All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/7] migrate u-boot-rockchip.bin to binman and generate an image for SPI
@ 2022-07-22 11:34 Quentin Schulz
  2022-07-22 11:34 ` [PATCH v2 1/7] rockchip: generate idbloader.img content for u-boot-rockchip.bin with binman for ARM Quentin Schulz
                   ` (7 more replies)
  0 siblings, 8 replies; 19+ messages in thread
From: Quentin Schulz @ 2022-07-22 11:34 UTC (permalink / raw)
  Cc: bharat.gooty, rayagonda.kokatanur, sjg, philipp.tomsich,
	kever.yang, jagan, alpernebiyasak, andy.yan, hl, chenjh,
	manivannan.sadhasivam, nick, klaus.goger, jernej.skrabec,
	jbx6244, deepakdas.linux, linux, mail, peterwillcn, heiko,
	w.egorov, pbrobinson, sunil, ldevulder, akash, banglang.huang,
	matwey.kornilov, michael, xypron.glpk, u-boot, Quentin Schulz

From: Quentin Schulz <quentin.schulz@theobroma-systems.com>

This migrates the generation of u-boot-rockchip.bin from Makefile to binman
completely. There is therefore no idbloader.img anymore as it is created on
the fly by binman.

This also adds support for generating the same kind of image than
u-boot-rockchip.bin but for SPI flashes (specifically, a different image
type generated by mkimage is necessary, in addition to a different
offset in the storage medium).

This has been tested on Puma RK3399 with patches soon to be sent to the
ML.

This also helped removing the hardcoded value for the u-boot.itb offset
in u-boot-rockchip.bin which prevented Puma SoM to be migrated to it.

Cheers,
Quentin

v2:
 - removed patch 4/8 rockchip: pad u-boot-rockchip.bin correctly because
 it would break partitions table,
 - rebased on top of master, changes to patch 3/7 rockchip: remove
 unneeded CONFIG_SPL_PAD_TO compared to the RFC 3/8 rockchip: remove
 unneeded CONFIG_SPL_PAD_TO,

Quentin Schulz (7):
  rockchip: generate idbloader.img content for u-boot-rockchip.bin with
    binman for ARM
  rockchip: generate u-boot-rockchip.bin with binman for ARM64 boards
  rockchip: remove unneeded CONFIG_SPL_PAD_TO
  rockchip: simplify binman image dependencies addition to INPUTS
  rockchip: allow to build SPI images even without HAS_ROM option
  binman: add support for skipping file concatenation for mkimage
  rockchip: add u-boot-rockchip-spi.bin image for booting from SPI-NOR
    flash

 Makefile                                      | 39 ++-------------
 arch/arm/Kconfig                              |  2 +-
 arch/arm/dts/rk3288-u-boot.dtsi               |  2 +-
 arch/arm/dts/rk3399-u-boot.dtsi               |  2 +-
 arch/arm/dts/rockchip-u-boot.dtsi             | 49 ++++++++++++++++++-
 arch/arm/mach-rockchip/Kconfig                |  6 +--
 configs/chromebit_mickey_defconfig            |  1 -
 configs/chromebook_bob_defconfig              |  1 -
 configs/chromebook_jerry_defconfig            |  1 -
 configs/chromebook_kevin_defconfig            |  1 -
 configs/chromebook_minnie_defconfig           |  1 -
 configs/chromebook_speedy_defconfig           |  1 -
 configs/evb-px30_defconfig                    |  1 -
 configs/evb-px5_defconfig                     |  1 -
 configs/evb-rk3036_defconfig                  |  1 -
 configs/evb-rk3229_defconfig                  |  1 -
 configs/evb-rk3288_defconfig                  |  1 -
 configs/evb-rk3308_defconfig                  |  1 -
 configs/evb-rk3328_defconfig                  |  1 -
 configs/evb-rk3399_defconfig                  |  1 -
 configs/evb-rk3568_defconfig                  |  1 -
 configs/ficus-rk3399_defconfig                |  1 -
 configs/firefly-px30_defconfig                |  1 -
 configs/firefly-rk3288_defconfig              |  1 -
 configs/firefly-rk3399_defconfig              |  1 -
 configs/khadas-edge-captain-rk3399_defconfig  |  1 -
 configs/khadas-edge-rk3399_defconfig          |  1 -
 configs/khadas-edge-v-rk3399_defconfig        |  1 -
 configs/kylin-rk3036_defconfig                |  1 -
 configs/leez-rk3399_defconfig                 |  1 -
 configs/lion-rk3368_defconfig                 |  1 -
 configs/miqi-rk3288_defconfig                 |  1 -
 configs/mk808_defconfig                       |  1 -
 configs/nanopc-t4-rk3399_defconfig            |  1 -
 configs/nanopi-m4-2gb-rk3399_defconfig        |  1 -
 configs/nanopi-m4-rk3399_defconfig            |  1 -
 configs/nanopi-m4b-rk3399_defconfig           |  1 -
 configs/nanopi-neo4-rk3399_defconfig          |  1 -
 configs/nanopi-r2s-rk3328_defconfig           |  1 -
 configs/nanopi-r4s-rk3399_defconfig           |  1 -
 configs/odroid-go2_defconfig                  |  1 -
 configs/orangepi-rk3399_defconfig             |  1 -
 configs/phycore-rk3288_defconfig              |  1 -
 configs/pinebook-pro-rk3399_defconfig         |  1 -
 configs/popmetal-rk3288_defconfig             |  1 -
 configs/puma-rk3399_defconfig                 |  1 -
 configs/px30-core-ctouch2-of10-px30_defconfig |  1 -
 configs/px30-core-ctouch2-px30_defconfig      |  1 -
 configs/px30-core-edimm2.2-px30_defconfig     |  1 -
 configs/roc-cc-rk3308_defconfig               |  1 -
 configs/roc-cc-rk3328_defconfig               |  1 -
 configs/roc-pc-mezzanine-rk3399_defconfig     |  1 -
 configs/roc-pc-rk3399_defconfig               |  1 -
 configs/rock-pi-4-rk3399_defconfig            |  1 -
 configs/rock-pi-4c-rk3399_defconfig           |  1 -
 configs/rock-pi-e-rk3328_defconfig            |  1 -
 configs/rock-pi-n10-rk3399pro_defconfig       |  1 -
 configs/rock-pi-n8-rk3288_defconfig           |  1 -
 configs/rock2_defconfig                       |  1 -
 configs/rock64-rk3328_defconfig               |  1 -
 configs/rock960-rk3399_defconfig              |  1 -
 configs/rock_defconfig                        |  1 -
 configs/rockpro64-rk3399_defconfig            |  1 -
 configs/tinker-rk3288_defconfig               |  1 -
 configs/tinker-s-rk3288_defconfig             |  1 -
 configs/vyasa-rk3288_defconfig                |  1 -
 include/configs/rockchip-common.h             |  2 -
 tools/binman/entries.rst                      | 22 +++++++++
 tools/binman/etype/mkimage.py                 | 41 ++++++++++++++--
 69 files changed, 116 insertions(+), 109 deletions(-)

-- 
2.37.1


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH v2 1/7] rockchip: generate idbloader.img content for u-boot-rockchip.bin with binman for ARM
  2022-07-22 11:34 [PATCH v2 0/7] migrate u-boot-rockchip.bin to binman and generate an image for SPI Quentin Schulz
@ 2022-07-22 11:34 ` Quentin Schulz
  2022-07-23 12:07   ` Johan Jonker
  2022-07-28 13:26   ` Jagan Teki
  2022-07-22 11:35 ` [PATCH v2 2/7] rockchip: generate u-boot-rockchip.bin with binman for ARM64 boards Quentin Schulz
                   ` (6 subsequent siblings)
  7 siblings, 2 replies; 19+ messages in thread
From: Quentin Schulz @ 2022-07-22 11:34 UTC (permalink / raw)
  Cc: bharat.gooty, rayagonda.kokatanur, sjg, philipp.tomsich,
	kever.yang, jagan, alpernebiyasak, andy.yan, hl, chenjh,
	manivannan.sadhasivam, nick, klaus.goger, jernej.skrabec,
	jbx6244, deepakdas.linux, linux, mail, peterwillcn, heiko,
	w.egorov, pbrobinson, sunil, ldevulder, akash, banglang.huang,
	matwey.kornilov, michael, xypron.glpk, u-boot, Quentin Schulz,
	Quentin Schulz

From: Quentin Schulz <quentin.schulz@theobroma-systems.com>

idbloader.img content - currently created by way of Makefile - can be
created by binman directly.

So let's do that for Rockchip ARM platforms.

Cc: Quentin Schulz <foss+uboot@0leil.net>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
---
 Makefile                          |  2 +-
 arch/arm/dts/rockchip-u-boot.dtsi | 15 +++++++++++++--
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index d76ec69b52..f780bfe211 100644
--- a/Makefile
+++ b/Makefile
@@ -1005,7 +1005,7 @@ endif
 else
 ifeq ($(CONFIG_SPL),y)
 # Generate these inputs for binman which will create the output files
-INPUTS-y += idbloader.img u-boot.img
+INPUTS-y += u-boot.img
 endif
 endif
 endif
diff --git a/arch/arm/dts/rockchip-u-boot.dtsi b/arch/arm/dts/rockchip-u-boot.dtsi
index eae3ee715d..0362c97e0b 100644
--- a/arch/arm/dts/rockchip-u-boot.dtsi
+++ b/arch/arm/dts/rockchip-u-boot.dtsi
@@ -17,9 +17,20 @@
 		filename = "u-boot-rockchip.bin";
 		pad-byte = <0xff>;
 
-		blob {
-			filename = "idbloader.img";
+		mkimage {
+			args = "-n", CONFIG_SYS_SOC, "-T", "rksd";
+#ifndef CONFIG_TPL
+			u-boot-spl {
+			};
 		};
+#else
+			u-boot-tpl {
+			};
+		};
+
+		u-boot-spl {
+		};
+#endif
 
 		u-boot-img {
 			offset = <CONFIG_SPL_PAD_TO>;
-- 
2.37.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH v2 2/7] rockchip: generate u-boot-rockchip.bin with binman for ARM64 boards
  2022-07-22 11:34 [PATCH v2 0/7] migrate u-boot-rockchip.bin to binman and generate an image for SPI Quentin Schulz
  2022-07-22 11:34 ` [PATCH v2 1/7] rockchip: generate idbloader.img content for u-boot-rockchip.bin with binman for ARM Quentin Schulz
@ 2022-07-22 11:35 ` Quentin Schulz
  2022-07-22 11:35 ` [PATCH v2 3/7] rockchip: remove unneeded CONFIG_SPL_PAD_TO Quentin Schulz
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 19+ messages in thread
From: Quentin Schulz @ 2022-07-22 11:35 UTC (permalink / raw)
  Cc: bharat.gooty, rayagonda.kokatanur, sjg, philipp.tomsich,
	kever.yang, jagan, alpernebiyasak, andy.yan, hl, chenjh,
	manivannan.sadhasivam, nick, klaus.goger, jernej.skrabec,
	jbx6244, deepakdas.linux, linux, mail, peterwillcn, heiko,
	w.egorov, pbrobinson, sunil, ldevulder, akash, banglang.huang,
	matwey.kornilov, michael, xypron.glpk, u-boot, Quentin Schulz,
	Quentin Schulz

From: Quentin Schulz <quentin.schulz@theobroma-systems.com>

This allows to build u-boot-rockchip.bin binary with binman for Rockchip
ARM64 boards instead of the legacy Makefile way.

Cc: Quentin Schulz <foss+uboot@0leil.net>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
---
 Makefile                          | 28 ++--------------------------
 arch/arm/Kconfig                  |  2 +-
 arch/arm/dts/rockchip-u-boot.dtsi |  5 +++++
 3 files changed, 8 insertions(+), 27 deletions(-)

diff --git a/Makefile b/Makefile
index f780bfe211..7761a10b11 100644
--- a/Makefile
+++ b/Makefile
@@ -999,8 +999,7 @@ ifeq ($(CONFIG_ARCH_ROCKCHIP),y)
 # On ARM64 this target is produced by binman so we don't need this dep
 ifeq ($(CONFIG_ARM64),y)
 ifeq ($(CONFIG_SPL),y)
-# TODO: Get binman to generate this too
-INPUTS-y += u-boot-rockchip.bin
+INPUTS-y += u-boot.itb
 endif
 else
 ifeq ($(CONFIG_SPL),y)
@@ -1493,29 +1492,6 @@ OBJCOPYFLAGS_u-boot-with-spl.bin = -I binary -O binary \
 u-boot-with-spl.bin: $(SPL_IMAGE) $(SPL_PAYLOAD) FORCE
 	$(call if_changed,pad_cat)
 
-ifeq ($(CONFIG_ARCH_ROCKCHIP),y)
-
-# TPL + SPL
-ifeq ($(CONFIG_SPL)$(CONFIG_TPL),yy)
-MKIMAGEFLAGS_u-boot-tpl-rockchip.bin = -n $(CONFIG_SYS_SOC) -T rksd
-tpl/u-boot-tpl-rockchip.bin: tpl/u-boot-tpl.bin FORCE
-	$(call if_changed,mkimage)
-idbloader.img: tpl/u-boot-tpl-rockchip.bin spl/u-boot-spl.bin FORCE
-	$(call if_changed,cat)
-else
-MKIMAGEFLAGS_idbloader.img = -n $(CONFIG_SYS_SOC) -T rksd
-idbloader.img: spl/u-boot-spl.bin FORCE
-	$(call if_changed,mkimage)
-endif
-
-ifeq ($(CONFIG_ARM64),y)
-OBJCOPYFLAGS_u-boot-rockchip.bin = -I binary -O binary \
-	--pad-to=$(CONFIG_SPL_PAD_TO) --gap-fill=0xff
-u-boot-rockchip.bin: idbloader.img u-boot.itb FORCE
-	$(call if_changed,pad_cat)
-endif # CONFIG_ARM64
-
-endif # CONFIG_ARCH_ROCKCHIP
 
 ifeq ($(CONFIG_ARCH_LPC32XX)$(CONFIG_SPL),yy)
 MKIMAGEFLAGS_lpc32xx-spl.img = -T lpc32xximage -a $(CONFIG_SPL_TEXT_BASE)
@@ -2218,7 +2194,7 @@ CLEAN_FILES += include/bmp_logo.h include/bmp_logo_data.h \
 	       tools/version.h u-boot* MLO* SPL System.map fit-dtb.blob* \
 	       u-boot-ivt.img.log u-boot-dtb.imx.log SPL.log u-boot.imx.log \
 	       lpc32xx-* bl31.c bl31.elf bl31_*.bin image.map tispl.bin* \
-	       idbloader.img flash.bin flash.log defconfig keep-syms-lto.c \
+	       flash.bin flash.log defconfig keep-syms-lto.c \
 	       mkimage-out.spl.mkimage mkimage.spl.mkimage imx-boot.map \
 	       itb.fit.fit itb.fit.itb itb.map spl.map
 
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index d4fc83318a..64e90575d1 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1960,7 +1960,7 @@ config ARCH_STM32MP
 config ARCH_ROCKCHIP
 	bool "Support Rockchip SoCs"
 	select BLK
-	select BINMAN if SPL_OPTEE || (SPL && !ARM64)
+	select BINMAN if SPL_OPTEE || SPL
 	select DM
 	select DM_GPIO
 	select DM_I2C
diff --git a/arch/arm/dts/rockchip-u-boot.dtsi b/arch/arm/dts/rockchip-u-boot.dtsi
index 0362c97e0b..aef6c379e2 100644
--- a/arch/arm/dts/rockchip-u-boot.dtsi
+++ b/arch/arm/dts/rockchip-u-boot.dtsi
@@ -32,7 +32,12 @@
 		};
 #endif
 
+#ifdef CONFIG_ARM64
+		blob {
+			filename = "u-boot.itb";
+#else
 		u-boot-img {
+#endif
 			offset = <CONFIG_SPL_PAD_TO>;
 		};
 	};
-- 
2.37.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH v2 3/7] rockchip: remove unneeded CONFIG_SPL_PAD_TO
  2022-07-22 11:34 [PATCH v2 0/7] migrate u-boot-rockchip.bin to binman and generate an image for SPI Quentin Schulz
  2022-07-22 11:34 ` [PATCH v2 1/7] rockchip: generate idbloader.img content for u-boot-rockchip.bin with binman for ARM Quentin Schulz
  2022-07-22 11:35 ` [PATCH v2 2/7] rockchip: generate u-boot-rockchip.bin with binman for ARM64 boards Quentin Schulz
@ 2022-07-22 11:35 ` Quentin Schulz
  2022-07-22 11:35 ` [PATCH v2 4/7] rockchip: simplify binman image dependencies addition to INPUTS Quentin Schulz
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 19+ messages in thread
From: Quentin Schulz @ 2022-07-22 11:35 UTC (permalink / raw)
  Cc: bharat.gooty, rayagonda.kokatanur, sjg, philipp.tomsich,
	kever.yang, jagan, alpernebiyasak, andy.yan, hl, chenjh,
	manivannan.sadhasivam, nick, klaus.goger, jernej.skrabec,
	jbx6244, deepakdas.linux, linux, mail, peterwillcn, heiko,
	w.egorov, pbrobinson, sunil, ldevulder, akash, banglang.huang,
	matwey.kornilov, michael, xypron.glpk, u-boot, Quentin Schulz,
	Quentin Schulz

From: Quentin Schulz <quentin.schulz@theobroma-systems.com>

Since binman takes care of setting the appropriate offset for the SPL
payload, there's no need to use this variable anymore.

Moreover, it is technically incorrect since the padding is different
depending on whether the first stage bootloader is for a SPI flash or
MMC storage medium.

Finally, this allows to use the CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR
config option without redefining CONFIG_SPL_PAD_TO in other board header
files.

Cc: Quentin Schulz <foss+uboot@0leil.net>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
---

v2:
 - rebased on top of master, CONFIG_SPL_PAD_TO is now a Kconfig option
 so let's remove it from defconfigs,
 - the remove was done with: sed -i '/CONFIG_SPL_PAD_TO=0x7f8000/d'
 configs/*, since 0x7f8000 was the original default value for Rockchip
 boards and it seems none were overriding it before commit ca8a329a1b7f
 ("Convert CONFIG_SPL_PAD_TO et al to Kconfig"),

 arch/arm/dts/rockchip-u-boot.dtsi             | 2 +-
 configs/chromebit_mickey_defconfig            | 1 -
 configs/chromebook_bob_defconfig              | 1 -
 configs/chromebook_jerry_defconfig            | 1 -
 configs/chromebook_kevin_defconfig            | 1 -
 configs/chromebook_minnie_defconfig           | 1 -
 configs/chromebook_speedy_defconfig           | 1 -
 configs/evb-px30_defconfig                    | 1 -
 configs/evb-px5_defconfig                     | 1 -
 configs/evb-rk3036_defconfig                  | 1 -
 configs/evb-rk3229_defconfig                  | 1 -
 configs/evb-rk3288_defconfig                  | 1 -
 configs/evb-rk3308_defconfig                  | 1 -
 configs/evb-rk3328_defconfig                  | 1 -
 configs/evb-rk3399_defconfig                  | 1 -
 configs/evb-rk3568_defconfig                  | 1 -
 configs/ficus-rk3399_defconfig                | 1 -
 configs/firefly-px30_defconfig                | 1 -
 configs/firefly-rk3288_defconfig              | 1 -
 configs/firefly-rk3399_defconfig              | 1 -
 configs/khadas-edge-captain-rk3399_defconfig  | 1 -
 configs/khadas-edge-rk3399_defconfig          | 1 -
 configs/khadas-edge-v-rk3399_defconfig        | 1 -
 configs/kylin-rk3036_defconfig                | 1 -
 configs/leez-rk3399_defconfig                 | 1 -
 configs/lion-rk3368_defconfig                 | 1 -
 configs/miqi-rk3288_defconfig                 | 1 -
 configs/mk808_defconfig                       | 1 -
 configs/nanopc-t4-rk3399_defconfig            | 1 -
 configs/nanopi-m4-2gb-rk3399_defconfig        | 1 -
 configs/nanopi-m4-rk3399_defconfig            | 1 -
 configs/nanopi-m4b-rk3399_defconfig           | 1 -
 configs/nanopi-neo4-rk3399_defconfig          | 1 -
 configs/nanopi-r2s-rk3328_defconfig           | 1 -
 configs/nanopi-r4s-rk3399_defconfig           | 1 -
 configs/odroid-go2_defconfig                  | 1 -
 configs/orangepi-rk3399_defconfig             | 1 -
 configs/phycore-rk3288_defconfig              | 1 -
 configs/pinebook-pro-rk3399_defconfig         | 1 -
 configs/popmetal-rk3288_defconfig             | 1 -
 configs/puma-rk3399_defconfig                 | 1 -
 configs/px30-core-ctouch2-of10-px30_defconfig | 1 -
 configs/px30-core-ctouch2-px30_defconfig      | 1 -
 configs/px30-core-edimm2.2-px30_defconfig     | 1 -
 configs/roc-cc-rk3308_defconfig               | 1 -
 configs/roc-cc-rk3328_defconfig               | 1 -
 configs/roc-pc-mezzanine-rk3399_defconfig     | 1 -
 configs/roc-pc-rk3399_defconfig               | 1 -
 configs/rock-pi-4-rk3399_defconfig            | 1 -
 configs/rock-pi-4c-rk3399_defconfig           | 1 -
 configs/rock-pi-e-rk3328_defconfig            | 1 -
 configs/rock-pi-n10-rk3399pro_defconfig       | 1 -
 configs/rock-pi-n8-rk3288_defconfig           | 1 -
 configs/rock2_defconfig                       | 1 -
 configs/rock64-rk3328_defconfig               | 1 -
 configs/rock960-rk3399_defconfig              | 1 -
 configs/rock_defconfig                        | 1 -
 configs/rockpro64-rk3399_defconfig            | 1 -
 configs/tinker-rk3288_defconfig               | 1 -
 configs/tinker-s-rk3288_defconfig             | 1 -
 configs/vyasa-rk3288_defconfig                | 1 -
 include/configs/rockchip-common.h             | 2 --
 62 files changed, 1 insertion(+), 63 deletions(-)

diff --git a/arch/arm/dts/rockchip-u-boot.dtsi b/arch/arm/dts/rockchip-u-boot.dtsi
index aef6c379e2..fc28ce5187 100644
--- a/arch/arm/dts/rockchip-u-boot.dtsi
+++ b/arch/arm/dts/rockchip-u-boot.dtsi
@@ -38,7 +38,7 @@
 #else
 		u-boot-img {
 #endif
-			offset = <CONFIG_SPL_PAD_TO>;
+			offset = <((CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR - 64) * 512)>;
 		};
 	};
 };
diff --git a/configs/chromebit_mickey_defconfig b/configs/chromebit_mickey_defconfig
index dad3b36b99..8a18937564 100644
--- a/configs/chromebit_mickey_defconfig
+++ b/configs/chromebit_mickey_defconfig
@@ -25,7 +25,6 @@ CONFIG_DEFAULT_FDT_FILE="rk3288-veyron-mickey.dtb"
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_BOARD_EARLY_INIT_R=y
-CONFIG_SPL_PAD_TO=0x7f8000
 CONFIG_SPL_NO_BSS_LIMIT=y
 # CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
 # CONFIG_SPL_SHARES_INIT_SP_ADDR is not set
diff --git a/configs/chromebook_bob_defconfig b/configs/chromebook_bob_defconfig
index 938bc28a1d..7554c2a627 100644
--- a/configs/chromebook_bob_defconfig
+++ b/configs/chromebook_bob_defconfig
@@ -29,7 +29,6 @@ CONFIG_BLOBLIST=y
 CONFIG_BLOBLIST_ADDR=0x100000
 CONFIG_BLOBLIST_SIZE=0x1000
 CONFIG_SPL_MAX_SIZE=0x2e000
-CONFIG_SPL_PAD_TO=0x7f8000
 CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
 CONFIG_SPL_BSS_START_ADDR=0xff8e0000
 CONFIG_SPL_BSS_MAX_SIZE=0x10000
diff --git a/configs/chromebook_jerry_defconfig b/configs/chromebook_jerry_defconfig
index 35d546e631..3793d54c27 100644
--- a/configs/chromebook_jerry_defconfig
+++ b/configs/chromebook_jerry_defconfig
@@ -26,7 +26,6 @@ CONFIG_LOG=y
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_BOARD_EARLY_INIT_R=y
-CONFIG_SPL_PAD_TO=0x7f8000
 CONFIG_SPL_NO_BSS_LIMIT=y
 # CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
 # CONFIG_SPL_SHARES_INIT_SP_ADDR is not set
diff --git a/configs/chromebook_kevin_defconfig b/configs/chromebook_kevin_defconfig
index 6f88002f96..1367e8f9a5 100644
--- a/configs/chromebook_kevin_defconfig
+++ b/configs/chromebook_kevin_defconfig
@@ -30,7 +30,6 @@ CONFIG_BLOBLIST=y
 CONFIG_BLOBLIST_ADDR=0x100000
 CONFIG_BLOBLIST_SIZE=0x1000
 CONFIG_SPL_MAX_SIZE=0x2e000
-CONFIG_SPL_PAD_TO=0x7f8000
 CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
 CONFIG_SPL_BSS_START_ADDR=0xff8e0000
 CONFIG_SPL_BSS_MAX_SIZE=0x10000
diff --git a/configs/chromebook_minnie_defconfig b/configs/chromebook_minnie_defconfig
index 60fc528a8c..a736b25ccd 100644
--- a/configs/chromebook_minnie_defconfig
+++ b/configs/chromebook_minnie_defconfig
@@ -26,7 +26,6 @@ CONFIG_SILENT_CONSOLE=y
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_BOARD_EARLY_INIT_R=y
-CONFIG_SPL_PAD_TO=0x7f8000
 CONFIG_SPL_NO_BSS_LIMIT=y
 # CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
 # CONFIG_SPL_SHARES_INIT_SP_ADDR is not set
diff --git a/configs/chromebook_speedy_defconfig b/configs/chromebook_speedy_defconfig
index e6f03faa87..119d0a2836 100644
--- a/configs/chromebook_speedy_defconfig
+++ b/configs/chromebook_speedy_defconfig
@@ -26,7 +26,6 @@ CONFIG_SILENT_CONSOLE=y
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_BOARD_EARLY_INIT_R=y
-CONFIG_SPL_PAD_TO=0x7f8000
 CONFIG_SPL_NO_BSS_LIMIT=y
 # CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
 # CONFIG_SPL_SHARES_INIT_SP_ADDR is not set
diff --git a/configs/evb-px30_defconfig b/configs/evb-px30_defconfig
index abd5632708..6e14de3d2d 100644
--- a/configs/evb-px30_defconfig
+++ b/configs/evb-px30_defconfig
@@ -31,7 +31,6 @@ CONFIG_DEFAULT_FDT_FILE="rockchip/px30-evb.dtb"
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_MISC_INIT_R=y
 CONFIG_SPL_MAX_SIZE=0x20000
-CONFIG_SPL_PAD_TO=0x7f8000
 CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
 CONFIG_SPL_BSS_START_ADDR=0x4000000
 CONFIG_SPL_BSS_MAX_SIZE=0x4000
diff --git a/configs/evb-px5_defconfig b/configs/evb-px5_defconfig
index fc46154dfd..5d360a4235 100644
--- a/configs/evb-px5_defconfig
+++ b/configs/evb-px5_defconfig
@@ -35,7 +35,6 @@ CONFIG_DEFAULT_FDT_FILE="rockchip/rk3368-px5-evb.dtb"
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_ARCH_EARLY_INIT_R=y
 CONFIG_SPL_MAX_SIZE=0x40000
-CONFIG_SPL_PAD_TO=0x7f8000
 CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
 CONFIG_SPL_BSS_START_ADDR=0x400000
 CONFIG_SPL_BSS_MAX_SIZE=0x20000
diff --git a/configs/evb-rk3036_defconfig b/configs/evb-rk3036_defconfig
index 7bc535e68c..ce56873c92 100644
--- a/configs/evb-rk3036_defconfig
+++ b/configs/evb-rk3036_defconfig
@@ -25,7 +25,6 @@ CONFIG_DEFAULT_FDT_FILE="rk3036-evb.dtb"
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 # CONFIG_SPL_FRAMEWORK is not set
-CONFIG_SPL_PAD_TO=0x7f8000
 CONFIG_SPL_NO_BSS_LIMIT=y
 CONFIG_SPL_STACK_R=y
 CONFIG_CMD_GPT=y
diff --git a/configs/evb-rk3229_defconfig b/configs/evb-rk3229_defconfig
index ebf13c31c5..492774ebf6 100644
--- a/configs/evb-rk3229_defconfig
+++ b/configs/evb-rk3229_defconfig
@@ -29,7 +29,6 @@ CONFIG_DEFAULT_FDT_FILE="rk3229-evb.dtb"
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_SPL_MAX_SIZE=0x100000
-CONFIG_SPL_PAD_TO=0x7f8000
 CONFIG_SPL_NO_BSS_LIMIT=y
 # CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
 CONFIG_SPL_STACK_R=y
diff --git a/configs/evb-rk3288_defconfig b/configs/evb-rk3288_defconfig
index a2b88169c6..0adb356b49 100644
--- a/configs/evb-rk3288_defconfig
+++ b/configs/evb-rk3288_defconfig
@@ -26,7 +26,6 @@ CONFIG_USE_PREBOOT=y
 CONFIG_DEFAULT_FDT_FILE="rk3288-evb-rk808.dtb"
 CONFIG_SILENT_CONSOLE=y
 CONFIG_DISPLAY_BOARDINFO_LATE=y
-CONFIG_SPL_PAD_TO=0x7f8000
 CONFIG_SPL_NO_BSS_LIMIT=y
 # CONFIG_SPL_SHARES_INIT_SP_ADDR is not set
 CONFIG_SPL_STACK=0xff718000
diff --git a/configs/evb-rk3308_defconfig b/configs/evb-rk3308_defconfig
index eb17b3d5e1..7888243bc8 100644
--- a/configs/evb-rk3308_defconfig
+++ b/configs/evb-rk3308_defconfig
@@ -25,7 +25,6 @@ CONFIG_BOOTDELAY=0
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_SPL_MAX_SIZE=0x20000
-CONFIG_SPL_PAD_TO=0x7f8000
 CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
 CONFIG_SPL_BSS_START_ADDR=0x400000
 CONFIG_SPL_BSS_MAX_SIZE=0x2000
diff --git a/configs/evb-rk3328_defconfig b/configs/evb-rk3328_defconfig
index c81437300c..38df0f2c1e 100644
--- a/configs/evb-rk3328_defconfig
+++ b/configs/evb-rk3328_defconfig
@@ -28,7 +28,6 @@ CONFIG_DEFAULT_FDT_FILE="rockchip/rk3328-evb.dtb"
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_SPL_MAX_SIZE=0x40000
-CONFIG_SPL_PAD_TO=0x7f8000
 CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
 CONFIG_SPL_BSS_START_ADDR=0x2000000
 CONFIG_SPL_BSS_MAX_SIZE=0x2000
diff --git a/configs/evb-rk3399_defconfig b/configs/evb-rk3399_defconfig
index e3b7137c8f..7938a97296 100644
--- a/configs/evb-rk3399_defconfig
+++ b/configs/evb-rk3399_defconfig
@@ -17,7 +17,6 @@ CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x300000
 CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-evb.dtb"
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_SPL_MAX_SIZE=0x2e000
-CONFIG_SPL_PAD_TO=0x7f8000
 CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
 CONFIG_SPL_BSS_START_ADDR=0x400000
 CONFIG_SPL_BSS_MAX_SIZE=0x2000
diff --git a/configs/evb-rk3568_defconfig b/configs/evb-rk3568_defconfig
index 135f48ced0..a3781ccbef 100644
--- a/configs/evb-rk3568_defconfig
+++ b/configs/evb-rk3568_defconfig
@@ -27,7 +27,6 @@ CONFIG_DEFAULT_FDT_FILE="rockchip/rk3568-evb.dtb"
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_SPL_MAX_SIZE=0x20000
-CONFIG_SPL_PAD_TO=0x7f8000
 CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
 CONFIG_SPL_BSS_START_ADDR=0x4000000
 CONFIG_SPL_BSS_MAX_SIZE=0x4000
diff --git a/configs/ficus-rk3399_defconfig b/configs/ficus-rk3399_defconfig
index b2c530d338..f2b9c0d434 100644
--- a/configs/ficus-rk3399_defconfig
+++ b/configs/ficus-rk3399_defconfig
@@ -17,7 +17,6 @@ CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
 CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x300000
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_SPL_MAX_SIZE=0x2e000
-CONFIG_SPL_PAD_TO=0x7f8000
 CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
 CONFIG_SPL_BSS_START_ADDR=0xff8e0000
 CONFIG_SPL_BSS_MAX_SIZE=0x10000
diff --git a/configs/firefly-px30_defconfig b/configs/firefly-px30_defconfig
index e7e405fc50..08994532a3 100644
--- a/configs/firefly-px30_defconfig
+++ b/configs/firefly-px30_defconfig
@@ -32,7 +32,6 @@ CONFIG_DEFAULT_FDT_FILE="rockchip/px30-firefly.dtb"
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_MISC_INIT_R=y
 CONFIG_SPL_MAX_SIZE=0x20000
-CONFIG_SPL_PAD_TO=0x7f8000
 CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
 CONFIG_SPL_BSS_START_ADDR=0x4000000
 CONFIG_SPL_BSS_MAX_SIZE=0x4000
diff --git a/configs/firefly-rk3288_defconfig b/configs/firefly-rk3288_defconfig
index b3198bfa38..ba693e3333 100644
--- a/configs/firefly-rk3288_defconfig
+++ b/configs/firefly-rk3288_defconfig
@@ -22,7 +22,6 @@ CONFIG_USE_PREBOOT=y
 CONFIG_DEFAULT_FDT_FILE="rk3288-firefly.dtb"
 CONFIG_SILENT_CONSOLE=y
 CONFIG_DISPLAY_BOARDINFO_LATE=y
-CONFIG_SPL_PAD_TO=0x7f8000
 CONFIG_SPL_NO_BSS_LIMIT=y
 # CONFIG_SPL_SHARES_INIT_SP_ADDR is not set
 CONFIG_SPL_STACK=0xff718000
diff --git a/configs/firefly-rk3399_defconfig b/configs/firefly-rk3399_defconfig
index 036769c066..195c41c510 100644
--- a/configs/firefly-rk3399_defconfig
+++ b/configs/firefly-rk3399_defconfig
@@ -18,7 +18,6 @@ CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-firefly.dtb"
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_MISC_INIT_R=y
 CONFIG_SPL_MAX_SIZE=0x2e000
-CONFIG_SPL_PAD_TO=0x7f8000
 CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
 CONFIG_SPL_BSS_START_ADDR=0x400000
 CONFIG_SPL_BSS_MAX_SIZE=0x2000
diff --git a/configs/khadas-edge-captain-rk3399_defconfig b/configs/khadas-edge-captain-rk3399_defconfig
index 9a0171e4a8..81d4a0b21c 100644
--- a/configs/khadas-edge-captain-rk3399_defconfig
+++ b/configs/khadas-edge-captain-rk3399_defconfig
@@ -17,7 +17,6 @@ CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x300000
 CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-khadas-edge-captain.dtb"
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_SPL_MAX_SIZE=0x2e000
-CONFIG_SPL_PAD_TO=0x7f8000
 CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
 CONFIG_SPL_BSS_START_ADDR=0x400000
 CONFIG_SPL_BSS_MAX_SIZE=0x2000
diff --git a/configs/khadas-edge-rk3399_defconfig b/configs/khadas-edge-rk3399_defconfig
index 27f119931f..fd1fabfb71 100644
--- a/configs/khadas-edge-rk3399_defconfig
+++ b/configs/khadas-edge-rk3399_defconfig
@@ -17,7 +17,6 @@ CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x300000
 CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-khadas-edge.dtb"
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_SPL_MAX_SIZE=0x2e000
-CONFIG_SPL_PAD_TO=0x7f8000
 CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
 CONFIG_SPL_BSS_START_ADDR=0x400000
 CONFIG_SPL_BSS_MAX_SIZE=0x2000
diff --git a/configs/khadas-edge-v-rk3399_defconfig b/configs/khadas-edge-v-rk3399_defconfig
index de2b625120..0f22d8df56 100644
--- a/configs/khadas-edge-v-rk3399_defconfig
+++ b/configs/khadas-edge-v-rk3399_defconfig
@@ -17,7 +17,6 @@ CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x300000
 CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-khadas-edge-v.dtb"
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_SPL_MAX_SIZE=0x2e000
-CONFIG_SPL_PAD_TO=0x7f8000
 CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
 CONFIG_SPL_BSS_START_ADDR=0x400000
 CONFIG_SPL_BSS_MAX_SIZE=0x2000
diff --git a/configs/kylin-rk3036_defconfig b/configs/kylin-rk3036_defconfig
index 4f17de826c..bccac1146a 100644
--- a/configs/kylin-rk3036_defconfig
+++ b/configs/kylin-rk3036_defconfig
@@ -27,7 +27,6 @@ CONFIG_DEFAULT_FDT_FILE="rk3036-kylin.dtb"
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 # CONFIG_SPL_FRAMEWORK is not set
-CONFIG_SPL_PAD_TO=0x7f8000
 CONFIG_SPL_NO_BSS_LIMIT=y
 CONFIG_SPL_STACK_R=y
 CONFIG_CMD_GPT=y
diff --git a/configs/leez-rk3399_defconfig b/configs/leez-rk3399_defconfig
index 1e708ed3f9..f45a327944 100644
--- a/configs/leez-rk3399_defconfig
+++ b/configs/leez-rk3399_defconfig
@@ -17,7 +17,6 @@ CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x300000
 CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-leez-p710.dtb"
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_SPL_MAX_SIZE=0x2e000
-CONFIG_SPL_PAD_TO=0x7f8000
 CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
 CONFIG_SPL_BSS_START_ADDR=0x400000
 CONFIG_SPL_BSS_MAX_SIZE=0x2000
diff --git a/configs/lion-rk3368_defconfig b/configs/lion-rk3368_defconfig
index 294ff4238f..85124045df 100644
--- a/configs/lion-rk3368_defconfig
+++ b/configs/lion-rk3368_defconfig
@@ -33,7 +33,6 @@ CONFIG_DEFAULT_FDT_FILE="rockchip/rk3368-lion-haikou.dtb"
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_ARCH_EARLY_INIT_R=y
 CONFIG_SPL_MAX_SIZE=0x40000
-CONFIG_SPL_PAD_TO=0x7f8000
 CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
 CONFIG_SPL_BSS_START_ADDR=0x400000
 CONFIG_SPL_BSS_MAX_SIZE=0x20000
diff --git a/configs/miqi-rk3288_defconfig b/configs/miqi-rk3288_defconfig
index 34465f99a5..ca391cbdbc 100644
--- a/configs/miqi-rk3288_defconfig
+++ b/configs/miqi-rk3288_defconfig
@@ -22,7 +22,6 @@ CONFIG_USE_PREBOOT=y
 CONFIG_DEFAULT_FDT_FILE="rk3288-miqi.dtb"
 CONFIG_SILENT_CONSOLE=y
 CONFIG_DISPLAY_BOARDINFO_LATE=y
-CONFIG_SPL_PAD_TO=0x7f8000
 CONFIG_SPL_NO_BSS_LIMIT=y
 # CONFIG_SPL_SHARES_INIT_SP_ADDR is not set
 CONFIG_SPL_STACK=0xff718000
diff --git a/configs/mk808_defconfig b/configs/mk808_defconfig
index 7df44fb81f..9c08ef4785 100644
--- a/configs/mk808_defconfig
+++ b/configs/mk808_defconfig
@@ -34,7 +34,6 @@ CONFIG_DEFAULT_FDT_FILE="rk3066a-mk808.dtb"
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_BOARD_LATE_INIT=y
 CONFIG_SPL_MAX_SIZE=0x32000
-CONFIG_SPL_PAD_TO=0x7f8000
 CONFIG_SPL_NO_BSS_LIMIT=y
 # CONFIG_SPL_SHARES_INIT_SP_ADDR is not set
 CONFIG_SPL_STACK=0x1008ffff
diff --git a/configs/nanopc-t4-rk3399_defconfig b/configs/nanopc-t4-rk3399_defconfig
index 15ab46e5e1..79663d0d88 100644
--- a/configs/nanopc-t4-rk3399_defconfig
+++ b/configs/nanopc-t4-rk3399_defconfig
@@ -17,7 +17,6 @@ CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x300000
 CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-nanopc-t4.dtb"
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_SPL_MAX_SIZE=0x2e000
-CONFIG_SPL_PAD_TO=0x7f8000
 CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
 CONFIG_SPL_BSS_START_ADDR=0x400000
 CONFIG_SPL_BSS_MAX_SIZE=0x2000
diff --git a/configs/nanopi-m4-2gb-rk3399_defconfig b/configs/nanopi-m4-2gb-rk3399_defconfig
index 93dafb8642..b15e77498c 100644
--- a/configs/nanopi-m4-2gb-rk3399_defconfig
+++ b/configs/nanopi-m4-2gb-rk3399_defconfig
@@ -17,7 +17,6 @@ CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x300000
 CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-nanopi-m4-2gb.dtb"
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_SPL_MAX_SIZE=0x2e000
-CONFIG_SPL_PAD_TO=0x7f8000
 CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
 CONFIG_SPL_BSS_START_ADDR=0x400000
 CONFIG_SPL_BSS_MAX_SIZE=0x2000
diff --git a/configs/nanopi-m4-rk3399_defconfig b/configs/nanopi-m4-rk3399_defconfig
index b5d9f4184d..f537008370 100644
--- a/configs/nanopi-m4-rk3399_defconfig
+++ b/configs/nanopi-m4-rk3399_defconfig
@@ -17,7 +17,6 @@ CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x300000
 CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-nanopi-m4.dtb"
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_SPL_MAX_SIZE=0x2e000
-CONFIG_SPL_PAD_TO=0x7f8000
 CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
 CONFIG_SPL_BSS_START_ADDR=0x400000
 CONFIG_SPL_BSS_MAX_SIZE=0x2000
diff --git a/configs/nanopi-m4b-rk3399_defconfig b/configs/nanopi-m4b-rk3399_defconfig
index c4b51adb6e..6157f5295f 100644
--- a/configs/nanopi-m4b-rk3399_defconfig
+++ b/configs/nanopi-m4b-rk3399_defconfig
@@ -17,7 +17,6 @@ CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x300000
 CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-nanopi-m4b.dtb"
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_SPL_MAX_SIZE=0x2e000
-CONFIG_SPL_PAD_TO=0x7f8000
 CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
 CONFIG_SPL_BSS_START_ADDR=0x400000
 CONFIG_SPL_BSS_MAX_SIZE=0x2000
diff --git a/configs/nanopi-neo4-rk3399_defconfig b/configs/nanopi-neo4-rk3399_defconfig
index 2bc066887f..e66b625096 100644
--- a/configs/nanopi-neo4-rk3399_defconfig
+++ b/configs/nanopi-neo4-rk3399_defconfig
@@ -17,7 +17,6 @@ CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x300000
 CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-nanopi-neo4.dtb"
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_SPL_MAX_SIZE=0x2e000
-CONFIG_SPL_PAD_TO=0x7f8000
 CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
 CONFIG_SPL_BSS_START_ADDR=0x400000
 CONFIG_SPL_BSS_MAX_SIZE=0x2000
diff --git a/configs/nanopi-r2s-rk3328_defconfig b/configs/nanopi-r2s-rk3328_defconfig
index eabbd47f26..c8fcd972cd 100644
--- a/configs/nanopi-r2s-rk3328_defconfig
+++ b/configs/nanopi-r2s-rk3328_defconfig
@@ -29,7 +29,6 @@ CONFIG_DEFAULT_FDT_FILE="rockchip/rk3328-nanopi-r2s.dtb"
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_MISC_INIT_R=y
 CONFIG_SPL_MAX_SIZE=0x40000
-CONFIG_SPL_PAD_TO=0x7f8000
 CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
 CONFIG_SPL_BSS_START_ADDR=0x2000000
 CONFIG_SPL_BSS_MAX_SIZE=0x2000
diff --git a/configs/nanopi-r4s-rk3399_defconfig b/configs/nanopi-r4s-rk3399_defconfig
index 917fd3fd8e..51129a4357 100644
--- a/configs/nanopi-r4s-rk3399_defconfig
+++ b/configs/nanopi-r4s-rk3399_defconfig
@@ -17,7 +17,6 @@ CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x300000
 CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-nanopi-r4s.dtb"
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_SPL_MAX_SIZE=0x2e000
-CONFIG_SPL_PAD_TO=0x7f8000
 CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
 CONFIG_SPL_BSS_START_ADDR=0x400000
 CONFIG_SPL_BSS_MAX_SIZE=0x2000
diff --git a/configs/odroid-go2_defconfig b/configs/odroid-go2_defconfig
index 599ff0b89b..5d7a597136 100644
--- a/configs/odroid-go2_defconfig
+++ b/configs/odroid-go2_defconfig
@@ -35,7 +35,6 @@ CONFIG_DEFAULT_FDT_FILE="rockchip/rk3326-odroid-go2.dtb"
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_MISC_INIT_R=y
 CONFIG_SPL_MAX_SIZE=0x20000
-CONFIG_SPL_PAD_TO=0x7f8000
 CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
 CONFIG_SPL_BSS_START_ADDR=0x4000000
 CONFIG_SPL_BSS_MAX_SIZE=0x4000
diff --git a/configs/orangepi-rk3399_defconfig b/configs/orangepi-rk3399_defconfig
index e9626fb09a..de67873110 100644
--- a/configs/orangepi-rk3399_defconfig
+++ b/configs/orangepi-rk3399_defconfig
@@ -17,7 +17,6 @@ CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x300000
 CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-orangepi.dtb"
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_SPL_MAX_SIZE=0x2e000
-CONFIG_SPL_PAD_TO=0x7f8000
 CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
 CONFIG_SPL_BSS_START_ADDR=0x400000
 CONFIG_SPL_BSS_MAX_SIZE=0x2000
diff --git a/configs/phycore-rk3288_defconfig b/configs/phycore-rk3288_defconfig
index 519a705a40..16fe1e2cbb 100644
--- a/configs/phycore-rk3288_defconfig
+++ b/configs/phycore-rk3288_defconfig
@@ -23,7 +23,6 @@ CONFIG_DEFAULT_FDT_FILE="rk3288-phycore-rdk.dtb"
 CONFIG_SILENT_CONSOLE=y
 CONFIG_CONSOLE_MUX=y
 CONFIG_DISPLAY_BOARDINFO_LATE=y
-CONFIG_SPL_PAD_TO=0x7f8000
 CONFIG_SPL_NO_BSS_LIMIT=y
 # CONFIG_SPL_SHARES_INIT_SP_ADDR is not set
 CONFIG_SPL_STACK=0xff718000
diff --git a/configs/pinebook-pro-rk3399_defconfig b/configs/pinebook-pro-rk3399_defconfig
index 602bcb78cb..dac0a8bce9 100644
--- a/configs/pinebook-pro-rk3399_defconfig
+++ b/configs/pinebook-pro-rk3399_defconfig
@@ -23,7 +23,6 @@ CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-pinebook-pro.dtb"
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_MISC_INIT_R=y
 CONFIG_SPL_MAX_SIZE=0x2e000
-CONFIG_SPL_PAD_TO=0x7f8000
 CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
 CONFIG_SPL_BSS_START_ADDR=0x400000
 CONFIG_SPL_BSS_MAX_SIZE=0x2000
diff --git a/configs/popmetal-rk3288_defconfig b/configs/popmetal-rk3288_defconfig
index 7b024437c2..3d4d4919c5 100644
--- a/configs/popmetal-rk3288_defconfig
+++ b/configs/popmetal-rk3288_defconfig
@@ -23,7 +23,6 @@ CONFIG_DEFAULT_FDT_FILE="rk3288-popmetal.dtb"
 CONFIG_SILENT_CONSOLE=y
 CONFIG_CONSOLE_MUX=y
 CONFIG_DISPLAY_BOARDINFO_LATE=y
-CONFIG_SPL_PAD_TO=0x7f8000
 CONFIG_SPL_NO_BSS_LIMIT=y
 # CONFIG_SPL_SHARES_INIT_SP_ADDR is not set
 CONFIG_SPL_STACK=0xff718000
diff --git a/configs/puma-rk3399_defconfig b/configs/puma-rk3399_defconfig
index f902f144f2..72b9f9c5c7 100644
--- a/configs/puma-rk3399_defconfig
+++ b/configs/puma-rk3399_defconfig
@@ -23,7 +23,6 @@ CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-puma-haikou.dtb"
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_MISC_INIT_R=y
 CONFIG_SPL_MAX_SIZE=0x2e000
-CONFIG_SPL_PAD_TO=0x7f8000
 CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
 CONFIG_SPL_BSS_START_ADDR=0xff8e0000
 CONFIG_SPL_BSS_MAX_SIZE=0x10000
diff --git a/configs/px30-core-ctouch2-of10-px30_defconfig b/configs/px30-core-ctouch2-of10-px30_defconfig
index 7a526b8c07..f07a16cd46 100644
--- a/configs/px30-core-ctouch2-of10-px30_defconfig
+++ b/configs/px30-core-ctouch2-of10-px30_defconfig
@@ -32,7 +32,6 @@ CONFIG_DEFAULT_FDT_FILE="rockchip/px30-engicam-px30-core-ctouch2-of10.dtb"
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_MISC_INIT_R=y
 CONFIG_SPL_MAX_SIZE=0x20000
-CONFIG_SPL_PAD_TO=0x7f8000
 CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
 CONFIG_SPL_BSS_START_ADDR=0x4000000
 CONFIG_SPL_BSS_MAX_SIZE=0x4000
diff --git a/configs/px30-core-ctouch2-px30_defconfig b/configs/px30-core-ctouch2-px30_defconfig
index c836c7cb95..713dad53b5 100644
--- a/configs/px30-core-ctouch2-px30_defconfig
+++ b/configs/px30-core-ctouch2-px30_defconfig
@@ -32,7 +32,6 @@ CONFIG_DEFAULT_FDT_FILE="rockchip/px30-engicam-px30-core-ctouch2.dtb"
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_MISC_INIT_R=y
 CONFIG_SPL_MAX_SIZE=0x20000
-CONFIG_SPL_PAD_TO=0x7f8000
 CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
 CONFIG_SPL_BSS_START_ADDR=0x4000000
 CONFIG_SPL_BSS_MAX_SIZE=0x4000
diff --git a/configs/px30-core-edimm2.2-px30_defconfig b/configs/px30-core-edimm2.2-px30_defconfig
index 33529900b0..bcae01ba69 100644
--- a/configs/px30-core-edimm2.2-px30_defconfig
+++ b/configs/px30-core-edimm2.2-px30_defconfig
@@ -32,7 +32,6 @@ CONFIG_DEFAULT_FDT_FILE="rockchip/px30-engicam-px30-core-edimm2.2.dtb"
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_MISC_INIT_R=y
 CONFIG_SPL_MAX_SIZE=0x20000
-CONFIG_SPL_PAD_TO=0x7f8000
 CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
 CONFIG_SPL_BSS_START_ADDR=0x4000000
 CONFIG_SPL_BSS_MAX_SIZE=0x4000
diff --git a/configs/roc-cc-rk3308_defconfig b/configs/roc-cc-rk3308_defconfig
index 325b7cb182..e9802865ae 100644
--- a/configs/roc-cc-rk3308_defconfig
+++ b/configs/roc-cc-rk3308_defconfig
@@ -25,7 +25,6 @@ CONFIG_BOOTDELAY=0
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_SPL_MAX_SIZE=0x20000
-CONFIG_SPL_PAD_TO=0x7f8000
 CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
 CONFIG_SPL_BSS_START_ADDR=0x400000
 CONFIG_SPL_BSS_MAX_SIZE=0x2000
diff --git a/configs/roc-cc-rk3328_defconfig b/configs/roc-cc-rk3328_defconfig
index 43b90c7879..c729aff0c5 100644
--- a/configs/roc-cc-rk3328_defconfig
+++ b/configs/roc-cc-rk3328_defconfig
@@ -29,7 +29,6 @@ CONFIG_DEFAULT_FDT_FILE="rockchip/rk3328-roc-cc.dtb"
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_MISC_INIT_R=y
 CONFIG_SPL_MAX_SIZE=0x40000
-CONFIG_SPL_PAD_TO=0x7f8000
 CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
 CONFIG_SPL_BSS_START_ADDR=0x2000000
 CONFIG_SPL_BSS_MAX_SIZE=0x2000
diff --git a/configs/roc-pc-mezzanine-rk3399_defconfig b/configs/roc-pc-mezzanine-rk3399_defconfig
index f537a605e1..c18cffeaea 100644
--- a/configs/roc-pc-mezzanine-rk3399_defconfig
+++ b/configs/roc-pc-mezzanine-rk3399_defconfig
@@ -23,7 +23,6 @@ CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x300000
 CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-roc-pc-mezzanine.dtb"
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_SPL_MAX_SIZE=0x2e000
-CONFIG_SPL_PAD_TO=0x7f8000
 CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
 CONFIG_SPL_BSS_START_ADDR=0x400000
 CONFIG_SPL_BSS_MAX_SIZE=0x2000
diff --git a/configs/roc-pc-rk3399_defconfig b/configs/roc-pc-rk3399_defconfig
index a502e549fb..5a7260fe91 100644
--- a/configs/roc-pc-rk3399_defconfig
+++ b/configs/roc-pc-rk3399_defconfig
@@ -23,7 +23,6 @@ CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x300000
 CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-roc-pc.dtb"
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_SPL_MAX_SIZE=0x2e000
-CONFIG_SPL_PAD_TO=0x7f8000
 CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
 CONFIG_SPL_BSS_START_ADDR=0x400000
 CONFIG_SPL_BSS_MAX_SIZE=0x2000
diff --git a/configs/rock-pi-4-rk3399_defconfig b/configs/rock-pi-4-rk3399_defconfig
index cf2e9fbde3..4ad6a32119 100644
--- a/configs/rock-pi-4-rk3399_defconfig
+++ b/configs/rock-pi-4-rk3399_defconfig
@@ -19,7 +19,6 @@ CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-rock-pi-4b.dtb"
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_MISC_INIT_R=y
 CONFIG_SPL_MAX_SIZE=0x2e000
-CONFIG_SPL_PAD_TO=0x7f8000
 CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
 CONFIG_SPL_BSS_START_ADDR=0x400000
 CONFIG_SPL_BSS_MAX_SIZE=0x2000
diff --git a/configs/rock-pi-4c-rk3399_defconfig b/configs/rock-pi-4c-rk3399_defconfig
index fd5b25d77b..23968ba5bc 100644
--- a/configs/rock-pi-4c-rk3399_defconfig
+++ b/configs/rock-pi-4c-rk3399_defconfig
@@ -19,7 +19,6 @@ CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-rock-pi-4c.dtb"
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_MISC_INIT_R=y
 CONFIG_SPL_MAX_SIZE=0x2e000
-CONFIG_SPL_PAD_TO=0x7f8000
 CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
 CONFIG_SPL_BSS_START_ADDR=0x400000
 CONFIG_SPL_BSS_MAX_SIZE=0x2000
diff --git a/configs/rock-pi-e-rk3328_defconfig b/configs/rock-pi-e-rk3328_defconfig
index 7d95e171f7..caba0c8deb 100644
--- a/configs/rock-pi-e-rk3328_defconfig
+++ b/configs/rock-pi-e-rk3328_defconfig
@@ -30,7 +30,6 @@ CONFIG_DEFAULT_FDT_FILE="rockchip/rk3328-rock-pi-e.dtb"
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_MISC_INIT_R=y
 CONFIG_SPL_MAX_SIZE=0x40000
-CONFIG_SPL_PAD_TO=0x7f8000
 CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
 CONFIG_SPL_BSS_START_ADDR=0x2000000
 CONFIG_SPL_BSS_MAX_SIZE=0x2000
diff --git a/configs/rock-pi-n10-rk3399pro_defconfig b/configs/rock-pi-n10-rk3399pro_defconfig
index e63a77a253..72f4a1001f 100644
--- a/configs/rock-pi-n10-rk3399pro_defconfig
+++ b/configs/rock-pi-n10-rk3399pro_defconfig
@@ -21,7 +21,6 @@ CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399pro-rock-pi-n10.dtb"
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_MISC_INIT_R=y
 CONFIG_SPL_MAX_SIZE=0x2e000
-CONFIG_SPL_PAD_TO=0x7f8000
 CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
 CONFIG_SPL_BSS_START_ADDR=0x400000
 CONFIG_SPL_BSS_MAX_SIZE=0x2000
diff --git a/configs/rock-pi-n8-rk3288_defconfig b/configs/rock-pi-n8-rk3288_defconfig
index 87b050f5dc..d406581ad4 100644
--- a/configs/rock-pi-n8-rk3288_defconfig
+++ b/configs/rock-pi-n8-rk3288_defconfig
@@ -22,7 +22,6 @@ CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x100000
 CONFIG_USE_PREBOOT=y
 CONFIG_SILENT_CONSOLE=y
 CONFIG_DISPLAY_BOARDINFO_LATE=y
-CONFIG_SPL_PAD_TO=0x7f8000
 CONFIG_SPL_NO_BSS_LIMIT=y
 # CONFIG_SPL_SHARES_INIT_SP_ADDR is not set
 CONFIG_SPL_STACK=0xff718000
diff --git a/configs/rock2_defconfig b/configs/rock2_defconfig
index dcececdc31..0faf405ea6 100644
--- a/configs/rock2_defconfig
+++ b/configs/rock2_defconfig
@@ -23,7 +23,6 @@ CONFIG_DEFAULT_FDT_FILE="rk3288-rock2-square.dtb"
 CONFIG_SILENT_CONSOLE=y
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_DISPLAY_BOARDINFO_LATE=y
-CONFIG_SPL_PAD_TO=0x7f8000
 CONFIG_SPL_NO_BSS_LIMIT=y
 # CONFIG_SPL_SHARES_INIT_SP_ADDR is not set
 CONFIG_SPL_STACK=0xff718000
diff --git a/configs/rock64-rk3328_defconfig b/configs/rock64-rk3328_defconfig
index bc333a5e2a..234d96b0d7 100644
--- a/configs/rock64-rk3328_defconfig
+++ b/configs/rock64-rk3328_defconfig
@@ -29,7 +29,6 @@ CONFIG_DEFAULT_FDT_FILE="rockchip/rk3328-rock64.dtb"
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_MISC_INIT_R=y
 CONFIG_SPL_MAX_SIZE=0x40000
-CONFIG_SPL_PAD_TO=0x7f8000
 CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
 CONFIG_SPL_BSS_START_ADDR=0x2000000
 CONFIG_SPL_BSS_MAX_SIZE=0x2000
diff --git a/configs/rock960-rk3399_defconfig b/configs/rock960-rk3399_defconfig
index bb5b214369..89a8f1d908 100644
--- a/configs/rock960-rk3399_defconfig
+++ b/configs/rock960-rk3399_defconfig
@@ -18,7 +18,6 @@ CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-rock960.dtb"
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_MISC_INIT_R=y
 CONFIG_SPL_MAX_SIZE=0x2e000
-CONFIG_SPL_PAD_TO=0x7f8000
 CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
 CONFIG_SPL_BSS_START_ADDR=0x400000
 CONFIG_SPL_BSS_MAX_SIZE=0x2000
diff --git a/configs/rock_defconfig b/configs/rock_defconfig
index e99272ef22..b5306589b9 100644
--- a/configs/rock_defconfig
+++ b/configs/rock_defconfig
@@ -25,7 +25,6 @@ CONFIG_DEFAULT_FDT_FILE="rk3188-radxarock.dtb"
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_SPL_MAX_SIZE=0x7800
-CONFIG_SPL_PAD_TO=0x7f8000
 CONFIG_SPL_NO_BSS_LIMIT=y
 # CONFIG_SPL_SHARES_INIT_SP_ADDR is not set
 CONFIG_SPL_STACK=0x10087fff
diff --git a/configs/rockpro64-rk3399_defconfig b/configs/rockpro64-rk3399_defconfig
index 72a5b78d79..2f97b57f25 100644
--- a/configs/rockpro64-rk3399_defconfig
+++ b/configs/rockpro64-rk3399_defconfig
@@ -22,7 +22,6 @@ CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-rockpro64.dtb"
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_MISC_INIT_R=y
 CONFIG_SPL_MAX_SIZE=0x2e000
-CONFIG_SPL_PAD_TO=0x7f8000
 CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
 CONFIG_SPL_BSS_START_ADDR=0x400000
 CONFIG_SPL_BSS_MAX_SIZE=0x2000
diff --git a/configs/tinker-rk3288_defconfig b/configs/tinker-rk3288_defconfig
index 839b93284f..81817968e1 100644
--- a/configs/tinker-rk3288_defconfig
+++ b/configs/tinker-rk3288_defconfig
@@ -23,7 +23,6 @@ CONFIG_USE_PREBOOT=y
 CONFIG_DEFAULT_FDT_FILE="rk3288-tinker.dtb"
 CONFIG_SILENT_CONSOLE=y
 CONFIG_DISPLAY_BOARDINFO_LATE=y
-CONFIG_SPL_PAD_TO=0x7f8000
 CONFIG_SPL_NO_BSS_LIMIT=y
 # CONFIG_SPL_SHARES_INIT_SP_ADDR is not set
 CONFIG_SPL_STACK=0xff718000
diff --git a/configs/tinker-s-rk3288_defconfig b/configs/tinker-s-rk3288_defconfig
index 886c6a933a..3110d3b03c 100644
--- a/configs/tinker-s-rk3288_defconfig
+++ b/configs/tinker-s-rk3288_defconfig
@@ -23,7 +23,6 @@ CONFIG_USE_PREBOOT=y
 CONFIG_DEFAULT_FDT_FILE="rk3288-tinker-s.dtb"
 CONFIG_SILENT_CONSOLE=y
 CONFIG_DISPLAY_BOARDINFO_LATE=y
-CONFIG_SPL_PAD_TO=0x7f8000
 CONFIG_SPL_NO_BSS_LIMIT=y
 # CONFIG_SPL_SHARES_INIT_SP_ADDR is not set
 CONFIG_SPL_STACK=0xff718000
diff --git a/configs/vyasa-rk3288_defconfig b/configs/vyasa-rk3288_defconfig
index 516e2cc32b..56f946984f 100644
--- a/configs/vyasa-rk3288_defconfig
+++ b/configs/vyasa-rk3288_defconfig
@@ -22,7 +22,6 @@ CONFIG_USE_PREBOOT=y
 CONFIG_DEFAULT_FDT_FILE="rk3288-vyasa.dtb"
 CONFIG_SILENT_CONSOLE=y
 CONFIG_DISPLAY_BOARDINFO_LATE=y
-CONFIG_SPL_PAD_TO=0x7f8000
 CONFIG_SPL_NO_BSS_LIMIT=y
 # CONFIG_SPL_SHARES_INIT_SP_ADDR is not set
 CONFIG_SPL_STACK=0xff718000
diff --git a/include/configs/rockchip-common.h b/include/configs/rockchip-common.h
index 4c964cc377..e7cf79fb4f 100644
--- a/include/configs/rockchip-common.h
+++ b/include/configs/rockchip-common.h
@@ -9,8 +9,6 @@
 
 #define CONFIG_SYS_NS16550_MEM32
 
-/* ((CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR - 64) * 512) */
-
 #ifndef CONFIG_SPL_BUILD
 
 /* First try to boot from SD (index 1), then eMMC (index 0) */
-- 
2.37.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH v2 4/7] rockchip: simplify binman image dependencies addition to INPUTS
  2022-07-22 11:34 [PATCH v2 0/7] migrate u-boot-rockchip.bin to binman and generate an image for SPI Quentin Schulz
                   ` (2 preceding siblings ...)
  2022-07-22 11:35 ` [PATCH v2 3/7] rockchip: remove unneeded CONFIG_SPL_PAD_TO Quentin Schulz
@ 2022-07-22 11:35 ` Quentin Schulz
  2022-07-22 11:35 ` [PATCH v2 5/7] rockchip: allow to build SPI images even without HAS_ROM option Quentin Schulz
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 19+ messages in thread
From: Quentin Schulz @ 2022-07-22 11:35 UTC (permalink / raw)
  Cc: bharat.gooty, rayagonda.kokatanur, sjg, philipp.tomsich,
	kever.yang, jagan, alpernebiyasak, andy.yan, hl, chenjh,
	manivannan.sadhasivam, nick, klaus.goger, jernej.skrabec,
	jbx6244, deepakdas.linux, linux, mail, peterwillcn, heiko,
	w.egorov, pbrobinson, sunil, ldevulder, akash, banglang.huang,
	matwey.kornilov, michael, xypron.glpk, u-boot, Quentin Schulz,
	Quentin Schulz

From: Quentin Schulz <quentin.schulz@theobroma-systems.com>

By factoring SPL check in the first condition, this makes the checks a
bit less convoluted and more readable.

Cc: Quentin Schulz <foss+uboot@0leil.net>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
---
 Makefile | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/Makefile b/Makefile
index 7761a10b11..279aeacee3 100644
--- a/Makefile
+++ b/Makefile
@@ -995,19 +995,14 @@ ifeq ($(CONFIG_MPC85xx)$(CONFIG_OF_SEPARATE),yy)
 INPUTS-y += u-boot-with-dtb.bin
 endif
 
-ifeq ($(CONFIG_ARCH_ROCKCHIP),y)
-# On ARM64 this target is produced by binman so we don't need this dep
+ifeq ($(CONFIG_ARCH_ROCKCHIP)$(CONFIG_SPL),yy)
+# Binman image dependencies
 ifeq ($(CONFIG_ARM64),y)
-ifeq ($(CONFIG_SPL),y)
 INPUTS-y += u-boot.itb
 endif
 else
-ifeq ($(CONFIG_SPL),y)
-# Generate these inputs for binman which will create the output files
 INPUTS-y += u-boot.img
 endif
-endif
-endif
 
 INPUTS-$(CONFIG_X86) += u-boot-x86-start16.bin u-boot-x86-reset16.bin \
 	$(if $(CONFIG_SPL_X86_16BIT_INIT),spl/u-boot-spl.bin) \
-- 
2.37.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH v2 5/7] rockchip: allow to build SPI images even without HAS_ROM option
  2022-07-22 11:34 [PATCH v2 0/7] migrate u-boot-rockchip.bin to binman and generate an image for SPI Quentin Schulz
                   ` (3 preceding siblings ...)
  2022-07-22 11:35 ` [PATCH v2 4/7] rockchip: simplify binman image dependencies addition to INPUTS Quentin Schulz
@ 2022-07-22 11:35 ` Quentin Schulz
  2022-07-22 11:35 ` [PATCH v2 6/7] binman: add support for skipping file concatenation for mkimage Quentin Schulz
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 19+ messages in thread
From: Quentin Schulz @ 2022-07-22 11:35 UTC (permalink / raw)
  Cc: bharat.gooty, rayagonda.kokatanur, sjg, philipp.tomsich,
	kever.yang, jagan, alpernebiyasak, andy.yan, hl, chenjh,
	manivannan.sadhasivam, nick, klaus.goger, jernej.skrabec,
	jbx6244, deepakdas.linux, linux, mail, peterwillcn, heiko,
	w.egorov, pbrobinson, sunil, ldevulder, akash, banglang.huang,
	matwey.kornilov, michael, xypron.glpk, u-boot, Quentin Schulz,
	Quentin Schulz

From: Quentin Schulz <quentin.schulz@theobroma-systems.com>

This prepares for the creation of a u-boot-rockchip-spi.bin image
similar to u-boot-rockchip.bin to the exception it's destined for
SPI-NOR flashes instead of MMC storage medium.

Cc: Quentin Schulz <foss+uboot@0leil.net>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
---
 arch/arm/dts/rk3288-u-boot.dtsi | 2 +-
 arch/arm/dts/rk3399-u-boot.dtsi | 2 +-
 arch/arm/mach-rockchip/Kconfig  | 6 ++----
 3 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/arch/arm/dts/rk3288-u-boot.dtsi b/arch/arm/dts/rk3288-u-boot.dtsi
index 9eb696b141..e411445ed6 100644
--- a/arch/arm/dts/rk3288-u-boot.dtsi
+++ b/arch/arm/dts/rk3288-u-boot.dtsi
@@ -56,7 +56,7 @@
 	};
 };
 
-#ifdef CONFIG_ROCKCHIP_SPI_IMAGE
+#if defined(CONFIG_ROCKCHIP_SPI_IMAGE) && defined(CONFIG_HAS_ROM)
 &binman {
 	rom {
 		filename = "u-boot.rom";
diff --git a/arch/arm/dts/rk3399-u-boot.dtsi b/arch/arm/dts/rk3399-u-boot.dtsi
index 716b9a433a..3c1a15fe51 100644
--- a/arch/arm/dts/rk3399-u-boot.dtsi
+++ b/arch/arm/dts/rk3399-u-boot.dtsi
@@ -60,7 +60,7 @@
 
 };
 
-#ifdef CONFIG_ROCKCHIP_SPI_IMAGE
+#if defined(CONFIG_ROCKCHIP_SPI_IMAGE) && defined(CONFIG_HAS_ROM)
 &binman {
 	rom {
 		filename = "u-boot.rom";
diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig
index c561a77e6a..b46cea2f91 100644
--- a/arch/arm/mach-rockchip/Kconfig
+++ b/arch/arm/mach-rockchip/Kconfig
@@ -425,12 +425,10 @@ config SPL_MMC
 
 config ROCKCHIP_SPI_IMAGE
 	bool "Build a SPI image for rockchip"
-	depends on HAS_ROM
 	help
 	  Some Rockchip SoCs support booting from SPI flash. Enable this
-	  option to produce a 4MB SPI-flash image (called u-boot.rom)
-	  containing U-Boot. The image is built by binman. U-Boot sits near
-	  the start of the image.
+	  option to produce a SPI-flash image containing U-Boot. The image
+	  is built by binman. U-Boot sits near the start of the image.
 
 config LNX_KRNL_IMG_TEXT_OFFSET_BASE
 	default SYS_TEXT_BASE
-- 
2.37.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH v2 6/7] binman: add support for skipping file concatenation for mkimage
  2022-07-22 11:34 [PATCH v2 0/7] migrate u-boot-rockchip.bin to binman and generate an image for SPI Quentin Schulz
                   ` (4 preceding siblings ...)
  2022-07-22 11:35 ` [PATCH v2 5/7] rockchip: allow to build SPI images even without HAS_ROM option Quentin Schulz
@ 2022-07-22 11:35 ` Quentin Schulz
  2022-07-22 11:35 ` [PATCH v2 7/7] rockchip: add u-boot-rockchip-spi.bin image for booting from SPI-NOR flash Quentin Schulz
  2022-07-24  7:46 ` [SPAM] [PATCH v2 0/7] migrate u-boot-rockchip.bin to binman and generate an image for SPI Xavier Drudis Ferran
  7 siblings, 0 replies; 19+ messages in thread
From: Quentin Schulz @ 2022-07-22 11:35 UTC (permalink / raw)
  Cc: bharat.gooty, rayagonda.kokatanur, sjg, philipp.tomsich,
	kever.yang, jagan, alpernebiyasak, andy.yan, hl, chenjh,
	manivannan.sadhasivam, nick, klaus.goger, jernej.skrabec,
	jbx6244, deepakdas.linux, linux, mail, peterwillcn, heiko,
	w.egorov, pbrobinson, sunil, ldevulder, akash, banglang.huang,
	matwey.kornilov, michael, xypron.glpk, u-boot, Quentin Schulz,
	Quentin Schulz

From: Quentin Schulz <quentin.schulz@theobroma-systems.com>

Some image types handled by mkimage require the datafiles to be passed
independently (-d data1:data2) for specific handling of each. A
concatenation of datafiles prior to passing them to mkimage wouldn't
work.

That is the case for rkspi for example which requires page alignment
and only writing 2KB every 4KB.

This adds the ability to tell binman to pass the datafiles without
prior concatenation to mkimage, by adding the multiple-data-files
boolean property to the mkimage node.

Cc: Quentin Schulz <foss+uboot@0leil.net>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
---
 tools/binman/entries.rst      | 22 +++++++++++++++++++
 tools/binman/etype/mkimage.py | 41 +++++++++++++++++++++++++++++++----
 2 files changed, 59 insertions(+), 4 deletions(-)

diff --git a/tools/binman/entries.rst b/tools/binman/entries.rst
index ae4305c99e..60c89aec59 100644
--- a/tools/binman/entries.rst
+++ b/tools/binman/entries.rst
@@ -1101,6 +1101,9 @@ Entry: mkimage: Binary produced by mkimage
 
 Properties / Entry arguments:
     - datafile: Filename for -d argument
+    - multiple-data-files: boolean to tell binman to pass all files as
+      datafiles to mkimage instead of creating a temporary file the result
+      of datafiles concatenation
     - args: Other arguments to pass
 
 The data passed to mkimage is collected from subnodes of the mkimage node,
@@ -1117,6 +1120,25 @@ This calls mkimage to create an imximage with u-boot-spl.bin as the input
 file. The output from mkimage then becomes part of the image produced by
 binman.
 
+To pass all datafiles untouched to mkimage::
+
+    mkimage {
+        args = "-n rk3399 -T rkspi";
+        multiple-data-files;
+
+        u-boot-tpl {
+        };
+
+        u-boot-spl {
+        };
+    };
+
+This calls mkimage to create a Rockchip RK3399-specific first stage
+bootloader, made of TPL+SPL. Since this first stage bootloader requires to
+align the TPL and SPL but also some weird hacks that is handled by mkimage
+directly, binman is told to not perform the concatenation of datafiles prior
+to passing the data to mkimage.
+
 To use CONFIG options in the arguments, use a string list instead, as in
 this example which also produces four arguments::
 
diff --git a/tools/binman/etype/mkimage.py b/tools/binman/etype/mkimage.py
index 5f6def2287..52297c23ea 100644
--- a/tools/binman/etype/mkimage.py
+++ b/tools/binman/etype/mkimage.py
@@ -16,6 +16,9 @@ class Entry_mkimage(Entry):
 
     Properties / Entry arguments:
         - datafile: Filename for -d argument
+        - multiple-data-files: boolean to tell binman to pass all files as
+          datafiles to mkimage instead of creating a temporary file the result
+          of datafiles concatenation
         - args: Other arguments to pass
 
     The data passed to mkimage is collected from subnodes of the mkimage node,
@@ -32,6 +35,25 @@ class Entry_mkimage(Entry):
     file. The output from mkimage then becomes part of the image produced by
     binman.
 
+	To pass all datafiles untouched to mkimage::
+
+		mkimage {
+			args = "-n rk3399 -T rkspi";
+			multiple-data-files;
+
+			u-boot-tpl {
+			};
+
+			u-boot-spl {
+			};
+		};
+
+	This calls mkimage to create a Rockchip RK3399-specific first stage
+	bootloader, made of TPL+SPL. Since this first stage bootloader requires to
+	align the TPL and SPL but also some weird hacks that is handled by mkimage
+	directly, binman is told to not perform the concatenation of datafiles prior
+	to passing the data to mkimage.
+
     To use CONFIG options in the arguments, use a string list instead, as in
     this example which also produces four arguments::
 
@@ -46,16 +68,27 @@ class Entry_mkimage(Entry):
     def __init__(self, section, etype, node):
         super().__init__(section, etype, node)
         self._args = fdt_util.GetArgs(self._node, 'args')
+        self._multiple_data_files = fdt_util.GetBool(self._node, 'multiple-data-files')
         self._mkimage_entries = OrderedDict()
         self.align_default = None
         self.ReadEntries()
 
     def ObtainContents(self):
         # Use a non-zero size for any fake files to keep mkimage happy
-        data, input_fname, uniq = self.collect_contents_to_file(
-            self._mkimage_entries.values(), 'mkimage', 1024)
-        if data is None:
-            return False
+        fake_size = 1024
+        if self._multiple_data_files:
+            fnames = []
+            uniq = self.GetUniqueName()
+            for entry in self._mkimage_entries.values():
+                if not entry.ObtainContents(fake_size=fake_size):
+                    return False
+                fnames.append(entry.GetDefaultFilename())
+            input_fname = ":".join(fnames)
+        else:
+            data, input_fname, uniq = self.collect_contents_to_file(
+                self._mkimage_entries.values(), 'mkimage', fake_size)
+            if data is None:
+                return False
         output_fname = tools.get_output_filename('mkimage-out.%s' % uniq)
         if self.mkimage.run_cmd('-d', input_fname, *self._args,
                                 output_fname) is not None:
-- 
2.37.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH v2 7/7] rockchip: add u-boot-rockchip-spi.bin image for booting from SPI-NOR flash
  2022-07-22 11:34 [PATCH v2 0/7] migrate u-boot-rockchip.bin to binman and generate an image for SPI Quentin Schulz
                   ` (5 preceding siblings ...)
  2022-07-22 11:35 ` [PATCH v2 6/7] binman: add support for skipping file concatenation for mkimage Quentin Schulz
@ 2022-07-22 11:35 ` Quentin Schulz
  2022-07-24  7:46 ` [SPAM] [PATCH v2 0/7] migrate u-boot-rockchip.bin to binman and generate an image for SPI Xavier Drudis Ferran
  7 siblings, 0 replies; 19+ messages in thread
From: Quentin Schulz @ 2022-07-22 11:35 UTC (permalink / raw)
  Cc: bharat.gooty, rayagonda.kokatanur, sjg, philipp.tomsich,
	kever.yang, jagan, alpernebiyasak, andy.yan, hl, chenjh,
	manivannan.sadhasivam, nick, klaus.goger, jernej.skrabec,
	jbx6244, deepakdas.linux, linux, mail, peterwillcn, heiko,
	w.egorov, pbrobinson, sunil, ldevulder, akash, banglang.huang,
	matwey.kornilov, michael, xypron.glpk, u-boot, Quentin Schulz,
	Quentin Schulz

From: Quentin Schulz <quentin.schulz@theobroma-systems.com>

This new image is similar to u-boot-rockchip.bin except that it's
destined to be flashed on SPI-NOR flashes.

Cc: Quentin Schulz <foss+uboot@0leil.net>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
---
 arch/arm/dts/rockchip-u-boot.dtsi | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/arch/arm/dts/rockchip-u-boot.dtsi b/arch/arm/dts/rockchip-u-boot.dtsi
index fc28ce5187..4c26caa92a 100644
--- a/arch/arm/dts/rockchip-u-boot.dtsi
+++ b/arch/arm/dts/rockchip-u-boot.dtsi
@@ -41,5 +41,34 @@
 			offset = <((CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR - 64) * 512)>;
 		};
 	};
+
+#ifdef CONFIG_ROCKCHIP_SPI_IMAGE
+	simple-bin-spi {
+		filename = "u-boot-rockchip-spi.bin";
+		pad-byte = <0xff>;
+
+		mkimage {
+			args = "-n", CONFIG_SYS_SOC, "-T", "rkspi";
+#ifdef CONFIG_TPL
+			multiple-data-files;
+
+			u-boot-tpl {
+			};
+#endif
+			u-boot-spl {
+			};
+		};
+
+#ifdef CONFIG_ARM64
+		blob {
+			filename = "u-boot.itb";
+#else
+		u-boot-img {
+#endif
+			/* Sync with u-boot,spl-payload-offset if present */
+			offset = <CONFIG_SYS_SPI_U_BOOT_OFFS>;
+		};
+	};
+#endif
 };
 #endif
-- 
2.37.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* Re: [PATCH v2 1/7] rockchip: generate idbloader.img content for u-boot-rockchip.bin with binman for ARM
  2022-07-22 11:34 ` [PATCH v2 1/7] rockchip: generate idbloader.img content for u-boot-rockchip.bin with binman for ARM Quentin Schulz
@ 2022-07-23 12:07   ` Johan Jonker
  2022-07-23 18:04     ` Matwey V. Kornilov
                       ` (2 more replies)
  2022-07-28 13:26   ` Jagan Teki
  1 sibling, 3 replies; 19+ messages in thread
From: Johan Jonker @ 2022-07-23 12:07 UTC (permalink / raw)
  To: Quentin Schulz
  Cc: bharat.gooty, rayagonda.kokatanur, sjg, philipp.tomsich,
	kever.yang, jagan, alpernebiyasak, andy.yan, hl, chenjh,
	manivannan.sadhasivam, nick, klaus.goger, jernej.skrabec,
	deepakdas.linux, linux, mail, peterwillcn, heiko, w.egorov,
	pbrobinson, sunil, ldevulder, akash, banglang.huang,
	matwey.kornilov, michael, xypron.glpk, u-boot, Quentin Schulz

Hi Quentin and others,

Some comments. Have a look if it's useful.
It works, but is in need for some improvement...

Johan

On 7/22/22 13:34, Quentin Schulz wrote:
> From: Quentin Schulz <quentin.schulz@theobroma-systems.com>
> 
> idbloader.img content - currently created by way of Makefile - can be
> created by binman directly.
> 
> So let's do that for Rockchip ARM platforms.
> 
> Cc: Quentin Schulz <foss+uboot@0leil.net>
> Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
> ---
>  Makefile                          |  2 +-
>  arch/arm/dts/rockchip-u-boot.dtsi | 15 +++++++++++++--
>  2 files changed, 14 insertions(+), 3 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index d76ec69b52..f780bfe211 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1005,7 +1005,7 @@ endif
>  else
>  ifeq ($(CONFIG_SPL),y)
>  # Generate these inputs for binman which will create the output files
> -INPUTS-y += idbloader.img u-boot.img
> +INPUTS-y += u-boot.img
>  endif
>  endif
>  endif
> diff --git a/arch/arm/dts/rockchip-u-boot.dtsi b/arch/arm/dts/rockchip-u-boot.dtsi
> index eae3ee715d..0362c97e0b 100644
> --- a/arch/arm/dts/rockchip-u-boot.dtsi
> +++ b/arch/arm/dts/rockchip-u-boot.dtsi
> @@ -17,9 +17,20 @@
>  		filename = "u-boot-rockchip.bin";
>  		pad-byte = <0xff>;
>  

> -		blob {
> -			filename = "idbloader.img";

"u-boot-rockchip.bin" is a combination image of mkimage(TPL/SPL) + "u-boot.img". Not everyone suites this fixed GPT format.
People may still want to write them separate while testing or whatever, so "idbloader.img" and "u-boot.img" must be kept available after this change!

===

rockchip.rst and README.rockchip and elsewhere on the internet still refer to "idbloader.img" so it should come back, but then made by binman.


	idbloader {
		filename = "idbloader.img";

		mkimage {
			args = "-n", CONFIG_SYS_SOC, "-T", "rksd";
#ifdef CONFIG_TPL
			multiple-data-files;

			u-boot-tpl {
			};
#endif
			u-boot-spl {
			};
		};
	};

===

After this patch serie "idbloader.img" is not removed.

make clean

After:
  CLEAN   include/generated/env.in u-boot-nodtb.bin u-boot.lds u-boot.cfg.configs u-boot.bin u-boot-dtb.bin u-boot.img u-boot-dtb.img u-boot.sym u-boot.map u-boot.srec u-boot.cfg u-boot.dtb.out u-boot-tpl.dtb.out u-boot u-boot-spl.dtb.out u-boot.dtb u-boot-rockchip.bin System.map

Before:
  CLEAN   include/generated/env.in u-boot-nodtb.bin u-boot.lds u-boot.cfg.configs u-boot.bin u-boot-dtb.bin u-boot.img u-boot-dtb.img u-boot.sym u-boot.map u-boot.srec u-boot.cfg u-boot.dtb.out u-boot-tpl.dtb.out u-boot u-boot-spl.dtb.out u-boot.dtb u-boot-rockchip.bin System.map idbloader.img

===

Your serie generates zombie files. PLease remove after use.
Same for others like:

simple-bin.map
mkimage-out.rom.mkimage
mkimage.rom.mkimage
rom.map
tools/boot/bootm.c
tools/boot/fdt_region.c
tools/boot/image-cipher.c
tools/boot/image-fit-sig.c
tools/boot/image-fit.c
tools/boot/image-host.c
tools/boot/image.c
u_boot_logo.S


Untracked files:
  (use "git add <file>..." to include in what will be committed)

	mkimage-out.simple-bin.mkimage
	mkimage.simple-bin.mkimage

===



===

> +		mkimage {
> +			args = "-n", CONFIG_SYS_SOC, "-T", "rksd";

> +#ifndef CONFIG_TPL
> +			u-boot-spl {
> +			};
>  		};
> +#else
> +			u-boot-tpl {
> +			};
> +		};
> +

u-boot-spl is the input for mkimage and should be a subnode.

> +		u-boot-spl {
> +		};
> +#endif

Fix your dts format:

	simple-bin {
		filename = "u-boot-rockchip.bin";
		pad-byte = <0xff>;

		mkimage {
			args = "-n", CONFIG_SYS_SOC, "-T", "rksd";
#ifdef CONFIG_TPL
			multiple-data-files;

			u-boot-tpl {
			};
#endif
			u-boot-spl {
			};
		};

#ifdef CONFIG_ARM64
		blob {
			filename = "u-boot.itb";
#else
		u-boot-img {
#endif
			offset = <((CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR - 64) * 512)>;
		};
	};
===

CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR is only related to MMC!

There are other boot mediums like NAND or USB, so don't assume that CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR is defined.

See my patch serie that still is in need for review:

https://lore.kernel.org/u-boot/20220508150825.21711-7-jbx6244@gmail.com/

Without it generates a warning:

Error: arch/arm/dts/rockchip-u-boot.dtsi:54.16-17 syntax error
FATAL ERROR: Unable to parse input tree

Add more compile conditions!

===

RK3066:
For NAND the "idbloader.img" might be useful for my serie (in need for review) when it gets TPL/SPL and rc4 right:

[PATCH v2 00/11] Add Rockchip IDB device
https://lore.kernel.org/u-boot/a1458a7b-2043-6397-3107-2d1fdf08c8e1@gmail.com/

In mk808_defconfig change:

CONFIG_TPL_TEXT_BASE=0x10080C04

to:

CONFIG_TPL_TEXT_BASE=0x10080C00

In rockchip.rst change:

        printf "RK30" > tplspl.bin
        dd if=u-boot-tpl.bin >> tplspl.bin

to:
        printf "RK30" > tplspl.bin
        dd if=u-boot-tpl.bin ibs=1 skip=4 >> tplspl.bin

The NAND can be programmed simular to MMC with:

rkdeveloptool wlx loader1 idbloader.img

TODO:

rk30 usbplug (open source)
===
>  
>  		u-boot-img {
>  			offset = <CONFIG_SPL_PAD_TO>;

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v2 1/7] rockchip: generate idbloader.img content for u-boot-rockchip.bin with binman for ARM
  2022-07-23 12:07   ` Johan Jonker
@ 2022-07-23 18:04     ` Matwey V. Kornilov
  2022-07-23 19:49     ` [SPAM] " Xavier Drudis Ferran
  2022-07-25 10:25     ` Quentin Schulz
  2 siblings, 0 replies; 19+ messages in thread
From: Matwey V. Kornilov @ 2022-07-23 18:04 UTC (permalink / raw)
  To: Johan Jonker
  Cc: Quentin Schulz, bharat.gooty, rayagonda.kokatanur, Simon Glass,
	Philipp Tomsich, Kever Yang, Jagan Teki, alpernebiyasak,
	andy.yan, hl, chenjh, manivannan.sadhasivam, nick, Klaus Goger,
	jernej.skrabec, deepakdas.linux, linux, mail, peterwillcn,
	Heiko Stübner, w.egorov, Peter Robinson, sunil,
	Loic Devulder, Akash Gajjar, banglang.huang, michael,
	Heinrich Schuchardt, U-Boot Mailing List, Quentin Schulz

сб, 23 июл. 2022 г. в 15:07, Johan Jonker <jbx6244@gmail.com>:
>
> Hi Quentin and others,
>
> Some comments. Have a look if it's useful.
> It works, but is in need for some improvement...
>
> Johan
>
> On 7/22/22 13:34, Quentin Schulz wrote:
> > From: Quentin Schulz <quentin.schulz@theobroma-systems.com>
> >
> > idbloader.img content - currently created by way of Makefile - can be
> > created by binman directly.
> >
> > So let's do that for Rockchip ARM platforms.
> >
> > Cc: Quentin Schulz <foss+uboot@0leil.net>
> > Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
> > ---
> >  Makefile                          |  2 +-
> >  arch/arm/dts/rockchip-u-boot.dtsi | 15 +++++++++++++--
> >  2 files changed, 14 insertions(+), 3 deletions(-)
> >
> > diff --git a/Makefile b/Makefile
> > index d76ec69b52..f780bfe211 100644
> > --- a/Makefile
> > +++ b/Makefile
> > @@ -1005,7 +1005,7 @@ endif
> >  else
> >  ifeq ($(CONFIG_SPL),y)
> >  # Generate these inputs for binman which will create the output files
> > -INPUTS-y += idbloader.img u-boot.img
> > +INPUTS-y += u-boot.img
> >  endif
> >  endif
> >  endif
> > diff --git a/arch/arm/dts/rockchip-u-boot.dtsi b/arch/arm/dts/rockchip-u-boot.dtsi
> > index eae3ee715d..0362c97e0b 100644
> > --- a/arch/arm/dts/rockchip-u-boot.dtsi
> > +++ b/arch/arm/dts/rockchip-u-boot.dtsi
> > @@ -17,9 +17,20 @@
> >               filename = "u-boot-rockchip.bin";
> >               pad-byte = <0xff>;
> >
>
> > -             blob {
> > -                     filename = "idbloader.img";
>
> "u-boot-rockchip.bin" is a combination image of mkimage(TPL/SPL) + "u-boot.img". Not everyone suites this fixed GPT format.
> People may still want to write them separate while testing or whatever, so "idbloader.img" and "u-boot.img" must be kept available after this change!

I agree. For instance, RockChip proprietary idbloader.img is known to
work with u-boot u-boot.img as a payload. It may be useful for testing
purposes then.

>
> ===
>
> rockchip.rst and README.rockchip and elsewhere on the internet still refer to "idbloader.img" so it should come back, but then made by binman.
>
>
>         idbloader {
>                 filename = "idbloader.img";
>
>                 mkimage {
>                         args = "-n", CONFIG_SYS_SOC, "-T", "rksd";
> #ifdef CONFIG_TPL
>                         multiple-data-files;
>
>                         u-boot-tpl {
>                         };
> #endif
>                         u-boot-spl {
>                         };
>                 };
>         };
>
> ===
>
> After this patch serie "idbloader.img" is not removed.
>
> make clean
>
> After:
>   CLEAN   include/generated/env.in u-boot-nodtb.bin u-boot.lds u-boot.cfg.configs u-boot.bin u-boot-dtb.bin u-boot.img u-boot-dtb.img u-boot.sym u-boot.map u-boot.srec u-boot.cfg u-boot.dtb.out u-boot-tpl.dtb.out u-boot u-boot-spl.dtb.out u-boot.dtb u-boot-rockchip.bin System.map
>
> Before:
>   CLEAN   include/generated/env.in u-boot-nodtb.bin u-boot.lds u-boot.cfg.configs u-boot.bin u-boot-dtb.bin u-boot.img u-boot-dtb.img u-boot.sym u-boot.map u-boot.srec u-boot.cfg u-boot.dtb.out u-boot-tpl.dtb.out u-boot u-boot-spl.dtb.out u-boot.dtb u-boot-rockchip.bin System.map idbloader.img
>
> ===
>
> Your serie generates zombie files. PLease remove after use.
> Same for others like:
>
> simple-bin.map
> mkimage-out.rom.mkimage
> mkimage.rom.mkimage
> rom.map
> tools/boot/bootm.c
> tools/boot/fdt_region.c
> tools/boot/image-cipher.c
> tools/boot/image-fit-sig.c
> tools/boot/image-fit.c
> tools/boot/image-host.c
> tools/boot/image.c
> u_boot_logo.S
>
>
> Untracked files:
>   (use "git add <file>..." to include in what will be committed)
>
>         mkimage-out.simple-bin.mkimage
>         mkimage.simple-bin.mkimage
>
> ===
>
>
>
> ===
>
> > +             mkimage {
> > +                     args = "-n", CONFIG_SYS_SOC, "-T", "rksd";
>
> > +#ifndef CONFIG_TPL
> > +                     u-boot-spl {
> > +                     };
> >               };
> > +#else
> > +                     u-boot-tpl {
> > +                     };
> > +             };
> > +
>
> u-boot-spl is the input for mkimage and should be a subnode.
>
> > +             u-boot-spl {
> > +             };
> > +#endif
>
> Fix your dts format:
>
>         simple-bin {
>                 filename = "u-boot-rockchip.bin";
>                 pad-byte = <0xff>;
>
>                 mkimage {
>                         args = "-n", CONFIG_SYS_SOC, "-T", "rksd";
> #ifdef CONFIG_TPL
>                         multiple-data-files;
>
>                         u-boot-tpl {
>                         };
> #endif
>                         u-boot-spl {
>                         };
>                 };
>
> #ifdef CONFIG_ARM64
>                 blob {
>                         filename = "u-boot.itb";
> #else
>                 u-boot-img {
> #endif
>                         offset = <((CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR - 64) * 512)>;
>                 };
>         };
> ===
>
> CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR is only related to MMC!
>
> There are other boot mediums like NAND or USB, so don't assume that CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR is defined.
>
> See my patch serie that still is in need for review:
>
> https://lore.kernel.org/u-boot/20220508150825.21711-7-jbx6244@gmail.com/
>
> Without it generates a warning:
>
> Error: arch/arm/dts/rockchip-u-boot.dtsi:54.16-17 syntax error
> FATAL ERROR: Unable to parse input tree
>
> Add more compile conditions!
>
> ===
>
> RK3066:
> For NAND the "idbloader.img" might be useful for my serie (in need for review) when it gets TPL/SPL and rc4 right:
>
> [PATCH v2 00/11] Add Rockchip IDB device
> https://lore.kernel.org/u-boot/a1458a7b-2043-6397-3107-2d1fdf08c8e1@gmail.com/
>
> In mk808_defconfig change:
>
> CONFIG_TPL_TEXT_BASE=0x10080C04
>
> to:
>
> CONFIG_TPL_TEXT_BASE=0x10080C00
>
> In rockchip.rst change:
>
>         printf "RK30" > tplspl.bin
>         dd if=u-boot-tpl.bin >> tplspl.bin
>
> to:
>         printf "RK30" > tplspl.bin
>         dd if=u-boot-tpl.bin ibs=1 skip=4 >> tplspl.bin
>
> The NAND can be programmed simular to MMC with:
>
> rkdeveloptool wlx loader1 idbloader.img
>
> TODO:
>
> rk30 usbplug (open source)
> ===
> >
> >               u-boot-img {
> >                       offset = <CONFIG_SPL_PAD_TO>;



-- 
With best regards,
Matwey V. Kornilov

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [SPAM] Re: [PATCH v2 1/7] rockchip: generate idbloader.img content for u-boot-rockchip.bin with binman for ARM
  2022-07-23 12:07   ` Johan Jonker
  2022-07-23 18:04     ` Matwey V. Kornilov
@ 2022-07-23 19:49     ` Xavier Drudis Ferran
  2022-07-25 10:25     ` Quentin Schulz
  2 siblings, 0 replies; 19+ messages in thread
From: Xavier Drudis Ferran @ 2022-07-23 19:49 UTC (permalink / raw)
  To: Johan Jonker
  Cc: Quentin Schulz, bharat.gooty, rayagonda.kokatanur, sjg,
	philipp.tomsich, kever.yang, jagan, alpernebiyasak, andy.yan, hl,
	chenjh, manivannan.sadhasivam, nick, klaus.goger, jernej.skrabec,
	deepakdas.linux, linux, mail, peterwillcn, heiko, w.egorov,
	pbrobinson, sunil, ldevulder, akash, banglang.huang,
	matwey.kornilov, michael, xypron.glpk, u-boot, Quentin Schulz

El Sat, Jul 23, 2022 at 02:07:30PM +0200, Johan Jonker deia:
> 
> > +		mkimage {
> > +			args = "-n", CONFIG_SYS_SOC, "-T", "rksd";
> 
> > +#ifndef CONFIG_TPL
> > +			u-boot-spl {
> > +			};
> >  		};
> > +#else
> > +			u-boot-tpl {
> > +			};
> > +		};
> > +
> 
> u-boot-spl is the input for mkimage and should be a subnode.
>
> > +		u-boot-spl {
> > +		};
> > +#endif
>

The input for mkimage can be tpl alone. 
I think this case is for rksd. For rksd one can simply concatenate 
the output of mkimage -n rk... -T rksd tpl  with the spl binary. 
That's why u-boot-spl is out of mkimage when there's u-boot-tpl.
for rksd I think mkimage just adds a header in front of the binary, 
so you can put the next binary right behind. You don't have to give spl 
to mkimage if you give it tpl.


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [SPAM] [PATCH v2 0/7] migrate u-boot-rockchip.bin to binman and generate an image for SPI
  2022-07-22 11:34 [PATCH v2 0/7] migrate u-boot-rockchip.bin to binman and generate an image for SPI Quentin Schulz
                   ` (6 preceding siblings ...)
  2022-07-22 11:35 ` [PATCH v2 7/7] rockchip: add u-boot-rockchip-spi.bin image for booting from SPI-NOR flash Quentin Schulz
@ 2022-07-24  7:46 ` Xavier Drudis Ferran
  2022-07-25 10:54   ` Quentin Schulz
  7 siblings, 1 reply; 19+ messages in thread
From: Xavier Drudis Ferran @ 2022-07-24  7:46 UTC (permalink / raw)
  To: Quentin Schulz
  Cc: bharat.gooty, rayagonda.kokatanur, sjg, philipp.tomsich,
	kever.yang, jagan, alpernebiyasak, andy.yan, hl, chenjh,
	manivannan.sadhasivam, nick, klaus.goger, jernej.skrabec,
	jbx6244, deepakdas.linux, linux, mail, peterwillcn, heiko,
	w.egorov, pbrobinson, sunil, ldevulder, akash, banglang.huang,
	matwey.kornilov, michael, xypron.glpk, u-boot, Quentin Schulz

El Fri, Jul 22, 2022 at 01:34:58PM +0200, Quentin Schulz deia:
> From: Quentin Schulz <quentin.schulz@theobroma-systems.com>
> 
> This migrates the generation of u-boot-rockchip.bin from Makefile to binman
> completely. There is therefore no idbloader.img anymore as it is created on
> the fly by binman.
>

Thanks a lot.

I've tested this series and it worked for me and my Rock Pi 4B. That's 
a similar board, RK3399 too. Maybe it needs more refinements for other
rockchip boards. 

I haven't spent a lot of time testing yet, and I've tested it with 
two or three dozen patches on top of master, so not quite the real thing.

One thing that comes to mind is that master has CONFIG_ENV_IS_IN_MMC=y
and I have it disabled and CONFIG_ENV_IS_NOWHERE=y. So maybe we should
check in dtsi whether we need binman to call mkenvimage (and
scripts/get_default_envs.sh or from what source?) and put the output
at CONFIG_ENV_OFFSET=0x3F8000 for the SD image.

Or maybe we should just disable CONFIG_ENV_IS_IN_MMC in the board ? (I
think it conflicts with trust settings anyway).

Or maybe just leave as it is and let env load non-fatally fail unless
the user provides their own custom environment ?

Now that we have Quentin's patches maybe we can remove the Makefile
warning about CONFIG_USE_SPL_FIT_GENERATOR and move the task that
arch/arm/mach-rockchip/make_fit_atf.py is doing to binman.
But I don't seem to find any dts using "split-elf" 
I even wonder, am I right to assume make_fit_atf.py is deprecated and
split-elf prefered ? Because split-elf seems to be unused and make_fit_atf.py 
seems to be default ???
 

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v2 1/7] rockchip: generate idbloader.img content for u-boot-rockchip.bin with binman for ARM
  2022-07-23 12:07   ` Johan Jonker
  2022-07-23 18:04     ` Matwey V. Kornilov
  2022-07-23 19:49     ` [SPAM] " Xavier Drudis Ferran
@ 2022-07-25 10:25     ` Quentin Schulz
  2022-07-25 11:05       ` Xavier Drudis Ferran
  2 siblings, 1 reply; 19+ messages in thread
From: Quentin Schulz @ 2022-07-25 10:25 UTC (permalink / raw)
  To: Johan Jonker, Quentin Schulz
  Cc: bharat.gooty, rayagonda.kokatanur, sjg, philipp.tomsich,
	kever.yang, jagan, alpernebiyasak, andy.yan, hl, chenjh,
	manivannan.sadhasivam, nick, klaus.goger, jernej.skrabec,
	deepakdas.linux, linux, mail, peterwillcn, heiko, w.egorov,
	pbrobinson, sunil, ldevulder, akash, banglang.huang,
	matwey.kornilov, michael, xypron.glpk, u-boot

Hi Johan,

On 7/23/22 14:07, Johan Jonker wrote:
> Hi Quentin and others,
> 
> Some comments. Have a look if it's useful.
> It works, but is in need for some improvement...
> 
> Johan
> 
> On 7/22/22 13:34, Quentin Schulz wrote:
>> From: Quentin Schulz <quentin.schulz@theobroma-systems.com>
>>
>> idbloader.img content - currently created by way of Makefile - can be
>> created by binman directly.
>>
>> So let's do that for Rockchip ARM platforms.
>>
>> Cc: Quentin Schulz <foss+uboot@0leil.net>
>> Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
>> ---
>>   Makefile                          |  2 +-
>>   arch/arm/dts/rockchip-u-boot.dtsi | 15 +++++++++++++--
>>   2 files changed, 14 insertions(+), 3 deletions(-)
>>
>> diff --git a/Makefile b/Makefile
>> index d76ec69b52..f780bfe211 100644
>> --- a/Makefile
>> +++ b/Makefile
>> @@ -1005,7 +1005,7 @@ endif
>>   else
>>   ifeq ($(CONFIG_SPL),y)
>>   # Generate these inputs for binman which will create the output files
>> -INPUTS-y += idbloader.img u-boot.img
>> +INPUTS-y += u-boot.img
>>   endif
>>   endif
>>   endif
>> diff --git a/arch/arm/dts/rockchip-u-boot.dtsi b/arch/arm/dts/rockchip-u-boot.dtsi
>> index eae3ee715d..0362c97e0b 100644
>> --- a/arch/arm/dts/rockchip-u-boot.dtsi
>> +++ b/arch/arm/dts/rockchip-u-boot.dtsi
>> @@ -17,9 +17,20 @@
>>   		filename = "u-boot-rockchip.bin";
>>   		pad-byte = <0xff>;
>>   
> 
>> -		blob {
>> -			filename = "idbloader.img";
> 
> "u-boot-rockchip.bin" is a combination image of mkimage(TPL/SPL) + "u-boot.img". Not everyone suites this fixed GPT format.
> People may still want to write them separate while testing or whatever, so "idbloader.img" and "u-boot.img" must be kept available after this change!
> 

Fair enough.

> ===
> 
> rockchip.rst and README.rockchip and elsewhere on the internet still refer to "idbloader.img" so it should come back, but then made by binman.
> 

I personally care very little what kind of information one finds outside 
of U-Boot upstream documentation. Considering that U-Boot has on-going 
deep changes, specifically related to DM and conversion from C headers 
to Kconfig options, old tutorial or answers on StackOverflow will anyway 
become outdated. This to me is not a valid argument (though updating the 
docs should have been done).

> 
> 	idbloader {
> 		filename = "idbloader.img";
> 
> 		mkimage {
> 			args = "-n", CONFIG_SYS_SOC, "-T", "rksd";
> #ifdef CONFIG_TPL
> 			multiple-data-files;
> 
> 			u-boot-tpl {
> 			};
> #endif
> 			u-boot-spl {
> 			};
> 		};
> 	};
> 
> ===
> 

I'll add "filename" DT property support for binman mkimage entry instead 
so that it creates idbloader.img binary again.

The issue is that binman creates images in parallel, so you cannot rely 
on the idbloader.img binary being creates by binman before another 
section uses it.

I also don't want to duplicate the mkimage node outside of 
u-boot-rockchip.bin. It'd be nice to have support for phandles in order 
to explicit dependencies between images, e.g. something like:

```
&binman {
	idbloader_img: idbloader-img {
		filename = "idbloader.img";

		mkimage {
			args = "-n", CONFIG_SYS_SOC, "-T", "rksd";
#ifdef CONFIG_TPL
			multiple-data-files;

			u-boot-tpl {
			};
#endif
			u-boot-spl {
			};
		};
	};
	simple-bin {
		filename "u-boot-rockchip.bin";

		blob {
			content = <&idbloader_img>;
		};
		u-boot-img {
		};
	};
};
```

But I couldn't find something allowing this? The collection entry seems 
to be close to what I'd like but:
```
&binman {
	collection {
		filename = "idbloader.img";
		content = <&idbloader_img>;
	};

	simple-bin {
		filename = "u-boot-rockchip.bin";
		pad-byte = <0xff>;


		idbloader_img: mkimage {
			args = "-n", CONFIG_SYS_SOC, "-T", "rksd";
#ifdef CONFIG_TPL
			multiple-data-files;

			u-boot-tpl {
			};
#endif
			u-boot-spl {
			};
		};
		u-boot-img {};
	};
```
creates an empty idbloader.img.

I'm sure I'm just missing out on something obvious but cannot find it 
right now.

> After this patch serie "idbloader.img" is not removed.
> 

Yes, there's no need to remove files that aren't generated anymore, 
since they won't exist. This is up to the user to do some clean-up 
before building a newer version of U-Boot.

> make clean
> 
> After:
>    CLEAN   include/generated/env.in u-boot-nodtb.bin u-boot.lds u-boot.cfg.configs u-boot.bin u-boot-dtb.bin u-boot.img u-boot-dtb.img u-boot.sym u-boot.map u-boot.srec u-boot.cfg u-boot.dtb.out u-boot-tpl.dtb.out u-boot u-boot-spl.dtb.out u-boot.dtb u-boot-rockchip.bin System.map
> 
> Before:
>    CLEAN   include/generated/env.in u-boot-nodtb.bin u-boot.lds u-boot.cfg.configs u-boot.bin u-boot-dtb.bin u-boot.img u-boot-dtb.img u-boot.sym u-boot.map u-boot.srec u-boot.cfg u-boot.dtb.out u-boot-tpl.dtb.out u-boot u-boot-spl.dtb.out u-boot.dtb u-boot-rockchip.bin System.map idbloader.img
> 
> ===
> 
> Your serie generates zombie files. PLease remove after use.
> Same for others like:
>  > simple-bin.map
> mkimage-out.rom.mkimage
> mkimage.rom.mkimage
> rom.map

Yup, will do.

> tools/boot/bootm.c
> tools/boot/fdt_region.c
> tools/boot/image-cipher.c
> tools/boot/image-fit-sig.c
> tools/boot/image-fit.c
> tools/boot/image-host.c
> tools/boot/image.c
> u_boot_logo.S
> 

Those predates the patch series (I only have the last one though).

> 
> Untracked files:
>    (use "git add <file>..." to include in what will be committed)
> 
> 	mkimage-out.simple-bin.mkimage
> 	mkimage.simple-bin.mkimage
> 
> ===
> 
> 
> 
> ===
> 
>> +		mkimage {
>> +			args = "-n", CONFIG_SYS_SOC, "-T", "rksd";
> 
>> +#ifndef CONFIG_TPL
>> +			u-boot-spl {
>> +			};
>>   		};
>> +#else
>> +			u-boot-tpl {
>> +			};
>> +		};
>> +
> 
> u-boot-spl is the input for mkimage and should be a subnode.
> 

Technically not needed, can be appended right after the TPL. But since 
you want the idbloader.img binary back, I'll do what you suggest 
otherwise it wouldn't contain the same content as before this patch series.

>> +		u-boot-spl {
>> +		};
>> +#endif
> 
> Fix your dts format:
> 
> 	simple-bin {
> 		filename = "u-boot-rockchip.bin";
> 		pad-byte = <0xff>;
> 
> 		mkimage {
> 			args = "-n", CONFIG_SYS_SOC, "-T", "rksd";
> #ifdef CONFIG_TPL
> 			multiple-data-files;
> 
> 			u-boot-tpl {
> 			};
> #endif
> 			u-boot-spl {
> 			};
> 		};
> 
> #ifdef CONFIG_ARM64
> 		blob {
> 			filename = "u-boot.itb";
> #else
> 		u-boot-img {
> #endif
> 			offset = <((CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR - 64) * 512)>;
> 		};
> 	};
> ===
> 
> CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR is only related to MMC!
> 
> There are other boot mediums like NAND or USB, so don't assume that CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR is defined.
> 
I have an issue with the assumption of what u-boot-rockchip.bin is 
supposed to be. What does it actually represent?

I have three possible boot media on my board: SPI-NOR, eMMC and SD Card. 
Both MMC devices can use the same offsets and images, so that's fine for 
me to have something like u-boot-rockchip-mmc.bin.
However, SPI-NOR has a different offset for U-Boot proper than MMC 
devices. It would be ridiculous to have two defconfigs with the only 
difference being the value of SPL_PAD_TO option. Hence why there's a 
u-boot-rockchip-spi.bin image now and also why I argue in this patch 
series that using SPL_PAD_TO is incorrect. I replaced SPL_PAD_TO with 
the formula that was originally used to define the padding, see 
https://source.denx.de/u-boot/u-boot/-/commit/79030a486128bdb6888059113711a6ae66ff89c5. 
I understand this change is not ok, but I cannot use SPL_PAD_TO either. 
I would like to have some opinion/answer on what I asked in the 
paragraph above.

> See my patch serie that still is in need for review:
> 
> https://urldefense.proofpoint.com/v2/url?u=https-3A__lore.kernel.org_u-2Dboot_20220508150825.21711-2D7-2Djbx6244-40gmail.com_&d=DwICaQ&c=_sEr5x9kUWhuk4_nFwjJtA&r=LYjLexDn7rXIzVmkNPvw5ymA1XTSqHGq8yBP6m6qZZ4njZguQhZhkI_-172IIy1t&m=G-BQeahyEOXOd4k4qm8FOKAAi0q_GYVKUH7r8DETdouey2AzEq1fMNzHfSSoLb5P&s=rDJyHW_vIS5_pzBJbCANS9y47hKX5KlTmVBqlI2rb_k&e=
> 

It's been almost three months and I don't see reviews on it, you should 
send a mail asking people to review it (you should probably rebase and 
resend though as I assume some changes were made to U-Boot that either 
creates conflict when applying or some header variable made it to 
Kconfig option now).

> Without it generates a warning:
> 
> Error: arch/arm/dts/rockchip-u-boot.dtsi:54.16-17 syntax error
> FATAL ERROR: Unable to parse input tree
> 
> Add more compile conditions!
> 

Fair enough. I would rename u-boot-rockchip.bin into 
u-boot-rockchip-mmc.bin and add an #ifdef on 
CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR.

In your series, you'll be able to add a u-boot-rockchip-nand.bin I guess?

> ===
> 
> RK3066:
> For NAND the "idbloader.img" might be useful for my serie (in need for review) when it gets TPL/SPL and rc4 right:
> 
> [PATCH v2 00/11] Add Rockchip IDB device
> https://urldefense.proofpoint.com/v2/url?u=https-3A__lore.kernel.org_u-2Dboot_a1458a7b-2D2043-2D6397-2D3107-2D2d1fdf08c8e1-40gmail.com_&d=DwICaQ&c=_sEr5x9kUWhuk4_nFwjJtA&r=LYjLexDn7rXIzVmkNPvw5ymA1XTSqHGq8yBP6m6qZZ4njZguQhZhkI_-172IIy1t&m=G-BQeahyEOXOd4k4qm8FOKAAi0q_GYVKUH7r8DETdouey2AzEq1fMNzHfSSoLb5P&s=wXUk74zHNoAwgPlPvlDZbNTBdqpDy2UTuSt9MDyuKiw&e=
> 
> In mk808_defconfig change:
> 
> CONFIG_TPL_TEXT_BASE=0x10080C04
> 
> to:
> 
> CONFIG_TPL_TEXT_BASE=0x10080C00
> 
> In rockchip.rst change:
> 
>          printf "RK30" > tplspl.bin
>          dd if=u-boot-tpl.bin >> tplspl.bin
> 
> to:
>          printf "RK30" > tplspl.bin
>          dd if=u-boot-tpl.bin ibs=1 skip=4 >> tplspl.bin
> 
> The NAND can be programmed simular to MMC with:
> 
> rkdeveloptool wlx loader1 idbloader.img
> 

Where is loader1 partition located in your NAND device? We do not use a 
partition table with our board (and we do not use Rockchip default 
offsets either) and I think U-Boot shouldn't assume users will flash 
into a named partition, because there's no guarantee the location of the 
partition will be the same for all devices and users.

Thanks for the review,
Cheers,
Quentin

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [SPAM] [PATCH v2 0/7] migrate u-boot-rockchip.bin to binman and generate an image for SPI
  2022-07-24  7:46 ` [SPAM] [PATCH v2 0/7] migrate u-boot-rockchip.bin to binman and generate an image for SPI Xavier Drudis Ferran
@ 2022-07-25 10:54   ` Quentin Schulz
  2022-07-25 11:20     ` Xavier Drudis Ferran
  0 siblings, 1 reply; 19+ messages in thread
From: Quentin Schulz @ 2022-07-25 10:54 UTC (permalink / raw)
  To: Xavier Drudis Ferran, Quentin Schulz
  Cc: bharat.gooty, rayagonda.kokatanur, sjg, philipp.tomsich,
	kever.yang, jagan, alpernebiyasak, andy.yan, hl, chenjh,
	manivannan.sadhasivam, nick, klaus.goger, jernej.skrabec,
	jbx6244, deepakdas.linux, linux, mail, peterwillcn, heiko,
	w.egorov, pbrobinson, sunil, ldevulder, akash, banglang.huang,
	matwey.kornilov, michael, xypron.glpk, u-boot

Hi Xavier,

On 7/24/22 09:46, Xavier Drudis Ferran wrote:
> El Fri, Jul 22, 2022 at 01:34:58PM +0200, Quentin Schulz deia:
>> From: Quentin Schulz <quentin.schulz@theobroma-systems.com>
>>
>> This migrates the generation of u-boot-rockchip.bin from Makefile to binman
>> completely. There is therefore no idbloader.img anymore as it is created on
>> the fly by binman.
>>
> 
> Thanks a lot.
> 
> I've tested this series and it worked for me and my Rock Pi 4B. That's
> a similar board, RK3399 too. Maybe it needs more refinements for other
> rockchip boards.
> 
> I haven't spent a lot of time testing yet, and I've tested it with
> two or three dozen patches on top of master, so not quite the real thing.
> 
> One thing that comes to mind is that master has CONFIG_ENV_IS_IN_MMC=y
> and I have it disabled and CONFIG_ENV_IS_NOWHERE=y. So maybe we should
> check in dtsi whether we need binman to call mkenvimage (and
> scripts/get_default_envs.sh or from what source?) and put the output
> at CONFIG_ENV_OFFSET=0x3F8000 for the SD image.
> 

It's not currently done for u-boot-rockchip.bin in upstream master, so 
it's not part of this patch series.

You'd need a new binman entry I assume for calling mkenvimage.

It's not a super safe assumption that CONFIG_ENV_OFFSET will be used for 
declaring where the environment is stored. E.g., CONFIG_ENV_OFFSET for 
Puma declares where the env is located on SPI-NOR, however for MMC 
devices, it is specified with u-boot,mmc-env-offset DT property (though, 
if it is not defined, it defaults to CONFIG_ENV_OFFSET, c.f. env/mmc.c). 
But maybe the same comment as I did for CONFIG_SYS_SPI_U_BOOT_OFFS would 
be enough? e.g. states that this should be in sync with the DT property 
if there's one for the board in question. See: 
https://lore.kernel.org/u-boot/20220722160655.3904213-13-foss+uboot@0leil.net/ 
for what I needed to do for Puma to get u-boot-rockchip-spi.bin support.

But that overall seems like a reasonable feature to add.

> Or maybe we should just disable CONFIG_ENV_IS_IN_MMC in the board ? (I
> think it conflicts with trust settings anyway).
> 

Yes, anything but ENV_IS_NOWHERE depends on !CHAIN_OF_TRUST. So I guess 
a check on #ifndef CONFIG_CHAIN_OF_TRUST for that section in binman 
would do the trick?

> Or maybe just leave as it is and let env load non-fatally fail unless
> the user provides their own custom environment ?
> 

If there's no environment where U-Boot is looking for it, it'll not 
fatally fail right now. The next time you save the environment 
(saveenv), it'll be written in the correct location and read during next 
boot. Again, this patch series does not modify u-boot-rockchip.bin 
current behavior :)

> Now that we have Quentin's patches maybe we can remove the Makefile
> warning about CONFIG_USE_SPL_FIT_GENERATOR and move the task that
> arch/arm/mach-rockchip/make_fit_atf.py is doing to binman.

I wasn't aware of this entry, maybe it is actually possible. That'd be 
nice to have :)

> But I don't seem to find any dts using "split-elf"

There are some test dts files in tools/binman directory for split-elf 
though.

> I even wonder, am I right to assume make_fit_atf.py is deprecated and
> split-elf prefered ? Because split-elf seems to be unused and make_fit_atf.py
> seems to be default ???
>   

My understanding is that there's a will to replace make_fit_atf.py 
output generated by binman instead, if binman supports everything needed 
to do this migration, I don't know.

Cheers,
Quentin

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v2 1/7] rockchip: generate idbloader.img content for u-boot-rockchip.bin with binman for ARM
  2022-07-25 10:25     ` Quentin Schulz
@ 2022-07-25 11:05       ` Xavier Drudis Ferran
  2022-07-25 11:56         ` Johan Jonker
  0 siblings, 1 reply; 19+ messages in thread
From: Xavier Drudis Ferran @ 2022-07-25 11:05 UTC (permalink / raw)
  To: Quentin Schulz
  Cc: Johan Jonker, Quentin Schulz, bharat.gooty, kever.yang, jagan,
	andy.yan, hl, chenjh, manivannan.sadhasivam, nick, klaus.goger,
	jernej.skrabec, deepakdas.linux, linux, mail, peterwillcn,
	u-boot

Note: I removed a few recipients from Cc: with a quite random criteria, 
just to avoid error messages from the list software that there were 
too many addresses in Cc:. I hope those will get it from the list anyway
and sorry if this is a problem.

 
> I'm sure I'm just missing out on something obvious but cannot find it right
> now.
> I have an issue with the assumption of what u-boot-rockchip.bin is supposed
> to be. What does it actually represent?
> 
> I have three possible boot media on my board: SPI-NOR, eMMC and SD Card.
> Both MMC devices can use the same offsets and images, so that's fine for me
> to have something like u-boot-rockchip-mmc.bin.
> However, SPI-NOR has a different offset for U-Boot proper than MMC devices.
> It would be ridiculous to have two defconfigs with the only difference being
> the value of SPL_PAD_TO option. Hence why there's a u-boot-rockchip-spi.bin
> image now and also why I argue in this patch series that using SPL_PAD_TO is
> incorrect. I replaced SPL_PAD_TO with the formula that was originally used
> to define the padding, see https://source.denx.de/u-boot/u-boot/-/commit/79030a486128bdb6888059113711a6ae66ff89c5.
> I understand this change is not ok, but I cannot use SPL_PAD_TO either. I
> would like to have some opinion/answer on what I asked in the paragraph
> above.

The difference between u-boot-rockchip-mmc.bin and
u-boot-rockchip-spi.bin is not only the offset. The image for SPI has
the parts loaded by bootrom (tpl and spl) written in 8Kb chunks
separated by 8Kb empty space (or something like this, I don't
remember). That's why there are different -T rksd and -T rkspi
options to mkimage. This is so at least for RK3399.

I have no idea whether nand images need this special format or not, 
or whether it depends on the SoC model or what. If it's only the 
offset, then maybe we can avoid a 3rd image and reuse the MMC one. 
I don't know.


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [SPAM] [PATCH v2 0/7] migrate u-boot-rockchip.bin to binman and generate an image for SPI
  2022-07-25 10:54   ` Quentin Schulz
@ 2022-07-25 11:20     ` Xavier Drudis Ferran
  2022-07-25 16:39       ` Quentin Schulz
  0 siblings, 1 reply; 19+ messages in thread
From: Xavier Drudis Ferran @ 2022-07-25 11:20 UTC (permalink / raw)
  To: Quentin Schulz
  Cc: Xavier Drudis Ferran, Quentin Schulz, kever.yang, andy.yan, hl,
	chenjh, manivannan.sadhasivam, nick, jbx6244, deepakdas.linux,
	linux, u-boot

El Mon, Jul 25, 2022 at 12:54:04PM +0200, Quentin Schulz deia:
 
> You'd need a new binman entry I assume for calling mkenvimage.
>

 
> It's not a super safe assumption that CONFIG_ENV_OFFSET will be used for
> declaring where the environment is stored. E.g., CONFIG_ENV_OFFSET for Puma
> declares where the env is located on SPI-NOR, however for MMC devices, it is
> specified with u-boot,mmc-env-offset DT property (though, if it is not
> defined, it defaults to CONFIG_ENV_OFFSET, c.f. env/mmc.c). But maybe the
> same comment as I did for CONFIG_SYS_SPI_U_BOOT_OFFS would be enough? e.g.
> states that this should be in sync with the DT property if there's one for
> the board in question. See: https://lore.kernel.org/u-boot/20220722160655.3904213-13-foss+uboot@0leil.net/
> for what I needed to do for Puma to get u-boot-rockchip-spi.bin support.
> 
> But that overall seems like a reasonable feature to add.
> 

But it is interesting enough ? 
I mean once you could call mkenvimage you'd still need to give it
some environment (variables values). And what would you give it
that would be different from the default environment ?
Maybe what's wanted is just to fail to read the environment
the first time. And the user can save it from hush (or run mkenvimage
themselves). 

> > Or maybe we should just disable CONFIG_ENV_IS_IN_MMC in the board ? (I
> > think it conflicts with trust settings anyway).
> > 
> 
> Yes, anything but ENV_IS_NOWHERE depends on !CHAIN_OF_TRUST. So I guess a
> check on #ifndef CONFIG_CHAIN_OF_TRUST for that section in binman would do
> the trick?
>

If we need to add the environment to binman we could just check ENV_IS_IN_...
because those will already be false if CHAIN_OF_TRUST is false, I think.
 
But mayeb we don't need to do that, or we just want to leave some 
empty space somewhere (yeah, difficult to know where if the offset can be in dt or Kconfig).

> 
> If there's no environment where U-Boot is looking for it, it'll not fatally
> fail right now. The next time you save the environment (saveenv), it'll be
> written in the correct location and read during next boot. Again, this patch
> series does not modify u-boot-rockchip.bin current behavior :)
>

You're right, so maybe we don't really need to run mkenvimage to build the image,
we leave the environment empty, and let the user do their thing. We may want 
to make sure we don't put something else there, though.
 
> > Now that we have Quentin's patches maybe we can remove the Makefile
> > warning about CONFIG_USE_SPL_FIT_GENERATOR and move the task that
> > arch/arm/mach-rockchip/make_fit_atf.py is doing to binman.
> 
> I wasn't aware of this entry, maybe it is actually possible. That'd be nice
> to have :)
> 

I'm playing with this right now. I don't have anything that boots.
First attempt complains that SPL can't allocate so much RAM to fit the
internal image (not really feeling like increasing space a lot for
many boards) and 2nd attempt at having an external image to make it closer
to what make_fit_atf.py used to do and have less breakage, then it doesn't even
complain, just stops short of running ATF.

I'll play some more...

> 
> My understanding is that there's a will to replace make_fit_atf.py output
> generated by binman instead, if binman supports everything needed to do this
> migration, I don't know.
>

Thanks for your confirmation.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v2 1/7] rockchip: generate idbloader.img content for u-boot-rockchip.bin with binman for ARM
  2022-07-25 11:05       ` Xavier Drudis Ferran
@ 2022-07-25 11:56         ` Johan Jonker
  0 siblings, 0 replies; 19+ messages in thread
From: Johan Jonker @ 2022-07-25 11:56 UTC (permalink / raw)
  To: Xavier Drudis Ferran, Quentin Schulz
  Cc: Quentin Schulz, bharat.gooty, kever.yang, jagan, andy.yan, hl,
	chenjh, manivannan.sadhasivam, nick, klaus.goger, jernej.skrabec,
	deepakdas.linux, linux, mail, peterwillcn, u-boot



On 7/25/22 13:05, Xavier Drudis Ferran wrote:
> Note: I removed a few recipients from Cc: with a quite random criteria, 
> just to avoid error messages from the list software that there were 
> too many addresses in Cc:. I hope those will get it from the list anyway
> and sorry if this is a problem.
> 
>  
>> I'm sure I'm just missing out on something obvious but cannot find it right
>> now.
>> I have an issue with the assumption of what u-boot-rockchip.bin is supposed
>> to be. What does it actually represent?
>>
>> I have three possible boot media on my board: SPI-NOR, eMMC and SD Card.
>> Both MMC devices can use the same offsets and images, so that's fine for me
>> to have something like u-boot-rockchip-mmc.bin.
>> However, SPI-NOR has a different offset for U-Boot proper than MMC devices.
>> It would be ridiculous to have two defconfigs with the only difference being
>> the value of SPL_PAD_TO option. Hence why there's a u-boot-rockchip-spi.bin
>> image now and also why I argue in this patch series that using SPL_PAD_TO is
>> incorrect. I replaced SPL_PAD_TO with the formula that was originally used
>> to define the padding, see https://source.denx.de/u-boot/u-boot/-/commit/79030a486128bdb6888059113711a6ae66ff89c5.
>> I understand this change is not ok, but I cannot use SPL_PAD_TO either. I
>> would like to have some opinion/answer on what I asked in the paragraph
>> above.
> 
> The difference between u-boot-rockchip-mmc.bin and
> u-boot-rockchip-spi.bin is not only the offset. The image for SPI has
> the parts loaded by bootrom (tpl and spl) written in 8Kb chunks
> separated by 8Kb empty space (or something like this, I don't
> remember). That's why there are different -T rksd and -T rkspi
> options to mkimage. This is so at least for RK3399.
> 
> I have no idea whether nand images need this special format or not, 
> or whether it depends on the SoC model or what. If it's only the 
> offset, then maybe we can avoid a 3rd image and reuse the MMC one. 
> I don't know.
> 

The pattern for NAND depends on the chip. Have NOT found a good logic for lsb modes other then a lookup list.
No need for a 3rd image as idbloader.img contains everything (header/TPL/SPL/RC4 support) for further processing elsewhere.

Johan

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [SPAM] [PATCH v2 0/7] migrate u-boot-rockchip.bin to binman and generate an image for SPI
  2022-07-25 11:20     ` Xavier Drudis Ferran
@ 2022-07-25 16:39       ` Quentin Schulz
  0 siblings, 0 replies; 19+ messages in thread
From: Quentin Schulz @ 2022-07-25 16:39 UTC (permalink / raw)
  To: Xavier Drudis Ferran
  Cc: Quentin Schulz, kever.yang, andy.yan, hl, chenjh,
	manivannan.sadhasivam, nick, jbx6244, deepakdas.linux, linux,
	u-boot



On 7/25/22 13:20, Xavier Drudis Ferran wrote:
> El Mon, Jul 25, 2022 at 12:54:04PM +0200, Quentin Schulz deia:
>   
>> You'd need a new binman entry I assume for calling mkenvimage.
>>
> 
>   
>> It's not a super safe assumption that CONFIG_ENV_OFFSET will be used for
>> declaring where the environment is stored. E.g., CONFIG_ENV_OFFSET for Puma
>> declares where the env is located on SPI-NOR, however for MMC devices, it is
>> specified with u-boot,mmc-env-offset DT property (though, if it is not
>> defined, it defaults to CONFIG_ENV_OFFSET, c.f. env/mmc.c). But maybe the
>> same comment as I did for CONFIG_SYS_SPI_U_BOOT_OFFS would be enough? e.g.
>> states that this should be in sync with the DT property if there's one for
>> the board in question. See: https://urldefense.proofpoint.com/v2/url?u=https-3A__lore.kernel.org_u-2Dboot_20220722160655.3904213-2D13-2Dfoss-2Buboot-400leil.net_&d=DwIBaQ&c=_sEr5x9kUWhuk4_nFwjJtA&r=LYjLexDn7rXIzVmkNPvw5ymA1XTSqHGq8yBP6m6qZZ4njZguQhZhkI_-172IIy1t&m=vRiCOa3kkluAD8H-j_n6Ah5cU-awcHa_QffxMmj8DZv5-_BNT1IcyP3RMiDj_ZWl&s=ptlh1k3KoLVMT-Zk2f-cUxoHrQeWZTVCLIP83D3NVuQ&e=
>> for what I needed to do for Puma to get u-boot-rockchip-spi.bin support.
>>
>> But that overall seems like a reasonable feature to add.
>>
> 
> But it is interesting enough ?
> I mean once you could call mkenvimage you'd still need to give it
> some environment (variables values). And what would you give it
> that would be different from the default environment ?

Nothing, but that's the point? So you don't need to run a saveenv first 
to save the environment on the storage medium? Which is useful when you 
have userspace modifying the environment (e.g. A/B partition choice). 
But that's off-topic anyways and I'm not entirely sure this is actually 
easily doable for the simple reason that I think sections are ordered in 
DTB and we don't know where the user wants the environment on their 
storage medium and that might change the order of the sections.

> Maybe what's wanted is just to fail to read the environment
> the first time. And the user can save it from hush (or run mkenvimage
> themselves).
> 
>>> Or maybe we should just disable CONFIG_ENV_IS_IN_MMC in the board ? (I
>>> think it conflicts with trust settings anyway).
>>>
>>
>> Yes, anything but ENV_IS_NOWHERE depends on !CHAIN_OF_TRUST. So I guess a
>> check on #ifndef CONFIG_CHAIN_OF_TRUST for that section in binman would do
>> the trick?
>>
> 
> If we need to add the environment to binman we could just check ENV_IS_IN_...
> because those will already be false if CHAIN_OF_TRUST is false, I think.
>   
> But mayeb we don't need to do that, or we just want to leave some
> empty space somewhere (yeah, difficult to know where if the offset can be in dt or Kconfig).
> 
>>
>> If there's no environment where U-Boot is looking for it, it'll not fatally
>> fail right now. The next time you save the environment (saveenv), it'll be
>> written in the correct location and read during next boot. Again, this patch
>> series does not modify u-boot-rockchip.bin current behavior :)
>>
> 
> You're right, so maybe we don't really need to run mkenvimage to build the image,
> we leave the environment empty, and let the user do their thing. We may want
> to make sure we don't put something else there, though.
>   
>>> Now that we have Quentin's patches maybe we can remove the Makefile
>>> warning about CONFIG_USE_SPL_FIT_GENERATOR and move the task that
>>> arch/arm/mach-rockchip/make_fit_atf.py is doing to binman.
>>
>> I wasn't aware of this entry, maybe it is actually possible. That'd be nice
>> to have :)
>>
> 
> I'm playing with this right now. I don't have anything that boots.
> First attempt complains that SPL can't allocate so much RAM to fit the
> internal image (not really feeling like increasing space a lot for
> many boards) and 2nd attempt at having an external image to make it closer
> to what make_fit_atf.py used to do and have less breakage, then it doesn't even
> complain, just stops short of running ATF.
> 
> I'll play some more...
> 

Don't really want to hijack the thread with something slightly unrelated 
but posting this here for posterity:

diff --git a/arch/arm/dts/rockchip-u-boot.dtsi 
b/arch/arm/dts/rockchip-u-boot.dtsi
index daa5dea3d5..0af11341a1 100644
--- a/arch/arm/dts/rockchip-u-boot.dtsi
+++ b/arch/arm/dts/rockchip-u-boot.dtsi
@@ -11,8 +11,8 @@
  	};
  };

-#ifdef CONFIG_SPL
  &binman {
+#ifdef CONFIG_SPL
  	simple-bin {
  		filename = "u-boot-rockchip.bin";
  		pad-byte = <0xff>;
@@ -31,13 +31,66 @@
  		};

  #ifdef CONFIG_ARM64
-		blob {
-			filename = "u-boot.itb";
+		fit {
+			offset = <((CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR - 64) * 512)>;
+
+			description = "FIT image for U-Boot with bl31 (TF-A)";
+			#address-cells = <1>;
+			fit,fdt-list = "of-list";
+
+			images {
+				uboot {
+					description = "U-Boot (64-bit)";
+					type = "standalone";
+					os = "U-Boot";
+					arch = "arm64";
+					compression = "none";
+					load = <CONFIG_SYS_TEXT_BASE>;
+
+					u-boot-nodtb {
+					};
+				};
+
+				@atf-SEQ {
+					fit,operation = "split-elf";
+					description = "ARM Trusted Firmware";
+					type = "firmware";
+					arch = "arm64";
+					os = "arm-trusted-firmware";
+					compression = "none";
+					fit,load;
+					fit,entry;
+					fit,data;
+
+					atf-bl31 {
+					};
+				};
+
+				@fdt-SEQ {
+					description = "NAME";
+					type = "flat_dt";
+					compression = "none";
+
+					u-boot-dtb {
+					};
+				};
+			};
+
+			configurations {
+				default = "@config-DEFAULT-SEQ";
+				@config-SEQ {
+					description = "NAME";
+					firmware = "atf-1";
+					loadables = "uboot","atf-2","atf-3";
+					fdt = "fdt-SEQ";
+				};
+			};
+		};
  #else
  		u-boot-img {
-#endif
  			offset = <((CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR - 64) * 512)>;
  		};
+#endif
  	};

  #ifdef CONFIG_ROCKCHIP_SPI_IMAGE
@@ -69,5 +122,5 @@
  		};
  	};
  #endif
-};
  #endif
+};


is what I have currently done and the outcome of this is:


U-Boot TPL 2022.07-00811-gf6815f93eb-dirty (Jul 25 2022 - 18:24:06)
Channel 0: DDR3, 666MHz
BW=32 Col=10 Bk=8 CS0 Row=15 CS=1 Die BW=16 Size=1024MB
Channel 1: DDR3, 666MHz
BW=32 Col=10 Bk=8 CS0 Row=15 CS=1 Die BW=16 Size=1024MB
256B stride
Trying to boot from BOOTROM
Returning to boot ROM...

U-Boot SPL 2022.07-00811-gf6815f93eb-dirty (Jul 25 2022 - 18:24:06 +0200)
Trying to boot from MMC2
alloc space exhausted
FIT buffer of 1018880 bytes
Could not get FIT buffer of 1018880 bytes
	check CONFIG_SYS_SPL_MALLOC_SIZE
No valid device tree binary found at 00000000002c0e88
initcall sequence 0000000000286bd0 failed at call 0000000000279604 (err=-1)
### ERROR ### Please RESET the board ###

The new u-boot-rockchip.bin is only about 2KB bigger. The name and 
addresses are correctly returned by mkimage -l when comparing the 
current implementation and with the patch above applied.

Cheers,
Quentin

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* Re: [PATCH v2 1/7] rockchip: generate idbloader.img content for u-boot-rockchip.bin with binman for ARM
  2022-07-22 11:34 ` [PATCH v2 1/7] rockchip: generate idbloader.img content for u-boot-rockchip.bin with binman for ARM Quentin Schulz
  2022-07-23 12:07   ` Johan Jonker
@ 2022-07-28 13:26   ` Jagan Teki
  1 sibling, 0 replies; 19+ messages in thread
From: Jagan Teki @ 2022-07-28 13:26 UTC (permalink / raw)
  To: Quentin Schulz
  Cc: bharat.gooty, rayagonda.kokatanur, sjg, philipp.tomsich,
	kever.yang, alpernebiyasak, andy.yan, hl, chenjh,
	manivannan.sadhasivam, nick, klaus.goger, jernej.skrabec,
	jbx6244, deepakdas.linux, linux, mail, peterwillcn, heiko,
	w.egorov, pbrobinson, sunil, ldevulder, akash, banglang.huang,
	matwey.kornilov, michael, xypron.glpk, u-boot, Quentin Schulz

On Fri, Jul 22, 2022 at 5:05 PM Quentin Schulz <foss+uboot@0leil.net> wrote:
>
> From: Quentin Schulz <quentin.schulz@theobroma-systems.com>
>
> idbloader.img content - currently created by way of Makefile - can be
> created by binman directly.
>
> So let's do that for Rockchip ARM platforms.
>
> Cc: Quentin Schulz <foss+uboot@0leil.net>
> Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
> ---
>  Makefile                          |  2 +-
>  arch/arm/dts/rockchip-u-boot.dtsi | 15 +++++++++++++--
>  2 files changed, 14 insertions(+), 3 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index d76ec69b52..f780bfe211 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1005,7 +1005,7 @@ endif
>  else
>  ifeq ($(CONFIG_SPL),y)
>  # Generate these inputs for binman which will create the output files
> -INPUTS-y += idbloader.img u-boot.img
> +INPUTS-y += u-boot.img
>  endif
>  endif
>  endif
> diff --git a/arch/arm/dts/rockchip-u-boot.dtsi b/arch/arm/dts/rockchip-u-boot.dtsi
> index eae3ee715d..0362c97e0b 100644
> --- a/arch/arm/dts/rockchip-u-boot.dtsi
> +++ b/arch/arm/dts/rockchip-u-boot.dtsi
> @@ -17,9 +17,20 @@
>                 filename = "u-boot-rockchip.bin";
>                 pad-byte = <0xff>;
>
> -               blob {
> -                       filename = "idbloader.img";

Binman might be first priority boot image to be used but not mandatory
for all cases. Some boards use SPL or TPL+SPL and U-Boot proper
separately in order to change the SPL or TPL+SPL for supporting Multi
DTB on a variety of boards without updating U-Boot proper from the
factory. idbloader.img can be a legacy image name but it is derived
from rockchip and many boards are already used it and it is simply
recognized by rockchip board vendors.

Thanks,
Jagan.

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2022-07-28 13:26 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-22 11:34 [PATCH v2 0/7] migrate u-boot-rockchip.bin to binman and generate an image for SPI Quentin Schulz
2022-07-22 11:34 ` [PATCH v2 1/7] rockchip: generate idbloader.img content for u-boot-rockchip.bin with binman for ARM Quentin Schulz
2022-07-23 12:07   ` Johan Jonker
2022-07-23 18:04     ` Matwey V. Kornilov
2022-07-23 19:49     ` [SPAM] " Xavier Drudis Ferran
2022-07-25 10:25     ` Quentin Schulz
2022-07-25 11:05       ` Xavier Drudis Ferran
2022-07-25 11:56         ` Johan Jonker
2022-07-28 13:26   ` Jagan Teki
2022-07-22 11:35 ` [PATCH v2 2/7] rockchip: generate u-boot-rockchip.bin with binman for ARM64 boards Quentin Schulz
2022-07-22 11:35 ` [PATCH v2 3/7] rockchip: remove unneeded CONFIG_SPL_PAD_TO Quentin Schulz
2022-07-22 11:35 ` [PATCH v2 4/7] rockchip: simplify binman image dependencies addition to INPUTS Quentin Schulz
2022-07-22 11:35 ` [PATCH v2 5/7] rockchip: allow to build SPI images even without HAS_ROM option Quentin Schulz
2022-07-22 11:35 ` [PATCH v2 6/7] binman: add support for skipping file concatenation for mkimage Quentin Schulz
2022-07-22 11:35 ` [PATCH v2 7/7] rockchip: add u-boot-rockchip-spi.bin image for booting from SPI-NOR flash Quentin Schulz
2022-07-24  7:46 ` [SPAM] [PATCH v2 0/7] migrate u-boot-rockchip.bin to binman and generate an image for SPI Xavier Drudis Ferran
2022-07-25 10:54   ` Quentin Schulz
2022-07-25 11:20     ` Xavier Drudis Ferran
2022-07-25 16:39       ` Quentin Schulz

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.