platform/kernel/u-boot.git
2 years agoclk: mediatek: add clock driver support for MediaTek MT7986 SoC
Weijie Gao [Fri, 9 Sep 2022 12:00:09 +0000 (20:00 +0800)]
clk: mediatek: add clock driver support for MediaTek MT7986 SoC

This patch adds clock driver support for MediaTek MT7986 SoC

Reviewed-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Daniel Golle <daniel@makrotopia.org>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2 years agoclk: mediatek: add CLK_XTAL support for clock driver
Weijie Gao [Fri, 9 Sep 2022 12:00:07 +0000 (20:00 +0800)]
clk: mediatek: add CLK_XTAL support for clock driver

This adds the CLK_XTAL macro/flag to allow modeling clocks which are
directly connected to the xtal clock.

Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Daniel Golle <daniel@makrotopia.org>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2 years agoclk: mediatek: add infrasys clock mux support
Weijie Gao [Fri, 9 Sep 2022 12:00:04 +0000 (20:00 +0800)]
clk: mediatek: add infrasys clock mux support

This patch adds infrasys clock mux support for mediatek clock drivers.

Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Daniel Golle <daniel@makrotopia.org>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2 years agoclk: mediatek: add support to configure clock driver parent
Weijie Gao [Fri, 9 Sep 2022 12:00:01 +0000 (20:00 +0800)]
clk: mediatek: add support to configure clock driver parent

This patch adds support for a clock node to configure its parent clock
where possible.

Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Daniel Golle <daniel@makrotopia.org>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2 years agoclk: mediatek: add CLK_BYPASS_XTAL flag to allow bypassing searching clock parent...
Weijie Gao [Fri, 9 Sep 2022 11:59:59 +0000 (19:59 +0800)]
clk: mediatek: add CLK_BYPASS_XTAL flag to allow bypassing searching clock parent of xtal clock

The mtk clock framework in u-boot uses array index for searching clock
parent (kernel uses strings for search), so we need to specify a special
clock with ID=0 for CLK_XTAL in u-boot.

In the mt7622/mt7629 clock tree, the clocks with ID=0 never call
mtk_topckgen_get_mux_rate, adn return xtal clock directly. This what we
expected.

However for newer chips, they may have some clocks with ID=0 not
representing the xtal clock and still needs mtk_topckgen_get_mux_rate be
called. Current logic will make entire clock driver not working.

This patch adds a flag to indicate that whether a clock driver needs clocks
with ID=0 to call mtk_topckgen_get_mux_rate.

Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Daniel Golle <daniel@makrotopia.org>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2 years agopinctrl: mediatek: add pinctrl driver for MT7986 SoC
Weijie Gao [Fri, 9 Sep 2022 11:59:57 +0000 (19:59 +0800)]
pinctrl: mediatek: add pinctrl driver for MT7986 SoC

This patch adds pinctrl and gpio support for MT7986 SoC

Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Daniel Golle <daniel@makrotopia.org>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2 years agopinctrl: mediatek: add pinctrl driver for MT7981 SoC
Weijie Gao [Fri, 9 Sep 2022 11:59:55 +0000 (19:59 +0800)]
pinctrl: mediatek: add pinctrl driver for MT7981 SoC

This patch adds pinctrl and gpio support for MT7981 SoC

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2 years agodt-bindings: pinctrl: mediatek: add a header for common pinconf parameters
Weijie Gao [Fri, 9 Sep 2022 11:59:52 +0000 (19:59 +0800)]
dt-bindings: pinctrl: mediatek: add a header for common pinconf parameters

This patch adds a pinctrl header for common pinconf parameters such as
pull-up/pull-down resistors and drive strengths.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2 years agoarm: dts: mt7622: add i2c support
Weijie Gao [Fri, 9 Sep 2022 11:59:50 +0000 (19:59 +0800)]
arm: dts: mt7622: add i2c support

Add both hardware and software i2c support for mt7622.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2 years agoi2c: add support for MediaTek I2C interface
Weijie Gao [Fri, 9 Sep 2022 11:59:48 +0000 (19:59 +0800)]
i2c: add support for MediaTek I2C interface

This patch adds support for MediaTek I2C interface

Reviewed-by: Heiko Schocher <hs@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2 years agospi: add support for MediaTek spi-mem controller
Weijie Gao [Fri, 9 Sep 2022 11:59:45 +0000 (19:59 +0800)]
spi: add support for MediaTek spi-mem controller

This patch adds support for spi-mem controller found on newer MediaTek SoCs
This controller supports Single/Dual/Quad SPI mode.

Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Daniel Golle <daniel@makrotopia.org>
Signed-off-by: SkyLake.Huang <skylake.huang@mediatek.com>
2 years agowatchdog: mediatek: add support for MediaTek MT7986 SoC
Weijie Gao [Fri, 9 Sep 2022 11:59:43 +0000 (19:59 +0800)]
watchdog: mediatek: add support for MediaTek MT7986 SoC

Add watchdog support for MediaTek MT7986 SoC

Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Daniel Golle <daniel@makrotopia.org>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2 years agotimer: mtk: add support for MediaTek MT7981/MT7986 SoCs
Weijie Gao [Fri, 9 Sep 2022 11:59:41 +0000 (19:59 +0800)]
timer: mtk: add support for MediaTek MT7981/MT7986 SoCs

This patch add general-purpose timer support for MediaTek MT7981/MT7986.
These two SoCs uses a newer version of timer with its register definition
slightly changed.

Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Daniel Golle <daniel@makrotopia.org>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2 years agopwm: mtk: add support for MediaTek MT7981 SoC
Weijie Gao [Fri, 9 Sep 2022 11:59:38 +0000 (19:59 +0800)]
pwm: mtk: add support for MediaTek MT7981 SoC

This patch adds PWM support for MediaTek MT7981 SoC.
MT7981 uses a different register offset so we have to add a version field
to indicate the IP core version.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2 years agopwm: mtk: add support for MediaTek MT7986 SoC
Weijie Gao [Fri, 9 Sep 2022 11:59:36 +0000 (19:59 +0800)]
pwm: mtk: add support for MediaTek MT7986 SoC

This patch adds PWM support for MediaTek MT7986 SoC.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2 years agoarm: dts: mt7622: force high-speed mode for uart
Weijie Gao [Fri, 9 Sep 2022 11:59:33 +0000 (19:59 +0800)]
arm: dts: mt7622: force high-speed mode for uart

The input clock for uart is too slow (25MHz) which introduces frequent data
error on both receiving and transmitting even if the baudrate is 115200.

Using high-speed can significantly solve this issue.

Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Daniel Golle <daniel@makrotopia.org>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2 years agoserial: mtk: add support for using dynamic baud clock souce
Weijie Gao [Fri, 9 Sep 2022 11:59:31 +0000 (19:59 +0800)]
serial: mtk: add support for using dynamic baud clock souce

The baud clock on some platform may change due to assigned-clock-parent
set in DT. In current flow the baud clock is only retrieved during probe
stage. If the parent of the source clock changes after probe stage, the
setbrg will set wrong baudrate.

To get the right clock rate, this patch records the baud clk struct to the
driver's priv, and changes the driver's flow to get the clock rate before
calling _mtk_serial_setbrg().

Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Daniel Golle <daniel@makrotopia.org>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2 years agonet: mediatek: add support for MediaTek MT7981/MT7986
Weijie Gao [Fri, 9 Sep 2022 11:59:28 +0000 (19:59 +0800)]
net: mediatek: add support for MediaTek MT7981/MT7986

This patch adds support for MediaTek MT7981 and MT7986. Both chips uses
PDMA v2.

Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Tested-by: Daniel Golle <daniel@makrotopia.org>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2 years agonet: mediatek: add support for PDMA v2
Weijie Gao [Fri, 9 Sep 2022 11:59:26 +0000 (19:59 +0800)]
net: mediatek: add support for PDMA v2

This patch adds support for PDMA v2 hardware. The PDMA v2 has extended the
DMA descriptor to 8-words, and some of its fields have changed comparing
to the v1 hardware.

Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Daniel Golle <daniel@makrotopia.org>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2 years agonet: mediatek: stop using bitfileds for DMA descriptors
Weijie Gao [Fri, 9 Sep 2022 11:59:24 +0000 (19:59 +0800)]
net: mediatek: stop using bitfileds for DMA descriptors

This patch is a preparation for adding a new version of PDMA of which the
DMA descriptor fields has changed. Using bitfields will result in a complex
modification. Convert bitfields to u32 units can solve this problem easily.

Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Daniel Golle <daniel@makrotopia.org>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2 years agonet: mediatek: use a struct to cover variations of all SoCs
Weijie Gao [Fri, 9 Sep 2022 11:59:21 +0000 (19:59 +0800)]
net: mediatek: use a struct to cover variations of all SoCs

Using a single soc id to control different initialization and TX/RX flow
for all SoCs is not extensible if more hardware variations are added in
the future.

This patch introduces a struct to replace the original mtk_soc to allow
the driver be able handle newer hardwares.

Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Daniel Golle <daniel@makrotopia.org>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2 years agommc: mediatek: add support for MediaTek MT7891/MT7986 SoCs
Weijie Gao [Fri, 9 Sep 2022 11:59:19 +0000 (19:59 +0800)]
mmc: mediatek: add support for MediaTek MT7891/MT7986 SoCs

Add eMMC and SDXC support for MediaTek MT7981/MT7986 SoCs
Both chips support SDXC and eMMC 4.5. MT7986A supports eMMC 5.1.

Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Daniel Golle <daniel@makrotopia.org>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2 years agoboard: mediatek: add MT7981 reference boards
Weijie Gao [Fri, 9 Sep 2022 11:59:16 +0000 (19:59 +0800)]
board: mediatek: add MT7981 reference boards

This patch adds general board files based on MT7981 SoCs.

MT7981 uses one mmc controller for booting from both SD and eMMC, and the
pins of mmc controller are also shared with spi controller.
So three configs are need for these boot types:

1. mt7981_rfb_defconfig - SPI-NOR and SPI-NAND
2. mt7981_emmc_rfb_defconfig - eMMC only
3. mt7981_sd_rfb_defconfig - SD only

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2 years agoboard: mediatek: add MT7986 reference boards
Weijie Gao [Fri, 9 Sep 2022 11:59:13 +0000 (19:59 +0800)]
board: mediatek: add MT7986 reference boards

Add general board files based on MT7986 SoCs.

MT7986 uses one mmc controller for booting from both SD and eMMC.
Both MT7986A and MT7986B use the same pins for spi controller.

Configs for various boot types:
1. mt7986_rfb_defconfig - SPI-NOR and SPI-NAND for MT7986A/B
2. mt7986a_bpir3_emmc_defconfig - eMMC for MT7986A only
3. mt7986a_bpir3_sd_defconfig - SD for MT7986A only

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2 years agoarm: mediatek: add support for MediaTek MT7981 SoC
Weijie Gao [Fri, 9 Sep 2022 11:59:11 +0000 (19:59 +0800)]
arm: mediatek: add support for MediaTek MT7981 SoC

This patch adds basic support for MediaTek MT7981 SoC.
This include the file that will initialize the SoC after boot and its
device tree.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2 years agoarm: mediatek: add support for MediaTek MT7986 SoC
Weijie Gao [Fri, 9 Sep 2022 11:59:09 +0000 (19:59 +0800)]
arm: mediatek: add support for MediaTek MT7986 SoC

This patch adds basic support for MediaTek MT7986 SoC.
This include the file that will initialize the SoC after boot and its
device tree.

Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Daniel Golle <daniel@makrotopia.org>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.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 tag 'u-boot-imx-20220922' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx
Tom Rini [Thu, 22 Sep 2022 14:29:29 +0000 (10:29 -0400)]
Merge tag 'u-boot-imx-20220922' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx

u-boot-imx-20220922
-------------------

Fixes for 2022.10

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

2 years agokontron-sl-mx8mm: Let CONFIG_SPL_FIT_IMAGE_TINY be selected
Fabio Estevam [Wed, 24 Aug 2022 01:09:34 +0000 (22:09 -0300)]
kontron-sl-mx8mm: Let CONFIG_SPL_FIT_IMAGE_TINY be selected

When CONFIG_IMX_HAB is selected the 'hab_status' command reports several
error events, indicating that the BootROM failed to authenticate the SPL.

After inspecting the content of the memory location that corresponds to
the DTB load address, the content did not match with the DTB binary,
showing that some kind of memory corruption/overlap occurred.

Letting the CONFIG_SPL_FIT_IMAGE_TINY option to be selected causes the
DTB to be properly placed into RAM and no more overlap occurs.

With this change, the 'hab_status' command returns no more error events,
which indicates that the BootROM succeeded to authenticate the SPL.

Signed-off-by: Fabio Estevam <festevam@denx.de>
Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de>
2 years agomx8m: csf.sh: Fix the calculation of fit_block_size
Fabio Estevam [Sat, 13 Aug 2022 12:03:10 +0000 (09:03 -0300)]
mx8m: csf.sh: Fix the calculation of fit_block_size

When running the script to sign SPL/U-Boot on a kontron-sl-mx8mm board,
the fit_block_size was calculated as 0x1000 instead of 0x1020.

Add an extra parenthesis pair to fix it.

Signed-off-by: Fabio Estevam <festevam@denx.de>
Reviewed-by: Marek Vasut <marex@denx.de>
2 years agoMerge tag 'dm-pull-21sep22' of https://source.denx.de/u-boot/custodians/u-boot-dm
Tom Rini [Wed, 21 Sep 2022 12:22:11 +0000 (08:22 -0400)]
Merge tag 'dm-pull-21sep22' of https://source.denx.de/u-boot/custodians/u-boot-dm

Fix futility bintool to run on newer distros
Apply a lost patch

2 years agobinman: Get futility by building it
Simon Glass [Sat, 17 Sep 2022 15:01:19 +0000 (09:01 -0600)]
binman: Get futility by building it

A binary download is not great, since it depends on libraries being
present in the system. Build futility from source instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agocmd: fdt: Add support for reading stringlist property values
Marek Vasut [Fri, 8 Jul 2022 21:50:43 +0000 (23:50 +0200)]
cmd: fdt: Add support for reading stringlist property values

The fdt command currently handles stringlists as strings in 'fdt get value'
subcommand. Since strings in FDT stringlists are separated by '\0', only
the first value gets inserted into the environment variable passed to the
'fdt get value' command.

Example, consider the following DT snippet:

/ { compatible = "foo", "bar" };

The following command only reports the first string in stringlist:
=> fdt get value var / compatible ; print var
foo

It is not possible to assign list of null-terminated strings into U-Boot
environment variable. Add optional 'index' parameter to the subcommand
'fdt get value <var> <path> <prop> [<index>]' which lets user specify which
string within the stringlist should be assigned into the 'var' variable.
The default value of 'index' is 0 in case it is not present. This way the
'fdt' command API does not change and existing scripts are not broken.

The following command now reports the Nth string in stringlist, counting
from zero:
=> fdt get value var / compatible 1 ; print var
bar

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@konsulko.com>
2 years agoarm64: zynqmp: Wire GEM reset gpio
Michal Simek [Fri, 9 Sep 2022 11:05:49 +0000 (13:05 +0200)]
arm64: zynqmp: Wire GEM reset gpio

With ethernet-phy-id driver ETH phy reset can be properly handle that's why
describe it in DT.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/5bfd92827033d19617113f4117f37dcf79699a0f.1662721547.git.michal.simek@amd.com
2 years agoarm64: zynqmp: Describe TI phy as ethernet-phy-id
Michal Simek [Fri, 9 Sep 2022 11:05:48 +0000 (13:05 +0200)]
arm64: zynqmp: Describe TI phy as ethernet-phy-id

TI DP83867 is using strapping based on MIO pins. Tristate setup can influce
PHY address. That's why switch description with ethernet-phy-id compatible
string which enable calling reset. PHY itself setups phy address after
power up or reset. Reset description will be added in separate commit.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/52bf9ac0453d4e4896d8edd2618e684bb1ff6012.1662721547.git.michal.simek@amd.com
2 years agoxilinx: versal: Remove unused comments from xilinx_versal.h
Michal Simek [Mon, 19 Sep 2022 08:16:53 +0000 (10:16 +0200)]
xilinx: versal: Remove unused comments from xilinx_versal.h

Couple of options have been moved to Kconfig but comments stayed in header
that's why remove them.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/ffaee826dcb6853825ac72db91bb3a682c42297d.1663575411.git.michal.simek@amd.com
2 years agoARM: imx: Deduplicate i.MX8M SNVS LPGPR unlock
Marek Vasut [Mon, 19 Sep 2022 19:37:07 +0000 (21:37 +0200)]
ARM: imx: Deduplicate i.MX8M SNVS LPGPR unlock

Pull this LPGPR unlock into common code, since it is used in multiple
systems already.

Signed-off-by: Marek Vasut <marex@denx.de>
2 years agoarm: dts: imx8mm-venice-gw7901: add dsa phy handles to u-boot dtsi
Tim Harvey [Fri, 9 Sep 2022 21:42:38 +0000 (14:42 -0700)]
arm: dts: imx8mm-venice-gw7901: add dsa phy handles to u-boot dtsi

The upstream Linux DSA drivers do not require phy-handle nodes in
the DSA ports yet the U-Boot DSA drivers do. Add a phy-handle and
the mdio nodes to the u-boot.dtsi file so that future dts file
syncrhonization between Linux and U-Boot don't break networking.

Fixes: 24a7a3c1c042 ("imx8mm: synchronise device tree with linux")
Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2 years agoarm: dts: imx8mp-venice-gw74xx: add dsa phy handles to u-boot dtsi
Tim Harvey [Fri, 9 Sep 2022 21:42:11 +0000 (14:42 -0700)]
arm: dts: imx8mp-venice-gw74xx: add dsa phy handles to u-boot dtsi

The upstream Linux DSA drivers do not require phy-handle nodes in
the DSA ports yet the U-Boot DSA drivers do. Add a phy-handle and
the mdio nodes to the u-boot.dtsi file so that future dts file
syncrhonization between Linux and U-Boot don't break networking.

Fixes: e0caa84ca685 ("imx8mp: synchronise device tree with linux")
Signed-off-by: Tim Harvey <tharvey@gateworks.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 https://gitlab.denx.de/u-boot/custodians/u-boot-usb
Tom Rini [Mon, 19 Sep 2022 20:49:18 +0000 (16:49 -0400)]
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-usb

- Fix a typo and remove an unused driver

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 agousb: gadget: designware-udc: Drop the driver
Marek Vasut [Tue, 23 Aug 2022 17:06:50 +0000 (19:06 +0200)]
usb: gadget: designware-udc: Drop the driver

This driver is not used by any system and is long unmaintained, drop it.
There is a DWC2 OTG driver which is maintained, see CONFIG_USB_GADGET_DWC2_OTG .

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2 years agousb: Kconfig: Fix typo in SPL_DM_USB text
Fabio Estevam [Sat, 17 Sep 2022 23:28:29 +0000 (20:28 -0300)]
usb: Kconfig: Fix typo in SPL_DM_USB text

Change a typo in "USB host mode".

Signed-off-by: Fabio Estevam <festevam@denx.de>
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>