Re: [PATCH V2 3/7] riscv: dts: binman: add condition for opensbi os boot

2023-10-12 Thread Simon Glass
On Wed, 11 Oct 2023 at 23:43, Randolph  wrote:
>
> Add condition for OpenSBI OS boot mode, by default it is not enabled.
> By default, binman creates the output file u-boot.itb.
> If SPL_OPENSBI_OS_BOOT is enabled, linux.itb will be created
> after compilation instead of the default u-boot.itb.
>
> Signed-off-by: Randolph 
> ---
>  arch/riscv/dts/binman.dtsi | 24 
>  1 file changed, 24 insertions(+)
>

Reviewed-by: Simon Glass 

You do have the option of creating two images, so you can support both
boot approaches. Then you would need to do the check at runtime,
somehow.


[PATCH V2 3/7] riscv: dts: binman: add condition for opensbi os boot

2023-10-12 Thread Randolph
Add condition for OpenSBI OS boot mode, by default it is not enabled.
By default, binman creates the output file u-boot.itb.
If SPL_OPENSBI_OS_BOOT is enabled, linux.itb will be created
after compilation instead of the default u-boot.itb.

Signed-off-by: Randolph 
---
 arch/riscv/dts/binman.dtsi | 24 
 1 file changed, 24 insertions(+)

diff --git a/arch/riscv/dts/binman.dtsi b/arch/riscv/dts/binman.dtsi
index 156cb00971..1a55097d71 100644
--- a/arch/riscv/dts/binman.dtsi
+++ b/arch/riscv/dts/binman.dtsi
@@ -13,7 +13,12 @@
 
  {
itb {
+
+#ifndef CONFIG_SPL_LOAD_FIT_OPENSBI_OS_BOOT
filename = "u-boot.itb";
+#else
+   filename = "linux.itb";
+#endif
 
fit {
description = "Configuration to load OpenSBI before 
U-Boot";
@@ -21,6 +26,7 @@
fit,fdt-list = "of-list";
 
images {
+#ifndef CONFIG_SPL_LOAD_FIT_OPENSBI_OS_BOOT
uboot {
description = "U-Boot";
type = "standalone";
@@ -33,6 +39,20 @@
filename = "u-boot-nodtb.bin";
};
};
+#else
+   linux {
+   description = "Linux";
+   type = "standalone";
+   os = "Linux";
+   arch = "riscv";
+   compression = "none";
+   load = ;
+
+   linux_blob: blob-ext {
+   filename = "Image";
+   };
+   };
+#endif
 
opensbi {
description = "OpenSBI fw_dynamic 
Firmware";
@@ -68,7 +88,11 @@
 #endif
description = "NAME";
firmware = "opensbi";
+#ifndef CONFIG_SPL_LOAD_FIT_OPENSBI_OS_BOOT
loadables = "uboot";
+#else
+   loadables = "linux";
+#endif
 #ifndef CONFIG_OF_BOARD
fdt = "fdt-SEQ";
 #endif
-- 
2.34.1