Use Performance Monitoring Unit of CCI in Linux Kernel

Hello,

I need to use the PMU of the CCI-550 (not the PMU of the CPUs) on the HiKey 970 board in the Linux kernel.
As far as I understand, I need to enable the CCI-550 PMU feature in the kernel config and I need to add an entry to the devicetree similar to: https://www.kernel.org/doc/Documentation/devicetree/bindings/arm/cci.txt

However, I do not know the memory address and interrupt numbers of the CCI.
So far, I have:

cci {
    compatible = "arm,cci-550";
    reg = <0x0 0x???????? 0 0x1000>;
    ranges = <0x0 0x0 0x???????? 0x10000>;

    pmu {
         compatible = "arm,cci-550-pmu,r0";
         reg = <0x9000 0x5000>;
         interrupts = <0 ?? 4>,
                      <0 ?? 4>,
                      <0 ?? 4>,
                      <0 ?? 4>,
                      <0 ?? 4>;
    };
};

Can anybody tell me where to find the memory addresses for the CCI-550 (and PMU)? The Hi3670 data sheet does not contain such details.

Best regards,
Martin Rapp

Background: I need to profile applications on Android on the HiKey 970, especially their memory-behavior. Here, cache coherency plays a major role. I am using the linux/perf_event.h API, but the CCI-550 PMU is not (yet) listed in /sys/bus/event_source/devices. PMUs of the CPUs work fine.

Board based on the Kirin 970 - HI3670 Application Processor
More info: http://www.96boards.org/product/hikey970

Hi @mrapp,

Sorry, there is no public documentation available for making use of CCI PMU.

Just for future reference, in case anybody stumbles across this thread.

I never managed to include the CCI into the device tree.

I managed to read the CCI counters with a kernel module that directly interfaces the hardware and makes the CCI performance counters available to the user space.

The module and sample code to use it is available 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.