diff mbox

[U-Boot] ARM: dts: uniphier: move aliases node up to make fdtgrep happy

Message ID 1459170639-23386-1-git-send-email-yamada.masahiro@socionext.com
State Accepted
Commit 6c64d50e47cbb9f68f53cc67f178d1a09f63b369
Delegated to: Masahiro Yamada
Headers show

Commit Message

Masahiro Yamada March 28, 2016, 1:10 p.m. UTC
Currently, fdtgrep would not accept uniphier-ph1-ld20-ref.dtb
and uniphier-ph1-ld11-ref.dtb unless the aliases node comes
the first in the root node.

$ make -s uniphier_pxs2_ld6b_defconfig
$ make CROSS_COMPILE=arm-linux-gnueabi- DEVICE_TREE=uniphier-ph1-ld20-ref
  [snip]
  LDS     spl/u-boot-spl.lds
  LD      spl/u-boot-spl
  OBJCOPY spl/u-boot-spl-nodtb.bin
  FDTGREP spl/u-boot-spl.dtb
Error at 'fdt_find_regions': FDT_ERR_BADLAYOUT
/aliases node must come before all other nodes
Error: FDT_ERR_BADMAGIC
make[1]: *** [spl/u-boot-spl.dtb] Error 1
make: *** [spl/u-boot-spl] Error 2

This commit moves the aliases node as the error message from the
fdtgrep tool suggests, although this requirement does not sound
reasonable to me.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

Simon,

I'd like to avoid this patch if possible.

Not figured out the root cause of the problem yet?



 arch/arm/dts/uniphier-ph1-ld11-ref.dts | 18 +++++++++---------
 arch/arm/dts/uniphier-ph1-ld20-ref.dts | 18 +++++++++---------
 2 files changed, 18 insertions(+), 18 deletions(-)

Comments

Masahiro Yamada April 18, 2016, 6:50 a.m. UTC | #1
Hi Simon,

No news about fdtgrep?

I will apply this patch in a few days, though I am not happy about it.



2016-03-28 22:10 GMT+09:00 Masahiro Yamada <yamada.masahiro@socionext.com>:
> Currently, fdtgrep would not accept uniphier-ph1-ld20-ref.dtb
> and uniphier-ph1-ld11-ref.dtb unless the aliases node comes
> the first in the root node.
>
> $ make -s uniphier_pxs2_ld6b_defconfig
> $ make CROSS_COMPILE=arm-linux-gnueabi- DEVICE_TREE=uniphier-ph1-ld20-ref
>   [snip]
>   LDS     spl/u-boot-spl.lds
>   LD      spl/u-boot-spl
>   OBJCOPY spl/u-boot-spl-nodtb.bin
>   FDTGREP spl/u-boot-spl.dtb
> Error at 'fdt_find_regions': FDT_ERR_BADLAYOUT
> /aliases node must come before all other nodes
> Error: FDT_ERR_BADMAGIC
> make[1]: *** [spl/u-boot-spl.dtb] Error 1
> make: *** [spl/u-boot-spl] Error 2
>
> This commit moves the aliases node as the error message from the
> fdtgrep tool suggests, although this requirement does not sound
> reasonable to me.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---
>
> Simon,
>
> I'd like to avoid this patch if possible.
>
> Not figured out the root cause of the problem yet?
>
>
>
>  arch/arm/dts/uniphier-ph1-ld11-ref.dts | 18 +++++++++---------
>  arch/arm/dts/uniphier-ph1-ld20-ref.dts | 18 +++++++++---------
>  2 files changed, 18 insertions(+), 18 deletions(-)
>
> diff --git a/arch/arm/dts/uniphier-ph1-ld11-ref.dts b/arch/arm/dts/uniphier-ph1-ld11-ref.dts
> index a624a49..88e7f53 100644
> --- a/arch/arm/dts/uniphier-ph1-ld11-ref.dts
> +++ b/arch/arm/dts/uniphier-ph1-ld11-ref.dts
> @@ -14,15 +14,6 @@
>         model = "UniPhier PH1-LD11 Reference Board";
>         compatible = "socionext,ph1-ld11-ref", "socionext,ph1-ld11";
>
> -       memory {
> -               device_type = "memory";
> -               reg = <0 0x80000000 0 0x40000000>;
> -       };
> -
> -       chosen {
> -               stdout-path = "serial0:115200n8";
> -       };
> -
>         aliases {
>                 serial0 = &serial0;
>                 serial1 = &serial1;
> @@ -35,6 +26,15 @@
>                 i2c4 = &i2c4;
>                 i2c5 = &i2c5;
>         };
> +
> +       memory {
> +               device_type = "memory";
> +               reg = <0 0x80000000 0 0x40000000>;
> +       };
> +
> +       chosen {
> +               stdout-path = "serial0:115200n8";
> +       };
>  };
>
>  &ethsc {
> diff --git a/arch/arm/dts/uniphier-ph1-ld20-ref.dts b/arch/arm/dts/uniphier-ph1-ld20-ref.dts
> index 108adeb..a55d90c 100644
> --- a/arch/arm/dts/uniphier-ph1-ld20-ref.dts
> +++ b/arch/arm/dts/uniphier-ph1-ld20-ref.dts
> @@ -14,15 +14,6 @@
>         model = "UniPhier PH1-LD20 Reference Board";
>         compatible = "socionext,ph1-ld20-ref", "socionext,ph1-ld20";
>
> -       memory {
> -               device_type = "memory";
> -               reg = <0 0x80000000 0 0xc0000000>;
> -       };
> -
> -       chosen {
> -               stdout-path = "serial0:115200n8";
> -       };
> -
>         aliases {
>                 serial0 = &serial0;
>                 serial1 = &serial1;
> @@ -35,6 +26,15 @@
>                 i2c4 = &i2c4;
>                 i2c5 = &i2c5;
>         };
> +
> +       memory {
> +               device_type = "memory";
> +               reg = <0 0x80000000 0 0xc0000000>;
> +       };
> +
> +       chosen {
> +               stdout-path = "serial0:115200n8";
> +       };
>  };
>
>  &ethsc {
> --
> 1.9.1
>
> _______________________________________________
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
Simon Glass April 18, 2016, 5:48 p.m. UTC | #2
HI Masahiro,

On 18 April 2016 at 00:50, Masahiro Yamada
<yamada.masahiro@socionext.com> wrote:
>
> Hi Simon,
>
> No news about fdtgrep?
>
> I will apply this patch in a few days, though I am not happy about it.

No sorry I have not got back to it. I recently did some buildman
fixes. I should get to it in the next few weeks but it will not be in
time for this release.

Regards,
Simon

>
>
>
> 2016-03-28 22:10 GMT+09:00 Masahiro Yamada <yamada.masahiro@socionext.com>:
> > Currently, fdtgrep would not accept uniphier-ph1-ld20-ref.dtb
> > and uniphier-ph1-ld11-ref.dtb unless the aliases node comes
> > the first in the root node.
> >
> > $ make -s uniphier_pxs2_ld6b_defconfig
> > $ make CROSS_COMPILE=arm-linux-gnueabi- DEVICE_TREE=uniphier-ph1-ld20-ref
> >   [snip]
> >   LDS     spl/u-boot-spl.lds
> >   LD      spl/u-boot-spl
> >   OBJCOPY spl/u-boot-spl-nodtb.bin
> >   FDTGREP spl/u-boot-spl.dtb
> > Error at 'fdt_find_regions': FDT_ERR_BADLAYOUT
> > /aliases node must come before all other nodes
> > Error: FDT_ERR_BADMAGIC
> > make[1]: *** [spl/u-boot-spl.dtb] Error 1
> > make: *** [spl/u-boot-spl] Error 2
> >
> > This commit moves the aliases node as the error message from the
> > fdtgrep tool suggests, although this requirement does not sound
> > reasonable to me.
> >
> > Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> > ---
> >
> > Simon,
> >
> > I'd like to avoid this patch if possible.
> >
> > Not figured out the root cause of the problem yet?
> >
> >
> >
> >  arch/arm/dts/uniphier-ph1-ld11-ref.dts | 18 +++++++++---------
> >  arch/arm/dts/uniphier-ph1-ld20-ref.dts | 18 +++++++++---------
> >  2 files changed, 18 insertions(+), 18 deletions(-)
> >
> > diff --git a/arch/arm/dts/uniphier-ph1-ld11-ref.dts b/arch/arm/dts/uniphier-ph1-ld11-ref.dts
> > index a624a49..88e7f53 100644
> > --- a/arch/arm/dts/uniphier-ph1-ld11-ref.dts
> > +++ b/arch/arm/dts/uniphier-ph1-ld11-ref.dts
> > @@ -14,15 +14,6 @@
> >         model = "UniPhier PH1-LD11 Reference Board";
> >         compatible = "socionext,ph1-ld11-ref", "socionext,ph1-ld11";
> >
> > -       memory {
> > -               device_type = "memory";
> > -               reg = <0 0x80000000 0 0x40000000>;
> > -       };
> > -
> > -       chosen {
> > -               stdout-path = "serial0:115200n8";
> > -       };
> > -
> >         aliases {
> >                 serial0 = &serial0;
> >                 serial1 = &serial1;
> > @@ -35,6 +26,15 @@
> >                 i2c4 = &i2c4;
> >                 i2c5 = &i2c5;
> >         };
> > +
> > +       memory {
> > +               device_type = "memory";
> > +               reg = <0 0x80000000 0 0x40000000>;
> > +       };
> > +
> > +       chosen {
> > +               stdout-path = "serial0:115200n8";
> > +       };
> >  };
> >
> >  &ethsc {
> > diff --git a/arch/arm/dts/uniphier-ph1-ld20-ref.dts b/arch/arm/dts/uniphier-ph1-ld20-ref.dts
> > index 108adeb..a55d90c 100644
> > --- a/arch/arm/dts/uniphier-ph1-ld20-ref.dts
> > +++ b/arch/arm/dts/uniphier-ph1-ld20-ref.dts
> > @@ -14,15 +14,6 @@
> >         model = "UniPhier PH1-LD20 Reference Board";
> >         compatible = "socionext,ph1-ld20-ref", "socionext,ph1-ld20";
> >
> > -       memory {
> > -               device_type = "memory";
> > -               reg = <0 0x80000000 0 0xc0000000>;
> > -       };
> > -
> > -       chosen {
> > -               stdout-path = "serial0:115200n8";
> > -       };
> > -
> >         aliases {
> >                 serial0 = &serial0;
> >                 serial1 = &serial1;
> > @@ -35,6 +26,15 @@
> >                 i2c4 = &i2c4;
> >                 i2c5 = &i2c5;
> >         };
> > +
> > +       memory {
> > +               device_type = "memory";
> > +               reg = <0 0x80000000 0 0xc0000000>;
> > +       };
> > +
> > +       chosen {
> > +               stdout-path = "serial0:115200n8";
> > +       };
> >  };
> >
> >  &ethsc {
> > --
> > 1.9.1
> >
> > _______________________________________________
> > U-Boot mailing list
> > U-Boot@lists.denx.de
> > http://lists.denx.de/mailman/listinfo/u-boot
>
>
>
> --
> Best Regards
> Masahiro Yamada
Masahiro Yamada Feb. 27, 2017, 12:50 p.m. UTC | #3
Hi Simon,


2016-04-19 2:48 GMT+09:00 Simon Glass <sjg@chromium.org>:
> HI Masahiro,
>
> On 18 April 2016 at 00:50, Masahiro Yamada
> <yamada.masahiro@socionext.com> wrote:
>>
>> Hi Simon,
>>
>> No news about fdtgrep?
>>
>> I will apply this patch in a few days, though I am not happy about it.
>
> No sorry I have not got back to it. I recently did some buildman
> fixes. I should get to it in the next few weeks but it will not be in
> time for this release.
>
> Regards,
> Simon



Almost one year has passed since then.


I still suffer from FDT_ERR_BADLAYOUT error of the fdtgrep
when I try to sync DT files with Linux.


Any progress on this?


For example,
http://patchwork.ozlabs.org/patch/732708/

causes the following error.

  OBJCOPY spl/u-boot-spl-nodtb.bin
  FDTGREP spl/u-boot-spl.dtb
Error at 'fdt_find_regions': FDT_ERR_BADLAYOUT
/aliases node must come before all other nodes


This seems unrelated to my patch.
I believe the problem is on the side of the fdtgrep.





>>
>>
>>
>> 2016-03-28 22:10 GMT+09:00 Masahiro Yamada <yamada.masahiro@socionext.com>:
>> > Currently, fdtgrep would not accept uniphier-ph1-ld20-ref.dtb
>> > and uniphier-ph1-ld11-ref.dtb unless the aliases node comes
>> > the first in the root node.
>> >
>> > $ make -s uniphier_pxs2_ld6b_defconfig
>> > $ make CROSS_COMPILE=arm-linux-gnueabi- DEVICE_TREE=uniphier-ph1-ld20-ref
>> >   [snip]
>> >   LDS     spl/u-boot-spl.lds
>> >   LD      spl/u-boot-spl
>> >   OBJCOPY spl/u-boot-spl-nodtb.bin
>> >   FDTGREP spl/u-boot-spl.dtb
>> > Error at 'fdt_find_regions': FDT_ERR_BADLAYOUT
>> > /aliases node must come before all other nodes
>> > Error: FDT_ERR_BADMAGIC
>> > make[1]: *** [spl/u-boot-spl.dtb] Error 1
>> > make: *** [spl/u-boot-spl] Error 2
>> >
>> > This commit moves the aliases node as the error message from the
>> > fdtgrep tool suggests, although this requirement does not sound
>> > reasonable to me.
>> >
>> > Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
>> > ---
>> >
>> > Simon,
>> >
>> > I'd like to avoid this patch if possible.
>> >
>> > Not figured out the root cause of the problem yet?
>> >
>> >
>> >
>> >  arch/arm/dts/uniphier-ph1-ld11-ref.dts | 18 +++++++++---------
>> >  arch/arm/dts/uniphier-ph1-ld20-ref.dts | 18 +++++++++---------
>> >  2 files changed, 18 insertions(+), 18 deletions(-)
>> >
>> > diff --git a/arch/arm/dts/uniphier-ph1-ld11-ref.dts b/arch/arm/dts/uniphier-ph1-ld11-ref.dts
>> > index a624a49..88e7f53 100644
>> > --- a/arch/arm/dts/uniphier-ph1-ld11-ref.dts
>> > +++ b/arch/arm/dts/uniphier-ph1-ld11-ref.dts
>> > @@ -14,15 +14,6 @@
>> >         model = "UniPhier PH1-LD11 Reference Board";
>> >         compatible = "socionext,ph1-ld11-ref", "socionext,ph1-ld11";
>> >
>> > -       memory {
>> > -               device_type = "memory";
>> > -               reg = <0 0x80000000 0 0x40000000>;
>> > -       };
>> > -
>> > -       chosen {
>> > -               stdout-path = "serial0:115200n8";
>> > -       };
>> > -
>> >         aliases {
>> >                 serial0 = &serial0;
>> >                 serial1 = &serial1;
>> > @@ -35,6 +26,15 @@
>> >                 i2c4 = &i2c4;
>> >                 i2c5 = &i2c5;
>> >         };
>> > +
>> > +       memory {
>> > +               device_type = "memory";
>> > +               reg = <0 0x80000000 0 0x40000000>;
>> > +       };
>> > +
>> > +       chosen {
>> > +               stdout-path = "serial0:115200n8";
>> > +       };
>> >  };
>> >
>> >  &ethsc {
>> > diff --git a/arch/arm/dts/uniphier-ph1-ld20-ref.dts b/arch/arm/dts/uniphier-ph1-ld20-ref.dts
>> > index 108adeb..a55d90c 100644
>> > --- a/arch/arm/dts/uniphier-ph1-ld20-ref.dts
>> > +++ b/arch/arm/dts/uniphier-ph1-ld20-ref.dts
>> > @@ -14,15 +14,6 @@
>> >         model = "UniPhier PH1-LD20 Reference Board";
>> >         compatible = "socionext,ph1-ld20-ref", "socionext,ph1-ld20";
>> >
>> > -       memory {
>> > -               device_type = "memory";
>> > -               reg = <0 0x80000000 0 0xc0000000>;
>> > -       };
>> > -
>> > -       chosen {
>> > -               stdout-path = "serial0:115200n8";
>> > -       };
>> > -
>> >         aliases {
>> >                 serial0 = &serial0;
>> >                 serial1 = &serial1;
>> > @@ -35,6 +26,15 @@
>> >                 i2c4 = &i2c4;
>> >                 i2c5 = &i2c5;
>> >         };
>> > +
>> > +       memory {
>> > +               device_type = "memory";
>> > +               reg = <0 0x80000000 0 0xc0000000>;
>> > +       };
>> > +
>> > +       chosen {
>> > +               stdout-path = "serial0:115200n8";
>> > +       };
>> >  };
>> >
>> >  &ethsc {
>> > --
>> > 1.9.1
>> >
>> > _______________________________________________
>> > U-Boot mailing list
>> > U-Boot@lists.denx.de
>> > http://lists.denx.de/mailman/listinfo/u-boot
>>
>>
>>
>> --
>> Best Regards
>> Masahiro Yamada
> _______________________________________________
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
Simon Glass April 2, 2017, 11:24 p.m. UTC | #4
Hi Masahiro,

On 27 February 2017 at 05:50, Masahiro Yamada
<yamada.masahiro@socionext.com> wrote:
> Hi Simon,
>
>
> 2016-04-19 2:48 GMT+09:00 Simon Glass <sjg@chromium.org>:
>> HI Masahiro,
>>
>> On 18 April 2016 at 00:50, Masahiro Yamada
>> <yamada.masahiro@socionext.com> wrote:
>>>
>>> Hi Simon,
>>>
>>> No news about fdtgrep?
>>>
>>> I will apply this patch in a few days, though I am not happy about it.
>>
>> No sorry I have not got back to it. I recently did some buildman
>> fixes. I should get to it in the next few weeks but it will not be in
>> time for this release.
>>
>> Regards,
>> Simon
>
>
>
> Almost one year has passed since then.
>
>
> I still suffer from FDT_ERR_BADLAYOUT error of the fdtgrep
> when I try to sync DT files with Linux.
>
>
> Any progress on this?
>
>
> For example,
> http://patchwork.ozlabs.org/patch/732708/
>
> causes the following error.
>
>   OBJCOPY spl/u-boot-spl-nodtb.bin
>   FDTGREP spl/u-boot-spl.dtb
> Error at 'fdt_find_regions': FDT_ERR_BADLAYOUT
> /aliases node must come before all other nodes
>
>
> This seems unrelated to my patch.
> I believe the problem is on the side of the fdtgrep.

Yes it cannot handle having the /aliases node last. I think I have
figured out how to implement this so have sent a patch:

http://patchwork.ozlabs.org/patch/746216/

Regards,
Simon
diff mbox

Patch

diff --git a/arch/arm/dts/uniphier-ph1-ld11-ref.dts b/arch/arm/dts/uniphier-ph1-ld11-ref.dts
index a624a49..88e7f53 100644
--- a/arch/arm/dts/uniphier-ph1-ld11-ref.dts
+++ b/arch/arm/dts/uniphier-ph1-ld11-ref.dts
@@ -14,15 +14,6 @@ 
 	model = "UniPhier PH1-LD11 Reference Board";
 	compatible = "socionext,ph1-ld11-ref", "socionext,ph1-ld11";
 
-	memory {
-		device_type = "memory";
-		reg = <0 0x80000000 0 0x40000000>;
-	};
-
-	chosen {
-		stdout-path = "serial0:115200n8";
-	};
-
 	aliases {
 		serial0 = &serial0;
 		serial1 = &serial1;
@@ -35,6 +26,15 @@ 
 		i2c4 = &i2c4;
 		i2c5 = &i2c5;
 	};
+
+	memory {
+		device_type = "memory";
+		reg = <0 0x80000000 0 0x40000000>;
+	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+	};
 };
 
 &ethsc {
diff --git a/arch/arm/dts/uniphier-ph1-ld20-ref.dts b/arch/arm/dts/uniphier-ph1-ld20-ref.dts
index 108adeb..a55d90c 100644
--- a/arch/arm/dts/uniphier-ph1-ld20-ref.dts
+++ b/arch/arm/dts/uniphier-ph1-ld20-ref.dts
@@ -14,15 +14,6 @@ 
 	model = "UniPhier PH1-LD20 Reference Board";
 	compatible = "socionext,ph1-ld20-ref", "socionext,ph1-ld20";
 
-	memory {
-		device_type = "memory";
-		reg = <0 0x80000000 0 0xc0000000>;
-	};
-
-	chosen {
-		stdout-path = "serial0:115200n8";
-	};
-
 	aliases {
 		serial0 = &serial0;
 		serial1 = &serial1;
@@ -35,6 +26,15 @@ 
 		i2c4 = &i2c4;
 		i2c5 = &i2c5;
 	};
+
+	memory {
+		device_type = "memory";
+		reg = <0 0x80000000 0 0xc0000000>;
+	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+	};
 };
 
 &ethsc {