diff mbox series

[v3,29/49] rockchip: Enable building a SPI ROM image on bob

Message ID 20200709183948.v3.29.I2408e884029011a41a912766d1b80b8cbf7f7b53@changeid
State Superseded
Headers show
Series rockchip: x86: Support building ROM files automatically with binman | expand

Commit Message

Simon Glass July 10, 2020, 12:39 a.m. UTC
Add a simple binman config and enable CONFIG_HAS_ROM so that U-Boot
produces a ROM for bob.

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

(no changes since v1)

 arch/arm/dts/rk3399-gru-u-boot.dtsi   |  4 ++++
 arch/arm/dts/rk3399-gru.dtsi          |  2 +-
 arch/arm/dts/rk3399-u-boot.dtsi       | 27 +++++++++++++++++++++++++++
 arch/arm/mach-rockchip/rk3399/Kconfig |  1 +
 4 files changed, 33 insertions(+), 1 deletion(-)

Comments

Jagan Teki July 13, 2020, 3:36 p.m. UTC | #1
On Fri, Jul 10, 2020 at 6:11 AM Simon Glass <sjg at chromium.org> wrote:
>
> Add a simple binman config and enable CONFIG_HAS_ROM so that U-Boot
> produces a ROM for bob.
>
> Signed-off-by: Simon Glass <sjg at chromium.org>
> ---
>
> (no changes since v1)
>
>  arch/arm/dts/rk3399-gru-u-boot.dtsi   |  4 ++++
>  arch/arm/dts/rk3399-gru.dtsi          |  2 +-
>  arch/arm/dts/rk3399-u-boot.dtsi       | 27 +++++++++++++++++++++++++++
>  arch/arm/mach-rockchip/rk3399/Kconfig |  1 +
>  4 files changed, 33 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm/dts/rk3399-gru-u-boot.dtsi b/arch/arm/dts/rk3399-gru-u-boot.dtsi
> index 7bddc3acdb..390ac2bb5a 100644
> --- a/arch/arm/dts/rk3399-gru-u-boot.dtsi
> +++ b/arch/arm/dts/rk3399-gru-u-boot.dtsi
> @@ -4,3 +4,7 @@
>   */
>
>  #include "rk3399-u-boot.dtsi"
> +
> +&spi_flash {
> +       u-boot,dm-pre-reloc;
> +};
> diff --git a/arch/arm/dts/rk3399-gru.dtsi b/arch/arm/dts/rk3399-gru.dtsi
> index 7ac88392f2..f9c5bb607b 100644
> --- a/arch/arm/dts/rk3399-gru.dtsi
> +++ b/arch/arm/dts/rk3399-gru.dtsi
> @@ -537,7 +537,7 @@ ap_i2c_audio: &i2c8 {
>         pinctrl-names = "default", "sleep";
>         pinctrl-1 = <&spi1_sleep>;
>
> -       spiflash at 0 {
> +       spi_flash: spiflash at 0 {
>                 compatible = "jedec,spi-nor";
>                 reg = <0>;
>
> diff --git a/arch/arm/dts/rk3399-u-boot.dtsi b/arch/arm/dts/rk3399-u-boot.dtsi
> index 8237782408..a76bbea730 100644
> --- a/arch/arm/dts/rk3399-u-boot.dtsi
> +++ b/arch/arm/dts/rk3399-u-boot.dtsi
> @@ -4,11 +4,14 @@
>   */
>  #define USB_CLASS_HUB                  9
>
> +#include "rockchip-u-boot.dtsi"
> +
>  / {
>         aliases {
>                 mmc0 = &sdhci;
>                 mmc1 = &sdmmc;
>                 pci0 = &pcie0;
> +               spi1 = &spi1;
>         };
>
>         cic: syscon at ff620000 {
> @@ -57,6 +60,30 @@
>
>  };
>
> +#ifdef CONFIG_HAS_ROM
> +&binman {
> +       rom {
> +               filename = "u-boot.rom";
> +               size = <0x400000>;
> +               pad-byte = <0xff>;
> +
> +               mkimage {
> +                       args = "-n rk3399 -T rkspi";
> +                       u-boot-spl {
> +                       };
> +               };

How could attach u-boot-spl for TPL builds where TPL has to args with
ROM header. right now we are doing in a monolithic way.

./tools/mkimage -n rk3399 -T rkspi -d
tpl/u-boot-tpl.bin:spl/u-boot-spl.bin idbloader.img
diff mbox series

Patch

diff --git a/arch/arm/dts/rk3399-gru-u-boot.dtsi b/arch/arm/dts/rk3399-gru-u-boot.dtsi
index 7bddc3acdb..390ac2bb5a 100644
--- a/arch/arm/dts/rk3399-gru-u-boot.dtsi
+++ b/arch/arm/dts/rk3399-gru-u-boot.dtsi
@@ -4,3 +4,7 @@ 
  */
 
 #include "rk3399-u-boot.dtsi"
+
+&spi_flash {
+	u-boot,dm-pre-reloc;
+};
diff --git a/arch/arm/dts/rk3399-gru.dtsi b/arch/arm/dts/rk3399-gru.dtsi
index 7ac88392f2..f9c5bb607b 100644
--- a/arch/arm/dts/rk3399-gru.dtsi
+++ b/arch/arm/dts/rk3399-gru.dtsi
@@ -537,7 +537,7 @@  ap_i2c_audio: &i2c8 {
 	pinctrl-names = "default", "sleep";
 	pinctrl-1 = <&spi1_sleep>;
 
-	spiflash at 0 {
+	spi_flash: spiflash at 0 {
 		compatible = "jedec,spi-nor";
 		reg = <0>;
 
diff --git a/arch/arm/dts/rk3399-u-boot.dtsi b/arch/arm/dts/rk3399-u-boot.dtsi
index 8237782408..a76bbea730 100644
--- a/arch/arm/dts/rk3399-u-boot.dtsi
+++ b/arch/arm/dts/rk3399-u-boot.dtsi
@@ -4,11 +4,14 @@ 
  */
 #define USB_CLASS_HUB			9
 
+#include "rockchip-u-boot.dtsi"
+
 / {
 	aliases {
 		mmc0 = &sdhci;
 		mmc1 = &sdmmc;
 		pci0 = &pcie0;
+		spi1 = &spi1;
 	};
 
 	cic: syscon at ff620000 {
@@ -57,6 +60,30 @@ 
 
 };
 
+#ifdef CONFIG_HAS_ROM
+&binman {
+	rom {
+		filename = "u-boot.rom";
+		size = <0x400000>;
+		pad-byte = <0xff>;
+
+		mkimage {
+			args = "-n rk3399 -T rkspi";
+			u-boot-spl {
+			};
+		};
+		u-boot-img {
+			offset = <0x40000>;
+		};
+		u-boot {
+			offset = <0x300000>;
+		};
+		fdtmap {
+		};
+	};
+};
+#endif
+
 &cru {
 	u-boot,dm-pre-reloc;
 };
diff --git a/arch/arm/mach-rockchip/rk3399/Kconfig b/arch/arm/mach-rockchip/rk3399/Kconfig
index 254b9c5b4d..8b91d4713d 100644
--- a/arch/arm/mach-rockchip/rk3399/Kconfig
+++ b/arch/arm/mach-rockchip/rk3399/Kconfig
@@ -5,6 +5,7 @@  choice
 
 config TARGET_CHROMEBOOK_BOB
 	bool "Asus Flip C101PA Chromebook (RK3399)"
+	select HAS_ROM
 	help
 	  Bob is a small RK3299-based device similar in apperance to Minnie.
 	  It has two USB 3.0 type-C ports, 4GB of SDRAM, WiFi and a 10.1",