简体   繁体   中英

What does opcode2 means in MRC instruction in case of big.LITTLE

I am using Cortex-A15-Cortex-A7 big.LITTLE arch soc.

In case of big.LITTLE processor's bL_head.S (in case of LITTLE initialization), MRC instruction is used as follows :-

mrc     p15, 0, r0, c0, c0, 5

Now, as per the MRC instruction detail,

MRC{cond} coproc, opcode1, Rd, CRn, CRm{, opcode2}

opcode2
is an optional coprocessor-specific opcode.
  1. I am not able to understand the meaning of 5. Here, as per my understanding, the CP is nothing but LITTLE processor cluster.
  2. Another doubt is, as per the instruction above, r0 content is copied into c0. Why there are two c0? What does another c0 is used for?

See this page for information on how to decode the cp15 system control register functionality.

According to the aforementioned page Op1 =0, CRn =c0, CRm =c0, Op2 =5 gives:

MPIDR   Multiprocessor Affinity Register

You can find more info on MPDIR here .

In basically all ARM processors, Coprocessor 15 is used for controlling various system functions of the current core. It does not refer to other processors in a multi-processor cluster. You can find the actual definitions of the CP15 registers in the core-specific Technical Reference Manual (TRM)

For example, looking up the combination you mention in the summary table of the Cortex-A7 TRM, we can see that it is MPIDR (Multiprocessor Affinity Register). And in fact, if you follow the link to the detailed description, you'll see exactly this instruction:

To access the MPIDR, read the CP15 registers with:
MRC p15, 0, <Rt>, c0, c0, 5; Read Multiprocessor Affinity Register

In your case, <Rt> is R0 . It is set to the value of MPIDR read from the hidden core register, and you can then interpret it as described in the TRM.

BTW, the specific combination of Opcode1, CRm, CRn and Opcode2 is processor-specific, but many of them are shared among the related cores. So in general you don't necessarily have to consult the TRM of the exact core you have, though of course it works best.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM