Thomas Gleixner | d2912cb | 2019-06-04 10:11:33 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Dinh Nguyen | 9c4566a | 2012-10-25 10:41:39 -0600 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (c) 2003 ARM Limited |
| 4 | * Copyright (c) u-boot contributors |
| 5 | * Copyright (c) 2012 Pavel Machek <pavel@denx.de> |
Dinh Nguyen | 9c4566a | 2012-10-25 10:41:39 -0600 | [diff] [blame] | 6 | */ |
| 7 | #include <linux/linkage.h> |
| 8 | #include <linux/init.h> |
Dinh Nguyen | 3a4356c | 2014-10-01 05:44:48 -0500 | [diff] [blame] | 9 | #include <asm/memory.h> |
Ben Dooks | bf55e0a | 2015-03-25 11:27:47 +0000 | [diff] [blame] | 10 | #include <asm/assembler.h> |
Dinh Nguyen | 9c4566a | 2012-10-25 10:41:39 -0600 | [diff] [blame] | 11 | |
Pavel Machek | ad208d0 | 2012-10-27 01:00:53 +0200 | [diff] [blame] | 12 | .arch armv7-a |
Sascha Hauer | 5616f36 | 2016-04-20 13:34:31 +0000 | [diff] [blame] | 13 | .arm |
Dinh Nguyen | 9c4566a | 2012-10-25 10:41:39 -0600 | [diff] [blame] | 14 | |
Dinh Nguyen | 9c4566a | 2012-10-25 10:41:39 -0600 | [diff] [blame] | 15 | ENTRY(secondary_trampoline) |
Dinh Nguyen | 3a4356c | 2014-10-01 05:44:48 -0500 | [diff] [blame] | 16 | /* CPU1 will always fetch from 0x0 when it is brought out of reset. |
| 17 | * Thus, we can just subtract the PAGE_OFFSET to get the physical |
| 18 | * address of &cpu1start_addr. This would not work for platforms |
| 19 | * where the physical memory does not start at 0x0. |
Ben Dooks | bf55e0a | 2015-03-25 11:27:47 +0000 | [diff] [blame] | 20 | */ |
| 21 | ARM_BE8(setend be) |
Dinh Nguyen | 3a4356c | 2014-10-01 05:44:48 -0500 | [diff] [blame] | 22 | adr r0, 1f |
| 23 | ldmia r0, {r1, r2} |
| 24 | sub r2, r2, #PAGE_OFFSET |
| 25 | ldr r3, [r2] |
| 26 | ldr r4, [r3] |
Ben Dooks | bf55e0a | 2015-03-25 11:27:47 +0000 | [diff] [blame] | 27 | ARM_BE8(rev r4, r4) |
Dinh Nguyen | 3a4356c | 2014-10-01 05:44:48 -0500 | [diff] [blame] | 28 | bx r4 |
Dinh Nguyen | 9c4566a | 2012-10-25 10:41:39 -0600 | [diff] [blame] | 29 | |
Dinh Nguyen | 3a4356c | 2014-10-01 05:44:48 -0500 | [diff] [blame] | 30 | .align |
| 31 | 1: .long . |
| 32 | .long socfpga_cpu1start_addr |
Dinh Nguyen | 9c4566a | 2012-10-25 10:41:39 -0600 | [diff] [blame] | 33 | ENTRY(secondary_trampoline_end) |