Re: [PATCH RESEND 2/7] riscv: dts: add binman_linux.dtsi for opensbi os boot mode

2023-10-07 Thread Simon Glass
Hi Randoph,

On Fri, 6 Oct 2023 at 05:26, Randolph  wrote:
>
> The binman_linux.dtsi is a fork of binman.dtsi, just change the first
> section image from the "u-boot" to "linux". Note that the filename
> is also changed. In binman.dtsi, the filename of u-boot section filename
> is called "u-boot-nodtb.bin". In binman_linux.dtsi, the filename should
> be called "Image", which is located in linux/arch/riscv/boot.
>
> Signed-off-by: Randolph 
> ---
>  arch/riscv/dts/binman_linux.dtsi | 79 
>  1 file changed, 79 insertions(+)
>  create mode 100644 arch/riscv/dts/binman_linux.dtsi
>
> diff --git a/arch/riscv/dts/binman_linux.dtsi 
> b/arch/riscv/dts/binman_linux.dtsi
> new file mode 100644
> index 00..334d64bc40
> --- /dev/null
> +++ b/arch/riscv/dts/binman_linux.dtsi
> @@ -0,0 +1,79 @@
> +// SPDX-License-Identifier: GPL-2.0+
> +/*
> + * Copyright (C) 2021, Bin Meng 
> + */
> +
> +#include 
> +
> +/ {
> +   binman: binman {
> +   multiple-images;
> +   };
> +};
> +
> + {
> +   itb {
> +   filename = "linux.itb";
> +
> +   fit {
> +   description = "Configuration to load OpenSBI before 
> Linux";
> +   #address-cells = <1>;
> +   fit,fdt-list = "of-list";
> +
> +   images {
> +   linux {
> +   description = "Linux";
> +   type = "standalone";
> +   os = "Linux";
> +   arch = "riscv";
> +   compression = "none";
> +   load = ;
> +
> +   linux_blob: blob-ext {
> +   filename = "Image";
> +   };
> +   };
> +
> +   opensbi {
> +   description = "OpenSBI fw_dynamic 
> Firmware";
> +   type = "firmware";
> +   os = "opensbi";
> +   arch = "riscv";
> +   compression = "none";
> +   load = ;
> +   entry = 
> ;
> +
> +   opensbi_blob: opensbi {
> +   filename = "fw_dynamic.bin";
> +   missing-msg = "opensbi";
> +   };
> +   };
> +
> +#ifndef CONFIG_OF_BOARD
> +   @fdt-SEQ {
> +   description = "NAME";
> +   type = "flat_dt";
> +   compression = "none";
> +   };
> +#endif
> +   };
> +
> +   configurations {
> +   default = "conf-1";
> +
> +#ifndef CONFIG_OF_BOARD
> +   @conf-SEQ {
> +#else
> +   conf-1 {
> +#endif
> +   description = "NAME";
> +   firmware = "opensbi";
> +   loadables = "linux";
> +#ifndef CONFIG_OF_BOARD
> +   fdt = "fdt-SEQ";
> +#endif
> +   };
> +   };
> +   };
> +   };
> +};
> --
> 2.34.1
>

Could you instead put an #ifdef to include the right file (or nodes)
in a single file?

i.e. always include binman.dtsi but have it do different things in either case?

Regards,
Simon


[PATCH RESEND 2/7] riscv: dts: add binman_linux.dtsi for opensbi os boot mode

2023-10-06 Thread Randolph
The binman_linux.dtsi is a fork of binman.dtsi, just change the first
section image from the "u-boot" to "linux". Note that the filename
is also changed. In binman.dtsi, the filename of u-boot section filename
is called "u-boot-nodtb.bin". In binman_linux.dtsi, the filename should
be called "Image", which is located in linux/arch/riscv/boot.

Signed-off-by: Randolph 
---
 arch/riscv/dts/binman_linux.dtsi | 79 
 1 file changed, 79 insertions(+)
 create mode 100644 arch/riscv/dts/binman_linux.dtsi

diff --git a/arch/riscv/dts/binman_linux.dtsi b/arch/riscv/dts/binman_linux.dtsi
new file mode 100644
index 00..334d64bc40
--- /dev/null
+++ b/arch/riscv/dts/binman_linux.dtsi
@@ -0,0 +1,79 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2021, Bin Meng 
+ */
+
+#include 
+
+/ {
+   binman: binman {
+   multiple-images;
+   };
+};
+
+ {
+   itb {
+   filename = "linux.itb";
+
+   fit {
+   description = "Configuration to load OpenSBI before 
Linux";
+   #address-cells = <1>;
+   fit,fdt-list = "of-list";
+
+   images {
+   linux {
+   description = "Linux";
+   type = "standalone";
+   os = "Linux";
+   arch = "riscv";
+   compression = "none";
+   load = ;
+
+   linux_blob: blob-ext {
+   filename = "Image";
+   };
+   };
+
+   opensbi {
+   description = "OpenSBI fw_dynamic 
Firmware";
+   type = "firmware";
+   os = "opensbi";
+   arch = "riscv";
+   compression = "none";
+   load = ;
+   entry = ;
+
+   opensbi_blob: opensbi {
+   filename = "fw_dynamic.bin";
+   missing-msg = "opensbi";
+   };
+   };
+
+#ifndef CONFIG_OF_BOARD
+   @fdt-SEQ {
+   description = "NAME";
+   type = "flat_dt";
+   compression = "none";
+   };
+#endif
+   };
+
+   configurations {
+   default = "conf-1";
+
+#ifndef CONFIG_OF_BOARD
+   @conf-SEQ {
+#else
+   conf-1 {
+#endif
+   description = "NAME";
+   firmware = "opensbi";
+   loadables = "linux";
+#ifndef CONFIG_OF_BOARD
+   fdt = "fdt-SEQ";
+#endif
+   };
+   };
+   };
+   };
+};
-- 
2.34.1