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, Mar 25, 1:52 AM
Unknown Object (File)
Feb 19 2024, 4:52 PM
Unknown Object (File)
Jan 17 2024, 10:18 PM
Unknown Object (File)
Jan 16 2024, 6:06 PM
Unknown Object (File)
Jan 14 2024, 7:55 PM
Unknown Object (File)
Jan 7 2024, 3:24 AM
Unknown Object (File)
Dec 24 2023, 9:48 AM
Unknown Object (File)
Dec 20 2023, 2:47 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
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 42423
Build 39311: 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
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
492–493
This revision is now accepted and ready to land.Nov 23 2021, 7:42 PM