]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
rockchip: rk3328: Add support to build bootable SPI image
authorJonas Karlman <jonas@kwiboo.se>
Sat, 17 Feb 2024 00:22:39 +0000 (00:22 +0000)
committerKever Yang <kever.yang@rock-chips.com>
Thu, 14 Mar 2024 03:40:48 +0000 (11:40 +0800)
Similar to RK35xx the BootRom in RK3328 can read all data and look for
idbloader at 0x8000, same as it does for SD and eMMC.

Use the rksd format and modify the mkimage offset to generate a bootable
u-boot-rockchip-spi.bin that can be written to 0x0 of SPI NOR flash.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
arch/arm/dts/rk3328-u-boot.dtsi
arch/arm/mach-rockchip/rk3328/rk3328.c

index a030f1a5e51dc7ff5ccd81d3d65daa384c677a48..4d43fe2fb51a2711f1b9f8b77b7d54f709662c66 100644 (file)
 &usb20_otg {
        hnp-srp-disable;
 };
+
+#ifdef CONFIG_ROCKCHIP_SPI_IMAGE
+&binman {
+       simple-bin-spi {
+               mkimage {
+                       args = "-n", CONFIG_SYS_SOC, "-T", "rksd";
+                       offset = <0x8000>;
+               };
+       };
+};
+#endif
index b8e657e9bf48cff0d4a59bc4b6174dc3ab2b9ead..ca3fa81e1278b8b37c4e6ec856a6233c4b4dfa02 100644 (file)
@@ -35,6 +35,7 @@
 
 const char * const boot_devices[BROM_LAST_BOOTSOURCE + 1] = {
        [BROM_BOOTSOURCE_EMMC] = "/mmc@ff520000",
+       [BROM_BOOTSOURCE_SPINOR] = "/spi@ff190000/flash@0",
        [BROM_BOOTSOURCE_SD] = "/mmc@ff500000",
 };