platform/kernel/u-boot.git
2 years agodoc: board: raspberrypi: Add documentation
Matthias Brugger [Mon, 14 Mar 2022 11:03:54 +0000 (12:03 +0100)]
doc: board: raspberrypi: Add documentation

Add documentation about the different configuration files for the
RaspberryPi board family.

Signed-off-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 years agodoc: uefi: Fix reference to CONFIG_EFI_SECURE_BOOT
Jan Kiszka [Wed, 16 Mar 2022 11:12:16 +0000 (12:12 +0100)]
doc: uefi: Fix reference to CONFIG_EFI_SECURE_BOOT

There is no CONFIG_UEFI_SECURE_BOOT, and there was never any.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 years agoNokia RX-51: Update documentation about QEMU
Pali Rohár [Tue, 8 Mar 2022 17:59:56 +0000 (18:59 +0100)]
Nokia RX-51: Update documentation about QEMU

Add section how to run U-Boot in n900 qemu machine.

Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 years agodoc: boards: amlogic: Add documentation on pre-generated FIP files
Neil Armstrong [Wed, 2 Mar 2022 09:42:22 +0000 (10:42 +0100)]
doc: boards: amlogic: Add documentation on pre-generated FIP files

It add documentation on licencing & provides links to the amlogic-boot-fip
pre-built files collections.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2 years agodoc: board: amlogic-p20x: fix FIP generation doc
Neil Armstrong [Wed, 2 Mar 2022 09:42:21 +0000 (10:42 +0100)]
doc: board: amlogic-p20x: fix FIP generation doc

The doc used GXL instructions, which couldn't work on GXBB SoCs.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2 years agotools: buildman: Fix doc path in warning message
Johannes Krottmayer [Tue, 1 Mar 2022 03:49:51 +0000 (04:49 +0100)]
tools: buildman: Fix doc path in warning message

Fix documentation path in deprecated warning message about device
driver.

Signed-off-by: Johannes Krottmayer <krjdev@gmail.com>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 years agoMakefile: Fix doc path in warning message
Johannes Krottmayer [Tue, 1 Mar 2022 03:49:50 +0000 (04:49 +0100)]
Makefile: Fix doc path in warning message

Fix documentation path in warning message about deprecated device driver.

Signed-off-by: Johannes Krottmayer <krjdev@gmail.com>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 years agoMerge tag 'u-boot-rockchip-20220318' of https://source.denx.de/u-boot/custodians...
Tom Rini [Fri, 18 Mar 2022 20:37:39 +0000 (16:37 -0400)]
Merge tag 'u-boot-rockchip-20220318' of https://source.denx.de/u-boot/custodians/u-boot-rockchip

- Fix for chromebook gru and bob board;
- some fix on driver like dram and saradc;

2 years agorockchip: ram: sdram_rk3x88: replace comma by semicolon
Johan Jonker [Wed, 12 Jan 2022 16:32:11 +0000 (17:32 +0100)]
rockchip: ram: sdram_rk3x88: replace comma by semicolon

A comma at the end of a line gives sometimes strange
effects in combination with some code formatters,
so replace a comma by a semicolon in the sdram_rk3188.c
and sdram_rk3288.c files.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2 years agorockchip: Set default LNX_KRNL_IMG_TEXT_OFFSET_BASE to SYS_TEXT_BASE
Alper Nebi Yasak [Sat, 29 Jan 2022 15:27:56 +0000 (18:27 +0300)]
rockchip: Set default LNX_KRNL_IMG_TEXT_OFFSET_BASE to SYS_TEXT_BASE

U-Boot can be chainloaded from vendor firmware on ARM64 chromebooks from
a GPT partition (roughly the same as in doc/chromium/chainload.rst), but
an appropriate image header must be built-in to the U-Boot binary by
enabling LINUX_KERNEL_IMAGE_HEADER.

This header has a field for an image load offset from 2MiB alignment
which must also be customized through LNX_KRNL_IMG_TEXT_OFFSET_BASE.
Set it equal to SYS_TEXT_BASE by default for Rockchip boards, which
happens to make this offset zero and works fine on chromebook_kevin
both for chainloading and bare-metal use.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2 years agorockchip: saradc: remove double semi-colon
Giulio Benetti [Mon, 14 Mar 2022 09:09:43 +0000 (10:09 +0100)]
rockchip: saradc: remove double semi-colon

Remove double semi-colon that has been forgotten while adding the
driver. This is only a style fix since it doesn't change the
functionality of the driver.

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2 years agorockchip: rk3328: enable USB mass storage on Renegade
Leonidas-Panagiotis Papadakos [Mon, 14 Mar 2022 16:51:49 +0000 (18:51 +0200)]
rockchip: rk3328: enable USB mass storage on Renegade

This is very useful to access the LibreComputer eMMC as removable
storage from a PC (e.g. like so `ums 0 mmc 0`). It has been tested as
working on my Renegade board.

Signed-off-by: Leonidas P. Papadakos <papadakospan at gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2 years agoMAINTAINERS: add rockchip regex for more files and directories
Johan Jonker [Fri, 24 Dec 2021 17:10:28 +0000 (18:10 +0100)]
MAINTAINERS: add rockchip regex for more files and directories

The current files and directories with wildcard patterns for
Rockchip patches in MAINTAINERS is not always complete.
Add the regex for DT related files and a generic regex for
catching some other forgotten cases, so that the maintainers
receive all Rockchip related patches.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
2 years agorockchip: rk3399: Add support for chromebook_kevin
Marty E. Plummer [Fri, 24 Dec 2021 13:43:46 +0000 (16:43 +0300)]
rockchip: rk3399: Add support for chromebook_kevin

Add support for Kevin, an RK3399-based convertible chromebook that is
very similar to Bob. This patch is mostly based on existing support for
Bob, with only minor changes for Kevin-specific things.

Unlike other Gru boards, coreboot sets Kevin's center logic to 925 mV,
so adjust it here in the dts as well. The rk3399-gru-kevin devicetree
has an unknown event code reference which has to be defined, set it
to the Linux counterpart. The new defconfig is copied from Bob with the
diffconfig:

     DEFAULT_DEVICE_TREE "rk3399-gru-bob" -> "rk3399-gru-kevin"
     DEFAULT_FDT_FILE "rockchip/rk3399-gru-bob.dtb" -> "rockchip/rk3399-gru-kevin.dtb"
     VIDEO_ROCKCHIP_MAX_XRES 1280 -> 2400
     VIDEO_ROCKCHIP_MAX_YRES 800 -> 1600
    +TARGET_CHROMEBOOK_KEVIN y

With this Kevin can boot from SPI flash to a usable U-Boot prompt on the
display with the keyboard working, but cannot boot into Linux for
unknown reasons.

eMMC starts in a working state but fails to re-init, microSD card works
but at a lower-than-expected speed, USB works but causes a hang on
de-init. There are known workarounds to solve eMMC and USB issues.

Cc: Marty E. Plummer <hanetzer@startmail.com>
Cc: Simon Glass <sjg@chromium.org>
[Alper: commit message, resync config with Bob, update MAINTAINERS,
        add to Rockchip doc, add Kconfig help message, set regulator]
Co-developed-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
2 years agorockchip: bob: Enable more configs
Alper Nebi Yasak [Fri, 24 Dec 2021 13:43:45 +0000 (16:43 +0300)]
rockchip: bob: Enable more configs

This patch enables some configs that should be working on the Bob board,
based on what is observed to work on the Kevin board.

The Bob board uses an Embedded DisplayPort panel compatible with the
simple panel and Rockchip eDP drivers. Its backlight is controlled by
the Chromium OS Embedded Controller Pulse Width Modulator. Enable these
for the board.

Also set VIDEO_ROCKCHIP_MAX_{XRES,YRES} to 1280x800, the resolution of
its panel. This had to be done for the Kevin board, but it's untested if
this is actually necessary for Bob.

The Rockchip video driver needs to assert/deassert some resets, so also
enable the reset controller. RESET_ROCKCHIP defaults to y for this board
when DM_RESET=y, so it's enough to set that.

The Bob board has two USB 3.0 Type-C ports and one USB 2.0 Type-A port
on its right side. Enable the configs relevant to USB devices so these
can be used. This is despite a known issue with RK3399 boards where USB
de-init causes a hang, as there is a known workaround.

Some other rk3399-based devices enable support for the SoC's random
number generator in commit a475bef5340c ("configs: rk3399: enable rng on
firefly/rock960/rockpro64"), as it can provide a KASLR seed when booting
using UEFI. Enable it for Bob as well.

The default misc_init_r() for Rockchip boards sets cpuid and ethernet
MAC address based on e-fuse block. A previous patch extends this on Gru
boards to set registers related to SoC IO domains as is necessary on
these boards. Enable this function and configs for it on Bob.

The microSD card slot on this board (and others based on Gru) is
connected to a GPIO controlled regulator (ppvar-sd-card-io), which must
be operable by U-Boot. Enable the relevant config option to allow this.

Bob boards also use the Winbond W25Q64DW SPI flash chip, enable support
for Winbond SPI flash chips in the board config so U-Boot can boot with
this chip.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
2 years agorockchip: gru: Add more devicetree settings
Simon Glass [Fri, 24 Dec 2021 13:43:44 +0000 (16:43 +0300)]
rockchip: gru: Add more devicetree settings

This adds some devicetree settings for the Gru-based boards, based on
what works on a Kevin board.

Gru-based boards usually have an 8MiB SPI flash chip and boot from it.
Make the u-boot.rom file intended to be flashed on it match its size.
Add properties for booting from SPI, and only try to boot from SPI as
MMC and SD card don't seem to work in SPL yet.

The Chromium OS EC needs a delay between transactions so it can get
itself ready. Also it currently uses a non-standard way of specifying
the interrupt. Add these so that the EC works reliably.

The Rockchip Embedded DisplayPort driver is looking for a rockchip,panel
property to find the panel it should work on. Add the property for the
Gru-based boards.

The U-Boot GPIO controlled regulator driver only considers the
"enable-gpios" devicetree property, not the singular "enable-gpio" one.
Some devicetree source files have the singular form as they were added
to Linux kernel when it used that form, and imported to U-Boot as is.
Fix one instance of this in the Gru boards' devicetree to the form that
works in U-Boot.

The PWM controlled regulator driver complains that there is no init
voltage set for a regulator it drives, though it's not clear which one.
Set them all to the voltage levels coreboot sets them: 900 mV.

The RK3399 SoC needs to know the voltage level that some supplies
provides, including one fixed 1.8V audio-related regulator. Although
this synchronization is currently statically done in the board init
functions, a not-so-hypothetical driver that does this dynamically would
query the regulator only to get -ENODATA and be confused. Make sure
U-Boot knows this supply is at 1.8V by setting its limits to that.

Most of this is a reapplication of commit 08c85b57a5ec ("rockchip: gru:
Add extra device-tree settings") whose changes were removed during a
sync with Linux at commit 167efc2c7a46 ("arm64: dts: rk3399: Sync
v5.7-rc1 from Linux"). Apply things to rk3399-gru-u-boot.dtsi instead so
they don't get lost again.

Signed-off-by: Simon Glass <sjg@chromium.org>
[Alper: move to -u-boot.dtsi, rewrite commit message, add more nodes]
Co-developed-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
2 years agorockchip: gru: Set up SoC IO domain registers
Alper Nebi Yasak [Fri, 24 Dec 2021 13:43:43 +0000 (16:43 +0300)]
rockchip: gru: Set up SoC IO domain registers

The RK3399 SoC needs to know the voltage value provided by some
regulators, which is done by setting relevant register bits. Configure
these the way other RK3399 boards do, but with the same values as are
set in the equivalent code in coreboot.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
2 years agoMerge https://source.denx.de/u-boot/custodians/u-boot-mmc
Tom Rini [Wed, 16 Mar 2022 12:13:16 +0000 (08:13 -0400)]
Merge https://source.denx.de/u-boot/custodians/u-boot-mmc

- Rockchip, i.MX and xenon_sdhci updates

2 years agoMerge https://source.denx.de/u-boot/custodians/u-boot-marvell
Tom Rini [Wed, 16 Mar 2022 12:12:45 +0000 (08:12 -0400)]
Merge https://source.denx.de/u-boot/custodians/u-boot-marvell

- mvebu: dts: turris_mox: fix non-working network / MDIO (Marek)

2 years agoMerge https://source.denx.de/u-boot/custodians/u-boot-riscv
Tom Rini [Wed, 16 Mar 2022 12:11:53 +0000 (08:11 -0400)]
Merge https://source.denx.de/u-boot/custodians/u-boot-riscv

- k210 updates

2 years agoMerge https://source.denx.de/u-boot/custodians/u-boot-sh
Tom Rini [Wed, 16 Mar 2022 12:11:14 +0000 (08:11 -0400)]
Merge https://source.denx.de/u-boot/custodians/u-boot-sh

- Config tweaks to enable the right I2C driver

2 years agorockchip: sdhci: Add HS400 Enhanced Strobe support for RK3568
Alper Nebi Yasak [Tue, 15 Mar 2022 17:46:28 +0000 (20:46 +0300)]
rockchip: sdhci: Add HS400 Enhanced Strobe support for RK3568

On RK3568, a register bit must be set to enable Enhanced Strobe.
However, it appears that the address of this register may differ from
vendor to vendor and should be read from the underlying MMC IP. Let the
Rockchip SDHCI driver read this address and set the relevant bit when
Enhanced Strobe configuration is requested.

The IP uses a custom mode select value (0x7) for HS400, use that instead
of the common but non-standard SDHCI_CTRL_HS400 value (0x5). Also add
some necessary DLL_STRBIN and DLL_TXCLK configuration for HS400.

Additionally, a bit signifying that the connected hardware is an eMMC
chip must be set to enable Data Strobe for HS400 and HS400ES modes. Also
make the driver set this bit as appropriate.

This is partly ported from Linux's Synopsys DWC MSHC driver which
happens to be the underlying IP. (drivers/mmc/host/sdhci-of-dwcmshc.c in
Linux tree).

Co-developed-by: Yifeng Zhao <yifeng.zhao@rock-chips.com>
Signed-off-by: Yifeng Zhao <yifeng.zhao@rock-chips.com>
Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2 years agorockchip: sdhci: Add HS400 Enhanced Strobe support for RK3399
Alper Nebi Yasak [Tue, 15 Mar 2022 17:46:27 +0000 (20:46 +0300)]
rockchip: sdhci: Add HS400 Enhanced Strobe support for RK3399

On RK3399, a register bit must be set to enable Enhanced Strobe.
Let the Rockchip SDHCI driver set it when Enhanced Strobe configuration
is requested. However, having it set makes the lower-speed modes stop
working and makes reinitialization fail, so let it be unset as needed in
set_control_reg().

This is mostly ported from Linux's Arasan SDHCI driver which happens
to be the underlying IP. (drivers/mmc/host/sdhci-of-arasan.c in Linux
tree).

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2 years agommc: sdhci: Add HS400 Enhanced Strobe support
Alper Nebi Yasak [Tue, 15 Mar 2022 17:46:26 +0000 (20:46 +0300)]
mmc: sdhci: Add HS400 Enhanced Strobe support

Delegate setting the Enhanced Strobe configuration to individual drivers
if they set a function for it. Return -ENOTSUPP if they do not, like
what the MMC uclass does.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2 years agommc: xenon_sdhci: remove wait_dat0 SDHCI OP
Robert Marko [Fri, 11 Mar 2022 18:14:07 +0000 (19:14 +0100)]
mmc: xenon_sdhci: remove wait_dat0 SDHCI OP

Generic SDHCI driver received support for checking the busy status by
polling the DAT[0] level instead of waiting for the worst MMC switch time.

Unfortunately, it appears that this does not work for Xenon controllers
despite being a part of the standard SDHCI registers and the Armada 3720
datasheet itself telling that BIT(20) is useful for detecting the DAT[0]
busy signal.

I have tried increasing the timeout value, but I have newer managed to
catch DAT_LEVEL bits change from 0 at all.

This issue appears to hit most if not all SoC-s supported by Xenon driver,
at least A3720, A8040 and CN9130 have non working eMMC currently.

So, until a better solution is found drop the wait_dat0 OP for Xenon.
I was able to only test it on A3720, but it should work for others as well.

Fixes: 40e6f52454fc ("drivers: mmc: Add wait_dat0 support for sdhci driver")
Signed-off-by: Robert Marko <robert.marko@sartura.hr>
Reviewed-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agocmd/mmc: fix output of mmc info for e-MMC
Max Merchel [Thu, 10 Feb 2022 09:16:39 +0000 (10:16 +0100)]
cmd/mmc: fix output of mmc info for e-MMC

e-MMC and SD standards differ for some CID fields:

- 6 Byte Name - assigned by Manufacturer (SD 5 Byte)
- 1 Byte OEM - assigned by Jedec  (SD 2 Byte)

See e-MMC standard (JEDEC Standard No. 84-B51), 7.2.3 (OID) and 7.2.4 (PNM)

Signed-off-by: Max Merchel <Max.Merchel@tq-group.com>
Signed-off-by: Markus Niebel <Markus.Niebel@ew.tq-group.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2 years agommc: fsl_esdhc_imx: use VENDORSPEC_FRC_SDCLK_ON when necessary
Haibo Chen [Tue, 22 Feb 2022 03:28:18 +0000 (11:28 +0800)]
mmc: fsl_esdhc_imx: use VENDORSPEC_FRC_SDCLK_ON when necessary

After commit f132aab40327 ("Revert "mmc: fsl_esdhc_imx: use
VENDORSPEC_FRC_SDCLK_ON to control card clock output""), it
involve issue in mmc_switch_voltage(), because of the special
design of usdhc.

For FSL_USDHC, it do not implement VENDORSPEC_CKEN/PEREN/HCKEN/IPGEN,
these are reserved bits(Though RM contain the definition of these bits,
but actually internal IC logic do not implement, already confirm with
IC team). Instead, use VENDORSPEC_FRC_SDCLK_ON to gate on/off the card
clock output. Here is the definition of this bit in RM:

[8] FRC_SDCLK_ON
Force CLK output active
Do not set this bit to 1 unless it is necessary. Also, make sure that
this bit is cleared when uSDHC’s clock is about to be changed (frequency
change, clock source change, or delay chain tuning).
0b - CLK active or inactive is fully controlled by the hardware.
1b - Force CLK active

In default, the FRC_SDCLK_ON is 0. This means, when there is no command
or data transfer on bus, hardware will gate off the card clock. But in
some case, we need the card clock keep on. Take IO voltage 1.8v switch
as example, after IO voltage change to 1.8v, spec require gate off the
card clock for 5ms, and gate on the clock back, once detect the card
clock on, then the card will draw the dat0 to high immediately. If there
is not clock gate off/on behavior, some card will keep the dat0 to low
level. This is the reason we fail in mmc_switch_voltage().

To fix this issue, and concern that this is only the fsl usdhc hardware
design limitation, set the bit FRC_SDCLK_ON in the beginning of the
wait_dat0() and clear it in the end. To make sure the 1.8v IO voltage
switch process align with SD specification.

For standard tuning process, usdhc specification also require the card
clock keep on, so also add these behavior in fsl_esdhc_execute_tuning().

Reviewed-by: Marek Vasut <marex@denx.de>
Tested-by: Fabio Estevam <festevam@gmail.com>
Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2 years agoarm: mvebu: dts: turris_mox: fix non-working network / MDIO
Marek Behún [Tue, 15 Mar 2022 15:37:27 +0000 (16:37 +0100)]
arm: mvebu: dts: turris_mox: fix non-working network / MDIO

Commit 0934dddc6436 ("arm: a37xx: Update DTS files to version from
upstream Linux kernel") ported Linux's device-tree files for Armada 3720
SOCs. This broke network on Turris MOX, because the SOC's MDIO bus in
U-Boot currently isn't probed via DM as it's own device, but is
registered as part of mvneta's driver, which means that pinctrl
definitions are not parsed for the MDIO bus node. Also mvneta driver
does not consider "phy-handle" property, only "phy".

For now, fix this by adding armada-3720-turris-mox-u-boot.dtsi file
returning the MDIO to how it was defined previously.

A better solution (using proper mvmdio DM driver) is being work on, but
will need testing on various boards, and we need the bug fixed now for
the upcoming release.

Fixes: 0934dddc6436 ("arm: a37xx: Update DTS files to version from upstream Linux kernel")
Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agoMerge tag 'u-boot-stm32-20220315' of https://source.denx.de/u-boot/custodians/u-boot-stm
Tom Rini [Tue, 15 Mar 2022 12:42:36 +0000 (08:42 -0400)]
Merge tag 'u-boot-stm32-20220315' of https://source.denx.de/u-boot/custodians/u-boot-stm

mtd: add NAND write protect support to stm32_fmc2_nand
stm32mp1 bsec: Add permanent lock write support
stm32mp1 bsec: Add dev in function description
cmd_stboard: Update test on misc_read() result
video: fix the check of return value of clk_set_rate in stm32_ltdc
DT: Alignment with kernel v5.17 for stm32mp15
DT: Add USB OTG pinctrl and regulator in SPL for DHCOR
DT: Move vdd_io extras into Avenger96 extras
DT: Add DFU support for DHCOM recovery
ram: stm32mp1: Unconditionally enable ASR
psci: Implement PSCI system suspend and DRAM SSR for stm32mp

2 years agopinctrl: k210: Fix bias-pull-up
Niklas Cassel [Tue, 1 Mar 2022 10:35:45 +0000 (10:35 +0000)]
pinctrl: k210: Fix bias-pull-up

Using bias-pull-up would actually cause the pin to have its pull-down
enabled. Fix this.

Original Linux patch by Sean Anderson:
https://lore.kernel.org/linux-gpio/20220209182822.640905-1-seanga2@gmail.com/

Fixes: 7224d5ccf8e1 ("pinctrl: Add support for Kendryte K210 FPIOA")
Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
2 years agopinctrl: k210: Fix loop in k210_pc_get_drive()
Niklas Cassel [Tue, 1 Mar 2022 10:35:44 +0000 (10:35 +0000)]
pinctrl: k210: Fix loop in k210_pc_get_drive()

The loop exited too early so the k210_pc_drive_strength[0] array element
was never used.

Original Linux patch by Dan Carpenter:
https://lore.kernel.org/linux-gpio/20220209180804.GA18385@kili/

Fixes: 7224d5ccf8e1 ("pinctrl: Add support for Kendryte K210 FPIOA")
Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
2 years agospi: dw: Actually mask interrupts
Sean Anderson [Tue, 1 Mar 2022 10:35:43 +0000 (10:35 +0000)]
spi: dw: Actually mask interrupts

The designware spi driver unconditionally uses polling.

The comment to spi_hw_init() also states that the function should disable
interrupts.

According to the DesignWare DW_apb_ssi Databook, value 0xff in IMR enables
all interrupts. Since we want to mask all interrupts write 0x0 instead.

On the canaan k210 board, pressing the reset button twice to reset the
board will run u-boot. If u-boot boots Linux without having SPI interrupts
masked, Linux will hang as soon as interrupts are enabled, because of an
interrupt storm.

Properly masking the SPI interrupts in u-boot allows us to successfully
boot Linux, even after resetting the board.

Fixes: 5bef6fd79f94 ("spi: Add designware master SPI DM driver used on SoCFPGA")
Signed-off-by: Sean Anderson <seanga2@gmail.com>
[Niklas: rewrite commit message]
Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
2 years agospi: dw: Force set K210 fifo length to 31
Damien Le Moal [Tue, 1 Mar 2022 10:35:43 +0000 (10:35 +0000)]
spi: dw: Force set K210 fifo length to 31

The Canaan Kendryte K210 SoC DW apb_ssi v4 spi controller is documented
to have a 32 word deep TX and RX FIFO, which spi_hw_init() detects.
However, when the RX FIFO is filled up to 32 entries (RXFLR = 32), an
RX FIFO overrun error occurs. Avoid this problem by force setting
fifo_len to 31.

Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
2 years agok210: dts: align plic node with Linux
Niklas Cassel [Tue, 1 Mar 2022 10:35:42 +0000 (10:35 +0000)]
k210: dts: align plic node with Linux

The Linux PLIC interrupt-controller driver actually initializes the hart
context registers in the PLIC driver exactly in the same order as
specified in the interrupts-extended device tree property. See the device
tree binding [1].

The ordering of the interrupts is therefore essential in order to
configure the PLIC correctly.

Fix the order so that we will have sane IRQ behavior when booting Linux
with the u-boot device tree.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/interrupt-controller/sifive,plic-1.0.0.yaml

Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2 years agok210: dts: align fpioa node with Linux
Damien Le Moal [Tue, 1 Mar 2022 10:35:41 +0000 (10:35 +0000)]
k210: dts: align fpioa node with Linux

Linux kernel fpioa pinctrl driver expects the sysctl phandle and the
power bit offset of the fpioa device to be specified as a single
property "canaan,k210-sysctl-power".
Replace the "canaan,k210-sysctl" and "canaan,k210-power-offset"
properties with "canaan,k210-sysctl-power" to satisfy the Linux kernel
requirements. This new property is parsed using the existing function
dev_read_phandle_with_args().

Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
2 years agok210: dts: add missing power bus clocks
Damien Le Moal [Tue, 1 Mar 2022 10:35:40 +0000 (10:35 +0000)]
k210: dts: add missing power bus clocks

Linux drivers for many of the K210 peripherals depend on the power bus
clock to be specified. Add the missing clocks and their names to avoid
problems when booting Linux using u-boot DT.

Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
2 years agok210: use the board vendor name rather than the marketing name
Damien Le Moal [Tue, 1 Mar 2022 10:35:39 +0000 (10:35 +0000)]
k210: use the board vendor name rather than the marketing name

"kendryte" is the marketing name for the K210 RISC-V SoC produced by
Canaan Inc. Rather than "kendryte,k210", use the usual "canaan,k210"
vendor,SoC compatibility string format in the device tree files and
use the SoC name for file names.
With these changes, the device tree files are more in sync with the
Linux kernel DTS and drivers, making uboot device tree usable by the
kernel.

Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2 years agoARM: dts: stm32: Add DFU support for DHCOM recovery
Marek Vasut [Mon, 14 Mar 2022 12:35:54 +0000 (13:35 +0100)]
ARM: dts: stm32: Add DFU support for DHCOM recovery

This patch configures U-Boot SPL for DHCOM SoM to permit DFU upload of
SPL and subsequent u-boot.itb for recovery or commissioning purposes.

The DFU usage procedure is identical to STM32MP1 DHCOR SoM, see commit
3919aa1722a ("ARM: dts: stm32: Add DFU support for DHCOR recovery") ,
except for switching the SoM into DFU mode. By default, the DHCOM SoM
has no dedicated mechanism for setting BOOTn straps into UART/USB mode,
therefore to enter DFU mode, the SoC must fail to boot from boot media
which can be selected by the BOOTn strap override mechanism first and
then fall back to DFU mode.

In case of a SoM with pre-populated BOOTn strap override button, power
the system off, remove microSD card (if applicable), hold down the BOOTn
strap override button located between eMMC and SoM edge connector, power
on the SoM. The SoC will fail to boot from SD card and fall back into
DFU mode.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Patrice Chotard <patrice.chotard@foss.st.com>
Cc: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2 years agostm32mp: psci: Implement PSCI system suspend and DRAM SSR
Marek Vasut [Fri, 25 Feb 2022 01:15:59 +0000 (02:15 +0100)]
stm32mp: psci: Implement PSCI system suspend and DRAM SSR

Implement PSCI system suspend and placement of DRAM into SSR while the
CPUs are in suspend. This saves non-trivial amount of power in suspend,
on 2x W632GU6NB-15 ~710mW.

Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Patrick Delaunay <patrick.delaunay@foss.st.com>
Cc: Patrice Chotard <patrice.chotard@foss.st.com>
2 years agoram: stm32mp1: Unconditionally enable ASR
Marek Vasut [Fri, 25 Feb 2022 01:15:58 +0000 (02:15 +0100)]
ram: stm32mp1: Unconditionally enable ASR

Enable DRAM ASR, auto self-refresh, unconditionally. This saves non-trivial
amount of power both at runtime and in suspend (on 2x W632GU6NB-15 ~150mW).

Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Patrick Delaunay <patrick.delaunay@foss.st.com>
Cc: Patrice Chotard <patrice.chotard@foss.st.com>
2 years agoARM: dts: stm32: Move vdd_io extras into Avenger96 extras
Marek Vasut [Thu, 3 Feb 2022 01:49:29 +0000 (02:49 +0100)]
ARM: dts: stm32: Move vdd_io extras into Avenger96 extras

The vdd_io regulator is present only on DHCOR SoM configured for 1V8 IO,
as populated on Avenger96, but not present on 3V3 DHCOR SoM. Move these
extras to Avenger96 u-boot DT extras.

Fixes: 3919aa1722a ("ARM: dts: stm32: Add DFU support for DHCOR recovery")
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Patrice Chotard <patrice.chotard@foss.st.com>
Cc: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2 years agoARM: dts: stm32: Add USB OTG pinctrl and regulator nodes into SPL DT on DHCOR
Marek Vasut [Fri, 28 Jan 2022 18:35:20 +0000 (19:35 +0100)]
ARM: dts: stm32: Add USB OTG pinctrl and regulator nodes into SPL DT on DHCOR

Fix the following warning in SPL and make sure that even DTs which
enforce Vbus detection using u-boot,force-vbus-detection;, the DFU
in SPL will work.

dwc2-udc-otg usb-otg@49000000: prop pinctrl-0 index 0 invalid phandle

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Patrice Chotard <patrice.chotard@foss.st.com>
Cc: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2 years agoarm: dts: stm32mp15: alignment with v5.17
Patrick Delaunay [Mon, 31 Jan 2022 15:07:54 +0000 (16:07 +0100)]
arm: dts: stm32mp15: alignment with v5.17

Device tree alignment with Linux kernel v5.17-rc1
- ARM: dts: stm32: add pull-up to USART3 and UART7 RX pins
  on STM32MP15 DKx boards
- ARM: dts: stm32: clean uart4_idle_pins_a node for stm32mp15
- ARM: dts: stm32: tune the HS USB PHYs on stm32mp15xx-dkx
- ARM: dts: stm32: tune the HS USB PHYs on stm32mp157c-ev1
- ARM: dts: stm32: fix stusb1600 pinctrl used on stm32mp157c-dk

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2 years agovideo: stm32: stm32_ltdc: fix the check of return value of clk_set_rate()
Gabriel Fernandez [Tue, 1 Feb 2022 13:02:14 +0000 (14:02 +0100)]
video: stm32: stm32_ltdc: fix the check of return value of clk_set_rate()

The clk_set_rate() function returns rate as an 'ulong' not
an 'int' and rate > 0 by default.

This patch avoids to display the associated warning when
the set rate function returns the new frequency.

Fixes: aeaf330649e8 ("video: stm32: stm32_ltdc: add bridge to display controller")
Signed-off-by: Gabriel Fernandez <gabriel.fernandez@foss.st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2 years agoboard: st: common: update test on misc_read result in command stboard
Patrick Delaunay [Tue, 1 Feb 2022 13:37:19 +0000 (14:37 +0100)]
board: st: common: update test on misc_read result in command stboard

Update management of misc_read/misc_write, which now returns length of
data after the commit 8729b1ae2cbd ("misc: Update read() and write()
methods to return bytes xfered"): raise a error when the result is not
the expected length.

Fixes: 658fde8a36ff ("board: stm32mp1: stboard: lock the OTP after programming")
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2 years agostm32mp1: bsec: add missing dev in function comment
Patrick Delaunay [Tue, 15 Feb 2022 15:08:51 +0000 (16:08 +0100)]
stm32mp1: bsec: add missing dev in function comment

Add the missing @dev reference in some function description.

Fixes: b66bfdf238b9 ("arm: stm32mp: bsec: migrate trace to log macro")
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2 years agostm32mp: bsec: add permanent lock write support
Patrick Delaunay [Tue, 15 Feb 2022 15:08:50 +0000 (16:08 +0100)]
stm32mp: bsec: add permanent lock write support

Add support of the permanent lock support in U-Boot proper
when BSEC is not managed by secure monitor (TF-A SP_MIN or OP-TEE).

This patch avoid issue with stm32key command and fuse command
on basic boot for this missing feature of U-Boot BSEC driver.

Reported-by: Johann Neuhauser <jneuhauser@dh-electronics.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Tested-by: Johann Neuhauser <jneuhauser@dh-electronics.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2 years agomtd: rawnand: stm32_fmc2: add NAND Write Protect support
Christophe Kerello [Tue, 22 Feb 2022 16:38:49 +0000 (17:38 +0100)]
mtd: rawnand: stm32_fmc2: add NAND Write Protect support

This patch adds the support of the WP# signal. WP will be disabled
before the first access to the NAND flash.

Signed-off-by: Christophe Kerello <christophe.kerello@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2 years agoMerge https://source.denx.de/u-boot/custodians/u-boot-usb
Tom Rini [Tue, 15 Mar 2022 02:54:53 +0000 (22:54 -0400)]
Merge https://source.denx.de/u-boot/custodians/u-boot-usb

- Bugfix for dwc2 USB driver.

2 years agoMerge tag 'video-20220314' of https://source.denx.de/u-boot/custodians/u-boot-video
Tom Rini [Mon, 14 Mar 2022 22:39:26 +0000 (18:39 -0400)]
Merge tag 'video-20220314' of https://source.denx.de/u-boot/custodians/u-boot-video

 - fix display of the u-boot logo on Apple devices
 - convert Nokia RX-51 to CONFIG_DM_VIDEO

2 years agoPrepare v2022.04-rc4
Tom Rini [Mon, 14 Mar 2022 20:39:08 +0000 (16:39 -0400)]
Prepare v2022.04-rc4

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoMerge branch '2022-03-14-regression-fixes'
Tom Rini [Mon, 14 Mar 2022 18:04:55 +0000 (14:04 -0400)]
Merge branch '2022-03-14-regression-fixes'

- Regression fixes for RK3399 eMMC, j721e Sierra SerDes driver,
  vexpress64 autoboot and tbs2910 image size

2 years agoboard: tbs2910: Enable Link Time Optimizations in defconfig
Soeren Moch [Mon, 14 Mar 2022 08:26:25 +0000 (09:26 +0100)]
board: tbs2910: Enable Link Time Optimizations in defconfig

This saves about 12 kBytes image size and helps to stay within the
size limit.

Suggested-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Soeren Moch <smoch@web.de>
2 years agovexpress64: fvp: Fix automatic boot
Andre Przywara [Fri, 4 Mar 2022 16:30:08 +0000 (16:30 +0000)]
vexpress64: fvp: Fix automatic boot

Commit 90f262a6951f ("vexpress64: Clean up BASE_FVP boot configuration")
cleaned up the usage of default address variables, but missed to update
the address for the kernel in the FVP's bootcmd definition.

Change ${kernel_addr} to read ${kernel_addr_r} to bring back the
automated boot for the fastmodel.
Also use "setenv" instead of the potentially ambiguous "set" on the way.

Fixes: 90f262a6951f ("vexpress64: Clean up BASE_FVP boot configuration")
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2 years agoboard: ti: j721e: evm.c: Fix the probing of in Sierra SerDes0
Aswath Govindraju [Fri, 4 Mar 2022 12:15:26 +0000 (17:45 +0530)]
board: ti: j721e: evm.c: Fix the probing of in Sierra SerDes0

Initialization and power on operations of links have been moved under the
link device in the Sierra SerDes driver. Also, the UCLASS of
sierra_phy_provider has been changed to UCLASS_MISC.

Therefore, fix the probing of SerDes0 instance accordingly.

Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
Reviewed-by: Georgi Vlaev <g-vlaev@ti.com>
2 years agophy: cadence: Sierra: Move the link operations from serdes phy to link device
Aswath Govindraju [Fri, 4 Mar 2022 12:15:25 +0000 (17:45 +0530)]
phy: cadence: Sierra: Move the link operations from serdes phy to link device

In commit 6f46c7441a9f ("phy: cadence: Sierra: Add a UCLASS_PHY device for
links"), a separate udevice of type UCLASS_PHY was created for each link.
Therefore, move the corresponding link operations under the link device.

Also, change the uclass of sierra phy to UCLASS_MISC as it is no longer the
phy device.

Fixes: 6f46c7441a9f ("phy: cadence: Sierra: Add a UCLASS_PHY device for links")
Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
Reviewed-by: Georgi Vlaev <g-vlaev@ti.com>
2 years agorockchip: sdhci: Fix RK3399 eMMC PHY power cycling
Alper Nebi Yasak [Fri, 28 Jan 2022 22:42:37 +0000 (01:42 +0300)]
rockchip: sdhci: Fix RK3399 eMMC PHY power cycling

The Rockchip RK3399 eMMC PHY has to be power-cycled while changing its
clock speed to some higher speeds. This is dependent on the desired
SDHCI clock speed, and it looks like the PHY should be powered off while
setting the SDHCI clock in these cases.

Commit ac804143cfd1 ("mmc: rockchip_sdhci: add phy and clock config for
rk3399") attempts to do this in the set_ios_post() hook by setting the
SDHCI clock once more while the PHY is turned off/on as necessary, as
the SDHCI framework does not provide a way to override how it sets its
clock. However, the commit breaks reinitializing the eMMC on a few
boards including chromebook_kevin and reportedly ROCKPro64.

This patch reworks the power cycling to utilize the SDHCI framework
slightly better (using the set_control_reg() hook to power off the PHY
and set_ios_post() hook to power it back on) which happens to fix the
issue, at least on a chromebook_kevin.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agoMerge https://source.denx.de/u-boot/custodians/u-boot-marvell
Tom Rini [Mon, 14 Mar 2022 15:24:20 +0000 (11:24 -0400)]
Merge https://source.denx.de/u-boot/custodians/u-boot-marvell

- kwboot: Misc minor improvement and fixes, e.g. mix of arguments (Pali)
- PCI: a37xx: Remap IO space to bus address 0x0 (Pali)

2 years agoMerge https://source.denx.de/u-boot/custodians/u-boot-x86
Tom Rini [Mon, 14 Mar 2022 14:57:15 +0000 (10:57 -0400)]
Merge https://source.denx.de/u-boot/custodians/u-boot-x86

- Trivial fixes for x86

2 years agoarm: a37xx: Remap IO space to bus address 0x0
Pali Rohár [Mon, 7 Mar 2022 18:12:59 +0000 (19:12 +0100)]
arm: a37xx: Remap IO space to bus address 0x0

Remap PCI I/O space to the bus address 0x0 in the Armada 37xx device-tree
in order to support legacy I/O port based cards which have hardcoded I/O
ports in low address space.

Some legacy PCI I/O based cards do not support 32-bit I/O addressing.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agotools: kwboot: Allow to mix positional arguments with option -b
Pali Rohár [Mon, 7 Mar 2022 18:03:09 +0000 (19:03 +0100)]
tools: kwboot: Allow to mix positional arguments with option -b

Commit 9e6d71d2b55f ("tools: kwboot: Allow to use -b without image path as
the last getopt() option") broke usage of kwboot with following arguments:

  kwboot -t -B 115200 /dev/ttyUSB0 -b u-boot-spl.kwb

Fix parsing of option -b with optional argument again.

Fixes: 9e6d71d2b55f ("tools: kwboot: Allow to use -b without image path as the last getopt() option")
Signed-off-by: Pali Rohár <pali@kernel.org>
Reported-by: Tony Dinh <mibodhi@gmail.com>
Tested-by: Tony Dinh <mibodhi at gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agotools: kwboot: Check if baudrate value is supported before sending image
Pali Rohár [Mon, 7 Mar 2022 18:03:08 +0000 (19:03 +0100)]
tools: kwboot: Check if baudrate value is supported before sending image

Call kwboot_open_tty() which baudrate value which was specified at the
command line by option -B. This function returns error if baudrate is not
supported by selected tty device.

Initial baudrate for image transfer is always 115200, so call
kwboot_tty_change_baudrate() with value 115200 immediately after
kwboot_open_tty() if baudrate specified by option -B is different than
115200.

This makes kwboot fail immediately, informing that baudrate is unsupported,
instead of failing only after the first part of image is already sent.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agotools: kwboot: Allow to specify custom baudrate only in supported operations
Pali Rohár [Mon, 7 Mar 2022 18:03:07 +0000 (19:03 +0100)]
tools: kwboot: Allow to specify custom baudrate only in supported operations

Custom baudrate different than 115200 may be specified only when kwboot is
not going to send boot/debug message pattern or when it is going to send
boot message pattern with image file (in which case baudrate change happens
after sending kwbimage header). BootROM detects boot/debug message pattern
only at baudrate 115200.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agousb: dwc2: handle return code of dev_read_size() in of to, plat function
Wolfgang Grandegger [Mon, 14 Mar 2022 08:32:53 +0000 (09:32 +0100)]
usb: dwc2: handle return code of dev_read_size() in of to, plat function

dev_read_size() returns -EINVAL (-22) if the property "g-tx-fifo-size"
does not exist. If that's the case, we now keep the default value of 0.

Signed-off-by: Wolfgang Grandegger <wg@aries-embedded.de>
2 years agoconfigs: condor: Enabled I2C support for R-Car V3H
Nam Nguyen [Tue, 18 Jan 2022 03:35:37 +0000 (10:35 +0700)]
configs: condor: Enabled I2C support for R-Car V3H

Enable I2C support for R-Car V3H (R8A77980) on Condor board.

Signed-off-by: Nam Nguyen <nam.nguyen.yh@renesas.com>
Signed-off-by: Hai Pham <hai.pham.ud@renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
2 years agoconfigs: eagle: Enabled I2C support for R-Car V3M
Nam Nguyen [Tue, 18 Jan 2022 03:33:40 +0000 (10:33 +0700)]
configs: eagle: Enabled I2C support for R-Car V3M

Enable I2C support for R-Car V3M (R8A77970) on Eagle board.

Signed-off-by: Nam Nguyen <nam.nguyen.yh@renesas.com>
Signed-off-by: Hai Pham <hai.pham.ud@renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
2 years agoconfigs: falcon: Enabled I2C support for R-Car V3U
Nam Nguyen [Tue, 18 Jan 2022 03:28:15 +0000 (10:28 +0700)]
configs: falcon: Enabled I2C support for R-Car V3U

Enable I2C support for R-Car V3U (R8A779A0) on Falcon board.

Signed-off-by: Nam Nguyen <nam.nguyen.yh@renesas.com>
Signed-off-by: Hai Pham <hai.pham.ud@renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
2 years agox86: Correct the coreboot header file in MAINTAINERS
Simon Glass [Sun, 13 Mar 2022 06:03:28 +0000 (23:03 -0700)]
x86: Correct the coreboot header file in MAINTAINERS

This board has its own config header file. Correct it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2 years agox86: Add an enum name for the GNVS firmware type
Simon Glass [Sun, 13 Mar 2022 06:03:27 +0000 (23:03 -0700)]
x86: Add an enum name for the GNVS firmware type

This enum is currently anonymous. Add a name so it can be used in the
code.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2 years agoMerge tag 'efi-2022-04-rc3-2' of https://source.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Sun, 13 Mar 2022 12:18:17 +0000 (08:18 -0400)]
Merge tag 'efi-2022-04-rc3-2' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request for efi-2022-04-rc3-2

Documentation:
* Fix description for SiFive Unmatched
* Add libgnutls28-dev to build dependencies

UEFI
* Avoid possibly invalid GUID pointers for protocol interfaces

Other
* Serial console support for cls command

2 years agoMerge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-spi
Tom Rini [Sat, 12 Mar 2022 12:20:29 +0000 (07:20 -0500)]
Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-spi

- sunXi SPI fixups (Andre)
- bcm iproc qspi (Rayagonda)

2 years agoefi_loader: copy GUID in InstallProtocolInterface()
Heinrich Schuchardt [Wed, 9 Mar 2022 18:56:23 +0000 (19:56 +0100)]
efi_loader: copy GUID in InstallProtocolInterface()

InstallProtocolInterface() is called with a pointer to the protocol GUID.
There is not guarantee that the memory used by the caller for the protocol
GUID stays allocated. To play it safe the GUID should be copied to U-Boot's
internal structures.

Reported-by: Joerie de Gram <j.de.gram@gmail.com>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 years agodoc: add libgnutls28-dev to build dependencies
Heinrich Schuchardt [Sat, 12 Mar 2022 10:56:23 +0000 (11:56 +0100)]
doc: add libgnutls28-dev to build dependencies

mkeficapsule requires package libgnutls28-dev for building

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 years agodoc: path to u-boot-spl.bin on SiFive Unmatched board
Heinrich Schuchardt [Thu, 10 Mar 2022 10:32:49 +0000 (11:32 +0100)]
doc: path to u-boot-spl.bin on SiFive Unmatched board

u-boot-spl.bin is built in spl/.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2 years agocmd: add serial console support for the cls command
Heinrich Schuchardt [Fri, 11 Feb 2022 17:11:05 +0000 (18:11 +0100)]
cmd: add serial console support for the cls command

Currently the cls command does not support the serial console

The screen can be cleared in the video uclass, the colored frame buffer
console, and the serial console by sending the same escape sequence.
This reduces the cls command to a single printf() statement on most
boards.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agomtd: spi-nor-ids: Enable quad read for Gigadevice gd25lq128
Niklas Cassel [Thu, 3 Mar 2022 18:26:39 +0000 (18:26 +0000)]
mtd: spi-nor-ids: Enable quad read for Gigadevice gd25lq128

The Gigadevice gd25lq128 serial flash exists in different versions,
all which identify themselves using the same JEDEC id.

gd25lq128c:
https://www.gigadevice.com/datasheet/gd25lq128

gd25lq128d:
https://www.gigadevice.com/datasheet/gd25lq128d

However, all versions support quad read, so enable it.
Tested and verified on the Sipeed MAix BiT board.

Fixes: 30b9a28a3f2d ("mtd: spi-nor-ids: Add Gigadevice gd25lq128 ID")
Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
2 years agosunxi: boards: Enable SPI flash support in U-Boot proper
Andre Przywara [Tue, 11 Jan 2022 12:46:06 +0000 (12:46 +0000)]
sunxi: boards: Enable SPI flash support in U-Boot proper

Some sunxi boards ship with SPI flash, which allows booting through the
BootROM. We cover this functionality by a separate SPL "mini" driver.
Separately we have a proper DM_SPI driver for U-Boot proper, which
provides access to the SPI flash through the "sf" command. That allows
to update the firmware on the SPI flash, also to store the environment
there.

However only very few boards actually enable support for U-Boot proper,
even though that would work and the SPL part is configured.

Use the cleaned up configuration scheme to enable SPI flash on those
boards which mention a SPI flash in their .dts, or which use the SPL SPI
support.

Out of the box this would enable storing the environment on the SPI
flash, and allows people to read or write the flash from U-Boot, for
instance to update the SPI flash when booted via an SD card.

For this to actually work there must be a "spi0" alias in the DT, which
most boards are missing. But this should be addressed separately.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
2 years agoenv: sunxi: enable ENV_IS_IN_SPI_FLASH
Andre Przywara [Tue, 11 Jan 2022 12:46:05 +0000 (12:46 +0000)]
env: sunxi: enable ENV_IS_IN_SPI_FLASH

Now that sunxi uses CONFIG_SPI more sanely, and can also now properly
load the environment from SPI flash, let's enable the symbol that
actually considers the SPI flash when accessing the environment.

As this symbol depends on CONFIG_SPI, which we now only enable if the
board has a SPI flash, we can make if "default y" for all Allwinner
boards.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
2 years agosunxi: use boot source for determining environment location
Andre Przywara [Tue, 11 Jan 2022 12:46:04 +0000 (12:46 +0000)]
sunxi: use boot source for determining environment location

Currently we only support to load the environment from raw MMC or FAT
locations on Allwinner boards. With the advent of SPI flash we probably
also want to support using the environment there, so we need to become
a bit more flexible.

Change the environment priority function to take the boot source into
account. When booted from eMMC or SD card, we use FAT or MMC, if
configured, as before.
If we are booted from SPI flash, we try to use the environment from
there, if possible. The same is true for NAND flash booting, although
this is somewhat theoretical right now (as untested).

This way we can use the same image for SD and SPI flash booting, which
allows us to simply copy a booted image from SD card to the SPI flash,
for instance.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
2 years agoenv: sunxi: Define location in SPI flash
Andre Przywara [Tue, 11 Jan 2022 12:46:03 +0000 (12:46 +0000)]
env: sunxi: Define location in SPI flash

To allow loading and storing the environment from SPI flash, adjust the
raw offset variables for Allwinner boards to make sense there.

U-Boot (including SPL and other blobs) is loaded from the beginning of
SPI flash, so move the environment location as far back as possible, to
not create unnecessary limits. As those offsets are shared with (now
mostly unused) raw MMC environment, we should respect the common one
megabyte limit, which also makes sense on SPI flash.

So limit the environment for those raw locations to 64KB, and place it
just below 1MB (@960KB).

Those values are currently unused, unless someone forcibly enables the
raw MMC environment. In this case it would break as of now, as the
current offset of 544KB is far too low for the current (arm64) U-Boot
proper.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
2 years agosunxi: Kconfig: Fix up SPI configuration
Andre Przywara [Tue, 11 Jan 2022 12:46:02 +0000 (12:46 +0000)]
sunxi: Kconfig: Fix up SPI configuration

Commit 7945caf22c44 ("arm: sunxi: Enable SPI/SPI-FLASH support for A64")
selected CONFIG_SPI by default on all Allwinner A64 boards, even though
only 4 out of the 14 A64 boards have a SPI flash chip. All other SoCs
had to manually select DM_SPI and friends, even though they are a
platform property (the sunxi SPI driver is DM_SPI only).

Clean this up to allow easy selection of SPI flash support in U-Boot
proper, by selecting DM_SPI and DM_SPI_FLASH *if* CONFIG_SPI is
selected, for *all* Allwinner SoCs. This simplifies the defconfig for
two Libretech boards already.

Also remove the forced CONFIG_SPI from the A64 Kconfig, instead let the
four boards which allow SPI booting select this explicitly.

Any board wishing to support SPI flash in U-Boot proper now just defines
CONFIG_SPI and CONFIG_SPI_FLASH_<vendor> in its defconfig, Kconfig takes
care of the rest.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
2 years agoNokia RX-51: Convert to CONFIG_DM_VIDEO
Pali Rohár [Wed, 9 Mar 2022 19:46:01 +0000 (20:46 +0100)]
Nokia RX-51: Convert to CONFIG_DM_VIDEO

Mechanically convert video_hw_init() function to UCLASS_VIDEO probe
callback and replace CONFIG_CFB_CONSOLE by CONFIG_DM_VIDEO.

As framebuffer base address is setup by the bootloader which loads U-Boot,
set plat->base to that fixed framebuffer address.

This change was tested in qemu n900 machine and is working fine.

What does not work is CONFIG_VIDEO_LOGO, seems to be buggy.

Signed-off-by: Pali Rohár <pali@kernel.org>
2 years agovideo: Allow drivers to allocate the frame buffer themselves
Pali Rohár [Wed, 9 Mar 2022 19:46:00 +0000 (20:46 +0100)]
video: Allow drivers to allocate the frame buffer themselves

When plat->base is set by driver then skip frame buffer reservation
and allocation.

Signed-off-by: Pali Rohár <pali@kernel.org>
2 years agovideo: bmp: Support x2r10g10b10 pixel format
Janne Grunau [Wed, 9 Feb 2022 21:16:22 +0000 (22:16 +0100)]
video: bmp: Support x2r10g10b10 pixel format

Fixes the display of the u-boot logo on Apple silicon devices.

Signed-off-by: Janne Grunau <j@jannau.net>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agoMerge branch '2022-03-08-assorted-fixes'
Tom Rini [Tue, 8 Mar 2022 13:42:51 +0000 (08:42 -0500)]
Merge branch '2022-03-08-assorted-fixes'

- serial uclass fix, mailmap/gitignore updates

2 years agoboard: .gitignore: replace dsdt.c by dsdt_generated.c
Philippe Reynes [Tue, 8 Mar 2022 09:37:19 +0000 (10:37 +0100)]
board: .gitignore: replace dsdt.c by dsdt_generated.c

Since commit 5d94cbd1dca7 ("scripts: Makefile.lib: generate
dsdt_generated.c instead of dsdt.c"), the file generated
is named dsdt_generated.c instead of dsdt.c.
So all files .gitignore referencing dsdt.c should be
upated with dsdt_generated.c.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2 years agodrivers: serial: Make sure we really return a serial device
Mark Kettenis [Mon, 21 Feb 2022 21:17:37 +0000 (22:17 +0100)]
drivers: serial: Make sure we really return a serial device

The stdout-path property in the device tree does not necessarily
point at a serial device. On machines such as the Apple M1 laptops
where the serial port isn't easy to access and users expect to see
console output on the integrated display stdout-path may point at
the device tree node for the framebuffer for example.

If stdout-path does not point at a node for a serial device, the
serial_check_stdout() will not find a bound device and will drop
down into code that attempts to use lists_bind_fdt() to bind a
device anyway. However, that fallback code does not check that
the uclass of the device is UCLASS_SERIAL. So if stdout-path points
at the framebuffer instead of the serial device it will return a
UCLASS_VIDEO device. Since the code that calls this function
expects the returned device to be a UCLASS_SERIAL device, U-Boot
will crash as soon as it attempts to send output to the console.

Add a check here to verify that the uclass of the bound device
really is UCLASS_SERIAL. If it isn't, serial_check_stdout() will
return an error and serial_find_console_or_panic() will use the
serial device with sequence number 0 as the console and all is fine.

Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years ago.mailmap: Fix Heinrich's xypron.glpk@gmx.de record
Michal Simek [Mon, 7 Mar 2022 07:41:21 +0000 (08:41 +0100)]
.mailmap: Fix Heinrich's xypron.glpk@gmx.de record

There is one issue with Heinrich xypron.glpk@gmx.de <xypron.glpk@gmx.de>
record which should be specifically grouped with his name.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2 years agoMerge https://source.denx.de/u-boot/custodians/u-boot-watchdog
Tom Rini [Tue, 8 Mar 2022 13:42:20 +0000 (08:42 -0500)]
Merge https://source.denx.de/u-boot/custodians/u-boot-watchdog

- Update MAINTAINERS file (Stefan)
- wdt-uclass.c: add a property u-boot, noautostart (Philippe)
- armada_37xx: Probe driver also when watchdog is already running (Pali)
- rti_wdt: Add 10% safety margin to clock frequency (Jan)

2 years agowatchdog: rti_wdt: Add 10% safety margin to clock frequency
Jan Kiszka [Tue, 8 Mar 2022 06:25:50 +0000 (07:25 +0100)]
watchdog: rti_wdt: Add 10% safety margin to clock frequency

When running against RC_OSC_32k, the watchdog may suffer from running
faster than expected, expiring earlier. The Linux kernel adds a 10%
margin to the timeout calculation by slowing down the read clock rate
accordingly. Do the same here, also to have comparable preset values
for both drivers.

Along this, fix the name of the local var holding to frequency - in Hz,
not kHz.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Stefan Roese <sr@denx.de>
2 years agowatchdog: armada_37xx: Probe driver also when watchdog is already running
Pali Rohár [Wed, 23 Feb 2022 13:21:40 +0000 (14:21 +0100)]
watchdog: armada_37xx: Probe driver also when watchdog is already running

If Armada 37xx watchdog is started before U-Boot then CNTR_CTRL_ACTIVE bit
is set, U-Boot armada-37xx-wdt.c driver fails to initialize and so U-Boot
is unable to use or kick this watchdog.

Do not check for CNTR_CTRL_ACTIVE bit and always initialize watchdog. Same
behavior is implemented in Linux kernel driver.

This change allows to activate watchdog in firmware which loads U-Boot.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agodrivers: watchdog: wdt-uclass.c: add a property u-boot, noautostart
Philippe Reynes [Thu, 10 Feb 2022 17:17:54 +0000 (18:17 +0100)]
drivers: watchdog: wdt-uclass.c: add a property u-boot, noautostart

Since commit 492ee6b8d0e7 ("watchdog: wdt-uclass.c: handle all DM
watchdogs in watchdog_reset()"), all the watchdog are started when
the config WATCHDOG_AUTOSTART.

To avoid a binary choice none/all, a property u-boot,noautostart
may be added in the watchdog node of the u-boot device tree to not
autostart this watchdog.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agoMAINTAINERS: Add watchdog maintainers entry
Stefan Roese [Thu, 13 Jan 2022 15:57:31 +0000 (16:57 +0100)]
MAINTAINERS: Add watchdog maintainers entry

I've been handling "inofficially" the watchdog related patches for a few
years now. Let's make this official and add a tree for it and also add
myself here in the MAINTAINERS file.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Tom Rini <trini@konsulko.com>
Cc: Harald Seiler <hws@denx.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
2 years agoMerge https://source.denx.de/u-boot/custodians/u-boot-sunxi
Tom Rini [Sun, 6 Mar 2022 01:46:55 +0000 (20:46 -0500)]
Merge https://source.denx.de/u-boot/custodians/u-boot-sunxi

- Fix ARMv5/F1C100 FEL booting
- Fix F1C100 reset
- Introduce proper F1C100 boot method detection
- Enable SPI booting for F1C100

Boot tested from FEL, SPI, SD card and eMMC (where applicable) on
Pine64-LTS, Pine-H64, BananaPi M1, OrangePi Zero, LicheePi Nano(F1C100).

2 years agoMerge branch '2022-03-04-assorted-minor-fixes'
Tom Rini [Sat, 5 Mar 2022 16:34:31 +0000 (11:34 -0500)]
Merge branch '2022-03-04-assorted-minor-fixes'

- mailmap file updates, OpenSSL code cleanup, assorted TI platform
  fixes, typo fix.

2 years agolib: rsa: use actual OpenSSL 1.1.0 EVP MD API
Yann Droneaud [Tue, 1 Mar 2022 15:12:34 +0000 (16:12 +0100)]
lib: rsa: use actual OpenSSL 1.1.0 EVP MD API

Since OpenSSL 1.1.0, EVP_MD_CTX_create() is EVP_MD_CTX_new()
                     EVP_MD_CTX_destroy() is EVP_MD_CTX_free()
                     EVP_MD_CTX_init() is EVP_MD_CTX_reset()

As there's no need to reset a newly created EVP_MD_CTX, moreover
EVP_DigestSignInit() does the reset, thus call to EVP_MD_CTX_init()
can be dropped.
As there's no need to reset an EVP_MD_CTX before it's destroyed,
as it will be reset by EVP_MD_CTX_free(), call to EVP_MD_CTX_reset()
is not needed and can be dropped.

Signed-off-by: Yann Droneaud <ydroneaud@opteya.com>
2 years ago.mailmap: Record all address for main U-Boot contributor
Michal Simek [Tue, 1 Mar 2022 11:43:32 +0000 (12:43 +0100)]
.mailmap: Record all address for main U-Boot contributor

Based on looking at top contributors it was seen that top statistics from
top contributors don't include all contributions from different email
addresses. That's why I checked all top contributors are checked it.

git shortlog -n $START..$END -e -s

The patch is adding mapping for Bin Meng, Marek Vasut, Masahiro Yamada,
Michal Simek, Tom Rini, Wolfgang Denk.
And also use mapping for Stefan Roese and Wolfgang Denk to be properly
counted.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Acked-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agomkimage: error handling for FIT image
Heinrich Schuchardt [Tue, 1 Mar 2022 07:53:56 +0000 (08:53 +0100)]
mkimage: error handling for FIT image

If parameter -F is given but FIT support is missing, a NULL pointer might
dereferenced (Coverity CID 350249).

If incorrect parameters are given, provide a message and show usage.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 years agocmd: pwm: fix typo 'eisable' -> 'disable'
Sébastien Szymanski [Fri, 25 Feb 2022 13:48:54 +0000 (14:48 +0100)]
cmd: pwm: fix typo 'eisable' -> 'disable'

Fixed misspelled 'disable' in help text.

Signed-off-by: Sébastien Szymanski <sebastien.szymanski@armadeus.com>
2 years agoarm: dts: iot2050: Add cfg register space for ringacc and udmap
Jan Kiszka [Wed, 16 Feb 2022 08:06:49 +0000 (09:06 +0100)]
arm: dts: iot2050: Add cfg register space for ringacc and udmap

Recent unrelated fixes (9876ae7db6da) revealed that we were missing bits
from 2af181b53e28 in the IOT2050 dt. Add them, but only for main U-Boot.
SPL loads from QSPI only, thus cannot use DMA.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>