This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM3358 读取 cycle counte 不是主频计数,也不是1/64(值有变化). (linux内核下每秒读取一次)

Other Parts Discussed in Thread: AM3358

初始化:
int32_t value = 1;
value |= 2;     // reset all counters to zero.
value |= 4;     // reset cycle counter to zero.
// program the performance-counter control-register:
asm volatile ("MCR p15, 0, %0, c9, c12, 0\t\n" :: "r"(value));
// enable all counters:
asm volatile ("MCR p15, 0, %0, c9, c12, 1\t\n" :: "r"(0x8000000f));
// clear overflows:
asm volatile ("MCR p15, 0, %0, c9, c12, 3\t\n" :: "r"(0x8000000f));

读取计数器:
asm volatile ("MRC p15, 0, %0, c9, c13, 0\t\n": "=r"(value));

怎么解决呢?最好有linux的验证代码,目前没有看出这里的代码有什么问题。