diff mbox series

[RFC,v1,2/5] arm64: dts: imx8mm: add common -binman.dtsi

Message ID 20210826121409.220124-3-marcel@ziswiler.com
State RFC
Delegated to: Stefano Babic
Headers show
Series arm64: dts: imx8mm: add common -binman.dtsi and further clean-up | expand

Commit Message

Marcel Ziswiler Aug. 26, 2021, 12:14 p.m. UTC
From: Marcel Ziswiler <marcel.ziswiler@toradex.com>

With the move to using binman to generate SPL aka u-boot-spl-ddr.bin and
U-Boot proper aka u-boot.itb every board now covers such configuration
in its own U-Boot specific device tree include. Introduce a new common
imx8mm-binman.dtsi which covers the common part of that configuration.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>

---

 arch/arm/dts/imx8mm-binman.dtsi               | 136 ++++++++++++++++++
 arch/arm/dts/imx8mm-cl-iot-gate-u-boot.dtsi   | 126 ++--------------
 arch/arm/dts/imx8mm-evk-u-boot.dtsi           | 124 +---------------
 .../dts/imx8mm-kontron-n801x-s-u-boot.dtsi    | 123 +---------------
 arch/arm/dts/imx8mm-venice-u-boot.dtsi        | 120 +---------------
 arch/arm/dts/imx8mm-verdin-u-boot.dtsi        | 123 +---------------
 6 files changed, 156 insertions(+), 596 deletions(-)
 create mode 100644 arch/arm/dts/imx8mm-binman.dtsi

Comments

Tim Harvey Aug. 26, 2021, 2:57 p.m. UTC | #1
On Thu, Aug 26, 2021 at 5:14 AM Marcel Ziswiler <marcel@ziswiler.com> wrote:
>
> From: Marcel Ziswiler <marcel.ziswiler@toradex.com>
>
> With the move to using binman to generate SPL aka u-boot-spl-ddr.bin and
> U-Boot proper aka u-boot.itb every board now covers such configuration
> in its own U-Boot specific device tree include. Introduce a new common
> imx8mm-binman.dtsi which covers the common part of that configuration.
>
> Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
>
> ---
>
>  arch/arm/dts/imx8mm-binman.dtsi               | 136 ++++++++++++++++++
>  arch/arm/dts/imx8mm-cl-iot-gate-u-boot.dtsi   | 126 ++--------------
>  arch/arm/dts/imx8mm-evk-u-boot.dtsi           | 124 +---------------
>  .../dts/imx8mm-kontron-n801x-s-u-boot.dtsi    | 123 +---------------
>  arch/arm/dts/imx8mm-venice-u-boot.dtsi        | 120 +---------------
>  arch/arm/dts/imx8mm-verdin-u-boot.dtsi        | 123 +---------------
>  6 files changed, 156 insertions(+), 596 deletions(-)
>  create mode 100644 arch/arm/dts/imx8mm-binman.dtsi
>
> diff --git a/arch/arm/dts/imx8mm-binman.dtsi b/arch/arm/dts/imx8mm-binman.dtsi
> new file mode 100644
> index 00000000000..2d98c1ef577
> --- /dev/null
> +++ b/arch/arm/dts/imx8mm-binman.dtsi
> @@ -0,0 +1,136 @@
> +// SPDX-License-Identifier: GPL-2.0+
> +/*
> + * Copyright 2021 Toradex
> + */
> +
> +/ {
> +       binman: binman {
> +               multiple-images;
> +       };
> +};
> +
> +&binman {
> +       u-boot-spl-ddr {
> +               filename = "u-boot-spl-ddr.bin";
> +               pad-byte = <0xff>;
> +               align-size = <4>;
> +               align = <4>;
> +
> +               u-boot-spl {
> +                       align-end = <4>;
> +               };
> +
> +               blob_1: blob-ext@1 {
> +                       filename = "lpddr4_pmu_train_1d_imem.bin";
> +                       size = <0x8000>;
> +               };
> +
> +               blob_2: blob-ext@2 {
> +                       filename = "lpddr4_pmu_train_1d_dmem.bin";
> +                       size = <0x4000>;
> +               };
> +
> +               blob_3: blob-ext@3 {
> +                       filename = "lpddr4_pmu_train_2d_imem.bin";
> +                       size = <0x8000>;
> +               };
> +
> +               blob_4: blob-ext@4 {
> +                       filename = "lpddr4_pmu_train_2d_dmem.bin";
> +                       size = <0x4000>;
> +               };
> +       };
> +
> +       spl {
> +               filename = "spl.bin";
> +
> +               mkimage {
> +                       args = "-n spl/u-boot-spl.cfgout -T imx8mimage -e 0x7e1000";
> +
> +                       blob {
> +                               filename = "u-boot-spl-ddr.bin";
> +                       };
> +               };
> +       };
> +
> +       itb {
> +               filename = "u-boot.itb";
> +
> +               fit {
> +                       description = "Configuration to load ATF before U-Boot";
> +                       #address-cells = <1>;
> +                       fit,external-offset = <CONFIG_FIT_EXTERNAL_OFFSET>;
> +
> +                       images {
> +                               uboot {
> +                                       description = "U-Boot (64-bit)";
> +                                       type = "standalone";
> +                                       arch = "arm64";
> +                                       compression = "none";
> +                                       load = <CONFIG_SYS_TEXT_BASE>;
> +
> +                                       uboot_blob: blob-ext {
> +                                               filename = "u-boot-nodtb.bin";
> +                                       };
> +                               };
> +
> +                               atf {
> +                                       description = "ARM Trusted Firmware";
> +                                       type = "firmware";
> +                                       arch = "arm64";
> +                                       compression = "none";
> +                                       load = <0x920000>;
> +                                       entry = <0x920000>;
> +
> +                                       atf_blob: blob-ext {
> +                                               filename = "bl31.bin";
> +                                       };
> +                               };
> +
> +                               binman_fip: fip {
> +                                       description = "Trusted Firmware FIP";
> +                                       type = "firmware";
> +                                       arch = "arm64";
> +                                       compression = "none";
> +                                       load = <0x40310000>;
> +                               };
> +
> +                               fdt {
> +                                       description = "NAME";
> +                                       type = "flat_dt";
> +                                       compression = "none";
> +
> +                                       uboot_fdt_blob: blob-ext {
> +                                               filename = "u-boot.dtb";
> +                                       };
> +                               };
> +                       };
> +
> +                       configurations {
> +                               default = "conf";
> +
> +                               binman_configuration: conf {
> +                                       description = "NAME";
> +                                       firmware = "uboot";
> +                                       loadables = "atf";
> +                                       fdt = "fdt";
> +                               };
> +                       };
> +               };
> +       };
> +
> +       imx-boot {
> +               filename = "flash.bin";
> +               pad-byte = <0x00>;
> +
> +               spl: blob-ext@1 {
> +                       offset = <0x0>;
> +                       filename = "spl.bin";
> +               };
> +
> +               binman_uboot: blob-ext@2 {
> +                       offset = <0x57c00>;
> +                       filename = "u-boot.itb";
> +               };
> +       };
> +};
<snip>
> diff --git a/arch/arm/dts/imx8mm-venice-u-boot.dtsi b/arch/arm/dts/imx8mm-venice-u-boot.dtsi
> index e0fa9ff4bfc..1bef06da562 100644
> --- a/arch/arm/dts/imx8mm-venice-u-boot.dtsi
> +++ b/arch/arm/dts/imx8mm-venice-u-boot.dtsi
> @@ -3,13 +3,10 @@
>   * Copyright 2021 Gateworks Corporation
>   */
>
> +#include "imx8mm-binman.dtsi"
>  #include "imx8mm-u-boot.dtsi"
>
>  / {
> -       binman: binman {
> -               multiple-images;
> -       };
> -
>         wdt-reboot {
>                 compatible = "wdt-reboot";
>                 wdt = <&wdog1>;
> @@ -72,118 +69,3 @@
>  &wdog1 {
>         u-boot,dm-spl;
>  };
> -
> -&binman {
> -        u-boot-spl-ddr {
> -               filename = "u-boot-spl-ddr.bin";
> -               pad-byte = <0xff>;
> -               align-size = <4>;
> -               align = <4>;
> -
> -               u-boot-spl {
> -                       align-end = <4>;
> -               };
> -
> -               blob_1: blob-ext@1 {
> -                       filename = "lpddr4_pmu_train_1d_imem.bin";
> -                       size = <0x8000>;
> -               };
> -
> -               blob_2: blob-ext@2 {
> -                       filename = "lpddr4_pmu_train_1d_dmem.bin";
> -                       size = <0x4000>;
> -               };
> -
> -               blob_3: blob-ext@3 {
> -                       filename = "lpddr4_pmu_train_2d_imem.bin";
> -                       size = <0x8000>;
> -               };
> -
> -               blob_4: blob-ext@4 {
> -                       filename = "lpddr4_pmu_train_2d_dmem.bin";
> -                       size = <0x4000>;
> -               };
> -       };
> -
> -       spl {
> -               filename = "spl.bin";
> -
> -               mkimage {
> -                       args = "-n spl/u-boot-spl.cfgout -T imx8mimage -e 0x7e1000";
> -
> -                       blob {
> -                               filename = "u-boot-spl-ddr.bin";
> -                       };
> -               };
> -       };
> -
> -       itb {
> -               filename = "u-boot.itb";
> -
> -               fit {
> -                       description = "Configuration to load ATF before U-Boot";
> -                       #address-cells = <1>;
> -                       fit,external-offset = <CONFIG_FIT_EXTERNAL_OFFSET>;
> -                       fit,fdt-list = "of-list";
> -
> -                       images {
> -                               uboot {
> -                                       description = "U-Boot (64-bit)";
> -                                       type = "standalone";
> -                                       arch = "arm64";
> -                                       compression = "none";
> -                                       load = <CONFIG_SYS_TEXT_BASE>;
> -
> -                                       uboot_blob: blob-ext {
> -                                               filename = "u-boot-nodtb.bin";
> -                                       };
> -                               };
> -
> -                               atf {
> -                                       description = "ARM Trusted Firmware";
> -                                       type = "firmware";
> -                                       arch = "arm64";
> -                                       compression = "none";
> -                                       load = <0x920000>;
> -                                       entry = <0x920000>;
> -
> -                                       atf_blob: blob-ext {
> -                                               filename = "bl31.bin";
> -                                       };
> -                               };
> -
> -                               @fdt-SEQ {
> -                                       description = "NAME";
> -                                       type = "flat_dt";
> -                                       compression = "none";
> -                               };
> -                       };
> -
> -                       configurations {
> -                               default = "@config-DEFAULT-SEQ";
> -
> -                               @config-SEQ {
> -                                       description = "NAME";
> -                                       firmware = "uboot";
> -                                       loadables = "atf";
> -                                       fdt = "fdt-SEQ";
> -                               };
> -                       };
> -               };
> -       };
> -

Marcel,

This would break imx8mm-venice.

The of-list, @fdt-SEQ and @config-SEQ are required to support
automatic generation of fdt and config nodes when you have multiple
device-trees. See tools/binman/entries.rst for details.

Currently, imx8mm-venice is the only board that uses multiple dtbs in
CONFIG_OF_LIST so this would be the only board broken by your patch.
I'm curious if just using the of-list, @fdt-SEQ and @config-SEQ as
above works fine for boards with a single dtb? Otherwise I suppose
boards like mine can include your common "imx8mm-binman.dtsi" but will
have to leave the &binman node override.

Best regards,

Tim
Marcel Ziswiler Aug. 26, 2021, 4:01 p.m. UTC | #2
Hi Tim

On Thu, 2021-08-26 at 07:57 -0700, Tim Harvey wrote:

> ...
> Marcel,
> 
> This would break imx8mm-venice.

Sure, that's why I made it an RFC. I was just missing some context.


> The of-list, @fdt-SEQ and @config-SEQ are required to support
> automatic generation of fdt and config nodes when you have multiple
> device-trees. See tools/binman/entries.rst for details.

Thanks for that pointer, that explains a lot.

> Currently, imx8mm-venice is the only board that uses multiple dtbs in
> CONFIG_OF_LIST so this would be the only board broken by your patch.
> I'm curious if just using the of-list, @fdt-SEQ and @config-SEQ as
> above works fine for boards with a single dtb? Otherwise I suppose
> boards like mine can include your common "imx8mm-binman.dtsi" but will
> have to leave the &binman node override.

Yes, let me investigate further and find a suitable solution. Expect a v2 with that shortly.

> Best regards,
> 
> Tim

Cheers

Marcel
Teresa Remmet Aug. 27, 2021, 9:21 a.m. UTC | #3
Hello Marcel,

Am Donnerstag, den 26.08.2021, 14:14 +0200 schrieb Marcel Ziswiler:
> From: Marcel Ziswiler <marcel.ziswiler@toradex.com>
> 
> With the move to using binman to generate SPL aka u-boot-spl-ddr.bin
> and
> U-Boot proper aka u-boot.itb every board now covers such
> configuration
> in its own U-Boot specific device tree include. Introduce a new
> common
> imx8mm-binman.dtsi which covers the common part of that
> configuration.
> 
> Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
> 
> ---
> 
>  arch/arm/dts/imx8mm-binman.dtsi               | 136
> ++++++++++++++++++
>  arch/arm/dts/imx8mm-cl-iot-gate-u-boot.dtsi   | 126 ++--------------
>  arch/arm/dts/imx8mm-evk-u-boot.dtsi           | 124 +---------------
>  .../dts/imx8mm-kontron-n801x-s-u-boot.dtsi    | 123 +---------------
>  arch/arm/dts/imx8mm-venice-u-boot.dtsi        | 120 +---------------
>  arch/arm/dts/imx8mm-verdin-u-boot.dtsi        | 123 +---------------
>  6 files changed, 156 insertions(+), 596 deletions(-)
>  create mode 100644 arch/arm/dts/imx8mm-binman.dtsi
> 
> diff --git a/arch/arm/dts/imx8mm-binman.dtsi b/arch/arm/dts/imx8mm-
> binman.dtsi
> new file mode 100644
> index 00000000000..2d98c1ef577
> --- /dev/null
> +++ b/arch/arm/dts/imx8mm-binman.dtsi

is it really necessary to create a new binman include? I have added the
nodes for imx8mp directly to the imx8mp-u-boot.dtsi. I guess you did
this because not all boards are converted yet. But I have tried this
when I moved binman to the common include for imx8mp. As the phycore-
imx8mp was also not converted at that point. It did not hurt having the
binman nodes included. At least back then.

I just not like to see that the file structure diverges. If there is a
good reason I'd rather also move the binman nodes for imx8mp to a
imx8mp-binman.dtsi.

Regards,
Teresa
Marcel Ziswiler Aug. 27, 2021, 10:59 a.m. UTC | #4
Hi Teresa

On Fri, 2021-08-27 at 09:21 +0000, Teresa Remmet wrote:
> Hello Marcel,
> 
> Am Donnerstag, den 26.08.2021, 14:14 +0200 schrieb Marcel Ziswiler:
> > From: Marcel Ziswiler <marcel.ziswiler@toradex.com>
> > 
> > With the move to using binman to generate SPL aka u-boot-spl-ddr.bin
> > and
> > U-Boot proper aka u-boot.itb every board now covers such
> > configuration
> > in its own U-Boot specific device tree include. Introduce a new
> > common
> > imx8mm-binman.dtsi which covers the common part of that
> > configuration.
> > 
> > Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
> > 
> > ---
> > 
> >  arch/arm/dts/imx8mm-binman.dtsi               | 136
> > ++++++++++++++++++
> >  arch/arm/dts/imx8mm-cl-iot-gate-u-boot.dtsi   | 126 ++--------------
> >  arch/arm/dts/imx8mm-evk-u-boot.dtsi           | 124 +---------------
> >  .../dts/imx8mm-kontron-n801x-s-u-boot.dtsi    | 123 +---------------
> >  arch/arm/dts/imx8mm-venice-u-boot.dtsi        | 120 +---------------
> >  arch/arm/dts/imx8mm-verdin-u-boot.dtsi        | 123 +---------------
> >  6 files changed, 156 insertions(+), 596 deletions(-)
> >  create mode 100644 arch/arm/dts/imx8mm-binman.dtsi
> > 
> > diff --git a/arch/arm/dts/imx8mm-binman.dtsi b/arch/arm/dts/imx8mm-
> > binman.dtsi
> > new file mode 100644
> > index 00000000000..2d98c1ef577
> > --- /dev/null
> > +++ b/arch/arm/dts/imx8mm-binman.dtsi
> 
> is it really necessary to create a new binman include?

No, I guess not. That's just what we loosely discussed. But this is also exactly why I only posted it as an RFC
to get such feedback.

> I have added the
> nodes for imx8mp directly to the imx8mp-u-boot.dtsi. I guess you did
> this because not all boards are converted yet. But I have tried this
> when I moved binman to the common include for imx8mp. As the phycore-
> imx8mp was also not converted at that point. It did not hurt having the
> binman nodes included. At least back then.

Yes, maybe we can indeed just put it all into the same imx8mp-u-boot.dtsi. If nobody objects to that idea I can
try it that way for a v2.


> I just not like to see that the file structure diverges. If there is a
> good reason I'd rather also move the binman nodes for imx8mp to a
> imx8mp-binman.dtsi.

No, I guess either way will work. Let's hope we get some more feedback on what the others prefer. Thanks!

> Regards,
> Teresa

Cheers

Marcel
Tim Harvey Aug. 27, 2021, 3:12 p.m. UTC | #5
On Fri, Aug 27, 2021 at 3:59 AM Marcel Ziswiler
<marcel.ziswiler@toradex.com> wrote:
>
> Hi Teresa
>
> On Fri, 2021-08-27 at 09:21 +0000, Teresa Remmet wrote:
> > Hello Marcel,
> >
> > Am Donnerstag, den 26.08.2021, 14:14 +0200 schrieb Marcel Ziswiler:
> > > From: Marcel Ziswiler <marcel.ziswiler@toradex.com>
> > >
> > > With the move to using binman to generate SPL aka u-boot-spl-ddr.bin
> > > and
> > > U-Boot proper aka u-boot.itb every board now covers such
> > > configuration
> > > in its own U-Boot specific device tree include. Introduce a new
> > > common
> > > imx8mm-binman.dtsi which covers the common part of that
> > > configuration.
> > >
> > > Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
> > >
> > > ---
> > >
> > >  arch/arm/dts/imx8mm-binman.dtsi               | 136
> > > ++++++++++++++++++
> > >  arch/arm/dts/imx8mm-cl-iot-gate-u-boot.dtsi   | 126 ++--------------
> > >  arch/arm/dts/imx8mm-evk-u-boot.dtsi           | 124 +---------------
> > >  .../dts/imx8mm-kontron-n801x-s-u-boot.dtsi    | 123 +---------------
> > >  arch/arm/dts/imx8mm-venice-u-boot.dtsi        | 120 +---------------
> > >  arch/arm/dts/imx8mm-verdin-u-boot.dtsi        | 123 +---------------
> > >  6 files changed, 156 insertions(+), 596 deletions(-)
> > >  create mode 100644 arch/arm/dts/imx8mm-binman.dtsi
> > >
> > > diff --git a/arch/arm/dts/imx8mm-binman.dtsi b/arch/arm/dts/imx8mm-
> > > binman.dtsi
> > > new file mode 100644
> > > index 00000000000..2d98c1ef577
> > > --- /dev/null
> > > +++ b/arch/arm/dts/imx8mm-binman.dtsi
> >
> > is it really necessary to create a new binman include?
>
> No, I guess not. That's just what we loosely discussed. But this is also exactly why I only posted it as an RFC
> to get such feedback.
>
> > I have added the
> > nodes for imx8mp directly to the imx8mp-u-boot.dtsi. I guess you did
> > this because not all boards are converted yet. But I have tried this
> > when I moved binman to the common include for imx8mp. As the phycore-
> > imx8mp was also not converted at that point. It did not hurt having the
> > binman nodes included. At least back then.
>
> Yes, maybe we can indeed just put it all into the same imx8mp-u-boot.dtsi. If nobody objects to that idea I can
> try it that way for a v2.
>
>
> > I just not like to see that the file structure diverges. If there is a
> > good reason I'd rather also move the binman nodes for imx8mp to a
> > imx8mp-binman.dtsi.
>
> No, I guess either way will work. Let's hope we get some more feedback on what the others prefer. Thanks!
>

I'm not sure if I understand correctly but if the suggestion is to
create a dtsi that is shared between the imx8mm and imx8mp I don't
think that would be a good idea as there are differences in addresses
and such. In fact, there's a difference in DDR training firmware
between ddr3 and lpddr4 so trying to even combine them into an
imx8mm-u-boot.dtsi doesn't even make sense to me. If anything maybe it
should be a imx8mm-binman-lpddr4-u-boot.dtsi or something like that?
Perhaps ifdef's could handle these differences allowing you to combine
ddr types and SoC's?

Tim
Marcel Ziswiler Aug. 28, 2021, 12:55 p.m. UTC | #6
Hi Tim

On Fri, 2021-08-27 at 08:12 -0700, Tim Harvey wrote:

> ...
> > > > +++ b/arch/arm/dts/imx8mm-binman.dtsi
> > > 
> > > is it really necessary to create a new binman include?
> > 
> > No, I guess not. That's just what we loosely discussed. But this is also exactly why I only posted it as an
> > RFC
> > to get such feedback.
> > 
> > > I have added the
> > > nodes for imx8mp directly to the imx8mp-u-boot.dtsi. I guess you did
> > > this because not all boards are converted yet. But I have tried this
> > > when I moved binman to the common include for imx8mp. As the phycore-
> > > imx8mp was also not converted at that point. It did not hurt having the
> > > binman nodes included. At least back then.
> > 
> > Yes, maybe we can indeed just put it all into the same imx8mp-u-boot.dtsi. If nobody objects to that idea I
> > can
> > try it that way for a v2.
> > 
> > 
> > > I just not like to see that the file structure diverges. If there is a
> > > good reason I'd rather also move the binman nodes for imx8mp to a
> > > imx8mp-binman.dtsi.
> > 
> > No, I guess either way will work. Let's hope we get some more feedback on what the others prefer. Thanks!
> > 
> 
> I'm not sure if I understand correctly but if the suggestion is to
> create a dtsi that is shared between the imx8mm and imx8mp I don't
> think that would be a good idea as there are differences in addresses
> and such. In fact, there's a difference in DDR training firmware
> between ddr3 and lpddr4 so trying to even combine them into an
> imx8mm-u-boot.dtsi doesn't even make sense to me. If anything maybe it
> should be a imx8mm-binman-lpddr4-u-boot.dtsi or something like that?

No, I don't think it is our intention to combine anything from imx8mm and imx8mp at this point. As far as I
understood, rather than introducing a new imx8mm-binman.dtsi the suggestion is to put that into the existing
imx8mm-u-boot.dtsi as well similar to how Teresa did that for phycore-imx8mp and the imx8mp-u-boot.dtsi.

> Perhaps ifdef's could handle these differences allowing you to combine
> ddr types and SoC's?

No, I don't really think that would improve anything over just having separate imx8mm-u-boot.dtsi and imx8mp-u-
boot.dtsi files. On the other hand, I also don't see that anything would stop us from still going down that
route of further combining imx8mm and imx8mp stuff in the future should we really want to.

> Tim

Cheers

Marcel
Marcel Ziswiler Oct. 6, 2021, 11:51 p.m. UTC | #7
Hi Tim

On Thu, 2021-08-26 at 07:57 -0700, Tim Harvey wrote:
> ...
> Marcel,
> 
> This would break imx8mm-venice.
> 
> The of-list, @fdt-SEQ and @config-SEQ are required to support
> automatic generation of fdt and config nodes when you have multiple
> device-trees. See tools/binman/entries.rst for details.
> 
> Currently, imx8mm-venice is the only board that uses multiple dtbs in
> CONFIG_OF_LIST so this would be the only board broken by your patch.
> I'm curious if just using the of-list, @fdt-SEQ and @config-SEQ as
> above works fine for boards with a single dtb?

Yes, I verified that now and will be sending a v2 with that shortly. Thanks!

> Otherwise I suppose
> boards like mine can include your common "imx8mm-binman.dtsi" but will
> have to leave the &binman node override.
> 
> Best regards,
> 
> Tim

Cheers

Marcel
diff mbox series

Patch

diff --git a/arch/arm/dts/imx8mm-binman.dtsi b/arch/arm/dts/imx8mm-binman.dtsi
new file mode 100644
index 00000000000..2d98c1ef577
--- /dev/null
+++ b/arch/arm/dts/imx8mm-binman.dtsi
@@ -0,0 +1,136 @@ 
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright 2021 Toradex
+ */
+
+/ {
+	binman: binman {
+		multiple-images;
+	};
+};
+
+&binman {
+	u-boot-spl-ddr {
+		filename = "u-boot-spl-ddr.bin";
+		pad-byte = <0xff>;
+		align-size = <4>;
+		align = <4>;
+
+		u-boot-spl {
+			align-end = <4>;
+		};
+
+		blob_1: blob-ext@1 {
+			filename = "lpddr4_pmu_train_1d_imem.bin";
+			size = <0x8000>;
+		};
+
+		blob_2: blob-ext@2 {
+			filename = "lpddr4_pmu_train_1d_dmem.bin";
+			size = <0x4000>;
+		};
+
+		blob_3: blob-ext@3 {
+			filename = "lpddr4_pmu_train_2d_imem.bin";
+			size = <0x8000>;
+		};
+
+		blob_4: blob-ext@4 {
+			filename = "lpddr4_pmu_train_2d_dmem.bin";
+			size = <0x4000>;
+		};
+	};
+
+	spl {
+		filename = "spl.bin";
+
+		mkimage {
+			args = "-n spl/u-boot-spl.cfgout -T imx8mimage -e 0x7e1000";
+
+			blob {
+				filename = "u-boot-spl-ddr.bin";
+			};
+		};
+	};
+
+	itb {
+		filename = "u-boot.itb";
+
+		fit {
+			description = "Configuration to load ATF before U-Boot";
+			#address-cells = <1>;
+			fit,external-offset = <CONFIG_FIT_EXTERNAL_OFFSET>;
+
+			images {
+				uboot {
+					description = "U-Boot (64-bit)";
+					type = "standalone";
+					arch = "arm64";
+					compression = "none";
+					load = <CONFIG_SYS_TEXT_BASE>;
+
+					uboot_blob: blob-ext {
+						filename = "u-boot-nodtb.bin";
+					};
+				};
+
+				atf {
+					description = "ARM Trusted Firmware";
+					type = "firmware";
+					arch = "arm64";
+					compression = "none";
+					load = <0x920000>;
+					entry = <0x920000>;
+
+					atf_blob: blob-ext {
+						filename = "bl31.bin";
+					};
+				};
+
+				binman_fip: fip {
+					description = "Trusted Firmware FIP";
+					type = "firmware";
+					arch = "arm64";
+					compression = "none";
+					load = <0x40310000>;
+				};
+
+				fdt {
+					description = "NAME";
+					type = "flat_dt";
+					compression = "none";
+
+					uboot_fdt_blob: blob-ext {
+						filename = "u-boot.dtb";
+					};
+				};
+			};
+
+			configurations {
+				default = "conf";
+
+				binman_configuration: conf {
+					description = "NAME";
+					firmware = "uboot";
+					loadables = "atf";
+					fdt = "fdt";
+				};
+			};
+		};
+	};
+
+	imx-boot {
+		filename = "flash.bin";
+		pad-byte = <0x00>;
+
+		spl: blob-ext@1 {
+			offset = <0x0>;
+			filename = "spl.bin";
+		};
+
+		binman_uboot: blob-ext@2 {
+			offset = <0x57c00>;
+			filename = "u-boot.itb";
+		};
+	};
+};
diff --git a/arch/arm/dts/imx8mm-cl-iot-gate-u-boot.dtsi b/arch/arm/dts/imx8mm-cl-iot-gate-u-boot.dtsi
index 3226a244a97..7235763c561 100644
--- a/arch/arm/dts/imx8mm-cl-iot-gate-u-boot.dtsi
+++ b/arch/arm/dts/imx8mm-cl-iot-gate-u-boot.dtsi
@@ -3,11 +3,9 @@ 
  * Copyright 2019 NXP
  */
 
-/ {
-	binman: binman {
-		multiple-images;
-	};
+#include "imx8mm-binman.dtsi"
 
+/ {
 	wdt-reboot {
 		compatible = "wdt-reboot";
 		wdt = <&wdog1>;
@@ -141,115 +139,19 @@ 
 	u-boot,dm-spl;
 };
 
-&binman {
-	u-boot-spl-ddr {
-		filename = "u-boot-spl-ddr.bin";
-		pad-byte = <0xff>;
-		align-size = <4>;
-		align = <4>;
-
-		u-boot-spl {
-			align-end = <4>;
-		};
-
-		blob_1: blob-ext@1 {
-			filename = "lpddr4_pmu_train_1d_imem.bin";
-			size = <0x8000>;
-		};
+&binman_fip {
+	description = "Trusted Firmware FIP";
+	type = "firmware";
+	arch = "arm64";
+	compression = "none";
+	load = <0x40310000>;
 
-		blob_2: blob-ext@2 {
-			filename = "lpddr4_pmu_train_1d_dmem.bin";
-			size = <0x4000>;
-		};
-
-		blob_3: blob-ext@3 {
-			filename = "lpddr4_pmu_train_2d_imem.bin";
-			size = <0x8000>;
-		};
-
-		blob_4: blob-ext@4 {
-			filename = "lpddr4_pmu_train_2d_dmem.bin";
-			size = <0x4000>;
-		};
-	};
-
-	flash {
-		mkimage {
-			args = "-n spl/u-boot-spl.cfgout -T imx8mimage -e 0x7e1000";
-
-			blob {
-				filename = "u-boot-spl-ddr.bin";
-			};
-		};
+	fip_blob {
+		filename = "fip.bin";
+		type = "blob-ext";
 	};
+};
 
-	itb {
-		filename = "u-boot.itb";
-
-		fit {
-			description = "Configuration to load ATF before U-Boot";
-			#address-cells = <1>;
-			fit,external-offset = <CONFIG_FIT_EXTERNAL_OFFSET>;
-
-			images {
-				uboot {
-					description = "U-Boot (64-bit)";
-					type = "standalone";
-					arch = "arm64";
-					compression = "none";
-					load = <CONFIG_SYS_TEXT_BASE>;
-
-					uboot_blob: blob-ext {
-						filename = "u-boot-nodtb.bin";
-					};
-				};
-
-				atf {
-					description = "ARM Trusted Firmware";
-					type = "firmware";
-					arch = "arm64";
-					compression = "none";
-					load = <0x920000>;
-					entry = <0x920000>;
-
-					atf_blob: blob-ext {
-						filename = "bl31.bin";
-					};
-				};
-
-				fip {
-					description = "Trusted Firmware FIP";
-					type = "firmware";
-					arch = "arm64";
-					compression = "none";
-					load = <0x40310000>;
-
-					fip_blob: blob-ext{
-						filename = "fip.bin";
-					};
-				};
-
-				fdt {
-					description = "NAME";
-					type = "flat_dt";
-					compression = "none";
-
-					uboot_fdt_blob: blob-ext {
-						filename = "u-boot.dtb";
-					};
-				};
-			};
-
-			configurations {
-				default = "conf";
-
-				conf {
-					description = "NAME";
-					firmware = "uboot";
-					loadables = "atf", "fip";
-					fdt = "fdt";
-				};
-			};
-		};
-	};
+&binman_configuration {
+	loadables = "atf", "fip";
 };
diff --git a/arch/arm/dts/imx8mm-evk-u-boot.dtsi b/arch/arm/dts/imx8mm-evk-u-boot.dtsi
index 3c75415e8fb..6b0d70aa9de 100644
--- a/arch/arm/dts/imx8mm-evk-u-boot.dtsi
+++ b/arch/arm/dts/imx8mm-evk-u-boot.dtsi
@@ -3,13 +3,10 @@ 
  * Copyright 2019 NXP
  */
 
+#include "imx8mm-binman.dtsi"
 #include "imx8mm-u-boot.dtsi"
 
 / {
-	binman: binman {
-		multiple-images;
-	};
-
 	wdt-reboot {
 		compatible = "wdt-reboot";
 		wdt = <&wdog1>;
@@ -116,122 +113,3 @@ 
 &wdog1 {
 	u-boot,dm-spl;
 };
-
-&binman {
-	 u-boot-spl-ddr {
-		filename = "u-boot-spl-ddr.bin";
-		pad-byte = <0xff>;
-		align-size = <4>;
-		align = <4>;
-
-		u-boot-spl {
-			align-end = <4>;
-		};
-
-		blob_1: blob-ext@1 {
-			filename = "lpddr4_pmu_train_1d_imem.bin";
-			size = <0x8000>;
-		};
-
-		blob_2: blob-ext@2 {
-			filename = "lpddr4_pmu_train_1d_dmem.bin";
-			size = <0x4000>;
-		};
-
-		blob_3: blob-ext@3 {
-			filename = "lpddr4_pmu_train_2d_imem.bin";
-			size = <0x8000>;
-		};
-
-		blob_4: blob-ext@4 {
-			filename = "lpddr4_pmu_train_2d_dmem.bin";
-			size = <0x4000>;
-		};
-	};
-
-
-	spl {
-		filename = "spl.bin";
-
-		mkimage {
-			args = "-n spl/u-boot-spl.cfgout -T imx8mimage -e 0x7e1000";
-
-			blob {
-				filename = "u-boot-spl-ddr.bin";
-			};
-		};
-	};
-
-	itb {
-		filename = "u-boot.itb";
-
-		fit {
-			description = "Configuration to load ATF before U-Boot";
-			#address-cells = <1>;
-			fit,external-offset = <CONFIG_FIT_EXTERNAL_OFFSET>;
-
-			images {
-				uboot {
-					description = "U-Boot (64-bit)";
-					type = "standalone";
-					arch = "arm64";
-					compression = "none";
-					load = <CONFIG_SYS_TEXT_BASE>;
-
-					uboot_blob: blob-ext {
-						filename = "u-boot-nodtb.bin";
-					};
-				};
-
-				atf {
-					description = "ARM Trusted Firmware";
-					type = "firmware";
-					arch = "arm64";
-					compression = "none";
-					load = <0x920000>;
-					entry = <0x920000>;
-
-					atf_blob: blob-ext {
-						filename = "bl31.bin";
-					};
-				};
-
-				fdt {
-					description = "NAME";
-					type = "flat_dt";
-					compression = "none";
-
-					uboot_fdt_blob: blob-ext {
-						filename = "u-boot.dtb";
-					};
-				};
-			};
-
-			configurations {
-				default = "conf";
-
-				conf {
-					description = "NAME";
-					firmware = "uboot";
-					loadables = "atf";
-					fdt = "fdt";
-				};
-			};
-		};
-	};
-
-	imx-boot {
-		filename = "flash.bin";
-		pad-byte = <0x00>;
-
-		spl: blob-ext@1 {
-			offset = <0x0>;
-			filename = "spl.bin";
-		};
-
-		uboot: blob-ext@2 {
-			offset = <0x57c00>;
-			filename = "u-boot.itb";
-		};
-	};
-};
diff --git a/arch/arm/dts/imx8mm-kontron-n801x-s-u-boot.dtsi b/arch/arm/dts/imx8mm-kontron-n801x-s-u-boot.dtsi
index 6f90f4c738c..aa06acbe064 100644
--- a/arch/arm/dts/imx8mm-kontron-n801x-s-u-boot.dtsi
+++ b/arch/arm/dts/imx8mm-kontron-n801x-s-u-boot.dtsi
@@ -3,6 +3,7 @@ 
  * Copyright (C) 2019 Kontron Electronics GmbH
  */
 
+#include "imx8mm-binman.dtsi"
 #include "imx8mm-u-boot.dtsi"
 
 / {
@@ -11,10 +12,6 @@ 
 		usb1 = &usbotg2;
 	};
 
-	binman: binman {
-		multiple-images;
-	};
-
 	wdt-reboot {
 		compatible = "wdt-reboot";
 		wdt = <&wdog1>;
@@ -133,121 +130,3 @@ 
 &wdog1 {
 	u-boot,dm-spl;
 };
-
-&binman {
-	u-boot-spl-ddr {
-		filename = "u-boot-spl-ddr.bin";
-		pad-byte = <0xff>;
-		align-size = <4>;
-		align = <4>;
-
-		u-boot-spl {
-			align-end = <4>;
-		};
-
-		blob_1: blob-ext@1 {
-			filename = "lpddr4_pmu_train_1d_imem.bin";
-			size = <0x8000>;
-		};
-
-		blob_2: blob-ext@2 {
-			filename = "lpddr4_pmu_train_1d_dmem.bin";
-			size = <0x4000>;
-		};
-
-		blob_3: blob-ext@3 {
-			filename = "lpddr4_pmu_train_2d_imem.bin";
-			size = <0x8000>;
-		};
-
-		blob_4: blob-ext@4 {
-			filename = "lpddr4_pmu_train_2d_dmem.bin";
-			size = <0x4000>;
-		};
-	};
-
-	spl {
-		filename = "spl.bin";
-
-		mkimage {
-			args = "-n spl/u-boot-spl.cfgout -T imx8mimage -e 0x7e1000";
-
-			blob {
-				filename = "u-boot-spl-ddr.bin";
-			};
-		};
-	};
-
-	itb {
-		filename = "u-boot.itb";
-
-		fit {
-			description = "Configuration to load ATF before U-Boot";
-			#address-cells = <1>;
-			fit,external-offset = <CONFIG_FIT_EXTERNAL_OFFSET>;
-
-			images {
-				uboot {
-					description = "U-Boot (64-bit)";
-					type = "standalone";
-					arch = "arm64";
-					compression = "none";
-					load = <CONFIG_SYS_TEXT_BASE>;
-
-					uboot_blob: blob-ext {
-						filename = "u-boot-nodtb.bin";
-					};
-				};
-
-				atf {
-					description = "ARM Trusted Firmware";
-					type = "firmware";
-					arch = "arm64";
-					compression = "none";
-					load = <0x920000>;
-					entry = <0x920000>;
-
-					atf_blob: blob-ext {
-						filename = "bl31.bin";
-					};
-				};
-
-				fdt {
-					description = "NAME";
-					type = "flat_dt";
-					compression = "none";
-
-					uboot_fdt_blob: blob-ext {
-						filename = "u-boot.dtb";
-					};
-				};
-			};
-
-			configurations {
-				default = "conf";
-
-				conf {
-					description = "NAME";
-					firmware = "uboot";
-					loadables = "atf";
-					fdt = "fdt";
-				};
-			};
-		};
-	};
-
-	imx-boot {
-		filename = "flash.bin";
-		pad-byte = <0x00>;
-
-		spl: blob-ext@1 {
-			offset = <0x0>;
-			filename = "spl.bin";
-		};
-
-		uboot: blob-ext@2 {
-			offset = <0x57c00>;
-			filename = "u-boot.itb";
-		};
-	};
-};
diff --git a/arch/arm/dts/imx8mm-venice-u-boot.dtsi b/arch/arm/dts/imx8mm-venice-u-boot.dtsi
index e0fa9ff4bfc..1bef06da562 100644
--- a/arch/arm/dts/imx8mm-venice-u-boot.dtsi
+++ b/arch/arm/dts/imx8mm-venice-u-boot.dtsi
@@ -3,13 +3,10 @@ 
  * Copyright 2021 Gateworks Corporation
  */
 
+#include "imx8mm-binman.dtsi"
 #include "imx8mm-u-boot.dtsi"
 
 / {
-	binman: binman {
-		multiple-images;
-	};
-
 	wdt-reboot {
 		compatible = "wdt-reboot";
 		wdt = <&wdog1>;
@@ -72,118 +69,3 @@ 
 &wdog1 {
 	u-boot,dm-spl;
 };
-
-&binman {
-	 u-boot-spl-ddr {
-		filename = "u-boot-spl-ddr.bin";
-		pad-byte = <0xff>;
-		align-size = <4>;
-		align = <4>;
-
-		u-boot-spl {
-			align-end = <4>;
-		};
-
-		blob_1: blob-ext@1 {
-			filename = "lpddr4_pmu_train_1d_imem.bin";
-			size = <0x8000>;
-		};
-
-		blob_2: blob-ext@2 {
-			filename = "lpddr4_pmu_train_1d_dmem.bin";
-			size = <0x4000>;
-		};
-
-		blob_3: blob-ext@3 {
-			filename = "lpddr4_pmu_train_2d_imem.bin";
-			size = <0x8000>;
-		};
-
-		blob_4: blob-ext@4 {
-			filename = "lpddr4_pmu_train_2d_dmem.bin";
-			size = <0x4000>;
-		};
-	};
-
-	spl {
-		filename = "spl.bin";
-
-		mkimage {
-			args = "-n spl/u-boot-spl.cfgout -T imx8mimage -e 0x7e1000";
-
-			blob {
-				filename = "u-boot-spl-ddr.bin";
-			};
-		};
-	};
-
-	itb {
-		filename = "u-boot.itb";
-
-		fit {
-			description = "Configuration to load ATF before U-Boot";
-			#address-cells = <1>;
-			fit,external-offset = <CONFIG_FIT_EXTERNAL_OFFSET>;
-			fit,fdt-list = "of-list";
-
-			images {
-				uboot {
-					description = "U-Boot (64-bit)";
-					type = "standalone";
-					arch = "arm64";
-					compression = "none";
-					load = <CONFIG_SYS_TEXT_BASE>;
-
-					uboot_blob: blob-ext {
-						filename = "u-boot-nodtb.bin";
-					};
-				};
-
-				atf {
-					description = "ARM Trusted Firmware";
-					type = "firmware";
-					arch = "arm64";
-					compression = "none";
-					load = <0x920000>;
-					entry = <0x920000>;
-
-					atf_blob: blob-ext {
-						filename = "bl31.bin";
-					};
-				};
-
-				@fdt-SEQ {
-					description = "NAME";
-					type = "flat_dt";
-					compression = "none";
-				};
-			};
-
-			configurations {
-				default = "@config-DEFAULT-SEQ";
-
-				@config-SEQ {
-					description = "NAME";
-					firmware = "uboot";
-					loadables = "atf";
-					fdt = "fdt-SEQ";
-				};
-			};
-		};
-	};
-
-	imx-boot {
-		filename = "flash.bin";
-		pad-byte = <0x00>;
-
-		spl: blob-ext@1 {
-			filename = "spl.bin";
-			offset = <0x0>;
-		};
-
-		uboot: blob-ext@2 {
-			filename = "u-boot.itb";
-			offset = <0x57c00>;
-		};
-	};
-};
diff --git a/arch/arm/dts/imx8mm-verdin-u-boot.dtsi b/arch/arm/dts/imx8mm-verdin-u-boot.dtsi
index 6962bb40b6e..5f7636f4450 100644
--- a/arch/arm/dts/imx8mm-verdin-u-boot.dtsi
+++ b/arch/arm/dts/imx8mm-verdin-u-boot.dtsi
@@ -3,13 +3,10 @@ 
  * Copyright 2021 Toradex
  */
 
+#include "imx8mm-binman.dtsi"
 #include "imx8mm-u-boot.dtsi"
 
 / {
-	binman: binman {
-		multiple-images;
-	};
-
 	firmware {
 		optee {
 			compatible = "linaro,optee-tz";
@@ -100,120 +97,6 @@ 
 	u-boot,dm-spl;
 };
 
-&binman {
-	 u-boot-spl-ddr {
-		filename = "u-boot-spl-ddr.bin";
-		pad-byte = <0xff>;
-		align-size = <4>;
-		align = <4>;
-
-		u-boot-spl {
-			align-end = <4>;
-		};
-
-		blob_1: blob-ext@1 {
-			filename = "lpddr4_pmu_train_1d_imem.bin";
-			size = <0x8000>;
-		};
-
-		blob_2: blob-ext@2 {
-			filename = "lpddr4_pmu_train_1d_dmem.bin";
-			size = <0x4000>;
-		};
-
-		blob_3: blob-ext@3 {
-			filename = "lpddr4_pmu_train_2d_imem.bin";
-			size = <0x8000>;
-		};
-
-		blob_4: blob-ext@4 {
-			filename = "lpddr4_pmu_train_2d_dmem.bin";
-			size = <0x4000>;
-		};
-	};
-
-	spl {
-		filename = "spl.bin";
-
-		mkimage {
-			args = "-n spl/u-boot-spl.cfgout -T imx8mimage -e 0x7e1000";
-
-			blob {
-				filename = "u-boot-spl-ddr.bin";
-			};
-		};
-	};
-
-	itb {
-		filename = "u-boot.itb";
-
-		fit {
-			description = "Configuration to load ATF before U-Boot";
-			#address-cells = <1>;
-			fit,external-offset = <CONFIG_FIT_EXTERNAL_OFFSET>;
-
-			images {
-				uboot {
-					description = "U-Boot (64-bit)";
-					type = "standalone";
-					arch = "arm64";
-					compression = "none";
-					load = <CONFIG_SYS_TEXT_BASE>;
-
-					uboot_blob: blob-ext {
-						filename = "u-boot-nodtb.bin";
-					};
-				};
-
-				atf {
-					description = "ARM Trusted Firmware";
-					type = "firmware";
-					arch = "arm64";
-					compression = "none";
-					load = <0x920000>;
-					entry = <0x920000>;
-
-					atf_blob: blob-ext {
-						filename = "bl31.bin";
-					};
-				};
-
-				fdt {
-					description = "NAME";
-					type = "flat_dt";
-					compression = "none";
-
-					uboot_fdt_blob: blob-ext {
-						filename = "u-boot.dtb";
-					};
-				};
-			};
-
-			configurations {
-				default = "conf";
-
-				conf {
-					description = "NAME";
-					firmware = "uboot";
-					loadables = "atf";
-					fdt = "fdt";
-				};
-			};
-		};
-	};
-
-	imx-boot {
-		filename = "flash.bin";
-		pad-byte = <0x00>;
-
-		spl: blob-ext@1 {
-			offset = <0x0>;
-			filename = "spl.bin";
-		};
-
-		uboot: blob-ext@2 {
-			offset = <0x5fc00>;
-			filename = "u-boot.itb";
-		};
-	};
+&binman_uboot {
+	offset = <0x5fc00>;
 };