platform/kernel/u-boot.git
10 months agospi: soft_spi: Support the recommended soft spi properties
Fabio Estevam [Thu, 18 May 2023 22:22:40 +0000 (19:22 -0300)]
spi: soft_spi: Support the recommended soft spi properties

According to Documentation/devicetree/bindings/spi/spi-gpio.yaml
from Linux, the recommended spio-gpio properties are:

sck-gpios, miso-gpios and mosi-gpios.

gpio-sck, gpio-mosi and gpio-miso are considered deprecated.

Currently, U-Boot only supports the deprecated properties.

Allow the soft_spi driver to support both the new and old properties.

Signed-off-by: Fabio Estevam <festevam@denx.de>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
10 months agodt-bindings: spi: Add bcm63xx-hsspi controller support
William Zhang [Wed, 7 Jun 2023 23:37:06 +0000 (16:37 -0700)]
dt-bindings: spi: Add bcm63xx-hsspi controller support

Bring the device tree binding document from Linux to u-boot

Port from linux patches:
Link: https://lore.kernel.org/r/20230207065826.285013-2-william.zhang@broadcom.com
Link: https://lore.kernel.org/r/20230207065826.285013-3-william.zhang@broadcom.com
Signed-off-by: William Zhang <william.zhang@broadcom.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
10 months agospi: synquacer: remove SPI_TX_BYTE handling
Masahisa Kojima [Wed, 24 May 2023 07:32:46 +0000 (16:32 +0900)]
spi: synquacer: remove SPI_TX_BYTE handling

Current code expects that SPI_TX_BYTE is single bit mode
but it is wrong. It indicates byte program mode,
not single bit mode.

If SPI_TX_DUAL, SPI_TX_QUAD and SPI_TX_OCTAL bits are not set,
the default transfer bus width is single bit.

Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
10 months agospi: bcmbca-hsspi: Add driver for newer HSSPI controller
William Zhang [Wed, 7 Jun 2023 23:37:05 +0000 (16:37 -0700)]
spi: bcmbca-hsspi: Add driver for newer HSSPI controller

The newer BCMBCA SoCs such as BCM6756, BCM4912 and BCM6855 include an
updated SPI controller that add the capability to allow the driver to
control chip select explicitly. Driver can control and keep cs low
between the transfers natively. Hence the dummy cs workaround or prepend
mode found in the bcm63xx-hsspi driver are no longer needed and this new
driver is much cleaner.

Port from linux patch:
Link: https://lore.kernel.org/r/20230209200246.141520-15-william.zhang@broadcom.com
Signed-off-by: William Zhang <william.zhang@broadcom.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
10 months agospi: bcm63xx-hsspi: Add prepend mode support
William Zhang [Wed, 7 Jun 2023 23:37:04 +0000 (16:37 -0700)]
spi: bcm63xx-hsspi: Add prepend mode support

Due to the controller limitation to keep the chip select low during the
bus idle time between the transfer, a dummy cs workaround was used when
this driver was first upstreamed to the u-boot based on linux kernel
driver. It basically picks the dummy cs as !actual_cs so typically dummy
cs is 1 when most of the case only cs 0 is used in the board design.
Then invert the polarity of both cs and tell the controller to start the
transfers using dummy cs. Assuming both cs are active low before the
inversion, effectively this keeps dummy cs high and actual cs low during
the transfer and workaround the issue.

This workaround requires that dummy cs 1 pin to is set to SPI chip
selection function in the pinmux when the transfer clock is above 25MHz.
The old chips likely have default pinmux set to chip select on the dummy
cs pin so it works but this is not case for the new Broadband BCA chips
and this workaround stop working. This is specifically an issue to
support SPI NAND and SPI NOR flash because these flash devices can
typically run at or above 100MHz.

This patch utilizes the prepend feature of the controller to combine the
multiple transfers in the same message to a single transfer when
possible. This way there is no need to keep clock low between transfers
and solve the issue without any pinmux requirement.

Multiple transfers within a SPI message may be combined into one
transfer if the following are all true:
  * One or more half duplex write transfer in single bit mode
  * Optional full duplex read/write at the end
  * No delay and cs_change between transfers

Most of the SPI device meets this requirements such as SPI NOR, SPI NAND
flash, Broadcom SPI voice card and etc. So this change switches to the
prepend mode as the default mode. For any SPI message that does not meet
the above requirement, we switch to original dummy cs mode but limit the
clock rate to the safe 25MHz.

Port from linux patch:
Link: https://lore.kernel.org/r/20230209200246.141520-12-william.zhang@broadcom.com
Signed-off-by: William Zhang <william.zhang@broadcom.com>
Acked-by: Jagan Teki <jagan@amarulasolutions.com>
10 months agospi: bcm63xx-hsspi: Add new compatible string support
William Zhang [Wed, 7 Jun 2023 23:37:03 +0000 (16:37 -0700)]
spi: bcm63xx-hsspi: Add new compatible string support

New compatible string brcm,bcmbca-hsspi-v1.0 is introduced based on
dts document brcm,bcm63xx-hsspi.yaml. Add it to the driver to support
this new binding.

Port from linux patch:
Link: https://lore.kernel.org/r/20230207065826.285013-6-william.zhang@broadcom.com
Signed-off-by: William Zhang <william.zhang@broadcom.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
10 months agospi: bcm63xx-hsspi: Fix multi-bit mode setting
William Zhang [Wed, 7 Jun 2023 23:37:02 +0000 (16:37 -0700)]
spi: bcm63xx-hsspi: Fix multi-bit mode setting

Currently the driver always sets the controller to dual data bit mode
for both tx and rx data in the profile mode control register even for
single data bit transfer. Luckily the opcode is set correctly according
to SPI transfer data bit width so it does not actually cause issues.

This change fixes the problem by setting tx and rx data bit mode field
correctly according to the actual SPI transfer tx and rx data bit width.

Fixes: 29cc4368ad4b ("dm: spi: add BCM63xx HSSPI driver")
Port from linux patch:
Link: https://lore.kernel.org/r/20230209200246.141520-11-william.zhang@broadcom.com
Signed-off-by: William Zhang <william.zhang@broadcom.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
10 months agospi: bcm63xx-hsspi: Make driver depend on BCMBCA arch
William Zhang [Wed, 7 Jun 2023 23:37:01 +0000 (16:37 -0700)]
spi: bcm63xx-hsspi: Make driver depend on BCMBCA arch

ARCH_BCMBCA was introduced to cover individual Broadcom broadband SoC
for common features and IP blocks. Use this config instead of each chip
config as the Kconfig dependency for Broadcom HSSPI driver.

Signed-off-by: William Zhang <william.zhang@broadcom.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
10 months agospi: pl022: Add chip-select gpio support
Lukas Funke [Fri, 28 Apr 2023 12:38:50 +0000 (14:38 +0200)]
spi: pl022: Add chip-select gpio support

Add support for an optional external chip-select gpio.

Signed-off-by: Lukas Funke <lukas.funke@weidmueller.com>
Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
10 months agospi: pl022: Remove platform data header
Stefan Herbrechtsmeier [Fri, 28 Apr 2023 12:38:49 +0000 (14:38 +0200)]
spi: pl022: Remove platform data header

Remove the platform data header because its content is only used by the
driver.

Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
10 months agospi: pl022: Rename flush into pl022_spi_flush
Stefan Herbrechtsmeier [Fri, 28 Apr 2023 12:38:48 +0000 (14:38 +0200)]
spi: pl022: Rename flush into pl022_spi_flush

Rename the flush function into pl022_spi_flush to avoid conflicting
types with previous declaration of the function in stdio.h header.

Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
10 months agospi: pl022: Align compatible property with device tree binding
Lukas Funke [Fri, 28 Apr 2023 12:38:47 +0000 (14:38 +0200)]
spi: pl022: Align compatible property with device tree binding

Align the compatible property with the kernel device tree binding [1]
by removing the '-spi' suffix.

[1] https://www.kernel.org/doc/Documentation/devicetree/bindings/spi/spi-pl022.yaml

Signed-off-by: Lukas Funke <lukas.funke@weidmueller.com>
Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
10 months agoMerge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-riscv
Tom Rini [Wed, 12 Jul 2023 17:10:04 +0000 (13:10 -0400)]
Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-riscv

- Add ethernet driver for StarFive JH7110 SoC
- Add ACLINT mtimer and mswi devices support
- Add Lichee PI 4A board

10 months agodoc: t-head: lpi4a: document Lichee PI 4A board
Yixun Lan [Sat, 8 Jul 2023 11:24:35 +0000 (19:24 +0800)]
doc: t-head: lpi4a: document Lichee PI 4A board

Reviewed-by: Wei Fu <wefu@redhat.com>
Signed-off-by: Yixun Lan <dlan@gentoo.org>
10 months agoconfigs: th1520_lpi4a_defconfig: Add initial config
Yixun Lan [Sat, 8 Jul 2023 11:24:34 +0000 (19:24 +0800)]
configs: th1520_lpi4a_defconfig: Add initial config

Add basic config for Sipeed Lichee PI 4A board which make it capable of
booting into serial console.

Reviewed-by: Wei Fu <wefu@redhat.com>
Signed-off-by: Yixun Lan <dlan@gentoo.org>
10 months agoriscv: dts: t-head: Add basic device tree for Sipeed Lichee PI 4A board
Yixun Lan [Sat, 8 Jul 2023 11:24:33 +0000 (19:24 +0800)]
riscv: dts: t-head: Add basic device tree for Sipeed Lichee PI 4A board

Only add basic support for CPU, PLIC UART and Timer.

Reviewed-by: Wei Fu <wefu@redhat.com>
Signed-off-by: Yixun Lan <dlan@gentoo.org>
10 months agoriscv: t-head: licheepi4a: initial support added
Yixun Lan [Sat, 8 Jul 2023 11:24:32 +0000 (19:24 +0800)]
riscv: t-head: licheepi4a: initial support added

Add support for Sipeed's Lichee Pi 4A board which based on T-HEAD's
TH1520 SoC, only minimal device tree and serial console are enabled,
so it's capable of chain booting from T-HEAD's vendor u-boot.

Reviewed-by: Wei Fu <wefu@redhat.com>
Signed-off-by: Yixun Lan <dlan@gentoo.org>
10 months agoriscv: Rename SiFive CLINT to RISC-V ALINT
Bin Meng [Wed, 21 Jun 2023 15:11:46 +0000 (23:11 +0800)]
riscv: Rename SiFive CLINT to RISC-V ALINT

As the RISC-V ACLINT specification is defined to be backward compatible
with the SiFive CLINT specification, we rename SiFive CLINT to RISC-V
ALINT in the source tree to be future-proof.

Signed-off-by: Bin Meng <bmeng@tinylab.org>
Reviewed-by: Rick Chen <rick@andestech.com>
10 months agoriscv: clint: Update the sifive clint ipi driver to support aclint
Bin Meng [Wed, 21 Jun 2023 15:11:45 +0000 (23:11 +0800)]
riscv: clint: Update the sifive clint ipi driver to support aclint

This RISC-V ACLINT specification [1] defines a set of memory mapped
devices which provide inter-processor interrupts (IPI) and timer
functionalities for each HART on a multi-HART RISC-V platform.

The RISC-V ACLINT specification is defined to be backward compatible
with the SiFive CLINT specification, however the device tree binding
is a new one. This change updates the sifive clint ipi driver to
support ACLINT mswi device, by checking the per-driver data field of
the ACLINT mtimer driver to determine whether a syscon based approach
needs to be taken to get the base address of the ACLINT mswi device.

[1] https://github.com/riscv/riscv-aclint/blob/main/riscv-aclint.adoc

Signed-off-by: Bin Meng <bmeng@tinylab.org>
Reviewed-by: Rick Chen <rick@andestech.com>
10 months agoriscv: timer: Update the sifive clint timer driver to support aclint
Bin Meng [Wed, 21 Jun 2023 15:11:44 +0000 (23:11 +0800)]
riscv: timer: Update the sifive clint timer driver to support aclint

This RISC-V ACLINT specification [1] defines a set of memory mapped
devices which provide inter-processor interrupts (IPI) and timer
functionalities for each HART on a multi-HART RISC-V platform.

The RISC-V ACLINT specification is defined to be backward compatible
with the SiFive CLINT specification, however the device tree binding
is a new one. This change updates the sifive clint timer driver to
support ACLINT mtimer device, using a per-driver data field to hold
the mtimer offset to the base address encoded in the mtimer node.

[1] https://github.com/riscv/riscv-aclint/blob/main/riscv-aclint.adoc

Signed-off-by: Bin Meng <bmeng@tinylab.org>
Reviewed-by: Rick Chen <rick@andestech.com>
10 months agoboard: starfive: Dynamic configuration of DT for 1.2A and 1.3B
Yanhong Wang [Thu, 15 Jun 2023 09:36:52 +0000 (17:36 +0800)]
board: starfive: Dynamic configuration of DT for 1.2A and 1.3B

The main difference between StarFive VisionFive 2 1.2A and 1.3B is gmac.
You can read the PCB version of the current board by
get_pcb_revision_from_eeprom(), and then dynamically configure the
difference of gmac in spl_perform_fixups() according to different PCB
versions, so that one DT and one defconfig can support both 1.2A and
1.3B versions, which is more user-friendly.

Signed-off-by: Yanhong Wang <yanhong.wang@starfivetech.com>
Reviewed-by: Rick Chen <rick@andestech.com>
10 months agoram: starfive: Read memory size information from EEPROM
Yanhong Wang [Thu, 15 Jun 2023 09:36:51 +0000 (17:36 +0800)]
ram: starfive: Read memory size information from EEPROM

StarFive VisionFive 2 has two versions, 1.2A and 1.3B, each version of
DDR capacity includes 2G/4G/8G, a DT can not support multiple
capacities, so the capacity size information is recorded to EEPROM, when
DDR initialization required capacity size information is read from
EEPROM.

If there is no information in EEPROM, it is initialized with the default
size defined in DT.

Signed-off-by: Yanhong Wang <yanhong.wang@starfivetech.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
10 months agoconfigs: starfive: Enable ID EEPROM configuration
Yanhong Wang [Thu, 15 Jun 2023 09:36:50 +0000 (17:36 +0800)]
configs: starfive: Enable ID EEPROM configuration

Enabled ID_EEPROM and I2C configuration for StarFive VisionFive2 board.

Signed-off-by: Yanhong Wang <yanhong.wang@starfivetech.com>
Reviewed-By: Leo Yu-Chi Linag <ycliang@andestech.com>
10 months agoriscv: dts: starfive: Add support eeprom device tree node
Yanhong Wang [Thu, 15 Jun 2023 09:36:49 +0000 (17:36 +0800)]
riscv: dts: starfive: Add support eeprom device tree node

Add support "atmel,24c04" eeprom for StarFive VisionFive2 board.

Signed-off-by: Yanhong Wang <yanhong.wang@starfivetech.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
10 months agoeeprom: starfive: Enable ID EEPROM configuration
Yanhong Wang [Thu, 15 Jun 2023 09:36:48 +0000 (17:36 +0800)]
eeprom: starfive: Enable ID EEPROM configuration

Enabled ID_EEPROM configuration for StarFive VisionFive2 board.

Signed-off-by: Yanhong Wang <yanhong.wang@starfivetech.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
10 months agoconfigs: starfive: Enable ethernet configuration for StarFive VisionFive2
Yanhong Wang [Thu, 15 Jun 2023 09:36:47 +0000 (17:36 +0800)]
configs: starfive: Enable ethernet configuration for StarFive VisionFive2

Enable DWC_ETH_QOS and PHY_MOTORCOMM configuration to support ethernet
function for StarFive VisionFive 2 board,including versions 1.2A and
1.3B.

Signed-off-by: Yanhong Wang <yanhong.wang@starfivetech.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
10 months agodoc: board: starfive: Reword the make defconfig information
Yanhong Wang [Thu, 15 Jun 2023 09:36:46 +0000 (17:36 +0800)]
doc: board: starfive: Reword the make defconfig information

The defconfig file name for StarFive VisionFive2 has been changed, and
the documentation description has also changed.

Signed-off-by: Yanhong Wang <yanhong.wang@starfivetech.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
10 months agoriscv: dts: jh7110: Combine the board device tree files of 1.2A and 1.3B
Yanhong Wang [Thu, 15 Jun 2023 09:36:45 +0000 (17:36 +0800)]
riscv: dts: jh7110: Combine the board device tree files of 1.2A and 1.3B

The difference between 1.2A and 1.3B is dynamically configured according
to the PCB version, and there is no difference on the board device tree,
so the same DT file can be used.

Signed-off-by: Yanhong Wang <yanhong.wang@starfivetech.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
10 months agoriscv: dts: jh7110: Add ethernet device tree nodes
Yanhong Wang [Thu, 15 Jun 2023 09:36:44 +0000 (17:36 +0800)]
riscv: dts: jh7110: Add ethernet device tree nodes

Add ethernet device tree node to support StarFive ethernet driver for
the JH7110 RISC-V SoC.

Signed-off-by: Yanhong Wang <yanhong.wang@starfivetech.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
10 months agonet: dwc_eth_qos: Add StarFive ethernet driver glue layer
Yanhong Wang [Thu, 15 Jun 2023 09:36:43 +0000 (17:36 +0800)]
net: dwc_eth_qos: Add StarFive ethernet driver glue layer

The StarFive ETHQOS hardware has its own clock and reset,so add a
corresponding glue driver to configure them.

Signed-off-by: Yanhong Wang <yanhong.wang@starfivetech.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
10 months agonet: phy: Add driver for Motorcomm yt8531 gigabit ethernet phy
Yanhong Wang [Thu, 15 Jun 2023 09:36:42 +0000 (17:36 +0800)]
net: phy: Add driver for Motorcomm yt8531 gigabit ethernet phy

Add a driver for the motorcomm yt8531 gigabit ethernet phy. We have
verified the driver on StarFive VisionFive2 board.

Signed-off-by: Yanhong Wang <yanhong.wang@starfivetech.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
10 months agoMerge tag 'efi-2023-07-rc7' of https://source.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Tue, 11 Jul 2023 17:27:32 +0000 (13:27 -0400)]
Merge tag 'efi-2023-07-rc7' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request efi-2023-07-rc7

Documentation:

* Fix links to Linux kernel documentation

UEFI:

* Fix memory leak in efidebug dh subcommand
* Fix underflow when calculating remaining variable store size
* Increase default variable store size to 64 KiB
* mkeficapsule: fix efi_firmware_management_capsule_header data type

10 months agoMakefile: Drop -rc6
Tom Rini [Tue, 11 Jul 2023 13:55:53 +0000 (09:55 -0400)]
Makefile: Drop -rc6

When tagging and releasing v2023.07 I forgot to drop the -rc6 tag. For
regular use, I've made a v2023.07.01 tag, but for here we can just drop
the -rc6 tag.

Signed-off-by: Tom Rini <trini@konsulko.com>
10 months agoMerge branch 'next'
Tom Rini [Mon, 10 Jul 2023 18:29:14 +0000 (14:29 -0400)]
Merge branch 'next'

10 months agoPrepare v2023.07 v2023.07
Tom Rini [Mon, 10 Jul 2023 18:13:47 +0000 (14:13 -0400)]
Prepare v2023.07

Signed-off-by: Tom Rini <trini@konsulko.com>
10 months agoMerge tag 'fsl-qoriq-2023-7-6' of https://source.denx.de/u-boot/custodians/u-boot...
Tom Rini [Mon, 10 Jul 2023 01:54:40 +0000 (21:54 -0400)]
Merge tag 'fsl-qoriq-2023-7-6' of https://source.denx.de/u-boot/custodians/u-boot-fsl-qoriq into next

Enable DM Serial for ls1043ardb and ls1046ardb/afrwy
Fixed secure boot on LS-CH2 platforms

10 months agomkeficapsule: fix efi_firmware_management_capsule_header data type
Malte Schmidt [Fri, 16 Jun 2023 08:28:05 +0000 (10:28 +0200)]
mkeficapsule: fix efi_firmware_management_capsule_header data type

The data type of item_offset_list shall be UINT64 according to the UEFI [1]
specifications.

In include/efi_api.h the correct data type is used. The bug was probably
never noticed because of little endianness.

[1] https://uefi.org/specs/UEFI/2.10/index.html

Signed-off-by: Malte Schmidt <malte.schmidt@weidmueller.com>
Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
10 months agodoc: harmonize Linux kernel documentation links
Heinrich Schuchardt [Sun, 9 Jul 2023 02:00:06 +0000 (04:00 +0200)]
doc: harmonize Linux kernel documentation links

Linux internally uses https://www.kernel.org/doc/html/latest/ for
documentation links. When referring to their documentation we should do the
same.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
10 months agocmd: efidebug: add missing efi_free_pool for dh subcommand
Masahisa Kojima [Thu, 29 Jun 2023 02:13:51 +0000 (11:13 +0900)]
cmd: efidebug: add missing efi_free_pool for dh subcommand

This adds the missing efi_free_pool call for dh subcommand.

Fixes: a80146205d0a ("cmd: efidebug: add dh command")
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>
10 months agoefi_loader: Increase default variable store size to 64KiB
Alper Nebi Yasak [Sat, 8 Jul 2023 15:21:12 +0000 (18:21 +0300)]
efi_loader: Increase default variable store size to 64KiB

Debian's arm64 UEFI Secure Boot shim makes the EFI variable store run
out of space while mirroring its MOK database to variables. This can be
observed in QEMU like so:

  $ tools/buildman/buildman -o build/qemu_arm64 --boards=qemu_arm64 -w
  $ cd build/qemu_arm64
  $ curl -L -o debian.iso \
      https://cdimage.debian.org/debian-cd/current/arm64/iso-cd/debian-12.0.0-arm64-netinst.iso
  $ qemu-system-aarch64 \
      -nographic -bios u-boot.bin \
      -machine virt -cpu cortex-a53 -m 1G -smp 2 \
      -drive if=virtio,file=debian.iso,index=0,format=raw,readonly=on,media=cdrom
  [...]
  => # interrupt autoboot
  => env set -e -bs -nv -rt -guid 605dab50-e046-4300-abb6-3dd810dd8b23 SHIM_VERBOSE 1
  => boot
  [...]
  mok.c:296:mirror_one_esl() SetVariable("MokListXRT43", ... varsz=0x4C) = Out of Resources
  mok.c:452:mirror_mok_db() esd:0x7DB92D20 adj:0x30
  Failed to set MokListXRT: Out of Resources
  mok.c:767:mirror_one_mok_variable() mirror_mok_db("MokListXRT",  datasz=17328) returned Out of Resources
  mok.c:812:mirror_one_mok_variable() returning Out of Resources
  Could not create MokListXRT: Out of Resources
  [...]
  Welcome to GRUB!

This would normally be fine as shim would continue to run grubaa64.efi,
but shim's error handling code for this case has a bug [1] that causes a
synchronous abort on at least chromebook_kevin (but apparently not on
QEMU arm64).

Double the default variable store size so the variables fit. There is a
note about this value matching PcdFlashNvStorageVariableSize when
EFI_MM_COMM_TEE is enabled, so keep the old default in that case.

[1] https://github.com/rhboot/shim/pull/577

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
10 months agoefi_loader: Avoid underflow when calculating remaining var store size
Alper Nebi Yasak [Sat, 8 Jul 2023 15:23:05 +0000 (18:23 +0300)]
efi_loader: Avoid underflow when calculating remaining var store size

The efi_var_mem_free() function calculates the available size for a new
EFI variable by subtracting the occupied buffer size and the overhead
for a new variable from the maximum buffer size set in Kconfig. This
is then returned as QueryVariableInfo()'s RemainingVariableStorageSize
output.

This can underflow as the calculation is done in and processed as
unsigned integer types. Check for underflow before doing the subtraction
and return zero if there's no space.

Fixes: f1f990a8c958 ("efi_loader: memory buffer for variables")
Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
10 months agox86: Update docs link in bootparam header
Paul Barker [Fri, 7 Jul 2023 06:51:42 +0000 (07:51 +0100)]
x86: Update docs link in bootparam header

After Linux commit ff61f0791ce9, x86 documentation was moved to
arch/x86 and the link in bootparam.h was broken.

Signed-off-by: Paul Barker <paul.barker.ct@bp.renesas.com>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
10 months agoMerge branch '2023-07-07-assorted-build-improvements' into next
Tom Rini [Sat, 8 Jul 2023 15:28:39 +0000 (11:28 -0400)]
Merge branch '2023-07-07-assorted-build-improvements' into next

- Correct a few dependencies in Kconfig and better handle some generated
  files so that they are properly cleaned later.

11 months agosysreset: Change Kconfig GPIO dependency
Michal Simek [Tue, 4 Jul 2023 12:05:13 +0000 (14:05 +0200)]
sysreset: Change Kconfig GPIO dependency

DM_GPIO depends on GPIO to be enabled but select will cause that DM_GPIO is
selected without GPIO which ends up in compilation error:
undefined reference to `dm_gpio_set_value'
undefined reference to `dm_gpio_get_value'
undefined reference to `dm_gpio_free'
undefined reference to `gpio_request_by_name'

Signed-off-by: Michal Simek <michal.simek@amd.com>
[trini: Fix configs which had relied on these select's]
Signed-off-by: Tom Rini <trini@konsulko.com>
11 months agotpl: Kconfig: TPL_BANNER_PRINT depends on DEBUG_UART && TPL_SERIAL
Ying Sun [Sun, 25 Jun 2023 09:18:21 +0000 (17:18 +0800)]
tpl: Kconfig: TPL_BANNER_PRINT depends on DEBUG_UART && TPL_SERIAL

As implemented in the arch/arm/mach-rockchip/tpl.c file,
the CONFIG_TPL_BANNER_PRINT option will not work
if either of these options is not enabled.

Add dependency constraints to the CONFIG_TPL_BANNER_PRINT option
definition to prevent configuration problems
where option is enabled but do not take effect.

Suggested-by: Yanjie Ren <renyanjie01@gmail.com>
Signed-off-by: Ying Sun <sunying@nj.iscas.ac.cn>
11 months agocommon: Kconfig: SYS_CONSOLE_ENV_OVERWRITE depends on SYS_CONSOLE_IS_IN_ENV
Ying Sun [Sun, 25 Jun 2023 08:52:07 +0000 (16:52 +0800)]
common: Kconfig: SYS_CONSOLE_ENV_OVERWRITE depends on SYS_CONSOLE_IS_IN_ENV

CONFIG_SYS_CONSOLE_ENV_OVERWRITE is implemented in common/console.c
when "#if CONFIG_IS_ENABLED(SYS_CONSOLE_IS_IN_ENV)" is met.

It is recommended to add dependency constraints to its definition.

Suggested-by: Yanjie Ren <renyanjie01@gmail.com>
Signed-off-by: Ying Sun <sunying@nj.iscas.ac.cn>
11 months agocmd: CONFIG_CMD_SAVES depends on CONFIG_CMD_LOADS
Ying Sun [Sun, 25 Jun 2023 08:24:47 +0000 (16:24 +0800)]
cmd: CONFIG_CMD_SAVES depends on CONFIG_CMD_LOADS

CONFIG_CMD_SAVES is used to enable support for the "saveenv" command
and is only implemented in cmd/load.c
when "#if defined(CONFIG_CMD_LOADS)" is met.

It is recommended to add dependency constraints to its definition.
Prevents "saveenv" command from not being supported
when "CONFIG_CMD_SAVES=y CONFIG_CMD_LOADS=n".

Suggested-by: Yanjie Ren <renyanjie01@gmail.com>
Signed-off-by: Ying Sun <sunying@nj.iscas.ac.cn>
Reviewed-by: Simon Glass <sjg@chromium.org>
11 months agotest: Find leftovers after clean/mrproper
Tobias Deiminger [Mon, 19 Jun 2023 22:41:07 +0000 (00:41 +0200)]
test: Find leftovers after clean/mrproper

Docs describe 'make clean' to delete most generated files, 'make
mrproper' to delete current configuration and all generated files. This
test tries to assert it.

Idea is to search remaining files by patterns in copies of the initial
out-of-source build, which has two advantages:
- looking in an out-of-source build dir allows to tell generated source
  code from committed source code
- copying is fast (compared to rebuilding each time) which allows to do
  a "world clean"

Signed-off-by: Tobias Deiminger <tdmg@linutronix.de>
11 months agoKbuild: Fix cleanup of *.dtbo for sandbox
Tobias Deiminger [Mon, 19 Jun 2023 22:41:06 +0000 (00:41 +0200)]
Kbuild: Fix cleanup of *.dtbo for sandbox

sandbox can generate DT overlays, but they were not cleaned.

Extend the explicit clean-files list accordingly.

Fixes: 95300f203f32 ("pytest: add sandbox test for "extension" command")
Signed-off-by: Tobias Deiminger <tdmg@linutronix.de>
11 months agoKbuild: Fix cleanup of *.dtb for some archs
Tobias Deiminger [Mon, 19 Jun 2023 22:41:05 +0000 (00:41 +0200)]
Kbuild: Fix cleanup of *.dtb for some archs

'make clean' did not descend into arch/$ARCH/dts for arc, m68k, nios2,
sh, xtensa.

Fix it by adding the missing archs to the explicit clean-dirs list.

Signed-off-by: Tobias Deiminger <tdmg@linutronix.de>
11 months agoKbuild: Fix cleanup of VPL
Tobias Deiminger [Mon, 19 Jun 2023 22:41:04 +0000 (00:41 +0200)]
Kbuild: Fix cleanup of VPL

VPL artifacts like example vpl/u-boot-vpl are currently not removed by
'make clean'.

We can clean them just as it's already done for SPL and TPL.

Fixes: f86ca5ad8f78 ("Introduce Verifying Program Loader (VPL)")
Signed-off-by: Tobias Deiminger <tdmg@linutronix.de>
11 months agoAdjust gitignore for tools/generated/
Tobias Deiminger [Mon, 19 Jun 2023 22:41:03 +0000 (00:41 +0200)]
Adjust gitignore for tools/generated/

Tell git that auto-generated C sources are now exclusively expected
under tools/generated/.

Signed-off-by: Tobias Deiminger <tdmg@linutronix.de>
11 months agoKbuild: Fix cleanup of generated sources in tools
Tobias Deiminger [Mon, 19 Jun 2023 22:41:02 +0000 (00:41 +0200)]
Kbuild: Fix cleanup of generated sources in tools

On 'make clean', generated C files in tools/env/ and tools/boot/ are
currently not removed, but they should.

Auto-generation for shared sources was first introduced with
ad80c4a3220b ("kbuild, tools: generate wrapper C sources automatically
by Makefile"). Cleanup later regressed (see Fixes:), because shared
files were moved out of lib/ and common/, but 'clean-dirs := lib common'
was not adjusted accordingly. Further, the generated
tools/env/embedded.c became a sibling to project files, which prevents
directory-wise cleanup at all.

To solve it, we establishe tools/generated/ as the sole place for
generated sources. Wrappers are now generated as
tools/generated/<orig_dirname>/<orig_filename>, and 'make clean' can
remove tools/generated/ as a whole (Linux Makefile.asm-generic headers
are cleaned similarly). This way we don't have to maintain separate
clean-files or clean-dirs entries for each single added or moved wrapper
file.

Fixes: 0649cd0d4908 ("Move environment files from common/ to env/")
Fixes: 19a91f2464a8 ("Create a new boot/ directory")
Signed-off-by: Tobias Deiminger <tdmg@linutronix.de>
[trini: Correct mkfwupdate case]
Signed-off-by: Tom Rini <trini@konsulko.com>
11 months agoMAINTAINERS: correct at91 tree link
Eugen Hristev [Fri, 7 Jul 2023 13:45:32 +0000 (16:45 +0300)]
MAINTAINERS: correct at91 tree link

This was not done when the tree name was changed, fix it now.

Signed-off-by: Eugen Hristev <eugen.hristev@collabora.com>
11 months agoMerge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-usb into...
Tom Rini [Thu, 6 Jul 2023 17:23:36 +0000 (13:23 -0400)]
Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-usb into next

11 months agoMerge branch 'riscv-for-next' of https://source.denx.de/u-boot/custodians/u-boot...
Tom Rini [Thu, 6 Jul 2023 17:21:37 +0000 (13:21 -0400)]
Merge branch 'riscv-for-next' of https://source.denx.de/u-boot/custodians/u-boot-riscv into next

- RISC-V CI OpenSBI version update
- Andes ae350 board modification
- Sync PolarFire SoC dts with Linux
- Support building ubifs

11 months agoboard: ae350: Add missing env variables for booti
Yu Chien Peter Lin [Tue, 4 Jul 2023 11:13:21 +0000 (19:13 +0800)]
board: ae350: Add missing env variables for booti

The 'booti' command is unable to boot Image.gz due to the absence
of required environment variables 'kernel_comp_addr_r' and
'kernel_comp_size'.

This commit adds these variables and reorganizes the memory layout
to prevent any overlap between binaries and files.

Signed-off-by: Yu Chien Peter Lin <peterlin@andestech.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
11 months agoriscv: andes_plicsw: Fix IPI during OpenSBI invocation
Yu Chien Peter Lin [Tue, 4 Jul 2023 11:13:20 +0000 (19:13 +0800)]
riscv: andes_plicsw: Fix IPI during OpenSBI invocation

On some AE350 boards, we need to explicitly initialize the priority
registers to a non-zero value so the boot hart can instruct secondary
harts to jump to OpenSBI.

This patch also updates the information about PLICSW.

Signed-off-by: Yu Chien Peter Lin <peterlin@andestech.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
11 months agoRISC-V: CONFIG_SPL_OPENSBI_SCRATCH_OPTIONS description
Heinrich Schuchardt [Tue, 4 Jul 2023 00:14:21 +0000 (02:14 +0200)]
RISC-V: CONFIG_SPL_OPENSBI_SCRATCH_OPTIONS description

Describe which numeric values can be used for as scratch options for
OpenSBI.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
11 months agoclk: starfive: pll: Fix to use postdiv1_mask
Hoegeun Kwon [Wed, 28 Jun 2023 10:19:49 +0000 (19:19 +0900)]
clk: starfive: pll: Fix to use postdiv1_mask

There is a problem that the rates of PLL0 and PLL1 are set incorrectly
because the postdiv1_mask value is incorrectly entered when setting
the pll clk reg. Modify postdiv1's mask value to be put correctly.

Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
Reviewed-by: Minkyu Kang <mk7.kang@samsung.com>
11 months agoci: riscv: Update OpenSBI to v1.2
Bin Meng [Tue, 20 Jun 2023 05:55:00 +0000 (13:55 +0800)]
ci: riscv: Update OpenSBI to v1.2

Use the latest OpenSBI v1.2 release binaries for the RISC-V CI.

Signed-off-by: Bin Meng <bmeng@tinylab.org>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
11 months agoboard: microchip: set mac address for ethernet1 on icicle
Conor Dooley [Thu, 15 Jun 2023 10:12:44 +0000 (11:12 +0100)]
board: microchip: set mac address for ethernet1 on icicle

The dts sync from Linux leaves mac0/ethernet1 enabled on icicle, but
U-Boot does not currently set a mac address for it. Expand on the code
which currently sets the mac for mac1/ethernet0 to optionally set the
mac address for the second ethernet.

Reviewed-by: Padmarao Begari <padmarao.begari@microchip.com>
Tested-by: Padmarao Begari <padmarao.begari@microchip.com>
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
11 months agoriscv: dts: sync mpfs-icicle devicetree with linux
Conor Dooley [Thu, 15 Jun 2023 10:12:43 +0000 (11:12 +0100)]
riscv: dts: sync mpfs-icicle devicetree with linux

The "notable" disappearances are:
- the pac193x stanza - there's nothing in mainline linux w.r.t. bindings
  for this & what is going to appear in mainline linux is going to be
  incompatible with what is currently in U-Boot.
- operating points - these operating points should not be set at the
  soc.dtsi level as they may not be possible depending on the design
  programmed to the FPGA
- clock output names - there are defines for the clock indices, these
  should not be needed
- the dt maintainers in linux NAKed using defines for IRQ numbers
- the qspi nand, which is not part of the icicle's default configuration
  is removed.

Reviewed-by: Padmarao Begari <padmarao.begari@microchip.com>
Tested-by: Padmarao Begari <padmarao.begari@microchip.com>
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
Reviewed-by: Rick Chen <rick@andestech.com>
11 months agoriscv: dts: drop microchip from dts filenames
Conor Dooley [Thu, 15 Jun 2023 10:12:42 +0000 (11:12 +0100)]
riscv: dts: drop microchip from dts filenames

The original names picked for the DT doesn't match Linux's naming scheme
and it was renamed there a while ago. Rename it in U-Boot to allow
easily syncing dts between the two projects.

Reviewed-by: Rick Chen <rick@andestech.com>
Reviewed-by: Padmarao Begari <padmarao.begari@microchip.com>
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
11 months agoclk: sifive: only build sifive-prci.o for CONFIG_CLK_SIFIVE_PRCI
Ben Dooks [Tue, 9 May 2023 13:50:05 +0000 (14:50 +0100)]
clk: sifive: only build sifive-prci.o for CONFIG_CLK_SIFIVE_PRCI

If we're building non FU540/FU740 SoC drivers, then the sifive-prci.o
is not needed. Only build this when CONFIG_CLK_SIFIVE_PRCI is selected.

Signed-off-by: Ben Dooks <ben.dooks@sifive.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
11 months agoriscv: define test_and_{set,clear}_bit in asm/bitops.h
Ben Dooks [Fri, 5 May 2023 08:02:07 +0000 (09:02 +0100)]
riscv: define test_and_{set,clear}_bit in asm/bitops.h

These seem to be missing, and trying to build ubifs without them
is causing errors due to these being missing.

Signed-off-by: Ben Dooks <ben.dooks@sifive.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
11 months agoriscv: implement local_irq_{save,restore} macros
Ben Dooks [Fri, 5 May 2023 08:02:06 +0000 (09:02 +0100)]
riscv: implement local_irq_{save,restore} macros

Add implementations of the local_irq_{save,restore} macros so that
<asm/atomic.h> can be used with riscv.

Signed-off-by: Ben Dooks <ben.dooks@sifive.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
11 months agoriscv: add generic link for <asm/atomic.h>
Ben Dooks [Fri, 5 May 2023 08:02:05 +0000 (09:02 +0100)]
riscv: add generic link for <asm/atomic.h>

Add a link from <asm/atomic.h> to the generic one to allow
things like ubifs to be built. This can be extended with
riscv AMO ops at a later date.

Signed-off-by: Ben Dooks <ben.dooks@sifive.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
11 months agocmd/sbi: display new extensions
Heinrich Schuchardt [Wed, 12 Apr 2023 08:38:16 +0000 (10:38 +0200)]
cmd/sbi: display new extensions

OpenSBI already implements some extensions that are not ratified yet:

* Debug Console Extension (DBCN)
* System Suspend Extension (SUSP)
* Collaborative Processor Performance Control Extension (CPPC)

Allow the sbi command to display these.

Provide the FID definitions of the Debug Console Extension. We can use that
extension for an early debug console driver.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
11 months agoLFU-544: Kconfig.nxp: Fixed secure boot on LS-CH2 platforms
Kshitiz Varshney [Thu, 22 Jun 2023 09:24:45 +0000 (11:24 +0200)]
LFU-544: Kconfig.nxp: Fixed secure boot on LS-CH2 platforms

pimg64 image pointer is dependent on ESBC_ADDR_64BIT config, which is
getting disabled, due to dependency on ESBC_HDR_LS.
ESBC_HDR_LS is required for LS-CH3 platforms.
So, removing the dependency on ESBC_HDR_LS.

Signed-off-by: Kshitiz Varshney <kshitiz.varshney@nxp.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Gaurav Jain <gaurav.jain@nxp.com>
11 months agoconfigs: ls1046afrwy: enable DM_SERIAL
Camelia Groza [Fri, 16 Jun 2023 13:18:38 +0000 (16:18 +0300)]
configs: ls1046afrwy: enable DM_SERIAL

As the serial devices are configured in the device tree, enable
DM_SERIAL in the ls1046afrwy defconfigs.

Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
11 months agoconfigs: ls1046ardb: enable DM_SERIAL
Camelia Groza [Fri, 16 Jun 2023 13:18:37 +0000 (16:18 +0300)]
configs: ls1046ardb: enable DM_SERIAL

As the serial devices are configured in the device tree, enable
DM_SERIAL in the ls1046ardb defconfigs.

Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
11 months agoarch: arm: dts: ls1046a: tag serial nodes with bootph-all
Camelia Groza [Fri, 16 Jun 2023 13:18:36 +0000 (16:18 +0300)]
arch: arm: dts: ls1046a: tag serial nodes with bootph-all

Make sure the serial driver is initialized before relocation by tagging
the serial nodes with "bootph-all".

In order to keep the serial nodes in sync with their representation in
the Linux dts, add these u-boot specific properties to *-u-boot.dtsi
files.

Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
11 months agoarch: arm: dts: ls1046a: sync serial nodes with Linux
Camelia Groza [Fri, 16 Jun 2023 13:18:35 +0000 (16:18 +0300)]
arch: arm: dts: ls1046a: sync serial nodes with Linux

Pick up the serial node descriptions from Linux v6.3 for the ls1046ardb
and ls1046afrwy boards and their dependencies. Including the
fsl,qoriq-clockgen.h and arm-gic.h headers forces us to change the include
directives to explicitly go through the C preprocessor for all boards in
the ls1046a SoC family.

Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
11 months agoconfigs: ls1043ardb: enable DM_SERIAL
Camelia Groza [Fri, 16 Jun 2023 13:18:34 +0000 (16:18 +0300)]
configs: ls1043ardb: enable DM_SERIAL

As the serial devices are configured in the device tree, enable
DM_SERIAL in the ls1043ardb defconfigs.

Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
11 months agoarch: arm: dts: ls1043a: tag serial nodes with bootph-all
Camelia Groza [Fri, 16 Jun 2023 13:18:33 +0000 (16:18 +0300)]
arch: arm: dts: ls1043a: tag serial nodes with bootph-all

Make sure the serial driver is initialized before relocation by tagging
the serial nodes with "bootph-all".

In order to keep the serial nodes in sync with their representation in
the Linux dts, add these u-boot specific properties to *-u-boot.dtsi
files.

Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
11 months agoarch: arm: dts: ls1043a: sync serial nodes with Linux
Camelia Groza [Fri, 16 Jun 2023 13:18:32 +0000 (16:18 +0300)]
arch: arm: dts: ls1043a: sync serial nodes with Linux

Pick up the serial node descriptions from Linux v6.3 for the ls1043ardb
board and its dependencies. Including the fsl,qoriq-clockgen.h and
arm-gic.h headers forces us to change the include directives to explicitly
go through the C preprocessor for all boards in the ls1043a SoC family.

Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
11 months agotools: spkgimage: correct printf specifier
Heinrich Schuchardt [Tue, 4 Jul 2023 20:18:09 +0000 (22:18 +0200)]
tools: spkgimage: correct printf specifier

Compiling on armv7 results in:

tools/renesas_spkgimage.c: In function ‘spkgimage_parse_config_line’:
tools/renesas_spkgimage.c:76:66: warning: format ‘%ld’ expects
argument of type ‘long int’, but argument 3 has type ‘size_t’
{aka ‘unsigned int’} [-Wformat=]
   76 |         "config error: unknown keyword on line %ld\n",
      |                                                ~~^
      |                                                  |
      |                                                  long int
      |                                                %d
   77 |         line_num);
      |         ~~~~~~~~
      |         |
      |         size_t {aka unsigned int}

The correct printf specifier for size_t is '%zu'.

Fixes: afdfcb11f97c ("tools: spkgimage: add Renesas SPKG format")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
11 months agoMerge tag 'v2023.07-rc6' into next
Tom Rini [Wed, 5 Jul 2023 15:28:55 +0000 (11:28 -0400)]
Merge tag 'v2023.07-rc6' into next

Prepare v2023.07-rc6

11 months agocolibri-imx7: Call fdt_increase_size()
Fabio Estevam [Tue, 4 Jul 2023 17:09:45 +0000 (14:09 -0300)]
colibri-imx7: Call fdt_increase_size()

For changing the USB OTG node status from "okay" to "disabled" more
space is needed, so call fdt_increase_size() to avoid the following
error:

```
 U-Boot 2023.07-rc5-0.0.0-devel+git.580eb31199be (Jun 27 2023 - 13:39:58 +0000)
 CPU:   Freescale i.MX7S rev1.2 800 MHz (running at 792 MHz)
 CPU:   Extended Commercial temperature grade (-20C to 105C) at 30C
 Reset cause: POR
 DRAM:  initcall sequence 8786eafc failed at call 8781b351 (err=-3)
 ### ERROR ### Please RESET the board ###
```

Ideally, fdt_status_disabled() should call fdt_increase_size() internally,
so that there would be no need for manually calling it in board code.

Do it manually for now to fix the regression.

Based on the code from board/CZ.NIC/turris_omnia/turris_omnia.c.

Reported-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Signed-off-by: Fabio Estevam <festevam@denx.de>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Tested-by: Francesco Dolcini <francesco.dolcini@toradex.com> # Toradex Colibri iMX7S
11 months agogit-mailrc: add alias for Eugen Hristev
Eugen Hristev [Tue, 4 Jul 2023 11:25:36 +0000 (14:25 +0300)]
git-mailrc: add alias for Eugen Hristev

add my patchwork alias

Signed-off-by: Eugen Hristev <eugen.hristev@collabora.com>
11 months agoMerge branch 'next' of https://source.denx.de/u-boot/custodians/u-boot-pmic into...
Tom Rini [Tue, 4 Jul 2023 15:22:57 +0000 (11:22 -0400)]
Merge branch 'next' of https://source.denx.de/u-boot/custodians/u-boot-pmic into next

11 months agoregulator: handle different error codes in regulator_set_enable_if_allowed
Eugen Hristev [Wed, 19 Apr 2023 13:45:26 +0000 (16:45 +0300)]
regulator: handle different error codes in regulator_set_enable_if_allowed

The regulator core can return different codes which are not considered
a real error for this function.
Return success in such cases.

Signed-off-by: Eugen Hristev <eugen.hristev@collabora.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
11 months agoregulator: rename dev_pdata to plat
Eugen Hristev [Wed, 19 Apr 2023 13:45:25 +0000 (16:45 +0300)]
regulator: rename dev_pdata to plat

Simplify the subsystem by renaming `dev_pdata` to just `plat`.
No functional change, just trivial renaming.

Suggested-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Eugen Hristev <eugen.hristev@collabora.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
11 months agoregulator: implement basic reference counter
Eugen Hristev [Wed, 19 Apr 2023 13:45:24 +0000 (16:45 +0300)]
regulator: implement basic reference counter

Some devices share a regulator supply, when the first one will request
regulator disable, the second device will have it's supply cut off before
graciously shutting down. Hence there will be timeouts and other failed
operations.
Implement a reference counter mechanism similar with what is done in
Linux, to keep track of enable and disable requests, and only disable the
regulator when the last of the consumers has requested shutdown.

Signed-off-by: Eugen Hristev <eugen.hristev@collabora.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
11 months agoPrepare v2023.07-rc6
Tom Rini [Mon, 3 Jul 2023 17:48:58 +0000 (13:48 -0400)]
Prepare v2023.07-rc6

Signed-off-by: Tom Rini <trini@konsulko.com>
11 months agospl: spl_legacy: Fix spl_end address
Fabio Estevam [Sat, 1 Jul 2023 02:30:53 +0000 (23:30 -0300)]
spl: spl_legacy: Fix spl_end address

Currently, spl_end points to the __bss_end address, which
is an external RAM address instead of the end of the SPL text
section in the internal RAM.

This causes boot failures on imx6-colibri, for example:

```
Trying to boot from MMC1
SPL: Image overlaps SPL
resetting ...
```
Fix this problem by assigning spl_end to _image_binary_end, as this
symbol properly represents the end of the SPL text section.

From u-boot-spl.map:

.end
 *(.__end)
                0x00000000009121a4                _image_binary_end = .

Fixes: 77aed22b48ab ("spl: spl_legacy: Add extra address checks")
Reported-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Signed-off-by: Fabio Estevam <festevam@denx.de>
Tested-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Marek Vasut <marex@denx.de>
Tested-by: Marek Vasut <marex@denx.de> # DH i.MX6Q DHCOM PDK2
11 months agomicroblaze: u-boot-spl.lds: Pass _image_binary_end
Fabio Estevam [Sat, 1 Jul 2023 02:30:52 +0000 (23:30 -0300)]
microblaze: u-boot-spl.lds: Pass _image_binary_end

Pass _image_binary_end to make a standard way to indicate the end
of the text section in SPL.

The motivation for this is to have a uniform way to handle
the SPL boundary checks.

Signed-off-by: Fabio Estevam <festevam@denx.de>
Reviewed-by: Marek Vasut <marex@denx.de>
11 months agosunxi: u-boot-spl.lds: Pass _image_binary_end
Fabio Estevam [Sat, 1 Jul 2023 02:30:51 +0000 (23:30 -0300)]
sunxi: u-boot-spl.lds: Pass _image_binary_end

Pass _image_binary_end to make a standard way to indicate the end
of the text section in SPL.

The motivation for this is to have a uniform way to handle
the SPL boundary checks.

Signed-off-by: Fabio Estevam <festevam@denx.de>
Reviewed-by: Marek Vasut <marex@denx.de>
11 months agodoc: imx: habv4: Fix typo in 'signing'
Fabio Estevam [Thu, 29 Jun 2023 19:25:31 +0000 (16:25 -0300)]
doc: imx: habv4: Fix typo in 'signing'

Fix two occurrences where 'signing' is misspelled.

Signed-off-by: Fabio Estevam <festevam@denx.de>
Reviewed-by: Tim Harvey <tharvey@gateworks.com>
11 months agorockchip: Restore support for boot scripts in legacy image format
Jonas Karlman [Mon, 26 Jun 2023 19:43:06 +0000 (19:43 +0000)]
rockchip: Restore support for boot scripts in legacy image format

Use of CONFIG_SPL_FIT_SIGNATURE=y cause CONFIG_LEGACY_IMAGE_FORMAT=n as
default, this prevent boot scripts in legacy image format from working
and was an unintended change in the listed fixes commits:

  Wrong image format for "source" command

Add CONFIG_LEGACY_IMAGE_FORMAT=y to defconfig for affected boards to
restore support for boot scripts in legacy image format.

Fixes: 3bf8e4080763 ("board: rockchip: add Radxa ROCK5B Rk3588 board")
Fixes: cf777572ca31 ("rockchip: rockpro64: Use SDMA to boost eMMC performance")
Fixes: 6e2b8344d60c ("rockchip: rock-pi-4: Use SDMA to boost eMMC performance")
Fixes: 1bf49d5a4a7c ("rockchip: rk3566-radxa-cm3-io: Update defconfig")
Fixes: 703c170b40f2 ("rockchip: rk3568-evb: Update defconfig")
Fixes: 68000f750acd ("rockchip: rk3568-rock-3a: Update defconfig")
Fixes: 6fb02589a608 ("rockchip: rk3588-evb: Update defconfig")
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
11 months agousb: dwc3-generic: Ensure reset GPIO is configured as an output
Peter Korsgaard [Wed, 28 Jun 2023 12:26:48 +0000 (14:26 +0200)]
usb: dwc3-generic: Ensure reset GPIO is configured as an output

GPIOD_ACTIVE_LOW is not enough to configure a GPIO as an output, we need
GPIOD_IS_OUT as well.

Fixes: b252d79b0936d60b ("usb: dwc3: Add support to reset usb ULPI phy")
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
11 months agoMerge tag 'efi-2023-07-rc6' of https://source.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Sat, 1 Jul 2023 20:11:51 +0000 (16:11 -0400)]
Merge tag 'efi-2023-07-rc6' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request efi-2023-07-rc6

Documentation:

* man-pages for the loads and saves commands

UEFI:

* fix implementation of allow_unaligned() for armv7 and arm11

11 months agoARM: arm11: Add C wrapper for allow_unaligned()
Marek Vasut [Sat, 1 Jul 2023 15:26:19 +0000 (17:26 +0200)]
ARM: arm11: Add C wrapper for allow_unaligned()

Rename current assembler implementation of allow_unaligned() to
arm11_arch_cp15_allow_unaligned() and add it into arm11.h header,
then add C wrapper of allow_unaligned().

This fixes misbehavior when linking U-Boot, where the CPU specific
allow_unaligned() implementation was ignored and instead the
__weak allow_unaligned() implementation from lib/efi_loader/efi_setup.c
was used, which led to "data abort" just before booting Linux via tftp,
in efi_dp_from_file() -> path_to_uefi() -> utf16_put() .

The problem is triggerd by c7c0ca37673 ("efi_loader: fix efi_dp_from_file()") .
Adding the wrapper fixes the problem.

Fixes: d47a774680d ("arm: arm11: allow unaligned memory access")
Signed-off-by: Marek Vasut <marex@denx.de>
11 months agoARM: armv7: Add C wrapper for allow_unaligned()
Marek Vasut [Sat, 1 Jul 2023 15:26:18 +0000 (17:26 +0200)]
ARM: armv7: Add C wrapper for allow_unaligned()

Rename current assembler implementation of allow_unaligned() to
v7_arch_cp15_allow_unaligned() and add it into armv7.h header,
then add C wrapper of allow_unaligned().

This fixes misbehavior when linking U-Boot on ARMv7a i.MX6Q, where the
CPU specific allow_unaligned() implementation was ignored and instead the
__weak allow_unaligned() implementation from lib/efi_loader/efi_setup.c
was used, which led to "data abort" just before booting Linux via tftp,
in efi_dp_from_file() -> path_to_uefi() -> utf16_put() .

The problem is triggerd by c7c0ca37673 ("efi_loader: fix efi_dp_from_file()") .
Adding the wrapper fixes the problem.

Fixes: 78f90aaeecc ("arm: armv7: allow unaligned memory access")
Signed-off-by: Marek Vasut <marex@denx.de>
11 months agodoc: fix typo loady in loadb man-page
Heinrich Schuchardt [Sun, 25 Jun 2023 21:22:44 +0000 (23:22 +0200)]
doc: fix typo loady in loadb man-page

%s/loady/loadb/

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
11 months agodoc: saves man-page
Heinrich Schuchardt [Sun, 25 Jun 2023 13:14:03 +0000 (15:14 +0200)]
doc: saves man-page

Provide a man-page for the saves command.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
11 months agodoc: loads man-page
Heinrich Schuchardt [Sun, 25 Jun 2023 11:40:23 +0000 (13:40 +0200)]
doc: loads man-page

Provide a man-page for the loads command.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
11 months agosmegw01: Fix wrong symbol override
Eduard Strehlau [Tue, 27 Jun 2023 16:57:49 +0000 (13:57 -0300)]
smegw01: Fix wrong symbol override

board_mmc_get_env_part() is not called as the default implementation
of mmc_get_env_part() is used.

Fix this problem by directly calling mmc_get_env_part() instead.

Signed-off-by: Eduard Strehlau <eduard@lionizers.com>
Signed-off-by: Fabio Estevam <festevam@denx.de>
11 months agoCI: Azure: Split keymile jobs out
Tom Rini [Mon, 26 Jun 2023 19:19:54 +0000 (15:19 -0400)]
CI: Azure: Split keymile jobs out

Currently the PowerPC build job in Azure will hit the maximum time limit
for a build and stop. Looking at the job, the easiest path to reducing
it is to move Keymile vendor boards to their own job and exclude them
from the PowerPC one (and while at this, the ls102 job).

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Heiko Schocher <hs@denx.de>