[PATCH] arm: pj4: check cpu id for pj4 cp0 access
Russell King - ARM Linux
linux at arm.linux.org.uk
Fri Jun 14 04:47:32 EDT 2013
On Fri, Jun 14, 2013 at 04:42:16AM -0400, Chao Xie wrote:
> @@ -79,6 +82,15 @@ static void __init pj4_cp_access_write(u32 value)
> static int __init pj4_cp0_init(void)
> {
> u32 cp_access;
> + u32 cpuid;
> +
> + __asm__ __volatile__ (
> + "mrc p15, 0, %0, c0, c0\n\t"
> + : "=r" (cpuid));
> +
> + /* If it is not a pj4 core, skip it. */
> + if ((cpuid & CORE_PJ4_MASK) != CORE_PJ4_ID)
> + return 0;
We have a macro for reading the CPU ID, see asm/cputype.h
More information about the linux-arm-kernel
mailing list