blob: 5d94b7a2fb108dc1bc1c5fcdd4edfa80ab2c0c7f [file] [log] [blame]
Dinh Nguyen9c4566a2012-10-25 10:41:39 -06001/*
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 Nguyen3a4356c2014-10-01 05:44:48 -050012#include <asm/memory.h>
Ben Dooksbf55e0a2015-03-25 11:27:47 +000013#include <asm/assembler.h>
Dinh Nguyen9c4566a2012-10-25 10:41:39 -060014
Pavel Machekad208d02012-10-27 01:00:53 +020015 .arch armv7-a
Dinh Nguyen9c4566a2012-10-25 10:41:39 -060016
Dinh Nguyen9c4566a2012-10-25 10:41:39 -060017ENTRY(secondary_trampoline)
Dinh Nguyen3a4356c2014-10-01 05:44:48 -050018 /* CPU1 will always fetch from 0x0 when it is brought out of reset.
19 * Thus, we can just subtract the PAGE_OFFSET to get the physical
20 * address of &cpu1start_addr. This would not work for platforms
21 * where the physical memory does not start at 0x0.
Ben Dooksbf55e0a2015-03-25 11:27:47 +000022 */
23ARM_BE8(setend be)
Dinh Nguyen3a4356c2014-10-01 05:44:48 -050024 adr r0, 1f
25 ldmia r0, {r1, r2}
26 sub r2, r2, #PAGE_OFFSET
27 ldr r3, [r2]
28 ldr r4, [r3]
Ben Dooksbf55e0a2015-03-25 11:27:47 +000029ARM_BE8(rev r4, r4)
Dinh Nguyen3a4356c2014-10-01 05:44:48 -050030 bx r4
Dinh Nguyen9c4566a2012-10-25 10:41:39 -060031
Dinh Nguyen3a4356c2014-10-01 05:44:48 -050032 .align
331: .long .
34 .long socfpga_cpu1start_addr
Dinh Nguyen9c4566a2012-10-25 10:41:39 -060035ENTRY(secondary_trampoline_end)