diff mbox series

[v5,8/8] rockchip: add u-boot-rockchip-spi.bin image for booting from SPI-NOR flash

Message ID 20220826153634.3086393-9-foss+uboot@0leil.net
State Superseded
Delegated to: Kever Yang
Headers show
Series migrate u-boot-rockchip.bin to binman and generate an image for SPI | expand

Commit Message

Quentin Schulz Aug. 26, 2022, 3:36 p.m. UTC
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>
---

v3:
 - added filename property so that idblaoder-spi.img binary is generated
 by binman, as per community request,
 - added new temporary files to the list of files to clean up on `make
 clean`,

 Makefile                          |  3 ++-
 arch/arm/dts/rockchip-u-boot.dtsi | 30 ++++++++++++++++++++++++++++++
 2 files changed, 32 insertions(+), 1 deletion(-)

Comments

Simon Glass Aug. 27, 2022, 12:21 a.m. UTC | #1
On Fri, 26 Aug 2022 at 09:37, Quentin Schulz <foss+uboot@0leil.net> wrote:
>
> 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>
> ---
>
> v3:
>  - added filename property so that idblaoder-spi.img binary is generated
>  by binman, as per community request,
>  - added new temporary files to the list of files to clean up on `make
>  clean`,
>
>  Makefile                          |  3 ++-
>  arch/arm/dts/rockchip-u-boot.dtsi | 30 ++++++++++++++++++++++++++++++
>  2 files changed, 32 insertions(+), 1 deletion(-)

Reviewed-by: Simon Glass <sjg@chromium.org>
Kever Yang Sept. 1, 2022, 12:08 p.m. UTC | #2
On 2022/8/26 23:36, Quentin Schulz wrote:
> 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>

Reviewed-by: Kever Yang <kever.yang@rock-chips.com>

Thanks,
- Kever
> ---
>
> v3:
>   - added filename property so that idblaoder-spi.img binary is generated
>   by binman, as per community request,
>   - added new temporary files to the list of files to clean up on `make
>   clean`,
>
>   Makefile                          |  3 ++-
>   arch/arm/dts/rockchip-u-boot.dtsi | 30 ++++++++++++++++++++++++++++++
>   2 files changed, 32 insertions(+), 1 deletion(-)
>
> diff --git a/Makefile b/Makefile
> index 736c4ad182..e70e92c947 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -2197,7 +2197,8 @@ CLEAN_FILES += include/bmp_logo.h include/bmp_logo_data.h \
>   	       idbloader.img 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 mkimage-out.rom.mkimage \
> -	       mkimage.rom.mkimage rom.map simple-bin.map
> +	       mkimage.rom.mkimage rom.map simple-bin.map simple-bin-spi.map \
> +	       idbloader-spi.img
>   
>   # Directories & files removed with 'make mrproper'
>   MRPROPER_DIRS  += include/config include/generated spl tpl \
> diff --git a/arch/arm/dts/rockchip-u-boot.dtsi b/arch/arm/dts/rockchip-u-boot.dtsi
> index f90a8bf085..584f21eb5b 100644
> --- a/arch/arm/dts/rockchip-u-boot.dtsi
> +++ b/arch/arm/dts/rockchip-u-boot.dtsi
> @@ -39,5 +39,35 @@
>   			offset = <CONFIG_SPL_PAD_TO>;
>   		};
>   	};
> +
> +#ifdef CONFIG_ROCKCHIP_SPI_IMAGE
> +	simple-bin-spi {
> +		filename = "u-boot-rockchip-spi.bin";
> +		pad-byte = <0xff>;
> +
> +		mkimage {
> +			filename = "idbloader-spi.img";
> +			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
diff mbox series

Patch

diff --git a/Makefile b/Makefile
index 736c4ad182..e70e92c947 100644
--- a/Makefile
+++ b/Makefile
@@ -2197,7 +2197,8 @@  CLEAN_FILES += include/bmp_logo.h include/bmp_logo_data.h \
 	       idbloader.img 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 mkimage-out.rom.mkimage \
-	       mkimage.rom.mkimage rom.map simple-bin.map
+	       mkimage.rom.mkimage rom.map simple-bin.map simple-bin-spi.map \
+	       idbloader-spi.img
 
 # Directories & files removed with 'make mrproper'
 MRPROPER_DIRS  += include/config include/generated spl tpl \
diff --git a/arch/arm/dts/rockchip-u-boot.dtsi b/arch/arm/dts/rockchip-u-boot.dtsi
index f90a8bf085..584f21eb5b 100644
--- a/arch/arm/dts/rockchip-u-boot.dtsi
+++ b/arch/arm/dts/rockchip-u-boot.dtsi
@@ -39,5 +39,35 @@ 
 			offset = <CONFIG_SPL_PAD_TO>;
 		};
 	};
+
+#ifdef CONFIG_ROCKCHIP_SPI_IMAGE
+	simple-bin-spi {
+		filename = "u-boot-rockchip-spi.bin";
+		pad-byte = <0xff>;
+
+		mkimage {
+			filename = "idbloader-spi.img";
+			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