blob: 09d9fc30c8cabce736a89fe026539454b971a551 [file] [log] [blame]
Thomas Gleixnerd2912cb2019-06-04 10:11:33 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Russell King59ac59f2010-02-11 21:56:07 +00002/*
Russell King0462b442011-01-19 10:24:56 +00003 * linux/arch/arm/plat-versatile/headsmp.S
Russell King59ac59f2010-02-11 21:56:07 +00004 *
5 * Copyright (c) 2003 ARM Limited
6 * All Rights Reserved
Russell King59ac59f2010-02-11 21:56:07 +00007 */
8#include <linux/linkage.h>
9#include <linux/init.h>
Ben Dooks98dec912013-05-28 21:34:50 +010010#include <asm/assembler.h>
Russell King59ac59f2010-02-11 21:56:07 +000011
Russell King59ac59f2010-02-11 21:56:07 +000012/*
Russell King0462b442011-01-19 10:24:56 +000013 * Realview/Versatile Express specific entry point for secondary CPUs.
14 * This provides a "holding pen" into which all secondary cores are held
Russell King59ac59f2010-02-11 21:56:07 +000015 * until we're ready for them to initialise.
16 */
Russell King0462b442011-01-19 10:24:56 +000017ENTRY(versatile_secondary_startup)
Ben Dooks98dec912013-05-28 21:34:50 +010018 ARM_BE8(setend be)
Russell King59ac59f2010-02-11 21:56:07 +000019 mrc p15, 0, r0, c0, c0, 5
Lorenzo Pieralisi1585defb2013-01-22 10:56:40 +000020 bic r0, #0xff000000
Russell King59ac59f2010-02-11 21:56:07 +000021 adr r4, 1f
22 ldmia r4, {r5, r6}
23 sub r4, r4, r5
24 add r6, r6, r4
25pen: ldr r7, [r6]
26 cmp r7, r0
27 bne pen
28
29 /*
30 * we've been released from the holding pen: secondary_stack
31 * should now contain the SVC stack for this core
32 */
33 b secondary_startup
34
Dave Martin618d9c82010-11-30 13:05:10 +010035 .align
Russell King59ac59f2010-02-11 21:56:07 +0000361: .long .
Russell Kingd9b778e2018-12-13 12:54:26 +000037 .long versatile_cpu_release
Pawel Moll764a5792011-12-15 14:02:33 +000038ENDPROC(versatile_secondary_startup)