Commit graph

98246 commits

Author SHA1 Message Date
Jerome Forissier
1728fa2349 net: lwip: rename linkoutput() as net_lwip_tx()
Rename static function linkoutput() as net_lwip_tx() for consistency
with net_lwip_rx().

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-03-11 14:16:03 +01:00
Tom Rini
1b42f57ec8 Prepare v2025.04-rc4
-----BEGIN PGP SIGNATURE-----
 
 iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmfPdnYACgkQFHw5/5Y0
 tyw17wv+KqFxDoJKTGVWeP4fu+zhTQlFo0f2tAlWylAdJnDP6nR/I49zid2mjRbZ
 2Bq3mE3G2Ag1efJ3UGHck0Zn1O9OpqVvk734IHSJFygN77l2xmNSMXZd8MLOsbaU
 4JXhxbLUdumCSkwVjjc9/sN+kJUfpwmFBwjqPWmE8rVU+IjApdZP0hBmfxACivl3
 p0JJZ870JkgSd5KuAGO/MUbinl/QYOdpitbo2EinOyqnLnivw5PzlcAYF0STNcgJ
 XfsT7Ap9T3woPTkT1mXGo+0gBs1OPxXcXp6nywFY75EVIGYRetDEXr8/jf74Jg83
 XK8+mqFP+bhlLOMydCdRHyQU8+WGNPfWtcOa7ekC3DjR9Kf7VwoTujqa9B9ILg6m
 UBagI/zUIWGAHi4oe2vMV16nR1cPT1ZexPoswZJrj/iDC6WaN0gWwDQgcPODm0UL
 rPYYNPWne/iGYgbkhy1zqZMEj7ytnvtjaVMRFdbTSwWUR3s23q9btqjlOwfXbtYZ
 0ENfAAu0
 =xGcd
 -----END PGP SIGNATURE-----

Merge tag 'v2025.04-rc4' into next

This uses Heinrich's merge of lib/efi_loader/efi_net.c which results in
no changes.
2025-03-10 20:18:51 -06:00
Tom Rini
a383b9bd4d Prepare v2025.04-rc4
Signed-off-by: Tom Rini <trini@konsulko.com>
2025-03-10 17:31:52 -06:00
Tom Rini
bdf41fb7b3 configs: Resync with savedefconfig
Resync all defconfig files using qconfig.py

Signed-off-by: Tom Rini <trini@konsulko.com>
2025-03-10 17:31:22 -06:00
Tom Rini
124b75644c 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
2025-03-10 10:13:03 -06:00
Simon Glass
d085e692c9 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>
2025-03-10 10:12:08 -06:00
Tom Rini
42fd94893e Pull request efi-next-20250310
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
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEK7wKXt3/btL6/yA+hO4vgnE3U0sFAmfO038ACgkQhO4vgnE3
 U0s++hAAkJh+7JvCRDpG6Us0Ytary9US6qG+n2GKnTPD/fy1Kfx/0jQz8B+XCpun
 pwr7XOzRyrimaxDjjGWKoYv6AfJzfuijDuN/FfZc5Dz6u1QJZrMyWXrAJ2ysob4a
 g69OV96omqh9Z9AWjwhvEb9WZ3mqEc5JghRlalsLptHegXoqPE5j068w9HOF8yu1
 ozLFh2PLFklHbG9r+ld7zj/svSQ4q1/JVi/Am9t5Wz7qzssaUSagzTnGxzObTAuD
 LciCtWk4zbdEfuhj63eQfUACuOoo9DuIcgtNmVljMf01lZMPhFCNQHJ6mHCq6fAF
 8hMsqsRIiqre6QcSUaRMQcFVm3nnViORkdbJZtFyj+SEyNlCrqOrW6sFWMlNstMC
 Aj2nK10kqb8B8uj3bIlhSDfmBtIOK4onBw8eiv93OzwEhq6y9Dz8eNNykvUHT8lR
 5ZbCczxZLvjJgi1DwZlWpyeAe2hiq9wHF5csT3VmLkbgL5hplRBAtprRIVfo8hWg
 fyr6PzvUHN3xIZ+hu+YaGG/RoFavMg6Xngeg17TQhfvRSjx1d7tvZLoINpz/l8XC
 r7yr5tDbbKC53Pntym2CEr6yQ2DNoRXyy2gBw3yDSWBZUYznKnJDadUu1RE0CloI
 Rsji6Oco5MSImTUqhR56ydhZALPEIwE2FBiLi4sJBRLjLQFTxEk=
 =7ibO
 -----END PGP SIGNATURE-----

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
2025-03-10 07:49:33 -06:00
Tom Rini
444cc6f080 ARM: stm32mp: Fix boot hang on STM32MP15xx with 1 GiB of DRAM.
-----BEGIN PGP SIGNATURE-----
 
 iQJQBAABCgA6FiEEXyrViUccKBz9c35Jysd4L3sz/6YFAmfOptocHHBhdHJpY2Uu
 Y2hvdGFyZEBmb3NzLnN0LmNvbQAKCRDKx3gvezP/pkgJD/9d/E9CLGU19WEb6wP+
 58ADB3zwQXiqou00Dbbf/Sg7LfVsAfO09tbUCl5K1Z8ZpajGHeVZV0oXH8nwhiwj
 DOp15J9hyw3eMvDyBDwTkcgIyijIzq2sTKdMFmeAJNNe3tLn4drUk9YgaCwo6b0A
 vWSh3RaYwGUu1c0dVV52W57iFbpINNmZ/zzE5EF5HtW/mMDbGWgES9cSua4iRUuF
 ThH0/iYf8XZvHp8oy4YrnL33ykNSA8PrgsuQcBpOgGqQ7zkg/2NTY1O9itNul+nH
 PINjwi1dDRXSIcZRK6Y1Aksgzj/ujRPEsh73CJuoRMlkTm+ltf6FnrzxxPdAqnfx
 nMo5ZTH8cGkZ2QB0R2bXEci8U44CcNpbRl2iuHHfeNZqF4p0QdKdVYhOj4cYLmnQ
 vcvvHOPbYb14Quq/YHJVM5gPzlFs3XpcEKcjfYej1qlq+troN80bYNig/RvFkISd
 egbxMkMJ0yFGYOXy189unfFrl1T3Qssv3r1xjUNovtBufEitOFSL+IPe3+eIgzwK
 HOZoZ35/aq2CBhtsGqGyNTCGcFGg9Dxo7LfmiNeyno9X/+VCPQuOG84GUps7J5Fp
 2pXIeOI+ZJJF8krCAbXnLJOQ9Jy4IQ+BRcJA3U7Bpr0DijqJmqAXWkk3rOXEhTd7
 M4koJPQEsKKLsqRdUiFRCtJMqA==
 =03U9
 -----END PGP SIGNATURE-----

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.
2025-03-10 07:48:25 -06:00
Marek Vasut
f5ee0f2bf7 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: 25fb58e88a ("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>
2025-03-10 09:39:30 +01:00
Tom Rini
6689b0c955 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>
2025-03-10 09:22:35 +01:00
Tom Rini
7f061aba9a 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>
2025-03-10 09:22:35 +01:00
Heinrich Schuchardt
cb21476496 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: 40ed7be4af ("Convert CONFIG_SYS_FDT_PAD to Kconfig")
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2025-03-10 07:41:26 +01:00
Heinrich Schuchardt
7cf559d4cb 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>
2025-03-10 07:41:23 +01:00
Yao Zi
f280615747 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>
2025-03-10 07:41:20 +01:00
Heinrich Schuchardt
7082c9e656 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>
2025-03-10 07:41:16 +01:00
Heinrich Schuchardt
8aa1d810e2 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>
2025-03-10 07:41:14 +01:00
Heinrich Schuchardt
e9b3810c67 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>
2025-03-10 07:41:11 +01:00
Adriano Cordova
79aec250c2 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>
2025-03-10 07:40:17 +01:00
Adriano Cordova
8c4aefc48b 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>
2025-03-10 07:02:28 +01:00
Adriano Cordova
dd5d82a599 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>
2025-03-10 07:02:25 +01:00
Adriano Cordova
267b0a7ddf 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>
2025-03-10 07:01:37 +01:00
Adriano Cordova
6a832d4b2e 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>
2025-03-10 06:41:10 +01:00
Adriano Cordova
fba5be3b60 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>
2025-03-10 06:41:07 +01:00
Adriano Cordova
74829b4d93 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>
2025-03-10 06:41:05 +01:00
Adriano Cordova
908033ea22 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>
2025-03-10 06:41:01 +01:00
Adriano Cordova
2eda179568 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: e55a4acb54 ("efi_loader: net: set EFI bootdevice device path to HTTP when loaded from wget")
Signed-off-by: Adriano Cordova <adriano.cordova@canonical.com>
2025-03-10 06:39:58 +01:00
Tom Rini
743c15b9fd 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
2025-03-07 12:06:21 -06:00
Gabriel Dalimonte
0165e1a8bd 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>
2025-03-07 11:50:22 -06:00
Gabriel Dalimonte
8465ee528b 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>
2025-03-07 11:50:22 -06:00
Gabriel Dalimonte
879eee641b 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>
2025-03-07 11:50:22 -06:00
Gabriel Dalimonte
06159a1465 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>
2025-03-07 11:50:22 -06:00
Gabriel Dalimonte
d9c149664f 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>
2025-03-07 11:50:22 -06:00
Gabriel Dalimonte
1742b8484e 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>
2025-03-07 11:50:22 -06:00
Tom Rini
0fd7ee0306 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>
2025-03-05 12:14:49 -06:00
Andrea della Porta
e22b2d7781 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>
2025-03-05 12:14:31 -06:00
Diederik de Haas
31378bd6fc 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>
2025-03-05 12:14:04 -06:00
Sumit Garg
19715a7f03 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>
2025-03-05 12:13:01 -06:00
Tom Rini
367971d205 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
 -----BEGIN PGP SIGNATURE-----
 
 iF0EABECAB0WIQQbPNTMvXmYlBPRwx7KSWXLKUoMIQUCZ8g41AAKCRDKSWXLKUoM
 IWoUAJwLRR8n8sSD8/CFMVRpRtKeWiHhKACghZ6WQjRBGTW8kX0Kyvrz14z/7Lw=
 =dzMG
 -----END PGP SIGNATURE-----

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
2025-03-05 12:11:18 -06:00
Padmarao Begari
8d2d615f14 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: a33b4b96b3 ("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>
2025-03-05 12:42:34 +01:00
Tom Rini
986ab810fa 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
2025-03-04 13:32:15 -06:00
Simon Glass
3d094ce28a 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>
2025-03-04 13:31:49 -06:00
Simon Glass
f8456c91aa 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>
2025-03-04 13:31:49 -06:00
Simon Glass
54ead4be04 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>
2025-03-04 13:31:49 -06:00
Simon Glass
d6900a778a 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>
2025-03-04 13:31:49 -06:00
Heiko Schocher
409d37e869 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>
2025-03-04 12:07:23 -06:00
J. Neuschäfer
b6f8da1c2e 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>
2025-03-04 11:59:51 -06:00
Tom Rini
78f8c8c58f 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
2025-03-04 08:22:19 -06:00
Simon Glass
ebe3c3c4a8 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>
2025-03-04 08:22:11 -06:00
Simon Glass
2c252d36b8 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>
2025-03-04 08:22:11 -06:00
Simon Glass
91fa9d9ed2 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>
2025-03-04 08:22:10 -06:00