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)
Mon, Jan 6, 10:33 AM
Unknown Object (File)
Fri, Jan 3, 4:31 PM
Unknown Object (File)
Fri, Jan 3, 5:51 AM
Unknown Object (File)
Fri, Dec 27, 4:15 AM
Unknown Object (File)
Dec 14 2024, 4:23 PM
Unknown Object (File)
Dec 6 2024, 10:09 AM
Unknown Object (File)
Dec 4 2024, 6:25 AM
Unknown Object (File)
Dec 4 2024, 6:24 AM

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
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 41969
Build 38857: arc lint + arc unit

Event Timeline

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

Is this used?

339

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

347–350

Why are these function pointers?

390–398

What are these magic numbers?

sys/dev/hwpmc/hwpmc_cmn600.c
422–424

What are these magic numbers?

818

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
69

What does this do?

70

cleanup the RF_SHAREABLE if not needed.

sys/dev/hwpmc/hwpmc_cmn600.c
50–58

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

62

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

65

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.

68

unused cpu argument?

94

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

163
354–355

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

383–389

Does these comments apply?

485

?

728

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

sys/arm64/arm64/cmn600.c
59

Removed. Thanks!

69

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

70

Done. Thanks!

339

Done. Thanks!

347–350

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

390–398

Done. Thanks!

sys/dev/hwpmc/hwpmc_cmn600.c
50–58

Done. Thanks!

62

Copy-paste :)
Fixed.
Thanks!

422–424

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

485

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

728

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

sys/dev/hwpmc/hwpmc_cmn600.c
68

Removed. Thanks!

94

Done. Thanks!

163

Done. Thanks!

354–355

Done. Thanks!

383–389

Done. Thanks!

818

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