armembeddedcortex-a8cortex-a

How do you startup the additional cores on an Allwinner H5?


I am trying to figure out how to start cores other than core0 for a quad core allwinner h5. the C_RST_CTRL register (a.k.a CPU2 Reset Control Register) has four bits at the bottom that imply they are four reset controls. The lsbit is one the other three zeros implying setting those releases reset on the other cores, but I dont see that happening (nothing is running code I have left at address zero), at the same time zeroing that lsbit does stop core0 implying that it is a reset control. So I assume there are clock gates somewhere but I cannot find them.

The prcm registers which are not documented in the H5 docs but are on a sunxi wiki page for older allwinners do show what seem to be real PLL settings but the cpu enable registers are marked as A31 only and the cpu0 register(s) are not setup so that would imply that is not how you enable any cpu including 0 for this chip.

What am I missing?


Solution

  • For a pure bare metal solution look at sunxi_cpu_ops.c from the plat/sun50iw1p1 directory of https://github.com/apritzel/arm-trusted-firmware.git

    You need to deactivate various power clamps as well as clock gates.

    Alternatively, include the Arm Trusted Firmware code and enable a core by an SMC call:

    ldr x2,=entry_point
    mov x1,#corenumber
    mov x0,#0x03
    movk x0,#0x8400,lsl #16
    smc #0
    

    I've now confirmed this works on an H5.