Dinh Nguyen | 9c4566a | 2012-10-25 10:41:39 -0600 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2003 ARM Limited |
| 3 | * Copyright (c) u-boot contributors |
| 4 | * Copyright (c) 2012 Pavel Machek <pavel@denx.de> |
| 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> |
Dinh Nguyen | 3a4356c | 2014-10-01 05:44:48 -0500 | [diff] [blame^] | 12 | #include <asm/memory.h> |
Dinh Nguyen | 9c4566a | 2012-10-25 10:41:39 -0600 | [diff] [blame] | 13 | |
Pavel Machek | ad208d0 | 2012-10-27 01:00:53 +0200 | [diff] [blame] | 14 | .arch armv7-a |
Dinh Nguyen | 9c4566a | 2012-10-25 10:41:39 -0600 | [diff] [blame] | 15 | |
Dinh Nguyen | 9c4566a | 2012-10-25 10:41:39 -0600 | [diff] [blame] | 16 | ENTRY(secondary_trampoline) |
Dinh Nguyen | 3a4356c | 2014-10-01 05:44:48 -0500 | [diff] [blame^] | 17 | /* CPU1 will always fetch from 0x0 when it is brought out of reset. |
| 18 | * Thus, we can just subtract the PAGE_OFFSET to get the physical |
| 19 | * address of &cpu1start_addr. This would not work for platforms |
| 20 | * where the physical memory does not start at 0x0. |
| 21 | */ |
| 22 | adr r0, 1f |
| 23 | ldmia r0, {r1, r2} |
| 24 | sub r2, r2, #PAGE_OFFSET |
| 25 | ldr r3, [r2] |
| 26 | ldr r4, [r3] |
| 27 | bx r4 |
Dinh Nguyen | 9c4566a | 2012-10-25 10:41:39 -0600 | [diff] [blame] | 28 | |
Dinh Nguyen | 3a4356c | 2014-10-01 05:44:48 -0500 | [diff] [blame^] | 29 | .align |
| 30 | 1: .long . |
| 31 | .long socfpga_cpu1start_addr |
Dinh Nguyen | 9c4566a | 2012-10-25 10:41:39 -0600 | [diff] [blame] | 32 | ENTRY(secondary_trampoline_end) |
Dinh Nguyen | d6dd735 | 2013-02-11 17:30:33 -0600 | [diff] [blame] | 33 | |
| 34 | ENTRY(socfpga_secondary_startup) |
| 35 | bl v7_invalidate_l1 |
| 36 | b secondary_startup |
| 37 | ENDPROC(socfpga_secondary_startup) |