blob: 053742131bacf20595ead9d9cc41799f68ad0b36 [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
Stephen Boydb29750d2012-02-21 01:21:32 -08004 * Copyright (c) 2010, 2012 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
Stephen Boydb29750d2012-02-21 01:21:32 -080013__CPUINIT
Jeff Ohlsteine14411d2010-11-30 13:06:36 -080014
15/*
16 * MSM specific entry point for secondary CPUs. This provides
17 * a "holding pen" into which all secondary cores are held until we're
18 * ready for them to initialise.
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070019 *
20 * This is executing in physical space with cache's off.
Jeff Ohlsteine14411d2010-11-30 13:06:36 -080021 */
22ENTRY(msm_secondary_startup)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070023 mrc p15, 0, r0, c0, c0, 5 @ MPIDR
24 and r0, r0, #15 @ What CPU am I
25 adr r4, 1f @ address of
26 ldmia r4, {r5, r6} @ load curr addr and pen_rel addr
27 sub r4, r4, r5 @ determine virtual/phys offsets
28 add r6, r6, r4 @ apply
29pen:
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070030 ldr r7, [r6] @ pen_rel has cpu to remove from reset
31 cmp r7, r0 @ are we lucky?
Jeff Ohlsteine14411d2010-11-30 13:06:36 -080032 bne pen
33
34 /*
35 * we've been released from the holding pen: secondary_stack
36 * should now contain the SVC stack for this core
37 */
38 b secondary_startup
Rob Herring8e0f5492012-01-12 08:46:23 -060039ENDPROC(msm_secondary_startup)
Jeff Ohlsteine14411d2010-11-30 13:06:36 -080040
Jeff Ohlsteine14411d2010-11-30 13:06:36 -0800411: .long .
42 .long pen_release