]> git.dujemihanovic.xyz Git - u-boot.git/log
u-boot.git
23 months agolmb: consider EFI memory map
Heinrich Schuchardt [Wed, 4 Jan 2023 00:36:14 +0000 (01:36 +0100)]
lmb: consider EFI memory map

Add reservations for all EFI memory areas that are not
EFI_CONVENTIONAL_MEMORY.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
23 months agoefi_loader: carve out efi_get_memory_map_alloc()
Heinrich Schuchardt [Thu, 5 Jan 2023 17:26:01 +0000 (18:26 +0100)]
efi_loader: carve out efi_get_memory_map_alloc()

Carve out code from efidebug command used to read the memory map.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
23 months agovexpress: adjust loadaddr
Heinrich Schuchardt [Wed, 4 Jan 2023 02:17:15 +0000 (03:17 +0100)]
vexpress: adjust loadaddr

On the vexpress_ca9x4 $loadaddr points to a memory area used by the EFI
sub-system. Use the same value as $kernel_addr_r which is safe.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
23 months agoMerge tag 'u-boot-stm32-20230106' of https://gitlab.denx.de/u-boot/custodians/u-boot-stm
Tom Rini [Fri, 6 Jan 2023 13:16:15 +0000 (08:16 -0500)]
Merge tag 'u-boot-stm32-20230106' of https://gitlab.denx.de/u-boot/custodians/u-boot-stm

- stm32mp: Fix board_get_usable_ram_top(): workaround to avoid issue after the
  commit 777aaaa706b ("common/memsize.c: Fix get_effective_memsize() to check
  for overflow") because the effective DDR effective size is reduce by 4KiB
  and sometime the board hang on boot

23 months agoMerge branch '2023-01-06-further-regression-fixes'
Tom Rini [Fri, 6 Jan 2023 13:14:28 +0000 (08:14 -0500)]
Merge branch '2023-01-06-further-regression-fixes'

- Bring in a number of important regression fixes for among others,
  uniphier, PXE booting, socrates, imx7d-pico, rockchip video and
  rzg2_beacon as well as making the python version warning fix more
  portable.

23 months agoarm: rmobile: rzg2_beacon: Enable alternative Ethernet PHY
Adam Ford [Wed, 4 Jan 2023 18:05:43 +0000 (12:05 -0600)]
arm: rmobile: rzg2_beacon: Enable alternative Ethernet PHY

Due to the part shortage, the AR8031 PHY was replaced with a
Micrel KSZ9131. Enabling both config options keeps backward
compatibility with either platform, and both appear to be
auto-detected.

Signed-off-by: Adam Ford <aford173@gmail.com>
Reviewed-by: Marek Vasut <marek.vasut+renesas@gmail.com>
23 months agoarm: dts: rz-g2-beacon-u-boot: Fix QSPI Regression
Adam Ford [Wed, 4 Jan 2023 15:53:09 +0000 (09:53 -0600)]
arm: dts: rz-g2-beacon-u-boot: Fix QSPI Regression

The QSPI is accessed via the RPC-IF, but the compatible flags
previously used a different name.  This compatibel name was changed
which broke the ability to access the QSPI.  Fix this by removing
the custom naming reference.

Fixes: 68083b897b57 ("renesas: Fix RPC-IF compatible values")
Signed-off-by: Adam Ford <aford173@gmail.com>
Reviewed-by: Marek Vasut <marek.vasut+renesas@gmail.com>
23 months agopylibfdt: Fix disable version normalization
Philippe Schenker [Wed, 4 Jan 2023 14:43:33 +0000 (15:43 +0100)]
pylibfdt: Fix disable version normalization

On Arch Linux based systems python setuptools does not contain
"setuptools.extern" hence it is failing with the following
error-message:
"
ModuleNotFoundError: No module named 'setuptools.extern'
"

According to a eschwartz `setuptools.extern` is not a public API and
shall not be assumed to be present in the setuptools package. He
mentions that the setuptools project anyway wants to drop this. [1]

Use the correct solution introduced by python setuptools developers to
disable normalization. [2]

[1] https://bbs.archlinux.org/viewtopic.php?id=259608
[2] https://github.com/pypa/setuptools/pull/2026
Fixes: 440098c42e73 ("pylibfdt: Fix version normalization warning")
Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
Reviewed-by: Marek Vasut <marex@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
23 months agocmd: pxe_utils: Limit fdtcontroladdr usage to non-fitImage
Marek Vasut [Wed, 14 Dec 2022 06:45:18 +0000 (07:45 +0100)]
cmd: pxe_utils: Limit fdtcontroladdr usage to non-fitImage

Commit d5ba6188dfb ("cmd: pxe_utils: Check fdtcontroladdr in label_boot")
forces '$fdtcontroladdr' DT address as a third parameter of bootm command
even if the PXE transfer pulls in a fitImage which contains configuration
node with its own DT that is preferrable to be passed to Linux. Limit the
$fdtcontroladdr fallback utilization to non-fitImages, since it is highly
likely a fitImage would come with its own DT, while single-file images do
need a separate DT.

Fixes: d5ba6188dfb ("cmd: pxe_utils: Check fdtcontroladdr in label_boot")
Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Tested-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Peter Hoyes <peter.hoyes@arm.com>
Tested-by: Peter Hoyes <peter.hoyes@arm.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
23 months agoRevert "Revert "cmd: pxe_utils: Check fdtcontroladdr in label_boot""
Marek Vasut [Sat, 17 Dec 2022 17:41:13 +0000 (18:41 +0100)]
Revert "Revert "cmd: pxe_utils: Check fdtcontroladdr in label_boot""

This reverts commit ed6251187afabf811a5fd49a44ebd61c53c7b378.

Superseded by "cmd: pxe_utils: Limit fdtcontroladdr usage to non-fitImage"
which is less heavy-handed approach and retains part of the original
behavior for non-fitImage.

Signed-off-by: Marek Vasut <marex@denx.de>
Acked-by: Neil Armstrong <neil.armstrong@linaro.org>
23 months agorockchip: Fix the broken Video out for rk3288 boards
Jagan Teki [Mon, 2 Jan 2023 18:23:45 +0000 (23:53 +0530)]
rockchip: Fix the broken Video out for rk3288 boards

Video out on RK3288 boards has been broken since from few
releases due to the adding of reset support on vop but
missed enabling DM_RESET on associated boards.

This patch fixes those RK3288 boards.

Cc: Simon Glass <sjg@chromium.org>
Cc: Lin Huang <hl@rock-chips.com>
Cc: Jernej Skrabec <jernej.skrabec@gmail.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Cc: Arnaud Patard (Rtp) <arnaud.patard@rtp-net.org>
Fixes: <9749d2ea29e1> ("rockchip: video: vop: Add reset support")
Reported-by: Manoj Sai <abbaraju.manojsai@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
23 months agoi2c: uniphier-f: correct error recovery
Dai Okamura [Fri, 9 Dec 2022 11:38:27 +0000 (20:38 +0900)]
i2c: uniphier-f: correct error recovery

The uniphier i2c block can recognize some handshake errors.
But driver handles all error detections as no error if no timeout.
So this makes unrecoverable state.

This replaces the return values with the right ones to tell the i2c
framework the errors:
- EDEADLK for arbitration lost error
- ENODATA for no answer error

Signed-off-by: Dai Okamura <okamura.dai@socionext.com>
Acked-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
23 months agoimx7d-pico: Fix the name of the u-boot.dtsi file
Fabio Estevam [Sat, 31 Dec 2022 16:25:14 +0000 (13:25 -0300)]
imx7d-pico: Fix the name of the u-boot.dtsi file

Since commit 2f96d4dd95f8 ("imx7s/d: synchronise device trees with linux")
the imx7d-pico board no longer boots.

The reason is that prior to the above commit there was an explicit
inclusion of arch/arm/dts/imx7d-pico-u-boot.dtsi inside imx7d-pico.dtsi.

After the syncing with the Linux upstream dtsi, this u-boot.dtsi inclusion
is gone and the board fails to boot.

U-Boot uses the imx7d-pico-pi.dtb file, so rename the u-boot.dtsi to
imx7d-pico-pi-u-boot.dtsi which gets included automatically by U-Boot
standard make logic and makes the board boot again.

Signed-off-by: Fabio Estevam <festevam@denx.de>
23 months agopowerpc/mpc85xx: socrates: Re-enable building u-boot-socrates.bin
Pali Rohár [Wed, 28 Dec 2022 18:18:39 +0000 (19:18 +0100)]
powerpc/mpc85xx: socrates: Re-enable building u-boot-socrates.bin

U-Boot build system builds final U-Boot binary for socrates board in custom
file u-boot-socrates.bin (instead of standard u-boot.bin). Output target
file u-boot-socrates.bin is generated by binman as defined in board binman
config file arch/powerpc/dts/socrates-u-boot.dtsi.

But binman was disabled in commit 5af42eafd7e1 ("Makefile: Reduce usage of
custom mpc85xx u-boot.bin target") for all mpc85xx boards which do not use
standard powerpc binman config file arch/powerpc/dts/u-boot.dtsi and boards
which do not require binman at all.

The only such mpc85xx board is socrates. So since that commit, U-Boot does
not final binary for socrates board anymore.

Fix this issue by re-enabling binman for socrates board. And build process
starts again producing u-boot-socrates.bin binary.

Note that build process for this socrates board always produce u-boot.bin
binary which is broken and not usable for socrates board. Long term
solution should be to disable building broken binary u-boot.bin and then
renaming u-boot-socrates.bin to u-boot.bin, or switching to use common
powerpc binman config file arch/powerpc/dts/socrates-u-boot.dtsi (if it is
possible).

Fixes: 5af42eafd7e1 ("Makefile: Reduce usage of custom mpc85xx u-boot.bin target")
Signed-off-by: Pali Rohár <pali@kernel.org>
Tested-by: Heiko Schocher <hs@denx.de>
23 months agoarm: stm32mp: Fix board_get_usable_ram_top() again
Marek Vasut [Thu, 5 Jan 2023 01:22:22 +0000 (02:22 +0100)]
arm: stm32mp: Fix board_get_usable_ram_top() again

Do not access gd->ram_size and assume this is actual valid RAM size. Since commit
777aaaa706b ("common/memsize.c: Fix get_effective_memsize() to check for overflow")
the RAM size may be less than gd->ram_size , call get_effective_memsize() to get
the limited value instead.

The aforementioned commit makes STM32MP15xx boards with 1 GiB of DRAM
at 0xc0000000 hang on boot, which is a grave defect.

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
23 months agoMerge tag 'efi-2023-01-rc5-3' of https://source.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Wed, 4 Jan 2023 13:50:24 +0000 (08:50 -0500)]
Merge tag 'efi-2023-01-rc5-3' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request for efi-2023-01-rc5-3

Documentation:

* Describe building documentation

UEFI:

* Add .data section to aarch64 EFI binaries and correct section flags
* Correct sorting of capsules when updating
* Populate console handles in system table

Other:

* Fix description of eth_env_[gs]et_enetaddr() return value
* Avoid endless loop in sound play command

23 months agoefi_loader: populate console handles in system table
Heinrich Schuchardt [Wed, 4 Jan 2023 04:56:09 +0000 (05:56 +0100)]
efi_loader: populate console handles in system table

The fields ConsoleInHandle, ConsoleOutHandle, ConsoleErrHandle must point
to the handles with the respective console protocols. Failure to do so
leads to an error in the EFI Shell:

    No SimpleTextInputEx was found. CTRL-based features are not usable.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
23 months agoefi_loader: adjust sorting of capsules
Heinrich Schuchardt [Thu, 29 Dec 2022 13:44:05 +0000 (14:44 +0100)]
efi_loader: adjust sorting of capsules

Up to now we only compared the first letter of the capsule name to sort
them alphabetically. Properly sort by the Unicode alphabet.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
23 months agotest: unit test for u16_strcasecmp()
Heinrich Schuchardt [Thu, 29 Dec 2022 13:44:04 +0000 (14:44 +0100)]
test: unit test for u16_strcasecmp()

Provide a unit test for u16_strcasecmp().

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
23 months agolib: add function u16_strcasecmp()
Heinrich Schuchardt [Thu, 29 Dec 2022 13:44:03 +0000 (14:44 +0100)]
lib: add function u16_strcasecmp()

Provide a function for comparing UTF-16 strings in a case insensitive
manner.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
23 months agoefi_loader: fix building aarch64 EFI binaries
Heinrich Schuchardt [Sat, 31 Dec 2022 10:58:54 +0000 (11:58 +0100)]
efi_loader: fix building aarch64 EFI binaries

While our EFI binaries execute without problems on EDK II they crash on
a Lenovo X13s. Let our binaries look more like what EDK II produces:

* move all writable data to a .data section
* align sections to 4 KiB boundaries (matching EFI page size)
* remove IMAGE_SCN_LNK_NRELOC_OVFL from .reloc section flags

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
23 months agoefi_loader: defines for PE-COFF section flags
Heinrich Schuchardt [Wed, 4 Jan 2023 11:18:54 +0000 (12:18 +0100)]
efi_loader: defines for PE-COFF section flags

Provide constants for the section flags used by binaries.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
23 months agodoc: Fix eth_env_[gs]et_enetaddr() return value
Marek Vasut [Sun, 18 Dec 2022 07:05:02 +0000 (08:05 +0100)]
doc: Fix eth_env_[gs]et_enetaddr() return value

Per env/common.c, eth_env_get_enetaddr() returns the same return
values as is_valid_ethaddr(), i.e. true if valid, false otherwise.
Per env/common.c, eth_env_set_enetaddr() may return -EEXIST is the
ethaddr is already set. Fix both.

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
23 months agodoc: building documentation
Heinrich Schuchardt [Fri, 30 Dec 2022 04:05:31 +0000 (05:05 +0100)]
doc: building documentation

Provide a man-page describing how to build the U-Boot documentation.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
23 months agocmd: avoid endless loop in sound play command
Heinrich Schuchardt [Fri, 30 Dec 2022 23:49:10 +0000 (00:49 +0100)]
cmd: avoid endless loop in sound play command

A parameter starting with a hyphen leads to an endless loop in the sound
play command.

Leave it to dectoul() to handle the hyphen. It will return 0 for a negative
number.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
23 months agoMerge https://source.denx.de/u-boot/custodians/u-boot-marvell
Tom Rini [Mon, 2 Jan 2023 14:36:13 +0000 (09:36 -0500)]
Merge https://source.denx.de/u-boot/custodians/u-boot-marvell

- orion-timer: Fix problem with early static variable (Stefan)

23 months agotimer: orion-timer: Fix problem with early static variable
Stefan Roese [Wed, 21 Dec 2022 09:18:49 +0000 (10:18 +0100)]
timer: orion-timer: Fix problem with early static variable

We've noticed that at least one Kirkwood board (Pogo v4) has problems
with the new orion DM timer implementation. Debugging revealed that this
issue is related with the static variable "early_init_done" which does
not work correctly before relocation in all cases.

This patch removes this static variable and replaces it's functionality
via a function that detects if the timer is already initialized.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Pali Rohár <pali@kernel.org>
Cc: Michael Walle <michael@walle.cc>
Cc: Tony Dinh <mibodhi@gmail.com>
Tested-by: Tony Dinh <mibodhi@gmail.com>
23 months agoconfigs: Resync with savedefconfig
Tom Rini [Thu, 29 Dec 2022 18:44:21 +0000 (13:44 -0500)]
configs: Resync with savedefconfig

Rsync all defconfig files using moveconfig.py

Signed-off-by: Tom Rini <trini@konsulko.com>
23 months agoMerge tag 'efi-2023-01-rc5-2' of https://source.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Thu, 29 Dec 2022 18:32:50 +0000 (13:32 -0500)]
Merge tag 'efi-2023-01-rc5-2' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request for efi-2023-01-rc5-2

Documentation:

* Reorganize existing TI docs and add K3 generation page
* Add texinfodocs and infodocs targets
* Update qemu-ppce500 documentation
* Use "changesets" not "csets" in statistics pages

UEFI

* Fix merging of preseeded non-volatile variables
* Fix a return value in the  EFI_HII_DATABASE_PROTOCOL
* Set UEFI specification version to 2.10

23 months agoMerge branch '2022-12-29-assorted-further-fixes'
Tom Rini [Thu, 29 Dec 2022 18:31:40 +0000 (13:31 -0500)]
Merge branch '2022-12-29-assorted-further-fixes'

- Rework Azure CI jobs for Rockchip, minor fixes for wget and correct
  runtime problems on a number of PowerPC platforms.

23 months agoPowerPC: Update dependencies on *SYS_MPC85XX_NO_RESETVEC
Tom Rini [Thu, 29 Dec 2022 14:50:03 +0000 (09:50 -0500)]
PowerPC: Update dependencies on *SYS_MPC85XX_NO_RESETVEC

In 96699f097a02 ("powerpc: mpc85xx: Use binman to embed dtb inside
U-Boot") we introduce CONFIG_MPC85XX_HAVE_RESET_VECTOR and do so via
Kconfig. However, much later in de47ff536363 ("Convert
CONFIG_SYS_MPC85XX_NO_RESETVEC to Kconfig") I converted the symbol that
is the inverse of this to Kconfig. This should have included a
dependency on the first symbol as they are logically opposite.

The dependency being missing lead to some platforms being broken at
runtime due to discarding the require reset vector.

Fixes: de47ff536363 ("Convert CONFIG_SYS_MPC85XX_NO_RESETVEC 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>
23 months agoMerge branch '2022-12-29-assorted-further-fixes'
Tom Rini [Thu, 29 Dec 2022 14:51:00 +0000 (09:51 -0500)]
Merge branch '2022-12-29-assorted-further-fixes'

- Rework Azure CI jobs for Rockchip, minor fixes for wget and correct a
  one of the runtime problems on a number of PowerPC platforms.

23 months agoPowerPC: Rework PBL location choice
Tom Rini [Wed, 28 Dec 2022 15:52:51 +0000 (10:52 -0500)]
PowerPC: Rework PBL location choice

When converting CONFIG_SDCARD and CONFIG_SPIFLASH to Kconfig, one set of
uses wasn't converted correctly. Allow for the case where platforms
don't rely on "PBL" to boot but instead use other mechanisms. See the
link below for more details.

Link: https://lore.kernel.org/all/20220802091338.f4g45ldhc7qbg6hm@pali/
Fixes: d433c74eecdc ("Convert CONFIG_SDCARD et al to Kconfig")
Tested-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
23 months agocmd: net: wget: fix Kconfig dependency
Michael Walle [Wed, 28 Dec 2022 15:27:15 +0000 (16:27 +0100)]
cmd: net: wget: fix Kconfig dependency

The wget command uses TCP, but fails to select PROT_TCP in Kconfig.
Instead it selects the non-existing symbol TCP. Fix the typo.

Signed-off-by: Michael Walle <michael@walle.cc>
23 months agonet: wget: fix implicit declaration
Michael Walle [Wed, 28 Dec 2022 15:27:14 +0000 (16:27 +0100)]
net: wget: fix implicit declaration

The compiler complains about the missing declaration of print_size():
net/wget.c:415:3: warning: implicit declaration of function ‘print_size’ [-Wimplicit-function-declaration]

Fix it.

Signed-off-by: Michael Walle <michael@walle.cc>
23 months agoCI: Rework rockchip jobs in Azure
Tom Rini [Tue, 27 Dec 2022 16:48:08 +0000 (11:48 -0500)]
CI: Rework rockchip jobs in Azure

The rockchip job is getting close to the hard time limit in Azure for
the free tier. Split this in to 32bit and 64bit board jobs.

Signed-off-by: Tom Rini <trini@konsulko.com>
23 months agoefi_loader: use u16_strlen() in efi_var_mem_ins()
Heinrich Schuchardt [Thu, 29 Dec 2022 09:50:54 +0000 (10:50 +0100)]
efi_loader: use u16_strlen() in efi_var_mem_ins()

Don't duplicate library functionality.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
23 months agoefi_loader: avoid adding variables twice
Ilias Apalodimas [Thu, 29 Dec 2022 08:13:22 +0000 (10:13 +0200)]
efi_loader: avoid adding variables twice

When the efi subsystem starts we restore variables that are both in a
file or stored into the .efi_runtime section of U-Boot.  However once
a variable gets created or changed the preseeded entries will end up in
the file.  As a consequence on the next boot we will end up adding
identical variable entries twice.

Fix this by checking if the to be inserted variable already exists.
Also swap the restoration order and start with the file instead of the
builtin variables,  so a user can replace the preseeded ones if needed.

Tested-by: Leo Yan <leo.yan@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
23 months agoefi_loader: typo non-volatile in efi_var_restore
Heinrich Schuchardt [Thu, 29 Dec 2022 08:23:03 +0000 (09:23 +0100)]
efi_loader: typo non-volatile in efi_var_restore

It is volatile variables that we do not allow to be restored from file.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
23 months agoefi_loader: set UEFI specification version to 2.10
Heinrich Schuchardt [Fri, 23 Dec 2022 01:26:52 +0000 (02:26 +0100)]
efi_loader: set UEFI specification version to 2.10

Claim to implement UEFI 2.10 setting EFI_SPECIFICATION_VERSION accordingly.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
23 months agoefi_loader: set IMAGE_FILE_LARGE_ADDRESS_AWARE
Heinrich Schuchardt [Fri, 23 Dec 2022 01:16:03 +0000 (02:16 +0100)]
efi_loader: set IMAGE_FILE_LARGE_ADDRESS_AWARE

For the 64bit EFI binaries that we create set the
IMAGE_FILE_LARGE_ADDRESS_AWARE characteristic in the PE-COFF header
to indicate that they can handle addresses above 2 GiB.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
23 months agoefi_loader: fix get_package_list_handle() status
Vincent Stehlé [Tue, 13 Dec 2022 21:39:09 +0000 (22:39 +0100)]
efi_loader: fix get_package_list_handle() status

When the HII protocol function get_package_list_handle() is called with an
invalid package list handle, it returns EFI_NOT_FOUND but this is not in
its list of possible status codes as per the EFI specification.
Return EFI_INVALID_PARAMETER instead to fix conformance.

Signed-off-by: Vincent Stehlé <vincent.stehle@arm.com>
Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
23 months agodoc: improve wget man-page
Heinrich Schuchardt [Thu, 22 Dec 2022 10:32:03 +0000 (11:32 +0100)]
doc: improve wget man-page

* correct formatting of synopsis
* improve description of TCP SACK configuration

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
23 months agodoc: Use "changesets" not "csets" in statistics pages
Tom Rini [Wed, 21 Dec 2022 23:04:10 +0000 (18:04 -0500)]
doc: Use "changesets" not "csets" in statistics pages

To make things more human readable, say "changesets from" rather than
"csets from" in all our historical pages here. Moving forward this has
been changed in our gitdm with b034e399e31a ("gitdm: fix typo csets").

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
23 months agodoc: add texinfodocs and infodocs targets
Maxim Cournoyer [Mon, 19 Dec 2022 02:48:08 +0000 (21:48 -0500)]
doc: add texinfodocs and infodocs targets

Sphinx supports generating Texinfo sources and Info documentation,
which can be navigated easily and is convenient to search (via the
indexed nodes or anchors, for example).  This is basically the same as
1f050e904dd6f2955eecbd22031d912ccb2e7683, which was recently applied
to the Linux kernel.

Signed-off-by: Maxim Cournoyer <maxim.cournoyer@savoirfairelinux.com>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
23 months agodoc: board: qemu-ppce500: Update supported and unsupported
Pali Rohár [Tue, 20 Dec 2022 20:06:26 +0000 (21:06 +0100)]
doc: board: qemu-ppce500: Update supported and unsupported

qemu can emulate also e500v1 core but cannot emulate CPUs from Freescale
PowerPC QorIQ T and P series.

Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
23 months agodoc: ti: add the K3 generation page
Bryan Brattlof [Mon, 19 Dec 2022 20:29:50 +0000 (14:29 -0600)]
doc: ti: add the K3 generation page

Texas Instrument's entire K3 generation of SoCs use much of the same
frameworks and boot flow, especially at the uboot level. Though there
are small differences introduced as each new K3 based SoC is developed
and as the K3 generation matures that will also need to be documented.

Rather than copying the same documentation, with the small differences
applicable to that specific SoC to a new page, introduce a new K3
page that can describe the general boot flow and design decisions for
the entire K3 generation of chips, leaving the specifics for that
particular SoC to a unique sub-page below this one.

Signed-off-by: Bryan Brattlof <bb@ti.com>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
23 months agodoc: ti: reorganize existing ti docs
Bryan Brattlof [Mon, 19 Dec 2022 20:29:49 +0000 (14:29 -0600)]
doc: ti: reorganize existing ti docs

Texas Instruments produces quite a lot of SoCs based upon a common
architecture 'generation'. (eg: OMAP, K3) TI's existing documentation
layout makes noticing this generation jump rather difficult.

To make navigation easier, split the existing documentation into
individual SoC families so we may begin grouping them according to their
generational (eg: OMAP, K3) families.

Signed-off-by: Bryan Brattlof <bb@ti.com>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
23 months agoMerge https://source.denx.de/u-boot/custodians/u-boot-pmic
Tom Rini [Tue, 27 Dec 2022 02:00:20 +0000 (21:00 -0500)]
Merge https://source.denx.de/u-boot/custodians/u-boot-pmic

- power: regulator: Add support for NPCM8xx

23 months agopower: regulator: Add support for NPCM8xx
Jim Liu [Mon, 7 Nov 2022 02:48:27 +0000 (10:48 +0800)]
power: regulator: Add support for NPCM8xx

Add support for setting nuvoton BMC NPCM845 voltage supply.

Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
2 years agoMerge tag 'tpm-23122022' of https://source.denx.de/u-boot/custodians/u-boot-tpm
Tom Rini [Fri, 23 Dec 2022 12:46:41 +0000 (07:46 -0500)]
Merge tag 'tpm-23122022' of https://source.denx.de/u-boot/custodians/u-boot-tpm

OP-TEE autodiscovery

2 years agoMerge branch '2022-12-22-assorted-important-fixes'
Tom Rini [Fri, 23 Dec 2022 12:44:30 +0000 (07:44 -0500)]
Merge branch '2022-12-22-assorted-important-fixes'

- Split up the aarch64 Azure CI job more, to avoid time limits, nuvoton
  network fix, SPL_OPTEE_IMAGE dependency fix, some fixes to the IPv6
  code, PowerPC build flag fixes, silence pylibfdt version warning.

2 years agotee: optee: discover services dependent on tee-supplicant
Etienne Carriere [Wed, 7 Dec 2022 15:30:00 +0000 (16:30 +0100)]
tee: optee: discover services dependent on tee-supplicant

Makes OP-TEE to enumerate also services depending on tee-supplicant
support in U-Boot. This change allows OP-TEE services like fTPM TA
to be discovered and get a TPM device registered in U-Boot.

Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2 years agotee: optee: don't fail probe because of optee-rng
Etienne Carriere [Wed, 7 Dec 2022 15:29:59 +0000 (16:29 +0100)]
tee: optee: don't fail probe because of optee-rng

Fixes optee-rng driver bind sequence in optee driver to print a warning
message but not report an error status when a optee-rng service driver
fails to be bound as the optee driver itself is still fully functional.

Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2 years agopylibfdt: Fix version normalization warning
Marek Vasut [Thu, 15 Dec 2022 22:37:59 +0000 (23:37 +0100)]
pylibfdt: Fix version normalization warning

Fix the following version normalization warning:
"
/usr/lib/python3/dist-packages/setuptools/dist.py:530: UserWarning: Normalizing '2023.01' to '2023.1'
"

Using suggestion from Richard Jones:
https://github.com/pypa/setuptools/issues/308#issuecomment-405817468

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agonet: nuvoton: fix build broken for use phy_get_interface_by_name
Jim Liu [Tue, 13 Sep 2022 06:25:21 +0000 (14:25 +0800)]
net: nuvoton: fix build broken for use phy_get_interface_by_name

The original patch is use phy_get_interface_by_name to set interface.
The new patch is use dev_read_phy_mode to replace it.

Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2 years agopowerpc/mpc85xx: Disable AltiVec and VSX instructions
Pali Rohár [Mon, 19 Dec 2022 21:46:22 +0000 (22:46 +0100)]
powerpc/mpc85xx: Disable AltiVec and VSX instructions

All vector instructions on powerpc mpc85xx must not be used because U-Boot
does not enable them. Usage cause random crashes. SPE vector instructions
are already disabled by compiler flags, so disable also AltiVec and VSX
vector instructions.

Linux kernel disables AltiVec and VSX instructions too.

Signed-off-by: Pali Rohár <pali@kernel.org>
2 years agopowerpc/mpc85xx: Improve disabling of SPE instructions
Pali Rohár [Sun, 11 Dec 2022 14:14:59 +0000 (15:14 +0100)]
powerpc/mpc85xx: Improve disabling of SPE instructions

Specifying -mspe=no also disables usage of SPE instructions. It is
documented in "[PATCH,rs6000] make -mno-spe work as expected" email:
http://gcc.gnu.org/ml/gcc-patches/2008-04/msg00311.html

So replace -mspe=yes by -mspe=no, so make it clear that u-boot has to be
compiled without SPE instructions.

Linux kernel contains following Makefile code to achieve it:

    # No SPE instruction when building kernel
    # (We use all available options to help semi-broken compilers)
    KBUILD_CFLAGS += $(call cc-option,-mno-spe)
    KBUILD_CFLAGS += $(call cc-option,-mspe=no)

Do same for U-Boot.

Signed-off-by: Pali Rohár <pali@kernel.org>
2 years agopowerpc/mpc85xx: Pass correct cpu compiler flags
Pali Rohár [Mon, 19 Dec 2022 21:41:52 +0000 (22:41 +0100)]
powerpc/mpc85xx: Pass correct cpu compiler flags

When gcc's default cpu (selected by --with-cpu= during gcc's configure
phase) does not match target U-Boot board cpu then U-Boot binary does not
have to be compiled correctly. Lot of distributions sets gcc's default cpu
to generic powerpc variant which works fine.

U-Boot already pass -Wa,-me500 flag to gcc which instructs GNU AS to accept
e500 specific instructions when processing assembler source files (.S).

This affects also assembly files generated by gcc from C source files. And
because gcc for generic powerpc cpu puts '.machine ppc' at the beginning of
the generated assembly file, it basically overwrites -me500 flag by which
was GNU AS invoked (from U-boot build system).

It started to be an issue since binutils 2.38 which does not keep enabled
extra functional units selected by previous cpu. Hence issuing directive
'.machine ppc' (generated by gcc for generic powerpc) after '.machine e500'
(specifying at command line) disables usage of e500 specific instructions.

And compiling arch/powerpc/cpu/mpc85xx/tlb.c code throws following
assembler errors:

    {standard input}: Assembler messages:
    {standard input}:127: Error: unrecognized opcode: `tlbre'
    {standard input}:418: Error: unrecognized opcode: `tlbre'
    {standard input}:821: Error: unrecognized opcode: `msync'
    {standard input}:821: Error: unrecognized opcode: `tlbwe'
    {standard input}:884: Error: unrecognized opcode: `tlbsx'

This issue was already hit by Debian people and is reported in bug tracker:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1003490

Calling gcc with -mcpu=8540 flag fixes this issue because -mcpu=8540 tells
gcc to compile code for e500 core/cpu (overwriting gcc's default cpu) and
does not put '.machine ppc' directive into assembly anymore.

Also if gcc is invoked with -mcpu=8540 then it pass -me500 flag to GNU AS.
So it is unnecessary to manually specify -Wa,-me500 flag because it is
implicitly added.

Fix this issue properly by specifying correct -mcpu compiler flag for all
supported powerpc cores in U-Boot mpc85xx platform, which are: e500v1,
e500v2, e500mc, e5500 and e6500. For specifying e500v1 and e500v2 cores,
gcc has unintuitive -mcpu=8540 and -mcpu=8548 flag names, for other cores
-mcpu matches core name.

The only difference between gcc's -mcpu=8540 and -mcpu=8548 flags is
support for double precision floating point SPE instructions. As U-Boot
does not use floating point, it is fine to use -mcpu=8540 for both e500v1
and e500v2 cores. Moreover gcc 9 completely removed e500 floating point
support, so since gcc 9 -mcpu=8548 is just alias to -mcpu=8540.

Note that U-Boot's CONFIG_E500 option is set also for other cpus, not only
for e500v1 and e500v2. So do not check for CONFIG_E500 and rather set e500
as last fallback value when no other mpc85xx cpu matches.

Signed-off-by: Pali Rohár <pali@kernel.org>
2 years agonet: don't memcpy to NULL
Heinrich Schuchardt [Wed, 7 Dec 2022 10:53:29 +0000 (11:53 +0100)]
net: don't memcpy to NULL

In ndisc_receive() 7 bytes are copied from a buffer of size 6 to NULL.

net_nd_packet_mac is a pointer. If it is NULL, we should set it to the
address of the buffer with the MAC address.

Addresses-Coverity-ID: 430974 ("Out-of-bounds access")
Fixes: c6610e1d90ea ("net: ipv6: Add Neighbor Discovery Protocol (NDP)")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Viacheslav Mitrofanov <v.v.mitrofanov@yadro.com>
2 years agonet: ipv6: Add missing break into IPv6 protocol handler
Viacheslav Mitrofanov [Tue, 6 Dec 2022 07:08:16 +0000 (10:08 +0300)]
net: ipv6: Add missing break into IPv6 protocol handler

IPv6 protocol handler is not terminated with a break statment.
It can lead to running unexpected code.

Signed-off-by: Viacheslav Mitrofanov <v.v.mitrofanov@yadro.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
2 years agospl: Kconfig: Fix SPL_OPTEE_IMAGE dependency
Jagan Teki [Thu, 3 Nov 2022 06:19:47 +0000 (11:49 +0530)]
spl: Kconfig: Fix SPL_OPTEE_IMAGE dependency

fdt_addr will build as part of SPL_LOAD_FIT or SPL_LOAD_FIT_FULL
which is indeed required to build optee image support in SPL.

common/spl/spl.c: In function ‘jump_to_image_optee’:
common/spl/spl.c:220:46: error: ‘struct spl_image_info’ has no member named ‘fdt_addr’
  220 |         spl_optee_entry(NULL, NULL, spl_image->fdt_addr,

Fix the dependency support.

Signed-off-by: Jagan Teki <jagan@edgeble.ai>
2 years agoCI: Reduce aarch64 catchall job matches
Tom Rini [Wed, 7 Dec 2022 14:16:18 +0000 (09:16 -0500)]
CI: Reduce aarch64 catchall job matches

The aarch64 catch-all job is getting close to the hard time limit in
Azure for the free tier. Move i.MX9 boards to the i.MX8 job and move
amlogic entirely to its own job. This brings us down from 85 boards to
51 boards and so should be safe for a while.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoMerge tag 'efi-2023-01-rc5' of https://source.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Tue, 20 Dec 2022 17:50:38 +0000 (12:50 -0500)]
Merge tag 'efi-2023-01-rc5' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request for efi-2023-01-rc5

UEFI:

* Improve parameter checking in efi_get_next_variable_name_mem()
* Fix a bugs in management of security database via the eficonfig command

Other:

* Allow sound command to play multiple sounds

2 years agoMerge tag 'tpm-20122022' of https://source.denx.de/u-boot/custodians/u-boot-tpm
Tom Rini [Tue, 20 Dec 2022 17:50:24 +0000 (12:50 -0500)]
Merge tag 'tpm-20122022' of https://source.denx.de/u-boot/custodians/u-boot-tpm

fTPM privileged login

2 years agoeficonfig: EFI_VARIABLE_APPEND_WRITE is not set for null key
Masahisa Kojima [Tue, 20 Dec 2022 10:38:52 +0000 (19:38 +0900)]
eficonfig: EFI_VARIABLE_APPEND_WRITE is not set for null key

The signed null key with authenticated header is used to clear
the PK, KEK, db and dbx. When CONFIG_EFI_MM_COMM_TEE is enabled
(StMM and OP-TEE based RPMB storage is used as the EFI variable
storage), clearing KEK, db and dbx by enrolling a signed null
key does not work as expected if EFI_VARIABLE_APPEND_WRITE
attritube is set.

This commit checks the selected file is null key, then
EFI_VARIABLE_APPEND_WRITE attibute will not be used for the null key.

Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 years agoefi_selftest: conformance test for GetNextVariableName
Heinrich Schuchardt [Sun, 18 Dec 2022 06:08:58 +0000 (06:08 +0000)]
efi_selftest: conformance test for GetNextVariableName

Test that GetNextVariableName() checks the parameters.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2 years agoefi_loader: fix efi_get_next_variable_name_mem()
Heinrich Schuchardt [Sun, 18 Dec 2022 06:08:57 +0000 (06:08 +0000)]
efi_loader: fix efi_get_next_variable_name_mem()

The VariableNameSize parameter is in bytes but u16_strnlen() counts u16.

Fix the parameter check for null termination.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2 years agoeficonfig: avoid SetVariable between GetNextVariableName calls
Masahisa Kojima [Mon, 19 Dec 2022 02:33:13 +0000 (11:33 +0900)]
eficonfig: avoid SetVariable between GetNextVariableName calls

The current code calls efi_set_variable_int() to delete the
invalid boot option between calls to efi_get_next_variable_name_int(),
it may produce unpredictable results.

This commit moves removal of the invalid boot option outside
of the efi_get_next_variable_name_int() calls.
EFI_NOT_FOUND returned from efi_get_next_variable_name_int()
indicates we retrieved all EFI variables, it should be treated
as EFI_SUCEESS.

To address the checkpatch warning of too many leading tabs,
combine two if statement into one.

Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2 years agoeficonfig: carve out efi_get_next_variable_name_int calls
Masahisa Kojima [Mon, 19 Dec 2022 02:33:12 +0000 (11:33 +0900)]
eficonfig: carve out efi_get_next_variable_name_int calls

To retrieve the EFI variable name by efi_get_next_variable_name_int(),
the sequence of alloc -> efi_get_next_variable_name_int ->
realloc -> efi_get_next_variable_name_int is required.
In current code, this sequence repeatedly appears in
the several functions. It should be curved out a common function.

This commit also fixes the missing free() of var_name16
in eficonfig_delete_invalid_boot_option().

Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2 years agotest: add unit test for u16_strnlen()
Heinrich Schuchardt [Sun, 18 Dec 2022 05:32:14 +0000 (05:32 +0000)]
test: add unit test for u16_strnlen()

Add the missing unit test. It can be executed with:

    ut unicode u16_strnlen

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2 years agodoc: correct heading level in printenv man-page
Heinrich Schuchardt [Sun, 18 Dec 2022 04:00:52 +0000 (04:00 +0000)]
doc: correct heading level in printenv man-page

The 'Configuration' heading should be on level 2, not on level 1.

Fixes: eaa268589e9c ("doc: man-page for the printenv command")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 years agocmd: allow sound command to play multiple sounds
Heinrich Schuchardt [Fri, 16 Dec 2022 00:50:39 +0000 (16:50 -0800)]
cmd: allow sound command to play multiple sounds

Currently the sound command accepts only one value each for duration and
frequency. Allowing more duration and frequency arguments enables playing a
tune.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agotpm2: ftpm: open session with privileged ree login
Etienne Carriere [Wed, 7 Dec 2022 15:25:33 +0000 (16:25 +0100)]
tpm2: ftpm: open session with privileged ree login

Opens the fTPM session with TEE_LOGIN_REE_KERNEL as fTPM may restrict
access to that login when Linux based OS is running as applications are
expected to got through the Linux TPMv2 driver.

Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2 years agoPrepare v2023.01-rc4
Tom Rini [Mon, 19 Dec 2022 13:45:26 +0000 (08:45 -0500)]
Prepare v2023.01-rc4

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoMerge tag 'u-boot-rockchip-20221219' of https://source.denx.de/u-boot/custodians...
Tom Rini [Mon, 19 Dec 2022 13:33:24 +0000 (08:33 -0500)]
Merge tag 'u-boot-rockchip-20221219' of https://source.denx.de/u-boot/custodians/u-boot-rockchip

- Only call binman when TPL available;
- rk3128 DTS fix;
- Fix GPT table corruption for rk3399 puma ;
- Fix i2c for rk3399 Pinebookpro;
- Enable UEFI capsule update for RockPi4;

2 years agorockpi4: capsule: Enable UEFI capsule update on RockPi4 boards
Sughosh Ganu [Thu, 10 Nov 2022 09:19:17 +0000 (14:49 +0530)]
rockpi4: capsule: Enable UEFI capsule update on RockPi4 boards

Enable the UEFI capsule update functionality on the RockPi4B and
RockPi4C boards. Support is being enabled for updating the idbloader
and u-boot firmware images residing on GPT partitioned uSD card
storage device.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2 years agorockpi4: board: Add firmware image information for capsule updates
Sughosh Ganu [Thu, 10 Nov 2022 09:19:16 +0000 (14:49 +0530)]
rockpi4: board: Add firmware image information for capsule updates

Add information that will be needed for enabling the UEFI capsule
update feature on the RockPi4 boards. With the feature enabled, it
would be possible to update the idbloader and u-boot.itb images on the
RockPi4B and RockPi4C variants.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2 years agorockchip: capsule: Add functions for supporting capsule updates
Sughosh Ganu [Thu, 10 Nov 2022 09:19:15 +0000 (14:49 +0530)]
rockchip: capsule: Add functions for supporting capsule updates

Add functions needed to support the UEFI capsule update feature on
rockchip boards. Currently, the feature is being enabled on the
RockPi4 boards with firmware images residing on GPT partitioned
storage media.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2 years agophy: rockchip: handle clock without enable function
John Keeping [Tue, 6 Dec 2022 12:48:55 +0000 (12:48 +0000)]
phy: rockchip: handle clock without enable function

If a clock doesn't supply the enable hook, clk_enable() will return
-ENOSYS.  In this case the clock is always enabled so there is no error
and the phy initialisation should continue.

Signed-off-by: John Keeping <john@metanate.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2 years agorockchip: Pinebook Pro: Do not initialize i2c before relocation
Michal Suchanek [Sat, 3 Dec 2022 12:31:29 +0000 (13:31 +0100)]
rockchip: Pinebook Pro: Do not initialize i2c before relocation

The i2c locks up when initialized before relocation, and it stays broken
in Linux as well breaking the ability to boot Linux.

The i2c bus and pmic was not actually used in pre-reloc before
commit ad607512f575 ("power: pmic: rk8xx: Support sysreset shutdown method")

The cause is not known.

This is board-specific, other boards that do not add the option to
include the i2c bus in pre-reloc DT are not affected.

Signed-off-by: Michal Suchanek <msuchanek@suse.de>
Reviewed-by: Peter Robinson <pbrobinson@gmail.com>
Tested-by: Peter Robinson <pbrobinson@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2 years agorockchip: puma: fix GPT table corruption when saving U-Boot environment
Quentin Schulz [Tue, 25 Oct 2022 10:58:02 +0000 (12:58 +0200)]
rockchip: puma: fix GPT table corruption when saving U-Boot environment

The GPT table is taking the first 34 sectors, which amounts to 0x4400
bytes. Saving the environment below this address in storage will corrupt
the GPT table.

While technically the table ends at 0x4400, some tools (e.g. bmaptool)
are rounding everything to the logical block size (0x1000), so it is
safer to make it point to 0x5000 so that the environment could still
persist when flashing a sparse image with bmaptool or similar tools.

Obviously, the default 0x4000 environment size does not work anymore, so
let's set it to 0x3000 so it does fill the gap between the GPT table
(rounded to 0x1000) and the start of the idbloader.img.

Fixes: 56f580d3eb8d ("rockchip: dts: rk3399-puma: put environment (in MMC/SD configurations) before SPL")
Cc: Quentin Schulz <foss+uboot@0leil.net>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2 years agoarm: dts: rockchip: enable ums/rockusb command for ROCK Pi 4
FUKAUMI Naoki [Wed, 19 Oct 2022 07:12:52 +0000 (07:12 +0000)]
arm: dts: rockchip: enable ums/rockusb command for ROCK Pi 4

this patch add USB mass storage function and Rockusb function for
Radxa ROCK Pi 4 series.

Signed-off-by: FUKAUMI Naoki <naoki@radxa.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2 years agoconfigs:rockchip:roc-rk3399-pc:Enable more configs
Manoj Sai [Thu, 15 Sep 2022 07:23:19 +0000 (12:53 +0530)]
configs:rockchip:roc-rk3399-pc:Enable more configs

This patch enables the following:

1) use preboot configuration to enable usb devices.

2) Enable USB configs so keyboards and other USB devices work,
   update the number of ports of the usb root hub.

   - with this addition the updated USB device Tree:

1  Hub (12 Mb/s, 0mA)
U-Boot Root Hub
1  Hub (12 Mb/s, 0mA)
|   U-Boot Root Hub
|
+-2  Hub (12 Mb/s, 100mA)
USB 2.0 Hub [MTT]

1  Hub (5 Gb/s, 0mA)
U-Boot XHCI Host Controller

3) enable crypto RNG support.

4) Change SPI speed and frequency:
    - increase the maximum SPI slave device speed,
      SPI flash max frequency for the environment from 10Mhz to 30MHz.

    - performance stats for speed update from 10MHz to 30MHz:

     with 10Mhz speed update:
      => sf update 0x300000 0x800000 0x400000
         4194304 bytes written, 0 bytes skipped in 36.819s, speed 119837 B/s

        with 30Mhz speed update:
      => sf update 0x300000 0x800000 0x400000
         4194304 bytes written, 0 bytes skipped in 20.319s, speed 220752 B/s

Signed-off-by: Manoj Sai <abbaraju.manojsai@amarulasolutions.com>
Signed-off-by: Da Xue <da.xue@libretech.co>
Signed-off-by: dsx724 <da@lessconfused.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2 years agoarm: dts: rockchip: rk3128: fix clocks, compatible and phys
Johan Jonker [Fri, 9 Sep 2022 20:20:07 +0000 (22:20 +0200)]
arm: dts: rockchip: rk3128: fix clocks, compatible and phys

Fix rk3128 clocks, compatible and phys, so that they match the bindings.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
2 years agoarm: dts: rockchip: rk3128: fix DT node names
Johan Jonker [Fri, 9 Sep 2022 20:19:24 +0000 (22:19 +0200)]
arm: dts: rockchip: rk3128: fix DT node names

The rk3128 DT node names should be generic.
Rename them to the pattern defined in the DT bindings.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
2 years agoarm: dts: rockchip: move all rk3128 u-boot specific properties in separate dtsi files
Johan Jonker [Fri, 9 Sep 2022 20:19:06 +0000 (22:19 +0200)]
arm: dts: rockchip: move all rk3128 u-boot specific properties in separate dtsi files

Move all rk3128 u-boot specific properties in separate dtsi files.
Sort emmc node.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2 years agoarm: dts: rockchip: rk3128: bulk convert gpios to their constant counterparts
Johan Jonker [Fri, 9 Sep 2022 20:18:55 +0000 (22:18 +0200)]
arm: dts: rockchip: rk3128: bulk convert gpios to their constant counterparts

Bulk convert rk3128 DT gpios to their constant counterparts.

sed -i -f script.sed rk3128.dtsi
sed -i -f script.sed rk3128-evb.dts

================================

/rockchip,pins *=/bcheck
b # to end of script
:append-next-line
N
:check
/^[^;]*$/bappend-next-line
s/<RK_GPIO\([0-9]\) /<\1 /g
s/<\([^ ][^ ]*  *\)0 /<\1RK_PA0 /g
s/<\([^ ][^ ]*  *\)1 /<\1RK_PA1 /g
s/<\([^ ][^ ]*  *\)2 /<\1RK_PA2 /g
s/<\([^ ][^ ]*  *\)3 /<\1RK_PA3 /g
s/<\([^ ][^ ]*  *\)4 /<\1RK_PA4 /g
s/<\([^ ][^ ]*  *\)5 /<\1RK_PA5 /g
s/<\([^ ][^ ]*  *\)6 /<\1RK_PA6 /g
s/<\([^ ][^ ]*  *\)7 /<\1RK_PA7 /g
s/<\([^ ][^ ]*  *\)8 /<\1RK_PB0 /g
s/<\([^ ][^ ]*  *\)9 /<\1RK_PB1 /g
s/<\([^ ][^ ]*  *\)10 /<\1RK_PB2 /g
s/<\([^ ][^ ]*  *\)11 /<\1RK_PB3 /g
s/<\([^ ][^ ]*  *\)12 /<\1RK_PB4 /g
s/<\([^ ][^ ]*  *\)13 /<\1RK_PB5 /g
s/<\([^ ][^ ]*  *\)14 /<\1RK_PB6 /g
s/<\([^ ][^ ]*  *\)15 /<\1RK_PB7 /g
s/<\([^ ][^ ]*  *\)16 /<\1RK_PC0 /g
s/<\([^ ][^ ]*  *\)17 /<\1RK_PC1 /g
s/<\([^ ][^ ]*  *\)18 /<\1RK_PC2 /g
s/<\([^ ][^ ]*  *\)19 /<\1RK_PC3 /g
s/<\([^ ][^ ]*  *\)20 /<\1RK_PC4 /g
s/<\([^ ][^ ]*  *\)21 /<\1RK_PC5 /g
s/<\([^ ][^ ]*  *\)22 /<\1RK_PC6 /g
s/<\([^ ][^ ]*  *\)23 /<\1RK_PC7 /g
s/<\([^ ][^ ]*  *\)24 /<\1RK_PD0 /g
s/<\([^ ][^ ]*  *\)25 /<\1RK_PD1 /g
s/<\([^ ][^ ]*  *\)26 /<\1RK_PD2 /g
s/<\([^ ][^ ]*  *\)27 /<\1RK_PD3 /g
s/<\([^ ][^ ]*  *\)28 /<\1RK_PD4 /g
s/<\([^ ][^ ]*  *\)29 /<\1RK_PD5 /g
s/<\([^ ][^ ]*  *\)30 /<\1RK_PD6 /g
s/<\([^ ][^ ]*  *\)31 /<\1RK_PD7 /g
s/<\([^ ][^ ]*  *[^ ][^ ]*  *\)0 /<\1RK_FUNC_GPIO /g
s/<\([^ ][^ ]*  *[^ ][^ ]*  *\)RK_FUNC_\([1-9]\) /<\1\2 /g

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2 years agorockchip: rk3128-cru: sync the clock dt-binding header from Linux
Johan Jonker [Fri, 9 Sep 2022 20:18:45 +0000 (22:18 +0200)]
rockchip: rk3128-cru: sync the clock dt-binding header from Linux

In order to update the DT for rk3128
sync the clock dt-binding header.
This is the state as of v6.0 in Linux.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2 years agorockchip: enable fdt overlays for ROCK Pi 4 series
FUKAUMI Naoki [Sat, 10 Sep 2022 01:47:24 +0000 (01:47 +0000)]
rockchip: enable fdt overlays for ROCK Pi 4 series

add CONFIG_OF_LIBFDT_OVERLAY=y to support fdt overlays.

Signed-off-by: FUKAUMI Naoki <naoki@radxa.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2 years agorockchip: Only call binman when TPL available
Kever Yang [Sun, 18 Dec 2022 12:43:38 +0000 (20:43 +0800)]
rockchip: Only call binman when TPL available

Rockchip platform use TPL to do the DRAM initialize for all the SoCs,
if TPL is not available, means no available DRAM init program, and the
u-boot-rockchip.bin is not functionable.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Change-Id: I2299f1eddce5aa7d5fb1a3fb4d8aeaa995b397fa

2 years agoMakefile: With BINMAN_ALLOW_MISSING=1 don't error on missing
Tom Rini [Tue, 6 Dec 2022 02:03:36 +0000 (21:03 -0500)]
Makefile: With BINMAN_ALLOW_MISSING=1 don't error on missing

When the user builds with BINMAN_ALLOW_MISSING=1 they're explicitly
setting the flag to allow for additional binaries to be missing and so
have acknowledged the output might not work. In this case we want to
default to not passing a non-zero exit code.

Cc: Simon Glass <sjg@chromium.org>
Reported-by: Peter Robinson <pbrobinson@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoMerge tag 'efi-2023-01-rc4' of https://source.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Sun, 18 Dec 2022 13:10:09 +0000 (08:10 -0500)]
Merge tag 'efi-2023-01-rc4' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request for efi-2023-01-rc4

Documentation:

* Fix htmldoc build dependency

UEFI:

* Adjust EBBR version for compatibility table

2 years agoMerge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-sunxi
Tom Rini [Sun, 18 Dec 2022 13:08:55 +0000 (08:08 -0500)]
Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-sunxi

This cleans up each board's defconfig, and fixes the serial console on
some Olimex board. Also we lose another legacy config variable.
The rest are minor cleanups, that actually shouldn't change anything
in the build.

Passed the gitlab CI, plus briefly tested on Pine64-LTS, LicheePi Nano,
and BananaPi M1.

2 years agodoc: update Sphinx requirements for certifi
Heinrich Schuchardt [Fri, 9 Dec 2022 14:33:52 +0000 (15:33 +0100)]
doc: update Sphinx requirements for certifi

Upgrade to version 2022.12.7.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 years agoefi: adjust ebbr to v2.1 in conformance profile
Vincent Stehlé [Fri, 16 Dec 2022 16:55:04 +0000 (17:55 +0100)]
efi: adjust ebbr to v2.1 in conformance profile

The EFI Conformance Profile Table entry for EBBR appears in v2.1.0 of the
EBBR specification[1]. Update naming accordingly.

While at it, update the EBBR version referenced in the documentation.

[1]: https://github.com/ARM-software/ebbr/releases/tag/v2.1.0

Signed-off-by: Vincent Stehlé <vincent.stehle@arm.com>
Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 years agodoc: fix typos
Maxim Cournoyer [Sat, 17 Dec 2022 02:09:40 +0000 (21:09 -0500)]
doc: fix typos

Fix a few typos spot during a first read of the contribution process.

Signed-off-by: Maxim Cournoyer <maxim.cournoyer@savoirfairelinux.com>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 years agoMerge https://source.denx.de/u-boot/custodians/u-boot-x86
Tom Rini [Thu, 15 Dec 2022 18:06:00 +0000 (13:06 -0500)]
Merge https://source.denx.de/u-boot/custodians/u-boot-x86

- Adjust CONFIG_TEXT_BASE for BayTrail based platforms
- 2 cosmetic issue fixes

2 years agosunxi: board: annotate #endif lines
Andre Przywara [Mon, 28 Nov 2022 00:02:56 +0000 (00:02 +0000)]
sunxi: board: annotate #endif lines

The legacy Allwinner code is cluttered with #ifdef's, some of them even
nested, which makes the code hard to read and error prone.
Eventually we will get rid of most of them, but for now let's at least
annotate the #endif lines with the corresponding symbol the bracket
started with.

Reviewed-by: Samuel Holland <samuel@sholland.org>
Tested-by: Samuel Holland <samuel@sholland.org>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2 years agosunxi: remove bogus mmc_pinmux_setup() prototype
Andre Przywara [Mon, 28 Nov 2022 00:55:20 +0000 (00:55 +0000)]
sunxi: remove bogus mmc_pinmux_setup() prototype

Since all callers of mmc_pinmux_setup() are located after the definition
of that function, there is no need for a forward declaration (anymore?).

Remove the prototype along with its #ifdef guards.

Reviewed-by: Samuel Holland <samuel@sholland.org>
Tested-by: Samuel Holland <samuel@sholland.org>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>