diff mbox series

[v5,08/11] riscv: dts: jh7110: Support multiple DTBs in a Fit image

Message ID 20241119020425.51989-9-hal.feng@starfivetech.com
State Superseded
Delegated to: Andes
Headers show
Series Support OF_UPSTREAM for StarFive JH7110 | expand

Commit Message

Hal Feng Nov. 19, 2024, 2:04 a.m. UTC
Support multiple DTBs for JH7110 based boards, so they can
select the correct DT at runtime.

Signed-off-by: Hal Feng <hal.feng@starfivetech.com>
---
 arch/riscv/dts/jh7110-common-u-boot.dtsi | 60 ++++++++++++++++++++++--
 1 file changed, 57 insertions(+), 3 deletions(-)

Comments

E Shattow Nov. 22, 2024, 9:20 a.m. UTC | #1
On Mon, Nov 18, 2024 at 6:06 PM Hal Feng <hal.feng@starfivetech.com> wrote:
>
> Support multiple DTBs for JH7110 based boards, so they can
> select the correct DT at runtime.
>
> Signed-off-by: Hal Feng <hal.feng@starfivetech.com>
> ---
>  arch/riscv/dts/jh7110-common-u-boot.dtsi | 60 ++++++++++++++++++++++--
>  1 file changed, 57 insertions(+), 3 deletions(-)
>
> diff --git a/arch/riscv/dts/jh7110-common-u-boot.dtsi b/arch/riscv/dts/jh7110-common-u-boot.dtsi
> index c44553455e..3928d551c9 100644
> --- a/arch/riscv/dts/jh7110-common-u-boot.dtsi
> +++ b/arch/riscv/dts/jh7110-common-u-boot.dtsi
> @@ -113,20 +113,74 @@
>                 fit {
>                         images {
>                                 fdt-1 {
> -                                       description = "NAME";
> +                                       description = "jh7110-starfive-visionfive-2-v1.3b";
>                                         load = <0x40400000>;
>                                         compression = "none";
>
> -                                       uboot_fdt_blob: blob-ext {
> -                                               filename = "u-boot.dtb";
> +                                       blob-ext {
> +                                               filename = "dts/upstream/src/riscv/starfive/jh7110-starfive-visionfive-2-v1.3b.dtb";
> +                                       };
> +                               };
> +
> +                               fdt-2 {
> +                                       description = "jh7110-starfive-visionfive-2-v1.2a";
> +                                       load = <0x40400000>;
> +                                       compression = "none";
> +
> +                                       blob-ext {
> +                                               filename = "dts/upstream/src/riscv/starfive/jh7110-starfive-visionfive-2-v1.2a.dtb";
> +                                       };
> +                               };
> +
> +                               fdt-3 {
> +                                       description = "jh7110-milkv-mars";
> +                                       load = <0x40400000>;
> +                                       compression = "none";
> +
> +                                       blob-ext {
> +                                               filename = "dts/upstream/src/riscv/starfive/jh7110-milkv-mars.dtb";
> +                                       };
> +                               };
> +
> +                               fdt-4 {
> +                                       description = "jh7110-pine64-star64";
> +                                       load = <0x40400000>;
> +                                       compression = "none";
> +
> +                                       blob-ext {
> +                                               filename = "dts/upstream/src/riscv/starfive/jh7110-pine64-star64.dtb";
>                                         };
>                                 };
>                         };
>
>                         configurations {
>                                 conf-1 {
> +                                       description = "jh7110-starfive-visionfive-2-v1.3b";
> +                                       firmware = "opensbi";
> +                                       loadables = "uboot";
>                                         fdt = "fdt-1";
>                                 };
> +
> +                               conf-2 {
> +                                       description = "jh7110-starfive-visionfive-2-v1.2a";
> +                                       firmware = "opensbi";
> +                                       loadables = "uboot";
> +                                       fdt = "fdt-2";
> +                               };
> +
> +                               conf-3 {
> +                                       description = "jh7110-milkv-mars";
> +                                       firmware = "opensbi";
> +                                       loadables = "uboot";
> +                                       fdt = "fdt-3";
> +                               };
> +
> +                               conf-4 {
> +                                       description = "jh7110-pine64-star64";
> +                                       firmware = "opensbi";
> +                                       loadables = "uboot";
> +                                       fdt = "fdt-4";
> +                               };
>                         };
>                 };
>         };
> --
> 2.43.2
>

Are we sure it is a good idea to have sequential numbering for things
that ought to be ordered by alphanumeric? Sounds to me like a noisy
commit in the future when adding board support and trying to sort, or
just piling on sequential additions.

fit{ images{ fdt-1 { ... } } }
configurations{ conf-1 { description =
"jh7110-starfive-visionfive-2-v1.3b" ... fdt = "fdt-1" } }

This is perhaps not as good as it can be, for being git commit
friendly when adding board support that is sorted by name.

What about?:

fit{ images{ fdt-starfive-visionfive-2-v1.3b { ... } } }
configurations{ conf-starfive-visionfive-2-v1.3b { description =
"jh7110-starfive-visionfive-2-v1.3b" ... fdt =
"fdt-starfive-visionfive-2-v1.3b" } }

based on the compatible identifier for that board or does that break something?

-E
Hal Feng Nov. 24, 2024, 11:38 p.m. UTC | #2
> On 22.11.24 17:21, E Shattow wrote: 
> On Mon, Nov 18, 2024 at 6:06 PM Hal Feng <hal.feng@starfivetech.com>
> wrote:
> >
> > Support multiple DTBs for JH7110 based boards, so they can select the
> > correct DT at runtime.
> >
> > Signed-off-by: Hal Feng <hal.feng@starfivetech.com>
> > ---
> >  arch/riscv/dts/jh7110-common-u-boot.dtsi | 60
> > ++++++++++++++++++++++--
> >  1 file changed, 57 insertions(+), 3 deletions(-)
> >
> > diff --git a/arch/riscv/dts/jh7110-common-u-boot.dtsi
> > b/arch/riscv/dts/jh7110-common-u-boot.dtsi
> > index c44553455e..3928d551c9 100644
> > --- a/arch/riscv/dts/jh7110-common-u-boot.dtsi
> > +++ b/arch/riscv/dts/jh7110-common-u-boot.dtsi
> > @@ -113,20 +113,74 @@
> >                 fit {
> >                         images {
> >                                 fdt-1 {
> > -                                       description = "NAME";
> > +                                       description =
> > + "jh7110-starfive-visionfive-2-v1.3b";
> >                                         load = <0x40400000>;
> >                                         compression = "none";
> >
> > -                                       uboot_fdt_blob: blob-ext {
> > -                                               filename = "u-boot.dtb";
> > +                                       blob-ext {
> > +                                               filename =
> "dts/upstream/src/riscv/starfive/jh7110-starfive-visionfive-2-v1.3b.dtb";
> > +                                       };
> > +                               };
> > +
> > +                               fdt-2 {
> > +                                       description = "jh7110-starfive-visionfive-2-v1.2a";
> > +                                       load = <0x40400000>;
> > +                                       compression = "none";
> > +
> > +                                       blob-ext {
> > +                                               filename =
> "dts/upstream/src/riscv/starfive/jh7110-starfive-visionfive-2-v1.2a.dtb";
> > +                                       };
> > +                               };
> > +
> > +                               fdt-3 {
> > +                                       description = "jh7110-milkv-mars";
> > +                                       load = <0x40400000>;
> > +                                       compression = "none";
> > +
> > +                                       blob-ext {
> > +                                               filename =
> "dts/upstream/src/riscv/starfive/jh7110-milkv-mars.dtb";
> > +                                       };
> > +                               };
> > +
> > +                               fdt-4 {
> > +                                       description = "jh7110-pine64-star64";
> > +                                       load = <0x40400000>;
> > +                                       compression = "none";
> > +
> > +                                       blob-ext {
> > +                                               filename =
> > + "dts/upstream/src/riscv/starfive/jh7110-pine64-star64.dtb";
> >                                         };
> >                                 };
> >                         };
> >
> >                         configurations {
> >                                 conf-1 {
> > +                                       description = "jh7110-starfive-visionfive-2-v1.3b";
> > +                                       firmware = "opensbi";
> > +                                       loadables = "uboot";
> >                                         fdt = "fdt-1";
> >                                 };
> > +
> > +                               conf-2 {
> > +                                       description = "jh7110-starfive-visionfive-2-v1.2a";
> > +                                       firmware = "opensbi";
> > +                                       loadables = "uboot";
> > +                                       fdt = "fdt-2";
> > +                               };
> > +
> > +                               conf-3 {
> > +                                       description = "jh7110-milkv-mars";
> > +                                       firmware = "opensbi";
> > +                                       loadables = "uboot";
> > +                                       fdt = "fdt-3";
> > +                               };
> > +
> > +                               conf-4 {
> > +                                       description = "jh7110-pine64-star64";
> > +                                       firmware = "opensbi";
> > +                                       loadables = "uboot";
> > +                                       fdt = "fdt-4";
> > +                               };
> >                         };
> >                 };
> >         };
> > --
> > 2.43.2
> >
> 
> Are we sure it is a good idea to have sequential numbering for things that
> ought to be ordered by alphanumeric? Sounds to me like a noisy commit in the
> future when adding board support and trying to sort, or just piling on
> sequential additions.
> 
> fit{ images{ fdt-1 { ... } } }
> configurations{ conf-1 { description =
> "jh7110-starfive-visionfive-2-v1.3b" ... fdt = "fdt-1" } }
> 
> This is perhaps not as good as it can be, for being git commit friendly when
> adding board support that is sorted by name.
> 
> What about?:
> 
> fit{ images{ fdt-starfive-visionfive-2-v1.3b { ... } } } configurations{ conf-
> starfive-visionfive-2-v1.3b { description = "jh7110-starfive-visionfive-2-
> v1.3b" ... fdt = "fdt-starfive-visionfive-2-v1.3b" } }
> 
> based on the compatible identifier for that board or does that break
> something?

Yeah, it's ok and I will modify accordingly. Thanks.

Best regards,
Hal
diff mbox series

Patch

diff --git a/arch/riscv/dts/jh7110-common-u-boot.dtsi b/arch/riscv/dts/jh7110-common-u-boot.dtsi
index c44553455e..3928d551c9 100644
--- a/arch/riscv/dts/jh7110-common-u-boot.dtsi
+++ b/arch/riscv/dts/jh7110-common-u-boot.dtsi
@@ -113,20 +113,74 @@ 
 		fit {
 			images {
 				fdt-1 {
-					description = "NAME";
+					description = "jh7110-starfive-visionfive-2-v1.3b";
 					load = <0x40400000>;
 					compression = "none";
 
-					uboot_fdt_blob: blob-ext {
-						filename = "u-boot.dtb";
+					blob-ext {
+						filename = "dts/upstream/src/riscv/starfive/jh7110-starfive-visionfive-2-v1.3b.dtb";
+					};
+				};
+
+				fdt-2 {
+					description = "jh7110-starfive-visionfive-2-v1.2a";
+					load = <0x40400000>;
+					compression = "none";
+
+					blob-ext {
+						filename = "dts/upstream/src/riscv/starfive/jh7110-starfive-visionfive-2-v1.2a.dtb";
+					};
+				};
+
+				fdt-3 {
+					description = "jh7110-milkv-mars";
+					load = <0x40400000>;
+					compression = "none";
+
+					blob-ext {
+						filename = "dts/upstream/src/riscv/starfive/jh7110-milkv-mars.dtb";
+					};
+				};
+
+				fdt-4 {
+					description = "jh7110-pine64-star64";
+					load = <0x40400000>;
+					compression = "none";
+
+					blob-ext {
+						filename = "dts/upstream/src/riscv/starfive/jh7110-pine64-star64.dtb";
 					};
 				};
 			};
 
 			configurations {
 				conf-1 {
+					description = "jh7110-starfive-visionfive-2-v1.3b";
+					firmware = "opensbi";
+					loadables = "uboot";
 					fdt = "fdt-1";
 				};
+
+				conf-2 {
+					description = "jh7110-starfive-visionfive-2-v1.2a";
+					firmware = "opensbi";
+					loadables = "uboot";
+					fdt = "fdt-2";
+				};
+
+				conf-3 {
+					description = "jh7110-milkv-mars";
+					firmware = "opensbi";
+					loadables = "uboot";
+					fdt = "fdt-3";
+				};
+
+				conf-4 {
+					description = "jh7110-pine64-star64";
+					firmware = "opensbi";
+					loadables = "uboot";
+					fdt = "fdt-4";
+				};
 			};
 		};
 	};