platform/kernel/u-boot.git
2 years agosunxi: pinctrl: Create the driver skeleton
Samuel Holland [Fri, 13 Aug 2021 01:09:43 +0000 (20:09 -0500)]
sunxi: pinctrl: Create the driver skeleton

Create a do-nothing driver for each sunxi pin controller variant.

Since only one driver can automatically bind to a DT node, since the
GPIO driver already requires a manual binding process, and since the
pinctrl driver needs access to some of the same information, refactor
the GPIO driver to be bound by the pinctrl driver. This commit should
cause no functional change.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2 years agoPrepare v2022.04
Tom Rini [Mon, 4 Apr 2022 14:31:32 +0000 (10:31 -0400)]
Prepare v2022.04

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoenv: do not fail on non-existing env.in file
Andrey Zhizhikin [Sun, 3 Apr 2022 14:06:03 +0000 (16:06 +0200)]
env: do not fail on non-existing env.in file

If include/generated/env.in does not exist, which is a typical case for
clean build, quiet_cmd_gen_envp command tries to delete this file
unconditionally.

This produces following warning during the build:
  ENVP    include/generated/env.in
rm: cannot remove 'include/generated/env.in': No such file or directory

Add '-f' option to the `rm` command to not complain if file does not
exist.

Fixes: f432eb6d8a9d ("env: Avoid using a leftover text-environment file")
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Signed-off-by: Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>
2 years agoARM: dts: colibri-imx6ull: fix mac address passing
Francesco Dolcini [Thu, 23 Sep 2021 07:55:21 +0000 (09:55 +0200)]
ARM: dts: colibri-imx6ull: fix mac address passing

colibri-imx6ull ethernet device is fec2, while the optional secondary
ethernet is fec1, update the ethernet aliases in the .dts file so that
ethaddr is set to fec2 and eth1addr to fec1.

Without this change the ethernet interfaces have a different
mac address between Linux and U-Boot.

Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
2 years agoMerge tag 'efi-2022-04-rc6' of https://source.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Fri, 1 Apr 2022 02:35:34 +0000 (22:35 -0400)]
Merge tag 'efi-2022-04-rc6' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request for efi-2022-04-rc6

Documentation:

* Move VxWorks and Plan 9 to HTML documentation
* Move all command man-pages to a separate directory

Test:

* Fix pylint errors

UEFI

* Fix build flags for initrddump.efi

QEMU

* Remove unused function to get RNG device

2 years agoenv: Avoid using a leftover text-environment file
Simon Glass [Sat, 12 Mar 2022 05:37:23 +0000 (22:37 -0700)]
env: Avoid using a leftover text-environment file

If include/generated/environment.h exists (perhaps leftover from a build
of another board) it is used, even if the board currently being built does
not have a text environment.

This causes a build error. Fix it by emptying the file if it should not be
there.

Fixes: https://source.denx.de/u-boot/u-boot/-/issues/9
Signed-off-by: Simon Glass <sjg@chromium.org>
Reported-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Sean Anderson <seanga2@gmail.com>
2 years agoefi_loader: initrddump: Actually use the custom CFLAGS
Andy Shevchenko [Wed, 30 Mar 2022 09:14:43 +0000 (12:14 +0300)]
efi_loader: initrddump: Actually use the custom CFLAGS

It seems a copy'n'paste typo when tool had been introduced.
It has never had the 'exit' suffix in the file name. Hence,
the custom CFLAGS never been applied and, for example, BFD
linker complains:

  LD      lib/efi_loader/initrddump_efi.so
  ld.bfd: lib/efi_loader/initrddump.o: warning: relocation in read-only section `.text.efi_main'
  ld.bfd: warning: creating DT_TEXTREL in a shared object

Remove wrong 'exit' suffix from the custom CFLAGS variable.

Fixes: 65ab48d69ddb ("efi_selftest: provide initrddump test tool")
Fixes: 9c045a49a9c9 ("efi_loader: move dtbdump.c, initrddump.c to lib/efi_loader")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 years agotest: fix pylint warnings in test_efi_bootmgr
Heinrich Schuchardt [Sun, 27 Mar 2022 08:03:33 +0000 (10:03 +0200)]
test: fix pylint warnings in test_efi_bootmgr

* Use f'' strings instead of .format().
* Correct sequence of imports.
* Remove a superfluous import.
* Add missing documentation.
* Replace yield by return.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 years agotest: fix pylint warnings for test_efi_fit.py
Heinrich Schuchardt [Sun, 27 Mar 2022 08:20:24 +0000 (10:20 +0200)]
test: fix pylint warnings for test_efi_fit.py

* fix style of argument documentation
* add encoding to open() calls

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 years agodoc: usage: Convert README.plan9 to reST
Bin Meng [Mon, 28 Mar 2022 02:43:51 +0000 (10:43 +0800)]
doc: usage: Convert README.plan9 to reST

This converts the existing README.plan9 to reST, and puts it under
the doc/usage/os directory.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 years agodoc: usage: Update vxworks doc to mention RISC-V support
Bin Meng [Mon, 28 Mar 2022 02:43:50 +0000 (10:43 +0800)]
doc: usage: Update vxworks doc to mention RISC-V support

At present the doc only mentions Arm, PowerPC and x86. RISC-V support
has been added since VxWorks SR0650 support for a while, and U-Boot
supports loading a RISC-V VxWorks kernel too. Let's document it.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 years agodoc: usage: Convert README.vxworks to reST
Bin Meng [Mon, 28 Mar 2022 02:43:49 +0000 (10:43 +0800)]
doc: usage: Convert README.vxworks to reST

This converts the existing README.vxworks to reST, and puts it under
the doc/usage/os directory.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2 years agodoc: usage: Update the extension command title
Bin Meng [Sun, 27 Mar 2022 14:20:44 +0000 (22:20 +0800)]
doc: usage: Update the extension command title

Update the extension command title for consistency with other commands.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 years agodoc: usage: Group all shell command docs into cmd/ sub-directory
Bin Meng [Mon, 28 Mar 2022 03:02:56 +0000 (11:02 +0800)]
doc: usage: Group all shell command docs into cmd/ sub-directory

Currently all shell command docs are put in the doc/usage root.
Let's group them into cmd/ sub-directory.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 years agodoc: mmc dev
Patrick Delaunay [Tue, 29 Mar 2022 14:01:13 +0000 (16:01 +0200)]
doc: mmc dev

Provide human readable descriptions of the speed nodes instead of the name
of constants from the code as it is already done for 'mmc rescan'
command in commit 212f078496e4 ("doc: mmc rescan speed mode").

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Aswath Govindraju <a-govindraju@ti.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2 years agoqemu: arm: Remove platform specific function to get RNG device
Sughosh Ganu [Sun, 13 Mar 2022 14:47:58 +0000 (20:17 +0530)]
qemu: arm: Remove platform specific function to get RNG device

The QEMU platform has a function defined to get the random number
generator(RNG) device. However, the RNG device can be obtained simply
by searching for a device belonging to the RNG uclass. Remove the
superfluous platform function defined for the QEMU platform for
getting the RNG device.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Tested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agoMerge branch '2022-03-31-critical-fixes'
Tom Rini [Thu, 31 Mar 2022 12:28:43 +0000 (08:28 -0400)]
Merge branch '2022-03-31-critical-fixes'

- Fixes for 2 gateworks platforms, Edison platform, incorrectly showing
  2 logos on LCD screens, not cleaning a generated environment file and
  correct the CONFIG_SYS_IMMR Kconfig migration on a number of MPC85xx
  platforms.

2 years agoboard: gateworks: venice: determine dram size at runtime
Tim Harvey [Wed, 30 Mar 2022 20:39:02 +0000 (13:39 -0700)]
board: gateworks: venice: determine dram size at runtime

The SPL does not update the memory node with the dram size from EEPROM
but instead we can use get_ram_size which does a simple memory test
to determine the available RAM. Update PHYS_SDRAM_SIZE to 4GiB as that
is the max used on the Venice boards.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Reviewed-by: Fabio Estevam <festevam@denx.de>
2 years agoRevert "x86: Move FACP table into separate functions"
Andy Shevchenko [Wed, 30 Mar 2022 15:49:18 +0000 (18:49 +0300)]
Revert "x86: Move FACP table into separate functions"

Before the culprit patch (see BugLink for the details):

  => acpi list
  Name      Base   Size  Detail
  ----  --------  -----  ------
  RSDP  000e4500     24  v02 U-BOOT
  RSDT  000e4530     38  v01 U-BOOT U-BOOTBL 20220401 INTL 0
  XSDT  000e45e0     4c  v01 U-BOOT U-BOOTBL 20220401 INTL 0
  CSRT  000e5490     58  v00 U-BOOT U-BOOTBL 20220401 INTL 0
  FACP  000e54f0    114  v06 U-BOOT U-BOOTBL 20220401 INTL 0
  DSDT  000e4780    c06  v02 U-BOOT U-BOOTBL 10000 INTL 20200925
  FACS  000e4740     40
  MCFG  000e5610     3c  v01 U-BOOT U-BOOTBL 20220401 INTL 0
  SPCR  000e5650     50  v02 U-BOOT U-BOOTBL 20220401 INTL 0
  APIC  000e56a0     48  v02 U-BOOT U-BOOTBL 20220401 INTL 0

After the culprit patch:

  => acpi list
  Name      Base   Size  Detail
  ----  --------  -----  ------
  RSDP  000e4500     24  v02 U-BOOT
  RSDT  000e4530     34  v01 U-BOOT U-BOOTBL 20220401 INTL 0
  XSDT  000e45e0     44  v01 U-BOOT U-BOOTBL 20220401 INTL 0
  CSRT  000e53a0     58  v00 U-BOOT U-BOOTBL 20220401 INTL 0
  MCFG  000e5520     3c  v01 U-BOOT U-BOOTBL 20220401 INTL 0
  SPCR  000e5560     50  v02 U-BOOT U-BOOTBL 20220401 INTL 0
  APIC  000e55b0     48  v02 U-BOOT U-BOOTBL 20220401 INTL 0

As a result Linux kernel can't find mandatory tables and fails
to boot.

Hence, revert it for good.

This reverts commit 379d3c1fd6aa490b1ad5697525cfc89b615cf25a.

BugLink: https://lore.kernel.org/all/20220131225930.GJ7515@bill-the-cat/
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2 years agopowerpc: Fix incorrect SYS_IMMR migration values
Tom Rini [Wed, 30 Mar 2022 13:30:15 +0000 (09:30 -0400)]
powerpc: Fix incorrect SYS_IMMR migration values

When migrating SYS_IMMR, I didn't allow for boards to provide
non-default values here.  This lead to an incorrect migration on the
platforms where CONFIG_SYS_IMMR is set to CONFIG_SYS_CCSRBAR and
CONFIG_SYS_CSSRBAR is NOT the same as CONFIG_SYS_CCSRBAR_DEFAULT.  Add
text to the prompt so that non-default values can be used and re-migrate
the platforms that have CONFIG_SYS_IMMR=CONFIG_SYS_CSSRBAR where
CONFIG_SYS_CSSRBAR != CONFIG_SYS_CCSRBAR_DEFAULT.

Fixes: be7dbb60c5bf ("Convert CONFIG_SYS_IMMR to Kconfig")
Reported-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
Tested-by: Pali Rohár <pali@kernel.org>
2 years agoMakefile: make clean should delete include/generated/env.in
Heinrich Schuchardt [Wed, 30 Mar 2022 10:11:00 +0000 (12:11 +0200)]
Makefile: make clean should delete include/generated/env.in

'make sifive_unamtched_defconfig; make clean; make' fails if file
include/generated/env.in exists. 'make clean' should remove all files that
stop building.

Add file include/generated/env.in to the clean target.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Marek Behún <marek.behun@nic.cz>
2 years agovideo: Do not show splash and U-Boot logo simultaneously
Fabio Estevam [Mon, 28 Mar 2022 19:40:36 +0000 (16:40 -0300)]
video: Do not show splash and U-Boot logo simultaneously

Currently, on imx6sabresd and gwventana boards, the company logo
and U-Boot logo are shown.

The correct behavior is to show only the company logo, if available,
and not both logos.

Reported-by: Tim Harvey <tharvey@gateworks.com>
Signed-off-by: Fabio Estevam <festevam@denx.de>
Tested-by: Tim Harvey <tharvey@gateworks.com> #gw_ventana
2 years agoboard: gw_ventana: gsc: fix GSC read/write functions
Tim Harvey [Thu, 24 Mar 2022 15:32:00 +0000 (08:32 -0700)]
board: gw_ventana: gsc: fix GSC read/write functions

commit 7c84319af9c7 ("dm: gpio: Correct use of -ENODEV in drivers")
changed the return code for an I2C NAK from -ENODEV to -EREMOTEIO.

Update the gsc_i2c_read and gsc_i2c_write functions for this change
to properly retry the transaction on a NAK meaning the GSC is busy.

Fixes: 7c84319af9c7 ("dm: gpio: Correct use of -ENODEV in drivers")
Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Reviewed-by: Fabio Estevam <festevam@denx.de>
2 years agoMerge https://source.denx.de/u-boot/custodians/u-boot-socfpga
Tom Rini [Mon, 28 Mar 2022 20:16:56 +0000 (16:16 -0400)]
Merge https://source.denx.de/u-boot/custodians/u-boot-socfpga

- One-liner env fix

2 years agoarm: socfpga: vining: Fix mtdparts for 2x256 MiB SF variant
Marek Vasut [Mon, 21 Feb 2022 05:16:12 +0000 (06:16 +0100)]
arm: socfpga: vining: Fix mtdparts for 2x256 MiB SF variant

The 2x256 MiB SF variant of this system has 192 MiB rootfs MTD partition
containing UBI on SF0, use the correct size in U-Boot environment, else
U-Boot cannot mount UBI and boot on this variant.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Siew Chin Lim <elly.siew.chin.lim@intel.com>
Cc: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Cc: Tien Fong Chee <tien.fong.chee@intel.com>
Cc: Tom Rini <trini@konsulko.com>
2 years agoimx: ventana: enable ONFI detection to fix NAND chip configuration
Tim Harvey [Tue, 22 Mar 2022 18:42:49 +0000 (11:42 -0700)]
imx: ventana: enable ONFI detection to fix NAND chip configuration

Enable ONFI detection to fix NAND chip configuration. Without this
the NAND oobsize will be wrong which leads to invalid ECC strength and
incompatibility with the previous configuration.

Fixes: 777f333c375a ("imx: ventana: enable dm for MTD and NAND")

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Reviewed-by: Fabio Estevam <festevam@denx.de>
2 years agoPrepare v2022.04-rc5
Tom Rini [Mon, 28 Mar 2022 14:14:51 +0000 (10:14 -0400)]
Prepare v2022.04-rc5

Signed-off-by: Tom Rini <trini@konsulko.com>
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>