This is a cache of https://discuss.96boards.org/t/any-method-or-materials-for-cci-550-on-hikey960/10308. It is a snapshot of the page at 2020-08-11T00:01:44.406+0000.
Any method or materials for CCI-550 on <strong>hikey</strong>960? - <strong>hikey</strong> 960 - <strong>96Boards</strong> Forum

Any method or materials for CCI-550 on hikey960?

Currently, I need to conduct some tests so that Arm CCI PMU would be helpful.

hikey960 is implemented with arm cci 550, however, here I get no materials about that. I’m wondering whether I can access the PMU of CCI-550 and do some test on hikey960.

Any ideas and hints can really be helpful! Thx guys!

BTW, I found this guy asking about that in hikey970 forum but without any response.https://discuss.96Boards.org/t/use-performance-monitoring-unit-of-cci-in-linux-kernel/7604

I am the guy from the mentioned question. I never managed to include the CCI into the device tree.

I managed to read the CCI counters with a bit of a “dirty” solution, but it works. I created a kernel module that directly interfaces the hardware and makes the CCI performance counters available to the user space.

Please have a look here: https://github.com/ma-rapp/hikey970

The kernel module is located in monitoring/modules/cci_pmu, a simple application to log counters to stdout is located in monitoring/cci_perfcounters.

Best,
Martin

Hi Martin!

Nice to see you in 960 forum and thx for you kindly and helpful reply!

Yep, I get no information about cci-550 in 960 device tree, too. And honestly, I’m not familiar with this area… Maybe one needs huge of debugging efforts to feasible the CCI_PMU API in Linux, so I just stop here.

However, your method can actually work since the CCI address is the same with 970 according to the soc manual. Besides, people who need to measure in such a low-level usually need to code their own concise measurement tool so I think your solution is not dirty at all!

Thanks for the convenience you offered me!

Best,
Zily

Hi, Martin! I set the PMCR.CEN and PMCR.EX to 1 to reset and enable all the CCI PMUs, however, the event control registers are always 0, showing it is disabled and event count registers return 0, too.

Is this caused by the NIDEN OR DBGEN signal? How about your situation on hikey970?

I’m looking forward to your kindly response :slight_smile:

Hi Zily,

Unfortunately, I don’t remember the details any more, it has been some time since I last worked on it. I remember that the code in the repo worked, I could trace many different counters and results looked reasonable. Just to summarize:

  1. enable the CCI (set PMCR_CEN)
  2. select and configure the correct event id
  3. enable the counter (write 1 to evnt_ctrl)

Forgetting any of these steps results in always reading 0s. However, I have no idea of the differences between 960 and 970, things may work differently there.

Best,
Martin

Thanks for your patient help! May there is some tiny bugs exist in my codes, sicne develop board like 960 and 970 usually enable the NIDEN | DBGEN sigal by default and what’s more, you made that on 970. so it would not be a big problem.

Have a nice day and thank you again Martin!