This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Failed to access PMCCNTR_EL0 on RK3399 Board

https://github.com/jerinjacobk/armv8_pmu_cycle_counter_el0

I got that  application in user-space can not access "PMCCNTR_EL0" commonly. So, I cross-compiled kernel-space code in github project above and insmod gennerated ko file on my rk3399 board.

However, I still could not access PMCCNTR_EL0 regsiter after that. I wonder that how could I fix it?

Parents
  • Hi

    My name is Stephen and I work at Arm.

    PMCCNTR_EL0 is in the Core power domain.  Is it possible that the Linux kernel is powering down the core that you are trying to count cycles on?  That could explain why you are sometimes unable to access PMCCNTR_EL0.

    developer.arm.com/.../PMCCNTR-EL0--Performance-Monitors-Cycle-Counter
    says PMCCNTR_EL0 is accessible through the external debug interface as follows:
        When IsCorePowered(), !DoubleLockStatus(), !OSLockStatus(), AllowExternalPMUAccess() and SoftwareLockStatus() accesses to this register are RO.
        When IsCorePowered(), !DoubleLockStatus(), !OSLockStatus(), AllowExternalPMUAccess() and !SoftwareLockStatus() accesses to this register are RW.
        Otherwise accesses to this register generate an error response.

    Hope this helps

    Stephen

Reply
  • Hi

    My name is Stephen and I work at Arm.

    PMCCNTR_EL0 is in the Core power domain.  Is it possible that the Linux kernel is powering down the core that you are trying to count cycles on?  That could explain why you are sometimes unable to access PMCCNTR_EL0.

    developer.arm.com/.../PMCCNTR-EL0--Performance-Monitors-Cycle-Counter
    says PMCCNTR_EL0 is accessible through the external debug interface as follows:
        When IsCorePowered(), !DoubleLockStatus(), !OSLockStatus(), AllowExternalPMUAccess() and SoftwareLockStatus() accesses to this register are RO.
        When IsCorePowered(), !DoubleLockStatus(), !OSLockStatus(), AllowExternalPMUAccess() and !SoftwareLockStatus() accesses to this register are RW.
        Otherwise accesses to this register generate an error response.

    Hope this helps

    Stephen

Children