platform/kernel/u-boot.git
2 years agommc: fsl_esdhc_spl: Fix checking for number of read sectors
Pali Rohár [Wed, 11 May 2022 18:28:28 +0000 (20:28 +0200)]
mmc: fsl_esdhc_spl: Fix checking for number of read sectors

Commit 0980cbba7b3c ("mmc: fsl_esdhc_spl: pre-PBL: implement redundancy
support") changed number of sectors which are read but did not adjusted
error check.

Fix it and check for if correct number of sectors were read.

Fixes: 0980cbba7b3c ("mmc: fsl_esdhc_spl: pre-PBL: implement redundancy support")
Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2 years agoarm: gic_v2: Skip gic_init_secure when cpu is not in el3
Sai Pavan Boddu [Wed, 11 May 2022 08:39:07 +0000 (10:39 +0200)]
arm: gic_v2: Skip gic_init_secure when cpu is not in el3

This would prevent configuring non-secure regs in case gic security
extensions are not emulated in Qemu.

Signed-off-by: Sai Pavan Boddu <sai.pavan.boddu@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
2 years agotest: dm: spi: Replace _spi_get_bus_and_cs() by spi_get_bus_and_cs() in some case
Patrice Chotard [Wed, 30 Mar 2022 07:33:15 +0000 (09:33 +0200)]
test: dm: spi: Replace _spi_get_bus_and_cs() by spi_get_bus_and_cs() in some case

In case _spi_get_bus_and_cs()'s parameters drv_name and dev_name are
respectively set to NULL and 0, use spi_get_bus_and_cs() instead.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Cc: Marek Behun <marek.behun@nic.cz>
Cc: Jagan Teki <jagan@amarulasolutions.com>
Cc: Vignesh R <vigneshr@ti.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
Cc: Lukasz Majewski <lukma@denx.de>
Cc: Marek Vasut <marex@denx.de>
Cc: Wolfgang Denk <wd@denx.de>
Cc: Simon Glass <sjg@chromium.org>
Cc: Stefan Roese <sr@denx.de>
Cc: "Pali Rohár" <pali@kernel.org>
Cc: Konstantin Porotchkin <kostap@marvell.com>
Cc: Igal Liberman <igall@marvell.com>
Cc: Bin Meng <bmeng.cn@gmail.com>
Cc: Pratyush Yadav <p.yadav@ti.com>
Cc: Sean Anderson <seanga2@gmail.com>
Cc: Anji J <anji.jagarlmudi@nxp.com>
Cc: Biwen Li <biwen.li@nxp.com>
Cc: Priyanka Jain <priyanka.jain@nxp.com>
Cc: Chaitanya Sakinam <chaitanya.sakinam@nxp.com>
2 years agospi: spi_flash_probe_bus_cs() rely on DT for spi speed and mode
Patrice Chotard [Wed, 30 Mar 2022 07:33:14 +0000 (09:33 +0200)]
spi: spi_flash_probe_bus_cs() rely on DT for spi speed and mode

Now, spi_flash_probe_bus_cs() relies on DT for spi speed and mode
and logically calls spi_get_bus_and_cs(). In case spi mode and speed are
not read from DT, make usage of spi_flash_probe() instead.

To sum-up:
 - Previous call tree was:
    spi_flash_probe() -> spi_flash_probe_bus_cs() -> spi_get_bus_and_cs()

 - Current call tree is:
    spi_flash_probe() -> _spi_get_bus_and_cs()
    spi_flash_probe_bus_cs() -> spi_get_bus_and_cs()

This patch impacts the following :
  - cmd/sf.c: if spi mode and/or speed is passed in argument of
    do_spi_flash_probe(), call spi_flash_probe() otherwise call
    spi_flash_probe_bus_cs().

  - drivers/net/fm/fm.c: as by default spi speed and mode was set to
    0 and a comment indicates that speed and mode are read from DT,
    use spi_flash_probe_bus_cs().

  - drivers/net/pfe_eth/pfe_firmware.c: spi speed and mode are not read
    from DT by all platforms using this driver, so keep legacy and replace
    spi_flash_probe_bus_cs() by spi_flash_probe();

  - drivers/net/sni_netsec.c : spi speed and mode are not read from DT,
    so replace spi_flash_probe_bus_cs() by spi_flash_probe().

  - drivers/usb/gadget/max3420_udc.c: Can't find any platform which make
    usage of this driver, nevertheless, keep legacy and replace
    spi_get_bus_and_cs() by _spi_get_bus_and_cs().

  - env/sf.c: a comment indicates that speed and mode are read
    from DT. So use spi_flash_probe_bus_cs().

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Cc: Marek Behun <marek.behun@nic.cz>
Cc: Jagan Teki <jagan@amarulasolutions.com>
Cc: Vignesh R <vigneshr@ti.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
Cc: Lukasz Majewski <lukma@denx.de>
Cc: Marek Vasut <marex@denx.de>
Cc: Wolfgang Denk <wd@denx.de>
Cc: Simon Glass <sjg@chromium.org>
Cc: Stefan Roese <sr@denx.de>
Cc: "Pali Rohár" <pali@kernel.org>
Cc: Konstantin Porotchkin <kostap@marvell.com>
Cc: Igal Liberman <igall@marvell.com>
Cc: Bin Meng <bmeng.cn@gmail.com>
Cc: Pratyush Yadav <p.yadav@ti.com>
Cc: Sean Anderson <seanga2@gmail.com>
Cc: Anji J <anji.jagarlmudi@nxp.com>
Cc: Biwen Li <biwen.li@nxp.com>
Cc: Priyanka Jain <priyanka.jain@nxp.com>
Cc: Chaitanya Sakinam <chaitanya.sakinam@nxp.com>
2 years agospi: spi-uclass: Add new spi_get_bus_and_cs() implementation
Patrice Chotard [Wed, 30 Mar 2022 07:33:13 +0000 (09:33 +0200)]
spi: spi-uclass: Add new spi_get_bus_and_cs() implementation

Move legacy spi_get_bus_and_cs() code to _spi_get_bus_and_cs().

Add new spi_get_bus_and_cs() implementation which rely on DT
for speed and mode and don't need any drv_name nor dev_name
parameters. This will prepare the ground for next patch.

Update all callers to use _spi_get_bus_and_cs() to keep the
same behavior.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Cc: Marek Behun <marek.behun@nic.cz>
Cc: Jagan Teki <jagan@amarulasolutions.com>
Cc: Vignesh R <vigneshr@ti.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
Cc: Lukasz Majewski <lukma@denx.de>
Cc: Marek Vasut <marex@denx.de>
Cc: Wolfgang Denk <wd@denx.de>
Cc: Simon Glass <sjg@chromium.org>
Cc: Stefan Roese <sr@denx.de>
Cc: "Pali Rohár" <pali@kernel.org>
Cc: Konstantin Porotchkin <kostap@marvell.com>
Cc: Igal Liberman <igall@marvell.com>
Cc: Bin Meng <bmeng.cn@gmail.com>
Cc: Pratyush Yadav <p.yadav@ti.com>
Cc: Sean Anderson <seanga2@gmail.com>
Cc: Anji J <anji.jagarlmudi@nxp.com>
Cc: Biwen Li <biwen.li@nxp.com>
Cc: Priyanka Jain <priyanka.jain@nxp.com>
Cc: Chaitanya Sakinam <chaitanya.sakinam@nxp.com>
2 years agopowerpc: mpc85xx: Fix CONFIG_OF_EMBED support for NOR booting
Pali Rohár [Mon, 2 May 2022 16:36:39 +0000 (18:36 +0200)]
powerpc: mpc85xx: Fix CONFIG_OF_EMBED support for NOR booting

mpc85xx NOR binary contains also reset vector and therefore option
CONFIG_MPC85XX_HAVE_RESET_VECTOR must be defined.

When build system uses binman, it takes care of constructing final image
which consist of u-boot-without-reset-vector, DTB and reset-vector.

CONFIG_OF_EMBED does not use binman, there is no external DTB and Makefile
produce directly final u-boot.bin binary.

So in this case mpc85xx reset vector must not be stripped from the final
u-boot.bin binary. Fix it.

Signed-off-by: Pali Rohár <pali@kernel.org>
2 years agopowerpc: mpc85xx: Fix CONFIG_OF_SEPARATE support for NOR booting
Pali Rohár [Mon, 2 May 2022 16:36:38 +0000 (18:36 +0200)]
powerpc: mpc85xx: Fix CONFIG_OF_SEPARATE support for NOR booting

Commit e8c0e0064c8a ("powerpc: mpc85xx: Fix CONFIG_OF_SEPARATE support")
fixed SD card booting on mpc85xx boards but broke NOR booting on these
boards. Reason is that U-Boot build system for NOR images uses binman and
this binman ignores alignment defined in linker script. Instead it has own
config file where is alignment defined.

Fix binman alignment for mpc85xx boards to match what is _now_ defined in
linker script.

This change fixes building of U-Boot for NOR booting on P2020 board.

Fixes: e8c0e0064c8a ("powerpc: mpc85xx: Fix CONFIG_OF_SEPARATE support")
Signed-off-by: Pali Rohár <pali@kernel.org>
2 years agofs/squashfs: use lldiv function for math
Sean Nyekjaer [Thu, 12 May 2022 18:37:14 +0000 (20:37 +0200)]
fs/squashfs: use lldiv function for math

When compling for x86:
ld.bfd: fs/squashfs/sqfs.o: in function `sqfs_read':
u-boot/fs/squashfs/sqfs.c:1443: undefined reference to `__udivmoddi4'
ld.bfd: u-boot/fs/squashfs/sqfs.c:1521: undefined reference to `__udivmoddi4'

Signed-off-by: Sean Nyekjaer <sean.nyekjaer.ext@siemensgamesa.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Pali Rohár <pali@kernel.org>
2 years agoMerge tag 'u-boot-imx-20220523' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx
Tom Rini [Mon, 23 May 2022 13:25:39 +0000 (09:25 -0400)]
Merge tag 'u-boot-imx-20220523' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx

u-boot-imx-20220523
-------------------

CI: https://source.denx.de/u-boot/custodians/u-boot-imx/-/pipelines/12087

Additionally to u-boot-imx20200520:

- DH MX8MP
- i.MX GPIO: reading GPIO when direction is output
- Menlo i.MX53: switch to DM

And from u-boot-imx20200520:

- fix Verdin hang
- add pca9450 regulator
- conversion to DM_SERIAL
- NAND block handling
- fix crypto
- enable cache on some boards
- add ACC board (MX6)

2 years agoARM: dts: imx: Add support for DH electronics i.MX8M Plus DHCOM and PDK2
Marek Vasut [Sat, 21 May 2022 14:56:26 +0000 (16:56 +0200)]
ARM: dts: imx: Add support for DH electronics i.MX8M Plus DHCOM and PDK2

Add support for DH electronics i.MX8M Plus DHCOM SoM on PDK2 carrier board.
Currently supported are serial console, EQoS and FEC ethernets, eMMC, SD,
SPI NOR and USB 3.0 host.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Fabio Estevam <festevam@denx.de>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
2 years agogpio: rgpio2p: Enhance reading of GPIO pin value
Christoph Fritz [Tue, 5 Apr 2022 10:29:30 +0000 (12:29 +0200)]
gpio: rgpio2p: Enhance reading of GPIO pin value

Add support for reading GPIO pin value when function is output.
With this patch applied, gpio toggle command is working.

Signed-off-by: Christoph Fritz <chf.fritz@googlemail.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Fabio Estevam <festevam@denx.de>
2 years agoARM: imx: mx5: Convert MX53 Menlo board to DM I2C and DM RTC
Marek Vasut [Sun, 8 May 2022 00:19:12 +0000 (02:19 +0200)]
ARM: imx: mx5: Convert MX53 Menlo board to DM I2C and DM RTC

Convert the board to DM I2C and DM RTC. This leads to removal of board
side iomuxc configuration, which is now done using pin control driver,
and conversion of board side legacy I2C accessors to DM ones.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
2 years agoMerge https://source.denx.de/u-boot/custodians/u-boot-usb
Tom Rini [Sat, 21 May 2022 02:07:56 +0000 (22:07 -0400)]
Merge https://source.denx.de/u-boot/custodians/u-boot-usb

2 years agousb: dwc3: Fix non-usb3 configurations
Jan Kiszka [Mon, 25 Apr 2022 11:26:45 +0000 (13:26 +0200)]
usb: dwc3: Fix non-usb3 configurations

Missing nodes may also be signaled via -ENODATA. We need to check for
that to prevent failing in non-usb3 setups.

Furthermore, dev.phy must be NULL'ed in case usb3-phy was not found.

Fixes: 142d50fbce7c ("usb: dwc3: Add support for usb3-phy PHY configuration")
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2 years agoMerge tag 'u-boot-stm32-20220520' of https://source.denx.de/u-boot/custodians/u-boot-stm
Tom Rini [Fri, 20 May 2022 17:50:11 +0000 (13:50 -0400)]
Merge tag 'u-boot-stm32-20220520' of https://source.denx.de/u-boot/custodians/u-boot-stm

- spi: fix busy bit check in stm32_qspi driver
- stm32mp15: configure Buck3 voltage per PMIC NVM on Avenger96 board

2 years agoARM: imx6: Adapt device tree selection in DH board file
Philip Oberfichtner [Fri, 20 May 2022 08:46:26 +0000 (10:46 +0200)]
ARM: imx6: Adapt device tree selection in DH board file

Before this commit device tree selection could rely solely on
differentiating the iMX6 processor variant Q and DL. After adding two new
carrier boards, the DRC02 and the picoITX, the interchangeability of SoMs
makes this approach infeasible.

It is now required to specify the carrier board (dhcom-drc02,
dhcom-picoitx or dhcom-pdk2) at compile time using
CONFIG_DEFAULT_DEVICETREE. The SoM is determined at runtime as before.

Signed-off-by: Philip Oberfichtner <pro@denx.de>
2 years agoARM: dts: imx: Configure FEC for iMX6QDL DRC02
Philip Oberfichtner [Fri, 20 May 2022 08:46:25 +0000 (10:46 +0200)]
ARM: dts: imx: Configure FEC for iMX6QDL DRC02

Add a u-boot dtsi for configuring the FEC node of the DH DRC02.

Reviewed-by: Marek Vasut <marex@denx.de>
Signed-off-by: Philip Oberfichtner <pro@denx.de>
2 years agoARM: dts: imx: Configure FEC for iMX6QDL picoITX
Philip Oberfichtner [Fri, 20 May 2022 08:46:24 +0000 (10:46 +0200)]
ARM: dts: imx: Configure FEC for iMX6QDL picoITX

Add a u-boot dtsi for configuring the FEC node of the DH picoITX.

Reviewed-by: Marek Vasut <marex@denx.de>
Signed-off-by: Philip Oberfichtner <pro@denx.de>
2 years agoARM: dts: imx: Simplify fec node for iMX6QDL DHCOM boards
Philip Oberfichtner [Fri, 20 May 2022 08:46:23 +0000 (10:46 +0200)]
ARM: dts: imx: Simplify fec node for iMX6QDL DHCOM boards

Firstly the FEC can now use the regulator reg_eth_vio from
imx6qdl-dhcom-som.dtsi instead of defining its own.

Secondly the &fec node is moved to the more generic SoM device tree
file, because it can be used by multiple boards.

Reviewed-by: Marek Vasut <marex@denx.de>
Signed-off-by: Philip Oberfichtner <pro@denx.de>
2 years agoARM: imx6: Remove CONFIG_FEC_MXC_PHYADDR from DH header
Philip Oberfichtner [Fri, 20 May 2022 08:46:22 +0000 (10:46 +0200)]
ARM: imx6: Remove CONFIG_FEC_MXC_PHYADDR from DH header

Use phy address from device tree instead of CONFIG_FEC_MXC_PHYADDR from
board header. This is required, because the DH picoITX and DRC02 boards
require different settings than PDK2. The corresponding 'phy-handle'
device tree properties are already there.

I tested this change on picoITX and DRC02, but on PDK2 it is untested.

Reviewed-by: Marek Vasut <marex@denx.de>
Signed-off-by: Philip Oberfichtner <pro@denx.de>
2 years agoARM: dts: imx: Migrate iMX6QDL picoITX DTs from Linux
Philip Oberfichtner [Fri, 20 May 2022 08:46:21 +0000 (10:46 +0200)]
ARM: dts: imx: Migrate iMX6QDL picoITX DTs from Linux

Migrate DH picoITX device trees from Linux commit 42226c989789
(tag v5.18-rc7). No changes have been made, the DTs are exact copies.
Furthermore add the DTB to dh_imx6_defconfig.

Reviewed-by: Marek Vasut <marex@denx.de>
Signed-off-by: Philip Oberfichtner <pro@denx.de>
2 years agoARM: dts: imx: Migrate iMX6QDL DRC02 DTs from Linux
Philip Oberfichtner [Fri, 20 May 2022 08:46:20 +0000 (10:46 +0200)]
ARM: dts: imx: Migrate iMX6QDL DRC02 DTs from Linux

Migrate DH DRC02 device trees from Linux commit 42226c989789
(tag v5.18-rc7). No changes have been made, the DTs are exact copies.
Furthermore add the DTB to dh_imx6_defconfig.

Reviewed-by: Marek Vasut <marex@denx.de>
Signed-off-by: Philip Oberfichtner <pro@denx.de>
2 years agoARM: imx6: Fix broken DT path in DH board file
Philip Oberfichtner [Fri, 20 May 2022 08:46:19 +0000 (10:46 +0200)]
ARM: imx6: Fix broken DT path in DH board file

In the DH electronics iMX6 board file fix the outdated eeprom path by
using a DT label instead.

The label has been newly created for all iMX6QDL DHCOM boards.

Reviewed-by: Marek Vasut <marex@denx.de>
Signed-off-by: Philip Oberfichtner <pro@denx.de>
2 years agopmic: pca9450: Add regulator driver
Marek Vasut [Fri, 20 May 2022 03:10:17 +0000 (05:10 +0200)]
pmic: pca9450: Add regulator driver

Add PCA9450 regulator driver. This is complementary driver for the BUCKn
and LDOn regulators provided by the PCA9450 PMIC driver. Currently the
driver permits reading the settngs and configuring the BUCKn and LDOn
regulators.

Reviewed-by: Fabio Estevam <festevam@denx.de>
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Fabio Estevam <festevam@denx.de>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
2 years agopmic: pca9450: Add upstream regulators subnode match
Marek Vasut [Fri, 20 May 2022 03:10:16 +0000 (05:10 +0200)]
pmic: pca9450: Add upstream regulators subnode match

The upstream DT regulators node subnodes are named BUCKn and LDOn,
the downstream DT regulators node subnodes are named buckn and ldon,
add the upstream match.

Reviewed-by: Fabio Estevam <festevam@denx.de>
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Fabio Estevam <festevam@denx.de>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
2 years agoimx: imx8mp_rsb3720a1: convert to DM_SERIAL
Peng Fan [Thu, 5 May 2022 07:43:28 +0000 (15:43 +0800)]
imx: imx8mp_rsb3720a1: convert to DM_SERIAL

Enable CONFIG_DM_SERIAL. uart2 and its pinmux was already
marked with u-boot,dm-spl.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Fabio Estevam <festevam@denx.de>
2 years agoARM: imx8mm: verdin-imx8mm: fix board hang in spl
Marcel Ziswiler [Mon, 16 May 2022 22:21:45 +0000 (00:21 +0200)]
ARM: imx8mm: verdin-imx8mm: fix board hang in spl

Move the preloader_console_init() call after spl_early_init() to avoid
board hang in SPL.

While at it remove explicit in-code console/debug UART pinmuxing (uart1
and its pinmuxing are already marked as u-boot,dm-spl via device tree).

Fixes: 4551e1898769 ("configs: verdin-imx8mm: verdin-imx8mp: enable dm serial")
Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2 years agoimx8mp_rsb3720a1: Enable cache in SPL
Fabio Estevam [Thu, 19 May 2022 11:59:28 +0000 (08:59 -0300)]
imx8mp_rsb3720a1: Enable cache in SPL

There is no reason for disabling I-cache and D-cache
in SPL.

Remove the unneeded CONFIG_SPL_SYS_ICACHE_OFF and
CONFIG_SPL_SYS_DCACHE_OFF options.

Signed-off-by: Fabio Estevam <festevam@denx.de>
2 years agocgtqmx8: Enable cache in SPL
Fabio Estevam [Thu, 19 May 2022 11:59:27 +0000 (08:59 -0300)]
cgtqmx8: Enable cache in SPL

There is no reason for disabling I-cache and D-cache
in SPL.

Remove the unneeded CONFIG_SPL_SYS_ICACHE_OFF and
CONFIG_SPL_SYS_DCACHE_OFF options.

Signed-off-by: Fabio Estevam <festevam@denx.de>
2 years agoimx8mm-cl-iot-gate: Enable cache in SPL
Fabio Estevam [Thu, 19 May 2022 11:59:26 +0000 (08:59 -0300)]
imx8mm-cl-iot-gate: Enable cache in SPL

There is no reason for disabling I-cache and D-cache
in SPL.

Remove the unneeded CONFIG_SPL_SYS_ICACHE_OFF and
CONFIG_SPL_SYS_DCACHE_OFF options.

Signed-off-by: Fabio Estevam <festevam@denx.de>
Reviewed-by: Michael Trimarchi <michael@amarulasolutions.com>
2 years agobosch: Add initial board support for ACC
Philip Oberfichtner [Thu, 19 May 2022 11:52:48 +0000 (13:52 +0200)]
bosch: Add initial board support for ACC

The Bosch ACC (Air Center Control) Board is based on the i.MX6D.

The device tree is copied from Linux, see [1]. The only difference
compared to the Linux DT is the removal of usbphynop properties. They are
defined in the Linux version of imx6qdl.dtsi, but not in the u-boot
version.

[1] Commit 6192cf8ac082 from
    git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux.git

Signed-off-by: Philip Oberfichtner <pro@denx.de>
2 years agoimx: imx8mn_smm_s2/s2pro: Enable TrustZone
Michael Trimarchi [Sun, 15 May 2022 09:41:09 +0000 (11:41 +0200)]
imx: imx8mn_smm_s2/s2pro: Enable TrustZone

When the board was added, enabling tzc380 was left off by
mistake. The optee was tested with the following configuration
in s2pro

+ firmware {
+ optee {
+ compatible = "linaro,optee-tz";
+ method = "smc";
+ };
+ };
+
+ reserved-memory {
+ #address-cells = <2>;
+ #size-cells = <2>;
+ ranges;
+
+ /* 6MiB */
+ optee_core@5f800000 {
+ reg = <0x00 0x5f800000 0x00 0x600000>;
+ };
+
+ /* 2MiB */
+ optee_shm@5fe00000 {
+ reg = <0x00 0x5fe00000 0x00 0x200000>;
+ };
+ };
+

Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
2 years agospl: spl_nand: Fix bad block handling in fitImage
Michael Trimarchi [Sun, 15 May 2022 09:35:33 +0000 (11:35 +0200)]
spl: spl_nand: Fix bad block handling in fitImage

If the fitImage has some bad block in fit image area, the
offset must be recalulcated. This should be done always.
After implementing it in mxs now is possible to call the function
even for that platform.

Cc: Fabio Estevam <festevam@gmail.com>
Tested-By: Tim Harvey <tharvey@gateworks.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
2 years agoarm: mach-imx: cmd_nandbcb fix bad block handling
Michael Trimarchi [Sun, 15 May 2022 09:35:32 +0000 (11:35 +0200)]
arm: mach-imx: cmd_nandbcb fix bad block handling

The badblock should be skipped properly in reading and writing.
Fix the logic. The bcb struct is written, skipping the bad block,
so we need to read using the same logic. This was tested create
bad block in the area and then flash it and read it back.

Acked-by: Han Xu <han.xu@nxp.com>
Tested-By: Tim Harvey <tharvey@gateworks.com>
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
2 years agomtd: nand: mxs_nand_spl: Fix bad block skipping
Michael Trimarchi [Sun, 15 May 2022 09:35:31 +0000 (11:35 +0200)]
mtd: nand: mxs_nand_spl: Fix bad block skipping

The specific implementation was having bug. Those bugs are since
the beginning of the implementation. Some manufactures can already
experience this bug in their SPL code. This bug can be more visible on
architecture that has complicated boot process like imx8mn. Older
version of uboot can be affected if the bad block
appear in correspoding of the beginning of u-boot image. In order to
adjust the function we scan from the first erase block.

The problematic part of old code was in this part:

while (is_badblock(mtd, offs, 1)) {
           page = page + nand_page_per_block;
          /* Check i we've reached the end of flash. */
          if (page >= mtd->size >> chip->page_shift) {
                      free(page_buf);
                      return -ENOMEM;
         }
}

Even we fix it adding increment of the offset of one erase block size
, we don't fix the problem, because the first erase block where the
image start is not checked. The code was tested on an imx8mn where
the boot rom api was not able to skip it. This code is used by other
architecures like imx6 and imx8mm

Cc: Han Xu <han.xu@nxp.com>
Cc: Fabio Estevam <festevam@gmail.com>
Acked-by: Han Xu <han.xu@nxp.com>
Tested-By: Tim Harvey <tharvey@gateworks.com>
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
2 years agonand: raw: mxs_nand: Fix specific hook registration
Michael Trimarchi [Sun, 15 May 2022 09:35:30 +0000 (11:35 +0200)]
nand: raw: mxs_nand: Fix specific hook registration

Move the hook after nand_scan_tail is called. The hook must be replaced
to the mxs specific one but those must to be assignment later in the
probe function.

With this fix markbad is working again. Before this change:

nand markbad 0xDEC00
NXS NAND: Writing OOB isn't supported
NXS NAND: Writing OOB isn't supported
block 0x000dec00 NOT marked as bad! ERROR 0

Cc: Han Xu <han.xu@nxp.com>
Cc: Fabio Estevam <festevam@gmail.com>
Acked-by: Han Xu <han.xu@nxp.com>
Tested-By: Tim Harvey <tharvey@gateworks.com>
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
2 years agocrypto/fsl: fsl_hash: Fix dcache issue in caam_hash_finish
Gaurav Jain [Wed, 11 May 2022 08:53:19 +0000 (14:23 +0530)]
crypto/fsl: fsl_hash: Fix dcache issue in caam_hash_finish

HW accelerated hash operations are giving incorrect hash output.
so add flush and invalidate for input/output hash buffers.

Fixes: 94e3c8c4fd (crypto/fsl - Add progressive hashing support using hardware acceleration.)
Signed-off-by: Gaurav Jain <gaurav.jain@nxp.com>
2 years agoi.MX8ULP: add display_ele_fw_version api
Gaurav Jain [Wed, 11 May 2022 08:37:55 +0000 (14:07 +0530)]
i.MX8ULP: add display_ele_fw_version api

implement get f/w version api.
print ele f/w version in spl.

Signed-off-by: Gaurav Jain <gaurav.jain@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Pankaj Gupta <pankaj.gupta@nxp.com>
2 years agocaam: Fix crash in case caam_jr_probe failed
Ye Li [Wed, 11 May 2022 08:26:20 +0000 (13:56 +0530)]
caam: Fix crash in case caam_jr_probe failed

If probing caam_jr returns failure, the variable "dev" will not be
initialized, so we can't use dev->name for the error print.
Otherwise it will cause crash.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Gaurav Jain <gaurav.jain@nxp.com>
2 years agokontron-sl-mx8mm: Select the CONFIG_CMD_UNZIP option
Fabio Estevam [Tue, 10 May 2022 23:06:27 +0000 (20:06 -0300)]
kontron-sl-mx8mm: Select the CONFIG_CMD_UNZIP option

Select the CMD_UNZIP option so that the 'gzwrite' command
can be used to flash wic.gz image into the eMMC.

Signed-off-by: Fabio Estevam <festevam@denx.de>
Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de>
2 years agousb: xhci-dwc3: Support role switch default role
Mark Kettenis [Tue, 19 Apr 2022 19:06:33 +0000 (21:06 +0200)]
usb: xhci-dwc3: Support role switch default role

When the device tree indicates support for role switching through
the "usb-role-switch" property, take the "role-switch-default-mode"
property into account when deciding which role to put the
controller into.

This makes USB devices work on Apple M1 systems where the device
tree may include a "dr_mode" property that is set to "otg", but
where we need to put the controller into "host" mode to see
devices connected to the type-C ports.

Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
2 years agoimx: toradex/verdin-imx8mm/p: cleanup board watchdog code
Peng Fan [Thu, 5 May 2022 11:06:12 +0000 (19:06 +0800)]
imx: toradex/verdin-imx8mm/p: cleanup board watchdog code

pinctrl_wdog already marked u-boot,dm-spl, so clean up board code.

The set_wdog_reset() function is not necessary as this is handled by
the imx_watchdog.c driver due to the 'fsl,ext-reset-output' property
being set.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
2 years agoimx: verdin-imx8mm/p: cleanup board watchdog code
Peng Fan [Thu, 5 May 2022 11:06:11 +0000 (19:06 +0800)]
imx: verdin-imx8mm/p: cleanup board watchdog code

pinctrl_wdog already marked u-boot,dm-spl, so clean up board code.

The set_wdog_reset() function is not necessary as this is handled by
the imx_watchdog.c driver due to the 'fsl,ext-reset-output' property
being set.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
2 years agoimx: imx8mn_smm_s2: clean up board watchdog code
Peng Fan [Thu, 5 May 2022 11:06:06 +0000 (19:06 +0800)]
imx: imx8mn_smm_s2: clean up board watchdog code

pinctrl_wdog already marked u-boot,dm-spl, so clean up board code.

The set_wdog_reset() function is not necessary as this is handled by
the imx_watchdog.c driver due to the 'fsl,ext-reset-output' property
being set.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Tested-by: Ariel D'Alessandro <ariel.dalessandro@collabora.com>
2 years agoimx: imx8mm-mx8menlo: drop unneeded watchdog settings
Peng Fan [Thu, 5 May 2022 11:06:03 +0000 (19:06 +0800)]
imx: imx8mm-mx8menlo: drop unneeded watchdog settings

pinctrl_wdog as u-boot,dm-spl already marked in imx8mm-verdin-u-boot.dtsi,

The set_wdog_reset() function is not necessary as this is handled by
the imx_watchdog.c driver due to the 'fsl,ext-reset-output' property
being set.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Marek Vasut <marex@denx.de>
2 years agoimx: imx8mp_evk: enable pinctrl_wdog in SPL
Peng Fan [Thu, 5 May 2022 11:05:59 +0000 (19:05 +0800)]
imx: imx8mp_evk: enable pinctrl_wdog in SPL

Mark pinctrl_wdog as u-boot,dm-spl to clean up board code,

The set_wdog_reset() function is not necessary as this is handled by
the imx_watchdog.c driver due to the 'fsl,ext-reset-output' property
being set.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
2 years agoimx: imx8mm_evk: enable pinctrl_wdog in SPL
Peng Fan [Thu, 5 May 2022 11:05:58 +0000 (19:05 +0800)]
imx: imx8mm_evk: enable pinctrl_wdog in SPL

Mark pinctrl_wdog as u-boot,dm-spl to clean up board code,

The set_wdog_reset() function is not necessary as this is handled by
the imx_watchdog.c driver due to the 'fsl,ext-reset-output' property
being set.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
2 years agoimx: imx8mn_evk: enable pinctrl_wdog in SPL
Peng Fan [Thu, 5 May 2022 11:05:57 +0000 (19:05 +0800)]
imx: imx8mn_evk: enable pinctrl_wdog in SPL

Mark pinctrl_wdog as u-boot,dm-spl to clean up board code,

The set_wdog_reset() function is not necessary as this is handled by
the imx_watchdog.c driver due to the 'fsl,ext-reset-output' property
being set.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
2 years agoimx: imx8mq-phanbell: enable CONFIG_DM_SERIAL
Peng Fan [Thu, 5 May 2022 07:43:41 +0000 (15:43 +0800)]
imx: imx8mq-phanbell: enable CONFIG_DM_SERIAL

Marked related nodes as u-boot,dm-spl for serial driver model
Enable CONFIG_DM_SERIAL

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Fabio Estevam <festevam@denx.de>
2 years agoimx: imx8mq-pico: enable CONFIG_DM_SERIAL
Peng Fan [Thu, 5 May 2022 07:43:40 +0000 (15:43 +0800)]
imx: imx8mq-pico: enable CONFIG_DM_SERIAL

Marked related nodes as u-boot,dm-spl for serial driver model
Enable CONFIG_DM_SERIAL

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Fabio Estevam <festevam@denx.de>
2 years agoimx: imx8mq-cm: enable CONFIG_DM_SERIAL
Peng Fan [Thu, 5 May 2022 07:43:39 +0000 (15:43 +0800)]
imx: imx8mq-cm: enable CONFIG_DM_SERIAL

Marked related nodes as u-boot,dm-spl for serial driver model
Enable CONFIG_DM_SERIAL

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Fabio Estevam <festevam@denx.de>
2 years agoimx: dts: move common changes to imx8mq-u-boot.dtsi
Peng Fan [Thu, 5 May 2022 07:43:38 +0000 (15:43 +0800)]
imx: dts: move common changes to imx8mq-u-boot.dtsi

Move some common changes to imx8mq-u-boot.dtsi, so others could reuse it

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Fabio Estevam <festevam@denx.de>
2 years agoimx: imx8mm_edm_sbc: Enable SPL_DM_SERIAL
Peng Fan [Thu, 5 May 2022 07:43:36 +0000 (15:43 +0800)]
imx: imx8mm_edm_sbc: Enable SPL_DM_SERIAL

Enable CONFIG_SPL_DM_SERIAL. uart and its pinmux was already
marked with u-boot,dm-spl.
Move preloader_console_init after spl_early_init to make sure driver
model work.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Fabio Estevam <festevam@denx.de>
2 years agoimx: imx8mm_mx8menlo: Enable DM_SERIAL
Peng Fan [Thu, 5 May 2022 07:43:30 +0000 (15:43 +0800)]
imx: imx8mm_mx8menlo: Enable DM_SERIAL

Enable CONFIG_DM_SERIAL. uart2 and its pinmux was already
marked with u-boot,dm-spl.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Fabio Estevam <festevam@denx.de>
2 years agoboard: gateworks: gw_ventana: remove obsolete file
Tim Harvey [Fri, 29 Apr 2022 21:05:22 +0000 (14:05 -0700)]
board: gateworks: gw_ventana: remove obsolete file

commit 61cf22505339 ("board: gateworks: gw_ventana: use comomn GSC driver")
moved to the common GSC driver and moved remaining board-specific
functions to eeprom.c. The functions in gsc.c are no longer used and it
was removed from the Makefile but the file itself was not removed.
Remove it now.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2 years agoboard: gateworks: gw_ventana: add support for GPY111 PHY
Tim Harvey [Fri, 29 Apr 2022 20:51:02 +0000 (13:51 -0700)]
board: gateworks: gw_ventana: add support for GPY111 PHY

The MaxLinear GPY111 PHY is being used on some boards due to part
availability. Add support for this PHY which requires a longer reset
post-delay and RGMII delay configuration.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2 years agoboard: gateworks: venice: enable SPL_DM_SERIAL
Tim Harvey [Fri, 29 Apr 2022 19:36:25 +0000 (12:36 -0700)]
board: gateworks: venice: enable SPL_DM_SERIAL

The uart2 and its pinmux are already marked with u-boot,dm-spl but we
need to move the call to preloader_console_init() after spl_early_init()
to avoid a board hang as dm can't be used until after spl_early_init()
due to the uart driver not enabling the uart clock.

Remove the manual config of the UART pinmux now that it is no longer
needed.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2 years agoconfigs: remove FEC_QUIRK_ENET_MAC from imx8m configs
Tim Harvey [Fri, 29 Apr 2022 18:17:52 +0000 (11:17 -0700)]
configs: remove FEC_QUIRK_ENET_MAC from imx8m configs

FEC_QUIRK_ENET_MAC is defined in the imx-regs.h include file and thus
does not need to be defined in the various board config includes.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2 years agoconfigs: imx8mp_venice: add FEC_QUIRK_ENET_MAC
Tim Harvey [Fri, 29 Apr 2022 17:08:32 +0000 (10:08 -0700)]
configs: imx8mp_venice: add FEC_QUIRK_ENET_MAC

The IMX8MP SoC FEC needs to have the FEC_QUIRK_ENET_MAC defined.

Fixes: commit 2395625209cc ("board: gateworks: venice: add imx8mp-venice-gw740x support")
Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2 years agoconfigs: imx8m{m, n}_venice: remove unneeded CONFIG_FEC_MXC_PHYADDR
Tim Harvey [Fri, 29 Apr 2022 16:54:04 +0000 (09:54 -0700)]
configs: imx8m{m, n}_venice: remove unneeded CONFIG_FEC_MXC_PHYADDR

The IMX8M based Venice boards all have device-tree fec nodes that
use proper dt with a phy-handle pointing to a phy with reg assigned
to the proper phy address.

There is no need to keep using the CONFIG_FEC_MXC_PHYADDR hack when
a proper dt is used - remove it.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2 years agoimx: imx8m: drop uneeded check
Peng Fan [Fri, 29 Apr 2022 08:18:49 +0000 (16:18 +0800)]
imx: imx8m: drop uneeded check

All i.MX8M needs TZASC ID SWAP set and locked, no need the check to
waste cpu cycles.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>
2 years agoimx: imx8m: add rproc_att
Peng Fan [Fri, 29 Apr 2022 08:03:14 +0000 (16:03 +0800)]
imx: imx8m: add rproc_att

With rpoc_att, bootaux able to kick elf file for M core

Signed-off-by: Peng Fan <peng.fan@nxp.com>
2 years agoimx: bootaux: get stack from elf file
Peng Fan [Fri, 29 Apr 2022 08:03:13 +0000 (16:03 +0800)]
imx: bootaux: get stack from elf file

To i.MX8, M core stack is pre-coded in source code, so need to get it
before kicking M core. The stack pointer is stored in the first word of
the first PT_LOAD section __isr_vector. So use a num to index the
section loading.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
2 years agoimx: bootaux: add missing newline
Peng Fan [Fri, 29 Apr 2022 08:03:12 +0000 (16:03 +0800)]
imx: bootaux: add missing newline

Add missing newline

Signed-off-by: Peng Fan <peng.fan@nxp.com>
2 years agoimx: bootaux: cleanup code
Peng Fan [Fri, 29 Apr 2022 08:03:11 +0000 (16:03 +0800)]
imx: bootaux: cleanup code

Use if (CONFIG_IS_ENABLED()) to make code cleaner
Enable elf support for i.MX8M

Signed-off-by: Peng Fan <peng.fan@nxp.com>
2 years agoimx8m: fix reading of DDR4 MR registers
Rasmus Villemoes [Mon, 25 Apr 2022 14:22:48 +0000 (16:22 +0200)]
imx8m: fix reading of DDR4 MR registers

I was trying to employ lpddr4_mr_read() to something similar to what
the imx8mm-cl-iot-gate board is doing for auto-detecting the RAM
type. However, the version in drivers/ddr/imx/imx8m/ddrphy_utils.c
differs from the private one used by that board in how it extracts the
byte value, and I was only getting zeroes. Adding a bit of debug
printf'ing gives me

 tmp = 0x00ffff00
 tmp = 0x00070700
 tmp = 0x00000000
 tmp = 0x00101000

and indeed I was expecting a (combined) value of 0xff070010 (0xff
being Manufacturer ID for Micron). I can't find any documentation that
says how the values are supposed to be read, but clearly the iot-gate
definition is the right one, both for its use case as well as my
imx8mp-based board.

So lift the private definition of lpddr4_mr_read() from the
imx8mm-cl-iot-gate board code to ddrphy_utils.c, and add a declaration
in the ddr.h header where e.g. get_trained_CDD() is already declared.

This has only been compile-tested for the imx8mm-cl-iot-gate
board (since I don't have the hardware), but since I've merely moved
its definition of lpddr4_mr_read(), I'd be surprised if it changed
anything for that board.

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Tested-by: Ying-Chun Liu (PaulLiu) <paul.liu@linaro.org>
Reviewed-by: Fabio Estevam <festevam@denx.de>
2 years agoARM: imx: imx31: Introduce and use UART_BASE_ADDR(n)
Marek Vasut [Sun, 24 Apr 2022 21:44:05 +0000 (23:44 +0200)]
ARM: imx: imx31: Introduce and use UART_BASE_ADDR(n)

Introduce helper macro UART_BASE_ADDR(n), which returns Nth UART base
address. Convert all board configurations to this new macro. This is the
first step toward switching CONFIG_MXC_UART_BASE to Kconfig. This is a
clean up, no functional change.

The new macro contains compile-time test to verify N is in suitable
range. The test works such that it multiplies constant N by constant
double-negation of size of a non-empty structure, i.e. it multiplies
constant N by constant 1 in each successful compilation case.

The non-empty structure may contain C11 _Static_assert(), make use of
this and place the kernel variant of static assert in there, so that
it performs the compile-time check for N in the correct range. Note
that it is not possible to directly use static_assert in compound
statements, hence this convoluted construct.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Fabio Estevam <festevam@denx.de>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
2 years agoARM: imx: imx27: Introduce and use UART_BASE_ADDR(n)
Marek Vasut [Sun, 24 Apr 2022 21:44:04 +0000 (23:44 +0200)]
ARM: imx: imx27: Introduce and use UART_BASE_ADDR(n)

Introduce helper macro UART_BASE_ADDR(n), which returns Nth UART base
address. Convert all board configurations to this new macro. This is the
first step toward switching CONFIG_MXC_UART_BASE to Kconfig. This is a
clean up, no functional change.

The new macro contains compile-time test to verify N is in suitable
range. The test works such that it multiplies constant N by constant
double-negation of size of a non-empty structure, i.e. it multiplies
constant N by constant 1 in each successful compilation case.

The non-empty structure may contain C11 _Static_assert(), make use of
this and place the kernel variant of static assert in there, so that
it performs the compile-time check for N in the correct range. Note
that it is not possible to directly use static_assert in compound
statements, hence this convoluted construct.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Fabio Estevam <festevam@denx.de>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
2 years agoARM: imx: imx8m: Introduce and use UART_BASE_ADDR(n)
Marek Vasut [Sun, 24 Apr 2022 21:44:03 +0000 (23:44 +0200)]
ARM: imx: imx8m: Introduce and use UART_BASE_ADDR(n)

Introduce helper macro UART_BASE_ADDR(n), which returns Nth UART base
address. Convert all board configurations to this new macro. This is the
first step toward switching CONFIG_MXC_UART_BASE to Kconfig. This is a
clean up, no functional change.

The new macro contains compile-time test to verify N is in suitable
range. The test works such that it multiplies constant N by constant
double-negation of size of a non-empty structure, i.e. it multiplies
constant N by constant 1 in each successful compilation case.

The non-empty structure may contain C11 _Static_assert(), make use of
this and place the kernel variant of static assert in there, so that
it performs the compile-time check for N in the correct range. Note
that it is not possible to directly use static_assert in compound
statements, hence this convoluted construct.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Fabio Estevam <festevam@denx.de>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
2 years agomx6sllevk: Remove duplicated "mmc dev" command
Fabio Estevam [Fri, 22 Apr 2022 17:17:57 +0000 (14:17 -0300)]
mx6sllevk: Remove duplicated "mmc dev" command

The "mmc dev ${mmcdev}" command is done twice.

Remove one ocurrence to avoid the duplication.

Signed-off-by: Fabio Estevam <festevam@denx.de>
2 years agomx6slevk: Remove duplicated "mmc dev" command
Fabio Estevam [Fri, 22 Apr 2022 17:17:56 +0000 (14:17 -0300)]
mx6slevk: Remove duplicated "mmc dev" command

The "mmc dev ${mmcdev}" command is done twice.

Remove one ocurrence to avoid the duplication.

Signed-off-by: Fabio Estevam <festevam@denx.de>
2 years agoi.MX8 crypto/fsl: Enable fsl CAAM rng driver
Gaurav Jain [Fri, 22 Apr 2022 11:08:34 +0000 (16:38 +0530)]
i.MX8 crypto/fsl: Enable fsl CAAM rng driver

rng driver enabled to read random number using caam.

Signed-off-by: Gaurav Jain <gaurav.jain@nxp.com>
2 years agoARM: dts: imx: Use 100 kHz I2C2 on Data Modul i.MX8M Mini eDM SBC
Marek Vasut [Fri, 22 Apr 2022 08:57:53 +0000 (10:57 +0200)]
ARM: dts: imx: Use 100 kHz I2C2 on Data Modul i.MX8M Mini eDM SBC

The I2C2 has SMBus device SMSC USB2514Bi connected to it, the device is
capable of up to 100 kHz operation. Reduce the bus frequency to 100 kHz
to guarantee this I2C device can work correctly.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Fabio Estevam <festevam@denx.de>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
2 years agoimx8mn/8mp: Allow booting via USB
Fabio Estevam [Thu, 21 Apr 2022 18:05:23 +0000 (15:05 -0300)]
imx8mn/8mp: Allow booting via USB

When trying to boot via USB on i.MX8MN it is necessary to specify
the U-Boot environment location, otherwise the boot process simply
hangs.

Specify the environment location when booting from USB.

Tested on a imx8mn-evk.

Suggested-by: Michael Nazzareno Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Fabio Estevam <festevam@denx.de>
Tested-By: Tim Harvey <tharvey@gateworks.com>
2 years agoimx8mn_ddr4_evk: Add USB Mass Storage support
Fabio Estevam [Thu, 21 Apr 2022 18:05:22 +0000 (15:05 -0300)]
imx8mn_ddr4_evk: Add USB Mass Storage support

Add USB Mass Storage support, which is a convenient way to flash
the eMMC card, for example.

Signed-off-by: Fabio Estevam <festevam@denx.de>
2 years agoi.MX6SX: crypto/fsl: fix entropy delay value
Gaurav Jain [Fri, 15 Apr 2022 11:10:49 +0000 (16:40 +0530)]
i.MX6SX: crypto/fsl: fix entropy delay value

RNG Hardware error is reported due to incorrect entropy delay

rng self test are run to determine the correct ent_dly.
test is executed with different voltage and temperature to identify the
worst case value for ent_dly. after adding a margin value(1000),
ent_dly should be at least 12000.

Signed-off-by: Gaurav Jain <gaurav.jain@nxp.com>
Reviewed-by: Fabio Estevam <festevam@denx.de>
2 years agomtd: rawnand: mxs_nand: Fix use_minimum_ecc for spl driver
Ye Li [Thu, 31 Mar 2022 05:27:47 +0000 (13:27 +0800)]
mtd: rawnand: mxs_nand: Fix use_minimum_ecc for spl driver

Because mxs_nand_spl driver does not support DM, to use the minimum ECC
layout, it needs to handle the CONFIG_NAND_MXS_USE_MINIMUM_ECC.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Han Xu <han.xu@nxp.com>
2 years agospi: stm32_qspi: Remove SR_BUSY bit check before sending command
Patrice Chotard [Thu, 12 May 2022 07:17:38 +0000 (09:17 +0200)]
spi: stm32_qspi: Remove SR_BUSY bit check before sending command

Waiting for SR_BUSY bit when receiving a new command is not needed.
SR_BUSY bit is already managed in the previous command treatment.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2 years agospi: stm32_qspi: Always check SR_TCF flags in stm32_qspi_wait_cmd()
Patrice Chotard [Thu, 12 May 2022 07:17:37 +0000 (09:17 +0200)]
spi: stm32_qspi: Always check SR_TCF flags in stm32_qspi_wait_cmd()

Currently, SR_TCF flag is checked in case there is data, this criteria
is not correct.

SR_TCF flags is set when programmed number of bytes have been transferred
to the memory device ("bytes" comprised command and data send to the
SPI device).
So even if there is no data, we must check SR_TCF flag.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2 years agoARM: dts: stm32: Configure Buck3 voltage per PMIC NVM on Avenger96
Marek Vasut [Wed, 11 May 2022 21:09:33 +0000 (23:09 +0200)]
ARM: dts: stm32: Configure Buck3 voltage per PMIC NVM on Avenger96

The Avenger96 board comes in multiple regulator configurations.
 - rev.100 or rev.200 have Buck3 preconfigured to 3V3 operation on
   boot and contains extra Enpirion EP53A8LQI DCDC converter which
   supplies the IO. Reduce Buck3 voltage to 2V9 to not waste power.
 - rev.200L have Buck3 preconfigured to 1V8 operation and have no
   Enpirion EP53A8LQI DCDC anymore, the IO is supplied from Buck3.

Configure the Buck3 voltage on this board per PMIC NVM settings and
update buck3 voltage limits in DT passed to OS before booting OS to
prevent potential hardware damage.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Patrice Chotard <patrice.chotard@foss.st.com>
Cc: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2 years agoMerge https://source.denx.de/u-boot/custodians/u-boot-marvell
Tom Rini [Wed, 18 May 2022 12:41:13 +0000 (08:41 -0400)]
Merge https://source.denx.de/u-boot/custodians/u-boot-marvell

- Misc Kconfig cleanups (Chris & Pali)
- turris_omnia: Fix hangup in debug UART (this introduces
  TPL/SPL_DEBUG_UART_BASE) Pali
- mvebu: uDPU: include fixed-phy support (Robert)
- pinctrl: probe pinctrl drivers during post-bind (Robert)

2 years agopinctrl: probe pinctrl drivers during post-bind
Robert Marko [Fri, 6 May 2022 18:01:39 +0000 (20:01 +0200)]
pinctrl: probe pinctrl drivers during post-bind

Currently, pinctrl drivers only get probed if pinconf is actually being
used, however on SoC-s like Armada 3720 pinctrl driver is a also the GPIO
driver.

So, if the pinctrl driver doesn't get probed GPIO-s won't get registered
and thus they cannot be used.

This is a problem on the Methode eDPU as it just uses SB pins as GPIO-s
and without them being registered networking won't work as it only has
one SFP slot and the TX disable GPIO is on the SB controller.

So, probe the pinctrl drivers using DM_FLAG_PROBE_AFTER_BIND like LED
uclass does.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
Reviewed-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agomvebu: uDPU: include fixed-phy support
Robert Marko [Fri, 6 May 2022 11:54:43 +0000 (13:54 +0200)]
mvebu: uDPU: include fixed-phy support

uDPU relies on using fixed-phy for the SFP support, and since the
fixed-phy parsing was moved to the generic driver instead of mvneta
networking stopped working on uDPU with:
uDPU>> dhcp
dm_eth_phy_connect failed

This is due to the conversion commit not enabling fixed-phy support
in defconfig like it did for other boards.

Fixes: 77fcf3cf1251 ("net: mvneta: Convert to use PHY_FIXED for fixed-link")
Signed-off-by: Robert Marko <robert.marko@sartura.hr>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agoarm: mvebu: turris_{omnia,mox}: Enable CONFIG_NETCONSOLE
Pali Rohár [Mon, 9 May 2022 09:12:46 +0000 (11:12 +0200)]
arm: mvebu: turris_{omnia,mox}: Enable CONFIG_NETCONSOLE

This allows to use U-Boot console on Turris devices via network.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agoarm: mvebu: Fix DEBUG_UART_BASE for all 32-bit boards
Pali Rohár [Mon, 9 May 2022 18:17:07 +0000 (20:17 +0200)]
arm: mvebu: Fix DEBUG_UART_BASE for all 32-bit boards

UART base address is located in internal registers.

Internal registers for 32-bit mvebu boards in SPL are at address 0xd0000000
and in proper U-Boot at address 0xf1000000.

Fix DEBUG_UART_BASE option for all 32-bit mvebu boards.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agoarm: mvebu: turris_omnia: Fix DEBUG_UART_BASE
Pali Rohár [Fri, 6 May 2022 09:05:17 +0000 (11:05 +0200)]
arm: mvebu: turris_omnia: Fix DEBUG_UART_BASE

Internal registers in SPL are at address 0xd0000000 and in proper U-Boot at
address 0xf1000000. UART base address is located in internal registers.

Fix DEBUG_UART_BASE option to correct value for both SPL and proper U-Boot.

This change fixes hangup of proper U-Boot when it is trying to print
something via debug UART.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agoserial: ns16550: Add support for SPL_DEBUG_UART_BASE
Pali Rohár [Fri, 6 May 2022 09:05:16 +0000 (11:05 +0200)]
serial: ns16550: Add support for SPL_DEBUG_UART_BASE

Use CONFIG_VAL(DEBUG_UART_BASE) instead of CONFIG_DEBUG_UART_BASE, so
proper config value (CONFIG_DEBUG_UART_BASE or CONFIG_SPL_DEBUG_UART_BASE)
is used based on building target.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agoserial: Add new config option TPL_DEBUG_UART_BASE
Pali Rohár [Mon, 16 May 2022 16:49:09 +0000 (18:49 +0200)]
serial: Add new config option TPL_DEBUG_UART_BASE

TPL_DEBUG_UART_BASE is same as DEBUG_UART_BASE, but applies only for TPL.

Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Stefan Roese <sr@denx.de>
2 years agoserial: Add new config option SPL_DEBUG_UART_BASE
Pali Rohár [Fri, 6 May 2022 09:05:15 +0000 (11:05 +0200)]
serial: Add new config option SPL_DEBUG_UART_BASE

SPL_DEBUG_UART_BASE is same as DEBUG_UART_BASE, but applies only for SPL.

In some cases base address of UART is different in SPL and proper U-Boot.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agoarm: mvebu: Move internal registers in arch_very_early_init() function
Pali Rohár [Fri, 6 May 2022 09:05:14 +0000 (11:05 +0200)]
arm: mvebu: Move internal registers in arch_very_early_init() function

Moving of internal registers from INTREG_BASE_ADDR_REG to SOC_REGS_PHY_BASE
needs to be done very early, prior calling any function which may touch
internal registers, like debug_uart_init().

So do it earlier in arch_very_early_init() instead of arch_cpu_init().

Movement is done in proper U-Boot, not in SPL. SPL may return to bootrom
and bootrom requires internal registers at (old) expected location.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agoarm: Add new config option ARCH_VERY_EARLY_INIT
Pali Rohár [Fri, 6 May 2022 09:05:13 +0000 (11:05 +0200)]
arm: Add new config option ARCH_VERY_EARLY_INIT

When this option is set then ARM _main() function would call
arch_very_early_init() function at the beginning. It would be before
calling any other functions like debug_uart_init() and also before
initializing C runtime environment.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agoarm: mvebu: Remove unused ARMADA_64BIT
Chris Packham [Thu, 5 May 2022 02:09:34 +0000 (14:09 +1200)]
arm: mvebu: Remove unused ARMADA_64BIT

Nothing selects ARMADA_64BIT. Instead the 64-bit SoCs just select ARM64
directly. Remove the unused config item.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agocmd: mvebu: Hide bubt specific options when bubt is disabled
Pali Rohár [Tue, 3 May 2022 09:13:24 +0000 (11:13 +0200)]
cmd: mvebu: Hide bubt specific options when bubt is disabled

CONFIG_MVEBU_NAND_BOOT, CONFIG_MVEBU_SPI_BOOT, CONFIG_MVEBU_MMC_BOOT and
CONFIG_MVEBU_UBOOT_DFLT_NAME are unused when CONFIG_CMD_MVEBU_BUBT is not
enabled. So hide them.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agoMerge branch '2022-05-11-Kconfig-cleanups-etc'
Tom Rini [Wed, 11 May 2022 17:27:44 +0000 (13:27 -0400)]
Merge branch '2022-05-11-Kconfig-cleanups-etc'

- Migrate CONFIG_MTD_CONCAT to Kconfig, use CONFIG_VAL/IS_ENABLED in
  more places, rename SPL_LEGACY_IMAGE_SUPPORT to
  SPL_LEGACY_IMAGE_FORMAT and update some related dependencies for TI
  platforms.

2 years agoMakefile: update warning about CONFIG_OF_EMBED
Ralph Siemsen [Thu, 28 Apr 2022 19:52:59 +0000 (15:52 -0400)]
Makefile: update warning about CONFIG_OF_EMBED

Update the diagnostic message with revised location of document, which
changed in 3e9fddfc4f1 ("doc: Move devicetree control doc to rST")

Signed-off-by: Ralph Siemsen <ralph.siemsen@linaro.org>
2 years agoboard_r: use IS_ENABLED(CONFIG_NEEDS_MANUAL_RELOC) in board_init_r()
Ovidiu Panait [Mon, 2 May 2022 15:34:56 +0000 (18:34 +0300)]
board_r: use IS_ENABLED(CONFIG_NEEDS_MANUAL_RELOC) in board_init_r()

Drop CONFIG_NEEDS_MANUAL_RELOC ifdefs in board_init_r() and use
IS_ENABLED() instead. Also, use the MANUAL_RELOC() macro to update the
initcall pointers.

Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
2 years agoConvert CONFIG_MTD_CONCAT to Kconfig
Chris Packham [Tue, 3 May 2022 09:24:57 +0000 (21:24 +1200)]
Convert CONFIG_MTD_CONCAT to Kconfig

This converts the following to Kconfig:
  CONFIG_MTD_CONCAT

Signed-off-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agocommon/console.c: use CONFIG_VAL() with PRE_CON_BUF_* variables
Rasmus Villemoes [Tue, 3 May 2022 12:37:39 +0000 (14:37 +0200)]
common/console.c: use CONFIG_VAL() with PRE_CON_BUF_* variables

There is currently no support for PRE_CONSOLE_BUFFER in SPL, but if
and when that gets implemented, one would almost certainly want to use
a different address and/or size for the buffer (e.g., U-Boot proper
might specify an address in DRAM and a generous buffer, while SPL
would be much more constrained).

So a prerequisite for adding SPL_PRE_CONSOLE_BUFFER is to make the
code use SPL_-specific values. No functional change.

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
2 years agoboot: Kconfig: Enable FIT processing by default on TI secure devices
Andrew Davis [Wed, 4 May 2022 20:52:28 +0000 (15:52 -0500)]
boot: Kconfig: Enable FIT processing by default on TI secure devices

TI secure devices chain-of-trust depends on FIT image processing,
enable it by default on these devices. This also reduces the delta
between the secure and non-secure defconfig files.

Signed-off-by: Andrew Davis <afd@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2 years agoboot: Kconfig: Disable non-FIT loading for TI secure devices
Andrew Davis [Wed, 4 May 2022 20:52:27 +0000 (15:52 -0500)]
boot: Kconfig: Disable non-FIT loading for TI secure devices

Non-FIT image loading support should be disabled for TI secure
devices as the image handlers for those image types do not follow
our secure boot checks.

Signed-off-by: Andrew Davis <afd@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>