diff mbox series

[9/9] riscv: sifive: unleashed: Switch to use binman to generate u-boot.itb

Message ID 20210505141557.23901-10-bmeng.cn@gmail.com
State Superseded
Delegated to: Andes
Headers show
Series riscv: Partially move to binman to generate u-boot.itb | expand

Commit Message

Bin Meng May 5, 2021, 2:15 p.m. UTC
At present SiFive Unleashed board uses the Makefile to create the FIT,
using USE_SPL_FIT_GENERATOR, which is deprecated as per the Makefile
warning. Update to use binman instead.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>

---

 arch/riscv/dts/binman.dtsi                    | 70 +++++++++++++++++++
 .../dts/hifive-unleashed-a00-u-boot.dtsi      |  1 +
 board/sifive/unleashed/Kconfig                |  1 +
 configs/sifive_unleashed_defconfig            |  1 +
 4 files changed, 73 insertions(+)
 create mode 100644 arch/riscv/dts/binman.dtsi

Comments

Simon Glass May 5, 2021, 11:37 p.m. UTC | #1
On Wed, 5 May 2021 at 08:16, Bin Meng <bmeng.cn@gmail.com> wrote:
>
> At present SiFive Unleashed board uses the Makefile to create the FIT,
> using USE_SPL_FIT_GENERATOR, which is deprecated as per the Makefile
> warning. Update to use binman instead.
>
> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
>
> ---
>
>  arch/riscv/dts/binman.dtsi                    | 70 +++++++++++++++++++
>  .../dts/hifive-unleashed-a00-u-boot.dtsi      |  1 +
>  board/sifive/unleashed/Kconfig                |  1 +
>  configs/sifive_unleashed_defconfig            |  1 +
>  4 files changed, 73 insertions(+)
>  create mode 100644 arch/riscv/dts/binman.dtsi

Reviewed-by: Simon Glass <sjg@chromium.org>

Is it possible to migrate all the boards so as not to leave two paths in use?
diff mbox series

Patch

diff --git a/arch/riscv/dts/binman.dtsi b/arch/riscv/dts/binman.dtsi
new file mode 100644
index 0000000000..f2f8647b24
--- /dev/null
+++ b/arch/riscv/dts/binman.dtsi
@@ -0,0 +1,70 @@ 
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2021, Bin Meng <bmeng.cn@gmail.com>
+ */
+
+#include <config.h>
+
+/ {
+	binman: binman {
+		multiple-images;
+	};
+};
+
+&binman {
+	itb {
+		filename = "u-boot.itb";
+
+		fit {
+			description = "Configuration to load OpenSBI before U-Boot";
+			#address-cells = <1>;
+			fit,fdt-list = "of-list";
+
+			images {
+				uboot {
+					description = "U-Boot";
+					type = "standalone";
+					os = "U-Boot";
+					arch = "riscv";
+					compression = "none";
+					load = <CONFIG_SYS_TEXT_BASE>;
+
+					uboot_blob: blob-ext {
+						filename = "u-boot-nodtb.bin";
+					};
+				};
+
+				opensbi {
+					description = "OpenSBI fw_dynamic Firmware";
+					type = "firmware";
+					os = "opensbi";
+					arch = "riscv";
+					compression = "none";
+					load = <CONFIG_SPL_OPENSBI_LOAD_ADDR>;
+					entry = <CONFIG_SPL_OPENSBI_LOAD_ADDR>;
+
+					opensbi_blob: blob-ext {
+						filename = "fw_dynamic.bin";
+					};
+				};
+
+				@fdt-SEQ {
+					description = "NAME";
+					type = "flat_dt";
+					compression = "none";
+				};
+			};
+
+			configurations {
+				default = "conf-1";
+
+				@conf-SEQ {
+					description = "NAME";
+					firmware = "opensbi";
+					loadables = "uboot";
+					fdt = "fdt-SEQ";
+				};
+			};
+		};
+	};
+};
diff --git a/arch/riscv/dts/hifive-unleashed-a00-u-boot.dtsi b/arch/riscv/dts/hifive-unleashed-a00-u-boot.dtsi
index 1996149c95..51b566116d 100644
--- a/arch/riscv/dts/hifive-unleashed-a00-u-boot.dtsi
+++ b/arch/riscv/dts/hifive-unleashed-a00-u-boot.dtsi
@@ -3,6 +3,7 @@ 
  * Copyright (C) 2019 Jagan Teki <jagan@amarulasolutions.com>
  */
 
+#include "binman.dtsi"
 #include "fu540-c000-u-boot.dtsi"
 #include "fu540-hifive-unleashed-a00-ddr.dtsi"
 
diff --git a/board/sifive/unleashed/Kconfig b/board/sifive/unleashed/Kconfig
index dbffd59c98..b08652365f 100644
--- a/board/sifive/unleashed/Kconfig
+++ b/board/sifive/unleashed/Kconfig
@@ -27,6 +27,7 @@  config BOARD_SPECIFIC_OPTIONS # dummy
 	def_bool y
 	select SIFIVE_FU540
 	select ENV_IS_IN_SPI_FLASH
+	select BINMAN if !USE_SPL_FIT_GENERATOR
 	imply CMD_DHCP
 	imply CMD_EXT2
 	imply CMD_EXT4
diff --git a/configs/sifive_unleashed_defconfig b/configs/sifive_unleashed_defconfig
index 62416a7c1d..dc9313e572 100644
--- a/configs/sifive_unleashed_defconfig
+++ b/configs/sifive_unleashed_defconfig
@@ -14,6 +14,7 @@  CONFIG_RISCV_SMODE=y
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_FIT=y
 CONFIG_SPL_LOAD_FIT_ADDRESS=0x84000000
+# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_DISPLAY_CPUINFO=y
 CONFIG_DISPLAY_BOARDINFO=y
 CONFIG_MISC_INIT_R=y