blob: ac27fbd7c65ea3aa641d7b03e886cf938552d7e0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
/*
* Copyright (C) 2013 Jean-Christophe PLAGNIOL-VILLARD <plagnio@jcrosoft.com>
*
* GPLv2 only
*/
#include <common.h>
#include <linux/sizes.h>
#include <asm/barebox-arm-head.h>
#include <asm/barebox-arm.h>
#include <asm/system_info.h>
#include <asm/unaligned.h>
#include <linux/amba/sp804.h>
static inline void start_vexpress_common(void *internal_dt)
{
void *fdt = internal_dt + get_runtime_offset();
unsigned long membase, memsize = SZ_512M;
arm_cpu_lowlevel_init();
if (amba_is_arm_sp804(IOMEM(0x10011000)))
membase = 0x60000000;
else
membase = 0x80000000;
/* QEMU may put a DTB at the start of RAM */
if (IS_ENABLED(CONFIG_OFDEVICE) &&
get_unaligned_be32((void*)membase) == FDT_MAGIC) {
fdt = (void*)membase;
/*
* Need to move membase a bit as the PBL wants to relocate
* to the start of RAM, which would overwrite the DTB.
*/
membase += SZ_4M;
memsize -= SZ_4M;
}
barebox_arm_entry(membase, memsize, fdt);
}
extern char __dtb_vexpress_v2p_ca9_start[];
ENTRY_FUNCTION(start_vexpress_ca9, r0, r1, r2)
{
start_vexpress_common(__dtb_vexpress_v2p_ca9_start);
}
extern char __dtb_vexpress_v2p_ca15_start[];
ENTRY_FUNCTION(start_vexpress_ca15, r0, r1, r2)
{
start_vexpress_common(__dtb_vexpress_v2p_ca15_start);
}
|