[PATCH v4 06/27] rockchip: Enable building a SPI ROM image on jerry

Simon Glass sjg at chromium.org
Sun Jul 19 21:55:57 CEST 2020


Add a simple binman config and enable CONFIG_HAS_ROM so that U-Boot
produces a ROM for jerry.

Change the binman image definition to support multiple images, since it
may be used to build both u-boot-rockchip.bin and u-boot.rom

Signed-off-by: Simon Glass <sjg at chromium.org>
---

Changes in v4:
- Add a new CONFIG_ROCKCHIP_SPI_IMAGE to control SPI-image generation

 arch/arm/dts/rk3288-u-boot.dtsi       | 24 ++++++++++++++++++++++++
 arch/arm/dts/rockchip-u-boot.dtsi     |  8 +++++++-
 arch/arm/mach-rockchip/Kconfig        |  9 +++++++++
 arch/arm/mach-rockchip/rk3288/Kconfig |  2 ++
 4 files changed, 42 insertions(+), 1 deletion(-)

diff --git a/arch/arm/dts/rk3288-u-boot.dtsi b/arch/arm/dts/rk3288-u-boot.dtsi
index 51b6e018bd..c87f00141f 100644
--- a/arch/arm/dts/rk3288-u-boot.dtsi
+++ b/arch/arm/dts/rk3288-u-boot.dtsi
@@ -12,6 +12,30 @@
 	};
 };
 
+#ifdef CONFIG_ROCKCHIP_SPI_IMAGE
+&binman {
+	rom {
+		filename = "u-boot.rom";
+		size = <0x400000>;
+		pad-byte = <0xff>;
+
+		mkimage {
+			args = "-n rk3288 -T rkspi";
+			u-boot-spl {
+			};
+		};
+		u-boot-img {
+			offset = <0x20000>;
+		};
+		u-boot {
+			offset = <0x300000>;
+		};
+		fdtmap {
+		};
+	};
+};
+#endif
+
 &dmc {
 	u-boot,dm-pre-reloc;
 };
diff --git a/arch/arm/dts/rockchip-u-boot.dtsi b/arch/arm/dts/rockchip-u-boot.dtsi
index a2559e2db0..0451db735e 100644
--- a/arch/arm/dts/rockchip-u-boot.dtsi
+++ b/arch/arm/dts/rockchip-u-boot.dtsi
@@ -6,7 +6,13 @@
 #include <config.h>
 
 / {
-	binman {
+	binman: binman {
+		multiple-images;
+	};
+};
+
+&binman {
+	simple-bin {
 		filename = "u-boot-rockchip.bin";
 		pad-byte = <0xff>;
 
diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig
index e2b6326584..dd1eec9f18 100644
--- a/arch/arm/mach-rockchip/Kconfig
+++ b/arch/arm/mach-rockchip/Kconfig
@@ -366,6 +366,15 @@ config TPL_ROCKCHIP_EARLYRETURN_TO_BROM
 config SPL_MMC_SUPPORT
 	default y if !SPL_ROCKCHIP_BACK_TO_BROM
 
+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.
+
 source "arch/arm/mach-rockchip/px30/Kconfig"
 source "arch/arm/mach-rockchip/rk3036/Kconfig"
 source "arch/arm/mach-rockchip/rk3128/Kconfig"
diff --git a/arch/arm/mach-rockchip/rk3288/Kconfig b/arch/arm/mach-rockchip/rk3288/Kconfig
index afb62fca78..bb715e9d0e 100644
--- a/arch/arm/mach-rockchip/rk3288/Kconfig
+++ b/arch/arm/mach-rockchip/rk3288/Kconfig
@@ -5,7 +5,9 @@ choice
 
 config TARGET_CHROMEBOOK_JERRY
 	bool "Google/Rockchip Veyron-Jerry Chromebook"
+	select HAS_ROM
 	select BOARD_LATE_INIT
+	select ROCKCHIP_SPI_IMAGE
 	help
 	  Jerry is a RK3288-based clamshell device with 2 USB 3.0 ports,
 	  HDMI, an 11.9 inch EDP display, micro-SD card, touchpad and
-- 
2.28.0.rc0.105.gf9edc3c819-goog



More information about the U-Boot mailing list