pandora-u-boot.git
3 months agonet: miiphybb: Drop bb_miiphy_alloc()/bb_miiphy_free() and struct bb_miiphy_bus
Marek Vasut [Sun, 2 Mar 2025 01:24:51 +0000 (02:24 +0100)]
net: miiphybb: Drop bb_miiphy_alloc()/bb_miiphy_free() and struct bb_miiphy_bus

These functions are no longer necessary, remove them.
The struct bb_miiphy_bus is no longer necessary either,
remove it as well.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Paul Barker <paul.barker.ct@bp.renesas.com>
3 months agoarm: mvebu: a38x: Switch back to mdio_alloc()
Marek Vasut [Sun, 2 Mar 2025 01:24:50 +0000 (02:24 +0100)]
arm: mvebu: a38x: Switch back to mdio_alloc()

Use mdio_alloc() again to allocate MDIO bus. This is possible
because all the miiphybb parameters and ops passing is handled in
at bb_miiphy_read()/bb_miiphy_write() level.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Paul Barker <paul.barker.ct@bp.renesas.com>
3 months agonet: sh_eth: Switch back to mdio_alloc()
Marek Vasut [Sun, 2 Mar 2025 01:24:49 +0000 (02:24 +0100)]
net: sh_eth: Switch back to mdio_alloc()

Use mdio_alloc() again to allocate MDIO bus. This is possible
because all the miiphybb parameters and ops passing is handled in
at bb_miiphy_read()/bb_miiphy_write() level.

This also fixes previously missed bb_miiphy_free() in .remove
callback of this driver. which does not pose a problem anymore.

Fixes: 08eefb5e792d ("net: sh_eth: Allocate bb_miiphy using bb_miiphy_alloc() and fill in callbacks")
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Paul Barker <paul.barker.ct@bp.renesas.com>
3 months agonet: ravb: Switch back to mdio_alloc()
Marek Vasut [Sun, 2 Mar 2025 01:24:48 +0000 (02:24 +0100)]
net: ravb: Switch back to mdio_alloc()

Use mdio_alloc() again to allocate MDIO bus. This is possible
because all the miiphybb parameters and ops passing is handled in
at bb_miiphy_read()/bb_miiphy_write() level.

This also fixes previously missed bb_miiphy_free() in .remove
callback of this driver. which does not pose a problem anymore.

Fixes: 079eaca6e7b4 ("net: ravb: Allocate bb_miiphy using bb_miiphy_alloc() and fill in callbacks")
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Paul Barker <paul.barker.ct@bp.renesas.com>
3 months agonet: designware: Switch back to mdio_alloc()
Marek Vasut [Sun, 2 Mar 2025 01:24:47 +0000 (02:24 +0100)]
net: designware: Switch back to mdio_alloc()

Use mdio_alloc() again to allocate MDIO bus. This is possible
because all the miiphybb parameters and ops passing is handled in
at bb_miiphy_read()/bb_miiphy_write() level.

This also fixes previously missed bb_miiphy_free() in .remove
callback of this driver. which does not pose a problem anymore.

Fixes: cbb69c2fafcc ("net: designware: Allocate bb_miiphy using bb_miiphy_alloc() and fill in callbacks")
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Paul Barker <paul.barker.ct@bp.renesas.com>
3 months agonet: miiphybb: Drop priv from struct bb_miiphy_bus
Marek Vasut [Sun, 2 Mar 2025 01:24:46 +0000 (02:24 +0100)]
net: miiphybb: Drop priv from struct bb_miiphy_bus

Remove the priv member from struct bb_miiphy_bus and its assignment
from drivers. This turns struct bb_miiphy_bus int struct mii_dev
wrapper, to be cleaned up next.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Paul Barker <paul.barker.ct@bp.renesas.com>
3 months agonet: miiphybb: Pass struct mii_dev directly to bb_miiphy_read/write()
Marek Vasut [Sun, 2 Mar 2025 01:24:45 +0000 (02:24 +0100)]
net: miiphybb: Pass struct mii_dev directly to bb_miiphy_read/write()

Access to MDIO bus private data can be provided by both
struct mii_dev .priv member and struct bb_miiphy_bus .priv
member, use the former directly and remove .priv from the
later. Drop unused bb_miiphy_getbus(). This removes any
dependency on struct bb_miiphy_bus from the miiphybb code,
except for helper functions which will be removed later.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Paul Barker <paul.barker.ct@bp.renesas.com>
3 months agonet: miiphybb: Pass struct bb_miiphy_bus_ops directly to bb_miiphy_read/write()
Marek Vasut [Sun, 2 Mar 2025 01:24:44 +0000 (02:24 +0100)]
net: miiphybb: Pass struct bb_miiphy_bus_ops directly to bb_miiphy_read/write()

The access to struct bb_miiphy_bus_ops via ops pointer in
struct bb_miiphy_bus is not necessary with wrappers added
in previous patch. Pass the ops pointer directly to both
bb_miiphy_read() and bb_miiphy_write() functions.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Paul Barker <paul.barker.ct@bp.renesas.com>
3 months agonet: miiphybb: Wrap driver side bb_miiphy_read/write() accessors
Marek Vasut [Sun, 2 Mar 2025 01:24:43 +0000 (02:24 +0100)]
net: miiphybb: Wrap driver side bb_miiphy_read/write() accessors

Do not call bb_miiphy_read()/bb_miiphy_write() accessors directly
in drivers, instead call them through wrapper functions. Those are
meant to be used as function parameter adaptation layer between
struct mii_dev callback function parameters and what the miiphybb
does expect and will soon expect. This is a preparatory patch, no
functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Paul Barker <paul.barker.ct@bp.renesas.com>
3 months agonet: miiphybb: Split off struct bb_miiphy_bus_ops
Marek Vasut [Sun, 2 Mar 2025 01:24:42 +0000 (02:24 +0100)]
net: miiphybb: Split off struct bb_miiphy_bus_ops

Move miiphybb operations into separate struct bb_miiphy_bus_ops
structure, add pointer to struct bb_miiphy_bus_ops into the base
struct bb_miiphy_bus and access the ops through this pointer in
miiphybb generic code. The variable reshuffling in miiphybb.c
cannot be easily avoided.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Paul Barker <paul.barker.ct@bp.renesas.com>
3 months agopinctrl: renesas: Drop special RZN1 entry from Makefile
Marek Vasut [Fri, 28 Feb 2025 12:02:52 +0000 (13:02 +0100)]
pinctrl: renesas: Drop special RZN1 entry from Makefile

The RZN1 symbol name is CONFIG_RZN1, there is no CONFIG_ARCH_RZN1.
Since RZN1 enables CONFIG_ARCH_RENESAS as well, remove the special
RZN1 entry from Makefile, the RZN1 pinctrl driver will still be
pulled in via CONFIG_ARCH_RENESAS.

Fixes: e4aea57fa773 ("pinctrl: renesas: add R906G032 driver")
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Paul Barker <paul.barker.ct@bp.renesas.com>
3 months agoARM: renesas: Enable USBHS UDC and UMS on Renesas R-Car Gen3 Salvator-X(S)
Marek Vasut [Sun, 9 Feb 2025 15:05:16 +0000 (16:05 +0100)]
ARM: renesas: Enable USBHS UDC and UMS on Renesas R-Car Gen3 Salvator-X(S)

The Renesas R-Car Gen3 Salvator-X(S) boards contain USB micro-B port
on which the USBHS controller is accessible. Enable the USBHS UDC
driver to make this port usable, enable UMS USB Mass Storage support
to make it possible to expose block devices as USB Mass Storage to
Host PC.

The USB VID/PID is picked from R-Car Series, 3rd Generation reference
manual Rev.2.00 chapter 19.2.8 USB download mode, and matches R-Car H3
BootROM USB download mode VID/PID.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
3 months agoMerge tag 'v2025.04-rc4' into next
Tom Rini [Tue, 11 Mar 2025 00:12:27 +0000 (18:12 -0600)]
Merge tag 'v2025.04-rc4' into next

This uses Heinrich's merge of lib/efi_loader/efi_net.c which results in
no changes.

3 months agoPrepare v2025.04-rc4 v2025.04-rc4
Tom Rini [Mon, 10 Mar 2025 23:31:52 +0000 (17:31 -0600)]
Prepare v2025.04-rc4

Signed-off-by: Tom Rini <trini@konsulko.com>
3 months agoconfigs: Resync with savedefconfig
Tom Rini [Mon, 10 Mar 2025 23:30:32 +0000 (17:30 -0600)]
configs: Resync with savedefconfig

Resync all defconfig files using qconfig.py

Signed-off-by: Tom Rini <trini@konsulko.com>
3 months agoMerge tag 'u-boot-dfu-next-20250310' of https://source.denx.de/u-boot/custodians...
Tom Rini [Mon, 10 Mar 2025 16:13:03 +0000 (10:13 -0600)]
Merge tag 'u-boot-dfu-next-20250310' of https://source.denx.de/u-boot/custodians/u-boot-dfu into next

u-boot-dfu-next-20250310

CI:
- https://source.denx.de/u-boot/custodians/u-boot-dfu/-/pipelines/25060

Usb gadget:
- Remove legacy CONFIG_USB_DEVICE
- Remove legacy usbtty driver

3 months agoenv: Provide a work-around for unquoting fdtfile
Simon Glass [Wed, 13 Nov 2024 15:09:37 +0000 (08:09 -0700)]
env: Provide a work-around for unquoting fdtfile

Some boards use a CONFIG option to specify the value of this variable.
This is normally handled by efi_get_distro_fdt_name() but in the case
of sunxi this does not work, since 'soc' is sunxi, but the files are
in the allwinner directory.

Provide a work-around for this particular case.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
3 months agoMerge tag 'efi-next-20250310' of https://source.denx.de/u-boot/custodians/u-boot...
Tom Rini [Mon, 10 Mar 2025 13:49:17 +0000 (07:49 -0600)]
Merge tag 'efi-next-20250310' of https://source.denx.de/u-boot/custodians/u-boot-efi into next

Pull request efi-next-20250310

CI:

* https://source.denx.de/u-boot/custodians/u-boot-efi/-/pipelines/25043

UEFI:

* Clean up usage of structure jmp_buf_data
* Refactor EFI network protocol implementation for future support
  of multiple network interfaces.
  - efi_net: let efi_net_set_dp properly update the device path
  - expose symbols to be used by the EFI network stack
  - efi_setup: Add efi_start_obj_list() to efi_setup.c
  - efi_net: Add efi_net_do_start() to efi_net.c
  - efi_device_path: Pass net udevice as argument
  - efi_net: Add device path cache
  - efi_net: Add dhcp cache
  - efi_net: Add support for multiple efi_net_obj

Others:

* legacy-net: wget: fix wget_info handling after new tcp legacy stack
* lib: correct description of CONFIG_SYS_FDT_PAD
* Separate setjmp.h into architecture dependent and independent parts
  - sandbox: remove linux/types.h dependency in setjmp.h
  - arm: include asm-generic/int-ll64.h in setjmp.h
  - common: clean up setjmp.h
* arm: use type jmp_buf instead of struct jmp_buf_data

3 months agoMerge tag 'u-boot-stm32-20250310' of https://source.denx.de/u-boot/custodians/u-boot-stm
Tom Rini [Mon, 10 Mar 2025 13:48:25 +0000 (07:48 -0600)]
Merge tag 'u-boot-stm32-20250310' of https://source.denx.de/u-boot/custodians/u-boot-stm

ARM: stm32mp: Fix boot hang on STM32MP15xx with 1 GiB of DRAM.

3 months agoARM: stm32mp: Fix dram_bank_mmu_setup() for ram_top=0
Marek Vasut [Sun, 9 Mar 2025 02:05:54 +0000 (03:05 +0100)]
ARM: stm32mp: Fix dram_bank_mmu_setup() for ram_top=0

On STM32MP15xx with 1 GiB of DRAM, the gd->ram_top becomes 0,
because DRAM base 0xc0000000 + DRAM size 0x40000000 leads to
gd->ram_top overflow which resets it to 0. Handle this special
case simply by checking for gd->ram_top being zero, and if it
is, assume there is no addr >= gd->ram_top .

This fixes boot hang on STM32MP15xx with 1 GiB of DRAM.

Fixes: 25fb58e88aba ("ARM: stm32mp: Fix dram_bank_mmu_setup() for LMB located above ram_top")
Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
3 months agousb: gadget: Remove the legacy usbtty driver
Tom Rini [Thu, 27 Feb 2025 20:51:01 +0000 (14:51 -0600)]
usb: gadget: Remove the legacy usbtty driver

The lone user of this driver has been removed for some time. Remove this
driver as well.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Link: https://lore.kernel.org/r/20250227205101.4127604-2-trini@konsulko.com
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
3 months agousb: gadget: Remove final remnants of CONFIG_USB_DEVICE
Tom Rini [Thu, 27 Feb 2025 20:51:00 +0000 (14:51 -0600)]
usb: gadget: Remove final remnants of CONFIG_USB_DEVICE

The lone user of the legacy USB device framework have been removed for
some time. Remove the final parts of the code that were missed.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Link: https://lore.kernel.org/r/20250227205101.4127604-1-trini@konsulko.com
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
3 months agolib: correct description of CONFIG_SYS_FDT_PAD
Heinrich Schuchardt [Sun, 2 Mar 2025 15:02:31 +0000 (16:02 +0100)]
lib: correct description of CONFIG_SYS_FDT_PAD

CONFIG_SYS_FDT_PAD defines the number of unused bytes added to a
device-tree and not the total size.

Fixes: 40ed7be4af52 ("Convert CONFIG_SYS_FDT_PAD to Kconfig")
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
3 months agoarm: use type jmp_buf instead of struct jmp_buf_data
Heinrich Schuchardt [Sun, 2 Mar 2025 14:21:21 +0000 (15:21 +0100)]
arm: use type jmp_buf instead of struct jmp_buf_data

Instead of using the implementation specific struct jmp_buf_data use the
standard compliant type jmp_buf when switching exception levels.

Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
3 months agoefi_loader: Clean up usage of structure jmp_buf_data
Yao Zi [Sun, 2 Mar 2025 14:21:20 +0000 (15:21 +0100)]
efi_loader: Clean up usage of structure jmp_buf_data

Structure jmp_buf_data provides the underlying format of jmp_buf, which
we actually don't care about. Clean up existing code to use the standard
jmp_buf type. This introduces no functional change.

Signed-off-by: Yao Zi <ziyao@disroot.org>
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
3 months agocommon: clean up setjmp.h
Heinrich Schuchardt [Sun, 2 Mar 2025 14:21:19 +0000 (15:21 +0100)]
common: clean up setjmp.h

Separate setjmp.h into an architecture independent part and an architecture
specific part. This simplifies moving from using struct jmp_buf_data
directly to using type jmp_buf in our code which is the C compliant way.

Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
3 months agoarm: include asm-generic/int-ll64.h in setjmp.h
Heinrich Schuchardt [Sun, 2 Mar 2025 14:21:18 +0000 (15:21 +0100)]
arm: include asm-generic/int-ll64.h in setjmp.h

Don't assume that u32 and u64 are already defined.

Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
3 months agosandbox: remove linux/types.h dependency in setjmp.h
Heinrich Schuchardt [Sun, 2 Mar 2025 14:21:17 +0000 (15:21 +0100)]
sandbox: remove linux/types.h dependency in setjmp.h

ulong is defined in linux/types.h use unsigned long instead.

Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
3 months agoefi_loader: efi_net: Add support for multiple efi_net_obj
Adriano Cordova [Mon, 3 Mar 2025 14:13:17 +0000 (11:13 -0300)]
efi_loader: efi_net: Add support for multiple efi_net_obj

Add support for multiple efi_net_obj structs in efi_net.c. This comes
in preparation for an EFI network driver supporting multiple network
interfaces. For now the EFI network stack still registers a single ethernet
udevice as an EFI network device even if multiple are present, namely
the one that was the current device at the moment of EFI initialization.

Signed-off-by: Adriano Cordova <adriano.cordova@canonical.com>
3 months agoefi_loader: efi_net: Add dhcp cache
Adriano Cordova [Mon, 3 Mar 2025 14:13:16 +0000 (11:13 -0300)]
efi_loader: efi_net: Add dhcp cache

Add a dhcp cache to store the DHCP ACKs received by the U-Boot network
stack.

Signed-off-by: Adriano Cordova <adriano.cordova@canonical.com>
3 months agoefi_loader: efi_net: Add device path cache
Adriano Cordova [Mon, 3 Mar 2025 14:13:15 +0000 (11:13 -0300)]
efi_loader: efi_net: Add device path cache

In preparation to support mutiple efi net udevices. Add a device path
cache to support device paths from multiple ethernet udevices.
The device paths can be added to the cache before EFI gets initialized and
the protocols get installed.

Signed-off-by: Adriano Cordova <adriano.cordova@canonical.com>
3 months agoefi_loader: efi_device_path: Pass net udevice as argument
Adriano Cordova [Mon, 3 Mar 2025 14:13:14 +0000 (11:13 -0300)]
efi_loader: efi_device_path: Pass net udevice as argument

In preparation to support multiple EFI net objects, support
constructing device paths using an ethernet device different
than the default. Add a udevice argument to the device path
generation, and keep the callsites with eth_get_dev() to
preserve existing functionality.

Signed-off-by: Adriano Cordova <adriano.cordova@canonical.com>
3 months agoefi_loader: efi_net: Add efi_net_do_start() to efi_net.c
Adriano Cordova [Mon, 3 Mar 2025 14:13:13 +0000 (11:13 -0300)]
efi_loader: efi_net: Add efi_net_do_start() to efi_net.c

This gets called each time a payload is to get executed by bootefi.
For now this only updates the PXE IP address.

Signed-off-by: Adriano Cordova <adriano.cordova@canonical.com>
3 months agoefi_loader: efi_setup: Add efi_start_obj_list() to efi_setup.c
Adriano Cordova [Mon, 3 Mar 2025 14:13:12 +0000 (11:13 -0300)]
efi_loader: efi_setup: Add efi_start_obj_list() to efi_setup.c

The coomand bootefi calls efi_init_obj_list to do the efi set up
before launching an .efi payload, but efi_init_obj_list is called
only once. There are some initializations which depend on the
environment and should be done each time a payload gets launched and
not only once. A motivation for this changes is the following order
of events:

1. Launch an EFI application (e.g. bootefi hello)
2. Change the ip address
3. Launch another application which uses the pxe protocol

As the EFI pxe protocol was initialized when the handles
for efi net were created in 1., the ip was hardcoded there.

In this example, another possibility would be to make a callback for ip
address changes to go all the way up to efi_net.

Signed-off-by: Adriano Cordova <adriano.cordova@canonical.com>
3 months agoefi_loader: expose symbols to be used by the EFI network stack
Adriano Cordova [Mon, 3 Mar 2025 14:13:11 +0000 (11:13 -0300)]
efi_loader: expose symbols to be used by the EFI network stack

The following symbols are exposed:
- efi_reinstall_protocol_interface
This is done so that the device path protocol interface
of the network device can be changed internally by u-boot
when a new bootfile gets downloaded.
- eth_set_dev
To support multiple network udevices
- efi_close_event
This comes in preparation to support unregistering
an EFI network device from the EFI network stack when
the underlying U-boot device gets removed
- efi_[dis]connect_controller
The EFI network driver uses ConnectController to add a
NIC to the EFI network stack.
- efi_uninstall_protocol_interface
connect_controler for the efi network driver can install
protocols, which need to be uninstalled in disconnect_controller
- EFI_SIMPLE_NETWORK_PROTOCOL_GUID

Signed-off-by: Adriano Cordova <adriano.cordova@canonical.com>
3 months agolegacy-net: wget: fix wget_info handling after new tcp legacy stack
Adriano Cordova [Mon, 3 Mar 2025 14:13:10 +0000 (11:13 -0300)]
legacy-net: wget: fix wget_info handling after new tcp legacy stack

Check wget_info->buffer_size for overflow and do not clean the wget_info struct
on failure, let the owner of the struct handle the error. The latter is necesary
, e.g., for when a request fails because the provided buffer was too small.

Signed-off-by: Adriano Cordova <adriano.cordova@canonical.com>
3 months agoefi_loader: efi_net: let efi_net_set_dp properly update the device path
Adriano Cordova [Mon, 27 Jan 2025 12:34:45 +0000 (09:34 -0300)]
efi_loader: efi_net: let efi_net_set_dp properly update the device path

This commit fixes an use after free introduced in Commit e55a4acb54
(" efi_loader: net: set EFI bootdevice device path to HTTP when loaded
from wget"). The logic in efi_net_set_dp is reworked so that when the
function is invoked it not only changes the value of the static variable
net_dp (this is how the function was implemented in e55a4acb54) but also
updates the protocol interface of the device path protocol in case efi
has started.

Fixes: e55a4acb54e8 ("efi_loader: net: set EFI bootdevice device path to HTTP when loaded from wget")
Signed-off-by: Adriano Cordova <adriano.cordova@canonical.com>
3 months agoMerge patch series "This series adds support for file renaming to EFI_FILE_PROTOCOL...
Tom Rini [Fri, 7 Mar 2025 17:50:34 +0000 (11:50 -0600)]
Merge patch series "This series adds support for file renaming to EFI_FILE_PROTOCOL.SetInfo()."

Gabriel Dalimonte <gabriel.dalimonte@gmail.com> says:

This series adds support for file renaming to EFI_FILE_PROTOCOL.SetInfo().
One of the use cases for renaming in EFI is to facilitate boot loader
boot counting.

No existing filesystems in U-Boot currently include file renaming,
resulting in support for renaming at the filesystem level and a
concrete implementation for the FAT filesystem.

Link: https://lore.kernel.org/r/20250217182648.31294-1-gabriel.dalimonte@gmail.com
3 months agoefi_loader: support file rename in SetInfo()
Gabriel Dalimonte [Mon, 17 Feb 2025 18:26:47 +0000 (13:26 -0500)]
efi_loader: support file rename in SetInfo()

Following the UEFI specification. The specification did not seem to
delineate if file_name was explicitly a file name only, or could
include paths to move the file to a different directory. The more
generous interpretation of supporting paths was selected.

Signed-off-by: Gabriel Dalimonte <gabriel.dalimonte@gmail.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
3 months agoefi_loader: move path out of file_handle
Gabriel Dalimonte [Mon, 17 Feb 2025 18:26:46 +0000 (13:26 -0500)]
efi_loader: move path out of file_handle

In order to support renaming via SetInfo(), path must allow for longer
values than what was originally present when file_handle was allocated.

Signed-off-by: Gabriel Dalimonte <gabriel.dalimonte@gmail.com>
3 months agofs: fat: update parent dirs metadata on dentry create/delete
Gabriel Dalimonte [Mon, 17 Feb 2025 18:26:45 +0000 (13:26 -0500)]
fs: fat: update parent dirs metadata on dentry create/delete

POSIX filesystem functions that create or remove directory entries contain
text along the lines of "[function] shall mark for update the last data
modification and last file status change timestamps of the parent
directory of each file." [1][2][3] The common theme is these timestamp
updates occur when a directory entry is added or removed. The
create_link() and delete_dentry_link() functions have been changed to
update the modification timestamp on the directory where the direntry
change occurs. This differs slightly from Linux in the case of rename(),
where Linux will not update `new_path`'s parent directory's timestamp if
it is replacing an existing file. (via `vfat_add_entry` [4])

The timestamps are not updated if the build configuration does not support
RTCs. This is an effort to minimize introducing erratic timestamps where
they would go from [current date] -> 2000-01-01 (error timestamp in the
FAT driver). I would assume an unchanged timestamp would be more valuable
than a default timestamp in these cases.

[1] https://pubs.opengroup.org/onlinepubs/9799919799/functions/rename.html
[2] https://pubs.opengroup.org/onlinepubs/9799919799/functions/unlink.html
[3] https://pubs.opengroup.org/onlinepubs/9799919799/functions/open.html
[4] https://elixir.bootlin.com/linux/v6.12.6/source/fs/fat/namei_vfat.c#L682

Signed-off-by: Gabriel Dalimonte <gabriel.dalimonte@gmail.com>
3 months agofs: fat: add rename
Gabriel Dalimonte [Mon, 17 Feb 2025 18:26:44 +0000 (13:26 -0500)]
fs: fat: add rename

The implementation roughly follows the POSIX specification for
rename() [1]. The ordering of operations attempting to minimize the chance
for data loss in unexpected circumstances.

The 'mv' command was implemented as a front end for the rename operation
as that is what most users are likely familiar with in terms of behavior.

The 'FAT_RENAME' Kconfig option was added to prevent code size increase on
size-oriented builds like SPL.

[1] https://pubs.opengroup.org/onlinepubs/9799919799/functions/rename.html

Signed-off-by: Gabriel Dalimonte <gabriel.dalimonte@gmail.com>
3 months agofs: add rename infrastructure
Gabriel Dalimonte [Mon, 17 Feb 2025 18:26:43 +0000 (13:26 -0500)]
fs: add rename infrastructure

The selection for *rename as the name for the rename/move operation
derives from the POSIX specification where they name the function
rename/renameat. [1] This aligns with Linux where the syscalls for
renaming/moving also use the rename/renameat naming.

[1] https://pubs.opengroup.org/onlinepubs/9799919799/functions/rename.html

Signed-off-by: Gabriel Dalimonte <gabriel.dalimonte@gmail.com>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
3 months agofs: fat: factor out dentry link create/delete
Gabriel Dalimonte [Mon, 17 Feb 2025 18:26:42 +0000 (13:26 -0500)]
fs: fat: factor out dentry link create/delete

The create_link() code was previously duplicated in two existing functions.
The two functions will be used in a future commit to achieve renaming.

Signed-off-by: Gabriel Dalimonte <gabriel.dalimonte@gmail.com>
3 months agoscripts/checkpatch.pl: Upgrade IS_ENABLED_CONFIG to error for U-Boot
Tom Rini [Wed, 26 Feb 2025 15:33:45 +0000 (09:33 -0600)]
scripts/checkpatch.pl: Upgrade IS_ENABLED_CONFIG to error for U-Boot

A problem we have today is that some instances of IS_ENABLED(FOO) have
crept in to the code. This is in turn because with checkpatch.pl this is
only a warning and not an error, so they were overlooked. And looking
deeper, in the Linux kernel this pattern is allowed because
IS_ENABLED(DEFINED_FLAG) is allowed if discouraged and a quick skim of
the instances I saw in the current kernel follow this pattern. In U-Boot
however, this is not allowed, so bump to an error.

Signed-off-by: Tom Rini <trini@konsulko.com>
3 months agofs/squashfs: Fix memory leak in sqfs_size_nest()
Andrea della Porta [Sun, 2 Mar 2025 18:29:31 +0000 (19:29 +0100)]
fs/squashfs: Fix memory leak in sqfs_size_nest()

In case MAX_SYMLINK_NEST is reached while determining the size
on a symlink node, the function returns immediately.
This would not free the resources after the free_strings: label
causing a memory leak.

Set the ret value and just break out of the switch to fix this.

Signed-off-by: Andrea della Porta <andrea.porta@suse.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
3 months agomcheck: Fix SPDX License Identifier to LGPL-2.1-or-later
Diederik de Haas [Sat, 1 Mar 2025 10:14:12 +0000 (11:14 +0100)]
mcheck: Fix SPDX License Identifier to LGPL-2.1-or-later

The GPL-2.1+ SPDX License Identifier doesn't exist, but luckily the full
license text was available which shows that GPL-2.1+ was a typo and it
should have been LGPL-2.1-or-later.
As the '+' in LGPL-2.1+ is deprecated in SPDX 3.0, use the preferred
identifier, which is '-or-later'.

Normally the full license header is removed when switching to SPDX
License Identifiers, so do that now.

Signed-off-by: Diederik de Haas <didi.debian@cknow.org>
3 months agoMAINTAINERS: .mailmap: Update Sumit Garg's email address
Sumit Garg [Thu, 27 Feb 2025 12:09:04 +0000 (17:39 +0530)]
MAINTAINERS: .mailmap: Update Sumit Garg's email address

Update Sumit Garg's email address to @kernel.org.

Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
3 months agoMerge tag 'xilinx-for-v2025.04-rc4' of https://source.denx.de/u-boot/custodians/u...
Tom Rini [Wed, 5 Mar 2025 18:11:18 +0000 (12:11 -0600)]
Merge tag 'xilinx-for-v2025.04-rc4' of https://source.denx.de/u-boot/custodians/u-boot-microblaze

AMD/Xilinx changes for v2025.04-rc4

Zynq:
- Guard code around SPL_FS_LOAD_PAYLOAD_NAME

Versal*:
- Remove tftp block size 4096

Versal:
- Use clocks per DT binding
- Store driver data in data section

Versal Gen 2:
- Fix major/minor version decoding

3 months agoxilinx: Remove tftp block size 4096
Padmarao Begari [Tue, 4 Mar 2025 04:30:30 +0000 (10:00 +0530)]
xilinx: Remove tftp block size 4096

The zynqmp gem driver support max MTU size 1536, so remove tftp
block size 4096 from defconfig and use default tftp block size.

Fixes: a33b4b96b3cf ("xilinx: Enable MBEDTLS/LWIP/WGET and WGET_HTTPS")
Signed-off-by: Padmarao Begari <padmarao.begari@amd.com>
Link: https://lore.kernel.org/r/20250304043030.2344536-1-padmarao.begari@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
3 months agoMerge patch series "tools: Minor clean-ups for the command library"
Tom Rini [Tue, 4 Mar 2025 19:31:54 +0000 (13:31 -0600)]
Merge patch series "tools: Minor clean-ups for the command library"

Simon Glass <sjg@chromium.org> says:

This series adds comments and fixes pylint warnings in the command
library. It also introduces a new, simpler way of running a single
command.

Link: https://lore.kernel.org/r/20250203162704.627469-1-sjg@chromium.org
3 months agou_boot_pylib: Add a function to run a single command
Simon Glass [Mon, 3 Feb 2025 16:26:45 +0000 (09:26 -0700)]
u_boot_pylib: Add a function to run a single command

Add a helper to avoid needing to use a list within a list for this
simple case.

Update existing users of runpipe() to use this where possible.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 months agou_boot_pylib: Fix pylint warnings in command
Simon Glass [Mon, 3 Feb 2025 16:26:44 +0000 (09:26 -0700)]
u_boot_pylib: Fix pylint warnings in command

This file has a lot of warnings. Before adding any more features, fix
those which are straightforward to resolve.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 months agou_boot_pylib: Add an exception-class for errors
Simon Glass [Mon, 3 Feb 2025 16:26:43 +0000 (09:26 -0700)]
u_boot_pylib: Add an exception-class for errors

Throwing an Exception is not very friendly since it is the top-level
class of all exceptions. Declare a new class instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 months agou_boot_pylib: Correct case for test_result
Simon Glass [Mon, 3 Feb 2025 16:26:42 +0000 (09:26 -0700)]
u_boot_pylib: Correct case for test_result

This should be in capitals and defined at the start of the file. Update
it.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 months agoled: Fix next Coverity scan error
Heiko Schocher [Wed, 26 Feb 2025 09:18:58 +0000 (10:18 +0100)]
led: Fix next Coverity scan error

The following was reported by Coverity scan:

*** CID 542488:  Control flow issues  (NO_EFFECT)
/drivers/led/led-uclass.c: 277 in led_get_function_name()
271                     return uc_plat->label;
272
273             /* Now try to detect function label name */
274             func = dev_read_string(dev, "function");
275             cp = dev_read_u32(dev, "color", &color);
276             // prevent coverity scan error CID 541279: (TAINTED_SCALAR)
>>>     CID 542488:  Control flow issues  (NO_EFFECT)
>>>     This less-than-zero comparison of an unsigned value is never true. "color < 0U".
277             if (color < LED_COLOR_ID_WHITE || color >= LED_COLOR_ID_MAX)
278                     cp = -EINVAL;
279

Fix it.

Addresses-Coverity-ID: 542488
Link: https://lists.denx.de/pipermail/u-boot/2025-February/581567.html
Signed-off-by: Heiko Schocher <hs@denx.de>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
3 months agogpio: 74x146: depend on DM_SPI
J. Neuschäfer [Mon, 17 Feb 2025 11:18:03 +0000 (12:18 +0100)]
gpio: 74x146: depend on DM_SPI

Currently, Kconfig allows building CONFIG_DM_74X164 without
CONFIG_DM_SPI, which results in linker errors because this driver
actually uses dm_spi_* functions:

drivers/gpio/74x164_gpio.o: in function `gen_74x164_write_conf':
  undefined reference to `dm_spi_claim_bus'
  undefined reference to `dm_spi_xfer'
  undefined reference to `dm_spi_release_bus'

Signed-off-by: J. Neuschäfer <j.ne@posteo.net>
3 months agoMerge patch series "Syncing up on skip-at-start"
Tom Rini [Tue, 4 Mar 2025 14:22:19 +0000 (08:22 -0600)]
Merge patch series "Syncing up on skip-at-start"

Simon Glass <sjg@chromium.org> says:

This series has the skip-at-start change and a few fixes.

Sadly it also includes a revert for the dm_probe_devices() patch, since
it breaks jerry (RK3288). I will need to investigate way.

It is based on -next and I can send a PR if desired.

https://source.denx.de/u-boot/custodians/u-boot-dm/-/pipelines/24835

Link: https://lore.kernel.org/r/20250226162621.2681677-1-sjg@chromium.org
3 months agox86: Stop working around skip-at-start
Simon Glass [Wed, 26 Feb 2025 16:26:18 +0000 (09:26 -0700)]
x86: Stop working around skip-at-start

With a recent Binman change, the skip-at-start property is now honoured,
meaning that all image-pos values in the affected section start from
the skip-at-start value.

The x86 code works around the old behaviour at present, so update it.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 months agobinman: Honour the skip-at-start property more faithfully
Simon Glass [Wed, 26 Feb 2025 16:26:17 +0000 (09:26 -0700)]
binman: Honour the skip-at-start property more faithfully

A discussion on the mailing list about dealing with block offsets and
binman symbols made me think that something is wrong with how Binman
deals with the skip-at-start property.

The feature was originally designed to handle x86 ROMs, which are mapped
at the top of the address space. That seemed too specific, whereas
skipping some space at the start seemed more generally useful.

It has proved useful. For example, rockchip images start at block 64,
so a skip-at-start of 0x8000 deals with this.

But it doesn't actually work correctly, since the image_pos value does
not give the actual position on the media.

Fix this and update the documentation, moving it into the 'section'
section.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 months agobinman: Rename Entry.end_4gb
Simon Glass [Wed, 26 Feb 2025 16:26:16 +0000 (09:26 -0700)]
binman: Rename Entry.end_4gb

The property is named end_at_4gb so name the variable the same, to avoid
confusion.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 months agosamsung: snow: Use BLOBLIST_FIXED
Simon Glass [Wed, 26 Feb 2025 16:26:15 +0000 (09:26 -0700)]
samsung: snow: Use BLOBLIST_FIXED

Snow requires a fixed bloblist to operate, so re-enable this option.

Signed-off-by: Simon Glass <sjg@chromium.org>
Fixes: 864106f3c47 ("bloblist: Make BLOBLIST_ALLOC the default")

3 months agoRevert "dm: core: Simplify dm_probe_devices()"
Simon Glass [Wed, 26 Feb 2025 16:26:14 +0000 (09:26 -0700)]
Revert "dm: core: Simplify dm_probe_devices()"

Unfortunately this change was not safe as some devices are bound before
relocation, but we don't want to probe them.

It causes 'raise: Signal # 8 caught' on jerry.

Move the bootstage timer to after autoprobe in initf_dm() since the
trace test does not tolerate any variance.

This reverts commit 21dd873572a01d74bfdfceb7a30b056f8ccba187.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 months agoboard: verdin-am62: fix missing memory fixup call
Stefan Eichenberger [Mon, 3 Mar 2025 18:16:03 +0000 (19:16 +0100)]
board: verdin-am62: fix missing memory fixup call

The commit bc07851897bd ("board: ti: Pull redundant DDR functions to a
common location and Fixup DDR size when ECC is enabled") broke DRAM
support for the Verdin AM62. This was partially fixed with commit
3f866c47b582 ("board: verdin-am62: add dram_init_banksize"). However,
because fixup_memory_node was not called, the Linux kernel was started
with the wrong memory size on modules with less memory available. This
resulted in boot failures. Fix this issue by calling fixup_memory_node
in the board file.

spl_perform_fixups will be called in the SPL and now sets the correct
memory size in the device tree of U-Boot by calling fixup_memory_node.
U-Boot will then adjust the memory sizes of Linux during bootm/booti in
fdt_fixup_memory_banks. This chain ensures that U-Boot and Linux only
use RAM that is actually available.

Fixes: 3f866c47b582 ("board: verdin-am62: add dram_init_banksize")
Fixes: bc07851897bd ("board: ti: Pull redundant DDR functions to a common location and Fixup DDR size when ECC is enabled")
Signed-off-by: Stefan Eichenberger <stefan.eichenberger@toradex.com>
Acked-by: Francesco Dolcini <francesco.dolcini@toradex.com>
3 months agomiiphy: define mii_devs with LIST_HEAD()
Weijie Gao [Sat, 25 Jan 2025 15:26:32 +0000 (23:26 +0800)]
miiphy: define mii_devs with LIST_HEAD()

When enabling net console and console multiplexing, a boot crash was
observed using mtk_eth driver with stdin/stdout set to "serial,nc"
in persistent environment:

> CPU:   MediaTek MT7981
> Model: OpenWrt One
> DRAM:  1 GiB
> Core:  35 devices, 15 uclasses, devicetree: separate
> spi-nand: spi_nand spi_nand@0: Winbond SPI NAND was found.
> spi-nand: spi_nand spi_nand@0: 128 MiB, block size: 128 KiB, page size: 2048, OOB size: 64
> Loading Environment from UBI... SF: Detected w25q128 with page size 256 Bytes, erase size 4 KiB, total 16 MiB
> mtd: partition "ubi" extends beyond the end of device "spi-nand0" -- size truncated to 0x7f00000
> Read 126976 bytes from volume ubootenv to 000000007f7bf0c0
> Read 126976 bytes from volume ubootenv2 to 000000007f7de100
> OK
> "Synchronous Abort" handler, esr 0x96000004, far 0xeafffffeea000018
> elr: 0000000041e63cd4 lr : 0000000041e1b844 (reloc)
> elr: 000000007ff9ecd4 lr : 000000007ff56844
> x0 : eafffffeea000018 x1 : 000000007fb552e0
> x2 : 00000000000000fe x3 : 0000000000000000

The cause is that "serial,nc" forced the console subsystem to
initialize the ethernet driver before ethernet subsystem
initialization (console_init_r() is called before initr_net()).

During the mtk_eth driver initialization, mdio_register() will be
called, and miiphy_get_dev_by_name() will then be called.

The miiphy_get_dev_by_name() will check the list "mii_devs" to see
if the passed device name exists. However the mii_devs is defined
without initialization:
> static struct list_head mii_devs;
and the actual initialization is done in the following chain:
initr_net -> eth_initialize -> eth_common_init -> miiphy_init
Since initr_net() hasn't be called, iterating over the mii_devs
will access to physical address 0 (mii_devs.next == NULL) and will
cause the crash.

The fix is to define mii_devs using:
> static LIST_HEAD(mii_devs);

As the "current_mii" is defined as a static variable, it will
always be NULL in board_r stage and initializing it will NULL is
unnecessary. So the entire miiphy_init() can be remove.

Signed-off-by: Weijie Gao <hackpascal@gmail.com>
3 months agolib: ecdsa: fix prevent memory leak in ecdsa_add_verify_data
Anton Moryakov [Thu, 6 Feb 2025 21:47:59 +0000 (00:47 +0300)]
lib: ecdsa: fix prevent memory leak in ecdsa_add_verify_data

- Ensure `free_ctx` is called in both error and success paths.
- Fix memory leak in `ctx.signature` when `do_add` fails."

Triggers found by static analyzer Svace.

Signed-off-by: Anton Moryakov <ant.v.moryakov@gmail.com>
3 months agotiny-printf: emit \0 as %c
Alexander Sverdlin [Thu, 20 Feb 2025 12:49:07 +0000 (13:49 +0100)]
tiny-printf: emit \0 as %c

The current code has a problematic corner case with formar "%c" and
0 as parameter. The proper zero byte is being emitted into digit buffer
but the final copy into outstr expects null-terminated string and doesn't
copy the required \0 byte. This has lead to malformed TFTP packets, refer
to tftp_send() which relies on %c to generate multiple zero-terminated
strings in one buffer.

Introduce a variable to force the copy of one character in this case.
The new behaviour is consistent with non-tiny implementation.

Reported-by: Chintan Vankar <c-vankar@ti.com>
Signed-off-by: Alexander Sverdlin <alexander.sverdlin@siemens.com>
3 months agoMerge patch series "arm: mach-k3: j722s: Enable ESM to support watchdogs"
Tom Rini [Mon, 3 Mar 2025 20:22:24 +0000 (14:22 -0600)]
Merge patch series "arm: mach-k3: j722s: Enable ESM to support watchdogs"

Keerthy <j-keerthy@ti.com> says:

The series enables watchdog support on J722S. It adds ESM initialization
to enable routing the watchdog events to trigger a SOC reset.

Link: https://lore.kernel.org/r/20250217105718.3109-1-j-keerthy@ti.com
3 months agoMerge patch series "J784S4: Enable USB DFU boot, DFU flash and UMS configs"
Tom Rini [Mon, 3 Mar 2025 20:21:14 +0000 (14:21 -0600)]
Merge patch series "J784S4: Enable USB DFU boot, DFU flash and UMS configs"

Siddharth Vadapalli <s-vadapalli@ti.com> says:

This series enables configs for USB DFU boot, USB DFU flash and USB Mass
Storage command for J784S4. The device-tree changes required for enabling
these features will be posted as patches to Linux device-tree mailing lists
and will eventually make it to U-Boot via DT Sync.

Link: https://lore.kernel.org/r/20250218094950.2542006-1-s-vadapalli@ti.com
3 months agoconfigs: j784s4_evm_a72_defconfig: enable USB DFU boot, DFU flash and UMS
Siddharth Vadapalli [Tue, 18 Feb 2025 09:49:45 +0000 (15:19 +0530)]
configs: j784s4_evm_a72_defconfig: enable USB DFU boot, DFU flash and UMS

Enable support for USB DFU boot via USB0 instance of USB on J784S4 SoC
which is a Cadence USB Controller. Additionally, enable support for USB
DFU flash and USB Mass Storage (UMS) command. While at it, sync with
savedefconfig.

Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com>
3 months agoconfigs: j784s4_evm_r5_defconfig: enable USB DFU boot
Siddharth Vadapalli [Tue, 18 Feb 2025 09:49:44 +0000 (15:19 +0530)]
configs: j784s4_evm_r5_defconfig: enable USB DFU boot

The USB0 instance of USB on J784S4 SoC is a Cadence USB Controller and
supports USB DFU boot. Enable support for it.

Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com>
3 months agoconfigs: j722s_evm_r5_defconfig: Enable the ESM Configs to support watchdog
Keerthy [Mon, 17 Feb 2025 10:57:18 +0000 (16:27 +0530)]
configs: j722s_evm_r5_defconfig: Enable the ESM Configs to support watchdog

Enable ESM configs. ESMs are a prerequisite to enable
watchdog reset functionality. The ESM aka error signalling module
is primarily responsible for sensing the watchdog reset event.

Signed-off-by: Keerthy <j-keerthy@ti.com>
3 months agoarm: mach-k3: j722s: Initialize MCU & MAIN Domain ESMs
Keerthy [Mon, 17 Feb 2025 10:57:17 +0000 (16:27 +0530)]
arm: mach-k3: j722s: Initialize MCU & MAIN Domain ESMs

Initialize MCU & MAIN Domain ESMs as a prerequisite to enable
watchdog reset functionality. The ESM aka error signalling module
is primarily responsible for sensing the watchdog reset event.

Signed-off-by: Keerthy <j-keerthy@ti.com>
Reviewed-by: Udit Kumar <u-kumar1@ti.com>
3 months agoMAINTAINERS: Update contact information for Greg Malysa
Greg Malysa [Fri, 28 Feb 2025 19:28:27 +0000 (14:28 -0500)]
MAINTAINERS: Update contact information for Greg Malysa

My previous address is no longer accessible, but I will continue to be
involved in maintaining the ADI sc5xx platforms. This updates my contact
information and hopefully avoids bouncing emails from other developers.

Signed-off-by: Greg Malysa <malysagreg@gmail.com>
3 months agoarm64: versal2: Show major and minor silicon version
Michal Simek [Tue, 18 Feb 2025 12:43:07 +0000 (13:43 +0100)]
arm64: versal2: Show major and minor silicon version

ES1 silicon is 0x10 (16) and production is 0x20 (32) but correct number to
see are v1.0 or v2.0 instead of v16 or v32.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/20095339334fe07f373ffae3bdbfec51f5a00dc7.1739882585.git.michal.simek@amd.com
3 months agoclk: versal: Store driver data in data section
Padmarao Begari [Tue, 18 Feb 2025 05:24:19 +0000 (10:54 +0530)]
clk: versal: Store driver data in data section

Line 171 in README is describing that before relocation
no code should use global variable because global variables
are placed to BSS section which is initialized to 0 after
relocation.

On Versal platforms clock driver is initialized before
relocation (via using dm,bootph-all flag in DT) and global
variables are initialized which works if this is used only
before relocation. But the variables are used after
relocation too but values are zeroed which is ending up
incorrect behavior.

That's why place variables to data section to ensure that
values are not cleared which is for now the quickest
temporary solution. The correct way to do it is to move
all global variables to private data to avoid it.

Signed-off-by: Padmarao Begari <padmarao.begari@amd.com>
Link: https://lore.kernel.org/r/20250218052419.1141139-1-padmarao.begari@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
3 months agoxilinx: zynq: Guard code around SPL_FS_LOAD_PAYLOAD_NAME
Michal Simek [Fri, 7 Feb 2025 06:43:23 +0000 (07:43 +0100)]
xilinx: zynq: Guard code around SPL_FS_LOAD_PAYLOAD_NAME

Guard code around CONFIG_SPL_FS_LOAD_PAYLOAD_NAME usage to avoid
compilation failure.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/f15a9762494945814b06a71db90ee4db59dd17ed.1738910601.git.michal.simek@amd.com
3 months agoMerge tag 'fsl-qoriq-2025-3-3' of https://source.denx.de/u-boot/custodians/u-boot...
Tom Rini [Mon, 3 Mar 2025 13:49:07 +0000 (07:49 -0600)]
Merge tag 'fsl-qoriq-2025-3-3' of https://source.denx.de/u-boot/custodians/u-boot-fsl-qoriq

CI: https://source.denx.de/u-boot/custodians/u-boot-fsl-qoriq/-/pipelines/24933

Fixes:

- Re-arm packet buffer in error case in tsec driver
- Fix LS1021a build
- Fix flush dcache alignment in caam_hash

3 months agoMerge tag 'efi-2025-04-rc4' of https://source.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Mon, 3 Mar 2025 13:47:13 +0000 (07:47 -0600)]
Merge tag 'efi-2025-04-rc4' of https://source.denx.de/u-boot/custodians/u-boot-efi

CI:

* https://source.denx.de/u-boot/custodians/u-boot-efi/-/pipelines/24904

UEFI:

* Let efi_net_set_dp properly update the device path

Network:

* Avoid buffer overflows in wget_info with legacy TCP stack

3 months agoclk: versal: Update the reference clocks as per bindings
Venkatesh Yadav Abbarapu [Thu, 6 Feb 2025 09:15:33 +0000 (14:45 +0530)]
clk: versal: Update the reference clocks as per bindings

As per the bindings the reference clocks naming has changed
from "pl_alt_ref_clk" to "pl_alt_ref" and "ref_clk" to "ref".
Update the same in the clock driver. Also add the fallback option
for older DT bindings.

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Link: https://lore.kernel.org/r/20250206091533.1447234-1-venkatesh.abbarapu@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
3 months agocrypto: fsl_hash: fix flush dcache alignment in caam_hash()
Benjamin Lemouzy [Fri, 21 Feb 2025 07:05:01 +0000 (08:05 +0100)]
crypto: fsl_hash: fix flush dcache alignment in caam_hash()

Loading a FIT kernel image with hash hardware acceleration enabled
(CONFIG_SHA_HW_ACCEL=y) displays the following CACHE warning:

    [...]
    Trying 'kernel-1' kernel subimage
    [...]
    Verifying Hash Integrity ... sha256CACHE: Misaligned operation at
range [160001281673fae8]
    [...]
    Trying 'ramdisk-1' ramdisk subimage
    [...]
    Verifying Hash Integrity ... sha256CACHE: Misaligned operation at
range [1676d6d41737a5d4]
    [...]
    Trying 'fdt-imx6q-xxx.dtb' fdt subimage
    [...]
    Verifying Hash Integrity ... sha256CACHE: Misaligned operation at
range [1673fbdc1674b0dc]
    [...]

This patch fixes it.

Tested on:
- i.MX 6 custom board
- LS1021A custom board

Signed-off-by: Benjamin Lemouzy <blemouzy@centralp.fr>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
3 months agoboard: freescale: fix LS1021a build
Benjamin Lemouzy [Mon, 17 Feb 2025 15:36:03 +0000 (16:36 +0100)]
board: freescale: fix LS1021a build

Fix build error "undefined reference to `is_warm_boot'" when
ls1021atsn and ls1021atwr boards are built with CONFIG_SPL=y and
CONFIG_DEEP_SLEEP=n.

Signed-off-by: Benjamin Lemouzy <blemouzy@centralp.fr>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
3 months agonet: tsec: Re-arm packet buffer in error case
J. Neuschäfer [Sun, 16 Feb 2025 21:18:13 +0000 (22:18 +0100)]
net: tsec: Re-arm packet buffer in error case

When an error is detected in the TSEC receive path, the driver currently
prints an error message, but leaves the corresponding packet descriptor
in its old state (i.e. owned by the CPU side). As a result, the packet
queue can be starved of available buffers if enough errors happen.

To recover from errors, re-arm the packet buffer descriptor after an
error has been detected.

Errors can be provoked by changing a PHY with phy-mode = "rgmii-id" to
phy-mode = "rgmii".

Signed-off-by: J. Neuschäfer <j.ne@posteo.net>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
3 months agonet: tsec: Reorder tsec_recv and tsec_free_pkt
J. Neuschäfer [Sun, 16 Feb 2025 21:18:12 +0000 (22:18 +0100)]
net: tsec: Reorder tsec_recv and tsec_free_pkt

This is necessary for the following patch. No functional change.

Signed-off-by: J. Neuschäfer <j.ne@posteo.net>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
3 months agoMerge tag 'u-boot-rockchip-20250301' of https://source.denx.de/u-boot/custodians...
Tom Rini [Sat, 1 Mar 2025 13:51:14 +0000 (07:51 -0600)]
Merge tag 'u-boot-rockchip-20250301' of https://source.denx.de/u-boot/custodians/u-boot-rockchip

CI: https://source.denx.de/u-boot/custodians/u-boot-rockchip/-/pipelines/2489

- Fix SD-Card boot on rk3308-rock-s0 v1.1;
- Fix crash on nanopi-r4s seconde usb port;
- Disable undeeded PCI config for nanopi-r3s-rk3566
- Correct usage of IS_ENABLED()

3 months agoMerge patch series "rsa: Add rsa_verify_openssl() to use openssl for host builds"
Tom Rini [Fri, 28 Feb 2025 22:51:10 +0000 (16:51 -0600)]
Merge patch series "rsa: Add rsa_verify_openssl() to use openssl for host builds"

Paul HENRYS <paul.henrys_ext@softathome.com> says:

This serie of patches adds a new tool to authenticate files signed with
a preload header.  This tool is also used in the tests to actually
verify the authenticity of the file signed with such a preload header.

Link: https://lore.kernel.org/r/20250224212055.2992852-1-paul.henrys_ext@softathome.com
3 months agobinman: Authenticate the image when testing the preload signature
Paul HENRYS [Mon, 24 Feb 2025 21:20:55 +0000 (22:20 +0100)]
binman: Authenticate the image when testing the preload signature

Use preload_check_sign to authenticate the generated image when testing the
preload signature in testPreLoad().

Signed-off-by: Paul HENRYS <paul.henrys_ext@softathome.com>
3 months agoconfigs: Enable the pre-load signature in tools-only_defconfig
Paul HENRYS [Mon, 24 Feb 2025 21:20:54 +0000 (22:20 +0100)]
configs: Enable the pre-load signature in tools-only_defconfig

pre-load related config options are enabled to have support of it in host
tools.

'CONFIG_FIT_SIGNATURE=y' is being automatically removed since it is
selected by CONFIG_IMAGE_PRE_LOAD_SIG.

Signed-off-by: Paul HENRYS <paul.henrys_ext@softathome.com>
3 months agotools: Add preload_check_sign to authenticate images with a pre-load
Paul HENRYS [Mon, 24 Feb 2025 21:20:53 +0000 (22:20 +0100)]
tools: Add preload_check_sign to authenticate images with a pre-load

preload_check_sign is added so that it can be used to authenticate images
signed with the pre-load signature supported by binman and U-Boot.
It could also be used to test the signature in binman tests signing
images with the pre-load.

Signed-off-by: Paul HENRYS <paul.henrys_ext@softathome.com>
3 months agoboot: Add support of the pre-load signature for host tools
Paul HENRYS [Mon, 24 Feb 2025 21:20:52 +0000 (22:20 +0100)]
boot: Add support of the pre-load signature for host tools

Signed-off-by: Paul HENRYS <paul.henrys_ext@softathome.com>
3 months agoimage: Add an inline declaration of unmap_sysmem()
Paul HENRYS [Mon, 24 Feb 2025 21:20:51 +0000 (22:20 +0100)]
image: Add an inline declaration of unmap_sysmem()

Add an empty inline declaration when compiling tools for a host where
unmap_sysmem() is not defined.

Signed-off-by: Paul HENRYS <paul.henrys_ext@softathome.com>
3 months agorsa: Add rsa_verify_openssl() to use openssl for host builds
Paul HENRYS [Mon, 24 Feb 2025 21:20:50 +0000 (22:20 +0100)]
rsa: Add rsa_verify_openssl() to use openssl for host builds

rsa_verify_openssl() is used in lib/rsa/rsa-verify.c to authenticate data
when building host tools.

Signed-off-by: Paul HENRYS <paul.henrys_ext@softathome.com>
3 months agoMerge patch series "boards: siemens: iot2050: SM variant, sysinfo support, fixes...
Tom Rini [Fri, 28 Feb 2025 14:42:01 +0000 (08:42 -0600)]
Merge patch series "boards: siemens: iot2050: SM variant, sysinfo support, fixes & cleanups"

Baocheng Su <baocheng.su@siemens.com> says:

This introduces a sysinfo driver which also permits SMBIOS support.

The first 10 patches of v2 have already been applied. The remaining is
solely the sysinfo driver. To maintain consistency and ease of searching
through the history, the series title remains unchanged.

Link: https://lore.kernel.org/r/20250218023614.52574-1-baocheng.su@siemens.com
3 months agoboard: siemens: iot2050: Use sysinfo for board initialization
Baocheng Su [Tue, 18 Feb 2025 02:36:14 +0000 (10:36 +0800)]
board: siemens: iot2050: Use sysinfo for board initialization

Drop the info structure parsing of the board in favor of our new sysinfo
driver to avoid code duplication.

Signed-off-by: Baocheng Su <baocheng.su@siemens.com>
Signed-off-by: Li Hua Qian <huaqian.li@siemens.com>
[Jan: rebasing, split-up, cleanup]
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
3 months agosysinfo: Add driver for IOT2050 boards
Baocheng Su [Tue, 18 Feb 2025 02:36:13 +0000 (10:36 +0800)]
sysinfo: Add driver for IOT2050 boards

This brings a sysinfo driver and DT entry for the IOT2050 board series.
It translates the board information passed from SE-Boot to SPL into
values that can be retrieved via the sysinfo API. Will is already used
to fill the SMBIOS table when booting via EFI.

Signed-off-by: Baocheng Su <baocheng.su@siemens.com>
Signed-off-by: Li Hua Qian <huaqian.li@siemens.com>
[Jan: split-off as separate patch, cleanup]
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
3 months agosysinfo: Add SYSID_BOARD_RAM_SIZE_MB
Baocheng Su [Tue, 18 Feb 2025 02:36:12 +0000 (10:36 +0800)]
sysinfo: Add SYSID_BOARD_RAM_SIZE_MB

Add a new field SYSID_BOARD_RAM_SIZE_MB to sysinfo structure to store
the size of RAM in MB. dram_init can use this field to get the RAM size
via sysinfo driver.

Signed-off-by: Baocheng Su <baocheng.su@siemens.com>
3 months agosysinfo: Add API for accessing data elements
Baocheng Su [Tue, 18 Feb 2025 02:36:11 +0000 (10:36 +0800)]
sysinfo: Add API for accessing data elements

This commit introduces a new API to the sysinfo module, allowing access
to data elements. This is particularly useful for handling data with
multiple instances, such as MAC addresses.

Signed-off-by: Baocheng Su <baocheng.su@siemens.com>
3 months agosmbios: Fill UUID from sysinfo when available
Baocheng Su [Tue, 18 Feb 2025 02:36:10 +0000 (10:36 +0800)]
smbios: Fill UUID from sysinfo when available

Allow for the sysinfo drivers to provide a system UUID to SMBIOS. Will
be first used by the IOT2050 boards.

Signed-off-by: Li Hua Qian <huaqian.li@siemens.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Baocheng Su <baocheng.su@siemens.com>
3 months agodma: ti: k3-udma: Avoid Memory leak issues during dma memcpy
Prasanth Babu Mantena [Thu, 20 Feb 2025 13:18:27 +0000 (18:48 +0530)]
dma: ti: k3-udma: Avoid Memory leak issues during dma memcpy

During dma memcpy, bcdma descriptor gets allocated for each
transaction and not freed after completion of that transaction.
So, avoid the memory allocation for every transaction.

Add one descriptor per dma device and allocate it once in
resource setup. This descriptor can now be used for all
dma memcpy transactions optimally.

Signed-off-by: Prasanth Babu Mantena <p-mantena@ti.com>
3 months agoserial: ns16550: Fix pointer type mismatch
J. Neuschäfer [Tue, 18 Feb 2025 13:39:45 +0000 (14:39 +0100)]
serial: ns16550: Fix pointer type mismatch

serial_out_dynamic() takes a u8* addr and uses it for 8-bit or 32-bit
accesses, depending on the value of plat->reg_width. This results in a
pointer type mismatch that the compiler may even turn into an error:

drivers/serial/ns16550.c: In function ‘serial_out_dynamic’:
drivers/serial/ns16550.c:115:42: error: passing argument 1 of ‘out_be32’ from incompatible pointer type [-Wincompatible-pointer-types]
  115 |                                 out_be32(addr, value);
      |                                          ^~~~
      |                                          |
      |                                          u8 * {aka unsigned char *}

This error was observed on PowerPC.

Signed-off-by: J. Neuschäfer <j.ne@posteo.net>