Page MenuHomeFreeBSD

Add support of ARM CMN-600 controller, PMU access functions only. Add support of PMU counters of ARM CMN-600 controller.
ClosedPublic

Authored by ray on Oct 5 2021, 3:10 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Jun 18, 10:03 PM
Unknown Object (File)
Thu, May 30, 5:56 PM
Unknown Object (File)
May 14 2024, 7:56 AM
Unknown Object (File)
May 13 2024, 10:57 AM
Unknown Object (File)
May 11 2024, 8:43 AM
Unknown Object (File)
May 9 2024, 5:58 PM
Unknown Object (File)
Apr 27 2024, 4:38 PM
Unknown Object (File)
Apr 27 2024, 12:19 PM

Details

Summary
  • Add support of ARM CMN-600 controller, PMU access functions only.
  • Add support of PMU counters of ARM CMN-600 controller.

Sponsored By: ARM

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

ray requested review of this revision.Oct 5 2021, 3:10 PM
ray added reviewers: pmc, mhorne.
sys/arm64/arm64/cmn600.c
60

Is this used?

340

There's no need to case the return value of malloc.

348–351

Why are these function pointers?

391–399

What are these magic numbers?

sys/dev/hwpmc/hwpmc_cmn600.c
423–425

What are these magic numbers?

819

No need for this, KASSERT handles INVARIANTS not being defined.

Is this missing a change to attach these files to the build?

A few minor comments, I've looked mainly at hwpmc_cmn600.c so far.

sys/arm64/arm64/cmn600.c
70

What does this do?

71

cleanup the RF_SHAREABLE if not needed.

sys/dev/hwpmc/hwpmc_cmn600.c
51–59

At least a couple of these fields appear to be unused.

63

Is cmn600_pmcdesc[1] ever used? I don't see it.

66

From its usage it looks like this holds the number of cmn600 units in the system? If so cmn600_nunits would be a clearer name.

69

unused cpu argument?

95

Please use named macros for this kind of thing. It is impossible to tell what this bit means.

164
355–356

This check is not needed, I removed the others in R10:0e78510b7549.

384–390

Does these comments apply?

486

?

729

cmn600_pmc_nunits() expands to return (cmn600_npmcs)... so what is this assignment?

sys/arm64/arm64/cmn600.c
60

Removed. Thanks!

70

First include second. Second only used to calculate offset, so no need to map it.
Thanks

71

Done. Thanks!

340

Done. Thanks!

348–351

OOP like mode :)
At least names are shorter on usage.

391–399

Done. Thanks!

sys/dev/hwpmc/hwpmc_cmn600.c
51–59

Done. Thanks!

63

Copy-paste :)
Fixed.
Thanks!

423–425

They are indeed magic :)
I've add a comment to describe magicness:
Calculate pmevcnt0_input_sel based on list in Table 3-794.

486

Ahh, it is steps taken from manual. First one done in HW side.
Comment updated.

729

It's an external call from hwpmc_cmn600 to cmn600 driver :)
cmn600_npmcs static in both cases.

sys/dev/hwpmc/hwpmc_cmn600.c
69

Removed. Thanks!

95

Done. Thanks!

164

Done. Thanks!

355–356

Done. Thanks!

384–390

Done. Thanks!

819

Done. Thanks!

mhorne added inline comments.
sys/dev/hwpmc/hwpmc_cmn600.c
493–494
This revision is now accepted and ready to land.Nov 23 2021, 7:42 PM