arm_chainloader: fix core 0 detection for single-core machines
[rpi-open-firmware.git] / arm_chainloader / start.s
1 /*=============================================================================
2 Copyright (C) 2016 Kristina Brooks
3 All rights reserved.
4
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License
7 as published by the Free Software Foundation; either version 2
8 of the License, or (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 FILE DESCRIPTION
16 ARM entry point.
17
18 This is where all cores start. For RPi1, only one core starts so we can jump
19 straight to the main bootloader. For later models, the first core jumps to the
20 bootloader. The other cores wait until SMP is enabled by the kernel later in
21 the boot process.
22
23 =============================================================================*/
24
25 .text
26 .globl _start
27 _start:
28 /* vectors */
29 b L_all_cores_start
30 nop
31 nop
32 nop
33 nop
34 nop
35 nop
36 nop
37
38 /* comm chan */
39 nop
40 nop
41 nop
42 nop
43
44 L_all_cores_start:
45 /* check CPU id */
46 mrc p15, 0, r0, c0, c0, 5 @ read MPIDR
47 and r3, r0, #0xc0000000 @ multiprocessing extensions and
48 teq r3, #0x80000000 @ not part of a uniprocessor system?
49 bne L_core0 @ no, assume UP
50 ands r0, r0, #0x03 @ CPU 0?
51 bne L_deadloop @ if not, spin.
52
53 L_core0:
54 mov sp, #0x2000000
55 b _firmware_rendezvous
56
57 L_deadloop:
58 b L_deadloop
This page took 0.06573 seconds and 4 git commands to generate.