김태윤
김태윤

Reputation: 21

How do I specify that my assembly code runs on a specific core using MPIDR_EL1 in ARMv8 architecture

I'm trying to understand bare-metal startup code for Raspberry-pi 4.

In that code, the first thing is to check if execution is done by core 0.

start:
    // Check processor ID is zero (executing on main core), else hang
    mrs     x1, mpidr_el1
    and     x1, x1, #3
    cbz     x1, 2f

I vaguely understand that the bits [1:0] of MPIDR distinguish cores 0-3 since raspi 4 has 4-cores of Cortex-A72, but I still haven't gained a detailed understanding of the MPIDR register.

I searched through manuals like the ARMv8 TRM, cortex-A72 TRM, and the internet too, but couldn't find a clear explanation of the MPIDR.

I'm particularly confused about the differences between aff0, aff1, and aff2, as well as the concept of cluster ID.

And, in cortex-a72 trm, It seems that the bits [1:0] of MPIDR can only represent four cores. If I have a processor like the Lx2160A with 16 cores, how can I determine which core I want to execute on?

Could you explain the concepts of aff0, aff1, and aff2 in the MPIDR, as well as the concept of cluster ID? Additionally, could you clarify how do I specify that my assembly code runs on a specific core?

Upvotes: 0

Views: 355

Answers (0)

Related Questions