[RFC PATCH 4/8] rockchip: pad u-boot-rockchip.bin correctly

Quentin Schulz foss+uboot at 0leil.net
Fri Jul 15 17:36:51 CEST 2022


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

On MMC storage media, the TPL/SPL needs to be flashed at offset 32KB.
Instead of requesting the user to put the input the appropriate offsets,
let's create u-boot-rockchip.bin with the padding already added.

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

diff --git a/arch/arm/dts/rockchip-u-boot.dtsi b/arch/arm/dts/rockchip-u-boot.dtsi
index fc28ce5187..4cd243514e 100644
--- a/arch/arm/dts/rockchip-u-boot.dtsi
+++ b/arch/arm/dts/rockchip-u-boot.dtsi
@@ -18,6 +18,7 @@
 		pad-byte = <0xff>;
 
 		mkimage {
+			offset = <(32 * 1024)>; /* 32KB */
 			args = "-n", CONFIG_SYS_SOC, "-T", "rksd";
 #ifndef CONFIG_TPL
 			u-boot-spl {
@@ -38,7 +39,7 @@
 #else
 		u-boot-img {
 #endif
-			offset = <((CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR - 64) * 512)>;
+			offset = <(CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR * 512)>;
 		};
 	};
 };
diff --git a/doc/board/rockchip/rockchip.rst b/doc/board/rockchip/rockchip.rst
index 4ca7b00b1f..1995882244 100644
--- a/doc/board/rockchip/rockchip.rst
+++ b/doc/board/rockchip/rockchip.rst
@@ -179,7 +179,7 @@ To write an image that boots from a SD card (assumed to be /dev/sda):
 
 .. code-block:: bash
 
-        sudo dd if=u-boot-rockchip.bin of=/dev/sda seek=64
+        sudo dd if=u-boot-rockchip.bin of=/dev/sda
         sync
 
 eMMC
-- 
2.36.1



More information about the U-Boot mailing list