Loading...
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>
12
13 .arch armv7-a
14
15ENTRY(secondary_trampoline)
16 movw r2, #:lower16:cpu1start_addr
17 movt r2, #:upper16:cpu1start_addr
18
19 /* The socfpga VT cannot handle a 0xC0000000 page offset when loading
20 the cpu1start_addr, we bit clear it. Tested on HW and VT. */
21 bic r2, r2, #0x40000000
22
23 ldr r0, [r2]
24 ldr r1, [r0]
25 bx r1
26
27ENTRY(secondary_trampoline_end)
28
29ENTRY(socfpga_secondary_startup)
30 bl v7_invalidate_l1
31 b secondary_startup
32ENDPROC(socfpga_secondary_startup)
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>
12#include <asm/memory.h>
13#include <asm/assembler.h>
14
15 .arch armv7-a
16 .arm
17
18ENTRY(secondary_trampoline)
19 /* 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.
23 */
24ARM_BE8(setend be)
25 adr r0, 1f
26 ldmia r0, {r1, r2}
27 sub r2, r2, #PAGE_OFFSET
28 ldr r3, [r2]
29 ldr r4, [r3]
30ARM_BE8(rev r4, r4)
31 bx r4
32
33 .align
341: .long .
35 .long socfpga_cpu1start_addr
36ENTRY(secondary_trampoline_end)