blob: 979c1f8ccc978fa2ac428dbe7348468abf0e929c [file] [log] [blame]
Jeff Ohlsteine14411d2010-11-30 13:06:36 -08001/*
Jeff Ohlsteine14411d2010-11-30 13:06:36 -08002 * Copyright (c) 2003 ARM Limited
3 * All Rights Reserved
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004 * Copyright (c) 2010, Code Aurora Forum. All rights reserved.
Jeff Ohlsteine14411d2010-11-30 13:06:36 -08005 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#include <linux/linkage.h>
11#include <linux/init.h>
12
Jeff Ohlsteine14411d2010-11-30 13:06:36 -080013/*
14 * MSM specific entry point for secondary CPUs. This provides
15 * a "holding pen" into which all secondary cores are held until we're
16 * ready for them to initialise.
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070017 *
18 * This is executing in physical space with cache's off.
Jeff Ohlsteine14411d2010-11-30 13:06:36 -080019 */
20ENTRY(msm_secondary_startup)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070021 mrc p15, 0, r0, c0, c0, 5 @ MPIDR
22 and r0, r0, #15 @ What CPU am I
23 adr r4, 1f @ address of
24 ldmia r4, {r5, r6} @ load curr addr and pen_rel addr
25 sub r4, r4, r5 @ determine virtual/phys offsets
26 add r6, r6, r4 @ apply
27pen:
28 wfe
29 dsb @ ensure subsequent access is
30 @ after event
31
32 ldr r7, [r6] @ pen_rel has cpu to remove from reset
33 cmp r7, r0 @ are we lucky?
Jeff Ohlsteine14411d2010-11-30 13:06:36 -080034 bne pen
35
36 /*
37 * we've been released from the holding pen: secondary_stack
38 * should now contain the SVC stack for this core
39 */
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070040 mvn r7, #0 @ -1 to registers
41 str r7,[r6] @ back to the pen for ack
Jeff Ohlsteine14411d2010-11-30 13:06:36 -080042 b secondary_startup
43
Jeff Ohlsteine14411d2010-11-30 13:06:36 -0800441: .long .
45 .long pen_release