]> git.dujemihanovic.xyz Git - u-boot.git/log
u-boot.git
2 years agoconfigs: stm32f746-disco: Fix CONFIG_SYS_SPL_ARGS_ADDR
Patrice Chotard [Tue, 20 Sep 2022 16:04:33 +0000 (18:04 +0200)]
configs: stm32f746-disco: Fix CONFIG_SYS_SPL_ARGS_ADDR

STM32F746 embeds 1 MB of internal flash [0x08000000-0x080fffff],
fix CONFIG_SYS_SPL_ARGS_ADDR accordingly
It solves hard fault when jumping from SPL to U-Boot.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Tested-by: Waldemar Brodkorb <wbx@openadk.org>
2 years agoconfigs: stm32746g-eval: Fix SPL boot
Patrice Chotard [Tue, 20 Sep 2022 16:04:32 +0000 (18:04 +0200)]
configs: stm32746g-eval: Fix SPL boot

Commit 'b4b9a00ed593 ("Convert CONFIG_SYS_SPL_ARGS_ADDR to Kconfig")'
replaces CONFIG_SYS_FDT_BASE by CONFIG_SYS_SPL_ARGS_ADDR.
As CONFIG_SYS_SPL_ARGS_ADDR enables additional code when enable, it
increases SPL size over the initial 0x8000 limit.
Increase the SPL size to 0x9000 to fix SPL boot.
Set SPL_SIZE_LIMIT to 0x9000 to avoid similar issue in the future.

Fixes 'b4b9a00ed593 ("Convert CONFIG_SYS_SPL_ARGS_ADDR to Kconfig")'

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Tested-by: Waldemar Brodkorb <wbx@openadk.org>
2 years agoconfigs: stm32f769-disco: Fix SPL boot
Patrice Chotard [Tue, 20 Sep 2022 16:04:31 +0000 (18:04 +0200)]
configs: stm32f769-disco: Fix SPL boot

Commit 'b4b9a00ed593 ("Convert CONFIG_SYS_SPL_ARGS_ADDR to Kconfig")'
replaces CONFIG_SYS_FDT_BASE by CONFIG_SYS_SPL_ARGS_ADDR.
As CONFIG_SYS_SPL_ARGS_ADDR enables additional code when enable, it
increases SPL size over the initial 0x8000 limit.
Increase the SPL size to 0x9000 to fix SPL boot.
Set SPL_SIZE_LIMIT to 0x9000 to avoid similar issue in the future.

Fixes 'b4b9a00ed593 ("Convert CONFIG_SYS_SPL_ARGS_ADDR to Kconfig")'

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Tested-by: Waldemar Brodkorb <wbx@openadk.org>
2 years agoconfigs: stm32f746-disco: Fix SPL boot
Patrice Chotard [Tue, 20 Sep 2022 16:04:30 +0000 (18:04 +0200)]
configs: stm32f746-disco: Fix SPL boot

Commit 'b4b9a00ed593 ("Convert CONFIG_SYS_SPL_ARGS_ADDR to Kconfig")'
replaces CONFIG_SYS_FDT_BASE by CONFIG_SYS_SPL_ARGS_ADDR.
As CONFIG_SYS_SPL_ARGS_ADDR enables additional code when enable, it
increases SPL size over the initial 0x8000 limit.
Increase the SPL size to 0x9000 to fix SPL boot.
Set SPL_SIZE_LIMIT to 0x9000 to avoid similar issue in the future.

Fixes 'b4b9a00ed593 ("Convert CONFIG_SYS_SPL_ARGS_ADDR to Kconfig")'

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Tested-by: Waldemar Brodkorb <wbx@openadk.org>
2 years agoARM: dts: stm32: DT sync with kernel v6.0-rc4 for MCU's boards
Patrice Chotard [Fri, 23 Sep 2022 11:20:33 +0000 (13:20 +0200)]
ARM: dts: stm32: DT sync with kernel v6.0-rc4 for MCU's boards

Device tree alignment with kernel v6.0-rc4.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2 years agoARM: dts: stm32mp15: update DDR node
Patrick Delaunay [Wed, 21 Sep 2022 07:37:13 +0000 (09:37 +0200)]
ARM: dts: stm32mp15: update DDR node

Remove the unnecessary nodes for TFABOOT and keep the mandatory part
in SOC dtsi, only the DDRCTRL and DDRPHY addresses.
This patch allows to manage the DDR configuration setting in U-Boot
device tree only if it is needed, when CONFIG_SPL is defined.

With TFABOOT, the DDR configuration is done in TF-A BL2 and the DDR size
is dynamically computed in U-Boot since commit d72e7bbe7c28 ("ram:
stm32mp1: compute DDR size from DDRCTL registers").

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2 years agoconfigs: stm32mp1: cleanup config file
Patrick Delaunay [Fri, 16 Sep 2022 14:52:57 +0000 (16:52 +0200)]
configs: stm32mp1: cleanup config file

Remove the unnecessary comment after the CONFIG_SYS_BOOTM_LEN
migration to Kconfig.

Fixes: c45568cc4e51 ("Convert CONFIG_SYS_BOOTM_LEN to Kconfig")
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2 years agoarm: stm32mp: adapt the command stm32key for STM32MP13x
Patrick Delaunay [Thu, 15 Sep 2022 16:11:41 +0000 (18:11 +0200)]
arm: stm32mp: adapt the command stm32key for STM32MP13x

Change the mask of OTP0 used to close the device on STM32MP
- STM32MP15x: bit 6 of OPT0
- STM32MP13x: 0b111111 = 0x3F for OTP_SECURED closed device

And support the 2 keys for STM32MP13x
- PKHTH : Hash of the 8 ECC Public Keys Hashes Table
          (ECDSA is the authentication algorithm)
- EDMK : Encryption/Decryption Master Key

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2 years agoarm: stm32mp: support several key in command stm32key
Patrick Delaunay [Thu, 15 Sep 2022 16:11:40 +0000 (18:11 +0200)]
arm: stm32mp: support several key in command stm32key

Update the command stm32key to support several keys selected by
key name and managed by the new sub-command:

stm32key list
stm32key select [<key>]
stm32key read -a

This patch doesn't change the STM32MP15 behavior, only PKH is
supported, but it is a preliminary patch for STM32MP13 support.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2 years agoarm: stm32mp: introduced read_close_status function in stm32key command
Patrick Delaunay [Thu, 15 Sep 2022 16:11:39 +0000 (18:11 +0200)]
arm: stm32mp: introduced read_close_status function in stm32key command

Split the read_hash_otp function and introduce the helper function
read_close_status to read the close status in OTP separately of the PKH.

This patch is a preliminary step for STM32MP13 support.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2 years agoarm: stm32mp: add defines for BSEC_LOCK status in stm32key command
Patrick Delaunay [Thu, 15 Sep 2022 16:11:38 +0000 (18:11 +0200)]
arm: stm32mp: add defines for BSEC_LOCK status in stm32key command

Add defines for value used in stm32key for BSEC permanent lock status
and error.

This patch is a preliminary step to support more lock status in BSEC
driver.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2 years agoboard: st: stm32mp1: use of correct compatible string to add partitions
Christophe Kerello [Mon, 12 Sep 2022 15:40:50 +0000 (17:40 +0200)]
board: st: stm32mp1: use of correct compatible string to add partitions

Current compatible string used to update SPI NAND and SPI NOR devices
can lead to a wrong partitions update (for example, SPI NAND partitions
added to SPI NOR node in the device tree). To avoid this wrong behavior,
use jedec,spi-nor compatible string for SPI NOR devices and spi-nand
compatible string for SPI NAND devices.

Signed-off-by: Christophe Kerello <christophe.kerello@foss.st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2 years agostm32mp: stm32prog: improve the partitioning trace
Patrick Delaunay [Fri, 9 Sep 2022 15:22:15 +0000 (17:22 +0200)]
stm32mp: stm32prog: improve the partitioning trace

Improve the partitioning trace done in command stm32prog:
- remove the trace "partition: Done" when the GPT partitioning is not done
- indicate the mmc instance used for each 'gpt write' command

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2 years agoARM: dts: stm32mp: alignment with v6.0-rc3
Patrick Delaunay [Wed, 7 Sep 2022 11:42:23 +0000 (13:42 +0200)]
ARM: dts: stm32mp: alignment with v6.0-rc3

Device tree alignment with Linux kernel v6.0-rc3:
- ARM: dts: stm32: add support for USB2514B onboard hub on stm32mp15xx-dkx
- ARM: dts: stm32: Add alternate pinmux for RCC pin
- ARM: dts: stm32: Add alternate pinmux for DCMI pins
- ARM: dts: stm32: Add alternate pinmux for SPI2 pins
- ARM: dts: stm32: Fix SPI2 pinmux pin comments on stm32mp15
- ARM: dts: stm32: add optee reserved memory on stm32mp135f-dk
- ARM: dts: stm32: enable optee firmware and SCMI support on STM32MP13
- ARM: dts: stm32: remove the IPCC "wakeup" IRQ on stm32mp151

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2 years agostm32mp: stm32prog: correctly handle OTP when SMC is not supported
Patrick Delaunay [Tue, 6 Sep 2022 16:53:20 +0000 (18:53 +0200)]
stm32mp: stm32prog: correctly handle OTP when SMC is not supported

As the SMC is only supported in SP-MIN for STM32MP15x, the associated
partition should be absent when the TA NVMEM is not available in OPT-TEE
in STM32MP13x.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2 years agostm32mp: stm32prog: solve warning for 64bits compilation
Patrick Delaunay [Tue, 6 Sep 2022 16:53:19 +0000 (18:53 +0200)]
stm32mp: stm32prog: solve warning for 64bits compilation

Solve many compilation warning when stm32prog is activated on the aarch64.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2 years agostm32mp: stm32prog: change default flashlayout location to CONFIG_SYS_LOAD_ADDR
Patrick Delaunay [Tue, 6 Sep 2022 16:53:18 +0000 (18:53 +0200)]
stm32mp: stm32prog: change default flashlayout location to CONFIG_SYS_LOAD_ADDR

Change the defaut flashlayout location, hardcoded at STM32_DDR_BASE,
to CONFIG_SYS_LOAD_ADDR to avoid issue on board with reserved memory
at STM32_DDR_BASE.

This patch changes the command behavior for STM32MP13 and STM32MP15
platform, as CONFIG_SYS_LOAD_ADDR(0xc2000000) != STM32_DDR_BASE
but without impact for serial boot with STM32CubeProgrammer.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2 years agostm32mp: stm32prog: support empty flashlayout
Patrick Delaunay [Tue, 6 Sep 2022 16:53:17 +0000 (18:53 +0200)]
stm32mp: stm32prog: support empty flashlayout

When the STM32CubeProgrammer sent a empty flashlayout.tsv
file, the command stm32prog correctly parse the file
but data->dev_nb = 0 and the stm32prog_devices_init
operations should be skipped.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2 years agoMerge branch 'next' of https://source.denx.de/u-boot/custodians/u-boot-marvell into...
Tom Rini [Tue, 20 Sep 2022 12:50:07 +0000 (08:50 -0400)]
Merge branch 'next' of https://source.denx.de/u-boot/custodians/u-boot-marvell into next

- Enable CONFIG_TIMER for all Kirkwood / MVEBU boards (Stefan)
- u-boot-spl.kwb/SPL: Add / improve size limit setup / detection (Pali)
- mvebu: theadorable: Misc updates in defconfig und dts (Stefan)

2 years agoMerge tag 'u-boot-at91-2023.01-a' of https://source.denx.de/u-boot/custodians/u-boot...
Tom Rini [Tue, 20 Sep 2022 12:49:36 +0000 (08:49 -0400)]
Merge tag 'u-boot-at91-2023.01-a' of https://source.denx.de/u-boot/custodians/u-boot-at91 into next

First set of u-boot-at91 features for the 2023.01 cycle:

This feature set includes the important update on PIO4 pinctrl driver
that solves a long time mismatch between Linux and U-boot, related on
the unification of pinctrl and gpio driver support, now respecting the
pinctrl bindings ABI; and also support for pinctrl subnodes. The feature
set also adds support for PDA screen detection for sam9x60_curiosity
board , one fix for SD-Card reinsertion and one fix for sam9x60 clocks.

2 years agokirkwood: lsxl: Sync defconfigs
Stefan Roese [Thu, 15 Sep 2022 14:20:43 +0000 (16:20 +0200)]
kirkwood: lsxl: Sync defconfigs

With the recent changes in the Orion timer driver Kconfig setup, the
board specific enabling is not needed any more. This patch sync's these
2 boards with their current defconfig version.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Michael Walle <michael@walle.cc>
Tested-by: Tony Dinh <mibodhi@gmail.com>
2 years agoarm: mvebu: dts: mvebu-u-boot.dtsi: Add "u-boot, dm-pre-reloc" to timer DT node
Stefan Roese [Thu, 15 Sep 2022 14:20:42 +0000 (16:20 +0200)]
arm: mvebu: dts: mvebu-u-boot.dtsi: Add "u-boot, dm-pre-reloc" to timer DT node

Adding the "u-boot,dm-pre-reloc" DT property to the timer node is
necesssary to support the timer in the early boot phases (e.g.
SPL & pre-reloc).

Signed-off-by: Stefan Roese <sr@denx.de>
Tested-by: Tony Dinh <mibodhi@gmail.com>
2 years agoarm: mvebu: dts: armada-375.dtsi: Add timer0 & timer1
Stefan Roese [Thu, 15 Sep 2022 14:20:41 +0000 (16:20 +0200)]
arm: mvebu: dts: armada-375.dtsi: Add timer0 & timer1

Add the DT bindings / descriptions for timer0 & timer1, exactly as done
in mainline Linux.

Signed-off-by: Stefan Roese <sr@denx.de>
Tested-by: Tony Dinh <mibodhi@gmail.com>
2 years agoarm: mvebu: dts: Makefile: Compile Armada 375 dtb in a separate step
Stefan Roese [Thu, 15 Sep 2022 14:20:40 +0000 (16:20 +0200)]
arm: mvebu: dts: Makefile: Compile Armada 375 dtb in a separate step

This patch changes the compilation, so that the Armada 375 board(s) are
compiled in a separate step. This is necessary for the timer dts
conversion, as A375 has a different / timer description in the dts.

Signed-off-by: Stefan Roese <sr@denx.de>
Tested-by: Tony Dinh <mibodhi@gmail.com>
2 years agoarm: mvebu: Use CONFIG_TIMER on all MVEBU & KIRKWOOD platforms
Stefan Roese [Thu, 15 Sep 2022 14:20:39 +0000 (16:20 +0200)]
arm: mvebu: Use CONFIG_TIMER on all MVEBU & KIRKWOOD platforms

Now that the new timer support is available for these platforms, let's
select this IF for all these platforms. This way it's not necessary
that each board changes it's config header.

Signed-off-by: Stefan Roese <sr@denx.de>
Tested-by: Tony Dinh <mibodhi@gmail.com>
2 years agotimer: orion-timer: Add timer_get_boot_us() for BOOTSTAGE support
Stefan Roese [Thu, 15 Sep 2022 14:20:38 +0000 (16:20 +0200)]
timer: orion-timer: Add timer_get_boot_us() for BOOTSTAGE support

Add timer_get_boot_us() to support boards, that have CONFIG_BOOTSTAGE
enabled, like pogo_v4.

Signed-off-by: Stefan Roese <sr@denx.de>
Tested-by: Tony Dinh <mibodhi@gmail.com>
2 years agotimer: orion-timer: Add support for other Armada SoC's
Stefan Roese [Thu, 15 Sep 2022 14:20:37 +0000 (16:20 +0200)]
timer: orion-timer: Add support for other Armada SoC's

This patch adds support for other Marvell Armada SoC's, supporting the
25MHz fixed clock operation, like the Armada XP etc.

Signed-off-by: Stefan Roese <sr@denx.de>
Tested-by: Tony Dinh <mibodhi@gmail.com>
2 years agoarm: mvebu: theadorable: Update eth & mdio DT nodes
Stefan Roese [Thu, 15 Sep 2022 13:21:22 +0000 (15:21 +0200)]
arm: mvebu: theadorable: Update eth & mdio DT nodes

With the recent changes in the Marvel mvneta network driver, the MDIO
bus is not connected any more. This patch updates the DT nodes to use
the nodes from the dtsi files instead of creating ad-hoc nodes.

Signed-off-by: Stefan Roese <sr@denx.de>
2 years agoarm: mvebu: theadorable: Misc defconfig changes
Stefan Roese [Thu, 15 Sep 2022 13:21:21 +0000 (15:21 +0200)]
arm: mvebu: theadorable: Misc defconfig changes

- Remove EFI support as it's not used on this board
- Disable CONFIG_FIT_PRINT to reduce the serial output (minimal speedup)

Signed-off-by: Stefan Roese <sr@denx.de>
2 years agoarm: mvebu: Add default SPL_SIZE_LIMIT for 32-bit SoCs
Pali Rohár [Wed, 14 Sep 2022 16:48:16 +0000 (18:48 +0200)]
arm: mvebu: Add default SPL_SIZE_LIMIT for 32-bit SoCs

32-bit Marvell Armada BootROMs limit maximal size of SPL image to 192 kB.
So define 192 kB (= 0x30000) limit as default value for SPL_SIZE_LIMIT.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Marek Behún <kabel@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agoarm: mvebu: turris_omnia: Add CONFIG_BOARD_SIZE_LIMIT
Pali Rohár [Wed, 14 Sep 2022 13:06:46 +0000 (15:06 +0200)]
arm: mvebu: turris_omnia: Add CONFIG_BOARD_SIZE_LIMIT

Maximal size of u-boot kwb image binary is $CONFIG_ENV_OFFSET which is
0xF0000 = 983040 bytes. So add missing CONFIG_BOARD_SIZE_LIMIT definition
to ensure that u-boot binary does not overflow to the u-boot env storage.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Marek Behún <kabel@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agoMakefile: Add missing CONFIG_BOARD_SIZE_LIMIT check for u-boot-spl.kwb
Pali Rohár [Wed, 14 Sep 2022 13:06:14 +0000 (15:06 +0200)]
Makefile: Add missing CONFIG_BOARD_SIZE_LIMIT check for u-boot-spl.kwb

Currently CONFIG_BOARD_SIZE_LIMIT check is ignored for u-boot-spl.kwb
target. Fix it by adding missing $(BOARD_SIZE_CHECK) macro.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Marek Behún <kabel@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agoMerge branch 'master' into next
Tom Rini [Mon, 19 Sep 2022 17:19:39 +0000 (13:19 -0400)]
Merge branch 'master' into next

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoPrepare v2022.10-rc5
Tom Rini [Mon, 19 Sep 2022 16:17:04 +0000 (12:17 -0400)]
Prepare v2022.10-rc5

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoconfigs: Resync with savedefconfig
Tom Rini [Mon, 19 Sep 2022 15:22:26 +0000 (11:22 -0400)]
configs: Resync with savedefconfig

Rsync all defconfig files using moveconfig.py

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoimx8m*_venice_defconfig: fix default bootcmd
Tim Harvey [Thu, 8 Sep 2022 16:11:13 +0000 (09:11 -0700)]
imx8m*_venice_defconfig: fix default bootcmd

commit 970bf8603b87 ("Convert CONFIG_USE_BOOTCOMMAND et al to Kconfig")
had an unintended side effect of resulting in a bootcmd env var change
for boards like venice that did not have CONFIG_USE_BOOTCOMMAND defined
and relied on it being defaulted in include/config_distro_bootcmd.h.
Following that patch it instead got defaulted in tools/env/fw_env_private.h

Fix this by enabling CONFIG_USE_BOOTCOMMAND for venice.

Fixes: commit 970bf8603b87 ("Convert CONFIG_USE_BOOTCOMMAND et al to Kconfig")
Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2 years agoMerge tag 'u-boot-imx-20220919' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx
Tom Rini [Mon, 19 Sep 2022 12:38:32 +0000 (08:38 -0400)]
Merge tag 'u-boot-imx-20220919' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx

u-boot-imx-20220919
-------------------

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

- Fix imx8mn-beacon-kit-u-boot
- Merged Purism
- imxrt1170 (already merged in u-boot-imx)
- Fixes in crypto FSL
- Toradex : fixes Verdin
- Serial Driver: fixes when not used as console
- DH Boards : fixes + USB
- Fix CONFIG_SYS_MALLOC_F_LEN (Kconfig)
- Add imx6ulz_smm_m2

2 years agopowerpc: mpc85xx: Fix incorrect application of patch
Marek Behún [Mon, 19 Sep 2022 09:32:08 +0000 (11:32 +0200)]
powerpc: mpc85xx: Fix incorrect application of patch

I messed up application of patch 5a428e751044 ("mmc: fsl_esdhc_spl: Add
support for builds without CONFIG_SYS_MMC_U_BOOT_OFFS"). I took it from
a work-in-progress branch where I changed usage of
  CONFIG_SDCARD to CONFIG_SD_BOOT
and refactored
  SYS_MPC85XX_NO_RESETVEC
mess.

But these changes aren't in master yet. Fix the wrong usage of these
macros.

Fixes: 5a428e751044 ("mmc: fsl_esdhc_spl: Add support for builds without
CONFIG_SYS_MMC_U_BOOT_OFFS")
Signed-off-by: Marek Behún <kabel@kernel.org>
Reviewed-by: Pali Rohár <pali@kernel.org>
2 years agopinctrl: at91-pio4: Add support for pinctrl config subnodes
Sergiu Moga [Thu, 1 Sep 2022 14:22:42 +0000 (17:22 +0300)]
pinctrl: at91-pio4: Add support for pinctrl config subnodes

Previously, in order for the `pinctrl-*` DT node properties
to be properly processed, the pinctrl's subnodes were limited
to only having the `pinmux` property as well as other additional
properties (slew-rate, bias-disable, etc.). Now, with this patch
the pinctrl driver is made to work similarly to the one from Linux.
It can now distinguish between one subnode and a subnode with multiple
subnodes.

Signed-off-by: Sergiu Moga <sergiu.moga@microchip.com>
2 years agopinctrl: at91-pio4: Bind GPIO driver to the pinctrl DT node
Sergiu Moga [Thu, 1 Sep 2022 14:22:41 +0000 (17:22 +0300)]
pinctrl: at91-pio4: Bind GPIO driver to the pinctrl DT node

This has been done in order to align the DT of U-Boot with the DT
of Linux. In Linux, a phandle from a '-gpio' DT property is linked
to the pinctrl driver, a single driver that handles both pinctrl
settings and offers GPIO API to callers. On the other hand,
U-Boot redirects such phandle to a corresponding UCLASS_GPIO
driver, because U-Boot offers two different types of drivers
in this case: UCLASS_PINCTRL which handles pin functions and
UCLASS_GPIO which handles gpio requests as a gpio provider.
Due to this, we have two drivers in Uboot, but the Devicetree
has a single node. Thus, just one of the drivers can be probed
for the DT node during platform initialization, before relocation.

Our previous solution in U-Boot was to have a different devicetree:
the gpio node has a subnode for the pinctrl driver, which
is not compliant with Linux ABI. Furthermore, our documentation
for this type of nodes mentions no such gpio compatible.

After this patch, we can no longer add nodes with a gpio
compatible in the DT. Thus, in order to link the pinctrl driver to
the gpio one, a hook to the bind method of the former in U-Boot has
been added and the GPIO related compatibles have been removed to
avoid conflict when compatibles are enumerated and bound to drivers
during platform start before relocation. The bind method will attach
the GPIO driver to the pinctrl DT node so that every phandle coming
from '-gpio' DT properties will be redirected to a valid driver
attached to the pinctrl DT node.

Signed-off-by: Sergiu Moga <sergiu.moga@microchip.com>
2 years agoARM: dts: at91: sama7: Align with Linux Devicetree
Sergiu Moga [Thu, 1 Sep 2022 14:22:40 +0000 (17:22 +0300)]
ARM: dts: at91: sama7: Align with Linux Devicetree

This patch makes sure that the Devicetree for the sama7
boards are aligned with the Devicetree from Linux. This
implies removing the GPIO compatible and replacing it
with the PINCTRL one, as well as unifying the SDMMC
pinctrl related subnodes under one single subnode.

Signed-off-by: Sergiu Moga <sergiu.moga@microchip.com>
2 years agoARM: dts: at91: sama5: Align with Linux Devicetree
Sergiu Moga [Thu, 1 Sep 2022 14:22:39 +0000 (17:22 +0300)]
ARM: dts: at91: sama5: Align with Linux Devicetree

This patch makes sure that the Devicetree for the sama5
boards are aligned with the Devicetree from Linux. This
implies removing the GPIO compatible and replacing it
with the PINCTRL one, as well as unifying the SDMMC
pinctrl related subnodes under one single subnode.

Signed-off-by: Sergiu Moga <sergiu.moga@microchip.com>
2 years agoclk: at91: sam9x60: change parent clock from mck_pres to mck_div
Mihai Sain [Tue, 19 Jul 2022 13:51:59 +0000 (16:51 +0300)]
clk: at91: sam9x60: change parent clock from mck_pres to mck_div

ddrck and qspick should have mck_div as parent clocks to be in sync with
linux driver.

Signed-off-by: Mihai Sain <mihai.sain@microchip.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
2 years agoARM: dts: at91: sam9x60_curiosity: add onewire support
Durai Manickam KR [Thu, 7 Jul 2022 11:10:56 +0000 (16:40 +0530)]
ARM: dts: at91: sam9x60_curiosity: add onewire support

Add support for onewire memory.

Signed-off-by: Durai Manickam KR <durai.manickamkr@microchip.com>
2 years agoboard: sam9x60_curiosity: add pda detect call at init time
Durai Manickam KR [Thu, 7 Jul 2022 11:10:55 +0000 (16:40 +0530)]
board: sam9x60_curiosity: add pda detect call at init time

Call the PDA detection mechanism at boot time so that we can
have the pda environment variable ready for use.

Signed-off-by: Durai Manickam KR <durai.manickamkr@microchip.com>
2 years agoconfigs: sama9x60_curiosity: add onewire and eeprom drivers
Durai Manickam KR [Thu, 7 Jul 2022 11:10:54 +0000 (16:40 +0530)]
configs: sama9x60_curiosity: add onewire and eeprom drivers

SAM9X60 SoC can have extra clip boards (PDAs) connected, which have
an EEPROM memory for identification. A special GPIO can be used to read
this memory over 1wire protocol. Enabling one wire and eeprom drivers
for this memory.

Signed-off-by: Durai Manickam KR <durai.manickamkr@microchip.com>
2 years agommc: atmel_sdhci: re-enable sdhci after SD Card re-insertion
Sergiu Moga [Wed, 22 Jun 2022 13:30:47 +0000 (16:30 +0300)]
mmc: atmel_sdhci: re-enable sdhci after SD Card re-insertion

Whenever the SD Card would be removed and then re-inserted while in the
U-Boot command line, the `SDBPWR` bit of the `SDMMC_PCR` register would
remain unset afterwards. In order for the bit to be set again after
re-insertion, register an additional `deferred_probe` method that the
DM would then transparently call. This method will call the generic
`sdhci_probe` which will, during its execution flow, set this bit to 1.

Signed-off-by: Sergiu Moga <sergiu.moga@microchip.com>
Reported-by: Mihai Sain <mihai.sain@microchip.com>
Reviewed-by: Eugen Hristev <eugen.hristev@microchip.com>
2 years agobsh: imx6ulz_smm_m2: Add imx6ulz BSH SMM M2 boards
Michael Trimarchi [Sun, 18 Sep 2022 15:09:53 +0000 (17:09 +0200)]
bsh: imx6ulz_smm_m2: Add imx6ulz BSH SMM M2 boards

Introduce BSH SystemMaster (SMM) M2 board family, which consists of:
imx6ulz SMM M2 and imx6ulz SMM M2 PRO boards.

Add support for imx6ulz BSH SMM M2 board:

- 128 MiB DDR3 RAM
- 256MiB Nand
- USBOTG1 peripheral - fastboot.

Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Reviewed-by: Fabio Estevam <festevam@denx.de>
2 years agoARM: imx: Update Data Modul i.MX8M Mini eDM SBC DRAM timing
Marek Vasut [Tue, 30 Aug 2022 12:34:26 +0000 (14:34 +0200)]
ARM: imx: Update Data Modul i.MX8M Mini eDM SBC DRAM timing

Adjust the DRAM timing settings for this board per ones provided
by hardware department. The change is applied to the LPDDR4 MR11
register CA ODT configuration, from RZQ/6 to RZQ/3, which fixes
stability issues on subset of boards. The DDR PHY PIE block has
been updated accordingly.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Reviewed-by: Fabio Estevam <festevam@denx.de>
2 years agoARM: imx: Enable SPL GPIO hog on i.MX8M Plus DHCOM
Marek Vasut [Fri, 26 Aug 2022 21:16:27 +0000 (23:16 +0200)]
ARM: imx: Enable SPL GPIO hog on i.MX8M Plus DHCOM

Enable GPIO hog support in SPL to match the GPIO hog support in U-Boot proper.

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>
Cc: uboot-imx <uboot-imx@nxp.com>
Reviewed-by: Fabio Estevam <festevam@denx.de>
2 years agoverdin-imx8mm: various config additions and improvements
Marcel Ziswiler [Mon, 22 Aug 2022 13:06:03 +0000 (15:06 +0200)]
verdin-imx8mm: various config additions and improvements

- integrate bootcount using SNVS_LP general purpose register LPGPR0
- enable link-time optimisation
- explicitly set a boot delay of one second
- enable CRC32 and MD5
- enable command for low-level access to data in a partition
- enable time commands
- enable PMIC commands
- improve ETHPRIME configuration
- enable eMMC HS400 functionality
- enable fixed PHY and MDIO driver model
- remove stale PFUZE100 PMIC driver
- enable thermal management unit driver
- enable more USB host functionality
- enable hexdump

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2 years agoKconfig: enlarge CONFIG_SYS_MALLOC_F_LEN
Peng Fan [Thu, 15 Sep 2022 01:38:18 +0000 (09:38 +0800)]
Kconfig: enlarge CONFIG_SYS_MALLOC_F_LEN

"alloc space exhausted" happens in very early stage, which could be seen
with DEBUG_UART options enabled and leeds to an non-functional board.

kontron_pitx_imx8m:
CONFIG_DEBUG_UART_BASE=0x30880000   # for serial3
CONFIG_DEBUG_UART_CLOCK=24000000

imx8mqevk:
CONFIG_DEBUG_UART_BASE=0x30860000      # for uart1
CONFIG_DEBUG_UART_CLOCK=24000000

It is because CONFIG_SYS_MALLOC_F_LEN is too small and still leave
CONFIG_SPL_SYS_MALLOC_F_LEN as 0x2000.

Reported-by: Heiko Thiery <heiko.thiery@gmail.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Heiko Thiery <heiko.thiery@gmail.com>
Tested-by: Heiko Thiery <heiko.thiery@gmail.com>
Reviewed-by: Fabio Estevam <festevam@denx.de>
2 years agoserial: mxc: have putc use the TXFIFO
Johannes Schneider [Tue, 6 Sep 2022 12:15:04 +0000 (14:15 +0200)]
serial: mxc: have putc use the TXFIFO

only waiting for TXEMPTY leads to corrupted messages going over the
wire - which is fixed by making use of the FIFO

this change is following the linux kernel uart driver
(drivers/tty/serial/imx.c), which also checks UTS_TXFULL
instead of UTS_TXEMPTY

Signed-off-by: Johannes Schneider <johannes.schneider@leica-geosystems.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Fabio Estevam <festevam@denx.de>
2 years agoserial: mxc: enable the RX pipeline
Johannes Schneider [Tue, 6 Sep 2022 12:15:03 +0000 (14:15 +0200)]
serial: mxc: enable the RX pipeline

on imx8(mm) the RXDMUXSEL needs to be set for data going over the wire
(as observable on a connected 'scope) to actually make it into the
RXFIFO

the reference manual is not overly clear about this, and only
mentiones that "UCR3_RXDMUXSEL should always be set." - and since the
CR3 register reverts to its reset values after setting the baudrate,
setting this bit is done during '_mxc_serial_setbgr'

Signed-off-by: Johannes Schneider <johannes.schneider@leica-geosystems.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Fabio Estevam <festevam@denx.de>
2 years agoMAINTAINERS: imx: Add an entry for the serial driver
Fabio Estevam [Mon, 5 Sep 2022 10:57:00 +0000 (07:57 -0300)]
MAINTAINERS: imx: Add an entry for the serial driver

Currently, when running ./scripts/get_maintainer.pl on serial_mxc.c
no i.MX maintainer is returned.

Fix it by adding an entry for this driver.

Reported-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Fabio Estevam <festevam@denx.de>
Acked-by: Peng Fan <peng.fan@nxp.com>
2 years agoboard: purism: add the Purism Librem5 phone
Angus Ainslie [Thu, 25 Aug 2022 13:46:02 +0000 (06:46 -0700)]
board: purism: add the Purism Librem5 phone

Initial commit of Librem5 u-boot and SPL

Signed-off-by: Angus Ainslie <angus@akkea.ca>
Co-developed-by: Sebastian Krzyszkowiak <sebastian.krzyszkowiak@puri.sm>
Signed-off-by: Sebastian Krzyszkowiak <sebastian.krzyszkowiak@puri.sm>
Reviewed-by: Fabio Estevam <festevam@denx.de>
2 years agoverdin-imx8mp: do not save environment when it's nowhere
Denys Drozdov [Tue, 23 Aug 2022 11:05:49 +0000 (13:05 +0200)]
verdin-imx8mp: do not save environment when it's nowhere

This code part is broken, remove it.

Signed-off-by: Andrejs Cainikovs <andrejs.cainikovs@toradex.com>
Signed-off-by: Denys Drozdov <denys.drozdov@toradex.com>
2 years agoverdin-imx8mm: do not save environment when it's nowhere
Denys Drozdov [Tue, 23 Aug 2022 11:05:48 +0000 (13:05 +0200)]
verdin-imx8mm: do not save environment when it's nowhere

This code part is broken, remove it.

Signed-off-by: Andrejs Cainikovs <andrejs.cainikovs@toradex.com>
Signed-off-by: Denys Drozdov <denys.drozdov@toradex.com>
2 years agoverdin-imx8mm: improve and extend boot devices
Marcel Ziswiler [Mon, 22 Aug 2022 13:06:02 +0000 (15:06 +0200)]
verdin-imx8mm: improve and extend boot devices

- Annotate boot devices available in spl_board_boot_device().
- Drop SD3_BOOT/MMC3_BOOT not available for boot on Verdin iMX8M Mini.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2 years agoverdin-imx8mm: prepare for optional job ring driver model
Marcel Ziswiler [Mon, 22 Aug 2022 13:06:01 +0000 (15:06 +0200)]
verdin-imx8mm: prepare for optional job ring driver model

Prepare for optional job ring driver model. Sec may be initialized based
on the job ring information processed from the device tree.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2 years agoverdin-imx8mm: verdin-imx8mp: update env memory layout
Marcel Ziswiler [Mon, 22 Aug 2022 13:06:00 +0000 (15:06 +0200)]
verdin-imx8mm: verdin-imx8mp: update env memory layout

Update the distro config env memory layout for the Verdin iMX8M Mini and
Verdin iMX8M Plus:

- loadaddr=0x48280000 allows for 128.5MB area for uncompressing (ie FIT
  images, kernel_comp_addr_r, kernel_comp_size)
- fdt_addr_r = loadaddr + 127.5MB : allows for 127.5MB kernel
- scriptaddr = fdt_addr_r + 512KB : allows for 512KB fdt
- ramdisk_addr_r = scriptaddr + 512KB : allows for 512KB script

Memory layout taken from commit fd5c7173ade4
("imx8m{m,n}_venice: update env memory layout") but moved loadaddr by an
additional 0.5MB to avoid "Moving Image from 0x48200000 to 0x48280000"
during booti plus actually defining kernel_comp_size to make booti work.

Note that for our regular BSP Layers and Reference Images for Yocto
Project an updated distro boot script is required (see
meta-toradex-bsp-common/recipes-bsp/u-boot/u-boot-distro-boot).

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2 years agoARM: imx: Update DDR frequency on i.MX8M Plus DHCOM
Marek Vasut [Fri, 19 Aug 2022 11:02:53 +0000 (13:02 +0200)]
ARM: imx: Update DDR frequency on i.MX8M Plus DHCOM

Commit 99c7cc58e12 ("ddr: imx: Add i.MX9 DDR controller driver")
contains an inobvious side-effect which renders all systems using
DRAM controller at 3732 MT/s unbootable. The change is located in
ddrphy_init_set_dfi_clk(), where the switch case statement entry
3732 changed to entry 3733, so any board with DDR calibration data
for 3732 MT/s operations needs to be updated to 3733 MT/s to match
the change.

Since there is currently only one such board, update the board instead
of handling both 3732 and 3733 options in the driver. It is likely the
NXP MX8MP RPA update will follow and use the later value too.

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>
Cc: Ye Li <ye.li@nxp.com>
Cc: uboot-imx <uboot-imx@nxp.com>
Reviewed-by: Fabio Estevam <festevam@denx.de>
2 years agoimx8m: ddrphy_utils: Remove unused file
Marek Vasut [Fri, 19 Aug 2022 11:02:23 +0000 (13:02 +0200)]
imx8m: ddrphy_utils: Remove unused file

The ddrphy_utils.c is now deduplicated in drivers/ddr/imx/phy/ddrphy_utils.c ,
this drivers/ddr/imx/imx8m/ddrphy_utils.c is a remnant from when the
deduplication was implemented and was not removed. Remove it as it is
unused.

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>
Cc: Ye Li <ye.li@nxp.com>
Cc: uboot-imx <uboot-imx@nxp.com>
Reviewed-by: Fabio Estevam <festevam@denx.de>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
2 years agoARM: imx: dh-imx6: Increase SF erase area for u-boot update
Marek Vasut [Fri, 12 Aug 2022 20:59:10 +0000 (22:59 +0200)]
ARM: imx: dh-imx6: Increase SF erase area for u-boot update

Erase the entire U-Boot area during U-Boot update instead of just
a subset of it. This way, in case u-boot-with-spl.imx grows, the
sf write won't write over non-erased part of the SPI NOR.

Signed-off-by: Marek Vasut <marex@denx.de>
2 years agoARM: dts: imx: Fix I2C5 GPIO assignment on i.MX8M Plus DHCOM
Marek Vasut [Fri, 12 Aug 2022 20:41:55 +0000 (22:41 +0200)]
ARM: dts: imx: Fix I2C5 GPIO assignment on i.MX8M Plus DHCOM

Fix copy-paste error of the I2C5 bus recovery GPIO assignment,
the I2C5 GPIOs are on gpio3 instead of gpio5.

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>
Cc: uboot-imx <uboot-imx@nxp.com>
2 years agoARM: dts: imx: Adjust ECSPI1 pinmux on i.MX8M Plus DHCOM
Marek Vasut [Fri, 12 Aug 2022 20:41:54 +0000 (22:41 +0200)]
ARM: dts: imx: Adjust ECSPI1 pinmux on i.MX8M Plus DHCOM

The ECSPI1 is on I2C1/I2C2 pins of the SoC, update the pinmux accordingly.

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>
Cc: uboot-imx <uboot-imx@nxp.com>
2 years agoARM: dts: imx: Rename imx8mp-dhcom{-pdk2,}-boot.dtsi
Marek Vasut [Fri, 12 Aug 2022 20:41:53 +0000 (22:41 +0200)]
ARM: dts: imx: Rename imx8mp-dhcom{-pdk2,}-boot.dtsi

Rename imx8mp-dhcom-pdk2-u-boot.dtsi to imx8mp-dhcom-u-boot.dtsi, since
this file is shared by PDK2, PicoITX and DRC02. No functional change.

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>
Cc: uboot-imx <uboot-imx@nxp.com>
2 years agoARM: dts: imx: Add SoM compatible to i.MX8M Plus DHCOM PDK2
Marek Vasut [Fri, 12 Aug 2022 20:41:52 +0000 (22:41 +0200)]
ARM: dts: imx: Add SoM compatible to i.MX8M Plus DHCOM PDK2

Add SoM compatible string into i.MX8MP DHCOM PDK2 compatible strings.

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>
Cc: uboot-imx <uboot-imx@nxp.com>
2 years agoARM: dts: imx: Drop Atheros PHY header from i.MX8M Plus DHCOM PDK2
Marek Vasut [Fri, 12 Aug 2022 20:41:51 +0000 (22:41 +0200)]
ARM: dts: imx: Drop Atheros PHY header from i.MX8M Plus DHCOM PDK2

This PHY is not used on PDK2, the header was added due to copy-paste
error, drop it.

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>
Cc: uboot-imx <uboot-imx@nxp.com>
2 years agoARM: dts: imx: Add HW variant details to i.MX8M Plus DHCOM PDK2
Marek Vasut [Fri, 12 Aug 2022 20:41:50 +0000 (22:41 +0200)]
ARM: dts: imx: Add HW variant details to i.MX8M Plus DHCOM PDK2

Add information about which exact SoM variant is used on which PDK2 variant.

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>
Cc: uboot-imx <uboot-imx@nxp.com>
2 years agoARM: imx: Enable USB ethernet on i.MX8M Plus DHCOM
Marek Vasut [Fri, 12 Aug 2022 20:41:49 +0000 (22:41 +0200)]
ARM: imx: Enable USB ethernet on i.MX8M Plus DHCOM

Enable both USB CDC ethernet and USB host ethernet on i.MX8M Plus DHCOM.
This is useful for bringing up systems without ethernet plug, but with
either USB host or gadget plug.

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>
Cc: uboot-imx <uboot-imx@nxp.com>
2 years agoboard: gateworks: venice: add fixup for GW73xx-C+
Tim Harvey [Thu, 11 Aug 2022 18:55:38 +0000 (11:55 -0700)]
board: gateworks: venice: add fixup for GW73xx-C+

The GW73xx-C revision and onward replaced the 5-port PCIe switch with a
4-port (dropping PCIe to one of the miniPCIe sockets) due to part
availability. This moved the PCI bus of the GbE eth1 device. Use a fixup
to adjust the dt accordingly so that local-mac-address assigned from dt
works on new revision boards.

While we are at it, rename 'blob' to 'fdt' for clarity.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2 years agoarm: dts: imx8mn-beacon-kit-u-boot: Fix broken booting
Adam Ford [Sun, 31 Jul 2022 17:16:10 +0000 (12:16 -0500)]
arm: dts: imx8mn-beacon-kit-u-boot: Fix broken booting

When the imx8mm.dtsi file was pulled in from Linux, the UARTs
were moved into an spba sub-node which wasn't being included
in the SPL device tree.  This meant the references to the UART
weren't being handled properly and when booting the system would
constantly reboot.  Fix this by adding the spba node to the spl
device tree to restore normal booting.

Fixes: 4e5114daf9eb ("imx8mn: synchronise device tree with linux")
Signed-off-by: Adam Ford <aford173@gmail.com>
2 years agocrypto/fsl: fsl_hash: Fix crash in flush dcache
Gaurav Jain [Fri, 29 Jul 2022 10:02:23 +0000 (15:32 +0530)]
crypto/fsl: fsl_hash: Fix crash in flush dcache

wrong end address passed to flush_dcache_range.
modified the flush_dache logic for scatter list elements.

Fixes: 1919f58a8f (crypto/fsl: fsl_hash: Fix dcache issue in caam_hash_finish)
Signed-off-by: Gaurav Jain <gaurav.jain@nxp.com>
2 years agoimx: romapi: fix spurious ampersand in address print
Marcel Ziswiler [Wed, 20 Jul 2022 07:27:55 +0000 (09:27 +0200)]
imx: romapi: fix spurious ampersand in address print

Fix spurious ampersand in address print e.g.

Find img info 0x&480331a0, size 855

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Michael Trimarchi <michael@amarulasolutions.com>"
2 years agodoc: imx: habv4: Add Secure Boot guide for i.MX8M SPL targets
Marek Vasut [Tue, 12 Jul 2022 15:04:52 +0000 (17:04 +0200)]
doc: imx: habv4: Add Secure Boot guide for i.MX8M SPL targets

Add HABv4 documentation extension for SPL targets covering the
following topics:

- How to sign an securely boot an flash.bin container image.
- How to extend the root of trust for additional boot images.
- Add SPL and fitImage CSF examples.
- Add signature generation script example.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Breno Lima <breno.lima@nxp.com>
Cc: Fabio Estevam <festevam@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Utkarsh Gupta <utkarsh.gupta@nxp.com>
Cc: Ye Li <ye.li@nxp.com>
2 years agoARM: imxrt1170_defconfig: Add i.MXRT1170 defconfig
Jesse Taube [Tue, 26 Jul 2022 05:43:46 +0000 (01:43 -0400)]
ARM: imxrt1170_defconfig: Add i.MXRT1170 defconfig

Add a base defconfig for the i.MXRT1170

Signed-off-by: Jesse Taube <Mr.Bossman075@gmail.com>
2 years agoRAM: Add changes for i.MXRT11xx series
Jesse Taube [Tue, 26 Jul 2022 05:43:44 +0000 (01:43 -0400)]
RAM: Add changes for i.MXRT11xx series

The i.MXRT11 series has different offsets for IOCR_MUX, it also can
address 64MiB of SDRAM so add a macro for that.

Signed-off-by: Jesse Taube <Mr.Bossman075@gmail.com>
2 years agoclk: imx: Add initial support for i.MXRT1170 clock driver
Jesse Taube [Tue, 26 Jul 2022 05:43:43 +0000 (01:43 -0400)]
clk: imx: Add initial support for i.MXRT1170 clock driver

Add clock driver support for i.MXRT1170.

Signed-off-by: Jesse Taube <Mr.Bossman075@gmail.com>
2 years agoclk: imx: Add i.MXRT11xx pllv3 variant
Jesse Taube [Tue, 26 Jul 2022 05:43:42 +0000 (01:43 -0400)]
clk: imx: Add i.MXRT11xx pllv3 variant

The i.MXRT11 series has two new pll types but are variants of existing.
This patch adds the ability to read one of the pll types' frequency
as it can't be changed unlike the generic pll it also has the
division factors swapped.

Signed-off-by: Jesse Taube <Mr.Bossman075@gmail.com>
2 years agodt-bindings: imx: Add clock binding for i.MXRT1170
Jesse Taube [Tue, 26 Jul 2022 05:43:41 +0000 (01:43 -0400)]
dt-bindings: imx: Add clock binding for i.MXRT1170

Add the clock binding doc for i.MXRT1170.

Signed-off-by: Jesse Taube <Mr.Bossman075@gmail.com>
2 years agoARM: dts: imx: add i.MXRT1170-EVK support
Jesse Taube [Tue, 26 Jul 2022 05:43:45 +0000 (01:43 -0400)]
ARM: dts: imx: add i.MXRT1170-EVK support

The NXP i.MXRT1170 Evaluation Kit (EVK) provides a platform for rapid
evaluation of the i.MXRT, which features NXP's implementation of the Arm
Cortex-M7 and Cortex-M4 core.

The EVK provides 64 MB SDRAM, Micro SD card socket,
USB 2.0 OTG.

This patch aims to support the preliminary booting up features
as follows:
GPIO
LPUART
SD/MMC
SDRAM

Signed-off-by: Jesse Taube <Mr.Bossman075@gmail.com>
2 years agoARM: dts: imxrt11170-pinfunc: Add pinctrl binding header
Jesse Taube [Tue, 26 Jul 2022 05:43:40 +0000 (01:43 -0400)]
ARM: dts: imxrt11170-pinfunc: Add pinctrl binding header

Add binding header for i.MXRT1170 pinctrl device tree.

Signed-off-by: Jesse Taube <Mr.Bossman075@gmail.com>
2 years agoimx: imxrt1170-evk: Add support for the NXP i.MXRT1170-EVK
Jesse Taube [Tue, 26 Jul 2022 05:43:39 +0000 (01:43 -0400)]
imx: imxrt1170-evk: Add support for the NXP i.MXRT1170-EVK

This commit adds board support for i.MXRT1170-EVK from NXP. This board
is an evaluation kit provided by NXP for i.MXRT117x processor family.

Signed-off-by: Jesse Taube <Mr.Bossman075@gmail.com>
2 years agoMerge branch 'mpc85xx-for-v2022.10-rc5' of https://source.denx.de/u-boot/custodians...
Tom Rini [Sun, 18 Sep 2022 15:41:08 +0000 (11:41 -0400)]
Merge branch 'mpc85xx-for-v2022.10-rc5' of https://source.denx.de/u-boot/custodians/u-boot-mpc85xx

2 years agoMerge branch 'next' of https://source.denx.de/u-boot/custodians/u-boot-watchdog into...
Tom Rini [Sun, 18 Sep 2022 12:34:31 +0000 (08:34 -0400)]
Merge branch 'next' of https://source.denx.de/u-boot/custodians/u-boot-watchdog into next

- Migrate watchdog reset to cyclic infrastructure (Stefan)

2 years agoMerge https://source.denx.de/u-boot/custodians/u-boot-marvell
Tom Rini [Sun, 18 Sep 2022 12:27:23 +0000 (08:27 -0400)]
Merge https://source.denx.de/u-boot/custodians/u-boot-marvell

- mvebu: turris_omnia: Fix setting switch CONFIG pins on new board
  design (Marek)
- orion-timer: Use timer_conv_64() to fix timer wrap around (Stefan)

2 years agotimer: orion-timer: Use timer_conv_64() to fix timer wrap around
Stefan Roese [Thu, 15 Sep 2022 14:20:36 +0000 (16:20 +0200)]
timer: orion-timer: Use timer_conv_64() to fix timer wrap around

While testing on some Kirkwood platforms it was noticed that the timer
did not function correctly all the time. The driver did not correctly
handle 32bit timer value wrap arounds. Using the timer_conv_64()
conversion function fixes this issue.

Fixes: e9e73d78a8fb ("timer: add orion-timer support")
Suggested-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier-oss@weidmueller.com>
Signed-off-by: Stefan Roese <sr@denx.de>
Tested-by: Tony Dinh <mibodhi@gmail.com>
2 years agoarm: mvebu: turris_omnia: Fix setting switch CONFIG pins on new board design
Marek Behún [Tue, 13 Sep 2022 16:10:28 +0000 (18:10 +0200)]
arm: mvebu: turris_omnia: Fix setting switch CONFIG pins on new board design

It seems that waiting only 10 ms after releasing LAN switch from reset
is not enough for the strapping pins to latch the requested values.
P6_MODE[0] is latched to 0 instead of 1.

Increasing the delay to 50 ms fixes this issue.

Signed-off-by: Marek Behún <kabel@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agowatchdog: Further cleanup
Stefan Roese [Fri, 2 Sep 2022 12:10:49 +0000 (14:10 +0200)]
watchdog: Further cleanup

Remove some now unused macros and #ifdef's.

Signed-off-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Tom Rini <trini@konsulko.com> [am335x_evm, mx6cuboxi, rpi_3,dra7xx_evm, pine64_plus, am65x_evm, j721e_evm]
2 years agowatchdog: Remove WATCHDOG_RESET macro
Stefan Roese [Fri, 2 Sep 2022 12:10:48 +0000 (14:10 +0200)]
watchdog: Remove WATCHDOG_RESET macro

Now that we've globally replaced all WATCHDOG_RESET occurances, let's
remove the ugly macro itself in the header.

Signed-off-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Tom Rini <trini@konsulko.com> [am335x_evm, mx6cuboxi, rpi_3,dra7xx_evm, pine64_plus, am65x_evm, j721e_evm]
2 years agowatchdog: Get rid of ASSEMBLY hacks
Stefan Roese [Fri, 2 Sep 2022 12:10:47 +0000 (14:10 +0200)]
watchdog: Get rid of ASSEMBLY hacks

Only one occurance of WATCHDOG_RESET is left in one assembler file.
This patch changes this occurance to a direct call to watchdog_reset
and then removes all the ASSEMBLY ifdef'ery in watchdog.h, as it's not
needed any more to clean this mess a bit up.

Signed-off-by: Stefan Roese <sr@denx.de>
Tested-by: Tom Rini <trini@konsulko.com> [am335x_evm, mx6cuboxi, rpi_3,dra7xx_evm, pine64_plus, am65x_evm, j721e_evm]
2 years agocyclic: Use schedule() instead of WATCHDOG_RESET()
Stefan Roese [Fri, 2 Sep 2022 12:10:46 +0000 (14:10 +0200)]
cyclic: Use schedule() instead of WATCHDOG_RESET()

Globally replace all occurances of WATCHDOG_RESET() with schedule(),
which handles the HW_WATCHDOG functionality and the cyclic
infrastructure.

Signed-off-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Tom Rini <trini@konsulko.com> [am335x_evm, mx6cuboxi, rpi_3,dra7xx_evm, pine64_plus, am65x_evm, j721e_evm]
2 years agocyclic: Introduce schedule() function
Stefan Roese [Fri, 2 Sep 2022 12:10:45 +0000 (14:10 +0200)]
cyclic: Introduce schedule() function

This patch introduces a schedule() function, which shall be used instead
of the old WATCHDOG_RESET. Follow-up patches will make sure, that this
new function is used.

Signed-off-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Tom Rini <trini@konsulko.com> [am335x_evm, mx6cuboxi, rpi_3,dra7xx_evm, pine64_plus, am65x_evm, j721e_evm]
2 years agowatchdog: Integrate watchdog triggering into the cyclic framework
Stefan Roese [Thu, 18 Aug 2022 11:22:46 +0000 (13:22 +0200)]
watchdog: Integrate watchdog triggering into the cyclic framework

This patch integrates the watchdog triggering into the recently added
cyclic infrastructure. Each watchdog device that shall be triggered
registers it's own cyclic function. This way, multiple watchdog devices
are still supported, each via a cyclic function with separate trigger
intervals.

Signed-off-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Tom Rini <trini@konsulko.com> [am335x_evm, mx6cuboxi, rpi_3,dra7xx_evm, pine64_plus, am65x_evm, j721e_evm]
2 years agoconfigs: Resync with savedefconfig
Tom Rini [Fri, 16 Sep 2022 20:06:46 +0000 (16:06 -0400)]
configs: Resync with savedefconfig

Rsync all defconfig files using moveconfig.py

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoMerge branch '2022-09-16-rationalize-the-block-interface' into next
Tom Rini [Fri, 16 Sep 2022 19:35:47 +0000 (15:35 -0400)]
Merge branch '2022-09-16-rationalize-the-block-interface' into next

The block interface has two separate implementations, one using driver
model and one not. The latter is really only needed for SPL, where
size constraints allegedly don't allow use of driver model. Of course
we still need space for filesystems and other code, so it isn't clear
that driver model is anything more than the straw that breaks the
camel's back.

The driver model version uses a uclass ID for the interface time, but
converts back and forth between that and if_type, which is the legacy
type.

The HAVE_BLOCK_DEVICE define is mostly a hangover from the old days.
At present its main purpose is to enable the legacy block implementation
in SPL.

Finally the use of 'select' to enable BLK does not work very well. It
causes kconfig errors when another option depends on BLK and it is
not recommended by the kconfig style guide.

This series aims to clean things up:
- Enable BLK based on whether different media types are used, but still
  allow boards to disable it
- Rename HAVE_BLOCK_DEVICE to indicates its real purpose
- Drop if_type and use the uclass instead
- Drop some obsolete if_type values

An issue not resolved by this series is that the sandbox host interface
does not actually have a device. At present it uses the root device, which
was convenience for the driver model conversion but not really correct. It
should be possible to clean this up, in a future series.

Another minor issue is the use of UCLASS_USB for a mass-storage device.
This has been the case for a while and is not addresed by this series,
other than to add a comment.

Note that this test relies on Tom Rini's series to drop various boards
including warp and cm_t335

Finally, a patch is included to make binman put fake files in a
subdirectory, since repeated runs of certain boards can cause unrelated
failues (e.g. chromebook_coral) when fake files are left around.

2 years agommc: fsl_esdhc_spl: Add support for builds without CONFIG_SYS_MMC_U_BOOT_OFFS
Pali Rohár [Fri, 5 Aug 2022 20:09:41 +0000 (22:09 +0200)]
mmc: fsl_esdhc_spl: Add support for builds without CONFIG_SYS_MMC_U_BOOT_OFFS

When fixed offset via CONFIG_SYS_MMC_U_BOOT_OFFS is not specified then
expects that U-Boot proper is placed immediately after SPL without any
additional padding.

This allows to generate smaller SPL+U-Boot final binary as it is not
required to specify fixed offset to U-Boot proper at SPL compile time.

In this case offset to U-Boot proper is calculated at SPL compile time in
linker script.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Marek Behún <kabel@kernel.org>
2 years agopowerpc: mpc85xx: Fix loading U-Boot proper from SD card in SPL
Pali Rohár [Fri, 5 Aug 2022 20:09:40 +0000 (22:09 +0200)]
powerpc: mpc85xx: Fix loading U-Boot proper from SD card in SPL

Change 8-byte alignment of SPL binary to just 4-byte alignment as objcopy
trims trailing zero bytes when converting ELF file to RAW binary.

This is same fix for SPL linker script as was done fix for U-Boot linker
script in commit e8c0e0064c8a ("powerpc: mpc85xx: Fix CONFIG_OF_SEPARATE
support").

It is required for the patch "mmc: fsl_esdhc_spl: Add support for builds
without CONFIG_SYS_MMC_U_BOOT_OFFS" which triggered this issue in SPL.

Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Marek Behún <kabel@kernel.org>
2 years agommc: fsl_esdhc_spl: Add support for loading proper U-Boot from unaligned location
Pali Rohár [Fri, 5 Aug 2022 20:09:39 +0000 (22:09 +0200)]
mmc: fsl_esdhc_spl: Add support for loading proper U-Boot from unaligned location

This allows to concatenate SPL and proper U-Boot without extra alignment.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Marek Behún <kabel@kernel.org>