Commit graph

97969 commits

Author SHA1 Message Date
Simon Glass
cd48a21dbd 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 21dd873572.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-04 08:22:10 -06:00
Stefan Eichenberger
4164289db8 board: verdin-am62: fix missing memory fixup call
The commit bc07851897 ("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
3f866c47b5 ("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: 3f866c47b5 ("board: verdin-am62: add dram_init_banksize")
Fixes: bc07851897 ("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>
2025-03-04 08:21:45 -06:00
Weijie Gao
7e0370f37d 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>
2025-03-04 08:03:47 -06:00
Greg Malysa
e34aa2975a 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>
2025-03-03 13:10:40 -06:00
Tom Rini
cf6354ab23 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
2025-03-03 07:49:07 -06:00
Tom Rini
d4e428856c Pull request efi-2025-04-rc4
UEFI:
 
 * let efi_net_set_dp properly update the device path
 
 Network:
 
 * avoid buffer overflows in wget_info with legacy TCP stack
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEK7wKXt3/btL6/yA+hO4vgnE3U0sFAmfEES4ACgkQhO4vgnE3
 U0sZJBAAs2+uW+L30J/2lYEUTsgpliciiCdIU3O44uM+9xK52xVtFqHxZh67twRg
 cFfqooVg3CGR2Sxn78I40G8ibeEukua1IZStxKSm+eQF5eiKRB5Vxmr03KY0siSE
 4IVGZbll4meSnpalpGvIHctZtWb8nQQvhIHE8+8wEmau+UMHbRWmfbTF/SymoIrr
 //azmapXOYOYGZVh+UKMFoeLJxpA7k+IHvKQgX7CppOgb15Z8RUMjgqizqrYxRkn
 TOK+51TOigd7ap5+Nz0sFF4knx0yKLpvAZZgS/dln9WvAHD6GccKu2FDfm6ayTvy
 n10NCgPlQcRVGt26ws01sL5+bLr2bAtcH9zxFmllwknZb5esAo2CmACD/UBYhcrL
 /jVYveVucCZSVAPCP9h3mx5zUQkxJjpJmymb7NbAGhqp1gwk5XFglBeyMSgQjjDe
 VecHWTuGIzi8vN4WqYreogdhrEOt+6pCxoe+V24zRCwwczCTgWGFI15ifyoRsJmi
 psXkyZg/MjGwkZqzN4ZxH2KYCCjUoCdJ/JceSDPWGO15xKc6ZB91tCjKJgAkMlcA
 kL7hfYz1oP5MWRj1/mzJ99EreyV93xsXtoC7TKKI8BkqPRsSAxso25AkwduTIpR1
 zLrAJBkdEAZUG6J9WFeWkOBU0sJCWaT213ArJM2Zq5pH6BL9fLw=
 =vRs8
 -----END PGP SIGNATURE-----

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
2025-03-03 07:47:37 -06:00
Benjamin Lemouzy
ef0e979e14 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 [16000128, 1673fae8]
    [...]
    Trying 'ramdisk-1' ramdisk subimage
    [...]
    Verifying Hash Integrity ... sha256CACHE: Misaligned operation at
range [1676d6d4, 1737a5d4]
    [...]
    Trying 'fdt-imx6q-xxx.dtb' fdt subimage
    [...]
    Verifying Hash Integrity ... sha256CACHE: Misaligned operation at
range [1673fbdc, 1674b0dc]
    [...]

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>
2025-03-03 14:18:50 +08:00
Benjamin Lemouzy
9f258e4820 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>
2025-03-03 14:18:50 +08:00
J. Neuschäfer
63a23cb465 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>
2025-03-03 14:18:49 +08:00
J. Neuschäfer
a149456d6a 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>
2025-03-03 14:18:48 +08:00
Tom Rini
6ae0a578de 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()
2025-03-01 07:51:14 -06:00
Adriano Cordova
32a6c5eac0 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-02-28 15:26:05 +01:00
Adriano Cordova
2c2d2f3d12 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-02-28 15:25:30 +01:00
Tianling Shen
a390c48575 rockchip: nanopi-r3s-rk3566: disable unneeded CONFIG_NVME_PCI
This board does not have any NVMe slot, so disable unneeded
CONFIG_NVME_PCI option.

Fixes: bf4a33e725 ("board: rockchip: add FriendlyElec NanoPi R3S")
Signed-off-by: Tianling Shen <cnsztl@gmail.com>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2025-02-28 19:21:17 +08:00
Justin Klaassen
ed073246e8 rockchip: nanopi-r4s: Enable second usb port and fix crash
The patch enables the second USB3.0 Type-A USB port on the NanoPi R4S
board, which prevents a crash when initializing the usb system in U-Boot
and allows both Type-A USB ports to be used for booting.

=> usb start
starting USB...
Bus usb@fe380000: USB EHCI 1.00
Bus usb@fe3c0000: "Synchronous Abort" handler, esr 0x96000010, far 0x0

Signed-off-by: Justin Klaassen <justin@tidylabs.net>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2025-02-28 19:15:21 +08:00
Tom Rini
126262b2be clk: rockchip: Correct usage of IS_ENABLED() macro
These two files were using IS_ENABLED() to test for CONFIG flags but omitted
the CONFIG_ prefix and so did not work as expected.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2025-02-28 19:14:35 +08:00
Jonas Karlman
4871db6082 rockchip: rk3308-rock-s0: Fix SD-card boot on v1.1 hw revision
BootROM leave GPIO4_D6 configured as SDMMC_PWREN function and DW MMC
driver set PWREN high in dwmci_init().

However, HW revision prior to v1.2 must pull GPIO4_D6 low to access
sdmmc. For HW revision v1.2 the state of GPIO4_D6 has no impact.

Upstream Linux commit 26c100232b09 "arm64: dts: rockchip: Fix sdmmc
access on rk3308-rock-s0 v1.1 boards" fixed this issue by adding a
vcc_sd regulator.

Include the new vcc_sd regulator in SPL and enable required Kconfig
options to set GPIO4_D6 low to fix reading sdmmc on v1.1 hw revision.

Fixes: 25438c40a0 ("board: rockchip: Add Radxa ROCK S0")
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2025-02-28 19:13:50 +08:00
Tom Rini
32c9a6518d Merge patch series "mbedtls: fix incorrect kconfig dependencies on mbedtls"
This series from Raymond Mao <raymond.mao@linaro.org> fixes assorted
problems with how dependencies were expressed in Kconfig for mbedtls and
assorted algorithms.

Link: https://lore.kernel.org/r/20250203220825.707590-1-raymond.mao@linaro.org
2025-02-27 12:11:07 -06:00
Raymond Mao
ac0b1e82ff mbedtls: refactor mbedtls build for XPL
Refactor the entire kconfig page for mbedtls, adapt mbedtls makefile
and default config file using 'XPL_', in order to have independent
mbedtls kconfig options in U-Boot Proper, SPL, TPL and VPL.
User can choose legacy or mbedtls libraries for them independently.

Set mbedtls native hashing libraries as default when MBEDTLS_LIB,
SPL_MBEDTLS_LIB, TPL_MBEDTLS_LIB or VPL_MBEDTLS_LIB is selected.

If users prefer using U-Boot legacy hashing libraries, please select
MBEDTLS_LIB_HASHING_ALT, SPL_MBEDTLS_LIB_HASHING_ALT,
TPL_MBEDTLS_LIB_HASHING_ALT or VPL_MBEDTLS_LIB_HASHING_ALT for U-Boot
Proper, SPL, TPL and VPL respectively.

Moreover, rename a few kconfig options and update their descriptions to
improve the consistency of terminology.

Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-02-27 12:11:02 -06:00
Raymond Mao
f13cd90762 mbedtls: access mbedtls private members in mscode and pkcs7 parser
U-Boot requires to access x509_internal.h, mbedtls_sha256_context and
mbedtls_sha1_context in the porting layer, and this requires to
enable MBEDTLS_ALLOW_PRIVATE_ACCESS.

Enable it to mscode and pkcs7_parser to fix a mbedtls internal building
error when X509 is selected.

Moreover, Move it to a separate file to avoid enabling it in multiple
places.

Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-02-27 12:11:02 -06:00
Raymond Mao
a26e957381 mbedtls: fix incorrect kconfig dependencies on mbedtls
Fixed the building failures when WGET_HTTPS,NET_LWIP and MBEDTLS_LIB
are selected due to a few incorrect kconfig dependencies.

Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-02-27 12:11:02 -06:00
Daniel Schultz
b78f8677cd arch: arm: dts: k3-am642-phycore-som-binman: Add custMpk to overlays
There are some device-tree overlays with missing entries for the
keyfile. Add them to sign all images in the U-Boot FIT image.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Wadim Egorov <w.egorov@phytec.de>
2025-02-27 08:07:38 -06:00
Daniel Schultz
c5aa4a4624 arch: arm: dts: k3-am625-phycore-som-binman: Add custMpk to overlays
There are some device-tree overlays with missing entries for the
keyfile. Add them to sign all images in the U-Boot FIT image.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Wadim Egorov <w.egorov@phytec.de>
2025-02-27 08:07:38 -06:00
Tom Rini
74bbe86413 Merge tag 'u-boot-imx-master-20250227' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx
CI: https://source.denx.de/u-boot/custodians/u-boot-imx/-/pipelines/24872

- Fix bootstd booting on imx8mm_evk, imx8mq_evk, imx8mp_evk and
  imx93_evk
2025-02-27 08:00:30 -06:00
Fabio Estevam
11ad9f8b15 imx8mp_evk: Pass kernel_addr_r
Currently, booting via bootstd fails because the kernel cannot be retrieved.
The reason for this is the lack of 'kernel_addr_r'.

Pass 'kernel_addr_r' to fix booting via bootstd.

Signed-off-by: Fabio Estevam <festevam@denx.de>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
2025-02-27 09:42:49 -03:00
Fabio Estevam
65d150bf7b imx93_evk: Pass kernel_addr_r
Currently, booting via bootstd fails because the kernel cannot be retrieved.
The reason for this is the lack of 'kernel_addr_r'.

Pass 'kernel_addr_r' to fix booting via bootstd.

Signed-off-by: Fabio Estevam <festevam@denx.de>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
2025-02-27 09:42:47 -03:00
Peng Fan
542cac02d0 imx8mm: imx8mm_evk: fix BOOTSTD boot
Select BOOTSTD_FULL and BOOTSTD_BOOTCOMMAND
Correct DEFAULT_FDT_FILE
Correct env file for imx8mm_evk_fspi_defconfig

Fixes: 364ba68ed1 ("imx: imx8mm_evk: Switch to BOOTSTD")
Reported-by: Ludwig Nussel <ludwig.nussel@siemens.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
2025-02-27 08:14:37 -03:00
Peng Fan
46a110aac0 imx8mq: imx8mq_evk: fix DEFAULT_FDT_FILE
The CONFIG_DEFAULT_FDT_FILE should be imx8mq_evk.dtb for this board

Fixes: 7050bd925f ("imx: imx8mq_evk: Switch to BOOTSTD")
Reported-by: Ludwig Nussel <ludwig.nussel@siemens.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
2025-02-27 08:14:37 -03:00
Tom Rini
57bbc4de75 Merge tag 'qcom-fixes-2025.04-rc4' of https://source.denx.de/u-boot/custodians/u-boot-snapdragon
CI: https://source.denx.de/u-boot/custodians/u-boot-snapdragon/-/pipelines/24841

The clk_stub, regulator, and pinctrl fixes enable the sdcard on the RB5
dev board (and sm8250 devices broadly). clk_stub is only enabled in
qcom_defconfig and the others are qcom specific so these shouldn't
affect other platforms.

Lastly, a small ufetch fix from Sam which gets color rendering correctly
on U-Boots framebuffer video device.
2025-02-26 08:55:32 -06:00
Sam Day
6267ce5565 cmd: ufetch: use 3-bit colour ANSI codes
Currently, the 8-bit escapes are being used, which aren't supported by
vidconsole_escape_char. Since the current usage maps directly to the
3-bit equivalents anyway, let's use those instead.

With this change, the fetch output looks as fetching in the vidconsole
as it does over serial!

Signed-off-by: Sam Day <me@samcday.com>
Tested-by: Alexey Minnekhanov <alexeymin@postmarketos.org>
Tested-by: Ferass El Hafidi <funderscore@postmarketos.org>
2025-02-26 13:48:27 +00:00
Caleb Connolly
554562f7b5 pinctrl: qcom: sm8250: fix pin count
The pin count wasn't updated when the special pins were added, as a
result it was never possible to configure the special pins on SM8250
boards.

Fix the pin count and allow the special pins to be configured. This
fixes sdcard support on the RB5.

Fixes: 58fa520424 ("pinctr: qcom: sm8250: add special pins pins configuration data")
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Tested-by: Amit Pundir <amit.pundir@linaro.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2025-02-26 13:48:27 +00:00
Caleb Connolly
e57b72abb7 power: regulator: add additional supported LDOs for pm8150l
Add the other LDOs that our rpmh driver can currently support. Some of
these are used on the RB5 to power the sdcard.

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Tested-by: Amit Pundir <amit.pundir@linaro.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2025-02-26 13:48:27 +00:00
Julius Lehmann
506f6a384c clk: stub: add sm8150 compatible id
Add support for sm8150 clock controller to clk stub driver.

Signed-off-by: Julius Lehmann <lehmanju@devpi.de>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
2025-02-26 13:16:40 +00:00
Caleb Connolly
b72d6a9d61 qcom_defconfig: enable stub clock
Enable the stub clock driver for rpmcc

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2025-02-26 13:16:40 +00:00
Caleb Connolly
d31a3bd08e clk: add stub clock driver
Add a stub clock driver which can be used to bind clock controllers
which aren't required for the platform to boot, but which are needed for
U-Boot drivers to work.

In addition, add a NOP parent driver to allow for binding the parent
nodes of the clock.

Initially this driver supports a Qualcomm platform where the MMC driver
tries to fetch the RPM clock controller, which is not actually required
for the device to work.

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2025-02-26 13:16:40 +00:00
Tom Rini
dc0ee458f1 Prepare v2025.04-rc3
Signed-off-by: Tom Rini <trini@konsulko.com>
2025-02-24 16:53:59 -06:00
Marek Vasut
dbb9e136b8 mmc: Fix size calculation for sector addressed MMC version 4
For eMMC v4 and newer that is smaller than 2 GiB, the JEDEC JESD84-B51
section 6.2.4 Configure partitions indicates that EXT_CSD SEC_COUNT
should not be used to determine device size, and instead device size
should be calculated from C_SIZE and C_SIZE_MULT.

This is not exactly accurate, the 2 GiB limit is not a hard line,
there are eMMC devices which are smaller than 2 GiB and still
require device size to be determined from EXT_CSD SEC_COUNT. The
hard line is instead OCR HCS bit, which indicates whether the device
is byte or sector addressed, the former applies to most devices
below 2 GiB, and the later applies mostly to devices above 2 GiB.

However, there are a couple of devices which are smaller than 2 GiB
and still set the OCR HCS bit to indicate they are sector addressed,
and therefore the size calculation for those devices should also
use EXT_CSD SEC_COUNT . Use mmc->high_capacity flag to discern the
devices instead of arbitrary 2 GiB limit. The mmc->high_capacity flag
reflects the OCR HCS bit state.

Fixes: 639b7827d1 ("mmc: fix the condition for MMC version 4")
Signed-off-by: Marek Vasut <marex@denx.de>
2025-02-24 14:16:28 -06:00
Joao Marcos Costa
59fd62d71c fs/squashfs: fix potential integer overflows
The length of buffers used to read inode tables, directory tables, and
reading a file are calculated as: number of blocks * block size, and
such plain multiplication is prone to overflowing (thus unsafe).

Replace it by __builtin_mul_overflow, i.e. safe math.

Signed-off-by: Joao Marcos Costa <joaomarcos.costa@bootlin.com>
2025-02-24 08:49:04 -06:00
Tom Rini
5061eab96a Merge branch 'picasso' of https://source.denx.de/u-boot/custodians/u-boot-tegra
Branch contains bringup of Acer Iconia Tab A500 (codename picasso), a
Tegra 2 Android device with decent Linux kernel support. Ondevice tests
and U-Boot test suit all passed.
2025-02-22 08:42:01 -06:00
Tom Rini
313b9856f9 Pull request efi-2025-04-rc3
UEFI:
 
 * create a parent device for all EFI block devices
 * move lmb_map_update_notify() to EFI
 * make efi_add_memory_map_pg() static
 * remove comparisons to string literals from runtime
 * ix potential deref-after-null
 
 Other:
 
 * avoid superfluous value check in lmb_map_update_notify()
 * support more efi protocols in uuid_guid_get_str()
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEK7wKXt3/btL6/yA+hO4vgnE3U0sFAme3XJYACgkQhO4vgnE3
 U0tbDRAAo8wMa/PLC0dB/NRwCclbZxRfLbirwKTawPC5Ub8HYH5aXtvd4JW+qvKJ
 A1fz8092P1Rbv8zXILME6Cig3LOBZrvQhbgfTKbPK/VYXrpLPD0f6jyfEywLj1Fn
 pqMp0VkH60qj9xh3axqdJPS1lL7yGr6+L1AOmqptZ6hr2IjtWGZ7/VYj26WqIf9X
 awV7hjmxJTwvivy9aezcb3cyBq82TvVLfm+TFTsXJHIlgbYnyYHE3b5uuM+XOOgt
 bVL+Wj4kEU1t7qtkR7ZTn6k1VyEgSRecdJP0Q4pP3TFLxUX2ku4MyHvCl4BwQOBf
 UV4AT2SgiOIZKcaVpzb1ukMACgCBba6RTvjB86MWU9N0dgbHs8ZTXmmQPYmEUxgR
 68ufeA89xuSFNoQ8ft2lMYjfY0OjtNr6riTVdEeEwXVq+r/ogCY/p2/NpRMAR8LG
 yNwLBQ3Hwqmyy+VYHJ53anvRR44hPf4ZFLtlgGtuDEfrgZ03ZNU5TPB+1v6A0C1L
 K772WYp6LOn1nedYoWp3fB5GhA1oiFdUvgOXi0nxkPr1jW+rewAFyGWtV8AP9msz
 AtAEfJPLBV4LhxZBR4mHADeOAt+AUThWRuY1i3yOg1o+XAJazK3K2DIlfnmr4cc1
 TZbMR4NPTtgpZomJlSYlGWRutgQwHt/la5qlfF+sFdqUmy+Dq/A=
 =7bV8
 -----END PGP SIGNATURE-----

Merge tag 'efi-2025-04-rc3' of https://source.denx.de/u-boot/custodians/u-boot-efi

CI:

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

UEFI:

* create a parent device for all EFI block devices
* move lmb_map_update_notify() to EFI
* make efi_add_memory_map_pg() static
* remove comparisons to string literals from runtime
* ix potential deref-after-null

Other:

* avoid superfluous value check in lmb_map_update_notify()
* support more efi protocols in uuid_guid_get_str()
2025-02-20 11:21:41 -06:00
Tom Rini
7a6dbb9dbe Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-riscv
CI: https://source.denx.de/u-boot/custodians/u-boot-riscv/-/pipelines/24692

- board: VisionFive 2: Update maintainer file
- configs: starfive: Add LwIP network and wget command
- configs: microchip: set DEFAULT_FDT_FILE
2025-02-20 08:34:52 -06:00
Tom Rini
ee69293e0d Merge tag 'u-boot-rockchip-20250220' of https://source.denx.de/u-boot/custodians/u-boot-rockchip
CI: https://source.denx.de/u-boot/custodians/u-boot-rockchip/-/pipelines/24690

Please pull the fixes for rockchip platform:
- Fix for rk3399 bob and kevin
- Fix for sdram more than 4GB
- Fix for dwc_eth on rk356x/rk3588
- Fix for sdmmc access on rk33080rock-s9
2025-02-20 08:32:53 -06:00
Heinrich Schuchardt
5ce629db25 efi_loader: make efi_add_memory_map_pg() static
The function is only used in the efi_memory.c module.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2025-02-20 11:09:33 +01:00
Heinrich Schuchardt
41d5734442 lmb: move lmb_map_update_notify() to EFI
When building with qemu_arm64_defconfig with CONFIG_CC_OPTIMIZE_FOR_DEBUG=y
and CONFIG_EFI_LOADER=n an error undefined reference to efi_add_memory_map_pg
occurs.

Move the EFI dependent part of lmb_map_update_notify() to the EFI
sub-system.

Reported-by: Liya Huang <1425075683@qq.com>
Acked-by: Liya Huang <1425075683@qq.com>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2025-02-20 11:09:33 +01:00
Heinrich Schuchardt
08573d7688 lmb: avoid superfluous value check in lmb_map_update_notify()
Instead of testing the value of parameter op at runtime use an enum to
ensure that only valid values are used.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2025-02-20 11:09:33 +01:00
Heinrich Schuchardt
bd8bc53162 efi_driver: create a parent device for all EFI block devices
Up to now root has been the parent device for all block devices created via
calling ConnectController(). This does not work well together with the
implementation of bootstd.

Add a dummy parent device for all EFI block devices.

With this change EFI block devices are also accessible via commands like
'cat', 'load', and 'ls'.

    => dm tree
     Class     Seq    Probed  Driver                Name
    -----------------------------------------------------------
     efi           0  [ + ]   EFI block driver      `-- efi
     blk           3  [ + ]   efi_blk                   `-- efi.efiblk#0
     partition     0  [ + ]   blk_partition                 `-- efi.efiblk#0:1

    => ls efiloader 0:1
           13   hello.txt
            7   u-boot.txt
    2 file(s), 0 dir(s)

    => cat efiloader 0:1 hello.txt
    Hello world!

    => efidebug dh
    0000000018df1700 (efi.efiblk#0:1)
      /VenHw(dbca4c98-6cb0-694d-0872-819c650cb7b8)/HD(1,MBR,0xd1535d21,0x1,0x7f)
      Block IO
      Simple File System

Adjust the event dump unit test to consider the new event spy.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2025-02-20 11:07:44 +01:00
Ilias Apalodimas
530e869ff8 efi_loader: remove comparisons to string literals from runtime
For EFI runtime services, we manage to preserve string literals
by placing the .efi_runtime section just before .data and preserving
it when marking the runtime memory by marking surrounding boottime
code as runtime. This is ok for now but will break if we update any
linker scripts and decouple .text and .runtime sections.

So let's define the strings we used to compare in the appropriate
section for runtime services

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
2025-02-20 09:22:53 +01:00
Maks Mishin
80908fee77 efi_loader: Fix potential deref-after-null
After having been compared to a NULL value at efi_disk.c:426,
pointer 'part_info' is dereferenced at efi_disk.c:534.

Signed-off-by: Maks Mishin <maks.mishinFZ@gmail.com>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2025-02-20 09:04:12 +01:00
Vincent Stehlé
87ef1987de lib: uuid: support more efi protocols in uuid_guid_get_str()
Add more EFI protocols GUIDs to the translation table used by
uuid_guid_get_str().

Signed-off-by: Vincent Stehlé <vincent.stehle@arm.com>
Cc: Tom Rini <trini@konsulko.com>
2025-02-20 08:40:52 +01:00
E Shattow
399a03442f configs: starfive: use LwIP network stack and enable wget command
Use LwIP network stack and enable wget HTTP command. The tftpput command
is not currently supported by LwIP network stack so remove it.

Signed-off-by: E Shattow <e@freeshell.de>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2025-02-20 12:18:41 +08:00