platform/kernel/u-boot.git
2 years agoconfigs: Resync with savedefconfig
Tom Rini [Mon, 28 Mar 2022 14:01:11 +0000 (14:01 +0000)]
configs: Resync with savedefconfig

Rsync all defconfig files using moveconfig.py

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoMerge branch '2022-03-28-critical-fixes'
Tom Rini [Mon, 28 Mar 2022 13:56:05 +0000 (09:56 -0400)]
Merge branch '2022-03-28-critical-fixes'

- A zstd, two Apple M1 and an MXS NAND critical bugfix
- Clean up another file that wasn't being removed and update some
  external documentation links.

2 years agomtd: gpmi: fix the bch setting backward compatible issue
Han Xu [Fri, 25 Mar 2022 13:36:38 +0000 (08:36 -0500)]
mtd: gpmi: fix the bch setting backward compatible issue

Previous u-boot code changed the default bch setting behavior and caused
backward compatible issue. This fix choose the legacy bch geometry back
again as the default option. If the minimum ecc strength that NAND chips
required need to be chosen, it can be enabled by either adding DT flag
"fsl,use-minimum-ecc" or CONFIG_NAND_MXS_USE_MINIMUM_ECC in configs. The
unused flag "fsl,legacy-bch-geometry" get removed.

Fixes: 51cdf83eea (mtd: gpmi: provide the option to use legacy bch geometry)
Fixes: 616f03daba (mtd: gpmi: change the BCH layout setting for large oob NAND)
Tested-by: Tim Harvey <tharvey@gateworks.com>
Tested-by: Sean Nyekjaer <sean@geanix.com>
Signed-off-by: Han Xu <han.xu@nxp.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
2 years agoboot: image: fixup zstd decompression buffer initialization typo
Jérôme Carretero [Wed, 16 Mar 2022 19:35:36 +0000 (15:35 -0400)]
boot: image: fixup zstd decompression buffer initialization typo

The code was mistakenly initializing the input buffer twice.

Tested to be working on BeagleBone by adjusting CONFIG_SYS_BOOTM_LEN to
64MiB (probably works with less) and preparing uImage with:

 cat arch/arm/boot/Image \
  | zstd --ultra -22 --zstd=windowLog=22 \
  > linux.bin.zst

 mkimage -A arm -T kernel uImage -C zstd -d linux.bin.zst \
  -a 0x80008000 -e 0x80008000

Without the windowLog restriction, bootm fails with a zstd decompression
error 7 (window too large), which I haven't troubleshooted.

There should be a bit more documentation on the feature...

Reviewed-by: Simon Glass <sjg@chromium.org>
Fixes: 458b30af66c image: Update image_decomp() to avoid ifdefs

2 years agoFix URLs to old freescale git repos
Pali Rohár [Fri, 25 Mar 2022 09:51:46 +0000 (10:51 +0100)]
Fix URLs to old freescale git repos

Freescale git repos are now on source.codeaurora.org.

Signed-off-by: Pali Rohár <pali@kernel.org>
2 years agoMakefile: add drivers/video/u_boot_logo.S to clean
Heinrich Schuchardt [Sat, 19 Mar 2022 12:33:25 +0000 (13:33 +0100)]
Makefile: add drivers/video/u_boot_logo.S to clean

make sandbox_defconfig
make mrproper
make tests

fails with

../drivers/video/u_boot_logo.S: Assembler messages:
../drivers/video/u_boot_logo.S:5: Error: file not found: drivers/video/u_boot_logo.bmp

We have to delete the generated file.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agoarm: apple: Fix mem layout
Mark Kettenis [Mon, 21 Mar 2022 21:41:18 +0000 (22:41 +0100)]
arm: apple: Fix mem layout

The current approach for setting the environment variables that
describe the memory layout runs the risk of overlapping with
reserved memory regions. Use the lmb code to derive the addresses
for these variables instead.

Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agoarm: apple: Increase RTKit timeout
Hector Martin [Mon, 21 Mar 2022 21:36:05 +0000 (22:36 +0100)]
arm: apple: Increase RTKit timeout

The firmware on larger NVMe drives needs more than 100ms to come up.
Change the timeout to 1s.

Signed-off-by: Hector Martin <marcan@marcan.st>
Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agoMerge tag 'efi-2022-04-rc5-2' of https://source.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Sun, 27 Mar 2022 13:22:19 +0000 (09:22 -0400)]
Merge tag 'efi-2022-04-rc5-2' of https://source.denx.de/u-boot/custodians/u-boot-efi

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

Documentation:

* man-page for the wdt command

UEFI:

* Unit test for boot manager

2 years agocmd: efidebug: simplify do_efi_boot_add()
Heinrich Schuchardt [Wed, 23 Mar 2022 19:26:25 +0000 (20:26 +0100)]
cmd: efidebug: simplify do_efi_boot_add()

When calling efi_dp_from_name() we are not interested in the device part.
Just pass NULL as an argument.

Suggested-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 years agotest: test UEFI boot manager
Heinrich Schuchardt [Thu, 3 Mar 2022 11:31:18 +0000 (12:31 +0100)]
test: test UEFI boot manager

Provide a unit test for

* efidebug boot add
* efidebug boot order
* bootefi bootmgr
* initrd via EFI_LOAD_FILE2_PROTOCOL

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 years agoefi_loader: initrddump: drain input before prompt
Heinrich Schuchardt [Tue, 22 Mar 2022 17:20:07 +0000 (18:20 +0100)]
efi_loader: initrddump: drain input before prompt

Up to now the initrddump.efi application has drained the input after
showing the prompt. This works for humans but leads to problems when
automating testing. If the input is drained, this should be done before
showing the prompt.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2 years agoefi_loader: nocolor command line attr for initrddump.efi
Heinrich Schuchardt [Sun, 20 Mar 2022 08:21:57 +0000 (09:21 +0100)]
efi_loader: nocolor command line attr for initrddump.efi

initrddump.efi uses colored output and clear the screen. This is not
helpful for integration into Python tests. Allow specifying 'nocolor' in
the load option data to suppress color output and clearing the screen.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 years agoefi_loader: typo devie-path
Heinrich Schuchardt [Mon, 21 Mar 2022 07:26:48 +0000 (08:26 +0100)]
efi_loader: typo devie-path

%s/devie-path/device-path/

Reported-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 years agodoc: man-page for the wdt command
Heinrich Schuchardt [Fri, 25 Mar 2022 06:01:59 +0000 (07:01 +0100)]
doc: man-page for the wdt command

Describe the wdt command.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 years agoMerge https://source.denx.de/u-boot/custodians/u-boot-sunxi
Tom Rini [Sat, 26 Mar 2022 01:20:29 +0000 (21:20 -0400)]
Merge https://source.denx.de/u-boot/custodians/u-boot-sunxi

- Fix A20 GBit Ethernet operation
- Update board .dts files to provide correct RGMII PHY mode

2 years agosunxi: dts: Update RGMII phy-mode properties
Andre Przywara [Tue, 15 Mar 2022 23:20:54 +0000 (23:20 +0000)]
sunxi: dts: Update RGMII phy-mode properties

Commit f11513d99787 ("net: phy: realtek: Add tx/rx delay config for
8211e") made the Realtek PHY driver honour the phy-mode DT property,
to set up the proper delay scheme for the RX and TX lines. A similar
change in the kernel revealed that those properties were mostly wrong.
The kernel DTs got updated over the last few months, but we were missing
out on the U-Boot version.

Just sync in the phy-mode properties from the mainline kernel,
v5.17-rc7, to avoid the breaking DT sync that late in the cycle.

This fixes Ethernet operation on the affected boards.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Samuel Holland <samuel@sholland.org>
2 years agosunxi: Fix old GMAC pinmux setup
Andre Przywara [Tue, 15 Mar 2022 00:00:53 +0000 (00:00 +0000)]
sunxi: Fix old GMAC pinmux setup

Commit 5bc4cd05d7d4 ("sunxi: move non-essential code out of s_init()")
moved the call to eth_init_board() from s_init() into board_init_f().
This means it's now only called from the SPL, which makes sense for
most of the other moved low-level functions. However the GMAC pinmux and
clock setup in eth_init_board() was not happy about that, so it broke
the sun7i GMAC.

Since Ethernet is of no use in the SPL anyway, just move the call into
board_init(), which is only run in U-Boot proper.

This fixes Ethernet operation for the A20 SoCs, which broke in
v2022.04-rc1, with the above mentioned commit.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Tested-by: Petr Štetiar <ynezz@true.cz> [a20-olinuxino-lime2]
2 years agodoc: update doc/sphinx/requirements.txt
Heinrich Schuchardt [Fri, 25 Mar 2022 12:40:54 +0000 (13:40 +0100)]
doc: update doc/sphinx/requirements.txt

Pin all dependencies as reported by 'pip freeze'.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2 years agoMerge https://source.denx.de/u-boot/custodians/u-boot-marvell
Tom Rini [Thu, 24 Mar 2022 20:21:33 +0000 (16:21 -0400)]
Merge https://source.denx.de/u-boot/custodians/u-boot-marvell

- a37xx: espressobin: Fix non-working SPI (Pali)

2 years agoarm: a37xx: espressobin: Fix non-working SPI
Pali Rohár [Wed, 23 Mar 2022 16:19:42 +0000 (17:19 +0100)]
arm: a37xx: espressobin: Fix non-working SPI

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 SPI support on some Espressobin boards and results in
following U-Boot error:

  Loading Environment from SPIFlash... jedec_spi_nor flash@0: unrecognized JEDEC id bytes: f7, 30, 0b
  *** Warning - spi_flash_probe_bus_cs() failed, using default environment

Before that commit DT node for SPI was called 'spi-flash@0' and after
that commit it is called 'flash@0'. Before that commit 'spi-max-frequency'
was set to 50000000 and after it is 104000000.

Rename DT node 'spi-flash@0 in armada-3720-espressobin-u-boot.dtsi to
'flash@0' and set custom U-Boot 'spi-max-frequency' back to 50000000.

With this change SPI is working on Espressobin again and it is detected
with JEDEC ids ef, 60, 16 on our tested unit.

  Loading Environment from SPIFlash... SF: Detected w25q32dw with page size 256 Bytes, erase size 4 KiB, total 4 MiB
  OK

Note that it is unknown why spi-max-frequency with value 104000000 does not
work in U-Boot as it works fine with Linux kernel. Also note that in
defconfig file configs/mvebu_espressobin-88f3720_defconfig is set option
CONFIG_SF_DEFAULT_SPEED=40000000 which is different value than in DT.

Fixes: 0934dddc6436 ("arm: a37xx: Update DTS files to version from upstream Linux kernel")
Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agoMerge tag 'i2c-2022-04-rc5' of https://source.denx.de/u-boot/custodians/u-boot-i2c
Tom Rini [Wed, 23 Mar 2022 13:10:34 +0000 (09:10 -0400)]
Merge tag 'i2c-2022-04-rc5' of https://source.denx.de/u-boot/custodians/u-boot-i2c

i2c changes for fixes-for-2022.04

- atsha204a-i2c.c
  DTS and I2C fixes for Atmel ATSHA204 from Adrian

- i2c: fix always-true condition in i2c_probe_chip()
  from Nikita

- eeprom: Do not rewrite EEPROM I2C bus with DM I2C enabled
  from Marek

- clarify bootcount documentation fix from Michael

2 years agoarm: mvebu: dts: turris_mox: fix non-working USB port
Marek Behún [Tue, 22 Mar 2022 16:17:59 +0000 (17:17 +0100)]
arm: mvebu: dts: turris_mox: fix non-working USB port

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 USB port on Turris MOX, because in Linux' DTS the bus
voltage supply is described as a `phy-supply` property of connector
node, a mechanism that is not supported in U-Boot yet.

For now, fix this by adding `vbus-supply` to usb3 node.

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 agobootcount: clarify documentation
Michael Opdenacker [Wed, 2 Mar 2022 15:56:02 +0000 (16:56 +0100)]
bootcount: clarify documentation

- Grammar fixes
- Clarify explanations

Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
2 years agocmd: eeprom: Do not rewrite EEPROM I2C bus with DM I2C enabled
Marek Vasut [Wed, 16 Feb 2022 14:27:59 +0000 (15:27 +0100)]
cmd: eeprom: Do not rewrite EEPROM I2C bus with DM I2C enabled

With DM I2C, the EEPROM bus has been correctly configured in
eeprom_execute_command() already. Do not reconfigure it here
with hard-coded bus number again.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Tom Rini <trini@konsulko.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
2 years agoi2c: fix always-true condition in i2c_probe_chip()
Nikita Yushchenko [Tue, 15 Feb 2022 17:58:52 +0000 (20:58 +0300)]
i2c: fix always-true condition in i2c_probe_chip()

Per dm_i2c_ops.probe_chip documentation, i2c_probe_chip() shall fallback
to default probe method when .probe_chip() returns -ENOSYS.

Signed-off-by: Nikita Yushchenko <nikita.yoush@cogentembedded.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
2 years agomisc: atsha204a: fix i2c address readout from DTS
Adrian Fiergolski [Tue, 11 Jan 2022 18:05:31 +0000 (19:05 +0100)]
misc: atsha204a: fix i2c address readout from DTS

This patch replaces use fdtdec_get_addr with simpler dev_read_addr().
fdtdec_get_addr doesn't work properly on ZynqMP-based (64bit) system. Although
not confirmed, it could be related to the fact, that quoting the documentation,
"This variant hard-codes the number of cells used to represent the address and
size based on sizeof(fdt_addr_t) and sizeof(fdt_size_t)".

Signed-off-by: Adrian Fiergolski <adrian.fiergolski@fastree3d.com>
Reviewed-by: Marek Behún <marek.behun@nic.cz>
2 years agomisc: atsha204a: add delay after sending the message
Adrian Fiergolski [Tue, 11 Jan 2022 18:05:30 +0000 (19:05 +0100)]
misc: atsha204a: add delay after sending the message

Once request is sent, and before receiving a response, the delay is required.
This patch fixes missing delay for before first response try.

Signed-off-by: Adrian Fiergolski <adrian.fiergolski@fastree3d.com>
Reviewed-by: Marek Behún <marek.behun@nic.cz>
2 years agomisc: atsha204a: return timeout from wakeup function
Adrian Fiergolski [Tue, 11 Jan 2022 18:05:29 +0000 (19:05 +0100)]
misc: atsha204a: return timeout from wakeup function

If the maximum number of wake-up attempts is exceeded, return -ETIMEDOUT.

Signed-off-by: Adrian Fiergolski <adrian.fiergolski@fastree3d.com>
Reviewed-by: Marek Behún <marek.behun@nic.cz>
2 years agoMerge tag 'efi-2022-04-rc5' of https://source.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Sun, 20 Mar 2022 19:14:59 +0000 (15:14 -0400)]
Merge tag 'efi-2022-04-rc5' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request for efi-2022-04-rc5

Documentation:

* Fix documentation of FIP creation for Amlogic boards
* Update Nokia RX-51 QEMU documentation
* Add Raspberry Pi documentation

UEFI:

* Fix booting via short form device paths
* Support short form device paths in 'efidebug boot add'
* Fix ESP detection for capsule updates
* Allow ACPI table usage even if device-tree exists - ignore DT
* OP-TEE based GetVariable(): return attributes when buffer too small

2 years agoefi_loader: move dtbdump.c, initrddump.c to lib/efi_loader
Heinrich Schuchardt [Thu, 3 Mar 2022 07:13:53 +0000 (08:13 +0100)]
efi_loader: move dtbdump.c, initrddump.c to lib/efi_loader

The tools dtbdump.efi and initrddump.efi are useful for Python testing even
if CONFIG_EFI_SELFTEST=n.

Don't clear the screen as it is incompatible with Python testing.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 years agoefi_loader: remove efi_disk_is_system_part()
Heinrich Schuchardt [Fri, 4 Mar 2022 23:36:50 +0000 (00:36 +0100)]
efi_loader: remove efi_disk_is_system_part()

The block IO protocol may be installed on any handle. We should make
no assumption about the structure the handle points to.

efi_disk_is_system_part() makes an illegal widening cast from a handle
to a struct efi_disk_obj. Remove the function.

Fixes: Fixes: 41fd506842c2 ("efi_loader: disk: add efi_disk_is_system_part()")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 years agoefi_loader: export efi_system_partition_guid
Heinrich Schuchardt [Sat, 19 Mar 2022 06:04:03 +0000 (07:04 +0100)]
efi_loader: export efi_system_partition_guid

The efi_system_partition_guid is needed in multiple places. Export it.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 years agoefi_loader: use short-form DP for load options
Heinrich Schuchardt [Sat, 26 Feb 2022 11:10:10 +0000 (12:10 +0100)]
efi_loader: use short-form DP for load options

The GUID of partitions is sufficient for identification and will stay
constant in the lifetime of a boot option. The preceding path of the
device-path may change due to changes in the enumeration of devices.
Therefore it is preferable to use the short-form of device-paths in load
options. Adjust the 'efidebug boot add' command accordingly.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 years agoefi_loader: support booting via short-form device-path
Heinrich Schuchardt [Sat, 26 Feb 2022 11:05:30 +0000 (12:05 +0100)]
efi_loader: support booting via short-form device-path

The boot manager must support loading from boot options using a short-form
device-path, e.g. one where the first element is a hard drive media path.

See '3.1.2 Load Options Processing' in UEFI specification version 2.9.

Fixes: 0e074d12393b ("efi_loader: carve out efi_load_image_from_file()")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 years agoefi_loader: efi_dp_find_obj() add protocol check
Heinrich Schuchardt [Sat, 19 Mar 2022 05:35:43 +0000 (06:35 +0100)]
efi_loader: efi_dp_find_obj() add protocol check

Let function efi_dp_find_obj() additionally check if a given protocol is
installed on the handle relating to the device-path.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 years agoefi_loader: fix efi_dp_find_obj()
Heinrich Schuchardt [Fri, 4 Mar 2022 07:20:00 +0000 (08:20 +0100)]
efi_loader: fix efi_dp_find_obj()

efi_dp_find_obj() should not return any handle with a partially matching
device path but the handle with the maximum matching device path.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 years agoefi_loader: export efi_dp_shorten()
Heinrich Schuchardt [Sat, 26 Feb 2022 11:10:10 +0000 (12:10 +0100)]
efi_loader: export efi_dp_shorten()

Rename function shorten_path() to efi_dp_shorten() and export it.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 years agoefi_loader: Set variable attributes when EFI_BUFFER_TOO_SMALL is returned
Ilias Apalodimas [Wed, 16 Mar 2022 15:13:37 +0000 (17:13 +0200)]
efi_loader: Set variable attributes when EFI_BUFFER_TOO_SMALL is returned

Starting UEFI Spec 2.8 we must fill in the variable attributes when
GetVariable() returns EFI_BUFFER_TOO_SMALL and Attributes is non-NULL.

This code was written with 2.7 in mind so let's move the code around a
bit and fill in the attributes EFI_BUFFER_TOO_SMALL is returned

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 years agoefi_loader: Ignore DT when ACPI is on
Alexander Graf [Sun, 27 Feb 2022 12:18:56 +0000 (13:18 +0100)]
efi_loader: Ignore DT when ACPI is on

For targets that enable ACPI, we should not pass Device Trees into
the payload. However, our distro boot logic always passes the builtin
DT as an argument.

To make it easy to use ACPI with distro boot, let's just ignore the DT
argument to bootefi when ACPI is enabled. That way, we can successfully
distro boot payloads on ACPI enabled targets.

Signed-off-by: Alexander Graf <agraf@csgraf.de>
Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
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>