diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2019-09-12 13:07:12 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2019-10-02 08:42:20 +0200 |
commit | 19c24e2f0121742095698823034b525461aca1d4 (patch) | |
tree | 9ce4185117576a66f54e6c3d81b9f9536e8cc780 /arch/arm | |
parent | fd72834fa74b604efc7b2af5f40ccab5796b79e7 (diff) | |
download | barebox-19c24e2f0121742095698823034b525461aca1d4.tar.gz barebox-19c24e2f0121742095698823034b525461aca1d4.tar.xz |
ARM: start: Allow to pass machine type as boarddata
Allow to pass a machine type number as directly as boarddata. This makes
it easy for non device tree boards to pass a machine type and to
identify themselves during runtime.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/cpu/start.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/arch/arm/cpu/start.c b/arch/arm/cpu/start.c index c97b2770c4..44d974e40e 100644 --- a/arch/arm/cpu/start.c +++ b/arch/arm/cpu/start.c @@ -193,7 +193,19 @@ __noreturn void barebox_non_pbl_start(unsigned long membase, uint32_t totalsize = 0; const char *name; - if (blob_is_fdt(boarddata)) { + if ((unsigned long)boarddata < 8192) { + struct barebox_arm_boarddata *bd; + uint32_t machine_type = (unsigned long)boarddata; + unsigned long mem = arm_mem_boarddata(membase, endmem, + sizeof(*bd)); + pr_debug("found machine type %d in boarddata\n", + machine_type); + bd = barebox_boarddata = (void *)mem; + barebox_boarddata_size = sizeof(*bd); + bd->magic = BAREBOX_ARM_BOARDDATA_MAGIC; + bd->machine = machine_type; + malloc_end = mem; + } else if (blob_is_fdt(boarddata)) { totalsize = get_unaligned_be32(boarddata + 4); name = "DTB"; } else if (blob_is_compressed_fdt(boarddata)) { |