aboutsummaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorIlias Apalodimas2021-10-26 09:12:33 +0300
committerTom Rini2021-10-27 16:38:26 -0400
commite7fb789612e39653f9f20ad08ad40896c7f61742 (patch)
tree2a16e7d6ebd67449b5c0fca8f7841d879564889f /board
parent670d657dfb6ede2957043dd0ac868297ac093857 (diff)
sandbox: Remove OF_HOSTFILE
OF_HOSTFILE is used on sandbox configs only. Although it's pretty unique and not causing any confusions, we are better of having simpler config options for the DTB. So let's replace that with the existing OF_BOARD. U-Boot would then have only three config options for the DTB origin. - OF_SEPARATE, build separately from U-Boot - OF_BOARD, board specific way of providing the DTB - OF_EMBED embedded in the u-boot binary(should not be used in production Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'board')
-rw-r--r--board/AndesTech/ax25-ae350/ax25-ae350.c4
-rw-r--r--board/Marvell/octeontx/board-fdt.c3
-rw-r--r--board/Marvell/octeontx2/board-fdt.c3
-rw-r--r--board/Marvell/octeontx2/board.c3
-rw-r--r--board/armltd/vexpress64/vexpress64.c7
-rw-r--r--board/broadcom/bcmstb/bcmstb.c3
-rw-r--r--board/emulation/qemu-arm/qemu-arm.c3
-rw-r--r--board/emulation/qemu-ppce500/qemu-ppce500.c3
-rw-r--r--board/emulation/qemu-riscv/qemu-riscv.c3
-rw-r--r--board/highbank/highbank.c3
-rw-r--r--board/raspberrypi/rpi/rpi.c8
-rw-r--r--board/sifive/unleashed/unleashed.c3
-rw-r--r--board/sifive/unmatched/unmatched.c3
-rw-r--r--board/socrates/socrates.c4
-rw-r--r--board/xen/xenguest_arm64/xenguest_arm64.c7
-rw-r--r--board/xilinx/common/board.c3
16 files changed, 44 insertions, 19 deletions
diff --git a/board/AndesTech/ax25-ae350/ax25-ae350.c b/board/AndesTech/ax25-ae350/ax25-ae350.c
index b28894ed465..5fb32fd0fdb 100644
--- a/board/AndesTech/ax25-ae350/ax25-ae350.c
+++ b/board/AndesTech/ax25-ae350/ax25-ae350.c
@@ -54,13 +54,15 @@ ulong board_flash_get_legacy(ulong base, int banknum, flash_info_t *info)
return 0;
}
-void *board_fdt_blob_setup(void)
+void *board_fdt_blob_setup(int *err)
{
+ *err = 0;
#if CONFIG_IS_ENABLED(OF_BOARD)
return (void *)(ulong)gd->arch.firmware_fdt_addr;
#elif CONFIG_IS_ENABLED(OF_SEPARATE)
return (void *)CONFIG_SYS_FDT_BASE;
#else
+ *err = -EINVAL;
return NULL;
#endif
}
diff --git a/board/Marvell/octeontx/board-fdt.c b/board/Marvell/octeontx/board-fdt.c
index 1db2a4a2675..e989c374f2b 100644
--- a/board/Marvell/octeontx/board-fdt.c
+++ b/board/Marvell/octeontx/board-fdt.c
@@ -301,7 +301,8 @@ int ft_board_setup(void *blob, struct bd_info *bd)
*
* @return FDT base address received from ATF in x1 register
*/
-void *board_fdt_blob_setup(void)
+void *board_fdt_blob_setup(int *err)
{
+ *err = 0;
return (void *)fdt_base_addr;
}
diff --git a/board/Marvell/octeontx2/board-fdt.c b/board/Marvell/octeontx2/board-fdt.c
index a4771af4c1d..e2cfe017e83 100644
--- a/board/Marvell/octeontx2/board-fdt.c
+++ b/board/Marvell/octeontx2/board-fdt.c
@@ -215,7 +215,8 @@ int ft_board_setup(void *blob, struct bd_info *bd)
*
* @return FDT base address received from ATF in x1 register
*/
-void *board_fdt_blob_setup(void)
+void *board_fdt_blob_setup(int *err)
{
+ *err = 0;
return (void *)fdt_base_addr;
}
diff --git a/board/Marvell/octeontx2/board.c b/board/Marvell/octeontx2/board.c
index 4e8cb839f5e..63aa2d61349 100644
--- a/board/Marvell/octeontx2/board.c
+++ b/board/Marvell/octeontx2/board.c
@@ -226,12 +226,13 @@ static int do_go_uboot(struct cmd_tbl *cmdtp, int flag, int argc,
uboot_entry_t entry;
ulong addr;
void *fdt;
+ int err;
if (argc < 2)
return CMD_RET_USAGE;
addr = hextoul(argv[1], NULL);
- fdt = board_fdt_blob_setup();
+ fdt = board_fdt_blob_setup(&err);
entry = (uboot_entry_t)addr;
flush_cache((ulong)addr, 1 << 20); /* 1MiB should be enough */
dcache_disable();
diff --git a/board/armltd/vexpress64/vexpress64.c b/board/armltd/vexpress64/vexpress64.c
index 2e4260286b5..d2f307cca5d 100644
--- a/board/armltd/vexpress64/vexpress64.c
+++ b/board/armltd/vexpress64/vexpress64.c
@@ -131,12 +131,15 @@ static phys_addr_t find_dtb_in_nor_flash(const char *partname)
return ~0;
}
-void *board_fdt_blob_setup(void)
+void *board_fdt_blob_setup(int *err)
{
phys_addr_t fdt_rom_addr = find_dtb_in_nor_flash(CONFIG_JUNO_DTB_PART);
- if (fdt_rom_addr == ~0UL)
+ *err = 0;
+ if (fdt_rom_addr == ~0UL) {
+ *err = -ENXIO;
return NULL;
+ }
return (void *)fdt_rom_addr;
}
diff --git a/board/broadcom/bcmstb/bcmstb.c b/board/broadcom/bcmstb/bcmstb.c
index 723ebda3bd2..07aeb0981c0 100644
--- a/board/broadcom/bcmstb/bcmstb.c
+++ b/board/broadcom/bcmstb/bcmstb.c
@@ -131,8 +131,9 @@ int board_late_init(void)
return 0;
}
-void *board_fdt_blob_setup(void)
+void *board_fdt_blob_setup(int *err)
{
+ *err = 0;
/* Stored the DTB address there during our init */
return (void *)prior_stage_fdt_address;
}
diff --git a/board/emulation/qemu-arm/qemu-arm.c b/board/emulation/qemu-arm/qemu-arm.c
index aa68bef469a..16d5a97167a 100644
--- a/board/emulation/qemu-arm/qemu-arm.c
+++ b/board/emulation/qemu-arm/qemu-arm.c
@@ -94,8 +94,9 @@ int dram_init_banksize(void)
return 0;
}
-void *board_fdt_blob_setup(void)
+void *board_fdt_blob_setup(int *err)
{
+ *err = 0;
/* QEMU loads a generated DTB for us at the start of RAM. */
return (void *)CONFIG_SYS_SDRAM_BASE;
}
diff --git a/board/emulation/qemu-ppce500/qemu-ppce500.c b/board/emulation/qemu-ppce500/qemu-ppce500.c
index 924cc02c4be..7d8ba34b258 100644
--- a/board/emulation/qemu-ppce500/qemu-ppce500.c
+++ b/board/emulation/qemu-ppce500/qemu-ppce500.c
@@ -333,8 +333,9 @@ u32 cpu_mask(void)
*
* @return virtual address of FDT received from QEMU in r3 register
*/
-void *board_fdt_blob_setup(void)
+void *board_fdt_blob_setup(int *err)
{
+ *err = 0;
return get_fdt_virt();
}
diff --git a/board/emulation/qemu-riscv/qemu-riscv.c b/board/emulation/qemu-riscv/qemu-riscv.c
index 2a26e265ffb..b0d9dd59b12 100644
--- a/board/emulation/qemu-riscv/qemu-riscv.c
+++ b/board/emulation/qemu-riscv/qemu-riscv.c
@@ -72,8 +72,9 @@ int board_fit_config_name_match(const char *name)
}
#endif
-void *board_fdt_blob_setup(void)
+void *board_fdt_blob_setup(int *err)
{
+ *err = 0;
/* Stored the DTB address there during our init */
return (void *)(ulong)gd->arch.firmware_fdt_addr;
}
diff --git a/board/highbank/highbank.c b/board/highbank/highbank.c
index ffb6fd922da..b5fa5101e88 100644
--- a/board/highbank/highbank.c
+++ b/board/highbank/highbank.c
@@ -111,8 +111,9 @@ int ft_board_setup(void *fdt, struct bd_info *bd)
}
#endif
-void *board_fdt_blob_setup(void)
+void *board_fdt_blob_setup(int *err)
{
+ *err = 0;
/*
* The ECME management processor loads the DTB from NOR flash
* into DRAM (at 4KB), where it gets patched to contain the
diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c
index 0c7d58d18db..55afaa54d9f 100644
--- a/board/raspberrypi/rpi/rpi.c
+++ b/board/raspberrypi/rpi/rpi.c
@@ -488,10 +488,14 @@ int board_init(void)
/*
* If the firmware passed a device tree use it for U-Boot.
*/
-void *board_fdt_blob_setup(void)
+void *board_fdt_blob_setup(int *err)
{
- if (fdt_magic(fw_dtb_pointer) != FDT_MAGIC)
+ *err = 0;
+ if (fdt_magic(fw_dtb_pointer) != FDT_MAGIC) {
+ *err = -ENXIO;
return NULL;
+ }
+
return (void *)fw_dtb_pointer;
}
diff --git a/board/sifive/unleashed/unleashed.c b/board/sifive/unleashed/unleashed.c
index e7d2332d8c9..3c3e0e1d0d1 100644
--- a/board/sifive/unleashed/unleashed.c
+++ b/board/sifive/unleashed/unleashed.c
@@ -114,8 +114,9 @@ int misc_init_r(void)
#endif
-void *board_fdt_blob_setup(void)
+void *board_fdt_blob_setup(int *err)
{
+ *err = 0;
if (IS_ENABLED(CONFIG_OF_SEPARATE)) {
if (gd->arch.firmware_fdt_addr)
return (ulong *)(uintptr_t)gd->arch.firmware_fdt_addr;
diff --git a/board/sifive/unmatched/unmatched.c b/board/sifive/unmatched/unmatched.c
index 93c452c57fc..4895909f8d6 100644
--- a/board/sifive/unmatched/unmatched.c
+++ b/board/sifive/unmatched/unmatched.c
@@ -11,8 +11,9 @@
#include <dm.h>
#include <asm/sections.h>
-void *board_fdt_blob_setup(void)
+void *board_fdt_blob_setup(int *err)
{
+ *err = 0;
if (IS_ENABLED(CONFIG_OF_SEPARATE)) {
if (gd->arch.firmware_fdt_addr)
return (ulong *)(uintptr_t)gd->arch.firmware_fdt_addr;
diff --git a/board/socrates/socrates.c b/board/socrates/socrates.c
index 3ba2fbbd560..a81cb7b2ba6 100644
--- a/board/socrates/socrates.c
+++ b/board/socrates/socrates.c
@@ -220,13 +220,15 @@ int ft_board_setup(void *blob, struct bd_info *bd)
#endif /* CONFIG_OF_BOARD_SETUP */
#if defined(CONFIG_OF_SEPARATE)
-void *board_fdt_blob_setup(void)
+void *board_fdt_blob_setup(int *err)
{
void *fw_dtb;
+ *err = 0;
fw_dtb = (void *)(CONFIG_SYS_TEXT_BASE - CONFIG_ENV_SECT_SIZE);
if (fdt_magic(fw_dtb) != FDT_MAGIC) {
printf("DTB is not passed via %x\n", (u32)fw_dtb);
+ *err = -ENXIO;
return NULL;
}
diff --git a/board/xen/xenguest_arm64/xenguest_arm64.c b/board/xen/xenguest_arm64/xenguest_arm64.c
index da0ddeefff3..6e10bba76b7 100644
--- a/board/xen/xenguest_arm64/xenguest_arm64.c
+++ b/board/xen/xenguest_arm64/xenguest_arm64.c
@@ -39,10 +39,13 @@ int board_init(void)
* x0 is the physical address of the device tree blob (dtb) in system RAM.
* This is stored in rom_pointer during low level init.
*/
-void *board_fdt_blob_setup(void)
+void *board_fdt_blob_setup(int *err)
{
- if (fdt_magic(rom_pointer[0]) != FDT_MAGIC)
+ *err = 0;
+ if (fdt_magic(rom_pointer[0]) != FDT_MAGIC) {
+ *err = -ENXIO;
return NULL;
+ }
return (void *)rom_pointer[0];
}
diff --git a/board/xilinx/common/board.c b/board/xilinx/common/board.c
index 9006bd3b4d2..78a5d0efa86 100644
--- a/board/xilinx/common/board.c
+++ b/board/xilinx/common/board.c
@@ -320,10 +320,11 @@ __maybe_unused int xilinx_read_eeprom(void)
}
#if defined(CONFIG_OF_BOARD) || defined(CONFIG_OF_SEPARATE)
-void *board_fdt_blob_setup(void)
+void *board_fdt_blob_setup(int *err)
{
void *fdt_blob;
+ *err = 0;
if (!IS_ENABLED(CONFIG_SPL_BUILD) &&
!IS_ENABLED(CONFIG_VERSAL_NO_DDR) &&
!IS_ENABLED(CONFIG_ZYNQMP_NO_DDR)) {