I'm doing some experiments with a ARM Cortex A-8 device running Linux kernel.
I can access and read the value of the L2 cache lockdown register without any problems:
asm volatile ("mrc p15, 1, %0, c9, c0, 0" : "=r" (i));
When I try to write the value back, the device immediately crashes:
asm volatile ("mcr p15, 1, %0, c9, c0, 0" : : "r" (i));
The code is running as a kernel module so there are no permission issues.
I wonder if I'm missing anything special before writing that register value?