Re: [PATCH] Revert "tree: imx: remove old fit generator script"

2022-01-07 Thread Marcel Ziswiler
Hi Tom

On Fri, 2022-01-07 at 17:42 -0500, Tom Rini wrote:
> On Fri, Jan 07, 2022 at 11:26:49PM +0100, Marcel Ziswiler wrote:
> > Hi Tim and Tom
> > 
> > On Fri, 2022-01-07 at 12:37 -0800, Tim Harvey wrote:
> > > On Fri, Jan 7, 2022 at 12:27 PM Tom Rini  wrote:
> > > > 
> > > > On Fri, Jan 07, 2022 at 12:24:57PM -0800, Tim Harvey wrote:
> > > > > On Fri, Jan 7, 2022 at 12:08 PM Adam Ford  wrote:
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > On Fri, Jan 7, 2022 at 12:25 PM Tom Rini  wrote:
> > > > > > > 
> > > > > > > On Fri, Jan 07, 2022 at 12:21:18PM -0600, Adam Ford wrote:
> > > > > > > > On Fri, Jan 7, 2022 at 11:38 AM Tom Rini  
> > > > > > > > wrote:
> > > > > > > > 
> > > > > > > > > On Fri, Jan 07, 2022 at 09:27:05AM -0800, Tim Harvey wrote:
> > > > > > > > > > On Thu, Jan 6, 2022 at 12:27 PM Tim Harvey 
> > > > > > > > > > 
> > > > > > > > > wrote:
> > > > > > > > > > > 
> > > > > > > > > > > On Thu, Jan 6, 2022 at 11:18 AM ZHIZHIKIN Andrey
> > > > > > > > > > >  wrote:
> > > > > > > > > > > > 
> > > > > > > > > > > > Hello Tom,
> > > > > > > > > > > > 
> > > > > > > > > > > > > -Original Message-
> > > > > > > > > > > > > From: U-Boot  On Behalf 
> > > > > > > > > > > > > Of Tom Rini
> > > > > > > > > > > > > Sent: Thursday, January 6, 2022 7:52 PM
> > > > > > > > > > > > > To: u-boot@lists.denx.de
> > > > > > > > > > > > > Cc: Tim Harvey 
> > > > > > > > > > > > > Subject: [PATCH] Revert "tree: imx: remove old fit 
> > > > > > > > > > > > > generator
> > > > > > > > > script"
> > > > > > > > > > > > > 
> > > > > > > > > > > > > This reverts commit 
> > > > > > > > > > > > > d9a6f0eed66a39206b13513ec914f14084c3bb73.
> > > > > > > > > > > > > 
> > > > > > > > > > > > > For right now, it's too close to the release to merge 
> > > > > > > > > > > > > the series
> > > > > > > > > that
> > > > > > > > > > > > > allows for binman to be used to generate the final 
> > > > > > > > > > > > > images, and
> > > > > > > > > also not
> > > > > > > > > > > > > break CI, and then also merge all of the series that 
> > > > > > > > > > > > > convert
> > > > > > > > > currently
> > > > > > > > > > > > > broken platforms to use binman instead.  So, bring 
> > > > > > > > > > > > > back this
> > > > > > > > > script now
> > > > > > > > > > > > > and remove it again for real after the release.
> > > > > > > > > > > > 
> > > > > > > > > > > > Please note that this might not work, as the FIT 
> > > > > > > > > > > > generator script
> > > > > > > > > would
> > > > > > > > > > > > generate ITS with '@' symbols which are not compatible 
> > > > > > > > > > > > with mkimage
> > > > > > > > > due
> > > > > > > > > > > > to CVE-2021-27138. This revert should be complemented 
> > > > > > > > > > > > with the fix to
> > > > > > > > > > > > remove those '@' symbols as well.
> > > > > > > > > > > 
> > > > > > > > > > > Correct, the revert is not enough anymore:
> > > > > > > > > > >   MKIMAGE u-boot.itb
> > > > > > > > > > > u-boot.its:7.

Re: [PATCH] Revert "tree: imx: remove old fit generator script"

2022-01-07 Thread Marcel Ziswiler
> /images/fdt@3:
> > > > > > > > > node has a unit name, but no reg property
> > > > > > > > > u-boot.its:34.9-39.5: Warning (unit_address_vs_reg): 
> > > > > > > > > /images/fdt@4:
> > > > > > > > > node has a unit name, but no reg property
> > > > > > > > > u-boot.its:40.9-45.5: Warning (unit_address_vs_reg): 
> > > > > > > > > /images/fdt@5:
> > > > > > > > > node has a unit name, but no reg property
> > > > > > > > > u-boot.its:46.9-55.5: Warning (unit_address_vs_reg): 
> > > > > > > > > /images/atf@1:
> > > > > > > > > node has a unit name, but no reg property
> > > > > > > > > u-boot.its:60.12-65.5: Warning (unit_address_vs_reg):
> > > > > > > > > /configurations/config@1: node has a unit name, but no reg 
> > > > > > > > > property
> > > > > > > > > u-boot.its:66.12-71.5: Warning (unit_address_vs_reg):
> > > > > > > > > /configurations/config@2: node has a unit name, but no reg 
> > > > > > > > > property
> > > > > > > > > u-boot.its:72.12-77.5: Warning (unit_address_vs_reg):
> > > > > > > > > /configurations/config@3: node has a unit name, but no reg 
> > > > > > > > > property
> > > > > > > > > u-boot.its:78.12-83.5: Warning (unit_address_vs_reg):
> > > > > > > > > /configurations/config@4: node has a unit name, but no reg 
> > > > > > > > > property
> > > > > > > > > u-boot.its:84.12-89.5: Warning (unit_address_vs_reg):
> > > > > > > > > /configurations/config@5: node has a unit name, but no reg 
> > > > > > > > > property
> > > > > > > > > ./tools/mkimage: verify_header failed for FIT Image support 
> > > > > > > > > with exit
> > > > > > > code 1
> > > > > > > > > Makefile:1433: recipe for target 'u-boot.itb' failed
> > > > > > > > > make: *** [u-boot.itb] Error 1
> > > > > > > > > make: *** Deleting file 'u-boot.itb'
> > > > > > > > > make: *** Waiting for unfinished jobs
> > > > > > > > > 
> > > > > > > > > I don't know what had changed to cause this or when (again, I 
> > > > > > > > > stopped
> > > > > > > > > worrying about it because I thought we were moving to binman 
> > > > > > > > > for this
> > > > > > > > > release). There was a patch that resolved this from Oliver at
> > > > > > > > > https://lists.denx.de/pipermail/u-boot/2021-August/457997.html
> > > > > > > > >  but I
> > > > > > > > > don't think that fully solves anything 'at this point' either.
> > > > > > > > > 
> > > > > > > > > Even with that applied to current master I then end up with:
> > > > > > > > >   MKIMAGE flash.bin
> > > > > > > > > ./tools/mkimage: Can't open spl/u-boot-spl-ddr.bin: No such 
> > > > > > > > > file or
> > > > > > > directory
> > > > > > > > > arch/arm/mach-imx/Makefile:167: recipe for target 'flash.bin' 
> > > > > > > > > failed
> > > > > > > > > make[1]: *** [flash.bin] Error 1
> > > > > > > > > make[1]: *** Deleting file 'flash.bin'
> > > > > > > > > Makefile:1526: recipe for target 'flash.bin' failed
> > > > > > > > > 
> > > > > > > > > At some point over the past couple of months that patch 
> > > > > > > > > resolved the
> > > > > > > > > building issue when using the FIT generator but I also don't 
> > > > > > > > > know what
> > > > > > > > > else has changed that now causes that to not work.
> > > > > > > > > 
> > > > > > > > > As Tom pointed out in another thread these build failures did 
> > > > > > > > > not get
> > > > > > > > > caught by CI appare

Re: mkimage_fit_atf.sh: not found

2022-01-05 Thread Marcel Ziswiler
On Wed, 2022-01-05 at 17:04 -0500, Tom Rini wrote:
> On Wed, Jan 05, 2022 at 10:51:23PM +0100, Marcel Ziswiler wrote:
> > Hi Tim et al.
> > 
> > On Wed, 2022-01-05 at 11:08 -0800, Tim Harvey wrote:
> > > On Wed, Jan 5, 2022 at 3:34 AM ZHIZHIKIN Andrey
> > >  wrote:
> > > > 
> > > > Hello Tim,
> > > > 
> > > > > -Original Message-
> > > > > From: U-Boot  On Behalf Of Tim Harvey
> > > > > Sent: Tuesday, January 4, 2022 11:48 PM
> > > > > To: u-boot ; Stefano Babic ; 
> > > > > Fabio Estevam
> > > > > 
> > > > > Cc: Schrempf Frieder ; Adam Ford
> > > > > ; Marcel Ziswiler ; Jagan 
> > > > > Teki
> > > > > 
> > > > > Subject: mkimage_fit_atf.sh: not found
> > > > > 
> > > > > Stefano and Fabio,
> > > > > 
> > > > > I'm seeing the imx8mm_venice_defconfig target failing to build on
> > > > > master due to mkimage_fit_atf.sh not found:
> > > > > ./"arch/arm/mach-imx/mkimage_fit_atf.sh" \
> > > > > arch/arm/dts/imx8mm-venice-gw71xx-0x.dtb
> > > > > arch/arm/dts/imx8mm-venice-gw72xx-0x.dtb
> > > > > arch/arm/dts/imx8mm-venice-gw73xx-0x.dtb
> > > > > arch/arm/dts/imx8mm-venice-gw7901.dtb
> > > > > arch/arm/dts/imx8mm-venice-gw7902.dtb > u-boot.its
> > > > > /bin/sh: 1: ./arch/arm/mach-imx/mkimage_fit_atf.sh: not found
> > > > > 
> > > > 
> > > > This has been dropped in d9a6f0eed6 ("tree: imx: remove old fit 
> > > > generator script")
> > > 
> > > So why was that merged when it breaks several boards that are not
> > > switched to binman because of the CI issue?
> > 
> > I have to admit that I did not closely follow that discussion lately. But 
> > it seems to me that this should
> > be
> > solvable, not?
> > 
> > Anyway, at least in my local buildman use case just touching resp. binary 
> > blob file names helped me getting
> > thought this:
> > 
> > ⬢[zim@toolbox u-boot.git]$ touch lpddr4_pmu_train_1d_imem.bin
> > ⬢[zim@toolbox u-boot.git]$ touch lpddr4_pmu_train_1d_dmem.bin
> > ⬢[zim@toolbox u-boot.git]$ touch lpddr4_pmu_train_2d_imem.bin
> > ⬢[zim@toolbox u-boot.git]$ touch lpddr4_pmu_train_2d_dmem.bin
> > ⬢[zim@toolbox u-boot.git]$ touch bl31.bin
> > 
> > Couldn't that somehow also be done for CI?
> 
> There's a whole thread on making binman be able to fake things out in
> this case, so that it doesn't require too much special casing within CI
> itself.
> 
> > > > > As far as I can tell the other boards that are still using
> > > > > SPL_FIT_GENERATOR also fail due to this (ie imx8mm_beacon_defconfig,
> > > > > imx8mq_evk_defconfig, imx8mm-icore-mx8mm-edimm2.2_defconfig, etc).
> > > > 
> > > > imx8mq_evk is already converted and I've sent a patch for it, see [1].
> > > > 
> > > > > 
> > > > > What is the state of the binman conversion? I submitted a series to
> > > > > convert my boards to binman and it has just been sitting without any
> > > > > response for months now [1].
> > > > 
> > > > I believe that the reason for your series sitting in the queue is the 
> > > > same as
> > > > for imx8mq_evk: missing binary blobs (ATF and DDR) are failing CI 
> > > > builds.
> > > > 
> > > 
> > > Right, so imx8mq_evk (and others) are completely broken for the
> > > pending release correct?
> > > 
> > > Sounds like we need to revert d9a6f0eed6 ("tree: imx: remove old fit
> > > generator script")
> > 
> > I kind of agree. However, much smarter would be to finish that binman 
> > conversion which I also still have
> > one in
> > flight [1] plus the follow on patch series [2] (plus an unrelated i.MX 8M 
> > Plus board addition [3]) all
> > still
> > sitting there idle since October with acks resp. reviewed-bys in place!
> 
> Yes, I am hopeful many outstanding things in this area will get picked
> up after v2022.01 is released.  Might it make sense to revert what Tim
> suggested for now tho?

Sure, fair enough.

And what about them pending patch series?


Re: mkimage_fit_atf.sh: not found

2022-01-05 Thread Marcel Ziswiler
Hi Tim et al.

On Wed, 2022-01-05 at 11:08 -0800, Tim Harvey wrote:
> On Wed, Jan 5, 2022 at 3:34 AM ZHIZHIKIN Andrey
>  wrote:
> > 
> > Hello Tim,
> > 
> > > -Original Message-
> > > From: U-Boot  On Behalf Of Tim Harvey
> > > Sent: Tuesday, January 4, 2022 11:48 PM
> > > To: u-boot ; Stefano Babic ; Fabio 
> > > Estevam
> > > 
> > > Cc: Schrempf Frieder ; Adam Ford
> > > ; Marcel Ziswiler ; Jagan Teki
> > > 
> > > Subject: mkimage_fit_atf.sh: not found
> > > 
> > > Stefano and Fabio,
> > > 
> > > I'm seeing the imx8mm_venice_defconfig target failing to build on
> > > master due to mkimage_fit_atf.sh not found:
> > > ./"arch/arm/mach-imx/mkimage_fit_atf.sh" \
> > > arch/arm/dts/imx8mm-venice-gw71xx-0x.dtb
> > > arch/arm/dts/imx8mm-venice-gw72xx-0x.dtb
> > > arch/arm/dts/imx8mm-venice-gw73xx-0x.dtb
> > > arch/arm/dts/imx8mm-venice-gw7901.dtb
> > > arch/arm/dts/imx8mm-venice-gw7902.dtb > u-boot.its
> > > /bin/sh: 1: ./arch/arm/mach-imx/mkimage_fit_atf.sh: not found
> > > 
> > 
> > This has been dropped in d9a6f0eed6 ("tree: imx: remove old fit generator 
> > script")
> 
> So why was that merged when it breaks several boards that are not
> switched to binman because of the CI issue?

I have to admit that I did not closely follow that discussion lately. But it 
seems to me that this should be
solvable, not?

Anyway, at least in my local buildman use case just touching resp. binary blob 
file names helped me getting
thought this:

⬢[zim@toolbox u-boot.git]$ touch lpddr4_pmu_train_1d_imem.bin
⬢[zim@toolbox u-boot.git]$ touch lpddr4_pmu_train_1d_dmem.bin
⬢[zim@toolbox u-boot.git]$ touch lpddr4_pmu_train_2d_imem.bin
⬢[zim@toolbox u-boot.git]$ touch lpddr4_pmu_train_2d_dmem.bin
⬢[zim@toolbox u-boot.git]$ touch bl31.bin

Couldn't that somehow also be done for CI?

> > > As far as I can tell the other boards that are still using
> > > SPL_FIT_GENERATOR also fail due to this (ie imx8mm_beacon_defconfig,
> > > imx8mq_evk_defconfig, imx8mm-icore-mx8mm-edimm2.2_defconfig, etc).
> > 
> > imx8mq_evk is already converted and I've sent a patch for it, see [1].
> > 
> > > 
> > > What is the state of the binman conversion? I submitted a series to
> > > convert my boards to binman and it has just been sitting without any
> > > response for months now [1].
> > 
> > I believe that the reason for your series sitting in the queue is the same 
> > as
> > for imx8mq_evk: missing binary blobs (ATF and DDR) are failing CI builds.
> > 
> 
> Right, so imx8mq_evk (and others) are completely broken for the
> pending release correct?
> 
> Sounds like we need to revert d9a6f0eed6 ("tree: imx: remove old fit
> generator script")

I kind of agree. However, much smarter would be to finish that binman 
conversion which I also still have one in
flight [1] plus the follow on patch series [2] (plus an unrelated i.MX 8M Plus 
board addition [3]) all still
sitting there idle since October with acks resp. reviewed-bys in place!

Cheers

Marcel

> Tim
> 
> > > 
> > > I'm not sure when the above breakage occurred but the conversion to
> > > binman resolves it and other things.
> > > 
> > > Please let me know what you expect me to do to resolve this as there
> > > is a release pending.
> > > 
> > > Best regards,
> > > 
> > > Tim
> > > [1] 
> > > https://patchwork.ozlabs.org/project/uboot/patch/20211006201700.3018-1-
> > > thar...@gateworks.com/
> > 
> > -- andrey
> > 
> > Link: [1]:
> > http://patchwork.ozlabs.org/project/uboot/patch/20211203161802.12699-1-andrey.zhizhi...@leica-geosystems.com/

[1] 
http://patchwork.ozlabs.org/project/uboot/patch/20211022214340.1214793-1-mar...@ziswiler.com/
[2] http://patchwork.ozlabs.org/project/uboot/list/?series=268510
[3] 
http://patchwork.ozlabs.org/project/uboot/patch/20211022073104.1105628-1-mar...@ziswiler.com/


DeprecationWarning: distutils package and distutils.sysconfig module deprecated

2021-11-10 Thread Marcel Ziswiler
Hi there

After migrating to a new Fedora Silverblue 35 based setup with toolbx I get the 
following while compiling U-
Boot. Is/has anybody already looked into this?

scripts/dtc/pylibfdt/setup.py:21: DeprecationWarning: The distutils package is 
deprecated and slated for
removal in Python 3.12. Use setuptools or check PEP 632 for potential 
alternatives
  from distutils.core import setup, Extension

tools/binman/binman:12: DeprecationWarning: The distutils package is deprecated 
and slated for removal in
Python 3.12. Use setuptools or check PEP 632 for potential alternatives
  from distutils.sysconfig import get_python_lib

tools/binman/binman:12: DeprecationWarning: The distutils.sysconfig module is 
deprecated, use sysconfig instead
  from distutils.sysconfig import get_python_lib

Cheers

Marcel


Re: [PATCH] imx8mn_var_som: Add support for Variscite VAR-SOM-MX8M-NANO board

2021-11-03 Thread Marcel Ziswiler
Hi Ariel

On Tue, 2021-11-02 at 20:18 -0300, Ariel D'Alessandro wrote:
> Add support for iMX8MN VAR-SOM-MX8M-NANO board. Enables support for:
> 
> - 1GiB DDR4 RAM
> - 16 GiB eMMC
> - SD card
> - Gigabit ethernet
> - USBOTG1 peripheral - fastboot
> 
> Signed-off-by: Ariel D'Alessandro 
> ---
>  arch/arm/dts/Makefile |   1 +
>  arch/arm/dts/imx8mn-var-som-u-boot.dtsi   | 220 
>  arch/arm/dts/imx8mn-var-som.dts   | 425 ++
>  arch/arm/mach-imx/imx8m/Kconfig   |   9 +
>  board/variscite/imx8mn_var_som/Kconfig    |  17 +
>  board/variscite/imx8mn_var_som/Makefile   |  12 +
>  board/variscite/imx8mn_var_som/ddr4_timing.c  | 529 ++
>  .../variscite/imx8mn_var_som/imx8mn_var_som.c |  35 ++
>  .../imx8mn_var_som/imximage-8mn-ddr4.cfg  |  12 +
>  board/variscite/imx8mn_var_som/spl.c  | 104 
>  configs/imx8mn_var_som_defconfig  |  98 
>  include/configs/imx8mn_var_som.h  | 106 
>  12 files changed, 1568 insertions(+)
>  create mode 100644 arch/arm/dts/imx8mn-var-som-u-boot.dtsi
>  create mode 100644 arch/arm/dts/imx8mn-var-som.dts
>  create mode 100644 board/variscite/imx8mn_var_som/Kconfig
>  create mode 100644 board/variscite/imx8mn_var_som/Makefile
>  create mode 100644 board/variscite/imx8mn_var_som/ddr4_timing.c
>  create mode 100644 board/variscite/imx8mn_var_som/imx8mn_var_som.c
>  create mode 100644 board/variscite/imx8mn_var_som/imximage-8mn-ddr4.cfg
>  create mode 100644 board/variscite/imx8mn_var_som/spl.c
>  create mode 100644 configs/imx8mn_var_som_defconfig
>  create mode 100644 include/configs/imx8mn_var_som.h
> 
> diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
> index cc34da7bd83..dfa034be80f 100644
> --- a/arch/arm/dts/Makefile
> +++ b/arch/arm/dts/Makefile
> @@ -901,6 +901,7 @@ dtb-$(CONFIG_ARCH_IMX8M) += \
> imx8mn-ddr4-evk.dtb \
> imx8mq-cm.dtb \
> imx8mn-evk.dtb \
> +   imx8mn-var-som.dtb \
> imx8mq-evk.dtb \
> imx8mm-beacon-kit.dtb \
> imx8mn-beacon-kit.dtb \
> diff --git a/arch/arm/dts/imx8mn-var-som-u-boot.dtsi 
> b/arch/arm/dts/imx8mn-var-som-u-boot.dtsi
> new file mode 100644
> index 000..73df408bc82
> --- /dev/null
> +++ b/arch/arm/dts/imx8mn-var-som-u-boot.dtsi
> @@ -0,0 +1,220 @@
> +// SPDX-License-Identifier: GPL-2.0+
> +/*
> + * Copyright 2021 Collabora Ltd.
> + */
> +
> +/ {
> +   binman: binman {
> +   multiple-images;
> +   };
> +
> +   wdt-reboot {
> +   compatible = "wdt-reboot";
> +   wdt = <>;
> +   u-boot,dm-spl;
> +   };
> +};
> +
> +&{/soc@0} {
> +   u-boot,dm-pre-reloc;
> +   u-boot,dm-spl;
> +};
> +
> +&{/soc@0/bus@3080/i2c@30a2/pmic@4b} {
> +   u-boot,dm-spl;
> +};
> +
> +&{/soc@0/bus@3080/i2c@30a2/pmic@4b/regulators} {
> +   u-boot,dm-spl;
> +};
> +
> + {
> +   u-boot,dm-spl;
> +   u-boot,dm-pre-reloc;

You might want to consistently order properties alphabetically (e.g. see 3 
nodes further up).

> +};
> +
> + {
> +   u-boot,dm-spl;
> +};
> +
> + {
> +   u-boot,dm-spl;
> +};
> +
> + {
> +   u-boot,dm-spl;
> +   u-boot,dm-pre-reloc;

Ditto.

> +   /delete-property/ assigned-clocks;
> +   /delete-property/ assigned-clock-parents;
> +   /delete-property/ assigned-clock-rates;
> +};
> +
> + {
> +   u-boot,dm-spl;
> +};
> +
> + {
> +   u-boot,dm-spl;
> +};
> +
> + {
> +   u-boot,dm-spl;
> +};
> +
> + {
> +   u-boot,dm-spl;
> +};
> +
> + {
> +   u-boot,dm-spl;
> +};
> +
> +_24m {
> +   u-boot,dm-spl;
> +   u-boot,dm-pre-reloc;

Ditto.

> +};
> +
> +_i2c1 {
> +   u-boot,dm-spl;
> +};
> +
> +_pmic {
> +   u-boot,dm-spl;
> +};
> +
> +_reg_usdhc2_vmmc {
> +   u-boot,dm-spl;
> +};
> +
> +_uart4 {
> +   u-boot,dm-spl;
> +};
> +
> +_usdhc2 {
> +   u-boot,dm-spl;
> +};
> +
> +_usdhc3 {
> +   u-boot,dm-spl;
> +};
> +
> +_wdog {
> +   u-boot,dm-spl;
> +};
> +
> + {
> +   u-boot,dm-spl;
> +};
> +
> + {
> +   u-boot,dm-spl;
> +};
> +
> + {
> +   u-boot,dm-spl;
> +};
> +
> + {
> +   u-boot,dm-spl;
> +};
> +
> + {
> +    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 = "ddr4_imem_1d.bin";
> +   size = <0x8000>;
> +   };
> +
> +   blob_2: blob-ext@2 {
> +   filename = "ddr4_dmem_1d.bin";
> +   size = <0x4000>;
> +   };
> +
> +   blob_3: blob-ext@3 {
> +   filename = "ddr4_imem_2d.bin";
> +   size = <0x8000>;
> +   };
> +
> 

Re: [PATCH v3 0/7] arm64: dts: imx8mm: use common binman configuration and further clean-up

2021-10-22 Thread Marcel Ziswiler
On Sat, 2021-10-23 at 01:15 +0200, Marcel Ziswiler wrote:
> From: Marcel Ziswiler 
> 
> 
> 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. Move the comon part of
> that configuration to the common imx8mm-u-boot.dtsi include file.
> 
> The initial patch fixes an issue with intermediate binary naming for the
> imx8mm-cl-iot-gate. And subsequent patches further clean up that dtsi.
> 
> This series is based on my refresh of Adam's imx8mm_beacon switch to
> binman patch [1], my refresh of Michael's sl28 patches [2]

Sorry, there was a misunderstanding on my side. This i.MX 8M Mini patch series, 
of course, does not depend on
anything sl28 which is fsl-qoriq based hardware. Thanks to Michael for pointing 
that out and sorry again!

> and Tim's
> switching imx8mm_venice to using binman to pack images [3].
> 
> [1] https://marc.info/?l=u-boot=163493902915471
> [2] https://marc.info/?l=u-boot=163494122816224
> [3] https://marc.info/?l=u-boot=163355140309636
> 
> Changes in v3:
> - Integrated imx8mm_beacon as well.
> - Re-based on top of imx/master.
> 
> Changes in v2:
> - New patch preparing cl-iot-gate.
> - New patch preparing cl-iot-gate.
> - Morph common binman dtsi into regular common u-boot dtsi as discussed
>   on mailing list.
> - Re-based.
> - Rather than doing that clean-up to the separate binman dtsi now do it
>   to the common u-boot dtsi one.
> - Rather than doing that clean-up to the separate binman dtsi now do it
>   to the common u-boot dtsi one.
> - Rather than doing that clean-up to the separate binman dtsi now do it
>   to the common u-boot dtsi one.
> 
> Changes in v1:
> - This was suggested by Simon on my earlier patch set upon which we
>   decided to first break this up into a common binman dtsi and then
>   subsequently do such further improvements.
> 
> Marcel Ziswiler (7):
>   imx8mm-cl-iot-gate: fix imximage intermediate binary naming
>   arm64: dts: imx8mm-cl-iot-gate-u-boot.dtsi: alphabetically re-order
>   arm64: dts: imx8mm-cl-iot-gate-u-boot.dtsi: use common
>     imx8mm-u-boot.dtsi
>   arm64: dts: imx8mm: use common binman configuration
>   arm64: dts: imx8mm-u-boot.dtsi: alphabetically re-order properties
>   arm64: dts: imx8mm-u-boot.dtsi: explicitly add spl filename
>   arm64: dts: imx8mm-u-boot.dtsi: improve odd blob-ext naming
> 
>  arch/arm/dts/imx8mm-beacon-kit-u-boot.dtsi    | 122 --
>  .../dts/imx8mm-cl-iot-gate-optee-u-boot.dtsi  | 209 --
>  arch/arm/dts/imx8mm-cl-iot-gate-u-boot.dtsi   | 188 +++-
>  arch/arm/dts/imx8mm-evk-u-boot.dtsi   | 123 ---
>  arch/arm/dts/imx8mm-u-boot.dtsi   | 149 -
>  arch/arm/dts/imx8mm-venice-u-boot.dtsi    | 119 --
>  arch/arm/dts/imx8mm-verdin-u-boot.dtsi    | 122 +-
>  .../imximage-8mm-lpddr4.cfg   |   2 +-
>  8 files changed, 212 insertions(+), 822 deletions(-)


Re: [PATCH v4 0/5] board: sl28: target refresh

2021-10-22 Thread Marcel Ziswiler
On Sat, 2021-10-23 at 00:19 +0200, Marcel Ziswiler wrote:
> From: Marcel Ziswiler 
> 
> 
> Note that this re-base is only compile tested.
> 
> Changes in v4:
> - Re-based on top of imx/master.
> 
> Changes in v3:
> - none
>  - use CONFIG_EFI_CAPSULE_FIRMWARE_FIT instead of
>    CONFIG_EFI_CAPSULE_FIRMWARE_RAW
> 
> Changes in v2:
> - none
> - new patch
> 
> Frieder Schrempf (1):
>   doc: board: kontron: sl28: Reduce section levels and change title
> 
> Michael Walle (4):
>   board: sl28: enable EFI_SET_TIME support
>   board: sl28: generate FIT update image
>   board: sl28: enable EFI UpdateCapsule support
>   board: sl28: add update image documentation
> 
>  .../dts/fsl-ls1028a-kontron-sl28-u-boot.dtsi  | 35 ++-
>  configs/kontron_sl28_defconfig    |  7 +++
>  doc/board/kontron/sl28.rst    | 45 ---
>  include/configs/kontron_sl28.h    |  2 +
>  4 files changed, 72 insertions(+), 17 deletions(-)

Sorry, there was a misunderstanding on my side. Please just disregard this v4. 
Thanks!


Re: [PATCH v4 0/5] board: sl28: target refresh

2021-10-22 Thread Marcel Ziswiler
Hi Michael

On Sat, 2021-10-23 at 01:28 +0200, Michael Walle wrote:
> Hi Marcel,
> 
> Am 2021-10-23 01:09, schrieb Marcel Ziswiler:
> > Sorry, I did not want to upset anybody. I probably should have asked
> > first before doing this.
> 
> You could have said the below in the cover letter. Then
> I'd have at least an idea what is going on ;)
> 
> > On Sat, 2021-10-23 at 00:52 +0200, Michael Walle wrote:
> > > Hi Marcel,
> > > 
> > > Am 2021-10-23 00:19, schrieb Marcel Ziswiler:
> > > > From: Marcel Ziswiler 
> > > > 
> > > > 
> > > > Note that this re-base is only compile tested.
> > > 
> > > Care to explain what this is? Why are you taking my patchset
> > > and make a new version of it and rebasing it on the wrong
> > > tree?
> > 
> > You might have noticed that Stefano has a hard time applying some
> > patch sets due to continuing conflicts.
> > Therefore in trying to further the binman clean-up [1] were I am just
> > about to post a new version as well, I
> > took the liberty to re-fresh all the patches my series bases on which
> > have not seen any care for more than a
> > month. I re-based them on top of Stefano's u-boot-imx/master branch
> > which I am very certain is exactly the tree
> > stuff needs to be re-based to, not?
> 
> This is a layerscape SoC board whose patches usually go through
> u-boot-fsl-qoriq. Apart from the one doc fix there should be no
> dependency on the u-boot-imx tree. I just took Frieder's doc fix
> because my last patch depends on it, (in a sense that it doesn't
> apply without it). The imx tree should be fine without the fix,
> it's just that the generated doc is messed up for the kontron
> boards.

Hm, now as you say it I am also wondering a little bit why it slipped into my 
dependency list. And then, of
course, nobody noticed anything (;-p).

> I think you don't really need this for your series.
> 
> > > Did I miss something?
> > 
> > Not sure. If you still feel my work is of no help to the community I
> > am more than happy to abandon any of it.
> 
> Now knowing why you did it, it's fine; its just the wrong
> tree.

Yep, now I see it. And my re-base does not even make any sense in this case. I 
guess, your v3 was and is still
just fine for the u-boot-fsl-qoriq/master branch. Let me just cancel this v4 
then. I am really sorry and hope I
did not disturb anything.

> -michael

Cheers

Marcel


[PATCH v3 7/7] arm64: dts: imx8mm-u-boot.dtsi: improve odd blob-ext naming

2021-10-22 Thread Marcel Ziswiler
From: Marcel Ziswiler 

Rather than using odd implicit blob-ext naming, explicitly specify the
type to be of blob-ext and therefore also simplify the node naming.

Signed-off-by: Marcel Ziswiler 
Reviewed-by: Peng Fan 

---

(no changes since v2)

Changes in v2:
- Rather than doing that clean-up to the separate binman dtsi now do it
  to the common u-boot dtsi one.

Changes in v1:
- This was suggested by Simon on my earlier patch set upon which we
  decided to first break this up into a common binman dtsi and then
  subsequently do such further improvements.

 arch/arm/dts/imx8mm-u-boot.dtsi | 27 ++-
 1 file changed, 18 insertions(+), 9 deletions(-)

diff --git a/arch/arm/dts/imx8mm-u-boot.dtsi b/arch/arm/dts/imx8mm-u-boot.dtsi
index 8feb0f2592a..7882fe73167 100644
--- a/arch/arm/dts/imx8mm-u-boot.dtsi
+++ b/arch/arm/dts/imx8mm-u-boot.dtsi
@@ -39,24 +39,28 @@
filename = "u-boot-spl.bin";
};
 
-   blob_1: blob-ext@1 {
+   1d-imem {
filename = "lpddr4_pmu_train_1d_imem.bin";
size = <0x8000>;
+   type = "blob-ext";
};
 
-   blob_2: blob-ext@2 {
+   1d_dmem {
filename = "lpddr4_pmu_train_1d_dmem.bin";
size = <0x4000>;
+   type = "blob-ext";
};
 
-   blob_3: blob-ext@3 {
+   2d_imem {
filename = "lpddr4_pmu_train_2d_imem.bin";
size = <0x8000>;
+   type = "blob-ext";
};
 
-   blob_4: blob-ext@4 {
+   2d_dmem {
filename = "lpddr4_pmu_train_2d_dmem.bin";
size = <0x4000>;
+   type = "blob-ext";
};
};
 
@@ -89,8 +93,9 @@
load = ;
type = "standalone";
 
-   uboot_blob: blob-ext {
+   uboot_blob {
filename = "u-boot-nodtb.bin";
+   type = "blob-ext";
};
};
 
@@ -102,8 +107,9 @@
load = <0x92>;
type = "firmware";
 
-   atf_blob: blob-ext {
+   atf_blob {
filename = "bl31.bin";
+   type = "blob-ext";
};
};
 
@@ -120,8 +126,9 @@
description = "NAME";
type = "flat_dt";
 
-   uboot_fdt_blob: blob-ext {
+   uboot_fdt_blob {
filename = "u-boot.dtb";
+   type = "blob-ext";
};
};
};
@@ -143,14 +150,16 @@
filename = "flash.bin";
pad-byte = <0x00>;
 
-   spl: blob-ext@1 {
+   spl {
filename = "spl.bin";
offset = <0x0>;
+   type = "blob-ext";
};
 
-   binman_uboot: blob-ext@2 {
+   binman_uboot: uboot {
filename = "u-boot.itb";
offset = <0x57c00>;
+   type = "blob-ext";
};
};
 };
-- 
2.26.2



[PATCH v3 4/7] arm64: dts: imx8mm: use common binman configuration

2021-10-22 Thread Marcel Ziswiler
From: Marcel Ziswiler 

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. Move the comon part of
that configuration to the common imx8mm-u-boot.dtsi include file.

Signed-off-by: Marcel Ziswiler 
Reviewed-by: Peng Fan 

---

Changes in v3:
- Integrated imx8mm_beacon as well.
- Re-based on top of imx/master.

Changes in v2:
- Morph common binman dtsi into regular common u-boot dtsi as discussed
  on mailing list.
- Re-based.

 arch/arm/dts/imx8mm-beacon-kit-u-boot.dtsi| 122 
 .../dts/imx8mm-cl-iot-gate-optee-u-boot.dtsi  | 124 ++--
 arch/arm/dts/imx8mm-cl-iot-gate-u-boot.dtsi   | 105 --
 arch/arm/dts/imx8mm-evk-u-boot.dtsi   | 123 
 arch/arm/dts/imx8mm-u-boot.dtsi   | 133 ++
 arch/arm/dts/imx8mm-venice-u-boot.dtsi| 119 
 arch/arm/dts/imx8mm-verdin-u-boot.dtsi| 122 +---
 7 files changed, 147 insertions(+), 701 deletions(-)

diff --git a/arch/arm/dts/imx8mm-beacon-kit-u-boot.dtsi 
b/arch/arm/dts/imx8mm-beacon-kit-u-boot.dtsi
index 3c034a85e35..73ddfdade6a 100644
--- a/arch/arm/dts/imx8mm-beacon-kit-u-boot.dtsi
+++ b/arch/arm/dts/imx8mm-beacon-kit-u-boot.dtsi
@@ -6,10 +6,6 @@
 #include "imx8mm-u-boot.dtsi"
 
 / {
-   binman: binman {
-   multiple-images;
-   };
-
wdt-reboot {
compatible = "wdt-reboot";
wdt = <>;
@@ -104,121 +100,3 @@
  {
u-boot,dm-spl;
 };
-
- {
-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 = ;
-
-   images {
-   uboot {
-   description = "U-Boot (64-bit)";
-   type = "standalone";
-   arch = "arm64";
-   compression = "none";
-   load = ;
-
-   uboot_blob: blob-ext {
-   filename = "u-boot-nodtb.bin";
-   };
-   };
-
-   atf {
-   description = "ARM Trusted Firmware";
-   type = "firmware";
-   arch = "arm64";
-   compression = "none";
-   load = <0x92>;
-   entry = <0x92>;
-
-   atf_blob: blob-ext {
-   filename = "bl31.bin";
-   };
-   };
-
-   fdt {
-   description = "NAME";
-   type = "flat_dt";
-   compression = "none";
-
-   uboot_fdt_blob

[PATCH v3 6/7] arm64: dts: imx8mm-u-boot.dtsi: explicitly add spl filename

2021-10-22 Thread Marcel Ziswiler
From: Marcel Ziswiler 

Explicitly add SPL aka u-boot-spl.bin filename.

Signed-off-by: Marcel Ziswiler 
Reviewed-by: Peng Fan 

---

(no changes since v2)

Changes in v2:
- Rather than doing that clean-up to the separate binman dtsi now do it
  to the common u-boot dtsi one.

 arch/arm/dts/imx8mm-u-boot.dtsi | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/dts/imx8mm-u-boot.dtsi b/arch/arm/dts/imx8mm-u-boot.dtsi
index 770282d2b98..8feb0f2592a 100644
--- a/arch/arm/dts/imx8mm-u-boot.dtsi
+++ b/arch/arm/dts/imx8mm-u-boot.dtsi
@@ -36,6 +36,7 @@
 
u-boot-spl {
align-end = <4>;
+   filename = "u-boot-spl.bin";
};
 
blob_1: blob-ext@1 {
-- 
2.26.2



[PATCH v3 5/7] arm64: dts: imx8mm-u-boot.dtsi: alphabetically re-order properties

2021-10-22 Thread Marcel Ziswiler
From: Marcel Ziswiler 

Alphabetically re-order properties.

Signed-off-by: Marcel Ziswiler 
Reviewed-by: Peng Fan 

---

(no changes since v2)

Changes in v2:
- Rather than doing that clean-up to the separate binman dtsi now do it
  to the common u-boot dtsi one.

 arch/arm/dts/imx8mm-u-boot.dtsi | 34 -
 1 file changed, 17 insertions(+), 17 deletions(-)

diff --git a/arch/arm/dts/imx8mm-u-boot.dtsi b/arch/arm/dts/imx8mm-u-boot.dtsi
index 5020255fa0f..770282d2b98 100644
--- a/arch/arm/dts/imx8mm-u-boot.dtsi
+++ b/arch/arm/dts/imx8mm-u-boot.dtsi
@@ -15,8 +15,8 @@
 };
 
  {
-   u-boot,dm-spl;
u-boot,dm-pre-reloc;
+   u-boot,dm-spl;
 };
 
  {
@@ -29,10 +29,10 @@
 
  {
u-boot-spl-ddr {
+   align = <4>;
+   align-size = <4>;
filename = "u-boot-spl-ddr.bin";
pad-byte = <0xff>;
-   align-size = <4>;
-   align = <4>;
 
u-boot-spl {
align-end = <4>;
@@ -76,17 +76,17 @@
 
fit {
description = "Configuration to load ATF before U-Boot";
-   #address-cells = <1>;
fit,external-offset = ;
fit,fdt-list = "of-list";
+   #address-cells = <1>;
 
images {
uboot {
-   description = "U-Boot (64-bit)";
-   type = "standalone";
arch = "arm64";
compression = "none";
+   description = "U-Boot (64-bit)";
load = ;
+   type = "standalone";
 
uboot_blob: blob-ext {
filename = "u-boot-nodtb.bin";
@@ -94,12 +94,12 @@
};
 
atf {
-   description = "ARM Trusted Firmware";
-   type = "firmware";
arch = "arm64";
compression = "none";
-   load = <0x92>;
+   description = "ARM Trusted Firmware";
entry = <0x92>;
+   load = <0x92>;
+   type = "firmware";
 
atf_blob: blob-ext {
filename = "bl31.bin";
@@ -107,17 +107,17 @@
};
 
binman_fip: fip {
-   description = "Trusted Firmware FIP";
-   type = "firmware";
arch = "arm64";
compression = "none";
+   description = "Trusted Firmware FIP";
load = <0x4031>;
+   type = "firmware";
};
 
@fdt-SEQ {
+   compression = "none";
description = "NAME";
type = "flat_dt";
-   compression = "none";
 
uboot_fdt_blob: blob-ext {
filename = "u-boot.dtb";
@@ -130,9 +130,9 @@
 
binman_configuration: @config-SEQ {
description = "NAME";
+   fdt = "fdt-SEQ";
firmware = "uboot";
loadables = "atf";
-   fdt = "fdt-SEQ";
};
};
};
@@ -143,20 +143,20 @@
pad-byte = <0x00>;
 
spl: blob-ext@1 {
-   offset = <0x0>;
filename = "spl.bin";
+   offset = <0x0>;
};
 
binman_uboot: blob-ex

[PATCH v3 3/7] arm64: dts: imx8mm-cl-iot-gate-u-boot.dtsi: use common imx8mm-u-boot.dtsi

2021-10-22 Thread Marcel Ziswiler
From: Marcel Ziswiler 

Use common imx8mm-u-boot.dtsi.

Signed-off-by: Marcel Ziswiler 
Reviewed-by: Peng Fan 

---

(no changes since v2)

Changes in v2:
- New patch preparing cl-iot-gate.

 .../dts/imx8mm-cl-iot-gate-optee-u-boot.dtsi  | 37 +--
 arch/arm/dts/imx8mm-cl-iot-gate-u-boot.dtsi   | 37 +--
 2 files changed, 4 insertions(+), 70 deletions(-)

diff --git a/arch/arm/dts/imx8mm-cl-iot-gate-optee-u-boot.dtsi 
b/arch/arm/dts/imx8mm-cl-iot-gate-optee-u-boot.dtsi
index 67ce70d0bdf..bc8a138e6c0 100644
--- a/arch/arm/dts/imx8mm-cl-iot-gate-optee-u-boot.dtsi
+++ b/arch/arm/dts/imx8mm-cl-iot-gate-optee-u-boot.dtsi
@@ -3,6 +3,8 @@
  * Copyright 2019 NXP
  */
 
+#include "imx8mm-u-boot.dtsi"
+
 / {
binman: binman {
multiple-images;
@@ -22,11 +24,6 @@
};
 };
 
-&{/soc@0} {
-   u-boot,dm-pre-reloc;
-   u-boot,dm-spl;
-};
-
 &{/soc@0/bus@3080/i2c@30a3/pmic@4b} {
u-boot,dm-spl;
 };
@@ -35,19 +32,6 @@
u-boot,dm-spl;
 };
 
- {
-   u-boot,dm-spl;
-   u-boot,dm-pre-reloc;
-};
-
- {
-   u-boot,dm-spl;
-};
-
- {
-   u-boot,dm-spl;
-};
-
  {
u-boot-spl-ddr {
filename = "u-boot-spl-ddr.bin";
@@ -161,14 +145,6 @@
};
 };
 
- {
-   u-boot,dm-spl;
-   u-boot,dm-pre-reloc;
-   /delete-property/ assigned-clocks;
-   /delete-property/ assigned-clock-parents;
-   /delete-property/ assigned-clock-rates;
-};
-
  {
phy-reset-gpios = < 22 GPIO_ACTIVE_LOW>;
 };
@@ -201,15 +177,6 @@
u-boot,dm-spl;
 };
 
- {
-   u-boot,dm-spl;
-};
-
-_24m {
-   u-boot,dm-spl;
-   u-boot,dm-pre-reloc;
-};
-
 _i2c2 {
u-boot,dm-spl;
 };
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 fe45a35d751..cf3cc191d5a 100644
--- a/arch/arm/dts/imx8mm-cl-iot-gate-u-boot.dtsi
+++ b/arch/arm/dts/imx8mm-cl-iot-gate-u-boot.dtsi
@@ -3,6 +3,8 @@
  * Copyright 2019 NXP
  */
 
+#include "imx8mm-u-boot.dtsi"
+
 / {
binman: binman {
multiple-images;
@@ -22,11 +24,6 @@
};
 };
 
-&{/soc@0} {
-   u-boot,dm-pre-reloc;
-   u-boot,dm-spl;
-};
-
 &{/soc@0/bus@3080/i2c@30a3/pmic@4b} {
u-boot,dm-spl;
 };
@@ -35,19 +32,6 @@
u-boot,dm-spl;
 };
 
- {
-   u-boot,dm-spl;
-   u-boot,dm-pre-reloc;
-};
-
- {
-   u-boot,dm-spl;
-};
-
- {
-   u-boot,dm-spl;
-};
-
  {
u-boot-spl-ddr {
filename = "u-boot-spl-ddr.bin";
@@ -149,14 +133,6 @@
};
 };
 
- {
-   u-boot,dm-spl;
-   u-boot,dm-pre-reloc;
-   /delete-property/ assigned-clocks;
-   /delete-property/ assigned-clock-parents;
-   /delete-property/ assigned-clock-rates;
-};
-
  {
phy-reset-gpios = < 22 GPIO_ACTIVE_LOW>;
 };
@@ -189,15 +165,6 @@
u-boot,dm-spl;
 };
 
- {
-   u-boot,dm-spl;
-};
-
-_24m {
-   u-boot,dm-spl;
-   u-boot,dm-pre-reloc;
-};
-
 _i2c2 {
u-boot,dm-spl;
 };
-- 
2.26.2



[PATCH v3 2/7] arm64: dts: imx8mm-cl-iot-gate-u-boot.dtsi: alphabetically re-order

2021-10-22 Thread Marcel Ziswiler
From: Marcel Ziswiler 

Alphabetically re-order nodes and properties.

Signed-off-by: Marcel Ziswiler 
Reviewed-by: Peng Fan 

---

(no changes since v2)

Changes in v2:
- New patch preparing cl-iot-gate.

 .../dts/imx8mm-cl-iot-gate-optee-u-boot.dtsi  | 202 +-
 arch/arm/dts/imx8mm-cl-iot-gate-u-boot.dtsi   | 202 +-
 2 files changed, 202 insertions(+), 202 deletions(-)

diff --git a/arch/arm/dts/imx8mm-cl-iot-gate-optee-u-boot.dtsi 
b/arch/arm/dts/imx8mm-cl-iot-gate-optee-u-boot.dtsi
index 12065935e49..67ce70d0bdf 100644
--- a/arch/arm/dts/imx8mm-cl-iot-gate-optee-u-boot.dtsi
+++ b/arch/arm/dts/imx8mm-cl-iot-gate-optee-u-boot.dtsi
@@ -8,18 +8,18 @@
multiple-images;
};
 
-   wdt-reboot {
-   compatible = "wdt-reboot";
-   wdt = <>;
-   u-boot,dm-spl;
-   };
-
firmware {
optee {
compatible = "linaro,optee-tz";
method = "smc";
};
};
+
+   wdt-reboot {
+   compatible = "wdt-reboot";
+   u-boot,dm-spl;
+   wdt = <>;
+   };
 };
 
 &{/soc@0} {
@@ -27,17 +27,12 @@
u-boot,dm-spl;
 };
 
- {
+&{/soc@0/bus@3080/i2c@30a3/pmic@4b} {
u-boot,dm-spl;
-   u-boot,dm-pre-reloc;
-   /delete-property/ assigned-clocks;
-   /delete-property/ assigned-clock-parents;
-   /delete-property/ assigned-clock-rates;
 };
 
-_24m {
+&{/soc@0/bus@3080/i2c@30a3/pmic@4b/regulators} {
u-boot,dm-spl;
-   u-boot,dm-pre-reloc;
 };
 
  {
@@ -53,94 +48,6 @@
u-boot,dm-spl;
 };
 
- {
-   u-boot,dm-spl;
-};
-
-_uart3 {
-   u-boot,dm-spl;
-};
-
-_usdhc2_gpio {
-   u-boot,dm-spl;
-};
-
-_usdhc2 {
-   u-boot,dm-spl;
-};
-
-_usdhc3 {
-   u-boot,dm-spl;
-};
-
- {
-   u-boot,dm-spl;
-};
-
- {
-   u-boot,dm-spl;
-};
-
- {
-   u-boot,dm-spl;
-};
-
- {
-   u-boot,dm-spl;
-};
-
- {
-   u-boot,dm-spl;
-};
-
- {
-   u-boot,dm-spl;
-};
-
- {
-   u-boot,dm-spl;
-};
-
- {
-   u-boot,dm-spl;
-};
-
- {
-   u-boot,dm-spl;
-};
-
- {
-   u-boot,dm-spl;
-};
-
- {
-   u-boot,dm-spl;
-};
-
-&{/soc@0/bus@3080/i2c@30a3/pmic@4b} {
-   u-boot,dm-spl;
-};
-
-&{/soc@0/bus@3080/i2c@30a3/pmic@4b/regulators} {
-   u-boot,dm-spl;
-};
-
-_i2c2 {
-   u-boot,dm-spl;
-};
-
-_pmic {
-   u-boot,dm-spl;
-};
-
- {
-   phy-reset-gpios = < 22 GPIO_ACTIVE_LOW>;
-};
-
- {
-   u-boot,dm-spl;
-};
-
  {
u-boot-spl-ddr {
filename = "u-boot-spl-ddr.bin";
@@ -253,3 +160,96 @@
};
};
 };
+
+ {
+   u-boot,dm-spl;
+   u-boot,dm-pre-reloc;
+   /delete-property/ assigned-clocks;
+   /delete-property/ assigned-clock-parents;
+   /delete-property/ assigned-clock-rates;
+};
+
+ {
+   phy-reset-gpios = < 22 GPIO_ACTIVE_LOW>;
+};
+
+ {
+   u-boot,dm-spl;
+};
+
+ {
+   u-boot,dm-spl;
+};
+
+ {
+   u-boot,dm-spl;
+};
+
+ {
+   u-boot,dm-spl;
+};
+
+ {
+   u-boot,dm-spl;
+};
+
+ {
+   u-boot,dm-spl;
+};
+
+ {
+   u-boot,dm-spl;
+};
+
+ {
+   u-boot,dm-spl;
+};
+
+_24m {
+   u-boot,dm-spl;
+   u-boot,dm-pre-reloc;
+};
+
+_i2c2 {
+   u-boot,dm-spl;
+};
+
+_pmic {
+   u-boot,dm-spl;
+};
+
+_uart3 {
+   u-boot,dm-spl;
+};
+
+_usdhc2 {
+   u-boot,dm-spl;
+};
+
+_usdhc2_gpio {
+   u-boot,dm-spl;
+};
+
+_usdhc3 {
+   u-boot,dm-spl;
+};
+
+ {
+   u-boot,dm-spl;
+};
+
+ {
+   u-boot,dm-spl;
+};
+
+ {
+   u-boot,dm-spl;
+};
+
+ {
+   u-boot,dm-spl;
+};
+
+ {
+   u-boot,dm-spl;
+};
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 00927c15744..fe45a35d751 100644
--- a/arch/arm/dts/imx8mm-cl-iot-gate-u-boot.dtsi
+++ b/arch/arm/dts/imx8mm-cl-iot-gate-u-boot.dtsi
@@ -8,18 +8,18 @@
multiple-images;
};
 
-   wdt-reboot {
-   compatible = "wdt-reboot";
-   wdt = <>;
-   u-boot,dm-spl;
-   };
-
firmware {
optee {
compatible = "linaro,optee-tz";
method = "smc";
};
};
+
+   wdt-reboot {
+   compatible = "wdt-reboot";
+   u-boot,dm-spl;
+   wdt = <>;
+   };
 };
 
 &{/soc@0} {
@@ -27,17 +27,12 @@
u-boot,dm-spl;
 };
 
- {
+&{/soc@0/bus@3080/i2c@30a3/pmic@4b} {
u-boot,dm-spl;
-   u-boot,dm-pre-reloc;
-   /delete-property/ assigned-clocks;
-   /delete-property/ assigned-clock-parents;
-   /delete-property/ assigned-clock-rates;
 };
 
-_24m {
+&{/soc@0/bus@3080/i2c@30a3/pmic@4b/regulators} {
u-boot,d

[PATCH v3 0/7] arm64: dts: imx8mm: use common binman configuration and further clean-up

2021-10-22 Thread Marcel Ziswiler
From: Marcel Ziswiler 


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. Move the comon part of
that configuration to the common imx8mm-u-boot.dtsi include file.

The initial patch fixes an issue with intermediate binary naming for the
imx8mm-cl-iot-gate. And subsequent patches further clean up that dtsi.

This series is based on my refresh of Adam's imx8mm_beacon switch to
binman patch [1], my refresh of Michael's sl28 patches [2] and Tim's
switching imx8mm_venice to using binman to pack images [3].

[1] https://marc.info/?l=u-boot=163493902915471
[2] https://marc.info/?l=u-boot=163494122816224
[3] https://marc.info/?l=u-boot=163355140309636

Changes in v3:
- Integrated imx8mm_beacon as well.
- Re-based on top of imx/master.

Changes in v2:
- New patch preparing cl-iot-gate.
- New patch preparing cl-iot-gate.
- Morph common binman dtsi into regular common u-boot dtsi as discussed
  on mailing list.
- Re-based.
- Rather than doing that clean-up to the separate binman dtsi now do it
  to the common u-boot dtsi one.
- Rather than doing that clean-up to the separate binman dtsi now do it
  to the common u-boot dtsi one.
- Rather than doing that clean-up to the separate binman dtsi now do it
  to the common u-boot dtsi one.

Changes in v1:
- This was suggested by Simon on my earlier patch set upon which we
  decided to first break this up into a common binman dtsi and then
  subsequently do such further improvements.

Marcel Ziswiler (7):
  imx8mm-cl-iot-gate: fix imximage intermediate binary naming
  arm64: dts: imx8mm-cl-iot-gate-u-boot.dtsi: alphabetically re-order
  arm64: dts: imx8mm-cl-iot-gate-u-boot.dtsi: use common
imx8mm-u-boot.dtsi
  arm64: dts: imx8mm: use common binman configuration
  arm64: dts: imx8mm-u-boot.dtsi: alphabetically re-order properties
  arm64: dts: imx8mm-u-boot.dtsi: explicitly add spl filename
  arm64: dts: imx8mm-u-boot.dtsi: improve odd blob-ext naming

 arch/arm/dts/imx8mm-beacon-kit-u-boot.dtsi| 122 --
 .../dts/imx8mm-cl-iot-gate-optee-u-boot.dtsi  | 209 --
 arch/arm/dts/imx8mm-cl-iot-gate-u-boot.dtsi   | 188 +++-
 arch/arm/dts/imx8mm-evk-u-boot.dtsi   | 123 ---
 arch/arm/dts/imx8mm-u-boot.dtsi   | 149 -
 arch/arm/dts/imx8mm-venice-u-boot.dtsi| 119 --
 arch/arm/dts/imx8mm-verdin-u-boot.dtsi| 122 +-
 .../imximage-8mm-lpddr4.cfg   |   2 +-
 8 files changed, 212 insertions(+), 822 deletions(-)

-- 
2.26.2



[PATCH v3 1/7] imx8mm-cl-iot-gate: fix imximage intermediate binary naming

2021-10-22 Thread Marcel Ziswiler
From: Marcel Ziswiler 

This fixes the following build time issue:

...
  BINMAN  all
binman: Error 1 running 'mkimage -d ./mkimage.spl.mkimage -n
 spl/u-boot-spl.cfgout -T imx8mimage -e 0x7e1000
 ./mkimage-out.spl.mkimage': mkimage.flash.mkimage: Can't open: No such
 file or directory

make: *** [Makefile:1094: all] Error 1

Signed-off-by: Marcel Ziswiler 
Reviewed-by: Peng Fan 
---

(no changes since v1)

 board/compulab/imx8mm-cl-iot-gate/imximage-8mm-lpddr4.cfg | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/board/compulab/imx8mm-cl-iot-gate/imximage-8mm-lpddr4.cfg 
b/board/compulab/imx8mm-cl-iot-gate/imximage-8mm-lpddr4.cfg
index b89092a5590..4071219fbf4 100644
--- a/board/compulab/imx8mm-cl-iot-gate/imximage-8mm-lpddr4.cfg
+++ b/board/compulab/imx8mm-cl-iot-gate/imximage-8mm-lpddr4.cfg
@@ -6,4 +6,4 @@
 #define __ASSEMBLY__
 
 BOOT_FROM  sd
-LOADER mkimage.flash.mkimage   0x7E1000
+LOADER u-boot-spl-ddr.bin  0x7e1000
-- 
2.26.2



Re: [PATCH v4 0/5] board: sl28: target refresh

2021-10-22 Thread Marcel Ziswiler
Hi Michael

Sorry, I did not want to upset anybody. I probably should have asked first 
before doing this.

On Sat, 2021-10-23 at 00:52 +0200, Michael Walle wrote:
> Hi Marcel,
> 
> Am 2021-10-23 00:19, schrieb Marcel Ziswiler:
> > From: Marcel Ziswiler 
> > 
> > 
> > Note that this re-base is only compile tested.
> 
> Care to explain what this is? Why are you taking my patchset
> and make a new version of it and rebasing it on the wrong
> tree?

You might have noticed that Stefano has a hard time applying some patch sets 
due to continuing conflicts.
Therefore in trying to further the binman clean-up [1] were I am just about to 
post a new version as well, I
took the liberty to re-fresh all the patches my series bases on which have not 
seen any care for more than a
month. I re-based them on top of Stefano's u-boot-imx/master branch which I am 
very certain is exactly the tree
stuff needs to be re-based to, not?

> Did I miss something?

Not sure. If you still feel my work is of no help to the community I am more 
than happy to abandon any of it.

[1] https://marc.info/?l=u-boot=163372696806292

> -michael

Cheers

Marcel


[PATCH v4 1/5] board: sl28: enable EFI_SET_TIME support

2021-10-22 Thread Marcel Ziswiler
From: Michael Walle 

Allow EFI to actually set the time before ExitBootServices().

Signed-off-by: Michael Walle 
Signed-off-by: Marcel Ziswiler 

---

Changes in v4:
- Re-based on top of imx/master.

Changes in v3:
- none

Changes in v2:
- none

 configs/kontron_sl28_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configs/kontron_sl28_defconfig b/configs/kontron_sl28_defconfig
index 4e25dafaaff..e066fe87771 100644
--- a/configs/kontron_sl28_defconfig
+++ b/configs/kontron_sl28_defconfig
@@ -94,3 +94,4 @@ CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_OF_LIBFDT_ASSUME_MASK=0x0
 CONFIG_OF_LIBFDT_OVERLAY=y
+CONFIG_EFI_SET_TIME=y
-- 
2.26.2



[PATCH v4 0/5] board: sl28: target refresh

2021-10-22 Thread Marcel Ziswiler
From: Marcel Ziswiler 


Note that this re-base is only compile tested.

Changes in v4:
- Re-based on top of imx/master.

Changes in v3:
- none
 - use CONFIG_EFI_CAPSULE_FIRMWARE_FIT instead of
   CONFIG_EFI_CAPSULE_FIRMWARE_RAW

Changes in v2:
- none
- new patch

Frieder Schrempf (1):
  doc: board: kontron: sl28: Reduce section levels and change title

Michael Walle (4):
  board: sl28: enable EFI_SET_TIME support
  board: sl28: generate FIT update image
  board: sl28: enable EFI UpdateCapsule support
  board: sl28: add update image documentation

 .../dts/fsl-ls1028a-kontron-sl28-u-boot.dtsi  | 35 ++-
 configs/kontron_sl28_defconfig|  7 +++
 doc/board/kontron/sl28.rst| 45 ---
 include/configs/kontron_sl28.h|  2 +
 4 files changed, 72 insertions(+), 17 deletions(-)

-- 
2.26.2



[PATCH v4 3/5] board: sl28: enable EFI UpdateCapsule support

2021-10-22 Thread Marcel Ziswiler
From: Michael Walle 

Enable support for update over EFI UpdateCapsule mechanism. This board
doesn't support setting EFI variables after ExitBootservices().
Therefore, we are also enabling EFI_IGNORE_OSINDICATIONS.

Signed-off-by: Michael Walle 
Signed-off-by: Marcel Ziswiler 

---

Changes in v4:
- Re-based on top of imx/master.

Changes in v3:
 - use CONFIG_EFI_CAPSULE_FIRMWARE_FIT instead of
   CONFIG_EFI_CAPSULE_FIRMWARE_RAW

Changes in v2:
- new patch

 configs/kontron_sl28_defconfig | 6 ++
 include/configs/kontron_sl28.h | 2 ++
 2 files changed, 8 insertions(+)

diff --git a/configs/kontron_sl28_defconfig b/configs/kontron_sl28_defconfig
index e066fe87771..accd1b04006 100644
--- a/configs/kontron_sl28_defconfig
+++ b/configs/kontron_sl28_defconfig
@@ -64,6 +64,8 @@ CONFIG_FSL_CAAM=y
 CONFIG_SYS_FSL_DDR3=y
 CONFIG_DDR_ECC=y
 CONFIG_ECC_INIT_VIA_DDRCONTROLLER=y
+CONFIG_DFU_MMC=y
+CONFIG_DFU_SF=y
 CONFIG_I2C_SET_DEFAULT_BUS_NUM=y
 CONFIG_I2C_MUX=y
 CONFIG_MMC_HS400_SUPPORT=y
@@ -95,3 +97,7 @@ CONFIG_USB_XHCI_DWC3=y
 CONFIG_OF_LIBFDT_ASSUME_MASK=0x0
 CONFIG_OF_LIBFDT_OVERLAY=y
 CONFIG_EFI_SET_TIME=y
+CONFIG_EFI_RUNTIME_UPDATE_CAPSULE=y
+CONFIG_EFI_CAPSULE_ON_DISK=y
+CONFIG_EFI_IGNORE_OSINDICATIONS=y
+CONFIG_EFI_CAPSULE_FIRMWARE_FIT=y
diff --git a/include/configs/kontron_sl28.h b/include/configs/kontron_sl28.h
index 6769592101d..4152851ba41 100644
--- a/include/configs/kontron_sl28.h
+++ b/include/configs/kontron_sl28.h
@@ -88,6 +88,8 @@
"envload=env import -d -b ${env_addr}\0" \
"install_rcw=source 2020\0" \
"fdtfile=freescale/fsl-ls1028a-kontron-sl28.dtb\0" \
+   "dfu_alt_info=sf 0:0=u-boot-bin raw 0x21 0x1d;" \
+   "u-boot-env raw 0x3e 0x2\0" \
ENV_MEM_LAYOUT_SETTINGS \
BOOTENV
 
-- 
2.26.2



[PATCH v4 4/5] doc: board: kontron: sl28: Reduce section levels and change title

2021-10-22 Thread Marcel Ziswiler
From: Frieder Schrempf 

In order to add other Kontron boards to the docs alongside the existing
sl28 board, we need to reduce the levels of the sections and change the
title.

Cc: Fabio Estevam 
Signed-off-by: Frieder Schrempf 
Acked-by: Michael Walle 
Signed-off-by: Marcel Ziswiler 

---
>From v3 of Michael:
Frieder, Fabio, I took the liberty and added this patch to this series,
because the next patch depends on it. It wasn't picked up yet in the imx
queue. In fact, Frieders patches should not depend on this one, although
the documentation will be incorrectly formatted, so it should be fine if
this patch will go through the qoriq queue.

Changes in v4:
- Re-based on top of imx/master.

Changes in v3:
- none

Changes in v2:
- new patch

 doc/board/kontron/sl28.rst | 30 +++---
 1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/doc/board/kontron/sl28.rst b/doc/board/kontron/sl28.rst
index e458fbc607c..07431986d8f 100644
--- a/doc/board/kontron/sl28.rst
+++ b/doc/board/kontron/sl28.rst
@@ -1,17 +1,17 @@
 .. SPDX-License-Identifier: GPL-2.0+
 
-Summary
-===
+Kontron SMARC-sAL28
+===
 
 The Kontron SMARC-sAL28 board is a TSN-enabled dual-core ARM A72
 processor module with an on-chip 6-port TSN switch and a 3D GPU.
 
 
 Quickstart
-==
+--
 
 Compile U-Boot
---
+^^
 
 Configure and compile the binary::
 
@@ -21,7 +21,7 @@ Configure and compile the binary::
 Copy u-boot.rom to a TFTP server.
 
 Install the bootloader on the board

+^^^
 
 Please note, this bootloader doesn't support the builtin watchdog (yet),
 therefore you have to disable it, see below. Otherwise you'll end up in
@@ -36,7 +36,7 @@ disabled the builtin watchdog you might have to manually 
enter failsafe
 mode by asserting the ``FORCE_RECOV#`` line during board reset.
 
 Disable the builtin watchdog
-
+
 
 - boot into the failsafe bootloader, either by asserting the
   ``FORCE_RECOV#`` line or if you still have the original bootloader
@@ -53,7 +53,7 @@ Disable the builtin watchdog
 
 
 Useful I2C tricks
-=
+-
 
 The board has a board management controller which is not supported in
 u-boot (yet). But you can use the i2c command to access it.
@@ -68,7 +68,7 @@ u-boot (yet). But you can use the i2c command to access it.
 
 
 Non-volatile Board Configuration Bits
-=
+-
 
 The board has 16 configuration bits which are stored in the CPLD and are
 non-volatile. These can be changed by the `sl28 nvm` command.
@@ -98,21 +98,21 @@ Please note, that if the board is in failsafe mode, the 
bits will have the
 factory defaults, ie. all bits are off.
 
 Power-On Inhibit
-
+
 
 If this is set, the board doesn't automatically turn on when power is
 applied. Instead, the user has to either toggle the ``PWR_BTN#`` line or
 use any other wake-up source such as RTC alarm or Wake-on-LAN.
 
 eMMC Boot
--
+^
 
 If this is set, the RCW will be fetched from the on-board eMMC at offset
 1MiB. For further details, have a look at the `Reset Configuration Word
 Documentation`_.
 
 Watchdog
-
+
 
 By default, the CPLD watchdog is enabled in failsafe mode. Using bits 2 and
 3, the user can change its mode or disable it altogether.
@@ -127,21 +127,21 @@ Bit 2  Bit 3  Description
 =  =  ===
 
 Clock Generator Select
---
+^^
 
 The board is prepared to supply different SerDes clock speeds. But for now,
 only setting 0 is supported, otherwise the CPU will hang because the PLL
 will not lock.
 
 Clock Output Disable And Keep Devices In Reset
---
+^^
 
 To safe power, the user might disable different devices and clock output of
 the board. It is not supported to disable the "CPU SerDes clock #2" for
 now, otherwise the CPU will hang because the PLL will not lock.
 
 Automatic reset of the onboard PHYs

+^^^
 
 By default, there is no hardware reset of the onboard PHY. This is because
 for Wake-on-LAN, some registers have to retain their values. If you don't
@@ -151,7 +151,7 @@ power-on reset.
 
 
 Further documentation
-=
+-
 
 - `Vendor Documentation`_
 - `Reset Configuration Word Documentation`_
-- 
2.26.2



[PATCH v4 5/5] board: sl28: add update image documentation

2021-10-22 Thread Marcel Ziswiler
From: Michael Walle 

Document the update image and how to use the EFI UpdateCapsule.

Signed-off-by: Michael Walle 
Signed-off-by: Marcel Ziswiler 

---

Changes in v4:
- Re-based on top of imx/master.

Changes in v3:
- none

Changes in v2:
- new patch

 doc/board/kontron/sl28.rst | 15 +++
 1 file changed, 15 insertions(+)

diff --git a/doc/board/kontron/sl28.rst b/doc/board/kontron/sl28.rst
index 07431986d8f..c7b18bed10c 100644
--- a/doc/board/kontron/sl28.rst
+++ b/doc/board/kontron/sl28.rst
@@ -52,6 +52,21 @@ Disable the builtin watchdog
 - power-cycle the board
 
 
+Update image
+
+
+After the build finished, there will be an update image called
+u-boot.update. This can either be used in the DFU mode (which isn't
+supported yet) or encapsulated in an EFI UpdateCapsule.
+
+To build the capsule use the following command
+
+ $ tools/mkeficapsule -f u-boot.update -i 1 UpdateUboot
+
+Afterward you can copy this file to your ESP into the /EFI/UpdateCapsule/
+folder. On the next EFI boot this will automatically update your
+bootloader.
+
 Useful I2C tricks
 -
 
-- 
2.26.2



[PATCH v4 2/5] board: sl28: generate FIT update image

2021-10-22 Thread Marcel Ziswiler
From: Michael Walle 

Generate a FIT update image during build. The image will be called
"u-boot.update" and can be used to build an EFI UpdateCapsule or during
DFU mode. Although, the latter isn't supported because there is no USB
OTG driver yet.

Signed-off-by: Michael Walle 
Signed-off-by: Marcel Ziswiler 

---

Changes in v4:
- Re-based on top of imx/master.

Changes in v3:
- none

Changes in v2:
- new patch

 .../dts/fsl-ls1028a-kontron-sl28-u-boot.dtsi  | 35 +--
 1 file changed, 33 insertions(+), 2 deletions(-)

diff --git a/arch/arm/dts/fsl-ls1028a-kontron-sl28-u-boot.dtsi 
b/arch/arm/dts/fsl-ls1028a-kontron-sl28-u-boot.dtsi
index b3861ed98cf..a501cece698 100644
--- a/arch/arm/dts/fsl-ls1028a-kontron-sl28-u-boot.dtsi
+++ b/arch/arm/dts/fsl-ls1028a-kontron-sl28-u-boot.dtsi
@@ -15,6 +15,12 @@
};
 
binman: binman {
+   multiple-images;
+   };
+};
+
+ {
+   u_boot_rom: u-boot-rom {
filename = "u-boot.rom";
pad-byte = <0xff>;
 
@@ -133,6 +139,31 @@
};
 };
 
+ {
+   u-boot-update {
+   filename = "u-boot.update";
+
+   fit {
+   description = "FIT update image";
+
+   images {
+   u-boot-bin {
+   description = "U-Boot";
+   type = "firmware";
+   os = "u-boot";
+   arch = "arm";
+   compression = "none";
+   load = <0>; /* unused */
+
+   blob {
+   filename = "u-boot.rom";
+   };
+   };
+   };
+   };
+   };
+};
+
 #ifdef CONFIG_SL28_ENABLE_SER0_CONSOLE
 / {
chosen {
@@ -142,7 +173,7 @@
 #endif
 
 #ifdef CONFIG_SL28_SPL_LOADS_ATF_BL31
- {
+_boot_rom {
fit {
images {
bl31 {
@@ -191,7 +222,7 @@
 #endif
 
 #ifdef CONFIG_SL28_SPL_LOADS_OPTEE_BL32
- {
+_boot_rom {
fit {
images {
bl32 {
-- 
2.26.2



[PATCH v2] imx8mm_beacon: Switch to binman for generating image

2021-10-22 Thread Marcel Ziswiler
From: Adam Ford 

To eliminate a warning when using custom imx tools for generating
a binary, use binman to generate flash.bin.

Signed-off-by: Adam Ford 
Signed-off-by: Marcel Ziswiler 

---
Note that this re-base is only compile tested.

Changes in v2:
- Re-based on top of imx/master.

 arch/arm/dts/imx8mm-beacon-kit-u-boot.dtsi  | 122 
 arch/arm/mach-imx/imx8m/Kconfig |   1 +
 board/beacon/imx8mm/Kconfig |   2 +-
 board/beacon/imx8mm/README  |   6 +-
 board/beacon/imx8mm/imximage-8mm-lpddr4.cfg |   9 ++
 configs/imx8mm_beacon_defconfig |   2 +-
 6 files changed, 137 insertions(+), 5 deletions(-)
 create mode 100644 board/beacon/imx8mm/imximage-8mm-lpddr4.cfg

diff --git a/arch/arm/dts/imx8mm-beacon-kit-u-boot.dtsi 
b/arch/arm/dts/imx8mm-beacon-kit-u-boot.dtsi
index 73ddfdade6a..3c034a85e35 100644
--- a/arch/arm/dts/imx8mm-beacon-kit-u-boot.dtsi
+++ b/arch/arm/dts/imx8mm-beacon-kit-u-boot.dtsi
@@ -6,6 +6,10 @@
 #include "imx8mm-u-boot.dtsi"
 
 / {
+   binman: binman {
+   multiple-images;
+   };
+
wdt-reboot {
compatible = "wdt-reboot";
wdt = <>;
@@ -100,3 +104,121 @@
  {
u-boot,dm-spl;
 };
+
+ {
+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 = ;
+
+   images {
+   uboot {
+   description = "U-Boot (64-bit)";
+   type = "standalone";
+   arch = "arm64";
+   compression = "none";
+   load = ;
+
+   uboot_blob: blob-ext {
+   filename = "u-boot-nodtb.bin";
+   };
+   };
+
+   atf {
+   description = "ARM Trusted Firmware";
+   type = "firmware";
+   arch = "arm64";
+   compression = "none";
+   load = <0x92>;
+   entry = <0x92>;
+
+   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 {
+   de

[PATCH v2] board: toradex: add verdin imx8m plus support

2021-10-22 Thread Marcel Ziswiler
From: Marcel Ziswiler 

This adds initial support for the Toradex Verdin iMX8M Plus Quad 4GB WB
IT V1.0B module. They are strapped to boot from eFuses which are factory
fused to properly boot from their on-module eMMC. U-Boot supports
booting from the on-module eMMC only, SDP support is disabled for now
due to missing i.MX 8M Plus USB support.

Functionality wise the following is known to be working:
- eMMC, 8-bit and 4-bit MMC/SD card slots
- Ethernet both on-module eQoS and FEC (requires PHY on carrier board)
- GPIOs
- I2C

Boot sequence is:
SPL ---> ATF (TF-A) ---> U-boot proper

ATF, U-boot proper and u-boot.dtb images are packed into a FIT image,
loaded by SPL.

Boot:
U-Boot SPL 2021.10-00289-g971442e784b (Oct 22 2021 - 09:13:32 +0200)
Quad die, dual rank failed, attempting dual die, single rank configuration.
Normal Boot
WDT:   Started watchdog@3028 with servicing (60s timeout)
Trying to boot from BOOTROM
Find img info 0x&48025c00, size 872
Download 776704, Total size 777520
NOTICE:  BL31: v2.2(release):rel_imx_5.4.70_2.3.2_rc1-5-g835a8f67b
NOTICE:  BL31: Built : 16:52:37, Aug 26 2021

U-Boot 2021.10-00289-g971442e784b (Oct 22 2021 - 09:13:32 +0200)

CPU:   Freescale i.MX8MP[8] rev1.1 at 1200 MHz
Reset cause: POR
DRAM:  8 GiB
WDT:   Started watchdog@3028 with servicing (60s timeout)
MMC:   FSL_SDHC: 1, FSL_SDHC: 2
Loading Environment from MMC... OK
In:serial
Out:   serial
Err:   serial
Model: Toradex Verdin iMX8M Plus Quad 4GB Wi-Fi / BT IT V1.0B, Serial# 06817281
Carrier: Toradex Verdin Development Board V1.1A, Serial# 10754333
Setting variant to wifi
Net:   Hard-coding pdata->enetaddr
eth1: ethernet@30be, eth0: ethernet@30bf [PRIME]
Hit any key to stop autoboot:  0
Verdin iMX8MP #

Signed-off-by: Marcel Ziswiler 

---
Known issues:
- MAC address: While the FEC driver allows using it from the environment
  rather than the SoC fuses the DWC EQoS iMX driver currently hard-codes
  this to only be read from fuses. I am still working on a patch that
  would allow the MAC address to be retrieved from the environment
  similar to how the FEC driver does.
- RAM size: Right now it is hard-coded to 8 GB. I am still working on a
  patch which allows our automatic RAM sizing approach with mainline.
- ETH PHY regulator: For now we just use a GPIO hog as in downstream.
  Doing this properly requires more work on the whole Ethernet stack
  within U-Boot but seems rather not that urgent.

Changes in v2:
- Separate commit notes from commit message.
- Fix mmc instance being 2 rather than 0 in the doc.
- Add the doc to the index.
- Document known issues in the commit notes.
- Re-based on top of imx/master which now already includes all
  dependencies making those commit notes superfluous.

 arch/arm/dts/Makefile   |1 +
 arch/arm/dts/imx8mp-verdin-u-boot.dtsi  |  132 ++
 arch/arm/dts/imx8mp-verdin.dts  |  639 ++
 arch/arm/mach-imx/imx8m/Kconfig |8 +
 board/toradex/verdin-imx8mp/Kconfig |   42 +
 board/toradex/verdin-imx8mp/MAINTAINERS |   10 +
 board/toradex/verdin-imx8mp/Makefile|   11 +
 board/toradex/verdin-imx8mp/imximage.cfg|   10 +
 board/toradex/verdin-imx8mp/lpddr4_timing.c | 2168 +++
 board/toradex/verdin-imx8mp/spl.c   |  158 ++
 board/toradex/verdin-imx8mp/verdin-imx8mp.c |  158 ++
 configs/verdin-imx8mp_defconfig |  131 ++
 doc/board/toradex/index.rst |1 +
 doc/board/toradex/verdin-imx8mp.rst |  109 +
 include/configs/verdin-imx8mp.h |  136 ++
 15 files changed, 3714 insertions(+)
 create mode 100644 arch/arm/dts/imx8mp-verdin-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx8mp-verdin.dts
 create mode 100644 board/toradex/verdin-imx8mp/Kconfig
 create mode 100644 board/toradex/verdin-imx8mp/MAINTAINERS
 create mode 100644 board/toradex/verdin-imx8mp/Makefile
 create mode 100644 board/toradex/verdin-imx8mp/imximage.cfg
 create mode 100644 board/toradex/verdin-imx8mp/lpddr4_timing.c
 create mode 100644 board/toradex/verdin-imx8mp/spl.c
 create mode 100644 board/toradex/verdin-imx8mp/verdin-imx8mp.c
 create mode 100644 configs/verdin-imx8mp_defconfig
 create mode 100644 doc/board/toradex/verdin-imx8mp.rst
 create mode 100644 include/configs/verdin-imx8mp.h

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index a88aecc5bd9..35198847efd 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -899,6 +899,7 @@ dtb-$(CONFIG_ARCH_IMX8M) += \
imx8mq-phanbell.dtb \
imx8mp-evk.dtb \
imx8mp-phyboard-pollux-rdk.dtb \
+   imx8mp-verdin.dtb \
imx8mq-pico-pi.dtb
 
 dtb-$(CONFIG_ARCH_IMXRT) += imxrt1050-evk.dtb \
diff --git a/arch/arm/dts/imx8mp-verdin-u-boot.dtsi 
b/arch/arm/dts/imx8mp-verdin-u-boot.dtsi
new file mode 100644
index 000..fb25b4a7ce4
--- /dev/null
+++ b/arch/arm/dts/imx8mp-verdin-u-boot.dtsi
@@ -0,0 +1,132 @@
+// SPDX-License-Identifier: GP

Re: i.MX LPDDR4 Firmware

2021-10-20 Thread Marcel Ziswiler
On Tue, 2021-10-19 at 15:04 +0200, Heiko Thiery wrote:
>  Hi Marcel,
> 
> Am Di., 19. Okt. 2021 um 11:47 Uhr schrieb Marcel Ziswiler
> :
> > 
> > Hi Heiko
> > 
> > On Mon, 2021-10-18 at 11:23 +0200, Heiko Thiery wrote:
> > > Hi all,
> > > 
> > > I see that in the NXP firmware-imx package different versions of the
> > > LPDDR4 train firmware is included but I cannot find a Release Note or
> > > something else that describes the differences. Does anyone know what
> > > is the correct version to be used?
> > 
> > Doesn't it depend on which generation of MScale one is using?
> > 
> > Anyway, from NXP's user guide [1]:
> > 
> > For i.MX 8M Quad and i.MX 8M Mini LPDDR4 EVK, copy 
> > lpddr4_pmu_train_1d_dmem.bin,
> > lpddr4_pmu_train_1d_imem.bin, lpddr4_pmu_train_2d_dmem.bin, and 
> > lpddr4_pmu_train_2d_imem.bin from
> > firmware/ddr/synopsys of firmware-imx package to imx-mkimage/iMX8M/.
> > 
> > For i.MX 8M Mini DDR4 EVK, copy ddr4_imem_1d.bin, ddr4_dmem_1d.bin, 
> > ddr4_imem_2d.bin, and ddr4_dmem_2d.bin
> > from firmware/ddr/synopsys of firmware-imx package to imx-mkimage/iMX8M.
> > 
> > For i.MX 8M Plus LPDDR4 EVK, copy lpddr4_pmu_train_1d_dmem_201904.bin, 
> > lpddr4_pmu_train_1d_imem_201904.bin,
> > lpddr4_pmu_train_2d_dmem_201904.bin, and 
> > lpddr4_pmu_train_2d_imem_201904.bin from firmware/ddr/synopsys of
> > firmware-imx package to imx-mkimage/iMX8M/.
> 
> Ok, I didn't even notice that and I just wanted to make sure I was
> using the right ones here. Maybe someone can tell us the use case for
> the "*_202006.bin" files.

Okay, I guess NXP uses it for their proprietary imx-mkimage stuff for the i.MX 
8M Plus:

https://source.codeaurora.org/external/imx/imx-mkimage/tree/iMX8M/soc.mak?h=imx_5.4.70_2.3.0#n64

But, as mentioned above, I could not find any official documentation not to 
mention release notes about any of
this anywhere.

@NXP: Anybody mind telling us more about this?

> > So their latest documentation does not even mention the later firmware 
> > available!
> > 
> > > Here is the content of the latest NXP release:
> > > lpddr4_pmu_train_1d_dmem_201904.bin
> > > lpddr4_pmu_train_1d_dmem_202006.bin
> > > lpddr4_pmu_train_1d_dmem.bin
> > > lpddr4_pmu_train_1d_imem_201904.bin
> > > lpddr4_pmu_train_1d_imem_202006.bin
> > > lpddr4_pmu_train_1d_imem.bin
> > > lpddr4_pmu_train_2d_dmem_201904.bin
> > > lpddr4_pmu_train_2d_dmem_202006.bin
> > > lpddr4_pmu_train_2d_dmem.bin
> > > lpddr4_pmu_train_2d_imem_201904.bin
> > > lpddr4_pmu_train_2d_imem_202006.bin
> > > lpddr4_pmu_train_2d_imem.bin
> > 
> > [1] https://www.nxp.com/docs/en/user-guide/IMX_LINUX_USERS_GUIDE.pdf
> > 
> > > Thanks
> > 
> > Cheers
> 
> Thanks,
> 
> Heiko


Re: i.MX LPDDR4 Firmware

2021-10-19 Thread Marcel Ziswiler
Hi Heiko

On Mon, 2021-10-18 at 11:23 +0200, Heiko Thiery wrote:
> Hi all,
> 
> I see that in the NXP firmware-imx package different versions of the
> LPDDR4 train firmware is included but I cannot find a Release Note or
> something else that describes the differences. Does anyone know what
> is the correct version to be used?

Doesn't it depend on which generation of MScale one is using?

Anyway, from NXP's user guide [1]:

For i.MX 8M Quad and i.MX 8M Mini LPDDR4 EVK, copy lpddr4_pmu_train_1d_dmem.bin,
lpddr4_pmu_train_1d_imem.bin, lpddr4_pmu_train_2d_dmem.bin, and 
lpddr4_pmu_train_2d_imem.bin from
firmware/ddr/synopsys of firmware-imx package to imx-mkimage/iMX8M/.

For i.MX 8M Mini DDR4 EVK, copy ddr4_imem_1d.bin, ddr4_dmem_1d.bin, 
ddr4_imem_2d.bin, and ddr4_dmem_2d.bin
from firmware/ddr/synopsys of firmware-imx package to imx-mkimage/iMX8M.

For i.MX 8M Plus LPDDR4 EVK, copy lpddr4_pmu_train_1d_dmem_201904.bin, 
lpddr4_pmu_train_1d_imem_201904.bin,
lpddr4_pmu_train_2d_dmem_201904.bin, and lpddr4_pmu_train_2d_imem_201904.bin 
from firmware/ddr/synopsys of
firmware-imx package to imx-mkimage/iMX8M/.

So their latest documentation does not even mention the later firmware 
available!

> Here is the content of the latest NXP release:
> lpddr4_pmu_train_1d_dmem_201904.bin
> lpddr4_pmu_train_1d_dmem_202006.bin
> lpddr4_pmu_train_1d_dmem.bin
> lpddr4_pmu_train_1d_imem_201904.bin
> lpddr4_pmu_train_1d_imem_202006.bin
> lpddr4_pmu_train_1d_imem.bin
> lpddr4_pmu_train_2d_dmem_201904.bin
> lpddr4_pmu_train_2d_dmem_202006.bin
> lpddr4_pmu_train_2d_dmem.bin
> lpddr4_pmu_train_2d_imem_201904.bin
> lpddr4_pmu_train_2d_imem_202006.bin
> lpddr4_pmu_train_2d_imem.bin

[1] https://www.nxp.com/docs/en/user-guide/IMX_LINUX_USERS_GUIDE.pdf

> Thanks

Cheers

Marcel


Re: [PATCH v6 00/11] board: toradex: verdin-imx8mm: target refresh

2021-10-12 Thread Marcel Ziswiler
Hi Tim

On Tue, 2021-10-12 at 12:46 -0700, Tim Harvey wrote:
> On Sat, Oct 9, 2021 at 1:43 PM Marcel Ziswiler  wrote:
> > 
> > From: Marcel Ziswiler 
> > 
> > 
> > An assortment of fixes and improvements like an Ethernet PHY
> > configuration fix, DEK blob encapsulation preparation, migration to
> > using binman to pack images, SLEEP_MOCI# enablement, dropping of V1.0
> > hardware support [1], renaming kernel image variable, using preboot
> > for fdtfile evaluation and watchdog pinctrl fix.
> > 
> > Note that this series is applied on top of Peng's Makefile fix [2] as
> > otherwise, it may not quite generate all binman artefacts in the right
> > order as discussed here [3].
> > 
> > [1] https://developer.toradex.com/verdin-sample-phase-over
> > [2] https://marc.info/?l=u-boot=162908373904742
> > [3] https://marc.info/?l=u-boot=162945614207220
> > 
> > Changes in v6:
> > - New patch re-ordering fdt nodes and properties.
> > - Update commit message as requested by Wolfgang.
> > 
> > Changes in v5:
> > - Drop device tree part already done by Marek's patch.
> > - Add another fixes tag as his patch forgot the board code part.
> > - Re-based on top of u-boot-imx, master yet again.
> > 
> > Changes in v4:
> > - Add Heiko Schocher's reviewed-by tag.
> > - Fix copyright periods.
> > - Re-based.
> > 
> > Changes in v3:
> > - Case fold hex string.
> > - Revert binman part of imx8mm-verdin-u-boot.dtsi to a plain copy from
> >   imx8mm-evk and postpone further improvements to after migrating to a
> >   common binman config as agreed with Frieder and Simon.
> > - New patch cleaning up include order.
> > - Add Fabio's reviewed-by tag.
> > - Fix patch.
> > - Add missing apalis-imx8 part.
> > - While at it update copyright year resp. period.
> > - Fix closing endif comment.
> > 
> > Changes in v2:
> > - Explicitly pass filename to binman when generating binaries as
> >   suggested by Heiko.
> > - Use proper intermediate binary u-boot-spl-ddr.bin for imximage as
> >   pointed out by Heiko.
> > - Drop first patch ("imx: mkimage_fit_atf: fix legacy image generation")
> >   as a similar fix was already refused earlier.
> > - New patch allows booting recent embedded Linux BSPs.
> > - New patch addressing dynamic fdtfile definition.
> > - New patch fixing watchdog pinctrl issue.
> > 
> > Igor Opaniuk (1):
> >   verdin-imx8mm: use preboot for fdtfile evaluation
> > 
> > Marcel Ziswiler (7):
> >   imx8m: clean-up kconfig indentation
> >   verdin-imx8mm: fix ethernet
> >   ARM: dts: imx8mm-verdin: prepare for dek blob encapsulation
> >   arm64: dts: imx8mm-verdin-u-boot.dtsi: alphabetically re-order
> >   verdin-imx8mm: switch to use binman to pack images
> >   verdin-imx8mm: clean-up include order
> >   verdin-imx8mm: fix watchdog pinctrl issue
> > 
> > Max Krummenacher (2):
> >   verdin-imx8mm: enable sleep_moci output
> >   verdin-imx8mm: drop support for v1.0 hardware
> > 
> > Oleksandr Suvorov (1):
> >   include/configs: apalis-imx8/verdin-imx8mm: rename kernel image
> >     variable
> > 
> >  arch/arm/dts/imx8mm-verdin-u-boot.dtsi  | 147 +++-
> >  arch/arm/dts/imx8mm-verdin.dts  |  18 +++
> >  arch/arm/mach-imx/imx8m/Kconfig     |  21 +--
> >  board/toradex/verdin-imx8mm/imximage.cfg    |  11 +-
> >  board/toradex/verdin-imx8mm/verdin-imx8mm.c |  81 +--
> >  configs/verdin-imx8mm_defconfig |   6 +-
> >  doc/board/toradex/verdin-imx8mm.rst |  53 ---
> >  include/configs/apalis-imx8.h   |   6 +-
> >  include/configs/verdin-imx8mm.h |  10 +-
> >  9 files changed, 220 insertions(+), 133 deletions(-)
> > 
> > --
> > 2.26.2
> > 
> 
> Marcel,
> 
> I've tested your series with mx8mm-venice and did not see any issues.

Note that I have currently several patch series in-flight. I assume you meant 
this to go here [1] instead, not?

> Tested-by: Tim Harvey  for imx8mm-venice-* boards
> 
> Thanks, the common u-boot.dtsi is nice to see!

Thanks!

> I have a couple of patches that have not been picked up by Stefano yet
> due to I believe merge conflicts becuase his imx tree is behind master
> with respect to some of the Kconfig patches. You are likely in the
> same boat.

Yeah, however, with his pulls from Thursday evening imx/master is now based on 
commit ea67f467a43 ("Merge
branch '2021-10-06-assorted-improvements'") which is very close to todays 
origin/master. So I don't think there
should be any more conflicts if your stuff is re-based either on top of 
imx/master or origin/master.

> Stefano, is it best for me to rebase my 'imx8mm_venice: switch to use
> binman to pack images' and 'board: gateworks: venice: add
> imx8mn-gw7902 support' patches on your tree or are you going to be
> merging in origin/master soon?
> 
> Best regards,
> 
> Tim

[1] https://marc.info/?l=u-boot=163372696806292

Cheers

Marcel


Re: IMX8M OP-TEE

2021-10-12 Thread Marcel Ziswiler
Hi Tim

On Mon, 2021-10-11 at 16:32 -0700, Tim Harvey wrote:
> 
> ...
> Marcel,
> 
> Thanks for checking into OP-TEE for me.

Sure thing. I meanwhile got reminded that Sergio Prado actually held a talk 
about this topic back at the
Embedded World [1]. Not sure whether he played with mainline U-Boot and OP-TEE 
though.

> I haven't tested your series yet as I tried to apply it and it failed.

It should actually be based on latest imx/master but depends on a few other 
series as indicated in the cover
letter.

> Do you have a git repo I can cherry-pick from or what did you base it
> on top of?

For your convenience I just pushed my branch to my personal github now as well 
[2].

> Thanks,

Thanks you!

> Tim

[1] https://www.youtube.com/watch?v=sBVzSQ5uvUw
[2] https://github.com/ziswiler/u-boot/tree/20211008-imx-master_common_binman_v2

Cheers

Marcel


[PATCH v1] board: toradex: add verdin imx8m plus support

2021-10-12 Thread Marcel Ziswiler
From: Marcel Ziswiler 

This adds initial support for the Toradex Verdin iMX8M Plus Quad 4GB WB
IT V1.0B module. They are strapped to boot from eFuses which are factory
fused to properly boot from their on-module eMMC. U-Boot supports
booting from the on-module eMMC only, SDP support is disabled for now
due to missing i.MX 8M Plus USB support.

Functionality wise the following is known to be working:
- eMMC, 8-bit and 4-bit MMC/SD card slots
- Ethernet both on-module eQoS and FEC (requires PHY on carrier board)
- GPIOs
- I2C

Boot sequence is:
SPL ---> ATF (TF-A) ---> U-boot proper

ATF, U-boot proper and u-boot.dtb images are packed into a FIT image,
loaded by SPL.

Boot:
U-Boot SPL 2021.10-00355-gb975dd54f37 (Oct 12 2021 - 18:32:08 +0200)
Quad die, dual rank failed, attempting dual die, single rank configuration.
Normal Boot
WDT:   Started watchdog@3028 with servicing (60s timeout)
Trying to boot from BOOTROM
Find img info 0x&48025c00, size 872
Download 776704, Total size 777464
NOTICE:  BL31: v2.2(release):rel_imx_5.4.70_2.3.2_rc1-5-g835a8f67b
NOTICE:  BL31: Built : 16:52:37, Aug 26 2021

U-Boot 2021.10-00355-gb975dd54f37 (Oct 12 2021 - 18:32:08 +0200)

CPU:   Freescale i.MX8MP[8] rev1.1 at 1200 MHz
Reset cause: POR
DRAM:  8 GiB
WDT:   Started watchdog@3028 with servicing (60s timeout)
MMC:   FSL_SDHC: 1, FSL_SDHC: 2
Loading Environment from MMC... OK
In:serial
Out:   serial
Err:   serial
Model: Toradex Verdin iMX8M Plus Quad 4GB Wi-Fi / BT IT V1.0B,
 Serial# 06817281
Carrier: Toradex Verdin Development Board V1.1A, Serial# 10754333
Setting variant to wifi
Net:   Hard-coding pdata->enetaddr
eth1: ethernet@30be, eth0: ethernet@30bf [PRIME]
Hit any key to stop autoboot:  0
Verdin iMX8MP #

Note that this series is applied on top of my patch set introducing
Colibri iMX6ULL 1GB eMMC variant [1], Peng's Makefile fix [2] as
otherwise, it may not quite generate all binman artefacts in the right
order as discussed here [3] and Ye Li's patch set enabling DWC EQoS iMX
driver [4].

[1] https://marc.info/?l=u-boot=163353937432582
[2] https://marc.info/?l=u-boot=162908373904742
[3] https://marc.info/?l=u-boot=162945614207220
[4] https://marc.info/?l=u-boot=162911073217202

Signed-off-by: Marcel Ziswiler 

---

 arch/arm/dts/Makefile   |1 +
 arch/arm/dts/imx8mp-verdin-u-boot.dtsi  |  132 ++
 arch/arm/dts/imx8mp-verdin.dts  |  639 ++
 arch/arm/mach-imx/imx8m/Kconfig |8 +
 board/toradex/verdin-imx8mp/Kconfig |   42 +
 board/toradex/verdin-imx8mp/MAINTAINERS |   10 +
 board/toradex/verdin-imx8mp/Makefile|   11 +
 board/toradex/verdin-imx8mp/imximage.cfg|   10 +
 board/toradex/verdin-imx8mp/lpddr4_timing.c | 2168 +++
 board/toradex/verdin-imx8mp/spl.c   |  158 ++
 board/toradex/verdin-imx8mp/verdin-imx8mp.c |  158 ++
 configs/verdin-imx8mp_defconfig |  131 ++
 doc/board/toradex/verdin-imx8mp.rst |  105 +
 include/configs/verdin-imx8mp.h |  136 ++
 14 files changed, 3709 insertions(+)
 create mode 100644 arch/arm/dts/imx8mp-verdin-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx8mp-verdin.dts
 create mode 100644 board/toradex/verdin-imx8mp/Kconfig
 create mode 100644 board/toradex/verdin-imx8mp/MAINTAINERS
 create mode 100644 board/toradex/verdin-imx8mp/Makefile
 create mode 100644 board/toradex/verdin-imx8mp/imximage.cfg
 create mode 100644 board/toradex/verdin-imx8mp/lpddr4_timing.c
 create mode 100644 board/toradex/verdin-imx8mp/spl.c
 create mode 100644 board/toradex/verdin-imx8mp/verdin-imx8mp.c
 create mode 100644 configs/verdin-imx8mp_defconfig
 create mode 100644 doc/board/toradex/verdin-imx8mp.rst
 create mode 100644 include/configs/verdin-imx8mp.h

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 2dd7ca68188..af1de695894 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -890,6 +890,7 @@ dtb-$(CONFIG_ARCH_IMX8M) += \
imx8mq-phanbell.dtb \
imx8mp-evk.dtb \
imx8mp-phyboard-pollux-rdk.dtb \
+   imx8mp-verdin.dtb \
imx8mq-pico-pi.dtb
 
 dtb-$(CONFIG_ARCH_IMXRT) += imxrt1050-evk.dtb \
diff --git a/arch/arm/dts/imx8mp-verdin-u-boot.dtsi 
b/arch/arm/dts/imx8mp-verdin-u-boot.dtsi
new file mode 100644
index 000..fb25b4a7ce4
--- /dev/null
+++ b/arch/arm/dts/imx8mp-verdin-u-boot.dtsi
@@ -0,0 +1,132 @@
+// SPDX-License-Identifier: GPL-2.0+ OR MIT
+/*
+ * Copyright 2021 Toradex
+ */
+
+#include "imx8mp-u-boot.dtsi"
+
+/ {
+   firmware {
+   optee {
+   compatible = "linaro,optee-tz";
+   method = "smc";
+   };
+   };
+
+   wdt-reboot {
+   compatible = "wdt-reboot";
+   u-boot,dm-spl;
+   wdt = <>;
+   };
+};
+
+ {
+   u-boot,dm-pre-reloc;
+   u-boot,dm-spl;
+   /delete-property/ assigned-clocks;
+ 

Re: IMX8M OP-TEE

2021-10-11 Thread Marcel Ziswiler
Hi Tim

On Mon, 2021-10-11 at 15:15 -0700, Tim Harvey wrote:
> Greetings,
> 
> Is anyone successfully booting U-Boot with OP-TEE support on the IMX8M?

I am not aware that anybody at Toradex played with OP-TEE so far but let me ask 
around again.

However, maybe Igor or Oleksandr (added to CC, now both with Foundries) might 
have some experience. I know that
Igor used to work on this kind of stuff.

> My understanding is that you need to add tee.bin to the images in the
> FIT image and include it in loadables following the ATF.
> 
> While this was done with arch/arm/mach-imx/mkimage_fit_atf.sh before
> the switch to binman by simply having tee.bin in the U-Boot directory
> and passing in TEE_LOAD_ADDR (or accepting the default of 0xfe00)
> once you switch to binman it needs to be added for your board.
> 
> Additionally in order to use OP-TEE from U-Boot (ie for dek_blob
> command) you need to add a node with compatible=linaro,optee-tz as
> well.
> 
> I've done the following to add OP-TEE for imx8mm_venice:
> diff --git a/configs/imx8mm_venice_defconfig b/configs/imx8mm_venice_defconfig
> index d85827b588..85d2b20810 100644
> -u-boot.dtsi
> index e0fa9ff4bf..7a71b974e1 100644
> --- a/arch/arm/dts/imx8mm-venice-u-boot.dtsi
> +++ b/arch/arm/dts/imx8mm-venice-u-boot.dtsi
> @@ -10,6 +10,13 @@
>     multiple-images;
>     };
> 
> +   firmware {
> +   optee {
> +   compatible = "linaro,optee-tz";
> +   method = "smc";
> +   };
> +   };
> +
>     wdt-reboot {
>     compatible = "wdt-reboot";
>     wdt = <>;
> @@ -152,6 +159,16 @@
>     };
>     };
> 
> +   tee {
> +   description = "TEE firmware";
> +   type = "firmware";
> +   arch = "arm64";
> +   compression = "none";
> +   data = "tee.bin";
> +   load = <0xbe00>;
> +   entry = <0xbe00>;
> +   };
> +
>     @fdt-SEQ {
>     description = "NAME";
>     type = "flat_dt";
> @@ -165,7 +182,7 @@
>     @config-SEQ {
>     description = "NAME";
>     firmware = "uboot";
> -   loadables = "atf";
> +   loadables = "atf", "tee";
>     fdt = "fdt-SEQ";
>     };
>     };
> 
> 
> However, when I attempt to boot I hang when the ATF is run.
> 
> Where does the TEE_LOAD_ADDR come from specifically? I would think
> this needs to be defined when building tee and needs to match the load
> address used in the FIT image. It appears that perhaps this is supped
> to be DDR_BASE + DDR_SIZE - 32MIB but I'm not entirely sure.
> 
> I'm currently using NXP's ATF (imx_5.4.3_2.0.0) and NXP's TEE
> (imx_5.4.70_2.3.0) and would also like to understand if NXP's branches
> are strictly required here and if so what the pros and cons of using
> them are.
> 
> Anyone using IMX8MM OP-TEE that could point me in the right direction?
> 
> Best regards,
> 
> Tim

BTW: Have you tried my latest stuff [1] on venice? Did/does it work? And yeah, 
my cover letter subject is
slightly misleading as I forgot to update that one (;-p).

[1] https://marc.info/?l=u-boot=163372696806292

Cheers

Marcel


Re: [PATCH 1/7] arm: mach-imx: Update MAC fuse for i.MX8MP

2021-10-10 Thread Marcel Ziswiler
On Mon, 2021-08-16 at 18:44 +0800, Ye Li wrote:
> i.MX8MP has two ENET controllers, have to update the function to
> enable loading two MAC addresses.
> 
> Signed-off-by: Ye Li 

Whole series.

Tested on iMX8MP_EVK and Verdin iMX8M Plus on Verdin development board.
Tested-by: Marcel Ziswiler 

I will post the Verdin iMX8M Plus support shortly.

> ---
>  arch/arm/mach-imx/mac.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm/mach-imx/mac.c b/arch/arm/mach-imx/mac.c
> index 3b1496b..9bb63d2 100644
> --- a/arch/arm/mach-imx/mac.c
> +++ b/arch/arm/mach-imx/mac.c
> @@ -31,7 +31,7 @@ void imx_get_mac_from_fuse(int dev_id, unsigned char *mac)
>  
> offset = is_mx6() ? MAC_FUSE_MX6_OFFSET : MAC_FUSE_MX7_OFFSET;
> fuse = (struct imx_mac_fuse *)(ulong)(OCOTP_BASE_ADDR + offset);
> -   has_second_mac = is_mx7() || is_mx6sx() || is_mx6ul() || is_mx6ull();
> +   has_second_mac = is_mx7() || is_mx6sx() || is_mx6ul() || is_mx6ull() 
> || is_imx8mp();
>  
> if (has_second_mac && dev_id == 1) {
> u32 value = readl(>mac_addr2);


[PATCH v6 00/11] board: toradex: verdin-imx8mm: target refresh

2021-10-09 Thread Marcel Ziswiler
From: Marcel Ziswiler 


An assortment of fixes and improvements like an Ethernet PHY
configuration fix, DEK blob encapsulation preparation, migration to
using binman to pack images, SLEEP_MOCI# enablement, dropping of V1.0
hardware support [1], renaming kernel image variable, using preboot
for fdtfile evaluation and watchdog pinctrl fix.

Note that this series is applied on top of Peng's Makefile fix [2] as
otherwise, it may not quite generate all binman artefacts in the right
order as discussed here [3].

[1] https://developer.toradex.com/verdin-sample-phase-over
[2] https://marc.info/?l=u-boot=162908373904742
[3] https://marc.info/?l=u-boot=162945614207220

Changes in v6:
- New patch re-ordering fdt nodes and properties.
- Update commit message as requested by Wolfgang.

Changes in v5:
- Drop device tree part already done by Marek's patch.
- Add another fixes tag as his patch forgot the board code part.
- Re-based on top of u-boot-imx, master yet again.

Changes in v4:
- Add Heiko Schocher's reviewed-by tag.
- Fix copyright periods.
- Re-based.

Changes in v3:
- Case fold hex string.
- Revert binman part of imx8mm-verdin-u-boot.dtsi to a plain copy from
  imx8mm-evk and postpone further improvements to after migrating to a
  common binman config as agreed with Frieder and Simon.
- New patch cleaning up include order.
- Add Fabio's reviewed-by tag.
- Fix patch.
- Add missing apalis-imx8 part.
- While at it update copyright year resp. period.
- Fix closing endif comment.

Changes in v2:
- Explicitly pass filename to binman when generating binaries as
  suggested by Heiko.
- Use proper intermediate binary u-boot-spl-ddr.bin for imximage as
  pointed out by Heiko.
- Drop first patch ("imx: mkimage_fit_atf: fix legacy image generation")
  as a similar fix was already refused earlier.
- New patch allows booting recent embedded Linux BSPs.
- New patch addressing dynamic fdtfile definition.
- New patch fixing watchdog pinctrl issue.

Igor Opaniuk (1):
  verdin-imx8mm: use preboot for fdtfile evaluation

Marcel Ziswiler (7):
  imx8m: clean-up kconfig indentation
  verdin-imx8mm: fix ethernet
  ARM: dts: imx8mm-verdin: prepare for dek blob encapsulation
  arm64: dts: imx8mm-verdin-u-boot.dtsi: alphabetically re-order
  verdin-imx8mm: switch to use binman to pack images
  verdin-imx8mm: clean-up include order
  verdin-imx8mm: fix watchdog pinctrl issue

Max Krummenacher (2):
  verdin-imx8mm: enable sleep_moci output
  verdin-imx8mm: drop support for v1.0 hardware

Oleksandr Suvorov (1):
  include/configs: apalis-imx8/verdin-imx8mm: rename kernel image
variable

 arch/arm/dts/imx8mm-verdin-u-boot.dtsi  | 147 +++-
 arch/arm/dts/imx8mm-verdin.dts  |  18 +++
 arch/arm/mach-imx/imx8m/Kconfig |  21 +--
 board/toradex/verdin-imx8mm/imximage.cfg|  11 +-
 board/toradex/verdin-imx8mm/verdin-imx8mm.c |  81 +--
 configs/verdin-imx8mm_defconfig |   6 +-
 doc/board/toradex/verdin-imx8mm.rst |  53 ---
 include/configs/apalis-imx8.h   |   6 +-
 include/configs/verdin-imx8mm.h |  10 +-
 9 files changed, 220 insertions(+), 133 deletions(-)

-- 
2.26.2



[PATCH v6 09/11] include/configs: apalis-imx8/verdin-imx8mm: rename kernel image variable

2021-10-09 Thread Marcel Ziswiler
From: Oleksandr Suvorov 

Variable "kernel_image" is used in boot.scr script only, that sets its
own default value to the constant string @@KERNEL_IMAGETYPE@@ in case
"kernel_image" is not set.
The default name of the kernel image shipped with BSP 5.x is "Image.gz".
Setting kernel_image="Image" as a pre-defined u-boot variable
breaks booting systems with modern versions of boot.scr, whereas
renaming it fixes booting with modern scripts and does not break working
of earlier versions of boot.scr.

While at it also update the copyright period, rather than hard-coding
fdtfile default fdt_board to dev for the Verdin iMX8M Mini and fix its
closing #endif comment.

Signed-off-by: Oleksandr Suvorov 
Signed-off-by: Marcel Ziswiler 
Reviewed-by: Fabio Estevam 

---

Changes in v6:
- Update commit message as requested by Wolfgang.

Changes in v3:
- Fix patch.
- Add missing apalis-imx8 part.
- While at it update copyright year resp. period.
- Fix closing endif comment.

Changes in v2:
- New patch allows booting recent embedded Linux BSPs.

 include/configs/apalis-imx8.h   |  6 +++---
 include/configs/verdin-imx8mm.h | 10 +-
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/include/configs/apalis-imx8.h b/include/configs/apalis-imx8.h
index 80594548877..ce5681499c9 100644
--- a/include/configs/apalis-imx8.h
+++ b/include/configs/apalis-imx8.h
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
 /*
- * Copyright 2019 Toradex
+ * Copyright 2019-2021 Toradex
  */
 
 #ifndef __APALIS_IMX8_H
@@ -42,12 +42,12 @@
 #define CONFIG_EXTRA_ENV_SETTINGS \
BOOTENV \
MEM_LAYOUT_ENV_SETTINGS \
+   "boot_file=Image\0" \
"console=ttyLP1 earlycon\0" \
"fdt_addr=0x8300\0" \
"fdt_file=fsl-imx8qm-apalis-eval.dtb\0" \
"fdtfile=fsl-imx8qm-apalis-eval.dtb\0" \
"finduuid=part uuid mmc ${mmcdev}:2 uuid\0" \
-   "image=Image\0" \
"initrd_addr=0x8380\0" \
"initrd_high=0x\0" \
"mmcargs=setenv bootargs console=${console},${baudrate} " \
@@ -57,7 +57,7 @@
"netargs=setenv bootargs console=${console},${baudrate} " \
"root=/dev/nfs ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp" \
"\0" \
-   "nfsboot=run netargs; dhcp ${loadaddr} ${image}; tftp ${fdt_addr} " \
+   "nfsboot=run netargs; dhcp ${loadaddr} ${boot_file}; tftp ${fdt_addr} " 
\
"apalis-imx8/${fdt_file}; booti ${loadaddr} - ${fdt_addr}\0" \
"panel=NULL\0" \
"script=boot.scr\0" \
diff --git a/include/configs/verdin-imx8mm.h b/include/configs/verdin-imx8mm.h
index 50c808383db..693fd6907eb 100644
--- a/include/configs/verdin-imx8mm.h
+++ b/include/configs/verdin-imx8mm.h
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
 /*
- * Copyright 2020 Toradex
+ * Copyright 2020-2021 Toradex
  */
 
 #ifndef __VERDIN_IMX8MM_H
@@ -54,16 +54,16 @@
BOOTENV \
MEM_LAYOUT_ENV_SETTINGS \
"bootcmd_mfg=fastboot 0\0" \
+   "boot_file=Image\0" \
"console=ttymxc0\0" \
"fdt_addr=0x4300\0" \
-   "fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \
+   "fdt_board=dev\0" \
"initrd_addr=0x4380\0" \
"initrd_high=0x\0" \
-   "kernel_image=Image\0" \
"netargs=setenv bootargs console=${console},${baudrate} " \
"root=/dev/nfs ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp" \
"\0" \
-   "nfsboot=run netargs; dhcp ${loadaddr} ${kernel_image}; " \
+   "nfsboot=run netargs; dhcp ${loadaddr} ${boot_file}; " \
"tftp ${fdt_addr} verdin/${fdtfile}; " \
"booti ${loadaddr} - ${fdt_addr}\0" \
"setup=setenv setupargs console=${console},${baudrate} " \
@@ -118,4 +118,4 @@
 #define CONFIG_MXC_USB_PORTSC  (PORT_PTS_UTMI | PORT_PTS_PTW)
 #define CONFIG_USB_MAX_CONTROLLER_COUNT 2
 
-#endif /*_VERDIN_IMX8MM_H */
+#endif /* __VERDIN_IMX8MM_H */
-- 
2.26.2



[PATCH v6 05/11] verdin-imx8mm: switch to use binman to pack images

2021-10-09 Thread Marcel Ziswiler
From: Marcel Ziswiler 

Use binman to pack images.

Signed-off-by: Marcel Ziswiler 
Reviewed-by: Heiko Thiery 
Reviewed-by: Fabio Estevam 
Reviewed-by: Heiko Schocher 

---

(no changes since v4)

Changes in v4:
- Add Heiko Schocher's reviewed-by tag.
- Fix copyright periods.

Changes in v3:
- Case fold hex string.
- Revert binman part of imx8mm-verdin-u-boot.dtsi to a plain copy from
  imx8mm-evk and postpone further improvements to after migrating to a
  common binman config as agreed with Frieder and Simon.

Changes in v2:
- Explicitly pass filename to binman when generating binaries as
  suggested by Heiko.
- Use proper intermediate binary u-boot-spl-ddr.bin for imximage as
  pointed out by Heiko.

 arch/arm/dts/imx8mm-verdin-u-boot.dtsi   | 124 ++-
 arch/arm/mach-imx/imx8m/Kconfig  |   1 +
 board/toradex/verdin-imx8mm/imximage.cfg |  11 +-
 configs/verdin-imx8mm_defconfig  |   2 +-
 doc/board/toradex/verdin-imx8mm.rst  |  53 +-
 5 files changed, 157 insertions(+), 34 deletions(-)

diff --git a/arch/arm/dts/imx8mm-verdin-u-boot.dtsi 
b/arch/arm/dts/imx8mm-verdin-u-boot.dtsi
index 1fc499806db..6a7e9d776c8 100644
--- a/arch/arm/dts/imx8mm-verdin-u-boot.dtsi
+++ b/arch/arm/dts/imx8mm-verdin-u-boot.dtsi
@@ -1,11 +1,15 @@
 // SPDX-License-Identifier: GPL-2.0+ OR MIT
 /*
- * Copyright 2020 Toradex
+ * Copyright 2020-2021 Toradex
  */
 
 #include "imx8mm-u-boot.dtsi"
 
 / {
+   binman: binman {
+   multiple-images;
+   };
+
firmware {
optee {
compatible = "linaro,optee-tz";
@@ -91,3 +95,121 @@
  {
u-boot,dm-spl;
 };
+
+ {
+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 = ;
+
+   images {
+   uboot {
+   description = "U-Boot (64-bit)";
+   type = "standalone";
+   arch = "arm64";
+   compression = "none";
+   load = ;
+
+   uboot_blob: blob-ext {
+   filename = "u-boot-nodtb.bin";
+   };
+   };
+
+   atf {
+   description = "ARM Trusted Firmware";
+   type = "firmware";
+   arch = "arm64";
+   compression = "none";
+   load = <0x92>;
+   entry = <0x92>;
+
+   atf_blob: blob-ext {
+   filename = "bl31.bin";
+   };
+   };
+
+   fdt {
+   description = "NAME";
+   type = "flat_dt";
+   compression = "none";
+
+  

[PATCH v6 10/11] verdin-imx8mm: use preboot for fdtfile evaluation

2021-10-09 Thread Marcel Ziswiler
From: Igor Opaniuk 

Enable and set preboot var with fdtfile evaluation.
It will be checked and run immediately before starting the
CONFIG_BOOTDELAY countdown and/or running the auto-boot command resp.
entering interactive mode.

This provides possibility to use different boot cmds in interactive mode
without manual setting fdtfile value, as it it's already evaluated
before entering interactive mode.

Signed-off-by: Igor Opaniuk 
Signed-off-by: Marcel Ziswiler 
Reviewed-by: Fabio Estevam 

---

(no changes since v2)

Changes in v2:
- New patch addressing dynamic fdtfile definition.

 configs/verdin-imx8mm_defconfig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/configs/verdin-imx8mm_defconfig b/configs/verdin-imx8mm_defconfig
index ced0d0acc37..ed14ff3b114 100644
--- a/configs/verdin-imx8mm_defconfig
+++ b/configs/verdin-imx8mm_defconfig
@@ -26,7 +26,8 @@ CONFIG_SPL_LOAD_FIT=y
 # CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_OF_SYSTEM_SETUP=y
 # CONFIG_USE_BOOTCOMMAND is not set
-CONFIG_DEFAULT_FDT_FILE="fsl-imx8mm-verdin-dev.dtb"
+CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="setenv fdtfile imx8mm-verdin-${variant}-${fdt_board}.dtb"
 CONFIG_LOG=y
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_DISPLAY_BOARDINFO_LATE=y
-- 
2.26.2



[PATCH v6 06/11] verdin-imx8mm: enable sleep_moci output

2021-10-09 Thread Marcel Ziswiler
From: Max Krummenacher 

This powers some peripherals on the carrier board e.g. the USB hub.

Related-to: ELB-3206
Signed-off-by: Max Krummenacher 
Signed-off-by: Marcel Ziswiler 
Reviewed-by: Fabio Estevam 
---

(no changes since v1)

 arch/arm/dts/imx8mm-verdin.dts  | 18 ++
 configs/verdin-imx8mm_defconfig |  1 +
 2 files changed, 19 insertions(+)

diff --git a/arch/arm/dts/imx8mm-verdin.dts b/arch/arm/dts/imx8mm-verdin.dts
index ac2a4b69d3c..a2331627d72 100644
--- a/arch/arm/dts/imx8mm-verdin.dts
+++ b/arch/arm/dts/imx8mm-verdin.dts
@@ -196,6 +196,18 @@
};
 };
 
+ {
+   ctrl_sleep_moci {
+   gpio-hog;
+   /* Verdin CTRL_SLEEP_MOCI# (SODIMM 256) */
+   gpios = <1 GPIO_ACTIVE_HIGH>;
+   line-name = "CTRL_SLEEP_MOCI#";
+   output-high;
+   pinctrl-names = "default";
+   pinctrl-0 = <_ctrl_sleep_moci>;
+   };
+};
+
 /* On-module I2C */
  {
clock-frequency = <40>;
@@ -548,6 +560,12 @@
>;
};
 
+   pinctrl_ctrl_sleep_moci: ctrlsleepmocigrp {
+   fsl,pins = <
+   MX8MM_IOMUXC_SAI3_TXD_GPIO5_IO1 0x1c4   
/* SODIMM 256 */
+   >;
+   };
+
pinctrl_dsi_bkl_en: dsi_bkl_en {
fsl,pins = <
MX8MM_IOMUXC_NAND_CE2_B_GPIO3_IO3   0x1c4   
/* SODIMM 21 */
diff --git a/configs/verdin-imx8mm_defconfig b/configs/verdin-imx8mm_defconfig
index 1c8b505656a..ced0d0acc37 100644
--- a/configs/verdin-imx8mm_defconfig
+++ b/configs/verdin-imx8mm_defconfig
@@ -69,6 +69,7 @@ CONFIG_SPL_CLK_COMPOSITE_CCF=y
 CONFIG_CLK_COMPOSITE_CCF=y
 CONFIG_SPL_CLK_IMX8MM=y
 CONFIG_CLK_IMX8MM=y
+CONFIG_GPIO_HOG=y
 CONFIG_MXC_GPIO=y
 CONFIG_DM_I2C=y
 CONFIG_MISC=y
-- 
2.26.2



[PATCH v6 11/11] verdin-imx8mm: fix watchdog pinctrl issue

2021-10-09 Thread Marcel Ziswiler
From: Marcel Ziswiler 

Finally, found the root cause of the issue already once mentioned back
here [2] which caused the following error message during boot:

imx_wdt watchdog@3028:
 pinctrl_select_state_full: uclass_get_device_by_phandle_id: err=-19

Turns out while the watchdog node itself was already u-boot,dm-spl its
pinctrl node was not which caused it to be unavailable at that early
stage. Note that any and all other boards I checked also seem to be
missing this. However, I can't judge whether or not they might indeed
need a similar fix or not.

[2] https://marc.info/?l=u-boot=161786572422973

Fixes: commit d304e7ace3a6
 ("ARM: imx8m: Fix reset in SPL on Toradex iMX8MM Verdin")
Signed-off-by: Marcel Ziswiler 
Reviewed-by: Fabio Estevam 

---

(no changes since v2)

Changes in v2:
- New patch fixing watchdog pinctrl issue.

 arch/arm/dts/imx8mm-verdin-u-boot.dtsi | 4 
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/dts/imx8mm-verdin-u-boot.dtsi 
b/arch/arm/dts/imx8mm-verdin-u-boot.dtsi
index 6a7e9d776c8..9fb4d8aa8c2 100644
--- a/arch/arm/dts/imx8mm-verdin-u-boot.dtsi
+++ b/arch/arm/dts/imx8mm-verdin-u-boot.dtsi
@@ -76,6 +76,10 @@
u-boot,dm-spl;
 };
 
+_wdog {
+   u-boot,dm-spl;
+};
+
  {
u-boot,dm-spl;
 };
-- 
2.26.2



[PATCH v6 08/11] verdin-imx8mm: drop support for v1.0 hardware

2021-10-09 Thread Marcel Ziswiler
From: Max Krummenacher 

We drop support for Verdin iMX8M Mini V1.0B.

Related-to: ELB-3551
Signed-off-by: Max Krummenacher 
Signed-off-by: Marcel Ziswiler 
Reviewed-by: Fabio Estevam 

---

(no changes since v5)

Changes in v5:
- Re-based on top of u-boot-imx, master yet again.

Changes in v4:
- Re-based.

Changes in v3:
- Add Fabio's reviewed-by tag.

Changes in v2:
- Drop first patch ("imx: mkimage_fit_atf: fix legacy image generation")
  as a similar fix was already refused earlier.

 board/toradex/verdin-imx8mm/verdin-imx8mm.c | 13 +
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/board/toradex/verdin-imx8mm/verdin-imx8mm.c 
b/board/toradex/verdin-imx8mm/verdin-imx8mm.c
index 71ceb26e811..c51c99b5156 100644
--- a/board/toradex/verdin-imx8mm/verdin-imx8mm.c
+++ b/board/toradex/verdin-imx8mm/verdin-imx8mm.c
@@ -9,6 +9,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -87,17 +88,13 @@ static void select_dt_from_module_version(void)
 
switch (get_pcb_revision()) {
case PCB_VERSION_1_0:
-   printf("Detected a V1.0 module\n");
-   if (is_wifi)
-   strncpy([0], "wifi", sizeof(variant));
-   else
-   strncpy([0], "nonwifi", sizeof(variant));
-   break;
+   printf("Detected a V1.0 module which is no longer supported in 
this BSP version\n");
+   hang();
default:
if (is_wifi)
-   strncpy([0], "wifi-v1.1", sizeof(variant));
+   strlcpy([0], "wifi", sizeof(variant));
else
-   strncpy([0], "nonwifi-v1.1", sizeof(variant));
+   strlcpy([0], "nonwifi", sizeof(variant));
break;
}
 
-- 
2.26.2



[PATCH v6 07/11] verdin-imx8mm: clean-up include order

2021-10-09 Thread Marcel Ziswiler
From: Marcel Ziswiler 

Alphabetically order includes.
While at it also update copyright year resp. period.

Signed-off-by: Marcel Ziswiler 
---

(no changes since v3)

Changes in v3:
- New patch cleaning up include order.

 board/toradex/verdin-imx8mm/verdin-imx8mm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/board/toradex/verdin-imx8mm/verdin-imx8mm.c 
b/board/toradex/verdin-imx8mm/verdin-imx8mm.c
index 1644f4b3081..71ceb26e811 100644
--- a/board/toradex/verdin-imx8mm/verdin-imx8mm.c
+++ b/board/toradex/verdin-imx8mm/verdin-imx8mm.c
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- * Copyright 2020 Toradex
+ * Copyright 2020-2021 Toradex
  */
 
 #include 
@@ -10,9 +10,9 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
-#include 
 
 #include "../common/tdx-cfg-block.h"
 
-- 
2.26.2



[PATCH v6 04/11] arm64: dts: imx8mm-verdin-u-boot.dtsi: alphabetically re-order

2021-10-09 Thread Marcel Ziswiler
From: Marcel Ziswiler 

Alphabetically re-order nodes and properties.

Signed-off-by: Marcel Ziswiler 

---

Changes in v6:
- New patch.

 arch/arm/dts/imx8mm-verdin-u-boot.dtsi | 18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/arch/arm/dts/imx8mm-verdin-u-boot.dtsi 
b/arch/arm/dts/imx8mm-verdin-u-boot.dtsi
index a97626fa0c1..1fc499806db 100644
--- a/arch/arm/dts/imx8mm-verdin-u-boot.dtsi
+++ b/arch/arm/dts/imx8mm-verdin-u-boot.dtsi
@@ -15,11 +15,19 @@
 
wdt-reboot {
compatible = "wdt-reboot";
-   wdt = <>;
u-boot,dm-spl;
+   wdt = <>;
};
 };
 
+&{/soc@0/bus@3080/i2c@30a2/pmic} {
+   u-boot,dm-spl;
+};
+
+&{/soc@0/bus@3080/i2c@30a2/pmic/regulators} {
+   u-boot,dm-spl;
+};
+
  {
u-boot,dm-spl;
 };
@@ -64,14 +72,6 @@
u-boot,dm-spl;
 };
 
-&{/soc@0/bus@3080/i2c@30a2/pmic} {
-   u-boot,dm-spl;
-};
-
-&{/soc@0/bus@3080/i2c@30a2/pmic/regulators} {
-   u-boot,dm-spl;
-};
-
  {
u-boot,dm-spl;
 };
-- 
2.26.2



[PATCH v6 03/11] ARM: dts: imx8mm-verdin: prepare for dek blob encapsulation

2021-10-09 Thread Marcel Ziswiler
From: Marcel Ziswiler 

Prepare for DEK blob encapsulation support through "dek_blob" command.
On ARMv8, u-boot runs in non-secure, thus cannot encapsulate a DEK blob
for encrypted boot.
The DEK blob is encapsulated by OP-TEE through a trusted application
call. U-boot sends and receives the DEK and the DEK blob binaries
through OP-TEE dynamic shared memory.

To enable the DEK blob encapsulation, add to the defconfig:
CONFIG_SECURE_BOOT=y
CONFIG_FAT_WRITE=y
CONFIG_CMD_DEKBLOB=y

Taken from NXP's commit 56d2050f4028 ("imx8m: Add DEK blob encapsulation
for imx8m").

Signed-off-by: Marcel Ziswiler 
Reviewed-by: Fabio Estevam 
---

(no changes since v1)

 arch/arm/dts/imx8mm-verdin-u-boot.dtsi | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/arch/arm/dts/imx8mm-verdin-u-boot.dtsi 
b/arch/arm/dts/imx8mm-verdin-u-boot.dtsi
index 67c31c49b6c..a97626fa0c1 100644
--- a/arch/arm/dts/imx8mm-verdin-u-boot.dtsi
+++ b/arch/arm/dts/imx8mm-verdin-u-boot.dtsi
@@ -6,6 +6,13 @@
 #include "imx8mm-u-boot.dtsi"
 
 / {
+   firmware {
+   optee {
+   compatible = "linaro,optee-tz";
+   method = "smc";
+   };
+   };
+
wdt-reboot {
compatible = "wdt-reboot";
wdt = <>;
-- 
2.26.2



[PATCH v6 01/11] imx8m: clean-up kconfig indentation

2021-10-09 Thread Marcel Ziswiler
From: Marcel Ziswiler 

Replace spurious spaces with proper tabs.

Signed-off-by: Marcel Ziswiler 
Reviewed-by: Fabio Estevam 
---

(no changes since v1)

 arch/arm/mach-imx/imx8m/Kconfig | 20 ++--
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/arch/arm/mach-imx/imx8m/Kconfig b/arch/arm/mach-imx/imx8m/Kconfig
index d6b9571b373..60a29cddda1 100644
--- a/arch/arm/mach-imx/imx8m/Kconfig
+++ b/arch/arm/mach-imx/imx8m/Kconfig
@@ -25,14 +25,14 @@ config SYS_SOC
default "imx8m"
 
 choice
-   prompt  "NXP i.MX8M board select"
+   prompt "NXP i.MX8M board select"
optional
 
 config TARGET_IMX8MQ_CM
-bool "Ronetix iMX8MQ-CM SoM"
+   bool "Ronetix iMX8MQ-CM SoM"
select BINMAN
-select IMX8MQ
-select IMX8M_LPDDR4
+   select IMX8MQ
+   select IMX8M_LPDDR4
 
 config TARGET_IMX8MQ_EVK
bool "imx8mq_evk"
@@ -105,10 +105,10 @@ config TARGET_PICO_IMX8MQ
select IMX8M_LPDDR4
 
 config TARGET_VERDIN_IMX8MM
-   bool "Support Toradex Verdin iMX8M Mini module"
-   select IMX8MM
-   select SUPPORT_SPL
-   select IMX8M_LPDDR4
+   bool "Support Toradex Verdin iMX8M Mini module"
+   select IMX8MM
+   select SUPPORT_SPL
+   select IMX8M_LPDDR4
 
 config TARGET_IMX8MM_BEACON
bool "imx8mm Beacon Embedded devkit"
@@ -125,14 +125,14 @@ config TARGET_IMX8MN_BEACON
 config TARGET_PHYCORE_IMX8MM
bool "PHYTEC PHYCORE i.MX8MM"
select IMX8MM
-select SUPPORT_SPL
+   select SUPPORT_SPL
select IMX8M_LPDDR4
 
 config TARGET_PHYCORE_IMX8MP
bool "PHYTEC PHYCORE i.MX8MP"
select BINMAN
select IMX8MP
-select SUPPORT_SPL
+   select SUPPORT_SPL
select IMX8M_LPDDR4
 
 config TARGET_IMX8MM_CL_IOT_GATE
-- 
2.26.2



[PATCH v6 02/11] verdin-imx8mm: fix ethernet

2021-10-09 Thread Marcel Ziswiler
From: Marcel Ziswiler 

Turns out Microship (formerly Micrel) meanwhile integrated proper
support for the DLL setup on their KSZ9131. Unfortunately, this
conflicts with our previous board code doing that.
Fix this by getting rid of our board code and just relying on the
generic implementation relying on rgmii-id being used as phy-mode.

Fixes: commit c6df0e2ffdc4
   ("net: phy: micrel: add support for DLL setup on ksz9131")
Fixes: commit af2d3c91d877
   ("ARM: dts: imx8mm-verdin: Set PHY mode to RGMII-ID")
Signed-off-by: Marcel Ziswiler 
Reviewed-by: Fabio Estevam 

---

(no changes since v5)

Changes in v5:
- Drop device tree part already done by Marek's patch.
- Add another fixes tag as his patch forgot the board code part.

 board/toradex/verdin-imx8mm/verdin-imx8mm.c | 64 -
 1 file changed, 64 deletions(-)

diff --git a/board/toradex/verdin-imx8mm/verdin-imx8mm.c 
b/board/toradex/verdin-imx8mm/verdin-imx8mm.c
index 76f4a1e209a..1644f4b3081 100644
--- a/board/toradex/verdin-imx8mm/verdin-imx8mm.c
+++ b/board/toradex/verdin-imx8mm/verdin-imx8mm.c
@@ -36,70 +36,6 @@ static int setup_fec(void)
 
return 0;
 }
-
-int board_phy_config(struct phy_device *phydev)
-{
-   int tmp;
-
-   switch (ksz9xx1_phy_get_id(phydev) & MII_KSZ9x31_SILICON_REV_MASK) {
-   case PHY_ID_KSZ9031:
-   /*
-* The PHY adds 1.2ns for the RXC and 0ns for TXC clock by
-* default. The MAC and the layout don't add a skew between
-* clock and data.
-* Add 0.3ns for the RXC path and 0.96 + 0.42 ns (1.38 ns) for
-* the TXC path to get the required clock skews.
-*/
-   /* control data pad skew - devaddr = 0x02, register = 0x04 */
-   ksz9031_phy_extended_write(phydev, 0x02,
-  MII_KSZ9031_EXT_RGMII_CTRL_SIG_SKEW,
-  MII_KSZ9031_MOD_DATA_NO_POST_INC,
-  0x0070);
-   /* rx data pad skew - devaddr = 0x02, register = 0x05 */
-   ksz9031_phy_extended_write(phydev, 0x02,
-  MII_KSZ9031_EXT_RGMII_RX_DATA_SKEW,
-  MII_KSZ9031_MOD_DATA_NO_POST_INC,
-  0x);
-   /* tx data pad skew - devaddr = 0x02, register = 0x06 */
-   ksz9031_phy_extended_write(phydev, 0x02,
-  MII_KSZ9031_EXT_RGMII_TX_DATA_SKEW,
-  MII_KSZ9031_MOD_DATA_NO_POST_INC,
-  0x);
-   /* gtx and rx clock pad skew - devaddr = 0x02,register = 0x08 */
-   ksz9031_phy_extended_write(phydev, 0x02,
-  MII_KSZ9031_EXT_RGMII_CLOCK_SKEW,
-  MII_KSZ9031_MOD_DATA_NO_POST_INC,
-  0x03f4);
-   break;
-   case PHY_ID_KSZ9131:
-   default:
-   /* read rxc dll control - devaddr = 0x2, register = 0x4c */
-   tmp = ksz9031_phy_extended_read(phydev, 0x02,
-   MII_KSZ9131_EXT_RGMII_2NS_SKEW_RXDLL,
-   MII_KSZ9031_MOD_DATA_NO_POST_INC);
-   /* disable rxdll bypass (enable 2ns skew delay on RXC) */
-   tmp &= ~MII_KSZ9131_RXTXDLL_BYPASS;
-   /* rxc data pad skew 2ns - devaddr = 0x02, register = 0x4c */
-   tmp = ksz9031_phy_extended_write(phydev, 0x02,
-   MII_KSZ9131_EXT_RGMII_2NS_SKEW_RXDLL,
-   MII_KSZ9031_MOD_DATA_NO_POST_INC, tmp);
-   /* read txc dll control - devaddr = 0x02, register = 0x4d */
-   tmp = ksz9031_phy_extended_read(phydev, 0x02,
-   MII_KSZ9131_EXT_RGMII_2NS_SKEW_TXDLL,
-   MII_KSZ9031_MOD_DATA_NO_POST_INC);
-   /* disable txdll bypass (enable 2ns skew delay on TXC) */
-   tmp &= ~MII_KSZ9131_RXTXDLL_BYPASS;
-   /* rxc data pad skew 2ns - devaddr = 0x02, register = 0x4d */
-   tmp = ksz9031_phy_extended_write(phydev, 0x02,
-   MII_KSZ9131_EXT_RGMII_2NS_SKEW_TXDLL,
-   MII_KSZ9031_MOD_DATA_NO_POST_INC, tmp);
-   break;
-   }
-
-   if (phydev->drv->config)
-   phydev->drv->config(phydev);
-   return 0;
-}
 #endif
 
 int board_init(void)
-- 
2.26.2



[PATCH v2 7/7] arm64: dts: imx8mm-u-boot.dtsi: improve odd blob-ext naming

2021-10-08 Thread Marcel Ziswiler
From: Marcel Ziswiler 

Rather than using odd implicit blob-ext naming, explicitly specify the
type to be of blob-ext and therefore also simplify the node naming.

Signed-off-by: Marcel Ziswiler 

---

Changes in v2:
- Rather than doing that clean-up to the separate binman dtsi now do it
  to the common u-boot dtsi one.

Changes in v1:
- This was suggested by Simon on my earlier patch set upon which we
  decided to first break this up into a common binman dtsi and then
  subsequently do such further improvements.

 arch/arm/dts/imx8mm-u-boot.dtsi | 27 ++-
 1 file changed, 18 insertions(+), 9 deletions(-)

diff --git a/arch/arm/dts/imx8mm-u-boot.dtsi b/arch/arm/dts/imx8mm-u-boot.dtsi
index 8feb0f2592a..7882fe73167 100644
--- a/arch/arm/dts/imx8mm-u-boot.dtsi
+++ b/arch/arm/dts/imx8mm-u-boot.dtsi
@@ -39,24 +39,28 @@
filename = "u-boot-spl.bin";
};
 
-   blob_1: blob-ext@1 {
+   1d-imem {
filename = "lpddr4_pmu_train_1d_imem.bin";
size = <0x8000>;
+   type = "blob-ext";
};
 
-   blob_2: blob-ext@2 {
+   1d_dmem {
filename = "lpddr4_pmu_train_1d_dmem.bin";
size = <0x4000>;
+   type = "blob-ext";
};
 
-   blob_3: blob-ext@3 {
+   2d_imem {
filename = "lpddr4_pmu_train_2d_imem.bin";
size = <0x8000>;
+   type = "blob-ext";
};
 
-   blob_4: blob-ext@4 {
+   2d_dmem {
filename = "lpddr4_pmu_train_2d_dmem.bin";
size = <0x4000>;
+   type = "blob-ext";
};
};
 
@@ -89,8 +93,9 @@
load = ;
type = "standalone";
 
-   uboot_blob: blob-ext {
+   uboot_blob {
filename = "u-boot-nodtb.bin";
+   type = "blob-ext";
};
};
 
@@ -102,8 +107,9 @@
load = <0x92>;
type = "firmware";
 
-   atf_blob: blob-ext {
+   atf_blob {
filename = "bl31.bin";
+   type = "blob-ext";
};
};
 
@@ -120,8 +126,9 @@
description = "NAME";
type = "flat_dt";
 
-   uboot_fdt_blob: blob-ext {
+   uboot_fdt_blob {
filename = "u-boot.dtb";
+   type = "blob-ext";
};
};
};
@@ -143,14 +150,16 @@
filename = "flash.bin";
pad-byte = <0x00>;
 
-   spl: blob-ext@1 {
+   spl {
filename = "spl.bin";
offset = <0x0>;
+   type = "blob-ext";
};
 
-   binman_uboot: blob-ext@2 {
+   binman_uboot: uboot {
filename = "u-boot.itb";
offset = <0x57c00>;
+   type = "blob-ext";
};
};
 };
-- 
2.26.2



[PATCH v2 5/7] arm64: dts: imx8mm-u-boot.dtsi: alphabetically re-order properties

2021-10-08 Thread Marcel Ziswiler
From: Marcel Ziswiler 

Alphabetically re-order properties.

Signed-off-by: Marcel Ziswiler 

---

Changes in v2:
- Rather than doing that clean-up to the separate binman dtsi now do it
  to the common u-boot dtsi one.

 arch/arm/dts/imx8mm-u-boot.dtsi | 34 -
 1 file changed, 17 insertions(+), 17 deletions(-)

diff --git a/arch/arm/dts/imx8mm-u-boot.dtsi b/arch/arm/dts/imx8mm-u-boot.dtsi
index 5020255fa0f..770282d2b98 100644
--- a/arch/arm/dts/imx8mm-u-boot.dtsi
+++ b/arch/arm/dts/imx8mm-u-boot.dtsi
@@ -15,8 +15,8 @@
 };
 
  {
-   u-boot,dm-spl;
u-boot,dm-pre-reloc;
+   u-boot,dm-spl;
 };
 
  {
@@ -29,10 +29,10 @@
 
  {
u-boot-spl-ddr {
+   align = <4>;
+   align-size = <4>;
filename = "u-boot-spl-ddr.bin";
pad-byte = <0xff>;
-   align-size = <4>;
-   align = <4>;
 
u-boot-spl {
align-end = <4>;
@@ -76,17 +76,17 @@
 
fit {
description = "Configuration to load ATF before U-Boot";
-   #address-cells = <1>;
fit,external-offset = ;
fit,fdt-list = "of-list";
+   #address-cells = <1>;
 
images {
uboot {
-   description = "U-Boot (64-bit)";
-   type = "standalone";
arch = "arm64";
compression = "none";
+   description = "U-Boot (64-bit)";
load = ;
+   type = "standalone";
 
uboot_blob: blob-ext {
filename = "u-boot-nodtb.bin";
@@ -94,12 +94,12 @@
};
 
atf {
-   description = "ARM Trusted Firmware";
-   type = "firmware";
arch = "arm64";
compression = "none";
-   load = <0x92>;
+   description = "ARM Trusted Firmware";
entry = <0x92>;
+   load = <0x92>;
+   type = "firmware";
 
atf_blob: blob-ext {
filename = "bl31.bin";
@@ -107,17 +107,17 @@
};
 
binman_fip: fip {
-   description = "Trusted Firmware FIP";
-   type = "firmware";
arch = "arm64";
compression = "none";
+   description = "Trusted Firmware FIP";
load = <0x4031>;
+   type = "firmware";
};
 
@fdt-SEQ {
+   compression = "none";
description = "NAME";
type = "flat_dt";
-   compression = "none";
 
uboot_fdt_blob: blob-ext {
filename = "u-boot.dtb";
@@ -130,9 +130,9 @@
 
binman_configuration: @config-SEQ {
description = "NAME";
+   fdt = "fdt-SEQ";
firmware = "uboot";
loadables = "atf";
-   fdt = "fdt-SEQ";
};
};
};
@@ -143,20 +143,20 @@
pad-byte = <0x00>;
 
spl: blob-ext@1 {
-   offset = <0x0>;
filename = "spl.bin";
+   offset = <0x0>;
};
 
binman_uboot: blob-ext@2 {
-   offset = <

[PATCH v2 6/7] arm64: dts: imx8mm-u-boot.dtsi: explicitly add spl filename

2021-10-08 Thread Marcel Ziswiler
From: Marcel Ziswiler 

Explicitly add SPL aka u-boot-spl.bin filename.

Signed-off-by: Marcel Ziswiler 

---

Changes in v2:
- Rather than doing that clean-up to the separate binman dtsi now do it
  to the common u-boot dtsi one.

 arch/arm/dts/imx8mm-u-boot.dtsi | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/dts/imx8mm-u-boot.dtsi b/arch/arm/dts/imx8mm-u-boot.dtsi
index 770282d2b98..8feb0f2592a 100644
--- a/arch/arm/dts/imx8mm-u-boot.dtsi
+++ b/arch/arm/dts/imx8mm-u-boot.dtsi
@@ -36,6 +36,7 @@
 
u-boot-spl {
align-end = <4>;
+   filename = "u-boot-spl.bin";
};
 
blob_1: blob-ext@1 {
-- 
2.26.2



[PATCH v2 4/7] arm64: dts: imx8mm: use common binman configuration

2021-10-08 Thread Marcel Ziswiler
From: Marcel Ziswiler 

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. Move the comon part of
that configuration to the common imx8mm-u-boot.dtsi include file.

Signed-off-by: Marcel Ziswiler 

---

Changes in v2:
- Morph common binman dtsi into regular common u-boot dtsi as discussed
  on mailing list.
- Re-based.

 .../dts/imx8mm-cl-iot-gate-optee-u-boot.dtsi  | 124 ++--
 arch/arm/dts/imx8mm-cl-iot-gate-u-boot.dtsi   | 105 --
 arch/arm/dts/imx8mm-evk-u-boot.dtsi   | 123 
 arch/arm/dts/imx8mm-u-boot.dtsi   | 133 ++
 arch/arm/dts/imx8mm-venice-u-boot.dtsi| 119 
 arch/arm/dts/imx8mm-verdin-u-boot.dtsi| 122 +---
 6 files changed, 147 insertions(+), 579 deletions(-)

diff --git a/arch/arm/dts/imx8mm-cl-iot-gate-optee-u-boot.dtsi 
b/arch/arm/dts/imx8mm-cl-iot-gate-optee-u-boot.dtsi
index bc8a138e6c0..5cbc70faaaf 100644
--- a/arch/arm/dts/imx8mm-cl-iot-gate-optee-u-boot.dtsi
+++ b/arch/arm/dts/imx8mm-cl-iot-gate-optee-u-boot.dtsi
@@ -6,10 +6,6 @@
 #include "imx8mm-u-boot.dtsi"
 
 / {
-   binman: binman {
-   multiple-images;
-   };
-
firmware {
optee {
compatible = "linaro,optee-tz";
@@ -32,117 +28,21 @@
u-boot,dm-spl;
 };
 
- {
-   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>;
-   };
+_fip {
+   arch = "arm64";
+   compression = "none";
+   description = "Trusted Firmware FIP";
+   load = <0x4031>;
+   type = "firmware";
 
-   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 = ;
-
-   images {
-   uboot {
-   description = "U-Boot (64-bit)";
-   type = "standalone";
-   arch = "arm64";
-   compression = "none";
-   load = ;
-
-   uboot_blob: blob-ext {
-   filename = "u-boot-nodtb.bin";
-   };
-   };
-
-   atf {
-   description = "ARM Trusted Firmware";
-   type = "firmware";
-   arch = "arm64";
-   compression = "none";
-   load = <0x92>;
-   entry = <0x92>;
-
-   atf_blob: blob-ext {
-   filename = "bl2.bin";
-   };
-   };
-
-   fip {
-   description = "Trusted Firmware FIP";
-  

[PATCH v2 2/7] arm64: dts: imx8mm-cl-iot-gate-u-boot.dtsi: alphabetically re-order

2021-10-08 Thread Marcel Ziswiler
From: Marcel Ziswiler 

Alphabetically re-order nodes and properties.

Signed-off-by: Marcel Ziswiler 

---

Changes in v2:
- New patch preparing cl-iot-gate.

 .../dts/imx8mm-cl-iot-gate-optee-u-boot.dtsi  | 202 +-
 arch/arm/dts/imx8mm-cl-iot-gate-u-boot.dtsi   | 202 +-
 2 files changed, 202 insertions(+), 202 deletions(-)

diff --git a/arch/arm/dts/imx8mm-cl-iot-gate-optee-u-boot.dtsi 
b/arch/arm/dts/imx8mm-cl-iot-gate-optee-u-boot.dtsi
index 12065935e49..67ce70d0bdf 100644
--- a/arch/arm/dts/imx8mm-cl-iot-gate-optee-u-boot.dtsi
+++ b/arch/arm/dts/imx8mm-cl-iot-gate-optee-u-boot.dtsi
@@ -8,18 +8,18 @@
multiple-images;
};
 
-   wdt-reboot {
-   compatible = "wdt-reboot";
-   wdt = <>;
-   u-boot,dm-spl;
-   };
-
firmware {
optee {
compatible = "linaro,optee-tz";
method = "smc";
};
};
+
+   wdt-reboot {
+   compatible = "wdt-reboot";
+   u-boot,dm-spl;
+   wdt = <>;
+   };
 };
 
 &{/soc@0} {
@@ -27,17 +27,12 @@
u-boot,dm-spl;
 };
 
- {
+&{/soc@0/bus@3080/i2c@30a3/pmic@4b} {
u-boot,dm-spl;
-   u-boot,dm-pre-reloc;
-   /delete-property/ assigned-clocks;
-   /delete-property/ assigned-clock-parents;
-   /delete-property/ assigned-clock-rates;
 };
 
-_24m {
+&{/soc@0/bus@3080/i2c@30a3/pmic@4b/regulators} {
u-boot,dm-spl;
-   u-boot,dm-pre-reloc;
 };
 
  {
@@ -53,94 +48,6 @@
u-boot,dm-spl;
 };
 
- {
-   u-boot,dm-spl;
-};
-
-_uart3 {
-   u-boot,dm-spl;
-};
-
-_usdhc2_gpio {
-   u-boot,dm-spl;
-};
-
-_usdhc2 {
-   u-boot,dm-spl;
-};
-
-_usdhc3 {
-   u-boot,dm-spl;
-};
-
- {
-   u-boot,dm-spl;
-};
-
- {
-   u-boot,dm-spl;
-};
-
- {
-   u-boot,dm-spl;
-};
-
- {
-   u-boot,dm-spl;
-};
-
- {
-   u-boot,dm-spl;
-};
-
- {
-   u-boot,dm-spl;
-};
-
- {
-   u-boot,dm-spl;
-};
-
- {
-   u-boot,dm-spl;
-};
-
- {
-   u-boot,dm-spl;
-};
-
- {
-   u-boot,dm-spl;
-};
-
- {
-   u-boot,dm-spl;
-};
-
-&{/soc@0/bus@3080/i2c@30a3/pmic@4b} {
-   u-boot,dm-spl;
-};
-
-&{/soc@0/bus@3080/i2c@30a3/pmic@4b/regulators} {
-   u-boot,dm-spl;
-};
-
-_i2c2 {
-   u-boot,dm-spl;
-};
-
-_pmic {
-   u-boot,dm-spl;
-};
-
- {
-   phy-reset-gpios = < 22 GPIO_ACTIVE_LOW>;
-};
-
- {
-   u-boot,dm-spl;
-};
-
  {
u-boot-spl-ddr {
filename = "u-boot-spl-ddr.bin";
@@ -253,3 +160,96 @@
};
};
 };
+
+ {
+   u-boot,dm-spl;
+   u-boot,dm-pre-reloc;
+   /delete-property/ assigned-clocks;
+   /delete-property/ assigned-clock-parents;
+   /delete-property/ assigned-clock-rates;
+};
+
+ {
+   phy-reset-gpios = < 22 GPIO_ACTIVE_LOW>;
+};
+
+ {
+   u-boot,dm-spl;
+};
+
+ {
+   u-boot,dm-spl;
+};
+
+ {
+   u-boot,dm-spl;
+};
+
+ {
+   u-boot,dm-spl;
+};
+
+ {
+   u-boot,dm-spl;
+};
+
+ {
+   u-boot,dm-spl;
+};
+
+ {
+   u-boot,dm-spl;
+};
+
+ {
+   u-boot,dm-spl;
+};
+
+_24m {
+   u-boot,dm-spl;
+   u-boot,dm-pre-reloc;
+};
+
+_i2c2 {
+   u-boot,dm-spl;
+};
+
+_pmic {
+   u-boot,dm-spl;
+};
+
+_uart3 {
+   u-boot,dm-spl;
+};
+
+_usdhc2 {
+   u-boot,dm-spl;
+};
+
+_usdhc2_gpio {
+   u-boot,dm-spl;
+};
+
+_usdhc3 {
+   u-boot,dm-spl;
+};
+
+ {
+   u-boot,dm-spl;
+};
+
+ {
+   u-boot,dm-spl;
+};
+
+ {
+   u-boot,dm-spl;
+};
+
+ {
+   u-boot,dm-spl;
+};
+
+ {
+   u-boot,dm-spl;
+};
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 00927c15744..fe45a35d751 100644
--- a/arch/arm/dts/imx8mm-cl-iot-gate-u-boot.dtsi
+++ b/arch/arm/dts/imx8mm-cl-iot-gate-u-boot.dtsi
@@ -8,18 +8,18 @@
multiple-images;
};
 
-   wdt-reboot {
-   compatible = "wdt-reboot";
-   wdt = <>;
-   u-boot,dm-spl;
-   };
-
firmware {
optee {
compatible = "linaro,optee-tz";
method = "smc";
};
};
+
+   wdt-reboot {
+   compatible = "wdt-reboot";
+   u-boot,dm-spl;
+   wdt = <>;
+   };
 };
 
 &{/soc@0} {
@@ -27,17 +27,12 @@
u-boot,dm-spl;
 };
 
- {
+&{/soc@0/bus@3080/i2c@30a3/pmic@4b} {
u-boot,dm-spl;
-   u-boot,dm-pre-reloc;
-   /delete-property/ assigned-clocks;
-   /delete-property/ assigned-clock-parents;
-   /delete-property/ assigned-clock-rates;
 };
 
-_24m {
+&{/soc@0/bus@3080/i2c@30a3/pmic@4b/regulators} {
u-boot,dm-spl;
-   u-boot,dm-pre-reloc;
 };
 
  {

[PATCH v2 3/7] arm64: dts: imx8mm-cl-iot-gate-u-boot.dtsi: use common imx8mm-u-boot.dtsi

2021-10-08 Thread Marcel Ziswiler
From: Marcel Ziswiler 

Use common imx8mm-u-boot.dtsi.

Signed-off-by: Marcel Ziswiler 

---

Changes in v2:
- New patch preparing cl-iot-gate.

 .../dts/imx8mm-cl-iot-gate-optee-u-boot.dtsi  | 37 +--
 arch/arm/dts/imx8mm-cl-iot-gate-u-boot.dtsi   | 37 +--
 2 files changed, 4 insertions(+), 70 deletions(-)

diff --git a/arch/arm/dts/imx8mm-cl-iot-gate-optee-u-boot.dtsi 
b/arch/arm/dts/imx8mm-cl-iot-gate-optee-u-boot.dtsi
index 67ce70d0bdf..bc8a138e6c0 100644
--- a/arch/arm/dts/imx8mm-cl-iot-gate-optee-u-boot.dtsi
+++ b/arch/arm/dts/imx8mm-cl-iot-gate-optee-u-boot.dtsi
@@ -3,6 +3,8 @@
  * Copyright 2019 NXP
  */
 
+#include "imx8mm-u-boot.dtsi"
+
 / {
binman: binman {
multiple-images;
@@ -22,11 +24,6 @@
};
 };
 
-&{/soc@0} {
-   u-boot,dm-pre-reloc;
-   u-boot,dm-spl;
-};
-
 &{/soc@0/bus@3080/i2c@30a3/pmic@4b} {
u-boot,dm-spl;
 };
@@ -35,19 +32,6 @@
u-boot,dm-spl;
 };
 
- {
-   u-boot,dm-spl;
-   u-boot,dm-pre-reloc;
-};
-
- {
-   u-boot,dm-spl;
-};
-
- {
-   u-boot,dm-spl;
-};
-
  {
u-boot-spl-ddr {
filename = "u-boot-spl-ddr.bin";
@@ -161,14 +145,6 @@
};
 };
 
- {
-   u-boot,dm-spl;
-   u-boot,dm-pre-reloc;
-   /delete-property/ assigned-clocks;
-   /delete-property/ assigned-clock-parents;
-   /delete-property/ assigned-clock-rates;
-};
-
  {
phy-reset-gpios = < 22 GPIO_ACTIVE_LOW>;
 };
@@ -201,15 +177,6 @@
u-boot,dm-spl;
 };
 
- {
-   u-boot,dm-spl;
-};
-
-_24m {
-   u-boot,dm-spl;
-   u-boot,dm-pre-reloc;
-};
-
 _i2c2 {
u-boot,dm-spl;
 };
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 fe45a35d751..cf3cc191d5a 100644
--- a/arch/arm/dts/imx8mm-cl-iot-gate-u-boot.dtsi
+++ b/arch/arm/dts/imx8mm-cl-iot-gate-u-boot.dtsi
@@ -3,6 +3,8 @@
  * Copyright 2019 NXP
  */
 
+#include "imx8mm-u-boot.dtsi"
+
 / {
binman: binman {
multiple-images;
@@ -22,11 +24,6 @@
};
 };
 
-&{/soc@0} {
-   u-boot,dm-pre-reloc;
-   u-boot,dm-spl;
-};
-
 &{/soc@0/bus@3080/i2c@30a3/pmic@4b} {
u-boot,dm-spl;
 };
@@ -35,19 +32,6 @@
u-boot,dm-spl;
 };
 
- {
-   u-boot,dm-spl;
-   u-boot,dm-pre-reloc;
-};
-
- {
-   u-boot,dm-spl;
-};
-
- {
-   u-boot,dm-spl;
-};
-
  {
u-boot-spl-ddr {
filename = "u-boot-spl-ddr.bin";
@@ -149,14 +133,6 @@
};
 };
 
- {
-   u-boot,dm-spl;
-   u-boot,dm-pre-reloc;
-   /delete-property/ assigned-clocks;
-   /delete-property/ assigned-clock-parents;
-   /delete-property/ assigned-clock-rates;
-};
-
  {
phy-reset-gpios = < 22 GPIO_ACTIVE_LOW>;
 };
@@ -189,15 +165,6 @@
u-boot,dm-spl;
 };
 
- {
-   u-boot,dm-spl;
-};
-
-_24m {
-   u-boot,dm-spl;
-   u-boot,dm-pre-reloc;
-};
-
 _i2c2 {
u-boot,dm-spl;
 };
-- 
2.26.2



[PATCH v2 0/7] arm64: dts: imx8mm: add common -binman.dtsi and further clean-up

2021-10-08 Thread Marcel Ziswiler
From: Marcel Ziswiler 


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. Move the comon part of
that configuration to the common imx8mm-u-boot.dtsi include file.

The initial patch fixes an issue with intermediate binary naming for the
imx8mm-cl-iot-gate. And subsequent patches further clean up that dtsi.

This series is based on Peng's binman conversion of late [1], my Verdin
iMX8M Mini target refresh [2], Fabio's generating a single bootable
flash.bin again for imx8mm-evk [3] and Tim's switching imx8mm_venice to
using binman to pack images [4].

This series has been run-time tested on Verdin iMX8M Mini. The other
targets were only compile tested.

[1] https://marc.info/?l=u-boot=163366377832026
[2] https://marc.info/?l=u-boot=163365299927718
[3] https://marc.info/?l=u-boot=162972343709264
[4] https://marc.info/?l=u-boot=162983187605276

Changes in v2:
- New patch preparing cl-iot-gate.
- Morph common binman dtsi into regular common u-boot dtsi as discussed
  on mailing list.
- Re-based.
- Rather than doing that clean-up to the separate binman dtsi now do it
  to the common u-boot dtsi one.

Changes in v1:
- This was suggested by Simon on my earlier patch set upon which we
  decided to first break this up into a common binman dtsi and then
  subsequently do such further improvements.

Marcel Ziswiler (7):
  imx8mm-cl-iot-gate: fix imximage intermediate binary naming
  arm64: dts: imx8mm-cl-iot-gate-u-boot.dtsi: alphabetically re-order
  arm64: dts: imx8mm-cl-iot-gate-u-boot.dtsi: use common
imx8mm-u-boot.dtsi
  arm64: dts: imx8mm: use common binman configuration
  arm64: dts: imx8mm-u-boot.dtsi: alphabetically re-order properties
  arm64: dts: imx8mm-u-boot.dtsi: explicitly add spl filename
  arm64: dts: imx8mm-u-boot.dtsi: improve odd blob-ext naming

 .../dts/imx8mm-cl-iot-gate-optee-u-boot.dtsi  | 209 --
 arch/arm/dts/imx8mm-cl-iot-gate-u-boot.dtsi   | 188 +++-
 arch/arm/dts/imx8mm-evk-u-boot.dtsi   | 123 ---
 arch/arm/dts/imx8mm-u-boot.dtsi   | 149 -
 arch/arm/dts/imx8mm-venice-u-boot.dtsi| 119 --
 arch/arm/dts/imx8mm-verdin-u-boot.dtsi| 122 +-
 .../imximage-8mm-lpddr4.cfg   |   2 +-
 7 files changed, 212 insertions(+), 700 deletions(-)

-- 
2.26.2



[PATCH v2 1/7] imx8mm-cl-iot-gate: fix imximage intermediate binary naming

2021-10-08 Thread Marcel Ziswiler
From: Marcel Ziswiler 

This fixes the following build time issue:

...
  BINMAN  all
binman: Error 1 running 'mkimage -d ./mkimage.spl.mkimage -n
 spl/u-boot-spl.cfgout -T imx8mimage -e 0x7e1000
 ./mkimage-out.spl.mkimage': mkimage.flash.mkimage: Can't open: No such
 file or directory

make: *** [Makefile:1094: all] Error 1

Signed-off-by: Marcel Ziswiler 
---

(no changes since v1)

 board/compulab/imx8mm-cl-iot-gate/imximage-8mm-lpddr4.cfg | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/board/compulab/imx8mm-cl-iot-gate/imximage-8mm-lpddr4.cfg 
b/board/compulab/imx8mm-cl-iot-gate/imximage-8mm-lpddr4.cfg
index b89092a5590..4071219fbf4 100644
--- a/board/compulab/imx8mm-cl-iot-gate/imximage-8mm-lpddr4.cfg
+++ b/board/compulab/imx8mm-cl-iot-gate/imximage-8mm-lpddr4.cfg
@@ -6,4 +6,4 @@
 #define __ASSEMBLY__
 
 BOOT_FROM  sd
-LOADER mkimage.flash.mkimage   0x7E1000
+LOADER u-boot-spl-ddr.bin  0x7e1000
-- 
2.26.2



[PATCH v5 08/10] include/configs: apalis-imx8/verdin-imx8mm: rename kernel image variable

2021-10-07 Thread Marcel Ziswiler
From: Oleksandr Suvorov 

Variable "kernel_image" is used in boot.scr script only, that sets its
own default value to the constant string @@KERNEL_IMAGETYPE@@ in case
"kernel_image" is not set.
The default name of the kernel image shipped with BSP 5.x is "Image.gz".
Setting kernel_image="Image" as a pre-defined u-boot variable
breaks booting systems with modern versions of boot.scr, whereas
renaming it fixes booting with modern scripts and does not break working
of earlier versions of boot.scr.

Signed-off-by: Oleksandr Suvorov 
Signed-off-by: Marcel Ziswiler 
Reviewed-by: Fabio Estevam 

---

(no changes since v3)

Changes in v3:
- Fix patch.
- Add missing apalis-imx8 part.
- While at it update copyright year resp. period.
- Fix closing endif comment.

Changes in v2:
- New patch allows booting recent embedded Linux BSPs.

 include/configs/apalis-imx8.h   |  6 +++---
 include/configs/verdin-imx8mm.h | 10 +-
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/include/configs/apalis-imx8.h b/include/configs/apalis-imx8.h
index 80594548877..ce5681499c9 100644
--- a/include/configs/apalis-imx8.h
+++ b/include/configs/apalis-imx8.h
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
 /*
- * Copyright 2019 Toradex
+ * Copyright 2019-2021 Toradex
  */
 
 #ifndef __APALIS_IMX8_H
@@ -42,12 +42,12 @@
 #define CONFIG_EXTRA_ENV_SETTINGS \
BOOTENV \
MEM_LAYOUT_ENV_SETTINGS \
+   "boot_file=Image\0" \
"console=ttyLP1 earlycon\0" \
"fdt_addr=0x8300\0" \
"fdt_file=fsl-imx8qm-apalis-eval.dtb\0" \
"fdtfile=fsl-imx8qm-apalis-eval.dtb\0" \
"finduuid=part uuid mmc ${mmcdev}:2 uuid\0" \
-   "image=Image\0" \
"initrd_addr=0x8380\0" \
"initrd_high=0x\0" \
"mmcargs=setenv bootargs console=${console},${baudrate} " \
@@ -57,7 +57,7 @@
"netargs=setenv bootargs console=${console},${baudrate} " \
"root=/dev/nfs ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp" \
"\0" \
-   "nfsboot=run netargs; dhcp ${loadaddr} ${image}; tftp ${fdt_addr} " \
+   "nfsboot=run netargs; dhcp ${loadaddr} ${boot_file}; tftp ${fdt_addr} " 
\
"apalis-imx8/${fdt_file}; booti ${loadaddr} - ${fdt_addr}\0" \
"panel=NULL\0" \
"script=boot.scr\0" \
diff --git a/include/configs/verdin-imx8mm.h b/include/configs/verdin-imx8mm.h
index 50c808383db..693fd6907eb 100644
--- a/include/configs/verdin-imx8mm.h
+++ b/include/configs/verdin-imx8mm.h
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
 /*
- * Copyright 2020 Toradex
+ * Copyright 2020-2021 Toradex
  */
 
 #ifndef __VERDIN_IMX8MM_H
@@ -54,16 +54,16 @@
BOOTENV \
MEM_LAYOUT_ENV_SETTINGS \
"bootcmd_mfg=fastboot 0\0" \
+   "boot_file=Image\0" \
"console=ttymxc0\0" \
"fdt_addr=0x4300\0" \
-   "fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \
+   "fdt_board=dev\0" \
"initrd_addr=0x4380\0" \
"initrd_high=0x\0" \
-   "kernel_image=Image\0" \
"netargs=setenv bootargs console=${console},${baudrate} " \
"root=/dev/nfs ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp" \
"\0" \
-   "nfsboot=run netargs; dhcp ${loadaddr} ${kernel_image}; " \
+   "nfsboot=run netargs; dhcp ${loadaddr} ${boot_file}; " \
"tftp ${fdt_addr} verdin/${fdtfile}; " \
"booti ${loadaddr} - ${fdt_addr}\0" \
"setup=setenv setupargs console=${console},${baudrate} " \
@@ -118,4 +118,4 @@
 #define CONFIG_MXC_USB_PORTSC  (PORT_PTS_UTMI | PORT_PTS_PTW)
 #define CONFIG_USB_MAX_CONTROLLER_COUNT 2
 
-#endif /*_VERDIN_IMX8MM_H */
+#endif /* __VERDIN_IMX8MM_H */
-- 
2.26.2



[PATCH v5 00/10] board: toradex: verdin-imx8mm: target refresh

2021-10-07 Thread Marcel Ziswiler
From: Marcel Ziswiler 


An assortment of fixes and improvements like an Ethernet PHY
configuration fix, DEK blob encapsulation preparation, migration to
using binman to pack images, SLEEP_MOCI# enablement, dropping of V1.0
hardware support [1], renaming kernel image variable, using preboot
for fdtfile evaluation and watchdog pinctrl fix.

Note that this series is applied on top of Peng's Makefile fix [2] as
otherwise, it may not quite generate all binman artefacts in the right
order as discussed here [3].

[1] https://developer.toradex.com/verdin-sample-phase-over
[2] https://marc.info/?l=u-boot=162908373904742
[3] https://marc.info/?l=u-boot=162945614207220

Changes in v5:
- Drop device tree part already done by Marek's patch.
- Add another fixes tag as his patch forgot the board code part.
- Re-based on top of u-boot-imx, master yet again.

Changes in v4:
- Add Heiko Schocher's reviewed-by tag.
- Fix copyright periods.
- Re-based.

Changes in v3:
- Case fold hex string.
- Revert binman part of imx8mm-verdin-u-boot.dtsi to a plain copy from
  imx8mm-evk and postpone further improvements to after migrating to a
  common binman config as agreed with Frieder and Simon.
- New patch cleaning up include order.
- Add Fabio's reviewed-by tag.
- Fix patch.
- Add missing apalis-imx8 part.
- While at it update copyright year resp. period.
- Fix closing endif comment.

Changes in v2:
- Explicitly pass filename to binman when generating binaries as
  suggested by Heiko.
- Use proper intermediate binary u-boot-spl-ddr.bin for imximage as
  pointed out by Heiko.
- Drop first patch ("imx: mkimage_fit_atf: fix legacy image generation")
  as a similar fix was already refused earlier.
- New patch allows booting recent embedded Linux BSPs.
- New patch addressing dynamic fdtfile definition.
- New patch fixing watchdog pinctrl issue.

Igor Opaniuk (1):
  verdin-imx8mm: use preboot for fdtfile evaluation

Marcel Ziswiler (6):
  imx8m: clean-up kconfig indentation
  verdin-imx8mm: fix ethernet
  ARM: dts: imx8mm-verdin: prepare for dek blob encapsulation
  verdin-imx8mm: switch to use binman to pack images
  verdin-imx8mm: clean-up include order
  verdin-imx8mm: fix watchdog pinctrl issue

Max Krummenacher (2):
  verdin-imx8mm: enable sleep_moci output
  verdin-imx8mm: drop support for v1.0 hardware

Oleksandr Suvorov (1):
  include/configs: apalis-imx8/verdin-imx8mm: rename kernel image
variable

 arch/arm/dts/imx8mm-verdin-u-boot.dtsi  | 135 +++-
 arch/arm/dts/imx8mm-verdin.dts  |  18 +++
 arch/arm/mach-imx/imx8m/Kconfig |  21 +--
 board/toradex/verdin-imx8mm/imximage.cfg|  11 +-
 board/toradex/verdin-imx8mm/verdin-imx8mm.c |  81 +---
 configs/verdin-imx8mm_defconfig |   6 +-
 doc/board/toradex/verdin-imx8mm.rst |  53 
 include/configs/apalis-imx8.h   |   6 +-
 include/configs/verdin-imx8mm.h |  10 +-
 9 files changed, 214 insertions(+), 127 deletions(-)

-- 
2.26.2



[PATCH v5 10/10] verdin-imx8mm: fix watchdog pinctrl issue

2021-10-07 Thread Marcel Ziswiler
From: Marcel Ziswiler 

Finally, found the root cause of the issue already once mentioned back
here [2] which caused the following error message during boot:

imx_wdt watchdog@3028:
 pinctrl_select_state_full: uclass_get_device_by_phandle_id: err=-19

Turns out while the watchdog node itself was already u-boot,dm-spl its
pinctrl node was not which caused it to be unavailable at that early
stage. Note that any and all other boards I checked also seem to be
missing this. However, I can't judge whether or not they might indeed
need a similar fix or not.

[2] https://marc.info/?l=u-boot=161786572422973

Fixes: commit d304e7ace3a6
 ("ARM: imx8m: Fix reset in SPL on Toradex iMX8MM Verdin")
Signed-off-by: Marcel Ziswiler 
Reviewed-by: Fabio Estevam 

---

(no changes since v2)

Changes in v2:
- New patch fixing watchdog pinctrl issue.

 arch/arm/dts/imx8mm-verdin-u-boot.dtsi | 4 
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/dts/imx8mm-verdin-u-boot.dtsi 
b/arch/arm/dts/imx8mm-verdin-u-boot.dtsi
index 0c65070cd5f..bf47930c36f 100644
--- a/arch/arm/dts/imx8mm-verdin-u-boot.dtsi
+++ b/arch/arm/dts/imx8mm-verdin-u-boot.dtsi
@@ -68,6 +68,10 @@
u-boot,dm-spl;
 };
 
+_wdog {
+   u-boot,dm-spl;
+};
+
 &{/soc@0/bus@3080/i2c@30a2/pmic} {
u-boot,dm-spl;
 };
-- 
2.26.2



[PATCH v5 04/10] verdin-imx8mm: switch to use binman to pack images

2021-10-07 Thread Marcel Ziswiler
From: Marcel Ziswiler 

Use binman to pack images.

Signed-off-by: Marcel Ziswiler 
Reviewed-by: Heiko Thiery 
Reviewed-by: Fabio Estevam 
Reviewed-by: Heiko Schocher 

---

(no changes since v4)

Changes in v4:
- Add Heiko Schocher's reviewed-by tag.
- Fix copyright periods.

Changes in v3:
- Case fold hex string.
- Revert binman part of imx8mm-verdin-u-boot.dtsi to a plain copy from
  imx8mm-evk and postpone further improvements to after migrating to a
  common binman config as agreed with Frieder and Simon.

Changes in v2:
- Explicitly pass filename to binman when generating binaries as
  suggested by Heiko.
- Use proper intermediate binary u-boot-spl-ddr.bin for imximage as
  pointed out by Heiko.

 arch/arm/dts/imx8mm-verdin-u-boot.dtsi   | 124 ++-
 arch/arm/mach-imx/imx8m/Kconfig  |   1 +
 board/toradex/verdin-imx8mm/imximage.cfg |  11 +-
 configs/verdin-imx8mm_defconfig  |   2 +-
 doc/board/toradex/verdin-imx8mm.rst  |  53 +-
 5 files changed, 157 insertions(+), 34 deletions(-)

diff --git a/arch/arm/dts/imx8mm-verdin-u-boot.dtsi 
b/arch/arm/dts/imx8mm-verdin-u-boot.dtsi
index a97626fa0c1..0c65070cd5f 100644
--- a/arch/arm/dts/imx8mm-verdin-u-boot.dtsi
+++ b/arch/arm/dts/imx8mm-verdin-u-boot.dtsi
@@ -1,11 +1,15 @@
 // SPDX-License-Identifier: GPL-2.0+ OR MIT
 /*
- * Copyright 2020 Toradex
+ * Copyright 2020-2021 Toradex
  */
 
 #include "imx8mm-u-boot.dtsi"
 
 / {
+   binman: binman {
+   multiple-images;
+   };
+
firmware {
optee {
compatible = "linaro,optee-tz";
@@ -91,3 +95,121 @@
  {
u-boot,dm-spl;
 };
+
+ {
+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 = ;
+
+   images {
+   uboot {
+   description = "U-Boot (64-bit)";
+   type = "standalone";
+   arch = "arm64";
+   compression = "none";
+   load = ;
+
+   uboot_blob: blob-ext {
+   filename = "u-boot-nodtb.bin";
+   };
+   };
+
+   atf {
+   description = "ARM Trusted Firmware";
+   type = "firmware";
+   arch = "arm64";
+   compression = "none";
+   load = <0x92>;
+   entry = <0x92>;
+
+   atf_blob: blob-ext {
+   filename = "bl31.bin";
+   };
+   };
+
+   fdt {
+   description = "NAME";
+   type = "flat_dt";
+   compression = "none";
+
+  

[PATCH v5 09/10] verdin-imx8mm: use preboot for fdtfile evaluation

2021-10-07 Thread Marcel Ziswiler
From: Igor Opaniuk 

Enable and set preboot var with fdtfile evaluation.
It will be checked and run immediately before starting the
CONFIG_BOOTDELAY countdown and/or running the auto-boot command resp.
entering interactive mode.

This provides possibility to use different boot cmds in interactive mode
without manual setting fdtfile value, as it it's already evaluated
before entering interactive mode.

Signed-off-by: Igor Opaniuk 
Signed-off-by: Marcel Ziswiler 
Reviewed-by: Fabio Estevam 

---

(no changes since v2)

Changes in v2:
- New patch addressing dynamic fdtfile definition.

 configs/verdin-imx8mm_defconfig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/configs/verdin-imx8mm_defconfig b/configs/verdin-imx8mm_defconfig
index ced0d0acc37..ed14ff3b114 100644
--- a/configs/verdin-imx8mm_defconfig
+++ b/configs/verdin-imx8mm_defconfig
@@ -26,7 +26,8 @@ CONFIG_SPL_LOAD_FIT=y
 # CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_OF_SYSTEM_SETUP=y
 # CONFIG_USE_BOOTCOMMAND is not set
-CONFIG_DEFAULT_FDT_FILE="fsl-imx8mm-verdin-dev.dtb"
+CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="setenv fdtfile imx8mm-verdin-${variant}-${fdt_board}.dtb"
 CONFIG_LOG=y
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_DISPLAY_BOARDINFO_LATE=y
-- 
2.26.2



[PATCH v5 05/10] verdin-imx8mm: enable sleep_moci output

2021-10-07 Thread Marcel Ziswiler
From: Max Krummenacher 

This powers some peripherals on the carrier board e.g. the USB hub.

Related-to: ELB-3206
Signed-off-by: Max Krummenacher 
Signed-off-by: Marcel Ziswiler 
Reviewed-by: Fabio Estevam 
---

(no changes since v1)

 arch/arm/dts/imx8mm-verdin.dts  | 18 ++
 configs/verdin-imx8mm_defconfig |  1 +
 2 files changed, 19 insertions(+)

diff --git a/arch/arm/dts/imx8mm-verdin.dts b/arch/arm/dts/imx8mm-verdin.dts
index ac2a4b69d3c..a2331627d72 100644
--- a/arch/arm/dts/imx8mm-verdin.dts
+++ b/arch/arm/dts/imx8mm-verdin.dts
@@ -196,6 +196,18 @@
};
 };
 
+ {
+   ctrl_sleep_moci {
+   gpio-hog;
+   /* Verdin CTRL_SLEEP_MOCI# (SODIMM 256) */
+   gpios = <1 GPIO_ACTIVE_HIGH>;
+   line-name = "CTRL_SLEEP_MOCI#";
+   output-high;
+   pinctrl-names = "default";
+   pinctrl-0 = <_ctrl_sleep_moci>;
+   };
+};
+
 /* On-module I2C */
  {
clock-frequency = <40>;
@@ -548,6 +560,12 @@
>;
};
 
+   pinctrl_ctrl_sleep_moci: ctrlsleepmocigrp {
+   fsl,pins = <
+   MX8MM_IOMUXC_SAI3_TXD_GPIO5_IO1 0x1c4   
/* SODIMM 256 */
+   >;
+   };
+
pinctrl_dsi_bkl_en: dsi_bkl_en {
fsl,pins = <
MX8MM_IOMUXC_NAND_CE2_B_GPIO3_IO3   0x1c4   
/* SODIMM 21 */
diff --git a/configs/verdin-imx8mm_defconfig b/configs/verdin-imx8mm_defconfig
index 1c8b505656a..ced0d0acc37 100644
--- a/configs/verdin-imx8mm_defconfig
+++ b/configs/verdin-imx8mm_defconfig
@@ -69,6 +69,7 @@ CONFIG_SPL_CLK_COMPOSITE_CCF=y
 CONFIG_CLK_COMPOSITE_CCF=y
 CONFIG_SPL_CLK_IMX8MM=y
 CONFIG_CLK_IMX8MM=y
+CONFIG_GPIO_HOG=y
 CONFIG_MXC_GPIO=y
 CONFIG_DM_I2C=y
 CONFIG_MISC=y
-- 
2.26.2



[PATCH v5 07/10] verdin-imx8mm: drop support for v1.0 hardware

2021-10-07 Thread Marcel Ziswiler
From: Max Krummenacher 

We drop support for Verdin iMX8M Mini V1.0B.

Related-to: ELB-3551
Signed-off-by: Max Krummenacher 
Signed-off-by: Marcel Ziswiler 
Reviewed-by: Fabio Estevam 

---

Changes in v5:
- Re-based on top of u-boot-imx, master yet again.

Changes in v4:
- Re-based.

Changes in v3:
- Add Fabio's reviewed-by tag.

Changes in v2:
- Drop first patch ("imx: mkimage_fit_atf: fix legacy image generation")
  as a similar fix was already refused earlier.

 board/toradex/verdin-imx8mm/verdin-imx8mm.c | 13 +
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/board/toradex/verdin-imx8mm/verdin-imx8mm.c 
b/board/toradex/verdin-imx8mm/verdin-imx8mm.c
index 71ceb26e811..c51c99b5156 100644
--- a/board/toradex/verdin-imx8mm/verdin-imx8mm.c
+++ b/board/toradex/verdin-imx8mm/verdin-imx8mm.c
@@ -9,6 +9,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -87,17 +88,13 @@ static void select_dt_from_module_version(void)
 
switch (get_pcb_revision()) {
case PCB_VERSION_1_0:
-   printf("Detected a V1.0 module\n");
-   if (is_wifi)
-   strncpy([0], "wifi", sizeof(variant));
-   else
-   strncpy([0], "nonwifi", sizeof(variant));
-   break;
+   printf("Detected a V1.0 module which is no longer supported in 
this BSP version\n");
+   hang();
default:
if (is_wifi)
-   strncpy([0], "wifi-v1.1", sizeof(variant));
+   strlcpy([0], "wifi", sizeof(variant));
else
-   strncpy([0], "nonwifi-v1.1", sizeof(variant));
+   strlcpy([0], "nonwifi", sizeof(variant));
break;
}
 
-- 
2.26.2



[PATCH v5 01/10] imx8m: clean-up kconfig indentation

2021-10-07 Thread Marcel Ziswiler
From: Marcel Ziswiler 

Replace spurious spaces with proper tabs.

Signed-off-by: Marcel Ziswiler 
Reviewed-by: Fabio Estevam 
---

(no changes since v1)

 arch/arm/mach-imx/imx8m/Kconfig | 20 ++--
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/arch/arm/mach-imx/imx8m/Kconfig b/arch/arm/mach-imx/imx8m/Kconfig
index d6b9571b373..60a29cddda1 100644
--- a/arch/arm/mach-imx/imx8m/Kconfig
+++ b/arch/arm/mach-imx/imx8m/Kconfig
@@ -25,14 +25,14 @@ config SYS_SOC
default "imx8m"
 
 choice
-   prompt  "NXP i.MX8M board select"
+   prompt "NXP i.MX8M board select"
optional
 
 config TARGET_IMX8MQ_CM
-bool "Ronetix iMX8MQ-CM SoM"
+   bool "Ronetix iMX8MQ-CM SoM"
select BINMAN
-select IMX8MQ
-select IMX8M_LPDDR4
+   select IMX8MQ
+   select IMX8M_LPDDR4
 
 config TARGET_IMX8MQ_EVK
bool "imx8mq_evk"
@@ -105,10 +105,10 @@ config TARGET_PICO_IMX8MQ
select IMX8M_LPDDR4
 
 config TARGET_VERDIN_IMX8MM
-   bool "Support Toradex Verdin iMX8M Mini module"
-   select IMX8MM
-   select SUPPORT_SPL
-   select IMX8M_LPDDR4
+   bool "Support Toradex Verdin iMX8M Mini module"
+   select IMX8MM
+   select SUPPORT_SPL
+   select IMX8M_LPDDR4
 
 config TARGET_IMX8MM_BEACON
bool "imx8mm Beacon Embedded devkit"
@@ -125,14 +125,14 @@ config TARGET_IMX8MN_BEACON
 config TARGET_PHYCORE_IMX8MM
bool "PHYTEC PHYCORE i.MX8MM"
select IMX8MM
-select SUPPORT_SPL
+   select SUPPORT_SPL
select IMX8M_LPDDR4
 
 config TARGET_PHYCORE_IMX8MP
bool "PHYTEC PHYCORE i.MX8MP"
select BINMAN
select IMX8MP
-select SUPPORT_SPL
+   select SUPPORT_SPL
select IMX8M_LPDDR4
 
 config TARGET_IMX8MM_CL_IOT_GATE
-- 
2.26.2



[PATCH v5 06/10] verdin-imx8mm: clean-up include order

2021-10-07 Thread Marcel Ziswiler
From: Marcel Ziswiler 

Alphabetically order includes.
While at it also update copyright year resp. period.

Signed-off-by: Marcel Ziswiler 
---

(no changes since v3)

Changes in v3:
- New patch cleaning up include order.

 board/toradex/verdin-imx8mm/verdin-imx8mm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/board/toradex/verdin-imx8mm/verdin-imx8mm.c 
b/board/toradex/verdin-imx8mm/verdin-imx8mm.c
index 1644f4b3081..71ceb26e811 100644
--- a/board/toradex/verdin-imx8mm/verdin-imx8mm.c
+++ b/board/toradex/verdin-imx8mm/verdin-imx8mm.c
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- * Copyright 2020 Toradex
+ * Copyright 2020-2021 Toradex
  */
 
 #include 
@@ -10,9 +10,9 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
-#include 
 
 #include "../common/tdx-cfg-block.h"
 
-- 
2.26.2



[PATCH v5 03/10] ARM: dts: imx8mm-verdin: prepare for dek blob encapsulation

2021-10-07 Thread Marcel Ziswiler
From: Marcel Ziswiler 

Prepare for DEK blob encapsulation support through "dek_blob" command.
On ARMv8, u-boot runs in non-secure, thus cannot encapsulate a DEK blob
for encrypted boot.
The DEK blob is encapsulated by OP-TEE through a trusted application
call. U-boot sends and receives the DEK and the DEK blob binaries
through OP-TEE dynamic shared memory.

To enable the DEK blob encapsulation, add to the defconfig:
CONFIG_SECURE_BOOT=y
CONFIG_FAT_WRITE=y
CONFIG_CMD_DEKBLOB=y

Taken from NXP's commit 56d2050f4028 ("imx8m: Add DEK blob encapsulation
for imx8m").

Signed-off-by: Marcel Ziswiler 
Reviewed-by: Fabio Estevam 
---

(no changes since v1)

 arch/arm/dts/imx8mm-verdin-u-boot.dtsi | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/arch/arm/dts/imx8mm-verdin-u-boot.dtsi 
b/arch/arm/dts/imx8mm-verdin-u-boot.dtsi
index 67c31c49b6c..a97626fa0c1 100644
--- a/arch/arm/dts/imx8mm-verdin-u-boot.dtsi
+++ b/arch/arm/dts/imx8mm-verdin-u-boot.dtsi
@@ -6,6 +6,13 @@
 #include "imx8mm-u-boot.dtsi"
 
 / {
+   firmware {
+   optee {
+   compatible = "linaro,optee-tz";
+   method = "smc";
+   };
+   };
+
wdt-reboot {
compatible = "wdt-reboot";
wdt = <>;
-- 
2.26.2



[PATCH v5 02/10] verdin-imx8mm: fix ethernet

2021-10-07 Thread Marcel Ziswiler
From: Marcel Ziswiler 

Turns out Microship (formerly Micrel) meanwhile integrated proper
support for the DLL setup on their KSZ9131. Unfortunately, this
conflicts with our previous board code doing that.
Fix this by getting rid of our board code and just relying on the
generic implementation relying on rgmii-id being used as phy-mode.

Fixes: commit c6df0e2ffdc4
   ("net: phy: micrel: add support for DLL setup on ksz9131")
Fixes: commit af2d3c91d877
   ("ARM: dts: imx8mm-verdin: Set PHY mode to RGMII-ID")
Signed-off-by: Marcel Ziswiler 
Reviewed-by: Fabio Estevam 

---

Changes in v5:
- Drop device tree part already done by Marek's patch.
- Add another fixes tag as his patch forgot the board code part.

 board/toradex/verdin-imx8mm/verdin-imx8mm.c | 64 -
 1 file changed, 64 deletions(-)

diff --git a/board/toradex/verdin-imx8mm/verdin-imx8mm.c 
b/board/toradex/verdin-imx8mm/verdin-imx8mm.c
index 76f4a1e209a..1644f4b3081 100644
--- a/board/toradex/verdin-imx8mm/verdin-imx8mm.c
+++ b/board/toradex/verdin-imx8mm/verdin-imx8mm.c
@@ -36,70 +36,6 @@ static int setup_fec(void)
 
return 0;
 }
-
-int board_phy_config(struct phy_device *phydev)
-{
-   int tmp;
-
-   switch (ksz9xx1_phy_get_id(phydev) & MII_KSZ9x31_SILICON_REV_MASK) {
-   case PHY_ID_KSZ9031:
-   /*
-* The PHY adds 1.2ns for the RXC and 0ns for TXC clock by
-* default. The MAC and the layout don't add a skew between
-* clock and data.
-* Add 0.3ns for the RXC path and 0.96 + 0.42 ns (1.38 ns) for
-* the TXC path to get the required clock skews.
-*/
-   /* control data pad skew - devaddr = 0x02, register = 0x04 */
-   ksz9031_phy_extended_write(phydev, 0x02,
-  MII_KSZ9031_EXT_RGMII_CTRL_SIG_SKEW,
-  MII_KSZ9031_MOD_DATA_NO_POST_INC,
-  0x0070);
-   /* rx data pad skew - devaddr = 0x02, register = 0x05 */
-   ksz9031_phy_extended_write(phydev, 0x02,
-  MII_KSZ9031_EXT_RGMII_RX_DATA_SKEW,
-  MII_KSZ9031_MOD_DATA_NO_POST_INC,
-  0x);
-   /* tx data pad skew - devaddr = 0x02, register = 0x06 */
-   ksz9031_phy_extended_write(phydev, 0x02,
-  MII_KSZ9031_EXT_RGMII_TX_DATA_SKEW,
-  MII_KSZ9031_MOD_DATA_NO_POST_INC,
-  0x);
-   /* gtx and rx clock pad skew - devaddr = 0x02,register = 0x08 */
-   ksz9031_phy_extended_write(phydev, 0x02,
-  MII_KSZ9031_EXT_RGMII_CLOCK_SKEW,
-  MII_KSZ9031_MOD_DATA_NO_POST_INC,
-  0x03f4);
-   break;
-   case PHY_ID_KSZ9131:
-   default:
-   /* read rxc dll control - devaddr = 0x2, register = 0x4c */
-   tmp = ksz9031_phy_extended_read(phydev, 0x02,
-   MII_KSZ9131_EXT_RGMII_2NS_SKEW_RXDLL,
-   MII_KSZ9031_MOD_DATA_NO_POST_INC);
-   /* disable rxdll bypass (enable 2ns skew delay on RXC) */
-   tmp &= ~MII_KSZ9131_RXTXDLL_BYPASS;
-   /* rxc data pad skew 2ns - devaddr = 0x02, register = 0x4c */
-   tmp = ksz9031_phy_extended_write(phydev, 0x02,
-   MII_KSZ9131_EXT_RGMII_2NS_SKEW_RXDLL,
-   MII_KSZ9031_MOD_DATA_NO_POST_INC, tmp);
-   /* read txc dll control - devaddr = 0x02, register = 0x4d */
-   tmp = ksz9031_phy_extended_read(phydev, 0x02,
-   MII_KSZ9131_EXT_RGMII_2NS_SKEW_TXDLL,
-   MII_KSZ9031_MOD_DATA_NO_POST_INC);
-   /* disable txdll bypass (enable 2ns skew delay on TXC) */
-   tmp &= ~MII_KSZ9131_RXTXDLL_BYPASS;
-   /* rxc data pad skew 2ns - devaddr = 0x02, register = 0x4d */
-   tmp = ksz9031_phy_extended_write(phydev, 0x02,
-   MII_KSZ9131_EXT_RGMII_2NS_SKEW_TXDLL,
-   MII_KSZ9031_MOD_DATA_NO_POST_INC, tmp);
-   break;
-   }
-
-   if (phydev->drv->config)
-   phydev->drv->config(phydev);
-   return 0;
-}
 #endif
 
 int board_init(void)
-- 
2.26.2



Re: [PATCH] ARM: dts: imx8mm-verdin: Set PHY mode to RGMII-ID

2021-10-07 Thread Marcel Ziswiler
On Thu, 2021-10-07 at 23:56 +, Marcel Ziswiler wrote:
> On Thu, 2021-10-07 at 16:12 +0200, sba...@denx.de wrote:
> > > Since c6df0e2ffdc ("net: phy: micrel: add support for DLL setup on 
> > > ksz9131")
> > > the Micrel PHY driver correctly configures the delay register. The Verdin 
> > > PHY
> > > is RGMII-ID, so reflect that in DT, otherwise the ethernet no longer 
> > > works.
> > > Signed-off-by: Marek Vasut 
> > > Cc: Marcel Ziswiler 
> > > Cc: Max Krummenacher 
> > > Cc: Oleksandr Suvorov 
> > Applied to u-boot-imx, master, thanks !
> 
> No, remember, you should not have picked that one but rather my patch series 
> instead!

Okay, let me send a v5 of my patch series re-based on top of this now with 
another fixes tag (;-p).

> > Best regards,
> > Stefano Babic


Re: [PATCH] ARM: dts: imx8mm-verdin: Set PHY mode to RGMII-ID

2021-10-07 Thread Marcel Ziswiler
On Thu, 2021-10-07 at 16:12 +0200, sba...@denx.de wrote:
> > Since c6df0e2ffdc ("net: phy: micrel: add support for DLL setup on ksz9131")
> > the Micrel PHY driver correctly configures the delay register. The Verdin 
> > PHY
> > is RGMII-ID, so reflect that in DT, otherwise the ethernet no longer works.
> > Signed-off-by: Marek Vasut 
> > Cc: Marcel Ziswiler 
> > Cc: Max Krummenacher 
> > Cc: Oleksandr Suvorov 
> Applied to u-boot-imx, master, thanks !

No, remember, you should not have picked that one but rather my patch series 
instead!

> Best regards,
> Stefano Babic


Re: [PATCH v4 04/10] verdin-imx8mm: switch to use binman to pack images

2021-10-07 Thread Marcel Ziswiler
Hi Simon

On Wed, 2021-10-06 at 20:18 -0600, Simon Glass wrote:
> ...
> Nice clean-up!

Thanks!

> Reviewed-by: Simon Glass 
> 
> Option below.
> 
> > 
> > diff --git a/arch/arm/dts/imx8mm-verdin-u-boot.dtsi 
> > b/arch/arm/dts/imx8mm-verdin-u-boot.dtsi
> > index a97626fa0c1..0c65070cd5f 100644
> > --- a/arch/arm/dts/imx8mm-verdin-u-boot.dtsi
> > +++ b/arch/arm/dts/imx8mm-verdin-u-boot.dtsi
> > @@ -1,11 +1,15 @@
> >  // SPDX-License-Identifier: GPL-2.0+ OR MIT
> >  /*
> > - * Copyright 2020 Toradex
> > + * Copyright 2020-2021 Toradex
> >   */
> > 
> >  #include "imx8mm-u-boot.dtsi"
> > 
> >  / {
> > +   binman: binman {
> > +   multiple-images;
> > +   };
> > +
> >     firmware {
> >     optee {
> >     compatible = "linaro,optee-tz";
> > @@ -91,3 +95,121 @@
> >   {
> >     u-boot,dm-spl;
> >  };
> > +
> > + {
> > +    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>;
> > +   };
> 
> You can use the 'type' if you like, so you don't need the @:
> 
> blob_1: 1d-imem {
>     type = "blob-ext";
>     filename = "...";
>     ...

Yeah, remember, we agreed on doing such further clean-up in a separate step 
once we migrated towards using a
common binman configuration [1]. I am about to send out a v2 thereof.

[1] https://marc.info/?l=u-boot=162998010613817

> Regards,
> Simon

Cheers

Marcel


Re: [PATCH v2] imx8mm_venice: switch to use binman to pack images

2021-10-07 Thread Marcel Ziswiler
On Thu, 2021-10-07 at 10:26 -0700, Tim Harvey wrote:
> ...
> Marvell,

(;-p)

> Indeed that patch resolves the issue - thanks for reminding me that
> hasn't made it in yet!

You are very welcome. Yeah, I hope somebody starts pulling that stuff (and 
everything else still in-flight)
soon. As it currently still is one big disaster!

> Best regards,
> 
> Tim


Re: [PATCH v2] imx8mm_venice: switch to use binman to pack images

2021-10-07 Thread Marcel Ziswiler
Hi Tim

On Thu, 2021-10-07 at 08:52 -0700, Tim Harvey wrote:
> )On Wed, Oct 6, 2021 at 2:44 PM Marcel Ziswiler  wrote:
> > 
> > On Wed, 2021-10-06 at 13:17 -0700, Tim Harvey wrote:
> > > Use binman to pack images.
> > > 
> > > Note that imx8mm_venice supports several boards via multiple DTB's thus
> > > in the fit node we must use:
> > > - fit,fdt-list = "of-list"
> > > - fdt-SEQ
> > > - config-SEQ
> > > 
> > > Signed-off-by: Tim Harvey 
> > 
> > Reviewed-by: Marcel Ziswiler 
> > 
> > > ---
> > > v2:
> > >  - rebase on origin/mater
> > 
> > You probably meant master (;-p).
> > 
> > Rest look legit.
> 
> Marcel,
> 
> Thanks for the review. I will submit a v3 as I forgot to include a few
> other patches required for this that I had in v1 (using a common
> u-boot.dtsi file)
> 
> I am seeing 'WARNING 'u-boot-spl-ddr.bin' not found, resulting binary
> is not-functional' until I do a 'make' a second time so there is some
> sort of race condition with the binman blobs.

Yes, remember, this still needs Peng's Makefile fix [1] as otherwise, it may 
not quite generate all binman
artefacts in the right order as discussed here [2].

[1] https://marc.info/?l=u-boot=162908373904742
[2] https://marc.info/?l=u-boot=162945614207220

Cheers

Marcel


Re: [RFC PATCH v1 0/5] arm64: dts: imx8mm: add common -binman.dtsi and further clean-up

2021-10-06 Thread Marcel Ziswiler
On Thu, 2021-09-02 at 14:08 -0300, Fabio Estevam wrote:
> Hi Marcel,
> 
> On Thu, Aug 26, 2021 at 9:14 AM Marcel Ziswiler  wrote:
> > 
> > From: Marcel Ziswiler 
> > 
> > 
> > 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.
> > 
> > The initial patch fixes an issue with intermediate binary naming for the
> > imx8mm-cl-iot-gate. And subsequent patches further clean up that dtsi.
> > 
> > This series is based on Peng's binman conversion of late [1], my Verdin
> > iMX8M Mini target refresh [2], Fabio's generating a single bootable
> > flash.bin again for imx8mm-evk [3], Tim's switching imx8mm_venice to
> > using binman to pack images [4] and Frieder's support for Kontron
> > Electronics i.MX6UL/ULL and i.MX8MM SoMs [5].
> > 
> > This series has been run-time tested on Verdin iMX8M Mini. The other
> > targets were only compile tested.
> > 
> > Please note that for now, I left out the following intricacies of
> > imx8mm-venice-u-boot.dtsi. Not quite sure what exactly those are used
> > for.
> 
> The series looks good.

Thanks!

> We just need to find a way to not break imx8mm-venice.

Yep, yep. I cleaned that up now and will send a v2 shortly.

BTW: Now with 2021.10 released I hope somebody will pick up all my in-flight 
patch sets soon (;-p).

> Thanks


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

2021-10-06 Thread Marcel Ziswiler
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  node override.
> 
> Best regards,
> 
> Tim

Cheers

Marcel


Re: [PATCH v2] imx8mm_venice: switch to use binman to pack images

2021-10-06 Thread Marcel Ziswiler
On Wed, 2021-10-06 at 13:17 -0700, Tim Harvey wrote:
> Use binman to pack images.
> 
> Note that imx8mm_venice supports several boards via multiple DTB's thus
> in the fit node we must use:
> - fit,fdt-list = "of-list"
> - fdt-SEQ
> - config-SEQ
> 
> Signed-off-by: Tim Harvey 

Reviewed-by: Marcel Ziswiler 

> ---
> v2:
>  - rebase on origin/mater

You probably meant master (;-p).

Rest look legit.

>  - remove ATF_LOAD_ADDR from README as its no longer needed
> ---
>  arch/arm/dts/imx8mm-venice-u-boot.dtsi    | 119 ++
>  arch/arm/mach-imx/imx8m/Kconfig   |   1 +
>  board/gateworks/venice/Kconfig    |   3 +-
>  board/gateworks/venice/README |   2 +-
>  .../gateworks/venice/imximage-8mm-lpddr4.cfg  |   9 ++
>  configs/imx8mm_venice_defconfig   |   4 +-
>  6 files changed, 133 insertions(+), 5 deletions(-)
>  create mode 100644 board/gateworks/venice/imximage-8mm-lpddr4.cfg
> 
> diff --git a/arch/arm/dts/imx8mm-venice-u-boot.dtsi 
> b/arch/arm/dts/imx8mm-venice-u-boot.dtsi
> index 42b2903f04..e0fa9ff4bf 100644
> --- a/arch/arm/dts/imx8mm-venice-u-boot.dtsi
> +++ b/arch/arm/dts/imx8mm-venice-u-boot.dtsi
> @@ -6,6 +6,10 @@
>  #include "imx8mm-u-boot.dtsi"
>  
>  / {
> +   binman: binman {
> +   multiple-images;
> +   };
> +
> wdt-reboot {
> compatible = "wdt-reboot";
> wdt = <>;
> @@ -68,3 +72,118 @@
>   {
> u-boot,dm-spl;
>  };
> +
> + {
> +    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 = ;
> +   fit,fdt-list = "of-list";
> +
> +   images {
> +   uboot {
> +   description = "U-Boot (64-bit)";
> +   type = "standalone";
> +   arch = "arm64";
> +   compression = "none";
> +   load = ;
> +
> +   uboot_blob: blob-ext {
> +   filename = "u-boot-nodtb.bin";
> +   };
> +   };
> +
> +   atf {
> +   description = "ARM Trusted Firmware";
> +   type = "firmware";
> +   arch = "arm64";
> +   compression = "none";
> +   load = <0x92>;
> +   entry = <0x92>;
> +
> +   atf_blob: blob-ext {
> +  

[PATCH v4 10/10] verdin-imx8mm: fix watchdog pinctrl issue

2021-10-06 Thread Marcel Ziswiler
From: Marcel Ziswiler 

Finally, found the root cause of the issue already once mentioned back
here [2] which caused the following error message during boot:

imx_wdt watchdog@3028:
 pinctrl_select_state_full: uclass_get_device_by_phandle_id: err=-19

Turns out while the watchdog node itself was already u-boot,dm-spl its
pinctrl node was not which caused it to be unavailable at that early
stage. Note that any and all other boards I checked also seem to be
missing this. However, I can't judge whether or not they might indeed
need a similar fix or not.

[2] https://marc.info/?l=u-boot=161786572422973

Fixes: commit d304e7ace3a6
 ("ARM: imx8m: Fix reset in SPL on Toradex iMX8MM Verdin")
Signed-off-by: Marcel Ziswiler 
Reviewed-by: Fabio Estevam 

---

(no changes since v2)

Changes in v2:
- New patch fixing watchdog pinctrl issue.

 arch/arm/dts/imx8mm-verdin-u-boot.dtsi | 4 
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/dts/imx8mm-verdin-u-boot.dtsi 
b/arch/arm/dts/imx8mm-verdin-u-boot.dtsi
index 0c65070cd5f..bf47930c36f 100644
--- a/arch/arm/dts/imx8mm-verdin-u-boot.dtsi
+++ b/arch/arm/dts/imx8mm-verdin-u-boot.dtsi
@@ -68,6 +68,10 @@
u-boot,dm-spl;
 };
 
+_wdog {
+   u-boot,dm-spl;
+};
+
 &{/soc@0/bus@3080/i2c@30a2/pmic} {
u-boot,dm-spl;
 };
-- 
2.26.2



[PATCH v4 00/10] board: toradex: verdin-imx8mm: target refresh

2021-10-06 Thread Marcel Ziswiler
From: Marcel Ziswiler 


An assortment of fixes and improvements like an Ethernet PHY
configuration fix, DEK blob encapsulation preparation, migration to
using binman to pack images, SLEEP_MOCI# enablement, dropping of V1.0
hardware support [1], renaming kernel image variable, using preboot
for fdtfile evaluation and watchdog pinctrl fix.

Note that this series is applied on top of Peng's Makefile fix [2] as
otherwise, it may not quite generate all binman artefacts in the right
order as discussed here [3].

[1] https://developer.toradex.com/verdin-sample-phase-over
[2] https://marc.info/?l=u-boot=162908373904742
[3] https://marc.info/?l=u-boot=162945614207220

Changes in v4:
- Add Heiko Schocher's reviewed-by tag.
- Fix copyright periods.
- Re-based.

Changes in v3:
- Case fold hex string.
- Revert binman part of imx8mm-verdin-u-boot.dtsi to a plain copy from
  imx8mm-evk and postpone further improvements to after migrating to a
  common binman config as agreed with Frieder and Simon.
- New patch cleaning up include order.
- Add Fabio's reviewed-by tag.
- Fix patch.
- Add missing apalis-imx8 part.
- While at it update copyright year resp. period.
- Fix closing endif comment.

Changes in v2:
- Explicitly pass filename to binman when generating binaries as
  suggested by Heiko.
- Use proper intermediate binary u-boot-spl-ddr.bin for imximage as
  pointed out by Heiko.
- Drop first patch ("imx: mkimage_fit_atf: fix legacy image generation")
  as a similar fix was already refused earlier.
- New patch allows booting recent embedded Linux BSPs.
- New patch addressing dynamic fdtfile definition.
- New patch fixing watchdog pinctrl issue.

Igor Opaniuk (1):
  verdin-imx8mm: use preboot for fdtfile evaluation

Marcel Ziswiler (6):
  imx8m: clean-up kconfig indentation
  verdin-imx8mm: fix ethernet
  ARM: dts: imx8mm-verdin: prepare for dek blob encapsulation
  verdin-imx8mm: switch to use binman to pack images
  verdin-imx8mm: clean-up include order
  verdin-imx8mm: fix watchdog pinctrl issue

Max Krummenacher (2):
  verdin-imx8mm: enable sleep_moci output
  verdin-imx8mm: drop support for v1.0 hardware

Oleksandr Suvorov (1):
  include/configs: apalis-imx8/verdin-imx8mm: rename kernel image
variable

 arch/arm/dts/imx8mm-verdin-u-boot.dtsi  | 135 +++-
 arch/arm/dts/imx8mm-verdin.dts  |  20 ++-
 arch/arm/mach-imx/imx8m/Kconfig |  21 +--
 board/toradex/verdin-imx8mm/imximage.cfg|  11 +-
 board/toradex/verdin-imx8mm/verdin-imx8mm.c |  81 +---
 configs/verdin-imx8mm_defconfig |   6 +-
 doc/board/toradex/verdin-imx8mm.rst |  53 
 include/configs/apalis-imx8.h   |   6 +-
 include/configs/verdin-imx8mm.h |  10 +-
 9 files changed, 215 insertions(+), 128 deletions(-)

-- 
2.26.2



[PATCH v4 08/10] include/configs: apalis-imx8/verdin-imx8mm: rename kernel image variable

2021-10-06 Thread Marcel Ziswiler
From: Oleksandr Suvorov 

Variable "kernel_image" is used in boot.scr script only, that sets its
own default value to the constant string @@KERNEL_IMAGETYPE@@ in case
"kernel_image" is not set.
The default name of the kernel image shipped with BSP 5.x is "Image.gz".
Setting kernel_image="Image" as a pre-defined u-boot variable
breaks booting systems with modern versions of boot.scr, whereas
renaming it fixes booting with modern scripts and does not break working
of earlier versions of boot.scr.

Signed-off-by: Oleksandr Suvorov 
Signed-off-by: Marcel Ziswiler 
Reviewed-by: Fabio Estevam 

---

(no changes since v3)

Changes in v3:
- Fix patch.
- Add missing apalis-imx8 part.
- While at it update copyright year resp. period.
- Fix closing endif comment.

Changes in v2:
- New patch allows booting recent embedded Linux BSPs.

 include/configs/apalis-imx8.h   |  6 +++---
 include/configs/verdin-imx8mm.h | 10 +-
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/include/configs/apalis-imx8.h b/include/configs/apalis-imx8.h
index 80594548877..ce5681499c9 100644
--- a/include/configs/apalis-imx8.h
+++ b/include/configs/apalis-imx8.h
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
 /*
- * Copyright 2019 Toradex
+ * Copyright 2019-2021 Toradex
  */
 
 #ifndef __APALIS_IMX8_H
@@ -42,12 +42,12 @@
 #define CONFIG_EXTRA_ENV_SETTINGS \
BOOTENV \
MEM_LAYOUT_ENV_SETTINGS \
+   "boot_file=Image\0" \
"console=ttyLP1 earlycon\0" \
"fdt_addr=0x8300\0" \
"fdt_file=fsl-imx8qm-apalis-eval.dtb\0" \
"fdtfile=fsl-imx8qm-apalis-eval.dtb\0" \
"finduuid=part uuid mmc ${mmcdev}:2 uuid\0" \
-   "image=Image\0" \
"initrd_addr=0x8380\0" \
"initrd_high=0x\0" \
"mmcargs=setenv bootargs console=${console},${baudrate} " \
@@ -57,7 +57,7 @@
"netargs=setenv bootargs console=${console},${baudrate} " \
"root=/dev/nfs ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp" \
"\0" \
-   "nfsboot=run netargs; dhcp ${loadaddr} ${image}; tftp ${fdt_addr} " \
+   "nfsboot=run netargs; dhcp ${loadaddr} ${boot_file}; tftp ${fdt_addr} " 
\
"apalis-imx8/${fdt_file}; booti ${loadaddr} - ${fdt_addr}\0" \
"panel=NULL\0" \
"script=boot.scr\0" \
diff --git a/include/configs/verdin-imx8mm.h b/include/configs/verdin-imx8mm.h
index 50c808383db..693fd6907eb 100644
--- a/include/configs/verdin-imx8mm.h
+++ b/include/configs/verdin-imx8mm.h
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
 /*
- * Copyright 2020 Toradex
+ * Copyright 2020-2021 Toradex
  */
 
 #ifndef __VERDIN_IMX8MM_H
@@ -54,16 +54,16 @@
BOOTENV \
MEM_LAYOUT_ENV_SETTINGS \
"bootcmd_mfg=fastboot 0\0" \
+   "boot_file=Image\0" \
"console=ttymxc0\0" \
"fdt_addr=0x4300\0" \
-   "fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \
+   "fdt_board=dev\0" \
"initrd_addr=0x4380\0" \
"initrd_high=0x\0" \
-   "kernel_image=Image\0" \
"netargs=setenv bootargs console=${console},${baudrate} " \
"root=/dev/nfs ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp" \
"\0" \
-   "nfsboot=run netargs; dhcp ${loadaddr} ${kernel_image}; " \
+   "nfsboot=run netargs; dhcp ${loadaddr} ${boot_file}; " \
"tftp ${fdt_addr} verdin/${fdtfile}; " \
"booti ${loadaddr} - ${fdt_addr}\0" \
"setup=setenv setupargs console=${console},${baudrate} " \
@@ -118,4 +118,4 @@
 #define CONFIG_MXC_USB_PORTSC  (PORT_PTS_UTMI | PORT_PTS_PTW)
 #define CONFIG_USB_MAX_CONTROLLER_COUNT 2
 
-#endif /*_VERDIN_IMX8MM_H */
+#endif /* __VERDIN_IMX8MM_H */
-- 
2.26.2



[PATCH v4 09/10] verdin-imx8mm: use preboot for fdtfile evaluation

2021-10-06 Thread Marcel Ziswiler
From: Igor Opaniuk 

Enable and set preboot var with fdtfile evaluation.
It will be checked and run immediately before starting the
CONFIG_BOOTDELAY countdown and/or running the auto-boot command resp.
entering interactive mode.

This provides possibility to use different boot cmds in interactive mode
without manual setting fdtfile value, as it it's already evaluated
before entering interactive mode.

Signed-off-by: Igor Opaniuk 
Signed-off-by: Marcel Ziswiler 
Reviewed-by: Fabio Estevam 

---

(no changes since v2)

Changes in v2:
- New patch addressing dynamic fdtfile definition.

 configs/verdin-imx8mm_defconfig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/configs/verdin-imx8mm_defconfig b/configs/verdin-imx8mm_defconfig
index ced0d0acc37..ed14ff3b114 100644
--- a/configs/verdin-imx8mm_defconfig
+++ b/configs/verdin-imx8mm_defconfig
@@ -26,7 +26,8 @@ CONFIG_SPL_LOAD_FIT=y
 # CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_OF_SYSTEM_SETUP=y
 # CONFIG_USE_BOOTCOMMAND is not set
-CONFIG_DEFAULT_FDT_FILE="fsl-imx8mm-verdin-dev.dtb"
+CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="setenv fdtfile imx8mm-verdin-${variant}-${fdt_board}.dtb"
 CONFIG_LOG=y
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_DISPLAY_BOARDINFO_LATE=y
-- 
2.26.2



[PATCH v4 07/10] verdin-imx8mm: drop support for v1.0 hardware

2021-10-06 Thread Marcel Ziswiler
From: Max Krummenacher 

We drop support for Verdin iMX8M Mini V1.0B.

Related-to: ELB-3551
Signed-off-by: Max Krummenacher 
Signed-off-by: Marcel Ziswiler 
Reviewed-by: Fabio Estevam 

---

Changes in v4:
- Re-based.

Changes in v3:
- Add Fabio's reviewed-by tag.

Changes in v2:
- Drop first patch ("imx: mkimage_fit_atf: fix legacy image generation")
  as a similar fix was already refused earlier.

 board/toradex/verdin-imx8mm/verdin-imx8mm.c | 13 +
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/board/toradex/verdin-imx8mm/verdin-imx8mm.c 
b/board/toradex/verdin-imx8mm/verdin-imx8mm.c
index 71ceb26e811..c51c99b5156 100644
--- a/board/toradex/verdin-imx8mm/verdin-imx8mm.c
+++ b/board/toradex/verdin-imx8mm/verdin-imx8mm.c
@@ -9,6 +9,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -87,17 +88,13 @@ static void select_dt_from_module_version(void)
 
switch (get_pcb_revision()) {
case PCB_VERSION_1_0:
-   printf("Detected a V1.0 module\n");
-   if (is_wifi)
-   strncpy([0], "wifi", sizeof(variant));
-   else
-   strncpy([0], "nonwifi", sizeof(variant));
-   break;
+   printf("Detected a V1.0 module which is no longer supported in 
this BSP version\n");
+   hang();
default:
if (is_wifi)
-   strncpy([0], "wifi-v1.1", sizeof(variant));
+   strlcpy([0], "wifi", sizeof(variant));
else
-   strncpy([0], "nonwifi-v1.1", sizeof(variant));
+   strlcpy([0], "nonwifi", sizeof(variant));
break;
}
 
-- 
2.26.2



[PATCH v4 04/10] verdin-imx8mm: switch to use binman to pack images

2021-10-06 Thread Marcel Ziswiler
From: Marcel Ziswiler 

Use binman to pack images.

Signed-off-by: Marcel Ziswiler 
Reviewed-by: Heiko Thiery 
Reviewed-by: Fabio Estevam 
Reviewed-by: Heiko Schocher 

---

Changes in v4:
- Add Heiko Schocher's reviewed-by tag.
- Fix copyright periods.

Changes in v3:
- Case fold hex string.
- Revert binman part of imx8mm-verdin-u-boot.dtsi to a plain copy from
  imx8mm-evk and postpone further improvements to after migrating to a
  common binman config as agreed with Frieder and Simon.

Changes in v2:
- Explicitly pass filename to binman when generating binaries as
  suggested by Heiko.
- Use proper intermediate binary u-boot-spl-ddr.bin for imximage as
  pointed out by Heiko.

 arch/arm/dts/imx8mm-verdin-u-boot.dtsi   | 124 ++-
 arch/arm/mach-imx/imx8m/Kconfig  |   1 +
 board/toradex/verdin-imx8mm/imximage.cfg |  11 +-
 configs/verdin-imx8mm_defconfig  |   2 +-
 doc/board/toradex/verdin-imx8mm.rst  |  53 +-
 5 files changed, 157 insertions(+), 34 deletions(-)

diff --git a/arch/arm/dts/imx8mm-verdin-u-boot.dtsi 
b/arch/arm/dts/imx8mm-verdin-u-boot.dtsi
index a97626fa0c1..0c65070cd5f 100644
--- a/arch/arm/dts/imx8mm-verdin-u-boot.dtsi
+++ b/arch/arm/dts/imx8mm-verdin-u-boot.dtsi
@@ -1,11 +1,15 @@
 // SPDX-License-Identifier: GPL-2.0+ OR MIT
 /*
- * Copyright 2020 Toradex
+ * Copyright 2020-2021 Toradex
  */
 
 #include "imx8mm-u-boot.dtsi"
 
 / {
+   binman: binman {
+   multiple-images;
+   };
+
firmware {
optee {
compatible = "linaro,optee-tz";
@@ -91,3 +95,121 @@
  {
u-boot,dm-spl;
 };
+
+ {
+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 = ;
+
+   images {
+   uboot {
+   description = "U-Boot (64-bit)";
+   type = "standalone";
+   arch = "arm64";
+   compression = "none";
+   load = ;
+
+   uboot_blob: blob-ext {
+   filename = "u-boot-nodtb.bin";
+   };
+   };
+
+   atf {
+   description = "ARM Trusted Firmware";
+   type = "firmware";
+   arch = "arm64";
+   compression = "none";
+   load = <0x92>;
+   entry = <0x92>;
+
+   atf_blob: blob-ext {
+   filename = "bl31.bin";
+   };
+   };
+
+   fdt {
+   description = "NAME";
+   type = "flat_dt";
+   compression = "none";
+
+   uboot_fdt_blob: blob

[PATCH v4 05/10] verdin-imx8mm: enable sleep_moci output

2021-10-06 Thread Marcel Ziswiler
From: Max Krummenacher 

This powers some peripherals on the carrier board e.g. the USB hub.

Related-to: ELB-3206
Signed-off-by: Max Krummenacher 
Signed-off-by: Marcel Ziswiler 
Reviewed-by: Fabio Estevam 
---

(no changes since v1)

 arch/arm/dts/imx8mm-verdin.dts  | 18 ++
 configs/verdin-imx8mm_defconfig |  1 +
 2 files changed, 19 insertions(+)

diff --git a/arch/arm/dts/imx8mm-verdin.dts b/arch/arm/dts/imx8mm-verdin.dts
index ac2a4b69d3c..a2331627d72 100644
--- a/arch/arm/dts/imx8mm-verdin.dts
+++ b/arch/arm/dts/imx8mm-verdin.dts
@@ -196,6 +196,18 @@
};
 };
 
+ {
+   ctrl_sleep_moci {
+   gpio-hog;
+   /* Verdin CTRL_SLEEP_MOCI# (SODIMM 256) */
+   gpios = <1 GPIO_ACTIVE_HIGH>;
+   line-name = "CTRL_SLEEP_MOCI#";
+   output-high;
+   pinctrl-names = "default";
+   pinctrl-0 = <_ctrl_sleep_moci>;
+   };
+};
+
 /* On-module I2C */
  {
clock-frequency = <40>;
@@ -548,6 +560,12 @@
>;
};
 
+   pinctrl_ctrl_sleep_moci: ctrlsleepmocigrp {
+   fsl,pins = <
+   MX8MM_IOMUXC_SAI3_TXD_GPIO5_IO1 0x1c4   
/* SODIMM 256 */
+   >;
+   };
+
pinctrl_dsi_bkl_en: dsi_bkl_en {
fsl,pins = <
MX8MM_IOMUXC_NAND_CE2_B_GPIO3_IO3   0x1c4   
/* SODIMM 21 */
diff --git a/configs/verdin-imx8mm_defconfig b/configs/verdin-imx8mm_defconfig
index 1c8b505656a..ced0d0acc37 100644
--- a/configs/verdin-imx8mm_defconfig
+++ b/configs/verdin-imx8mm_defconfig
@@ -69,6 +69,7 @@ CONFIG_SPL_CLK_COMPOSITE_CCF=y
 CONFIG_CLK_COMPOSITE_CCF=y
 CONFIG_SPL_CLK_IMX8MM=y
 CONFIG_CLK_IMX8MM=y
+CONFIG_GPIO_HOG=y
 CONFIG_MXC_GPIO=y
 CONFIG_DM_I2C=y
 CONFIG_MISC=y
-- 
2.26.2



[PATCH v4 03/10] ARM: dts: imx8mm-verdin: prepare for dek blob encapsulation

2021-10-06 Thread Marcel Ziswiler
From: Marcel Ziswiler 

Prepare for DEK blob encapsulation support through "dek_blob" command.
On ARMv8, u-boot runs in non-secure, thus cannot encapsulate a DEK blob
for encrypted boot.
The DEK blob is encapsulated by OP-TEE through a trusted application
call. U-boot sends and receives the DEK and the DEK blob binaries
through OP-TEE dynamic shared memory.

To enable the DEK blob encapsulation, add to the defconfig:
CONFIG_SECURE_BOOT=y
CONFIG_FAT_WRITE=y
CONFIG_CMD_DEKBLOB=y

Taken from NXP's commit 56d2050f4028 ("imx8m: Add DEK blob encapsulation
for imx8m").

Signed-off-by: Marcel Ziswiler 
Reviewed-by: Fabio Estevam 
---

(no changes since v1)

 arch/arm/dts/imx8mm-verdin-u-boot.dtsi | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/arch/arm/dts/imx8mm-verdin-u-boot.dtsi 
b/arch/arm/dts/imx8mm-verdin-u-boot.dtsi
index 67c31c49b6c..a97626fa0c1 100644
--- a/arch/arm/dts/imx8mm-verdin-u-boot.dtsi
+++ b/arch/arm/dts/imx8mm-verdin-u-boot.dtsi
@@ -6,6 +6,13 @@
 #include "imx8mm-u-boot.dtsi"
 
 / {
+   firmware {
+   optee {
+   compatible = "linaro,optee-tz";
+   method = "smc";
+   };
+   };
+
wdt-reboot {
compatible = "wdt-reboot";
wdt = <>;
-- 
2.26.2



[PATCH v4 06/10] verdin-imx8mm: clean-up include order

2021-10-06 Thread Marcel Ziswiler
From: Marcel Ziswiler 

Alphabetically order includes.
While at it also update copyright year resp. period.

Signed-off-by: Marcel Ziswiler 
---

(no changes since v3)

Changes in v3:
- New patch cleaning up include order.

 board/toradex/verdin-imx8mm/verdin-imx8mm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/board/toradex/verdin-imx8mm/verdin-imx8mm.c 
b/board/toradex/verdin-imx8mm/verdin-imx8mm.c
index 1644f4b3081..71ceb26e811 100644
--- a/board/toradex/verdin-imx8mm/verdin-imx8mm.c
+++ b/board/toradex/verdin-imx8mm/verdin-imx8mm.c
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- * Copyright 2020 Toradex
+ * Copyright 2020-2021 Toradex
  */
 
 #include 
@@ -10,9 +10,9 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
-#include 
 
 #include "../common/tdx-cfg-block.h"
 
-- 
2.26.2



[PATCH v4 02/10] verdin-imx8mm: fix ethernet

2021-10-06 Thread Marcel Ziswiler
From: Marcel Ziswiler 

Turns out Microship (formerly Micrel) meanwhile integrated proper
support for the DLL setup on their KSZ9131. Unfortunately, this
conflicts with our previous board code doing that.
Fix this by getting rid of our board code and just relying on the
generic implementation relying on rgmii-id being used as phy-mode.

Fixes: commit c6df0e2ffdc4
   ("net: phy: micrel: add support for DLL setup on ksz9131")
Signed-off-by: Marcel Ziswiler 
Reviewed-by: Fabio Estevam 
---

(no changes since v1)

 arch/arm/dts/imx8mm-verdin.dts  |  2 +-
 board/toradex/verdin-imx8mm/verdin-imx8mm.c | 64 -
 2 files changed, 1 insertion(+), 65 deletions(-)

diff --git a/arch/arm/dts/imx8mm-verdin.dts b/arch/arm/dts/imx8mm-verdin.dts
index fb0756d6e19..ac2a4b69d3c 100644
--- a/arch/arm/dts/imx8mm-verdin.dts
+++ b/arch/arm/dts/imx8mm-verdin.dts
@@ -160,7 +160,7 @@
  {
fsl,magic-packet;
phy-handle = <>;
-   phy-mode = "rgmii";
+   phy-mode = "rgmii-id";
phy-supply = <_ethphy>;
pinctrl-names = "default", "sleep";
pinctrl-0 = <_fec1>;
diff --git a/board/toradex/verdin-imx8mm/verdin-imx8mm.c 
b/board/toradex/verdin-imx8mm/verdin-imx8mm.c
index 76f4a1e209a..1644f4b3081 100644
--- a/board/toradex/verdin-imx8mm/verdin-imx8mm.c
+++ b/board/toradex/verdin-imx8mm/verdin-imx8mm.c
@@ -36,70 +36,6 @@ static int setup_fec(void)
 
return 0;
 }
-
-int board_phy_config(struct phy_device *phydev)
-{
-   int tmp;
-
-   switch (ksz9xx1_phy_get_id(phydev) & MII_KSZ9x31_SILICON_REV_MASK) {
-   case PHY_ID_KSZ9031:
-   /*
-* The PHY adds 1.2ns for the RXC and 0ns for TXC clock by
-* default. The MAC and the layout don't add a skew between
-* clock and data.
-* Add 0.3ns for the RXC path and 0.96 + 0.42 ns (1.38 ns) for
-* the TXC path to get the required clock skews.
-*/
-   /* control data pad skew - devaddr = 0x02, register = 0x04 */
-   ksz9031_phy_extended_write(phydev, 0x02,
-  MII_KSZ9031_EXT_RGMII_CTRL_SIG_SKEW,
-  MII_KSZ9031_MOD_DATA_NO_POST_INC,
-  0x0070);
-   /* rx data pad skew - devaddr = 0x02, register = 0x05 */
-   ksz9031_phy_extended_write(phydev, 0x02,
-  MII_KSZ9031_EXT_RGMII_RX_DATA_SKEW,
-  MII_KSZ9031_MOD_DATA_NO_POST_INC,
-  0x);
-   /* tx data pad skew - devaddr = 0x02, register = 0x06 */
-   ksz9031_phy_extended_write(phydev, 0x02,
-  MII_KSZ9031_EXT_RGMII_TX_DATA_SKEW,
-  MII_KSZ9031_MOD_DATA_NO_POST_INC,
-  0x);
-   /* gtx and rx clock pad skew - devaddr = 0x02,register = 0x08 */
-   ksz9031_phy_extended_write(phydev, 0x02,
-  MII_KSZ9031_EXT_RGMII_CLOCK_SKEW,
-  MII_KSZ9031_MOD_DATA_NO_POST_INC,
-  0x03f4);
-   break;
-   case PHY_ID_KSZ9131:
-   default:
-   /* read rxc dll control - devaddr = 0x2, register = 0x4c */
-   tmp = ksz9031_phy_extended_read(phydev, 0x02,
-   MII_KSZ9131_EXT_RGMII_2NS_SKEW_RXDLL,
-   MII_KSZ9031_MOD_DATA_NO_POST_INC);
-   /* disable rxdll bypass (enable 2ns skew delay on RXC) */
-   tmp &= ~MII_KSZ9131_RXTXDLL_BYPASS;
-   /* rxc data pad skew 2ns - devaddr = 0x02, register = 0x4c */
-   tmp = ksz9031_phy_extended_write(phydev, 0x02,
-   MII_KSZ9131_EXT_RGMII_2NS_SKEW_RXDLL,
-   MII_KSZ9031_MOD_DATA_NO_POST_INC, tmp);
-   /* read txc dll control - devaddr = 0x02, register = 0x4d */
-   tmp = ksz9031_phy_extended_read(phydev, 0x02,
-   MII_KSZ9131_EXT_RGMII_2NS_SKEW_TXDLL,
-   MII_KSZ9031_MOD_DATA_NO_POST_INC);
-   /* disable txdll bypass (enable 2ns skew delay on TXC) */
-   tmp &= ~MII_KSZ9131_RXTXDLL_BYPASS;
-   /* rxc data pad skew 2ns - devaddr = 0x02, register = 0x4d */
-   tmp = ksz9031_phy_extended_write(phydev, 0x02,
-   MII_KSZ9131_EXT_RGMII_2NS_SKEW_TXDLL,
-   MII_KSZ9031_MOD_DATA_NO_POST_INC, tmp);
-   break;
-   }
-
-   if (phydev->drv->co

[PATCH v4 01/10] imx8m: clean-up kconfig indentation

2021-10-06 Thread Marcel Ziswiler
From: Marcel Ziswiler 

Replace spurious spaces with proper tabs.

Signed-off-by: Marcel Ziswiler 
Reviewed-by: Fabio Estevam 
---

(no changes since v1)

 arch/arm/mach-imx/imx8m/Kconfig | 20 ++--
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/arch/arm/mach-imx/imx8m/Kconfig b/arch/arm/mach-imx/imx8m/Kconfig
index 1d08a2977f5..a2ba30cf332 100644
--- a/arch/arm/mach-imx/imx8m/Kconfig
+++ b/arch/arm/mach-imx/imx8m/Kconfig
@@ -25,14 +25,14 @@ config SYS_SOC
default "imx8m"
 
 choice
-   prompt  "NXP i.MX8M board select"
+   prompt "NXP i.MX8M board select"
optional
 
 config TARGET_IMX8MQ_CM
-bool "Ronetix iMX8MQ-CM SoM"
+   bool "Ronetix iMX8MQ-CM SoM"
select BINMAN
-select IMX8MQ
-select IMX8M_LPDDR4
+   select IMX8MQ
+   select IMX8M_LPDDR4
 
 config TARGET_IMX8MQ_EVK
bool "imx8mq_evk"
@@ -105,10 +105,10 @@ config TARGET_PICO_IMX8MQ
select IMX8M_LPDDR4
 
 config TARGET_VERDIN_IMX8MM
-   bool "Support Toradex Verdin iMX8M Mini module"
-   select IMX8MM
-   select SUPPORT_SPL
-   select IMX8M_LPDDR4
+   bool "Support Toradex Verdin iMX8M Mini module"
+   select IMX8MM
+   select SUPPORT_SPL
+   select IMX8M_LPDDR4
 
 config TARGET_IMX8MM_BEACON
bool "imx8mm Beacon Embedded devkit"
@@ -125,14 +125,14 @@ config TARGET_IMX8MN_BEACON
 config TARGET_PHYCORE_IMX8MM
bool "PHYTEC PHYCORE i.MX8MM"
select IMX8MM
-select SUPPORT_SPL
+   select SUPPORT_SPL
select IMX8M_LPDDR4
 
 config TARGET_PHYCORE_IMX8MP
bool "PHYTEC PHYCORE i.MX8MP"
select BINMAN
select IMX8MP
-select SUPPORT_SPL
+   select SUPPORT_SPL
select IMX8M_LPDDR4
 
 config TARGET_IMX8MM_CL_IOT_GATE
-- 
2.26.2



[PATCH v2 5/5] colibri-imx6ull: add emmc variant

2021-10-06 Thread Marcel Ziswiler
From: Max Krummenacher 

Add code to build the eMMC variant of the Colibri iMX6ULL, i.e. the
'Colibri iMX6ULL 1GB' which has a eMMC instead of the raw NAND used
on other SKUs.

Related-to: ELB-4056, ELB-4057
Signed-off-by: Max Krummenacher 
Signed-off-by: Marcel Ziswiler 

---

Changes in v2:
- Re-based.

 arch/arm/dts/Makefile |  1 +
 arch/arm/dts/imx6ull-colibri-emmc.dts | 49 +++
 arch/arm/dts/imx6ull-colibri.dts  | 34 ++-
 arch/arm/dts/imx6ull-colibri.dtsi | 32 +--
 board/toradex/colibri-imx6ull/Kconfig | 48 +-
 board/toradex/colibri-imx6ull/MAINTAINERS |  4 +-
 .../toradex/colibri-imx6ull/colibri-imx6ull.c | 29 +-
 configs/colibri-imx6ull-emmc_defconfig| 88 +++
 configs/colibri-imx6ull_defconfig |  2 +-
 include/configs/colibri-imx6ull.h | 51 ---
 10 files changed, 290 insertions(+), 48 deletions(-)
 create mode 100644 arch/arm/dts/imx6ull-colibri-emmc.dts
 create mode 100644 configs/colibri-imx6ull-emmc_defconfig

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 9438bf735aa..ab0340ccd5d 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -820,6 +820,7 @@ dtb-$(CONFIG_MX6UL) += \
 dtb-$(CONFIG_MX6ULL) += \
imx6ull-14x14-evk.dtb \
imx6ull-colibri.dtb \
+   imx6ull-colibri-emmc.dtb \
imx6ull-myir-mys-6ulx-eval.dtb \
imx6ull-seeed-npi-imx6ull-dev-board.dtb \
imx6ull-phytec-segin-ff-rdk-emmc.dtb \
diff --git a/arch/arm/dts/imx6ull-colibri-emmc.dts 
b/arch/arm/dts/imx6ull-colibri-emmc.dts
new file mode 100644
index 000..cbb561ffb4a
--- /dev/null
+++ b/arch/arm/dts/imx6ull-colibri-emmc.dts
@@ -0,0 +1,49 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright 2021 Toradex AG
+ */
+
+#include "imx6ull-colibri.dtsi"
+#include "imx6ull-colibri-u-boot.dtsi"
+
+/ {
+   model = "Toradex Colibri iMX6ULL 1GB (eMMC)";
+   compatible = "toradex,colibri-imx6ull-emmc", "toradex,colibri-imx6ull", 
"fsl,imx6ull";
+
+   aliases {
+   mmc0 = 
+   mmc1 = 
+   };
+};
+
+/* eMMC */
+ {
+   pinctrl-names = "default";
+   pinctrl-0 = <_usdhc2emmc>;
+   assigned-clocks = < IMX6UL_CLK_USDHC2_SEL>, < 
IMX6UL_CLK_USDHC2>;
+   assigned-clock-parents = < IMX6UL_CLK_PLL2_PFD2>;
+   assigned-clock-rates = <0>, <19800>;
+   bus-width = <8>;
+   keep-power-in-suspend;
+   no-1-8-v;
+   non-removable;
+   vmmc-supply = <_module_3v3>;
+   status = "okay";
+};
+
+ {
+   pinctrl_usdhc2emmc: usdhc2emmcgrp {
+   fsl,pins = <
+   MX6UL_PAD_NAND_RE_B__USDHC2_CLK 0x17059
+   MX6UL_PAD_NAND_WE_B__USDHC2_CMD 0x17059
+   MX6UL_PAD_NAND_DATA00__USDHC2_DATA0 0x17059
+   MX6UL_PAD_NAND_DATA01__USDHC2_DATA1 0x17059
+   MX6UL_PAD_NAND_DATA02__USDHC2_DATA2 0x17059
+   MX6UL_PAD_NAND_DATA03__USDHC2_DATA3 0x17059
+   MX6UL_PAD_NAND_DATA04__USDHC2_DATA4 0x17059
+   MX6UL_PAD_NAND_DATA05__USDHC2_DATA5 0x17059
+   MX6UL_PAD_NAND_DATA06__USDHC2_DATA6 0x17059
+   MX6UL_PAD_NAND_DATA07__USDHC2_DATA7 0x17059
+   >;
+   };
+};
diff --git a/arch/arm/dts/imx6ull-colibri.dts b/arch/arm/dts/imx6ull-colibri.dts
index 15338a1ae3d..dbe3e0206e5 100644
--- a/arch/arm/dts/imx6ull-colibri.dts
+++ b/arch/arm/dts/imx6ull-colibri.dts
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
 /*
- * Copyright 2018-2019 Toradex AG
+ * Copyright 2018-2021 Toradex AG
  */
 
 #include "imx6ull-colibri.dtsi"
@@ -10,3 +10,35 @@
model = "Toradex Colibri iMX6ULL";
compatible = "toradex,colibri-imx6ull", "fsl,imx6ull";
 };
+
+/* NAND */
+ {
+   pinctrl-names = "default";
+   pinctrl-0 = <_gpmi_nand>;
+   nand-on-flash-bbt;
+   nand-ecc-mode = "hw";
+   nand-ecc-strength = <8>;
+   nand-ecc-step-size = <512>;
+   status = "okay";
+};
+
+ {
+   pinctrl_gpmi_nand: gpmi-nand-grp {
+   fsl,pins = <
+   MX6UL_PAD_NAND_DATA00__RAWNAND_DATA00   0x100a9
+   MX6UL_PAD_NAND_DATA01__RAWNAND_DATA01   0x100a9
+   MX6UL_PAD_NAND_DATA02__RAWNAND_DATA02   0x100a9
+   MX6UL_PAD_NAND_DATA03__RAWNAND_DATA03   0x100a9
+   MX6UL_PAD_NAND_DATA04__RAWNAND_DATA04   0x100a9
+   MX6UL_PAD_NAND_DATA05__RAWNAND_DATA05   0x100a9
+   MX6UL_PAD_NAND_DATA06__RAWNAND_DATA06   0x100a9
+   MX6UL_PAD_NAND_DATA07__R

[PATCH v2 0/5] board: toradex: prepare and add colibri imx6ull 1gb (emmc) support

2021-10-06 Thread Marcel Ziswiler
From: Marcel Ziswiler 


Some preparatory steps concerning tdx-cfg-block including a fix for
the interactive mode IT handling and adding them new SKUs and then
adding initial support for the Toradex Colibri iMX6ULL 1GB (eMMC) V1.1A
module. They are now strapped to boot from eFuses which are factory
fused to properly boot from their on-module eMMC.

Functionality wise the following is known to be working:
- 4-bit MMC/SD card slot
- 8-bit eMMC (fused default boot)
- bmode usb (imx_usb or uuu e.g. as used by the Toradex Easy Installer)
- Ethernet
- GPIOs
- I2C
- parallel RGB display
- USB device (e.g. for ums)
- USB host (e.g. for storage devices)

U-Boot 2021.10-rc1-00128-g4877bdab7e6 (Aug 16 2021 - 13:59:21 +0200)

CPU:   Freescale i.MX6ULL rev1.1 792 MHz (running at 396 MHz)
CPU:   Industrial temperature grade (-40C to 105C) at 59C
Reset cause: WDOG
DRAM:  1 GiB
MMC:   FSL_SDHC: 1, FSL_SDHC: 0
Loading Environment from MMC... OK
In:serial
Out:   serial
Err:   serial
Model: Toradex Colibri iMX6ULL 1GB IT (eMMC) V1.1A, Serial# 06906494
Net:   eth1: ethernet@20b4000
Hit any key to stop autoboot:  0
Colibri iMX6ULL #

Changes in v2:
- Re-based.

Denys Drozdov (1):
  toradex: configblock: fix interactive mode it handling

Marcel Ziswiler (2):
  toradex: take over maintainership
  toradex: tdx-cfg-block: add new i.mx 6ull and 8m plus skus

Max Krummenacher (1):
  colibri-imx6ull: add emmc variant

Philippe Schenker (1):
  colibri-imx6ull: imximage.cfg: integrate new 1GiB RAM variant

 arch/arm/dts/Makefile |  1 +
 arch/arm/dts/imx6ull-colibri-emmc.dts | 49 +++
 arch/arm/dts/imx6ull-colibri.dts  | 34 ++-
 arch/arm/dts/imx6ull-colibri.dtsi | 32 +--
 board/toradex/apalis-imx8x/MAINTAINERS|  2 +-
 board/toradex/apalis_imx6/MAINTAINERS |  2 +-
 board/toradex/colibri-imx6ull/Kconfig | 48 +-
 board/toradex/colibri-imx6ull/MAINTAINERS |  6 +-
 .../toradex/colibri-imx6ull/colibri-imx6ull.c | 29 +-
 board/toradex/colibri-imx6ull/imximage.cfg| 13 ++-
 board/toradex/colibri_imx6/MAINTAINERS|  2 +-
 board/toradex/colibri_imx7/MAINTAINERS|  2 +-
 board/toradex/colibri_t20/MAINTAINERS |  2 +-
 board/toradex/colibri_t30/MAINTAINERS |  2 +-
 board/toradex/colibri_vf/MAINTAINERS  |  2 +-
 board/toradex/common/tdx-cfg-block.c  | 34 +--
 board/toradex/common/tdx-cfg-block.h  |  5 ++
 board/toradex/verdin-imx8mm/MAINTAINERS   |  2 +-
 configs/colibri-imx6ull-emmc_defconfig| 88 +++
 configs/colibri-imx6ull_defconfig |  2 +-
 include/configs/colibri-imx6ull.h | 53 ---
 21 files changed, 339 insertions(+), 71 deletions(-)
 create mode 100644 arch/arm/dts/imx6ull-colibri-emmc.dts
 create mode 100644 configs/colibri-imx6ull-emmc_defconfig

-- 
2.26.2



[PATCH v2 4/5] colibri-imx6ull: imximage.cfg: integrate new 1GiB RAM variant

2021-10-06 Thread Marcel Ziswiler
From: Philippe Schenker 

Integrate new Toradex SKU 0062 Colibri iMX6ULL 1GB IT. This commit
basically adjusts three parameters of the RAM settings:

Increase density from 4Gb to 8Gb
Increase ROW address from 15 to 16
Increase tRFC (refresh command time) from 260 to 350

This timing is valid for all Toradex Colibri iMX6ULL SKUs

Related-to: ELB-4055, ELB-4057
Signed-off-by: Philippe Schenker 
Signed-off-by: Marcel Ziswiler 
---

(no changes since v1)

 board/toradex/colibri-imx6ull/imximage.cfg | 13 +
 include/configs/colibri-imx6ull.h  |  2 +-
 2 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/board/toradex/colibri-imx6ull/imximage.cfg 
b/board/toradex/colibri-imx6ull/imximage.cfg
index 8d869d9f79e..e162cff90f0 100644
--- a/board/toradex/colibri-imx6ull/imximage.cfg
+++ b/board/toradex/colibri-imx6ull/imximage.cfg
@@ -83,16 +83,14 @@ DATA 4 0x021B08C0 0x00944009
 DATA 4 0x021B08b8 0x0800
 DATA 4 0x021B0004 0x0002002D
 DATA 4 0x021B0008 0x1B333030
-DATA 4 0x021B000C 0x676B52F3
+DATA 4 0x021B000C 0x8B8F52F3
 DATA 4 0x021B0010 0xB66D0B63
 DATA 4 0x021B0014 0x01FF00DB
 DATA 4 0x021B0018 0x00201740
-DATA 4 0x021B001C 0x8000
 DATA 4 0x021B002C 0x26D2
-DATA 4 0x021B0030 0x006B1023
-DATA 4 0x021B0040 0x004F
-DATA 4 0x021B 0x8418
-DATA 4 0x021B0890 0x0040
+DATA 4 0x021B0030 0x008F1023
+DATA 4 0x021B0040 0x005F
+DATA 4 0x021B 0x8518
 DATA 4 0x021B001C 0x02008032
 DATA 4 0x021B001C 0x8033
 DATA 4 0x021B001C 0x00048031
@@ -100,7 +98,6 @@ DATA 4 0x021B001C 0x15208030
 DATA 4 0x021B001C 0x04008040
 DATA 4 0x021B0020 0x0800
 DATA 4 0x021B0818 0x0227
-DATA 4 0x021B0004 0x0002552D
+DATA 4 0x021B0004 0x0002556D
 DATA 4 0x021B0404 0x00011006
 DATA 4 0x021B001C 0x
-
diff --git a/include/configs/colibri-imx6ull.h 
b/include/configs/colibri-imx6ull.h
index d95c838eeb9..5aa42928bce 100644
--- a/include/configs/colibri-imx6ull.h
+++ b/include/configs/colibri-imx6ull.h
@@ -13,7 +13,7 @@
 #include "mx6_common.h"
 #define CONFIG_IOMUX_LPSR
 
-#define PHYS_SDRAM_SIZESZ_512M
+#define PHYS_SDRAM_SIZESZ_1G
 
 /* ENET1 */
 #define IMX_FEC_BASE   ENET2_BASE_ADDR
-- 
2.26.2



[PATCH v2 3/5] toradex: tdx-cfg-block: add new i.mx 6ull and 8m plus skus

2021-10-06 Thread Marcel Ziswiler
From: Marcel Ziswiler 

Add new i.MX 6ULL and 8M Plus SKUs to ConfigBlock handling:

0062: Colibri iMX6ULL 1GB IT (eMMC)

0063: Verdin iMX8M Plus Quad 4GB IT

0064: Verdin iMX8M Plus Quad 2GB Wi-Fi / BT IT

0065: Verdin iMX8M Plus QuadLite 1GB IT

0066: Verdin iMX8M Plus Quad 8GB Wi-Fi / BT

Signed-off-by: Marcel Ziswiler 
---

(no changes since v1)

 board/toradex/common/tdx-cfg-block.c | 29 
 board/toradex/common/tdx-cfg-block.h |  5 +
 2 files changed, 30 insertions(+), 4 deletions(-)

diff --git a/board/toradex/common/tdx-cfg-block.c 
b/board/toradex/common/tdx-cfg-block.c
index ad267812267..7cadd05c0a7 100644
--- a/board/toradex/common/tdx-cfg-block.c
+++ b/board/toradex/common/tdx-cfg-block.c
@@ -145,6 +145,11 @@ const char * const toradex_modules[] = {
[59] = "Verdin iMX8M Mini Quad 2GB IT",
[60] = "Verdin iMX8M Mini DualLite 1GB WB IT",
[61] = "Verdin iMX8M Plus Quad 2GB",
+   [62] = "Colibri iMX6ULL 1GB IT (eMMC)",
+   [63] = "Verdin iMX8M Plus Quad 4GB IT",
+   [64] = "Verdin iMX8M Plus Quad 2GB Wi-Fi / BT IT",
+   [65] = "Verdin iMX8M Plus QuadLite 1GB IT",
+   [66] = "Verdin iMX8M Plus Quad 8GB Wi-Fi / BT",
 };
 
 const char * const toradex_carrier_boards[] = {
@@ -415,7 +420,10 @@ static int get_cfgblock_interactive(void)
if (wb == 'y' || wb == 'Y')
tdx_hw_tag.prodid = COLIBRI_IMX6ULL_WIFI_BT_IT;
else
-   tdx_hw_tag.prodid = COLIBRI_IMX6ULL_IT;
+   if (gd->ram_size == 0x2000)
+   tdx_hw_tag.prodid = COLIBRI_IMX6ULL_IT;
+   else
+   tdx_hw_tag.prodid = 
COLIBRI_IMX6ULL_IT_EMMC;
} else {
if (wb == 'y' || wb == 'Y')
tdx_hw_tag.prodid = COLIBRI_IMX6ULL_WIFI_BT;
@@ -424,7 +432,10 @@ static int get_cfgblock_interactive(void)
}
 #endif
} else if (!strcmp("imx7d", soc))
-   tdx_hw_tag.prodid = COLIBRI_IMX7D;
+   if (gd->ram_size == 0x2000)
+   tdx_hw_tag.prodid = COLIBRI_IMX7D;
+   else
+   tdx_hw_tag.prodid = COLIBRI_IMX7D_EMMC;
else if (!strcmp("imx7s", soc))
tdx_hw_tag.prodid = COLIBRI_IMX7S;
else if (is_cpu_type(MXC_CPU_IMX8QM)) {
@@ -474,11 +485,21 @@ static int get_cfgblock_interactive(void)
tdx_hw_tag.prodid = VERDIN_IMX8MMQ_IT;
} else if (is_cpu_type(MXC_CPU_IMX8MN)) {
tdx_hw_tag.prodid = VERDIN_IMX8MNQ_WIFI_BT;
+   } else if (is_cpu_type(MXC_CPU_IMX8MPL)) {
+   tdx_hw_tag.prodid = VERDIN_IMX8MPQL_IT;
} else if (is_cpu_type(MXC_CPU_IMX8MP)) {
if (wb == 'y' || wb == 'Y')
-   tdx_hw_tag.prodid = VERDIN_IMX8MPQ_WIFI_BT_IT;
+   if (gd->ram_size == 0x8000)
+   tdx_hw_tag.prodid = 
VERDIN_IMX8MPQ_2GB_WIFI_BT_IT;
+   else if (gd->ram_size == 0x2)
+   tdx_hw_tag.prodid = VERDIN_IMX8MPQ_8GB_WIFI_BT;
+   else
+   tdx_hw_tag.prodid = VERDIN_IMX8MPQ_WIFI_BT_IT;
else
-   tdx_hw_tag.prodid = VERDIN_IMX8MPQ;
+   if (it == 'y' || it == 'Y')
+   tdx_hw_tag.prodid = VERDIN_IMX8MPQ_IT;
+   else
+   tdx_hw_tag.prodid = VERDIN_IMX8MPQ;
} else if (!strcmp("tegra20", soc)) {
if (it == 'y' || it == 'Y')
if (gd->ram_size == 0x1000)
diff --git a/board/toradex/common/tdx-cfg-block.h 
b/board/toradex/common/tdx-cfg-block.h
index 9debd5f0462..ddcf6997480 100644
--- a/board/toradex/common/tdx-cfg-block.h
+++ b/board/toradex/common/tdx-cfg-block.h
@@ -82,6 +82,11 @@ enum {
VERDIN_IMX8MMQ_IT,
VERDIN_IMX8MMDL_WIFI_BT_IT, /* 60 */
VERDIN_IMX8MPQ,
+   COLIBRI_IMX6ULL_IT_EMMC,
+   VERDIN_IMX8MPQ_IT,
+   VERDIN_IMX8MPQ_2GB_WIFI_BT_IT,
+   VERDIN_IMX8MPQL_IT, /* 65 */
+   VERDIN_IMX8MPQ_8GB_WIFI_BT,
 };
 
 enum {
-- 
2.26.2



[PATCH v2 2/5] toradex: configblock: fix interactive mode it handling

2021-10-06 Thread Marcel Ziswiler
From: Denys Drozdov 

Restore "Is the module an IT version? [y/N]" for "cfgblock create"
interactive mode command, which was leading to invalid detection
of 0051 Colibri iMX8DX 1GB WB module;

Fixes: a5b5ad4d859b ("toradex: tdx-cfg-clock: add new i.mx 8m mini/plus skus")
Related-to: ELB-3482
Signed-off-by: Denys Drozdov 
Signed-off-by: Marcel Ziswiler 
---

(no changes since v1)

 board/toradex/common/tdx-cfg-block.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/board/toradex/common/tdx-cfg-block.c 
b/board/toradex/common/tdx-cfg-block.c
index fe47cddad80..ad267812267 100644
--- a/board/toradex/common/tdx-cfg-block.c
+++ b/board/toradex/common/tdx-cfg-block.c
@@ -368,7 +368,10 @@ static int get_cfgblock_interactive(void)
if (cpu_is_pxa27x())
sprintf(message, "Is the module the 312 MHz version? [y/N] ");
else
-   it = 'y';
+   sprintf(message, "Is the module an IT version? [y/N] ");
+
+   len = cli_readline(message);
+   it = console_buffer[0];
 
 #if defined(CONFIG_TARGET_APALIS_IMX8) || \
defined(CONFIG_TARGET_APALIS_IMX8X) || \
-- 
2.26.2



[PATCH v2 1/5] toradex: take over maintainership

2021-10-06 Thread Marcel Ziswiler
From: Marcel Ziswiler 

Also take over maintainership of remaining Toradex SoMs as Oleksandr
has left our company.

Signed-off-by: Marcel Ziswiler 
CC: Oleksandr Suvorov 

---

(no changes since v1)

 board/toradex/apalis-imx8x/MAINTAINERS| 2 +-
 board/toradex/apalis_imx6/MAINTAINERS | 2 +-
 board/toradex/colibri-imx6ull/MAINTAINERS | 2 +-
 board/toradex/colibri_imx6/MAINTAINERS| 2 +-
 board/toradex/colibri_imx7/MAINTAINERS| 2 +-
 board/toradex/colibri_t20/MAINTAINERS | 2 +-
 board/toradex/colibri_t30/MAINTAINERS | 2 +-
 board/toradex/colibri_vf/MAINTAINERS  | 2 +-
 board/toradex/verdin-imx8mm/MAINTAINERS   | 2 +-
 9 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/board/toradex/apalis-imx8x/MAINTAINERS 
b/board/toradex/apalis-imx8x/MAINTAINERS
index 52721544476..93d6cdd4742 100644
--- a/board/toradex/apalis-imx8x/MAINTAINERS
+++ b/board/toradex/apalis-imx8x/MAINTAINERS
@@ -1,5 +1,5 @@
 Apalis iMX8X
-M: Oleksandr Suvorov 
+M: Marcel Ziswiler 
 W: http://developer.toradex.com/software/linux/linux-software
 S: Maintained
 F: arch/arm/dts/fsl-imx8x-apalis.dts
diff --git a/board/toradex/apalis_imx6/MAINTAINERS 
b/board/toradex/apalis_imx6/MAINTAINERS
index fde4d92dc3d..2685457013e 100644
--- a/board/toradex/apalis_imx6/MAINTAINERS
+++ b/board/toradex/apalis_imx6/MAINTAINERS
@@ -1,5 +1,5 @@
 Apalis iMX6
-M: Oleksandr Suvorov 
+M: Marcel Ziswiler 
 W: http://developer.toradex.com/software/linux/linux-software
 W:  https://www.toradex.com/community
 S: Maintained
diff --git a/board/toradex/colibri-imx6ull/MAINTAINERS 
b/board/toradex/colibri-imx6ull/MAINTAINERS
index 899b1ff555c..eb491c273d2 100644
--- a/board/toradex/colibri-imx6ull/MAINTAINERS
+++ b/board/toradex/colibri-imx6ull/MAINTAINERS
@@ -1,5 +1,5 @@
 Colibri iMX6ULL
-M: Oleksandr Suvorov 
+M: Marcel Ziswiler 
 W: http://developer.toradex.com/software/linux/linux-software
 W: https://www.toradex.com/community
 S: Maintained
diff --git a/board/toradex/colibri_imx6/MAINTAINERS 
b/board/toradex/colibri_imx6/MAINTAINERS
index 2cbf65433da..d2ed4147e94 100644
--- a/board/toradex/colibri_imx6/MAINTAINERS
+++ b/board/toradex/colibri_imx6/MAINTAINERS
@@ -1,5 +1,5 @@
 Colibri iMX6
-M: Oleksandr Suvorov 
+M: Marcel Ziswiler 
 W: http://developer.toradex.com/software/linux/linux-software
 W:  https://www.toradex.com/community
 S: Maintained
diff --git a/board/toradex/colibri_imx7/MAINTAINERS 
b/board/toradex/colibri_imx7/MAINTAINERS
index 3d7d010d8a6..24bec3ef14e 100644
--- a/board/toradex/colibri_imx7/MAINTAINERS
+++ b/board/toradex/colibri_imx7/MAINTAINERS
@@ -1,5 +1,5 @@
 Colibri iMX7
-M: Oleksandr Suvorov 
+M: Marcel Ziswiler 
 W: http://developer.toradex.com/software/linux/linux-software
 W: https://www.toradex.com/community
 S: Maintained
diff --git a/board/toradex/colibri_t20/MAINTAINERS 
b/board/toradex/colibri_t20/MAINTAINERS
index 61fbd2c1e0d..77c2fc39e61 100644
--- a/board/toradex/colibri_t20/MAINTAINERS
+++ b/board/toradex/colibri_t20/MAINTAINERS
@@ -1,5 +1,5 @@
 COLIBRI_T20
-M: Oleksandr Suvorov 
+M: Marcel Ziswiler 
 S: Maintained
 F: board/toradex/colibri_t20/
 F: include/configs/colibri_t20.h
diff --git a/board/toradex/colibri_t30/MAINTAINERS 
b/board/toradex/colibri_t30/MAINTAINERS
index ded9e28295f..c2d6587ed02 100644
--- a/board/toradex/colibri_t30/MAINTAINERS
+++ b/board/toradex/colibri_t30/MAINTAINERS
@@ -1,5 +1,5 @@
 Colibri T30
-M: Oleksandr Suvorov 
+M: Marcel Ziswiler 
 S: Maintained
 F: board/toradex/colibri_t30/
 F: include/configs/colibri_t30.h
diff --git a/board/toradex/colibri_vf/MAINTAINERS 
b/board/toradex/colibri_vf/MAINTAINERS
index c6627654a25..9f18b9a39d4 100644
--- a/board/toradex/colibri_vf/MAINTAINERS
+++ b/board/toradex/colibri_vf/MAINTAINERS
@@ -1,5 +1,5 @@
 Colibri VFxx
-M: Oleksandr Suvorov 
+M: Marcel Ziswiler 
 W: http://developer.toradex.com/software/linux/linux-software
 W: https://www.toradex.com/community
 S: Maintained
diff --git a/board/toradex/verdin-imx8mm/MAINTAINERS 
b/board/toradex/verdin-imx8mm/MAINTAINERS
index 08c370178cc..7965975d0bf 100644
--- a/board/toradex/verdin-imx8mm/MAINTAINERS
+++ b/board/toradex/verdin-imx8mm/MAINTAINERS
@@ -1,5 +1,5 @@
 Verdin iMX8M Mini
-M: Oleksandr Suvorov 
+M: Marcel Ziswiler 
 W: 
https://www.toradex.com/computer-on-modules/verdin-arm-family/nxp-imx-8m-mini
 S: Maintained
 F: arch/arm/dts/imx8mm-verdin.dts
-- 
2.26.2



Re: [PATCH v2] apalis/colibri_imx6: move setting bootcmd to defconfig

2021-09-16 Thread Marcel Ziswiler
On Thu, 2021-09-16 at 11:54 +0300, Oleksandr Suvorov wrote:
> Move setting the default boot command to the
> apalis/colibri_imx6_defconfig. It allows replacing the command
> without code modification.
> 
> Signed-off-by: Oleksandr Suvorov 
> Reviewed-by: Peng Fan 
> Reviewed-by: Igor Opaniuk 

Acked-by: Marcel Ziswiler 

> ---
> 
> Changes in v2:
> - fix spaces after semicolon.
> - add reviewed-by records.
> 
>  configs/apalis_imx6_defconfig  | 1 +
>  configs/colibri_imx6_defconfig | 1 +
>  include/configs/apalis_imx6.h  | 4 
>  include/configs/colibri_imx6.h | 4 
>  4 files changed, 2 insertions(+), 8 deletions(-)
> 
> diff --git a/configs/apalis_imx6_defconfig b/configs/apalis_imx6_defconfig
> index a0e85ba23a4..f64b1ca4378 100644
> --- a/configs/apalis_imx6_defconfig
> +++ b/configs/apalis_imx6_defconfig
> @@ -23,6 +23,7 @@ CONFIG_DISTRO_DEFAULTS=y
>  CONFIG_FIT=y
>  CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/mach-imx/spl_sd.cfg"
>  CONFIG_BOOTDELAY=1
> +CONFIG_BOOTCOMMAND="run distro_bootcmd; usb start; setenv stdout 
> serial,vidconsole; setenv stdin
> serial,usbkbd"
>  # CONFIG_DISPLAY_BOARDINFO is not set
>  CONFIG_DISPLAY_BOARDINFO_LATE=y
>  CONFIG_BOARD_EARLY_INIT_F=y
> diff --git a/configs/colibri_imx6_defconfig b/configs/colibri_imx6_defconfig
> index 47b1cfb1917..373d6476ddc 100644
> --- a/configs/colibri_imx6_defconfig
> +++ b/configs/colibri_imx6_defconfig
> @@ -22,6 +22,7 @@ CONFIG_DISTRO_DEFAULTS=y
>  CONFIG_FIT=y
>  CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/mach-imx/spl_sd.cfg"
>  CONFIG_BOOTDELAY=1
> +CONFIG_BOOTCOMMAND="run distro_bootcmd; usb start; setenv stdout 
> serial,vidconsole; setenv stdin
> serial,usbkbd"
>  # CONFIG_DISPLAY_BOARDINFO is not set
>  CONFIG_DISPLAY_BOARDINFO_LATE=y
>  CONFIG_BOARD_EARLY_INIT_F=y
> diff --git a/include/configs/apalis_imx6.h b/include/configs/apalis_imx6.h
> index 12de0105c6c..ade479cb943 100644
> --- a/include/configs/apalis_imx6.h
> +++ b/include/configs/apalis_imx6.h
> @@ -133,10 +133,6 @@
>  #endif
>  #define CONFIG_EXTRA_ENV_SETTINGS \
> BOOTENV \
> -   "bootcmd=run distro_bootcmd ; " \
> -   "usb start ; " \
> -   "setenv stdout serial,vidconsole; " \
> -   "setenv stdin serial,usbkbd\0" \
> "boot_file=zImage\0" \
> "console=ttymxc0\0" \
> "defargs=enable_wait_mode=off vmalloc=400M\0" \
> diff --git a/include/configs/colibri_imx6.h b/include/configs/colibri_imx6.h
> index 804a144a03e..f91d6b49ea8 100644
> --- a/include/configs/colibri_imx6.h
> +++ b/include/configs/colibri_imx6.h
> @@ -115,10 +115,6 @@
>  #define FDT_FILE "imx6dl-colibri-eval-v3.dtb"
>  #define CONFIG_EXTRA_ENV_SETTINGS \
> BOOTENV \
> -   "bootcmd=run distro_bootcmd; " \
> -   "usb start ; " \
> -   "setenv stdout serial,vidconsole; " \
> -   "setenv stdin serial,usbkbd\0" \
> "boot_file=zImage\0" \
> "console=ttymxc0\0" \
> "defargs=enable_wait_mode=off galcore.contiguousSize=50331648\0" \


Re: [PATCH] apalis/colibri_imx6: move setting bootcmd to defconfig

2021-09-15 Thread Marcel Ziswiler
Hi Oleksandr

Thanks, just one minor nit-pick below.

On Sun, 2021-09-12 at 22:39 +0300, Oleksandr Suvorov wrote:
> Move setting the default boot command to the
> apalis/colibri_imx6_defconfig. It allows replacing the command
> without code modification.
> 
> Signed-off-by: Oleksandr Suvorov 
> ---
> 
>  configs/apalis_imx6_defconfig  | 1 +
>  configs/colibri_imx6_defconfig | 1 +
>  include/configs/apalis_imx6.h  | 4 
>  include/configs/colibri_imx6.h | 4 
>  4 files changed, 2 insertions(+), 8 deletions(-)
> 
> diff --git a/configs/apalis_imx6_defconfig b/configs/apalis_imx6_defconfig
> index a0e85ba23a4..a2e0f8e3936 100644
> --- a/configs/apalis_imx6_defconfig
> +++ b/configs/apalis_imx6_defconfig
> @@ -23,6 +23,7 @@ CONFIG_DISTRO_DEFAULTS=y
>  CONFIG_FIT=y
>  CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/mach-imx/spl_sd.cfg"
>  CONFIG_BOOTDELAY=1
> +CONFIG_BOOTCOMMAND="run distro_bootcmd;usb start;setenv stdout 
> serial,vidconsole;setenv stdin serial,usbkbd"

I believe, usually we had a space after those semicolons, not?

>  # CONFIG_DISPLAY_BOARDINFO is not set
>  CONFIG_DISPLAY_BOARDINFO_LATE=y
>  CONFIG_BOARD_EARLY_INIT_F=y
> diff --git a/configs/colibri_imx6_defconfig b/configs/colibri_imx6_defconfig
> index 47b1cfb1917..bee4e7edd63 100644
> --- a/configs/colibri_imx6_defconfig
> +++ b/configs/colibri_imx6_defconfig
> @@ -22,6 +22,7 @@ CONFIG_DISTRO_DEFAULTS=y
>  CONFIG_FIT=y
>  CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/mach-imx/spl_sd.cfg"
>  CONFIG_BOOTDELAY=1
> +CONFIG_BOOTCOMMAND="run distro_bootcmd;usb start;setenv stdout 
> serial,vidconsole;setenv stdin serial,usbkbd"

Ditto.

>  # CONFIG_DISPLAY_BOARDINFO is not set
>  CONFIG_DISPLAY_BOARDINFO_LATE=y
>  CONFIG_BOARD_EARLY_INIT_F=y
> diff --git a/include/configs/apalis_imx6.h b/include/configs/apalis_imx6.h
> index 12de0105c6c..ade479cb943 100644
> --- a/include/configs/apalis_imx6.h
> +++ b/include/configs/apalis_imx6.h
> @@ -133,10 +133,6 @@
>  #endif
>  #define CONFIG_EXTRA_ENV_SETTINGS \
> BOOTENV \
> -   "bootcmd=run distro_bootcmd ; " \
> -   "usb start ; " \
> -   "setenv stdout serial,vidconsole; " \
> -   "setenv stdin serial,usbkbd\0" \

At least here we definitely did have them (;-p).

> "boot_file=zImage\0" \
> "console=ttymxc0\0" \
> "defargs=enable_wait_mode=off vmalloc=400M\0" \
> diff --git a/include/configs/colibri_imx6.h b/include/configs/colibri_imx6.h
> index 804a144a03e..f91d6b49ea8 100644
> --- a/include/configs/colibri_imx6.h
> +++ b/include/configs/colibri_imx6.h
> @@ -115,10 +115,6 @@
>  #define FDT_FILE "imx6dl-colibri-eval-v3.dtb"
>  #define CONFIG_EXTRA_ENV_SETTINGS \
> BOOTENV \
> -   "bootcmd=run distro_bootcmd; " \
> -   "usb start ; " \
> -   "setenv stdout serial,vidconsole; " \
> -   "setenv stdin serial,usbkbd\0" \
> "boot_file=zImage\0" \
> "console=ttymxc0\0" \
> "defargs=enable_wait_mode=off galcore.contiguousSize=50331648\0" \

Cheers

Marcel


Re: [PATCH] ARM: dts: imx8mm-verdin: Set PHY mode to RGMII-ID

2021-09-11 Thread Marcel Ziswiler
Hi Marek

On Sun, 2021-09-12 at 00:43 +0200, Marek Vasut wrote:
> Since c6df0e2ffdc ("net: phy: micrel: add support for DLL setup on ksz9131")
> the Micrel PHY driver correctly configures the delay register. The Verdin PHY
> is RGMII-ID, so reflect that in DT, otherwise the ethernet no longer works.

Yes, however, one should also get rid of the proprietary PHY setup in our board 
setup.

Remember, I already did send this as part of my target refresh series:

https://marc.info/?l=u-boot=162990456210415

> Signed-off-by: Marek Vasut 
> Cc: Marcel Ziswiler 
> Cc: Max Krummenacher 
> Cc: Oleksandr Suvorov 
> ---
>  arch/arm/dts/imx8mm-verdin.dts | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm/dts/imx8mm-verdin.dts b/arch/arm/dts/imx8mm-verdin.dts
> index fb0756d6e19..ac2a4b69d3c 100644
> --- a/arch/arm/dts/imx8mm-verdin.dts
> +++ b/arch/arm/dts/imx8mm-verdin.dts
> @@ -160,7 +160,7 @@
>   {
> fsl,magic-packet;
> phy-handle = <>;
> -   phy-mode = "rgmii";
> +   phy-mode = "rgmii-id";
> phy-supply = <_ethphy>;
> pinctrl-names = "default", "sleep";
> pinctrl-0 = <_fec1>;

Cheers

Marcel


Re: [PATCH v2 1/2] GPIO: fxl6408: Add support for FXL6408 GPIO expander

2021-09-09 Thread Marcel Ziswiler
Hi Oleksandr

Just one tiny nit-pick. Otherwise looks good and works great. Thanks!

On Sat, 2021-08-28 at 13:23 +0300, Oleksandr Suvorov wrote:
> From: Oleksandr Suvorov 
> 
> Initial support for Fairchild's 8 bit I2C gpio expander FXL6408.
> The CONFIG_FXL6408_GPIO define enables support for such devices.
> 
> Based on: https://patchwork.kernel.org/patch/9148419/
> 
> Signed-off-by: Oleksandr Suvorov 

Hehe.

> Reviewed-by: Simon Glass 
> Signed-off-by: Oleksandr Suvorov 

Tested-by: Marcel Ziswiler 

> ---
> 
> Changes in v2: None
> 
>  drivers/gpio/Kconfig    |   7 +
>  drivers/gpio/Makefile   |   1 +
>  drivers/gpio/gpio-fxl6408.c | 366 
>  3 files changed, 374 insertions(+)
>  create mode 100644 drivers/gpio/gpio-fxl6408.c
> 
> diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
> index 4a89c1a62b..f56e4cc261 100644
> --- a/drivers/gpio/Kconfig
> +++ b/drivers/gpio/Kconfig
> @@ -123,6 +123,13 @@ config DA8XX_GPIO
> help
>   This driver supports the DA8xx GPIO controller
>  
> +config FXL6408_GPIO
> +   bool "FXL6408 I2C GPIO expander driver"
> +   depends on DM_GPIO && DM_I2C
> +   help
> + This driver supports the Fairchild FXL6408 device. FXL6408 is a
> + fully configurable 8-bit I2C-controlled GPIO expander.
> +
>  config INTEL_BROADWELL_GPIO
> bool "Intel Broadwell GPIO driver"
> depends on DM
> diff --git a/drivers/gpio/Makefile b/drivers/gpio/Makefile
> index 58f4704f6b..83d8b5c9d8 100644
> --- a/drivers/gpio/Makefile
> +++ b/drivers/gpio/Makefile
> @@ -16,6 +16,7 @@ obj-$(CONFIG_AT91_GPIO)   += at91_gpio.o
>  obj-$(CONFIG_ATMEL_PIO4)   += atmel_pio4.o
>  obj-$(CONFIG_BCM6345_GPIO) += bcm6345_gpio.o
>  obj-$(CONFIG_CORTINA_GPIO)  += cortina_gpio.o
> +obj-$(CONFIG_FXL6408_GPIO) += gpio-fxl6408.o
>  obj-$(CONFIG_INTEL_GPIO)   += intel_gpio.o
>  obj-$(CONFIG_INTEL_ICH6_GPIO)  += intel_ich6_gpio.o
>  obj-$(CONFIG_INTEL_BROADWELL_GPIO) += intel_broadwell_gpio.o
> diff --git a/drivers/gpio/gpio-fxl6408.c b/drivers/gpio/gpio-fxl6408.c
> new file mode 100644
> index 00..8a86f32365
> --- /dev/null
> +++ b/drivers/gpio/gpio-fxl6408.c
> @@ -0,0 +1,366 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + *  Copyright (C) 2021 Toradex
> + *  Copyright (C) 2016 Broadcom
> + */
> +
> +/**
> + * DOC: FXL6408 I2C to GPIO expander.
> + *
> + * This chip has 8 GPIO lines out of it, and is controlled by an I2C
> + * bus (a pair of lines), providing 4x expansion of GPIO lines. It
> + * also provides an interrupt line out for notifying of state changes.
> + *
> + * Any preconfigured state will be left in place until the GPIO lines
> + * get activated. At power on, everything is treated as an input,
> + * default input is HIGH and pulled-up, all interrupts are masked.
> + *
> + * Documentation can be found at:
> + * https://www.fairchildsemi.com/datasheets/FX/FXL6408.pdf
> + *
> + * This driver bases on:
> + * - the original driver by Eric Anholt :
> + *   https://patchwork.kernel.org/patch/9148419/
> + * - the Toradex version by Max Krummenacher :
> + *   
> http://git.toradex.com/cgit/linux-toradex.git/tree/drivers/gpio/gpio-fxl6408.c?h=toradex_5.4-2.3.x-imx
> + * - the U-boot PCA953x driver by Peng Fan :
> + *   drivers/gpio/pca953x_gpio.c
> + *
> + * TODO:
> + *   - Add interrupts support
> + *   - Replace deprecated callbacks direction_input/output() with set_flags()
> + */
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +#define REG_DEVID_CTRL 0x01
> +# define SW_RSTBIT(0)
> +# define RST_INT   BIT(1)
> +/* 0b101 is the Manufacturer's ID assigned to Fairchild by Nokia */
> +# define MF_ID_FAIRCHILD   5
> +
> +/* Bits set here indicate that the GPIO is an output */
> +#define REG_IO_DIR 0x03
> +
> +/*
> + * Bits set here, when the corresponding bit of REG_IO_DIR is set, drive
> + * the output high instead of low.
> + */
> +#define REG_OUT_STATE  0x05
> +
> +/* Bits here make the output High-Z, instead of the OUTPUT value */
> +#define REG_OUT_HIGH_Z 0x07
> +
> +/*
> + * Bits here define the expected input state of the GPIO.
> + * INTERRUPT_STATUS bits will be set when the INPUT transitions away
> + * from this value.
> + */
> +#define REG_IN_DEFAULT_STATE   0x09
> +
> +/*
> + * Bits here enable either pull up or pull down according to
> + * REG_PULL_MODE.
> + */
> +#define REG_PULL_ENABLE  

Re: [PATCH] doc: board: toradex: fix file names

2021-09-09 Thread Marcel Ziswiler
On Wed, 2021-09-08 at 16:52 +0300, Oleksandr Suvorov wrote:
> Fix the documentation file names: s/apalix/apalis/.

Fixes: commit e98ea49a0eac ("toradex: MAINTAINERS: entries for new reST docs")
Fixes: commit 3730106cf0dc ("doc: board: apalis-imx8x: add documentation")

> Signed-off-by: Oleksandr Suvorov 

Acked-by: Marcel Ziswiler 

> ---
> 
>  board/toradex/apalis-imx8/MAINTAINERS    | 2 +-
>  doc/board/toradex/{apalix-imx8.rst => apalis-imx8.rst}   | 0
>  doc/board/toradex/{apalix-imx8x.rst => apalis-imx8x.rst} | 0
>  doc/board/toradex/index.rst  | 4 ++--
>  4 files changed, 3 insertions(+), 3 deletions(-)
>  rename doc/board/toradex/{apalix-imx8.rst => apalis-imx8.rst} (100%)
>  rename doc/board/toradex/{apalix-imx8x.rst => apalis-imx8x.rst} (100%)
> 
> diff --git a/board/toradex/apalis-imx8/MAINTAINERS 
> b/board/toradex/apalis-imx8/MAINTAINERS
> index 7fbd1be10f..507172c596 100644
> --- a/board/toradex/apalis-imx8/MAINTAINERS
> +++ b/board/toradex/apalis-imx8/MAINTAINERS
> @@ -6,5 +6,5 @@ F:  arch/arm/dts/fsl-imx8-apalis.dts
>  F: arch/arm/dts/fsl-imx8-apalis-u-boot.dtsi
>  F: board/toradex/apalis-imx8/
>  F: configs/apalis-imx8_defconfig
> -F: doc/board/toradex/apalix-imx8.rst
> +F: doc/board/toradex/apalis-imx8.rst
>  F: include/configs/apalis-imx8.h
> diff --git a/doc/board/toradex/apalix-imx8.rst 
> b/doc/board/toradex/apalis-imx8.rst
> similarity index 100%
> rename from doc/board/toradex/apalix-imx8.rst
> rename to doc/board/toradex/apalis-imx8.rst
> diff --git a/doc/board/toradex/apalix-imx8x.rst 
> b/doc/board/toradex/apalis-imx8x.rst
> similarity index 100%
> rename from doc/board/toradex/apalix-imx8x.rst
> rename to doc/board/toradex/apalis-imx8x.rst
> diff --git a/doc/board/toradex/index.rst b/doc/board/toradex/index.rst
> index abba648f86..5652848019 100644
> --- a/doc/board/toradex/index.rst
> +++ b/doc/board/toradex/index.rst
> @@ -6,8 +6,8 @@ Toradex
>  .. toctree::
>     :maxdepth: 2
>  
> -   apalix-imx8
> -   apalix-imx8x
> +   apalis-imx8
> +   apalis-imx8x
>     colibri_imx7
>     colibri-imx8x
>     verdin-imx8mm


Re: [PATCH] watchdog: Fix watchdog enablement in SPL and TPL

2021-09-02 Thread Marcel Ziswiler
On Tue, 2021-08-31 at 11:17 +0200, Marek Vasut wrote:
> On 8/31/21 8:49 AM, Marcel Ziswiler wrote:
> > Hi Marek
> > 
> > On Tue, 2021-08-31 at 00:03 +0200, Marek Vasut wrote:
> > > Commit 830d29ac372 ("watchdog: Allow to use CONFIG_WDT without starting 
> > > watchdog")
> > > completely broke WDT operation in both SPL and TPL, in either case those
> > > WDTs are never enabled. Fix it by filling in the missing Kconfig options
> > > for SPL and TPL.
> > > 
> > > Fixes: 830d29ac372 ("watchdog: Allow to use CONFIG_WDT without starting 
> > > watchdog")
> > > Signed-off-by: Marek Vasut 
> > > Cc: Pali Rohar 
> > > Cc: Stefan Roese 
> > > ---
> > >   drivers/watchdog/Kconfig | 20 
> > >   1 file changed, 20 insertions(+)
> > > 
> > > diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
> > > index f0ff2612a6b..65d974c4dd5 100644
> > > --- a/drivers/watchdog/Kconfig
> > > +++ b/drivers/watchdog/Kconfig
> > > @@ -273,4 +273,24 @@ config SPL_WDT
> > >    Enable driver model for watchdog timer in SPL.
> > >    This is similar to CONFIG_WDT in U-Boot.
> > >   
> > > +config SPL_WATCHDOG_AUTOSTART
> > > +   bool "Automatically start watchdog timer in SPL"
> > > +   depends on SPL && WDT
> > > +   default y
> > > +   help
> > > + Automatically start watchdog timer and start servicing it during
> > > + SPL phase. Enabled by default. Disable this option if you want
> > > + to compile U-Boot with CONFIG_WDT support but do not want to
> > > + activate watchdog, like when CONFIG_WDT option is disabled.
> > > +
> > > +config TPL_WATCHDOG_AUTOSTART
> > > +   bool "Automatically start watchdog timer in TPL"
> > > +   depends on TPL && WDT
> > > +   default y
> > > +   help
> > > + Automatically start watchdog timer and start servicing it during
> > > + TPL phase. Enabled by default. Disable this option if you want
> > > + to compile U-Boot with CONFIG_WDT support but do not want to
> > > + activate watchdog, like when CONFIG_WDT option is disabled.
> > > +
> > >   endmenu
> > 
> > Those Kconfig entries look fine. However, I am wondering where exactly they 
> > get used. Am I missing
> > anything?
> 
> Have a look at the patch this Fixes:, if those Kconfig entries are not 
> present, the WDT is disabled in SPL and TPL unconditionally.

Yes, I did. But I guess I was not aware of how exactly that 
CONFIG_IS_ENABLED(WATCHDOG_AUTOSTART) behaves.
While I have not really found this documented or the implementation thereof I 
assume it pre-fixes config stuff
with SPL_ resp. TPL_ when building those flavors, correct?

I am wondering how many others are unaware of this (just like the author of the 
patch this fixes). Maybe we
should at least document this properly somewhere, not?

> It could be that if you're using some non-free or proprietary preloader 
> instead of SPL, you won't run into this problem.

No, don't worry. I am not running anything evil (;-p).


Re: [[PATCH] colibri-imx6ull: move CONFIG_BOOTCOMMAND from header to defconfig

2021-09-01 Thread Marcel Ziswiler
On Wed, 2021-09-01 at 16:33 +0200, liu.min...@gmail.com wrote:
> From: Ming Liu 

Please note that we do have a patch set introducing Colibri iMX6ULL 1GB (eMMC) 
support [1] in-flight and you
likely would need to re-base on top of that one. Thanks!

[1] https://marc.info/?l=u-boot=162911970822560

> Move CONFIG_BOOTCOMMAND definition from colibri-imx6ull.h to
> colibri-imx6ull_defconfig, to be more flexible, for instance, it could
> be overridden by merge_config.sh script.
> 
> Signed-off-by: Ming Liu 
> ---
>  configs/colibri-imx6ull_defconfig | 3 ++-
>  include/configs/colibri-imx6ull.h | 3 ---
>  2 files changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/configs/colibri-imx6ull_defconfig 
> b/configs/colibri-imx6ull_defconfig
> index 739eea7c07..17e3aa65f9 100644
> --- a/configs/colibri-imx6ull_defconfig
> +++ b/configs/colibri-imx6ull_defconfig
> @@ -14,7 +14,8 @@ CONFIG_DISTRO_DEFAULTS=y
>  CONFIG_FIT=y
>  
> CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/toradex/colibri-imx6ull/imximage.cfg,IMX_NAND"
>  CONFIG_BOOTDELAY=1
> -# CONFIG_USE_BOOTCOMMAND is not set
> +CONFIG_USE_BOOTCOMMAND=y
> +CONFIG_BOOTCOMMAND="run ubiboot; echo; echo ubiboot failed; run 
> distro_bootcmd;"
>  CONFIG_USE_PREBOOT=y
>  CONFIG_PREBOOT="setenv fdtfile imx6ull-colibri${variant}-${fdt_board}.dtb"
>  # CONFIG_CONSOLE_MUX is not set
> diff --git a/include/configs/colibri-imx6ull.h 
> b/include/configs/colibri-imx6ull.h
> index 2fa3485173..304f88d8d7 100644
> --- a/include/configs/colibri-imx6ull.h
> +++ b/include/configs/colibri-imx6ull.h
> @@ -66,9 +66,6 @@
> "ubi read ${fdt_addr_r} dtb && " \
> "run fdt_fixup && bootz ${kernel_addr_r} - ${fdt_addr_r}\0" \
>  
> -/* Run Distro Boot script if ubiboot fails */
> -#define CONFIG_BOOTCOMMAND "run ubiboot || run distro_bootcmd;"
> -
>  #define BOOT_TARGET_DEVICES(func) \
> func(MMC, mmc, 0) \
> func(USB, usb, 0) \


Re: [PATCH] watchdog: Fix watchdog enablement in SPL and TPL

2021-08-31 Thread Marcel Ziswiler
Hi Marek

On Tue, 2021-08-31 at 00:03 +0200, Marek Vasut wrote:
> Commit 830d29ac372 ("watchdog: Allow to use CONFIG_WDT without starting 
> watchdog")
> completely broke WDT operation in both SPL and TPL, in either case those
> WDTs are never enabled. Fix it by filling in the missing Kconfig options
> for SPL and TPL.
> 
> Fixes: 830d29ac372 ("watchdog: Allow to use CONFIG_WDT without starting 
> watchdog")
> Signed-off-by: Marek Vasut 
> Cc: Pali Rohar 
> Cc: Stefan Roese 
> ---
>  drivers/watchdog/Kconfig | 20 
>  1 file changed, 20 insertions(+)
> 
> diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
> index f0ff2612a6b..65d974c4dd5 100644
> --- a/drivers/watchdog/Kconfig
> +++ b/drivers/watchdog/Kconfig
> @@ -273,4 +273,24 @@ config SPL_WDT
>   Enable driver model for watchdog timer in SPL.
>   This is similar to CONFIG_WDT in U-Boot.
>  
> +config SPL_WATCHDOG_AUTOSTART
> +   bool "Automatically start watchdog timer in SPL"
> +   depends on SPL && WDT
> +   default y
> +   help
> + Automatically start watchdog timer and start servicing it during
> + SPL phase. Enabled by default. Disable this option if you want
> + to compile U-Boot with CONFIG_WDT support but do not want to
> + activate watchdog, like when CONFIG_WDT option is disabled.
> +
> +config TPL_WATCHDOG_AUTOSTART
> +   bool "Automatically start watchdog timer in TPL"
> +   depends on TPL && WDT
> +   default y
> +   help
> + Automatically start watchdog timer and start servicing it during
> + TPL phase. Enabled by default. Disable this option if you want
> + to compile U-Boot with CONFIG_WDT support but do not want to
> + activate watchdog, like when CONFIG_WDT option is disabled.
> +
>  endmenu

Those Kconfig entries look fine. However, I am wondering where exactly they get 
used. Am I missing anything?

Cheers

Marcel


Re: [PATCH 3/3] imx8qm_mek: Increase CONFIG_SYS_BOOTM_LEN to 64MB

2021-08-30 Thread Marcel Ziswiler
On Mon, 2021-08-30 at 13:46 -0400, Tom Rini wrote:
> On Mon, Aug 30, 2021 at 03:05:32PM +0000, Marcel Ziswiler wrote:
> > On Mon, 2021-08-30 at 14:18 +0200, Marek Vasut wrote:
> > > On 8/30/21 1:11 PM, Oleksandr Suvorov wrote:
> > > > On Sun, Aug 29, 2021 at 10:55 PM Marek Vasut  wrote:
> > > > > 
> > > > > On 8/29/21 9:39 PM, Oleksandr Suvorov wrote:
> > > > > > The BSP platform LmP supports the board NXP iMX8QM MEK. The
> > > > > > kernel size in LmP exceeds 32Mb. Increase the maximum size
> > > > > > of an uncompressed kernel to fix the following error:
> > > > > >   Uncompressing Kernel Image
> > > > > >   Error: inflate() returned -5
> > > > > >   Image too large: increase CONFIG_SYS_BOOTM_LEN
> > > > > >   Must RESET board to recover
> > > > > > 
> > > > > 
> > > > > Maybe we should increase the default for arm64 instead ? 8 MiB is too 
> > > > > small.
> > > > 
> > > > I completely agree if NXP doesn't have objections.
> > > > @Peng Fan Do you mind?
> > > 
> > > Increase it for all of arm64 , or all of U-Boot even. This has nothing 
> > > to do with NXP.
> > 
> > In general, I agree. However, in practice this can have devastating effects 
> > on stuff as discussed here:
> > 
> > https://marc.info/?l=u-boot=162999598824381
> 
> In that yes, if we allow for larger kernels to be loaded, we also need
> to ensure platforms use sane relocation values, it also needs to be
> considered.

Exactly.

> But even if we have CONFIG_SYS_BOOTM_LEN set large, unless
> we then also disable device tree / initrd relocation, we don't have a
> silent problem?

Well, I am not saying we should NOT increase CONFIG_SYS_BOOTM_LEN. I am just 
cautioning that this may cause
further issue resp. might require further adjustments down the road.


Re: [PATCH 3/3] imx8qm_mek: Increase CONFIG_SYS_BOOTM_LEN to 64MB

2021-08-30 Thread Marcel Ziswiler
On Mon, 2021-08-30 at 17:10 +0200, Marek Vasut wrote:
> On 8/30/21 5:05 PM, Marcel Ziswiler wrote:
> > On Mon, 2021-08-30 at 14:18 +0200, Marek Vasut wrote:
> > > On 8/30/21 1:11 PM, Oleksandr Suvorov wrote:
> > > > On Sun, Aug 29, 2021 at 10:55 PM Marek Vasut  wrote:
> > > > > 
> > > > > On 8/29/21 9:39 PM, Oleksandr Suvorov wrote:
> > > > > > The BSP platform LmP supports the board NXP iMX8QM MEK. The
> > > > > > kernel size in LmP exceeds 32Mb. Increase the maximum size
> > > > > > of an uncompressed kernel to fix the following error:
> > > > > >    Uncompressing Kernel Image
> > > > > >    Error: inflate() returned -5
> > > > > >    Image too large: increase CONFIG_SYS_BOOTM_LEN
> > > > > >    Must RESET board to recover
> > > > > > 
> > > > > 
> > > > > Maybe we should increase the default for arm64 instead ? 8 MiB is too 
> > > > > small.
> > > > 
> > > > I completely agree if NXP doesn't have objections.
> > > > @Peng Fan Do you mind?
> > > 
> > > Increase it for all of arm64 , or all of U-Boot even. This has nothing
> > > to do with NXP.
> > 
> > In general, I agree. However, in practice this can have devastating effects 
> > on stuff as discussed here:
> > 
> > https://marc.info/?l=u-boot=162999598824381
> 
> I suspect the correct solution for that is to use bootm_size and let 
> U-Boot figure out where to place the kernel / DT / etc.

Sure, but how would that work with FIT images e.g. containing kernel binary, 
device tree(s) and an initrd?


Re: [PATCH 3/3] imx8qm_mek: Increase CONFIG_SYS_BOOTM_LEN to 64MB

2021-08-30 Thread Marcel Ziswiler
On Mon, 2021-08-30 at 14:18 +0200, Marek Vasut wrote:
> On 8/30/21 1:11 PM, Oleksandr Suvorov wrote:
> > On Sun, Aug 29, 2021 at 10:55 PM Marek Vasut  wrote:
> > > 
> > > On 8/29/21 9:39 PM, Oleksandr Suvorov wrote:
> > > > The BSP platform LmP supports the board NXP iMX8QM MEK. The
> > > > kernel size in LmP exceeds 32Mb. Increase the maximum size
> > > > of an uncompressed kernel to fix the following error:
> > > >   Uncompressing Kernel Image
> > > >   Error: inflate() returned -5
> > > >   Image too large: increase CONFIG_SYS_BOOTM_LEN
> > > >   Must RESET board to recover
> > > > 
> > > 
> > > Maybe we should increase the default for arm64 instead ? 8 MiB is too 
> > > small.
> > 
> > I completely agree if NXP doesn't have objections.
> > @Peng Fan Do you mind?
> 
> Increase it for all of arm64 , or all of U-Boot even. This has nothing 
> to do with NXP.

In general, I agree. However, in practice this can have devastating effects on 
stuff as discussed here:

https://marc.info/?l=u-boot=162999598824381


<    1   2   3   4   5   6   7   8   9   10   >