Jeff Ohlstein | e14411d | 2010-11-30 13:06:36 -0800 | [diff] [blame] | 1 | /* |
Jeff Ohlstein | e14411d | 2010-11-30 13:06:36 -0800 | [diff] [blame] | 2 | * Copyright (c) 2003 ARM Limited |
| 3 | * All Rights Reserved |
Duy Truong | 790f06d | 2013-02-13 16:38:12 -0800 | [diff] [blame] | 4 | * Copyright (c) 2010, 2012 The Linux Foundation. All rights reserved. |
Jeff Ohlstein | e14411d | 2010-11-30 13:06:36 -0800 | [diff] [blame] | 5 | * |
| 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 Boyd | b29750d | 2012-02-21 01:21:32 -0800 | [diff] [blame] | 13 | __CPUINIT |
Jeff Ohlstein | e14411d | 2010-11-30 13:06:36 -0800 | [diff] [blame] | 14 | |
| 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 Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 19 | * |
| 20 | * This is executing in physical space with cache's off. |
Jeff Ohlstein | e14411d | 2010-11-30 13:06:36 -0800 | [diff] [blame] | 21 | */ |
| 22 | ENTRY(msm_secondary_startup) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 23 | 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 |
| 29 | pen: |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 30 | ldr r7, [r6] @ pen_rel has cpu to remove from reset |
| 31 | cmp r7, r0 @ are we lucky? |
Jeff Ohlstein | e14411d | 2010-11-30 13:06:36 -0800 | [diff] [blame] | 32 | 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 Herring | 8e0f549 | 2012-01-12 08:46:23 -0600 | [diff] [blame] | 39 | ENDPROC(msm_secondary_startup) |
Jeff Ohlstein | e14411d | 2010-11-30 13:06:36 -0800 | [diff] [blame] | 40 | |
Jeff Ohlstein | e14411d | 2010-11-30 13:06:36 -0800 | [diff] [blame] | 41 | 1: .long . |
| 42 | .long pen_release |