Merge branch '2021-10-18-OF_xxx-cleanup'
authorTom Rini <trini@konsulko.com>
Tue, 19 Oct 2021 13:07:07 +0000 (09:07 -0400)
committerTom Rini <trini@konsulko.com>
Tue, 19 Oct 2021 13:07:07 +0000 (09:07 -0400)
- Clean things up and rework such that we can drop OF_PRIOR_STAGE

23 files changed:
arch/arm/Kconfig
arch/riscv/cpu/cpu.c
arch/riscv/cpu/start.S
arch/riscv/dts/binman.dtsi
board/AndesTech/ax25-ae350/ax25-ae350.c
board/broadcom/bcmstb/bcmstb.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/bcm7260_defconfig
configs/bcm7445_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
include/fdtdec.h
lib/fdtdec.c
tools/binman/binman.rst

index d8c041a..504abca 100644 (file)
@@ -636,7 +636,6 @@ config ARCH_BCMSTB
        select DM
        select GPIO_EXTRA_HEADER
        select OF_CONTROL
-       select OF_PRIOR_STAGE
        imply CMD_DM
        help
          This enables support for Broadcom ARM-based set-top box
index 8e49b6d..8d90c5e 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 308b0a9..76850ec 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 d26cfdb..5757ef6 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 15da58a..b28894e 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 276e59b..723ebda 100644 (file)
@@ -130,3 +130,9 @@ int board_late_init(void)
 
        return 0;
 }
+
+void *board_fdt_blob_setup(void)
+{
+       /* Stored the DTB address there during our init */
+       return (void *)prior_stage_fdt_address;
+}
index dcfd3f2..2a26e26 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 dab35f9..2ee5bf1 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 11063e9..7093569 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 d2d0e31..4b98531 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 90511ae..3c072aa 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 ec58dd2..3afb909 100644 (file)
@@ -25,7 +25,7 @@ CONFIG_CMD_CACHE=y
 CONFIG_CMD_EXT2=y
 CONFIG_CMD_EXT4=y
 CONFIG_CMD_FS_GENERIC=y
-CONFIG_OF_PRIOR_STAGE=y
+CONFIG_OF_BOARD=y
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
index d5dd4b7..3726abd 100644 (file)
@@ -26,7 +26,7 @@ CONFIG_CMD_CACHE=y
 CONFIG_CMD_EXT2=y
 CONFIG_CMD_EXT4=y
 CONFIG_CMD_FS_GENERIC=y
-CONFIG_OF_PRIOR_STAGE=y
+CONFIG_OF_BOARD=y
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
index f49d49e..e77e3ed 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 a009f62..0378741 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 aac6f38..b0e655b 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 506ac43..1f8dc2d 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 db2f21d..bdcec1f 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 cf33870..9745c1a 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 0cc562c..fc41305 100644 (file)
@@ -22,7 +22,7 @@ config BINMAN
 config BINMAN_STANDALONE_FDT
        bool
        depends on BINMAN
-       default y if OF_BOARD || OF_PRIOR_STAGE
+       default y if OF_BOARD
        help
          This option tells U-Boot build system that a standalone device tree
          source is explicitly required when using binman to package U-Boot.
@@ -32,7 +32,7 @@ config BINMAN_STANDALONE_FDT
          directory for a specific board. Such device tree sources are built for
          OF_SEPARATE or OF_EMBED. However for a scenario like the board device
          tree blob is not provided in the U-Boot build tree, but fed to U-Boot
-         in the runtime, e.g.: in the OF_PRIOR_STAGE case that it is passed by
+         in the runtime, e.g.: in the OF_BOARD case that it is passed by
          a prior stage bootloader. For such scenario, a standalone device tree
          blob containing binman node to describe how to package U-Boot should
          be provided explicitly.
@@ -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
@@ -133,13 +133,6 @@ config OF_HOSTFILE
          This is only useful for Sandbox.  Use the -d flag to U-Boot to
          specify the file to read.
 
-config OF_PRIOR_STAGE
-       bool "Prior stage bootloader DTB for DT control"
-       help
-         If this option is enabled, the device tree used for DT
-         control will be read from a device tree binary, at a memory
-         location passed to U-Boot by the prior stage bootloader.
-
 endchoice
 
 config DEFAULT_DEVICE_TREE
index f94d1f4..2398142 100644 (file)
@@ -55,10 +55,6 @@ struct bd_info;
 #define SPL_BUILD      0
 #endif
 
-#ifdef CONFIG_OF_PRIOR_STAGE
-extern phys_addr_t prior_stage_fdt_address;
-#endif
-
 /*
  * Information about a resource. start is the first address of the resource
  * and end is the last address (inclusive). The length of the resource will
index ad090ea..959b337 100644 (file)
@@ -1613,8 +1613,6 @@ int fdtdec_setup(void)
                puts("Failed to read control FDT\n");
                return -1;
        }
-# elif defined(CONFIG_OF_PRIOR_STAGE)
-       gd->fdt_blob = (void *)(uintptr_t)prior_stage_fdt_address;
 # endif
 # ifndef CONFIG_SPL_BUILD
        /* Allow the early environment to override the fdt address */
index 09e7b57..614df54 100644 (file)
@@ -232,18 +232,18 @@ You can use other, more specific CONFIG options - see 'Automatic .dtsi
 inclusion' below.
 
 
-Using binman with OF_BOARD or OF_PRIOR_STAGE
+Using binman with OF_BOARD
 --------------------------------------------
 
 Normally binman is used with a board configured with OF_SEPARATE or OF_EMBED.
 This is a typical scenario where a device tree source that contains the binman
 node is provided in the arch/<arch>/dts directory for a specific board.
 
-However for a board configured with OF_BOARD or OF_PRIOR_STAGE, no device tree
-blob is provided in the U-Boot build phase hence the binman node information
-is not available. In order to support such use case, a new Kconfig option
-BINMAN_STANDALONE_FDT is introduced, to tell the build system that a standalone
-device tree blob containing binman node is explicitly required.
+However for a board configured with OF_BOARD, no device tree blob is provided
+in the U-Boot build phase hence the binman node information is not available.
+In order to support such use case, a new Kconfig option BINMAN_STANDALONE_FDT
+is introduced, to tell the build system that a standalone device tree blob
+containing binman node is explicitly required.
 
 Note there is a Kconfig option BINMAN_FDT which enables U-Boot run time to
 access information about binman entries, stored in the device tree in a binman
@@ -252,10 +252,6 @@ For the other OF_CONTROL methods, it's quite possible binman node is not
 available as binman is invoked during the build phase, thus this option is not
 turned on by default for these OF_CONTROL methods.
 
-See qemu-riscv64_spl_defconfig for an example of how binman is used with
-OF_PRIOR_STAGE to generate u-boot.itb image.
-
-
 Access to binman entry offsets at run time (symbols)
 ----------------------------------------------------