6777 Commits

Author SHA1 Message Date
Leo Yu-Chi Liang
89e4154431 common: spl: fix compilation warning
Explicitly specify the type by replacing macro with variable
to fix the possible compilation warning.

Signed-off-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2025-08-14 15:33:00 +08:00
Tom Rini
6549dbfd26 Merge patch series "Extend usb_onboard_hub driver to support Cypress HX3 hub family"
Lukasz Czechowski <lukasz.czechowski@thaumatec.com> says:

This patch series extends the usb_onboard_hub driver to allow for
support of more types of onboard hub devices, and adds the Cypress HX3
hub family.

First patch in the series updates the bind function, so that it no
longer uses hardcoded compatible strings.
Next patch simplifies the code, by removing unnecessary dm_gpio function
call.
Third patch updates the remove function, which allows the prevent issues
with usb devices reenumeration, in case of calling "usb reset". Although
the issue could still occur in case of invalid initial state of reset
gpio, it is minimized with no impact on main usb_hub driver.
Fourth patch extends the driver with support for multiple power
supplies, the same way it is done in kernel driver.  Finally, last patch
provides hub data and of_match table entries for Cypress HX3

Link: https://lore.kernel.org/r/20250722-usb_onboard_hub_cypress_hx3-v4-0-91c3ee958c0e@thaumatec.com
2025-07-30 08:20:35 -06:00
Lukasz Czechowski
a1f8103bbe usb: onboard-hub: Add support for Cypress HX3 family
The HX3 is a family of USB3.0 hub controllers that comes in
different variants: CYUSB330x/CYUSB331x/CYUSB332x/CYUSB230x.
To support this hub, controlling of reset pin and two
power supplies is required.
The reset time is set to 10ms, based on the datasheet [1].
Power-on delay time is not required, so it is set to 0.
The compatible strings added to of_match table are
compliant with usb/cypress,hx3.yaml bindings.

[1] https://www.infineon.com/dgdl/Infineon-HX3_USB_3_0_Hub_Consumer_Industrial-DataSheet-v22_00-EN.pdf?fileId=8ac78c8c7d0d8da4017d0ecb53f644b8

Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
Signed-off-by: Lukasz Czechowski <lukasz.czechowski@thaumatec.com>
2025-07-30 07:57:17 -06:00
Lukasz Czechowski
3eb6b0f504 usb: onboard-hub: Add support for multiple power supplies
Some of the onboard hubs require multiple power supplies, so extend
the driver to support them.
The implementation is inspired by the kernel driver, as introduced
by commit [1] in the v6.10 kernel.

[1] ec1848cd5d

Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
Signed-off-by: Lukasz Czechowski <lukasz.czechowski@thaumatec.com>
2025-07-30 07:57:17 -06:00
Lukasz Czechowski
42a025412d usb: onboard-hub: Set the reset gpio pin before freeing
In the usb_onboard_hub_remove, the reset gpio, if available, is
freed. The pin state however, remains unchanged, as set in the
usb_onboard_hub_reset. The hub is then left enabled.

During second onboard hub probing, the hub is initially enabled
(reset pin in state "0"), and then it is being reset by the reset
function (transition to "1" and then to "0"). Because of this,
the hub first disconnects from root hub, and then it connects again.

When the devices are being discovered in the usb_scan_port in the
usb_hub driver, initially there is the USB_PORT_STAT_CONNECTION bit
not set in portstatus, but USB_PORT_STAT_C_CONNECTION set in
portchange data (which is because disconnect event occurred first).
In this condition, the driver does not wait for devices to appear.
This can cause the hub (and all child devices) to be not enumerated
when rescanning on "usb reset" command.

To fix this, set the reset gpio to active in usb_onboard_hub_remove,
to put the hub into reset state.
However, in case the hub reset pin is by default held in high
state by HW before U-Boot takes over, in which case the USB hub is
active, then during the first probe it gets reset and we might get
into the same issue of the hub being not enumerated.

Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
Signed-off-by: Lukasz Czechowski <lukasz.czechowski@thaumatec.com>
2025-07-30 07:57:17 -06:00
Lukasz Czechowski
480753ca92 usb: onboard-hub: Use devm API do automatically free the reset GPIO
The reset GPIO is obtained during driver probing by the function
devm_gpiod_get_optional, which means the GPIO will be automatically
freed when the device is removed. Because of this, explicit call
to free the reset GPIO in hub remove function is not needed.
To support the Managed device resources, the DEVRES config must
be enabled, otherwise the devres functions fall back to non-managed
variants. Set the necessary dependency to DEVRES in Kconfig.

Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
Signed-off-by: Lukasz Czechowski <lukasz.czechowski@thaumatec.com>
2025-07-30 07:57:17 -06:00
Lukasz Czechowski
a4446e13db usb: onboard-hub: Use the ofnode to check if the peer-hub was probed
Currently the check in usb_onboard_hub_bind is relying on specific
compatible string for the Michrochip USB5744. Replace this with
more generic approach that will allow to add new types of devices
to the of_match table. Because the driver only needs to bind one
"half" of the hub, the peer-hub node is used to find out if it
was already done. In case peer-hub was bound, -ENODEV is returned.

Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
Signed-off-by: Lukasz Czechowski <lukasz.czechowski@thaumatec.com>
2025-07-30 07:57:17 -06:00
Andrew Goodbody
ae409a84e7 spl: NULL check variable before dereference
In boot_from_devices the variable loader is not NULL checked after
assignment and before first use but later code does check it for NULL.
Add a NULL check before first use.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
2025-07-29 13:12:12 -06:00
Casey Connolly
174128ad6e treewide: fix Casey's name
I updated the mailmap a while back but it's nice to have authorship
comments adjusted too.

Signed-off-by: Casey Connolly <casey.connolly@linaro.org>
2025-07-28 08:53:20 -06:00
Andre Przywara
08f3f477c6 sunxi: add basic A523 support
Add the basic Kconfig options, addresses and other values for the
existing Kconfig settings for the new Allwinner A523/T527/H728 SoC.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2025-07-27 23:11:31 +01:00
Ye Li
10b6d472d2 spl: spl_imx_container: Delete uninitialized variable
The 'overhead' variable is uninitialized and actually shall not be used.
Delete it to fix coverity CID 37041718 - Uninitialized scalar variable.

Fixes: 73c40fcb7367 ("spl: Refactor spl_load_info->read to use units of bytes")
Reported-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Reviewed-by: Andrew Goodbody <andrew.goodbody@linaro.org>
2025-07-24 08:00:47 -03:00
Ye Li
42337445b5 spl: imx: Add support for new PQC container
To support PQC container format which is used for post quantum
authentication on new i.MX parts like i.MX94

The major changes compared to legacy container format is in
signature block, new container tag and version, and new alignment
of container header.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Jacky Bai <ping.bai@nxp.com>
Signed-off-by: Alice Guo <alice.guo@nxp.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
2025-07-17 09:56:33 -03:00
Tom Rini
d9a9b4e352 common/avb_verify.c: Make use of LBAF for printing lbaint_t
When printing the contents of an lbaint_t variable we need to use LBAF
to print it in order to get the correct format type depending on 32 or
64bit-ness.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Sam Protsenko <semen.protsenko@linaro.org>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
Link: https://lore.kernel.org/r/20250702010603.19354-2-trini@konsulko.com
Signed-off-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
2025-07-16 10:56:28 -06:00
David Zang
5f70be08b0 Fix autoboot countdown printing wrong
Originally when bootdelay >99, the countdown breaks. Setting bootdelay
at 101 or bigger will trigger this error.

Signed-off-by: David Zang <davidzangcs@gmail.com>
2025-07-14 15:16:53 -06:00
Tom Rini
7adb9b03a6 Kconfig: Test for !COMPILE_TEST in some locations
We have a few options that we cannot enable in a "allyesconfig" type
build because we cannot use zero as a default value.

- The logic around HAS_BOARD_SIZE_LIMIT assumes that if we have set this
  then we compare with it. Similarly, we need to set SPL_NO_BSS_LIMIT as
  the default there.
- Both SYS_CUSTOM_LDSCRIPT and ENV_USE_DEFAULT_ENV_TEXT_FILE then prompt
  for a file name to use.
- The SYS_I2C_SOFT driver is a legacy driver which requires a lot of
  configuration within the board config. file instead, so disable it.

Signed-off-by: Tom Rini <trini@konsulko.com>
2025-07-11 11:33:25 -06:00
Tom Rini
d0ed963690 global: Make ARCH_MISC_INIT a selected symbol
This symbol is not something that the user should be enabling or
disabling but rather the developer for a particular board should select
it when required.

This is mostly size neutral, however a few places do have changes. In
the case of i.MX6ULL systems, it is always the case that
arch_misc_init() could call setup_serial_number() and do useful work,
but was not enabled widely, but now is. In the case of i.MX23/28
systems, we should be able to call mx28_fixup_vt() again here, so do so.
Finally, some platforms were calling arch_misc_init() and then not doing
anything and this results in removing the option.

Acked-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
2025-07-11 11:33:25 -06:00
Tom Rini
6bb0679377 Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-sh
- SH Ether clean ups, RZ/A1 clean ups, RZ/A1 Genmai support
- Gen3 EEPROM DT node clean up
- V4H SA0 BootROM compatible binman etype, SCIF compatible SREC
  generation for Gen4
2025-07-10 16:44:08 -06:00
Marek Vasut
26758c24b9 arm64: renesas: Add Renesas R-Car Gen4 SCIF/HSCIF loader SREC generation
Add Renesas R-Car Gen4 SCIF/HSCIF loader compatible SREC generation.
This is a regular U-Boot SPL SREC augmented with a short header which
describes where to store the received data and how much data to store.
This header is interpreted by the R-Car Gen4 BootROM SCIF/HSCIF loader.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2025-07-10 19:26:55 +02:00
Tom Rini
3393f3ddac common/log_syslog.c: Add missing include of <env.h>
This file was making environment calls without including <env.h> and so
relying on an indirect inclusion from elsewhere. Add the missing include
directly.

Signed-off-by: Tom Rini <trini@konsulko.com>
2025-07-10 08:41:12 -06:00
Andrew Goodbody
ebb2c9e550 common: readline: Fix always true test
The variable base is unsigned so >= 0 is always true. Fix this test
so that it is actually useful. The fix prevents the code from causing
a segfault in the case where Ctrl-w is pressed on a line consisting
only of spaces.

Fixes: dcc18ce0dbaf ("cli: Implement delete-word in cread_line()")
Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
2025-07-08 15:35:49 -06:00
Tom Rini
6d0b8874fd Merge branch 'next' 2025-07-07 14:10:59 -06:00
Tom Rini
5ac65a4851 Merge patch series "spl: fix error handling in spl_fit_get_image_name()"
Heinrich Schuchardt <heinrich.schuchardt@canonical.com> says:

spl_fit_get_image_name() used to lack a detection of malformed image name
properties in FIT images. The change in commit 3704b888a4ca ("common/spl:
fix potential out of buffer access in spl_fit_get_image_name function")
tried to fix this  but led to function spl_fit_get_image_name() no longer
detecting if a property at index > 1 does not exist.

This patch is reverted.

An explicit check for malformed image name properties is introduced.

Link: https://lore.kernel.org/u-boot/38f5d078-3328-4bdb-9c95-4fb5fe89ddc2@gmx.de/T/#u
Link: https://lore.kernel.org/r/20250624153431.46986-1-heinrich.schuchardt@canonical.com
2025-06-26 11:58:21 -06:00
Heinrich Schuchardt
79f8f31d58 common/spl: guard against buffer overflow in spl_fit_get_image_name()
A malformed FIT image could have an image name property that is not NUL
terminated. Reject such images.

Reported-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Tested-by: E Shattow <e@freeshell.de>
2025-06-26 11:58:17 -06:00
Heinrich Schuchardt
6ef9a89c1d common/spl: Revert fix potential out of buffer access in spl_fit_get_image_name function
The change in commit 3704b888a4ca ("common/spl: fix potential out of buffer
access in spl_fit_get_image_name function") led to function
spl_fit_get_image_name() no longer detecting if a property does not exist
at a non-zero buffer.

Link: https://lore.kernel.org/u-boot/38f5d078-3328-4bdb-9c95-4fb5fe89ddc2@gmx.de/T/#m59f3a23e675daa992c28d12236de71cae2ca2bb9
Fixes: 3704b888a4ca ("common/spl: fix potential out of buffer access in spl_fit_get_image_name function")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Tested-by: E Shattow <e@freeshell.de>
2025-06-26 11:58:17 -06:00
Andre Przywara
fb4c3b2a04 sunxi: add support for the Allwinner A100/A133 SoC
The Allwinner A100 SoC has been around for a while, mostly on cheap
tablets, but didn't generate much interest in the community so far.
There were some efforts by two Allwinner employees in 2020, which led
to basic upstream Linux support for that SoC, although this momentum
dried up pretty quickly, leaving a lot of peripherals unsupported.

The A100 was silently replaced with the seemingly identical Allwinner
A133, which is reportedly a better bin of the A100. So far we assume
that both are compatible from a software perspective. There are some
more devices with the A133 out there now, so people are working on
filling the gaps, and adding U-Boot (and TF-A) support.

Based on the just added pinctrl, clock and DRAM support, this adds the
missing bits, mostly addresses and values for the SPL.

The A133 seems to be an predecessor to the H6, so we can share a lot of
code with that (and the H616 code), and just need to adjust some details.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2025-06-24 01:59:09 +01:00
Tom Rini
184e7d0bb2 Prepare v2025.07-rc5
-----BEGIN PGP SIGNATURE-----
 
 iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmhZtLAACgkQFHw5/5Y0
 tyyl/gv+LLsF/PdBp93gXaUVFQwh3lrAWltjK6n+gKDpIazlX8Ajiu2tFBzYgBdP
 JNp3PsHJ8ER/GpU4nG/13KfWg8c4CGvAqY0zLxKufMckBdZAE5EwztvSNzZKZA6f
 5FQCecidpwlWBNZRWVbxAAtl83nGBwUmgPAoxDBv4I7DQBJD7mJfzxVnWZuwSioP
 ix3aingjRSIUpldHR5IAQfEmnPPfv7IS6EYb2lOoV22WtTfnF6bpteR/2OUxnW6z
 YxXHaZrDkIfE+gXYOQu5Tau8R0ca4l+ws8GaocTD9VVCDem8JU7b0GCfoXg+ry2Q
 dLYuROREeiXEi14I6arZznpPQM8iIAeDOy0w5b3qXbav0+GWB4rmJKLMniD5JT2r
 r8Kle/QeagILMVPOaUVgjmkEnft4thD14ipvr8kUCurUh1VtFYWTGzKVS47yHaxY
 I1zQaz1NNdtyQNWO/Nwbs+88C7v8q7DeLIIjUt2/J01Bu8ouf2WyfG04iBeZOitt
 CxBZ++2z
 =e4ez
 -----END PGP SIGNATURE-----

Merge tag 'v2025.07-rc5' into next

Prepare v2025.07-rc5

With this merge, tighten up the LTO_FLAGS removal we added to not
trigger on ARMv7 (which is Thumb-2 and should be fine).
2025-06-23 16:15:23 -06:00
Jerome Forissier
410d59095a arm: kirkwood: fix freeze on boot
Commit 6fe50e395080 ("arm: asm/system.h: mrc and mcr need .arm if
__thumb2__ is not set") is not a proper fix for the LTO link error
mentioned in its description. It causes 32-bit arm instructions to be
mixed with thumb instructions, which the Kirkwood SoCs do not support.
For example, board_init_r() is mostly generated in Thumb-1 mode as
expected since the build flags contain -mthumb -mthumb-interwork. The
MCR instruction corresponding to writefr_extra_feature_reg() is also
correcly emitted as a 32-bit ARM instruction (it cannot be encoded in
Thumb-1 anyways). The problem is, the compiler inlines the MCR without
generating the BX or BLX instruction which are needed to transition
between the ARM and the Thumb-1 states. From the objdump output:

006186a0 <board_init_r>:
board_init_r():
/home/jerome/work/u-boot/common/board_r.c:799
  6186a0:       b5f0            push    {r4, r5, r6, r7, lr}
  6186a2:       b0ab            sub     sp, #172        @ 0xac
get_gd():
/home/jerome/work/u-boot/./arch/arm/include/asm/global_data.h:127
  6186a4:       464a            mov     r2, r9
...
/home/jerome/work/u-boot/arch/arm/mach-kirkwood/cpu.c:242
  619aae:       9b15            ldr     r3, [sp, #84]   @ 0x54
writefr_extra_feature_reg():
/home/jerome/work/u-boot/./arch/arm/include/asm/arch/cpu.h:100
  619ab0:       ee2f3f11        mcr     15, 1, r3, cr15, cr1, {0}
                ^^^^^^^^
                32-bit ARM instruction

Further investigation is needed to understand how to fix the issue so
that the code size is minimal for all boards. In the mean time, this
fix disables LTO for the two problematic files (common/board_f.c and
common/board_r.c). This makes the Kirkwood-based boards bootable again.
The binary size is increased by 1048 bytes which is perfectly
acceptable.

Fixes: 6fe50e395080 ("arm: asm/system.h: mrc and mcr need .arm if __thumb2__ is not set")
Reported-by: Tony Dinh <mibodhi@gmail.com>
Tested-by: Tony Dinh <mibodhi@gmail.com>
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
2025-06-23 14:04:40 -06:00
Tom Rini
dbf7fd557a Merge patch series "Consistent Kconfig environment options CONFIG_ENV_ prefix"
Marek Vasut <marek.vasut+renesas@mailbox.org> says:

Rename the environment related variables and add ENV_ prefix, so that
all configuration options which are related to environment would have
an CONFIG_ENV_ prefix. No functional change.

Link: https://lore.kernel.org/r/20250609192701.20260-1-marek.vasut+renesas@mailbox.org
2025-06-20 12:57:47 -06:00
Marek Vasut
224224c9fa env: Drop DELAY_ENVIRONMENT
There are no users of DELAY_ENVIRONMENT and the same effect can
be achieved either using DT /config/load-environment property,
or by using ENV_IS_NOWHERE . Remove this configuration option
and matching functionality.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2025-06-20 12:15:08 -06:00
Marek Vasut
123682c765 env: Rename SYS_RELOC_GD_ENV_ADDR to ENV_RELOC_GD_ENV_ADDR
Rename the variable and add ENV_ prefix, so that all configuration
options which are related to environment would have an CONFIG_ENV_
prefix. No functional change.

Reviewed-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2025-06-20 12:15:08 -06:00
Mikhail Kshevetskiy
8bb9c275c4 common/spl: improve error handling in spl_fit
This fix a possible NULL pointer dereference.

There is also a risk of memory leaking within the same portion of code.
The leak will happen if loaded image is bad or damaged. In this case
u-boot-spl will try booting from the other available media. Unfortunately
resources allocated for previous boot media will NOT be freed.

We can't fix that issue as the memory allocation mechanism used here
is unknown. It can be different kinds of malloc() or something else.

To somewhat reduce memory consumption, one can try to reuse previously
allocated memory as it's done in board_spl_fit_buffer_addr() from
test/image/spl_load.c.

The corresponding comment was put to the code as well.

Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Reviewed-by: Anshul Dalal <anshuld@ti.com>
2025-06-19 11:01:51 -06:00
Mikhail Kshevetskiy
3eb43c54fa common/spl: handle properly images with bad checksum
load_simple_fit() returns -EPERM for the images with broken signatures.
Unfortunately this may conflict with image loaging selection on the base
of boot phase. See commit 873112db9ce68c38984ff25808dde726f8dd5573
("spl: Support selecting images based on phase in simple FIT").

Thus loading of

	configurations {
		uboot {
			description = "u-boot";
			firmware = "atf";
			loadables = "atf", "tee", "uboot";
		};
	};

with damaged "tee" image may finish without errors. This may results in
board bricking.

This patch fixes commit 873112db9ce68c38984ff25808dde726f8dd5573
("spl: Support selecting images based on phase in simple FIT")
by replacing EPERM with EBADSLT places where it should be done.

Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
2025-06-19 11:01:51 -06:00
Mikhail Kshevetskiy
3704b888a4 common/spl: fix potential out of buffer access in spl_fit_get_image_name function
The current code have two issues:
1) ineffective NULL pointer check

	str = strchr(str, '\0') + 1
	if (!str || ...

   The str here will never be NULL (because we add 1 to result of strchr())

2) strchr() may go out of the buffer for the special forms of name variable.
   It's better use memchr() function here.

   According to the code the property is a sequence of C-string like
   shown below:

     'h', 'e', 'l', 'l', 'o', '\0', 'w', 'o', 'r', 'l', 'd', '\0', '!', '\0'

   index is the string number we are interested, so

     index = 0   =>  "hello",
     index = 1   =>  "world",
     index = 2   =>  "!"

   The issue will arrise if last string for some reason have no terminating
   '\0' character. This can happen for damaged or specially crafted dtb.

Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Reviewed-by: Tom Rini <trini@konsulko.com>
2025-06-19 11:01:51 -06:00
Simon Glass
f73450918d spl: Rename jump_to_image_no_args()
This function is currently a misnomer at times as we have cases where it
passes arguments to the image. In preparation for making that be a more
common case rename this function to jump_to_image(...). In order to do
this, rename jump_to_image in board_init_r(...) to jumper so that we do
not have a conflict.

Signed-off-by: Simon Glass <sjg@chromium.org>
[trini: Reword the commit message, adding missing cases of
        jump_to_image_no_args()]
Signed-off-by: Tom Rini <trini@konsulko.com>
2025-06-13 13:22:53 -06:00
Tom Rini
59d00e20fc Prepare v2025.07-rc4
-----BEGIN PGP SIGNATURE-----
 
 iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmhHWBoACgkQFHw5/5Y0
 tyxXAQv/T9LMNIwewuJ3EsJavypFdXb1p33PmbRELYK8S96CpTBBJXCoDAc6+Xfu
 ilUES9Weml8Ott+L3CbJTUtohLRfrWZGW6cx8/nYOhhUFWDqkCdpWGnEFPM0Basp
 lyBBxzqxPH5TbUQPUnhJ/2n1LclaF7tehn7GwDQUdQRsAc3fsJr+4Yx+TjeY30YQ
 CcYC+AvJ/M0ev2EmHNsZZGY9xJi67KdHLHNx6cEJ714BZihIu4EShVk7yvI9zM7O
 /hd4S10VGqHltB1KCRfnbfSD68rzS2h2TI4QZg3Ye8ldU+ZCFeTeNhBgO89VMoh9
 2HhQxxvfGDyuUsmoThUHZGvdq2EmRcyIKjRteQzFhrJr2Gk905vdpIGQdej8EG1x
 w6okxdFOWEOXTMShHv72Gcx8PzTVFtTUcYYge7N85rVirZpZmBKvaFzBCfrZ6gEh
 x0n7o5LaZwc1jm8yuPiWZcCKi0Ve4AIXBjweQRXJ/A6Y0Z/vEYYybPKMRRTuNpSy
 OyXQK8/y
 =uKu6
 -----END PGP SIGNATURE-----

Merge tag 'v2025.07-rc4' into next

Prepare v2025.07-rc4
2025-06-09 16:28:28 -06:00
Heinrich Schuchardt
8b410cab51 configs: raise SPL_SYS_MALLOC_SIZE to 8 MiB on RISC-V
On several RISC-V boards we have seen that 1 MiB is a insufficient value
for CONFIG_SPL_SYS_MALLOC_SIZE.

For instance qemu-riscv32_spl_defconfig fails booting because u-boot.itb
exceeds 1 MiB.

8 MiB is a reasonable value that allows adding FPGA blobs or splash images
to main U-boot.

Reported-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2025-06-09 10:43:57 +08:00
Christian Marangi
8c986521c3 cmd: bootmenu: permit to select bootmenu entry with a shortcut
Permit to select a bootmenu entry with a key shortcut. This is
especially useful in production or testing scenario to automate flashing
procedure or testing procedure.

The boot entry are changed to append the shortcut key to it.

Example:
      1. Run default boot command.
      2. Boot system via TFTP.
      3. Boot production system from NAND.
      4. Boot recovery system from NAND.
      5. Load production system via TFTP then write to NAND.
      6. Load recovery system via TFTP then write to NAND.
      7. Load BL31+U-Boot FIP via TFTP then write to NAND.
      8. Load BL2 preloader via TFTP then write to NAND.
      9. Reboot.
      a. Reset all settings to factory defaults.
      0. Exit

0 is always reserved for Exit to console.
On pressing the keyboard key 2, the bootmenu entry 2 is selected and
executed.

Up to 34 key shortcut (0 excluded as reserved) are supported from 1-9
and a-z.
If a shortcut key not present in the bootmenu list is pressed, it is
simply ignored and eventually the autoboot is interrupted.

Capital A-Z are converted to lower a-z and the related option is
selected.

Suggested-by: Weijie Gao <weijie.gao@mediatek.com>
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Tested-by: Petr Štetiar <ynezz@true.cz>
2025-06-05 16:57:35 -06:00
Tom Rini
b3f69c1418 AMD/Xilinx/FPGA changes for v2025.07-rc4
usb:
 - Fix regulator handling
 
 net:
 - Fix MII clock handling
 
 phy:
 - Fix GTR line logic for sgmii
 
 pci:
 - Fix pcireg_base logic
 
 fpga:
 - Fix change handling in intel_sdm_mb driver
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYIAB0WIQSXAixArPbWpRanWW+rB/7wTvUR9QUCaEE3QwAKCRCrB/7wTvUR
 9VEkAQC/Gn3EUD9ZRNv03NQFH1nWRBVYooNClEyAKngRg540SAEAoIqIUBvBAXqi
 BATlW6Qlyld62ofaeb6SUnedzOcSMw0=
 =PZ8J
 -----END PGP SIGNATURE-----

Merge tag 'xilinx-for-v2025.07-rc4' of https://source.denx.de/u-boot/custodians/u-boot-microblaze

AMD/Xilinx/FPGA changes for v2025.07-rc4

usb:
- Fix regulator handling

net:
- Fix MII clock handling

phy:
- Fix GTR line logic for sgmii

pci:
- Fix pcireg_base logic

fpga:
- Fix change handling in intel_sdm_mb driver
2025-06-05 08:40:42 -06:00
Simon Glass
4ef863f2d6 x86: Correct condition for init_cache_f_r()
The condition here is reversed, which makes link and coral very slow,
leading to lab failures.

Fixes 6c171f7a184 ("common: board: make initcalls static")

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
2025-06-04 08:15:12 -06:00
Padmarao Begari
77b053502f usb: onboard-hub: Fix return type for regulator APIs
Apart from ENOENT observing return value as ENOSYS when
!DM_REGULATOR that's why cover both configurations.
Changed code is not working as operation should be "&&"
not "||" (ret != -ENOENT && ret != -ENOSYS).

Also fix the remove function where the regulator_set_enable_if_allowed()
function is returning an error.

Signed-off-by: Padmarao Begari <padmarao.begari@amd.com>
Reviewed-by: Marek Vasut <marex@denx.de>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/a2d520f14efc30fc28ec59881205e156dabbfcd9.1744350937.git.michal.simek@amd.com
2025-06-04 10:24:16 +02:00
Tom Rini
d786c6b69f Merge patch series "Audit include list for include/[a-m]*.h"
Tom Rini <trini@konsulko.com> says:

Hey all,

Related to my other series I've posted recently on cleaning up some
headers, this series here is the result of at least lightly auditing the
#includes used in include/[a-m]*.h. This ignores subdirectories, as at
least in part I think the top-level includes we've constructed are the
most likely places to have some extra transitive include paths. I'm sure
there's exceptions and I'll likely audit deeper once this first pass is
done. This only gets as far as "include/m*.h" because I didn't want this
to get too big. This also sets aside <miiphy.h> and <phy.h>. While
miiphy.h does not directly need <phy.h> there are *so* many users and I
think I had half of the tree just about not building when I first tried.
It might be worth further investigation, but it might just be OK as-is.

Link: https://lore.kernel.org/r/20250521230119.2084088-1-trini@konsulko.com
2025-06-02 17:43:56 -06:00
Tom Rini
d81b57a3cc include/ide.h: Cleanup usage
At this point in time, <ide.h> provides the IDE_BUS macro and the
function prototype for ide_set_reset, which is used with IDE_RESET. The
only files which should include this header are the ones that either use
that macro or that function. Remove <blk.h> from <ide.h> and remove
<ide.h> from places which do not need it.

Signed-off-by: Tom Rini <trini@konsulko.com>
2025-06-02 17:26:16 -06:00
Tom Rini
43d76dc7df include/fat.h: Audit include list
This file does not need <asm/cache.h> so remove it. However the file
common/spl/spl_fat.c does need it, so add it there.

Signed-off-by: Tom Rini <trini@konsulko.com>
2025-06-02 17:26:15 -06:00
Tom Rini
e50dbb3a0a Merge patch series "Start removing <env.h> from headers when not required"
Tom Rini <trini@konsulko.com> says:

Given Simon's series at [1] I started looking in to what brings in
<env.h> when not strictly required and in turn has some unintended
implicit includes. This series takes care of the places where, commonly,
<linux/string.h> or <env.h> itself were required along with a few other
less common cases. This sets aside for the moment what to do about
net-common.h and env_get_ip() as I'm not entirely sure what's best
there.

[1]: https://patchwork.ozlabs.org/project/uboot/list/?series=454939&state=*
Link: https://lore.kernel.org/r/20250514225002.15361-1-trini@konsulko.com
2025-05-29 08:29:24 -06:00
Tom Rini
dcb7d927d1 global: Avoid indirect inclusion of <env.h> from <command.h>
The include file <command.h> does not need anything from <env.h>.
Furthermore, include/env.h itself includes other headers which can lead
to longer indirect inclusion paths. To prepare to remove <env.h> from
<command.h> fix all of the places which had relied on this indirect
inclusion to instead include <env.h> directly.

Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org> # android, bcb
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> # spawn
Signed-off-by: Tom Rini <trini@konsulko.com>
2025-05-29 08:29:16 -06:00
Tom Rini
39b815d02d Prepare v2025.07-rc3
-----BEGIN PGP SIGNATURE-----
 
 iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmg05QAACgkQFHw5/5Y0
 tywvZwv+NXX8pDhTbJgUnY3jgR2oHAU/G9iL5o9+Wbpi+5k1x9o8fjCav0lkfG0g
 Y+03bPlfH8p1eYsXN/oaP4nBPcRYO5EWf1ibj+X2kKl+fZRALje2nkF5voL+wK9w
 Gz7Gu0SGWhyP1+VajD4b7DaAJMLdZ5y6JsoWqnw3HwMzKgZCxVnnOXTtPtCVf7oU
 HacjUNxc63twcduCQr7yvwp7yL75uduHnpdn+Slh+epNMgq8sjVsHBm7ixSBM1VW
 3TPRTFnyyPjyDq6Xu4KIVzKVrwps5qV9MHcA+boY4cghltbLyZP5mMvK7tpUnWEr
 DnrA7XHJ5QwJA4CzEHPBLYD2CpGD9GPszY7M4AWHJQSGUKLnQgq/OMas7h6ZPkhF
 1poNjnok+siiMvn4qWRv/lmKVHy+d4QUcA6Y3SZZ/L7q28AgTKdsEp5kljb2UrOe
 JJZ6M0xCVbdNLZkjU89twPbczIkyqkmMc9ewnyvn81fFDsx9SCFq5eZSbl2O7LLw
 on5dPrqP
 =H01a
 -----END PGP SIGNATURE-----

Merge tag 'v2025.07-rc3' into next

Prepare v2025.07-rc3
2025-05-26 16:07:19 -06:00
Ben Dooks
86acdce2ba common: add config for board_init() call
Add CONFIG_BOARD_INIT to specifu if the board_init() needs calling
during initcall phase, and default it to 'y' for the relevant
architectures which probably need it.

This allows anyone with a board that doesn't need it to just remove
it from the initcall list w/o an empty code block in the board init
file.

Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
Reviewed-by: Tom Rini <trini@konsulko.com>
2025-05-22 13:55:17 -06:00
Christoph Niedermaier
1e24e84db4 tiny-printf: Handle formatting of %p with an extra Kconfig
The formatting with %pa / %pap behaves like %x, which results in an
incorrect value being output. To improve this, a new fine-tuning
Kconfig SPL_USE_TINY_PRINTF_POINTER_SUPPORT for pointer formatting
has been added. If it is enabled, the output of %pa / %pap should
be correct, and if it is disabled, the pointer formatting is
completely unsupported. In addition to indicate unsupported formatting,
'?' will be output. This allows enabling pointer formatting only
when needed. For SPL_NET it is selected by default. Then it also
supports the formatting with %pm, %pM and %pI4.

In summery this level of %p support for tiny printf is possible now:

1) The standard tiny printf won't have support for pointer formatting.
   So it doesn't print misleading values for %pa, instead '?' will be
   output:
   %p   => ?
   %pa  => ?a
   %pap => ?ap

2) If SPL_USE_TINY_PRINTF_POINTER_SUPPORT is enabled or DEBUG is defined
   tiny printf supports formatting %p and %pa / %pap.

3) If SPL_NET is enabled the support of pointers is extended
   for %pm, %pM and %pI4.

Signed-off-by: Christoph Niedermaier <cniedermaier@dh-electronics.com>
2025-05-22 10:57:12 -06:00
Tom Rini
df5dcf7b7e Merge tag 'u-boot-imx-master-20250522' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx
CI: https://source.denx.de/u-boot/custodians/u-boot-imx/-/pipelines/26275

- Fix boot regression on imx8mn_bsh_smm_s2/s2pro.
- Fix reset on imx6ulz_smm_m2.
- Adjust DDR initialization on imx6ulz_smm_m2.
- Fix CAAM startup error.
2025-05-22 08:41:25 -06:00
Dario Binacchi
8acea298bb spl: Kconfig: support U-Boot load from raw NAND
Commit 2a00d73d081a ("spl: mmc: Try to clean up raw-mode options") breaks
the boot of the BSH SMM S2 board. As stated in the commit itself, "Some
boards use this value even though MMC is not enabled in SPL, for example
imx8mn_bsh_smm_s2".

Support load of the U-Boot image from raw NAND sector. This is equivalent
to load from MMC raw sector.

Fixes: 2a00d73d081a ("spl: mmc: Try to clean up raw-mode options")
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
2025-05-21 07:52:29 -03:00