On 10.02.25 14:08, Simon Glass wrote:
Hi Heinrich,

On Mon, 10 Feb 2025 at 04:18, Heinrich Schuchardt
<heinrich.schucha...@canonical.com> wrote:

Booting JH7110 systems with a VisionFive 2 device-tree used to kind of
work without causing harm to the hardware. But there is no guarantee
that this will hold true in future. So we should not rely on it.

Before the current patch series booting failed on unsupported boards due
to the lack of a device-tree in the binman generated default configuration
when reaching main U-Boot.

By setting the default configuration to non-matching value booting will
now fail on unsupported boards already in SPL. This allows SPL to
continue with the next boot source for a possible recovery.

Signed-off-by: Heinrich Schuchardt <heinrich.schucha...@canonical.com>
---
v2:
         new patch
---
  arch/riscv/dts/starfive-visionfive2-binman.dtsi | 13 +++++++++++++
  1 file changed, 13 insertions(+)

diff --git a/arch/riscv/dts/starfive-visionfive2-binman.dtsi 
b/arch/riscv/dts/starfive-visionfive2-binman.dtsi
index 05787bdb92d..dd0faca6824 100644
--- a/arch/riscv/dts/starfive-visionfive2-binman.dtsi
+++ b/arch/riscv/dts/starfive-visionfive2-binman.dtsi
@@ -13,6 +13,19 @@
  };

  &binman {
+       itb {
+               fit {
+                       configurations {
+                               /*
+                                * Do not boot if there is no matching
+                                * configuration. We can't remove the default
+                                * here. So use a non-matching value.
+                                */
+                               default = "none";

The 'default' is optional [1] but the spec is silent on what happens
when the default is missing. What do you think it should do? Perhaps
we should add a property to define the behaviour?

If there is no match and default does not exist, we should not boot.

In our current code we don't boot if default points to a non-existing config. But having inconsistent FIT images might not be the best idea.

Maybe it would be better to use

#ifndef CONFIG_MULTI_DTB_FIT
        default = "conf-1";
#endif

in arch/riscv/dts/binman.dtsi to avoid having an invalid default value?

Best regards

Heinrich


+                       };
+               };
+       };
+
         spl-img {
                 filename = "spl/u-boot-spl.bin.normal.out";

--
2.47.1


Regards,
SImon

[1] https://fitspec.osfw.foundation/#id4

Reply via email to