diff options
author | Peter Hoyes | 2021-11-11 09:26:02 +0000 |
---|---|---|
committer | Tom Rini | 2022-01-04 22:48:48 -0500 |
commit | 2661397464e47d45cd25bbc5e6b9de7594b3268d (patch) | |
tree | 8e898c3878143d62624a25df30cf33e77bb4e8c6 | |
parent | 90f262a6951f530ec60bf78a681b117f625cbe3f (diff) |
vexpress64: Enable OF_CONTROL and OF_BOARD for VExpress64
Capture x0 in lowlevel_init.S as potential fdt address. Modify
board_fdt_blob_setup to use fdt address from either vexpress_aemv8.h
or lowlevel_init.S.
Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
-rw-r--r-- | board/armltd/vexpress64/Makefile | 2 | ||||
-rw-r--r-- | board/armltd/vexpress64/lowlevel_init.S | 12 | ||||
-rw-r--r-- | board/armltd/vexpress64/vexpress64.c | 26 |
3 files changed, 39 insertions, 1 deletions
diff --git a/board/armltd/vexpress64/Makefile b/board/armltd/vexpress64/Makefile index 868dc4f629f..1878fbed4ec 100644 --- a/board/armltd/vexpress64/Makefile +++ b/board/armltd/vexpress64/Makefile @@ -3,5 +3,5 @@ # (C) Copyright 2000-2004 # Wolfgang Denk, DENX Software Engineering, wd@denx.de. -obj-y := vexpress64.o +obj-y := vexpress64.o lowlevel_init.o obj-$(CONFIG_TARGET_VEXPRESS64_JUNO) += pcie.o diff --git a/board/armltd/vexpress64/lowlevel_init.S b/board/armltd/vexpress64/lowlevel_init.S new file mode 100644 index 00000000000..3dcfb85d0e9 --- /dev/null +++ b/board/armltd/vexpress64/lowlevel_init.S @@ -0,0 +1,12 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * (C) Copyright 2021 Arm Limited + */ + +.global save_boot_params +save_boot_params: + + adr x8, prior_stage_fdt_address + str x0, [x8] + + b save_boot_params_ret diff --git a/board/armltd/vexpress64/vexpress64.c b/board/armltd/vexpress64/vexpress64.c index d2f307cca5d..d17b463be57 100644 --- a/board/armltd/vexpress64/vexpress64.c +++ b/board/armltd/vexpress64/vexpress64.c @@ -85,7 +85,15 @@ int dram_init_banksize(void) return 0; } +/* Assigned in lowlevel_init.S + * Push the variable into the .data section so that it + * does not get cleared later. + */ +unsigned long __section(".data") prior_stage_fdt_address; + #ifdef CONFIG_OF_BOARD + +#ifdef CONFIG_TARGET_VEXPRESS64_JUNO #define JUNO_FLASH_SEC_SIZE (256 * 1024) static phys_addr_t find_dtb_in_nor_flash(const char *partname) { @@ -130,9 +138,11 @@ static phys_addr_t find_dtb_in_nor_flash(const char *partname) return ~0; } +#endif void *board_fdt_blob_setup(int *err) { +#ifdef CONFIG_TARGET_VEXPRESS64_JUNO phys_addr_t fdt_rom_addr = find_dtb_in_nor_flash(CONFIG_JUNO_DTB_PART); *err = 0; @@ -142,6 +152,22 @@ void *board_fdt_blob_setup(int *err) } return (void *)fdt_rom_addr; +#endif + +#ifdef VEXPRESS_FDT_ADDR + if (fdt_magic(VEXPRESS_FDT_ADDR) == FDT_MAGIC) { + *err = 0; + return (void *)VEXPRESS_FDT_ADDR; + } +#endif + + if (fdt_magic(prior_stage_fdt_address) == FDT_MAGIC) { + *err = 0; + return (void *)prior_stage_fdt_address; + } + + *err = -ENXIO; + return NULL; } #endif |