diff mbox series

[v2,9/9] board: phytec: imx8mp-phycore: Switch to binman

Message ID 20210702111948.2197868-10-t.remmet@phytec.de
State Superseded
Delegated to: Stefano Babic
Headers show
Series phyCORE-i.MX8MP Update | expand

Commit Message

Teresa Remmet July 2, 2021, 11:19 a.m. UTC
Use now binman for image creation.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
---
 .../imx8mp-phyboard-pollux-rdk-u-boot.dtsi    | 105 ++++++++++++++++++
 arch/arm/mach-imx/imx8m/Kconfig               |   1 +
 .../phytec/phycore_imx8mp/imximage-8mp-sd.cfg |  10 ++
 configs/phycore-imx8mp_defconfig              |   4 +-
 4 files changed, 118 insertions(+), 2 deletions(-)
 create mode 100644 board/phytec/phycore_imx8mp/imximage-8mp-sd.cfg

Comments

Heiko Schocher July 5, 2021, 5:13 a.m. UTC | #1
Hello Teresa,

On 02.07.21 13:19, Teresa Remmet wrote:
> Use now binman for image creation.
> 
> Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
> ---
>  .../imx8mp-phyboard-pollux-rdk-u-boot.dtsi    | 105 ++++++++++++++++++
>  arch/arm/mach-imx/imx8m/Kconfig               |   1 +
>  .../phytec/phycore_imx8mp/imximage-8mp-sd.cfg |  10 ++
>  configs/phycore-imx8mp_defconfig              |   4 +-
>  4 files changed, 118 insertions(+), 2 deletions(-)
>  create mode 100644 board/phytec/phycore_imx8mp/imximage-8mp-sd.cfg

Reviewed-by: Heiko Schocher <hs@denx.de>

bye,
Heiko
Jagan Teki July 5, 2021, 5:31 a.m. UTC | #2
On Fri, Jul 2, 2021 at 4:49 PM Teresa Remmet <t.remmet@phytec.de> wrote:
>
> Use now binman for image creation.
>
> Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
> ---
>  .../imx8mp-phyboard-pollux-rdk-u-boot.dtsi    | 105 ++++++++++++++++++
>  arch/arm/mach-imx/imx8m/Kconfig               |   1 +
>  .../phytec/phycore_imx8mp/imximage-8mp-sd.cfg |  10 ++
>  configs/phycore-imx8mp_defconfig              |   4 +-
>  4 files changed, 118 insertions(+), 2 deletions(-)
>  create mode 100644 board/phytec/phycore_imx8mp/imximage-8mp-sd.cfg
>
> diff --git a/arch/arm/dts/imx8mp-phyboard-pollux-rdk-u-boot.dtsi b/arch/arm/dts/imx8mp-phyboard-pollux-rdk-u-boot.dtsi
> index dbc48dfb4841..2b8e77cb27c5 100644
> --- a/arch/arm/dts/imx8mp-phyboard-pollux-rdk-u-boot.dtsi
> +++ b/arch/arm/dts/imx8mp-phyboard-pollux-rdk-u-boot.dtsi
> @@ -7,6 +7,10 @@
>  #include "imx8mp-u-boot.dtsi"
>
>  / {
> +       binman: binman {
> +               multiple-images;
> +       };
> +
>         wdt-reboot {
>                 compatible = "wdt-reboot";
>                 wdt = <&wdog1>;
> @@ -81,3 +85,104 @@
>  &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_202006.bin";
> +                       size = <0x8000>;
> +               };
> +
> +               blob_2: blob-ext@2 {
> +                       filename = "lpddr4_pmu_train_1d_dmem_202006.bin";
> +                       size = <0x4000>;
> +               };
> +
> +               blob_3: blob-ext@3 {
> +                       filename = "lpddr4_pmu_train_2d_imem_202006.bin";
> +                       size = <0x8000>;
> +               };
> +
> +               blob_4: blob-ext@4 {
> +                       filename = "lpddr4_pmu_train_2d_dmem_202006.bin";
> +                       size = <0x4000>;
> +               };
> +       };
> +
> +       flash {
> +               mkimage {
> +                       args = "-n spl/u-boot-spl.cfgout -T imx8mimage -e 0x920000";
> +
> +                       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 = <0x970000>;
> +                                       entry = <0x970000>;
> +
> +                                       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";
> +                               };
> +                       };
> +               };
> +       };
> +};

I think this will increase the same copy of its in respective boards
with changes in ddr names. Better to have common script to update the
final its by taking ddr files via env, like it was done in Rockchip,
Allwinner.

Jagan.
Teresa Remmet July 6, 2021, 12:24 p.m. UTC | #3
Hello Jagan,

Am Montag, den 05.07.2021, 11:01 +0530 schrieb Jagan Teki:
> On Fri, Jul 2, 2021 at 4:49 PM Teresa Remmet <t.remmet@phytec.de>
> wrote:
> > Use now binman for image creation.
> > 
> > Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
> > ---
> >  .../imx8mp-phyboard-pollux-rdk-u-boot.dtsi    | 105
> > ++++++++++++++++++
> >  arch/arm/mach-imx/imx8m/Kconfig               |   1 +
> >  .../phytec/phycore_imx8mp/imximage-8mp-sd.cfg |  10 ++
> >  configs/phycore-imx8mp_defconfig              |   4 +-
> >  4 files changed, 118 insertions(+), 2 deletions(-)
> >  create mode 100644 board/phytec/phycore_imx8mp/imximage-8mp-sd.cfg
> > 
> > diff --git a/arch/arm/dts/imx8mp-phyboard-pollux-rdk-u-boot.dtsi
> > b/arch/arm/dts/imx8mp-phyboard-pollux-rdk-u-boot.dtsi
> > index dbc48dfb4841..2b8e77cb27c5 100644
> > --- a/arch/arm/dts/imx8mp-phyboard-pollux-rdk-u-boot.dtsi
> > +++ b/arch/arm/dts/imx8mp-phyboard-pollux-rdk-u-boot.dtsi
> > @@ -7,6 +7,10 @@
> >  #include "imx8mp-u-boot.dtsi"
> > 
> >  / {
> > +       binman: binman {
> > +               multiple-images;
> > +       };
> > +
> >         wdt-reboot {
> >                 compatible = "wdt-reboot";
> >                 wdt = <&wdog1>;
> > @@ -81,3 +85,104 @@
> >  &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_202006.bin";
> > +                       size = <0x8000>;
> > +               };
> > +
> > +               blob_2: blob-ext@2 {
> > +                       filename =
> > "lpddr4_pmu_train_1d_dmem_202006.bin";
> > +                       size = <0x4000>;
> > +               };
> > +
> > +               blob_3: blob-ext@3 {
> > +                       filename =
> > "lpddr4_pmu_train_2d_imem_202006.bin";
> > +                       size = <0x8000>;
> > +               };
> > +
> > +               blob_4: blob-ext@4 {
> > +                       filename =
> > "lpddr4_pmu_train_2d_dmem_202006.bin";
> > +                       size = <0x4000>;
> > +               };
> > +       };
> > +
> > +       flash {
> > +               mkimage {
> > +                       args = "-n spl/u-boot-spl.cfgout -T
> > imx8mimage -e 0x920000";
> > +
> > +                       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 = <0x970000>;
> > +                                       entry = <0x970000>;
> > +
> > +                                       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";
> > +                               };
> > +                       };
> > +               };
> > +       };
> > +};
> 
> I think this will increase the same copy of its in respective boards
> with changes in ddr names. Better to have common script to update the
> final its by taking ddr files via env, like it was done in Rockchip,
> Allwinner.

I could move the binman nodes also to "imx8mp-u-boot.dtsi". If it is
only the ddr firmware names that might differ, they could be
overwritten in the board specific u-boot.dtsi files using the blob_*
labels. 

What do you think?

Teresa


> 
> Jagan.
Jagan Teki July 7, 2021, 4:47 a.m. UTC | #4
On Tue, Jul 6, 2021 at 5:54 PM Teresa Remmet <T.Remmet@phytec.de> wrote:
>
> Hello Jagan,
>
> Am Montag, den 05.07.2021, 11:01 +0530 schrieb Jagan Teki:
> > On Fri, Jul 2, 2021 at 4:49 PM Teresa Remmet <t.remmet@phytec.de>
> > wrote:
> > > Use now binman for image creation.
> > >
> > > Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
> > > ---
> > >  .../imx8mp-phyboard-pollux-rdk-u-boot.dtsi    | 105
> > > ++++++++++++++++++
> > >  arch/arm/mach-imx/imx8m/Kconfig               |   1 +
> > >  .../phytec/phycore_imx8mp/imximage-8mp-sd.cfg |  10 ++
> > >  configs/phycore-imx8mp_defconfig              |   4 +-
> > >  4 files changed, 118 insertions(+), 2 deletions(-)
> > >  create mode 100644 board/phytec/phycore_imx8mp/imximage-8mp-sd.cfg
> > >
> > > diff --git a/arch/arm/dts/imx8mp-phyboard-pollux-rdk-u-boot.dtsi
> > > b/arch/arm/dts/imx8mp-phyboard-pollux-rdk-u-boot.dtsi
> > > index dbc48dfb4841..2b8e77cb27c5 100644
> > > --- a/arch/arm/dts/imx8mp-phyboard-pollux-rdk-u-boot.dtsi
> > > +++ b/arch/arm/dts/imx8mp-phyboard-pollux-rdk-u-boot.dtsi
> > > @@ -7,6 +7,10 @@
> > >  #include "imx8mp-u-boot.dtsi"
> > >
> > >  / {
> > > +       binman: binman {
> > > +               multiple-images;
> > > +       };
> > > +
> > >         wdt-reboot {
> > >                 compatible = "wdt-reboot";
> > >                 wdt = <&wdog1>;
> > > @@ -81,3 +85,104 @@
> > >  &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_202006.bin";
> > > +                       size = <0x8000>;
> > > +               };
> > > +
> > > +               blob_2: blob-ext@2 {
> > > +                       filename =
> > > "lpddr4_pmu_train_1d_dmem_202006.bin";
> > > +                       size = <0x4000>;
> > > +               };
> > > +
> > > +               blob_3: blob-ext@3 {
> > > +                       filename =
> > > "lpddr4_pmu_train_2d_imem_202006.bin";
> > > +                       size = <0x8000>;
> > > +               };
> > > +
> > > +               blob_4: blob-ext@4 {
> > > +                       filename =
> > > "lpddr4_pmu_train_2d_dmem_202006.bin";
> > > +                       size = <0x4000>;
> > > +               };
> > > +       };
> > > +
> > > +       flash {
> > > +               mkimage {
> > > +                       args = "-n spl/u-boot-spl.cfgout -T
> > > imx8mimage -e 0x920000";
> > > +
> > > +                       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 = <0x970000>;
> > > +                                       entry = <0x970000>;
> > > +
> > > +                                       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";
> > > +                               };
> > > +                       };
> > > +               };
> > > +       };
> > > +};
> >
> > I think this will increase the same copy of its in respective boards
> > with changes in ddr names. Better to have common script to update the
> > final its by taking ddr files via env, like it was done in Rockchip,
> > Allwinner.
>
> I could move the binman nodes also to "imx8mp-u-boot.dtsi". If it is
> only the ddr firmware names that might differ, they could be
> overwritten in the board specific u-boot.dtsi files using the blob_*
> labels.
>
> What do you think?

Agreed.

Jagan.
diff mbox series

Patch

diff --git a/arch/arm/dts/imx8mp-phyboard-pollux-rdk-u-boot.dtsi b/arch/arm/dts/imx8mp-phyboard-pollux-rdk-u-boot.dtsi
index dbc48dfb4841..2b8e77cb27c5 100644
--- a/arch/arm/dts/imx8mp-phyboard-pollux-rdk-u-boot.dtsi
+++ b/arch/arm/dts/imx8mp-phyboard-pollux-rdk-u-boot.dtsi
@@ -7,6 +7,10 @@ 
 #include "imx8mp-u-boot.dtsi"
 
 / {
+	binman: binman {
+		multiple-images;
+	};
+
 	wdt-reboot {
 		compatible = "wdt-reboot";
 		wdt = <&wdog1>;
@@ -81,3 +85,104 @@ 
 &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_202006.bin";
+			size = <0x8000>;
+		};
+
+		blob_2: blob-ext@2 {
+			filename = "lpddr4_pmu_train_1d_dmem_202006.bin";
+			size = <0x4000>;
+		};
+
+		blob_3: blob-ext@3 {
+			filename = "lpddr4_pmu_train_2d_imem_202006.bin";
+			size = <0x8000>;
+		};
+
+		blob_4: blob-ext@4 {
+			filename = "lpddr4_pmu_train_2d_dmem_202006.bin";
+			size = <0x4000>;
+		};
+	};
+
+	flash {
+		mkimage {
+			args = "-n spl/u-boot-spl.cfgout -T imx8mimage -e 0x920000";
+
+			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 = <0x970000>;
+					entry = <0x970000>;
+
+					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";
+				};
+			};
+		};
+	};
+};
diff --git a/arch/arm/mach-imx/imx8m/Kconfig b/arch/arm/mach-imx/imx8m/Kconfig
index 0669363c0f51..ccaf106be5d8 100644
--- a/arch/arm/mach-imx/imx8m/Kconfig
+++ b/arch/arm/mach-imx/imx8m/Kconfig
@@ -127,6 +127,7 @@  config TARGET_PHYCORE_IMX8MM
 
 config TARGET_PHYCORE_IMX8MP
 	bool "PHYTEC PHYCORE i.MX8MP"
+	select BINMAN
 	select IMX8MP
         select SUPPORT_SPL
 	select IMX8M_LPDDR4
diff --git a/board/phytec/phycore_imx8mp/imximage-8mp-sd.cfg b/board/phytec/phycore_imx8mp/imximage-8mp-sd.cfg
new file mode 100644
index 000000000000..b2920b4908ed
--- /dev/null
+++ b/board/phytec/phycore_imx8mp/imximage-8mp-sd.cfg
@@ -0,0 +1,10 @@ 
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright 2021 NXP
+ */
+
+#define __ASSEMBLY__
+
+ROM_VERSION	v2
+BOOT_FROM	sd
+LOADER		mkimage.flash.mkimage	0x920000
diff --git a/configs/phycore-imx8mp_defconfig b/configs/phycore-imx8mp_defconfig
index 89c2ac977f47..32d538c8bbbb 100644
--- a/configs/phycore-imx8mp_defconfig
+++ b/configs/phycore-imx8mp_defconfig
@@ -20,9 +20,9 @@  CONFIG_SPL_IMX_ROMAPI_LOADADDR=0x48000000
 CONFIG_FIT=y
 CONFIG_FIT_EXTERNAL_OFFSET=0x3000
 CONFIG_SPL_LOAD_FIT=y
-CONFIG_SPL_FIT_GENERATOR="arch/arm/mach-imx/mkimage_fit_atf.sh"
+# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_OF_SYSTEM_SETUP=y
-CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/mach-imx/imx8m/imximage-8mp-lpddr4.cfg"
+CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/phytec/phycore_imx8mp/imximage-8mp-sd.cfg"
 CONFIG_DEFAULT_FDT_FILE="oftree"
 CONFIG_BOARD_LATE_INIT=y
 CONFIG_SPL_BOARD_INIT=y