privilege mode access to coprocessor register

Hello,

I want the privilege and user mode access to the coprocessor register
C0, C1

I tried to write following for the c1 and c0 coprocessor

mrc p15, 0, r0, c1, c0, 2 @ read the coprocessor access control reg
    @@ write '1111' to bits 3,2,1,0 - which should enable user- and
    @@ privilege- mode access to the c1, c0 coprocessor
    orr r0, r0, #0x000f @
    mcr p15, 0, r0, c1, c0, 2 @ write back

With this much change, I can build the kernel without any error but
when I use the instruction "MRC p15. 0, r0, c1, c0, 1" in my code it
gives "illegal instruction error with this new uImage. so any one
reason?

Thanks,
Seema

Where do you write this code .? . Did you write your own kernel
module / a driver linked with kernel?

check the other MRC instruction being used in the arch specific .s
files for ARM .

Please check with the ARM documentation as well for the mnemonic
syntax.

~D

I wrote this code in the head.S file near arch/arm/boot/compressed/
head.S in line 520.

call_kernel: bl cache_clean_flush
                    bl cache_off

    mrc p15, 0, r0, c1, c0, 2 @ read the coprocessor access control
reg
    @@ write '1111' to bits 3,2,1,0 - which should enable user- and
    @@ privilege- mode access to the c1, c0 coprocessor
    orr r0, r0, #0x0f
    mcr p15, 0, r0, c1, c0, 2 @ write back

    mrc p15, 0, r0, c9, c14, 0 @ HGC: read the register...

    orr r0, #0x1
    mcr p15, 0, r0, c9, c14, 0 @ write back

        mov r0, #0 @ must be zero
        mov r1, r7 @ restore architecture number
        mov r2, r8 @ restore atags pointer
        mov pc, r4 @ call kernel
   @@ ....

Do any one know some other method?