]> git.baikalelectronics.ru Git - uboot.git/commitdiff
riscv: Remove OF_PRIOR_STAGE from RISC-V boards
authorIlias Apalodimas <ilias.apalodimas@linaro.org>
Mon, 11 Oct 2021 21:00:13 +0000 (00:00 +0300)
committerTom Rini <trini@konsulko.com>
Mon, 18 Oct 2021 17:19:50 +0000 (13:19 -0400)
At some point back in 2018 prior_stage_fdt_address and OF_PRIOR_STAGE got
introduced,  in order to support a DTB handed over by an earlier stage boo
loader.  However we have another option in the Kconfig (OF_BOARD) which has
identical semantics.

On RISC-V some of the boards pick up the DTB from a1 and copy it in their
private gd_t.  Apart from that they copy it to prior_stage_fdt_address,  if
the Kconfig option is selected, which is unnecessary.

So let's switch the config option for those boards to OF_BOARD and define
the required board_fdt_blob_setup() for them.

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
16 files changed:
arch/riscv/cpu/cpu.c
arch/riscv/cpu/start.S
arch/riscv/dts/binman.dtsi
board/AndesTech/ax25-ae350/ax25-ae350.c
board/emulation/qemu-riscv/qemu-riscv.c
configs/ae350_rv32_defconfig
configs/ae350_rv32_spl_defconfig
configs/ae350_rv64_defconfig
configs/ae350_rv64_spl_defconfig
configs/qemu-riscv32_defconfig
configs/qemu-riscv32_smode_defconfig
configs/qemu-riscv32_spl_defconfig
configs/qemu-riscv64_defconfig
configs/qemu-riscv64_smode_defconfig
configs/qemu-riscv64_spl_defconfig
dts/Kconfig

index 8e49b6d7364d6a12ae557d8ea9e4ae57f445f182..8d90c5e6b8aa5ba8d5bd716727ef82705e0eca6f 100644 (file)
@@ -17,9 +17,6 @@
  * The variables here must be stored in the data section since they are used
  * before the bss section is available.
  */
-#ifdef CONFIG_OF_PRIOR_STAGE
-phys_addr_t prior_stage_fdt_address __section(".data");
-#endif
 #ifndef CONFIG_XIP
 u32 hart_lottery __section(".data") = 0;
 
index 308b0a97a58fa0ad81af39c9a9aa39c59ce849a6..76850ec9be2cf45668d9e097f0a1fcfec98d7961 100644 (file)
@@ -142,11 +142,6 @@ call_harts_early_init:
        bnez    tp, secondary_hart_loop
 #endif
 
-#ifdef CONFIG_OF_PRIOR_STAGE
-       la      t0, prior_stage_fdt_address
-       SREG    s1, 0(t0)
-#endif
-
        jal     board_init_f_init_reserve
 
        SREG    s1, GD_FIRMWARE_FDT_ADDR(gp)
index d26cfdb78a9ee824010d910b36e9364d2880c374..5757ef65ea4b2ecc7cb2ae9ffc5e98941c625ba8 100644 (file)
@@ -48,7 +48,7 @@
                                        };
                                };
 
-#ifndef CONFIG_OF_PRIOR_STAGE
+#ifndef CONFIG_OF_BOARD
                                @fdt-SEQ {
                                        description = "NAME";
                                        type = "flat_dt";
@@ -60,7 +60,7 @@
                        configurations {
                                default = "conf-1";
 
-#ifndef CONFIG_OF_PRIOR_STAGE
+#ifndef CONFIG_OF_BOARD
                                @conf-SEQ {
 #else
                                conf-1 {
@@ -68,7 +68,7 @@
                                        description = "NAME";
                                        firmware = "opensbi";
                                        loadables = "uboot";
-#ifndef CONFIG_OF_PRIOR_STAGE
+#ifndef CONFIG_OF_BOARD
                                        fdt = "fdt-SEQ";
 #endif
                                };
index 15da58a314536f423294673084b23415a047d8a9..b28894ed46559648f5269b4d20e3ad2b733e7e11 100644 (file)
@@ -21,7 +21,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-extern phys_addr_t prior_stage_fdt_address;
 /*
  * Miscellaneous platform dependent initializations
  */
@@ -57,7 +56,13 @@ ulong board_flash_get_legacy(ulong base, int banknum, flash_info_t *info)
 
 void *board_fdt_blob_setup(void)
 {
+#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
+       return NULL;
+#endif
 }
 
 int smc_init(void)
index dcfd3f20bee66176f43716361ab5f4f372cf7371..2a26e265ffb9b982e402f21d371f198c83f5f1f3 100644 (file)
@@ -14,6 +14,8 @@
 #include <virtio_types.h>
 #include <virtio.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 int board_init(void)
 {
        /*
@@ -69,3 +71,9 @@ int board_fit_config_name_match(const char *name)
        return 0;
 }
 #endif
+
+void *board_fdt_blob_setup(void)
+{
+       /* Stored the DTB address there during our init */
+       return (void *)(ulong)gd->arch.firmware_fdt_addr;
+}
index dab35f9bd613dbb999d35e2b3d69234a649c8099..2ee5bf18a6416271945f2b4753c02fe0cd2464a0 100644 (file)
@@ -17,7 +17,7 @@ CONFIG_CMD_SF_TEST=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_BOOTP_PREFER_SERVERIP=y
 CONFIG_CMD_CACHE=y
-CONFIG_OF_PRIOR_STAGE=y
+CONFIG_OF_BOARD=y
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
index 11063e9e1b7bfe1e25f2a6bf8d63af6a87dc8025..70935694229906ea8e431878f28b366676fd3414 100644 (file)
@@ -21,7 +21,7 @@ CONFIG_CMD_SF_TEST=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_BOOTP_PREFER_SERVERIP=y
 CONFIG_CMD_CACHE=y
-CONFIG_OF_PRIOR_STAGE=y
+CONFIG_OF_BOARD=y
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_BOOTP_SEND_HOSTNAME=y
index d2d0e31827cdee5b5bb3cadf25782abe0c40fe87..4b98531add06383c2f384c741152fba47f10c6f4 100644 (file)
@@ -18,7 +18,7 @@ CONFIG_CMD_SF_TEST=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_BOOTP_PREFER_SERVERIP=y
 CONFIG_CMD_CACHE=y
-CONFIG_OF_PRIOR_STAGE=y
+CONFIG_OF_BOARD=y
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
index 90511ae0bf5b096c08c76bf36e6e6ffcbe986bcb..3c072aa2a51bd1069c7a4dc6a872e05959213eab 100644 (file)
@@ -22,7 +22,7 @@ CONFIG_CMD_SF_TEST=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_BOOTP_PREFER_SERVERIP=y
 CONFIG_CMD_CACHE=y
-CONFIG_OF_PRIOR_STAGE=y
+CONFIG_OF_BOARD=y
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_BOOTP_SEND_HOSTNAME=y
index f49d49e1d3a6a06ddbbf2275485d8d3e3b50eca4..e77e3ed53a0ee6a114dbb116882242e381f61140 100644 (file)
@@ -11,6 +11,6 @@ CONFIG_DISPLAY_BOARDINFO=y
 CONFIG_CMD_BOOTEFI_SELFTEST=y
 CONFIG_CMD_NVEDIT_EFI=y
 # CONFIG_CMD_MII is not set
-CONFIG_OF_PRIOR_STAGE=y
+CONFIG_OF_BOARD=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM_MTD=y
index a009f623694c25c2f9f9b8e040327776005b274b..03787416f107aff2d6308596be8a26f085402026 100644 (file)
@@ -12,7 +12,7 @@ CONFIG_DISPLAY_BOARDINFO=y
 CONFIG_CMD_BOOTEFI_SELFTEST=y
 CONFIG_CMD_NVEDIT_EFI=y
 # CONFIG_CMD_MII is not set
-CONFIG_OF_PRIOR_STAGE=y
+CONFIG_OF_BOARD=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM_MTD=y
 CONFIG_SYSRESET_SBI=y
index aac6f389a7937f49ebafd78642b883f75eb1ad16..b0e655be416da83b7a74487dde7b75b89c4a4495 100644 (file)
@@ -14,7 +14,7 @@ CONFIG_DISPLAY_CPUINFO=y
 CONFIG_DISPLAY_BOARDINFO=y
 CONFIG_CMD_SBI=y
 # CONFIG_CMD_MII is not set
-CONFIG_OF_PRIOR_STAGE=y
+CONFIG_OF_BOARD=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM_MTD=y
 CONFIG_SYSRESET_SBI=y
index 506ac4382c74e718910bbecf2ad18c3fe38fd9e2..1f8dc2d20531defdaba8b3c602b23f24508fbff2 100644 (file)
@@ -12,6 +12,6 @@ CONFIG_DISPLAY_BOARDINFO=y
 CONFIG_CMD_BOOTEFI_SELFTEST=y
 CONFIG_CMD_NVEDIT_EFI=y
 # CONFIG_CMD_MII is not set
-CONFIG_OF_PRIOR_STAGE=y
+CONFIG_OF_BOARD=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM_MTD=y
index db2f21d8dbcadc02e98278486ed99685987674dc..bdcec1fdaba4201d060b097ccb9fea2b1db3ed14 100644 (file)
@@ -15,7 +15,7 @@ CONFIG_DISPLAY_BOARDINFO=y
 CONFIG_CMD_BOOTEFI_SELFTEST=y
 CONFIG_CMD_NVEDIT_EFI=y
 # CONFIG_CMD_MII is not set
-CONFIG_OF_PRIOR_STAGE=y
+CONFIG_OF_BOARD=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM_MTD=y
 CONFIG_SYSRESET_SBI=y
index cf33870135d51d1ebeede6583e58434fd0d0625b..9745c1a586a6c1251dbf74c5af9e4aad01444e1d 100644 (file)
@@ -15,7 +15,7 @@ CONFIG_DISPLAY_CPUINFO=y
 CONFIG_DISPLAY_BOARDINFO=y
 CONFIG_CMD_SBI=y
 # CONFIG_CMD_MII is not set
-CONFIG_OF_PRIOR_STAGE=y
+CONFIG_OF_BOARD=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM_MTD=y
 CONFIG_SYSRESET_SBI=y
index 0cc562c626e0304c4215be5b4eec6a3cc5fa2ca1..7a297b2f0e507a98ee6d76738279a908007a7afd 100644 (file)
@@ -118,7 +118,7 @@ config OF_EMBED
          Boards in the mainline U-Boot tree should not use it.
 
 config OF_BOARD
-       bool "Provided by the board at runtime"
+       bool "Provided by the board (e.g a previous loader) at runtime"
        depends on !SANDBOX
        help
          If this option is enabled, the device tree will be provided by