blob: c160fa3007e943be451b82318149a69dce4d7e54 [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
Sascha Hauer5616f362016-04-20 13:34:31 +000016 .arm
Dinh Nguyen9c4566a2012-10-25 10:41:39 -060017
Dinh Nguyen9c4566a2012-10-25 10:41:39 -060018ENTRY(secondary_trampoline)
Dinh Nguyen3a4356c2014-10-01 05:44:48 -050019 /* CPU1 will always fetch from 0x0 when it is brought out of reset.
20 * Thus, we can just subtract the PAGE_OFFSET to get the physical
21 * address of &cpu1start_addr. This would not work for platforms
22 * where the physical memory does not start at 0x0.
Ben Dooksbf55e0a2015-03-25 11:27:47 +000023 */
24ARM_BE8(setend be)
Dinh Nguyen3a4356c2014-10-01 05:44:48 -050025 adr r0, 1f
26 ldmia r0, {r1, r2}
27 sub r2, r2, #PAGE_OFFSET
28 ldr r3, [r2]
29 ldr r4, [r3]
Ben Dooksbf55e0a2015-03-25 11:27:47 +000030ARM_BE8(rev r4, r4)
Dinh Nguyen3a4356c2014-10-01 05:44:48 -050031 bx r4
Dinh Nguyen9c4566a2012-10-25 10:41:39 -060032
Dinh Nguyen3a4356c2014-10-01 05:44:48 -050033 .align
341: .long .
35 .long socfpga_cpu1start_addr
Dinh Nguyen9c4566a2012-10-25 10:41:39 -060036ENTRY(secondary_trampoline_end)