arm_chainloader: fix core 0 detection for single-core machines
authorAlex Badea <vamposdecampos@gmail.com>
Tue, 30 Aug 2016 19:31:12 +0000 (22:31 +0300)
committerAlex Badea <vamposdecampos@gmail.com>
Tue, 30 Aug 2016 19:31:12 +0000 (22:31 +0300)
For example, a Pi 1 seem to have a MPIDR value of 0x410fb767.
Add a check similar to Linux: test that bit 31 (multiprocessor
extensions) is set and bit 30 (uniprocessor system) is clear
before looking at the core number.

Signed-off-by: Alex Badea <vamposdecampos@gmail.com>
arm_chainloader/start.s

index afe5b3c..19d8506 100644 (file)
@@ -43,10 +43,13 @@ _start:
 \r
 L_all_cores_start:\r
         /* check CPU id */\r
-        mrc p15, 0, r0, c0, c0, 5\r
-        ands r0, r0, #0x03\r
-        bne L_deadloop\r
-\r
+       mrc p15, 0, r0, c0, c0, 5       @ read MPIDR
+       and r3, r0, #0xc0000000         @ multiprocessing extensions and
+       teq r3, #0x80000000             @ not part of a uniprocessor system?
+       bne L_core0                     @ no, assume UP
+       ands r0, r0, #0x03              @ CPU 0?
+       bne L_deadloop                  @ if not, spin.
+
 L_core0:\r
        mov sp, #0x2000000\r
        b _firmware_rendezvous\r
This page took 0.02368 seconds and 4 git commands to generate.