summaryrefslogtreecommitdiff
path: root/common
AgeCommit message (Collapse)Author
34 hoursKconfig: Test for !COMPILE_TEST in some locationsTom Rini
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>
34 hoursglobal: Make ARCH_MISC_INIT a selected symbolTom Rini
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>
2 daysMerge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-shTom Rini
- 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
2 daysarm64: renesas: Add Renesas R-Car Gen4 SCIF/HSCIF loader SREC generationMarek Vasut
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>
3 dayscommon/log_syslog.c: Add missing include of <env.h>Tom Rini
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>
4 dayscommon: readline: Fix always true testAndrew Goodbody
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>
5 daysMerge branch 'next'Tom Rini
2025-06-26Merge patch series "spl: fix error handling in spl_fit_get_image_name()"Tom Rini
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-26common/spl: guard against buffer overflow in spl_fit_get_image_name()Heinrich Schuchardt
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-26common/spl: Revert fix potential out of buffer access in ↵Heinrich Schuchardt
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-24sunxi: add support for the Allwinner A100/A133 SoCAndre Przywara
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-23Merge tag 'v2025.07-rc5' into nextTom Rini
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-23arm: kirkwood: fix freeze on bootJerome Forissier
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-20Merge patch series "Consistent Kconfig environment options CONFIG_ENV_ prefix"Tom Rini
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-20env: Drop DELAY_ENVIRONMENTMarek Vasut
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-20env: Rename SYS_RELOC_GD_ENV_ADDR to ENV_RELOC_GD_ENV_ADDRMarek Vasut
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-19common/spl: improve error handling in spl_fitMikhail Kshevetskiy
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-19common/spl: handle properly images with bad checksumMikhail Kshevetskiy
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-19common/spl: fix potential out of buffer access in spl_fit_get_image_name ↵Mikhail Kshevetskiy
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-13spl: Rename jump_to_image_no_args()Simon Glass
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-09Merge tag 'v2025.07-rc4' into nextTom Rini
Prepare v2025.07-rc4
2025-06-09configs: raise SPL_SYS_MALLOC_SIZE to 8 MiB on RISC-VHeinrich Schuchardt
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-05cmd: bootmenu: permit to select bootmenu entry with a shortcutChristian Marangi
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-05Merge tag 'xilinx-for-v2025.07-rc4' of ↵Tom Rini
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-04x86: Correct condition for init_cache_f_r()Simon Glass
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-04usb: onboard-hub: Fix return type for regulator APIsPadmarao Begari
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-02Merge patch series "Audit include list for include/[a-m]*.h"Tom Rini
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-02include/ide.h: Cleanup usageTom Rini
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-02include/fat.h: Audit include listTom Rini
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-05-29Merge patch series "Start removing <env.h> from headers when not required"Tom Rini
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-29global: Avoid indirect inclusion of <env.h> from <command.h>Tom Rini
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-26Merge tag 'v2025.07-rc3' into nextTom Rini
Prepare v2025.07-rc3
2025-05-22common: add config for board_init() callBen Dooks
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-22tiny-printf: Handle formatting of %p with an extra KconfigChristoph Niedermaier
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-22Merge tag 'u-boot-imx-master-20250522' of ↵Tom Rini
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-21spl: Kconfig: support U-Boot load from raw NANDDario Binacchi
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-21riscv: Access gd with inline assembly when building with LTO or ClangYao Zi
Similar to AArch64's case, Clang may wrongly fold accesses to gd pointer which is defined with register qualifier into constants, breaking various components. This patch defines gd as a macro when building with Clang or LTO, which expands to get_gd() that accesses gp pointer in assembly, making RISC-V ports function properly and preparing for introduction of LTO in the future. Board initialization code is also adapted for non-assignable gd. Reported-by: Nathaniel Hourt <I@nathaniel.land> Signed-off-by: Yao Zi <ziyao@disroot.org> Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2025-05-16cyclic: make cyclic_register safe to call on already-registered infoRasmus Villemoes
Now that cyclic_unregister() is safe to call on a not-registered cyclic_info, we can make cyclic_register() behave like the mod_timer() and hrtimer_start() APIs in linux, in that they don't distinguish between whether the timer was already enabled or not; from the point of the call it is, with whatever timeout/period is set in that most recent call. This avoids users of the cyclic API from separately keeping track of whether their callback is already registered or not, and even if they know it is, can be used for changing the period (and/or the callback function) without first doing unregister(). See also this recent'ish message from kernel maintainer Thomas Gleixner on that API design for timer frameworks: https://lore.kernel.org/lkml/87ikn6sibi.ffs@tglx/ First of all the question is whether add() and mod() are really valuable distinctions. I'm not convinced at all. Back then, when we introduced hrtimers, we came to the conclusion that hrtimer_start() is sufficient. Signed-off-by: Rasmus Villemoes <ravi@prevas.dk> Reviewed-by: Stefan Roese <sr@denx.de>
2025-05-16cyclic: make cyclic_unregister() idempotentRasmus Villemoes
Make cyclic_unregister() safe to call with an already unregistered, or possibly never registered, struct cyclic_info. This is similar to how the various timer APIs in the linux kernel work (they all allow calling delete/cancel/... on an inactive timer object). This means callers don't have to separately keep track of whether their cyclic callback is registered or not, and avoids them trying to peek into the struct cyclic_info for that information - which leads to somewhat ugly code as it would have to be guarded by ifdef CONFIG_CYCLIC. Signed-off-by: Rasmus Villemoes <ravi@prevas.dk> Reviewed-by: Stefan Roese <sr@denx.de>
2025-05-06rockchip: Add SPL_PAD_TO Kconfig default valueJonas Karlman
Almost all Rockchip boards use the same Kconfig value for SPL_PAD_TO, 0x7f8000. u-boot-rockchip.bin is typically written to offset 64S (32KiB) of MMC media. u-boot.itb (or u-boot.img) is typically expected at offset 16384S (8MiB) of MMC media (SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x4000). SPL_PAD_TO is used as the offset for u-boot.itb (or u-boot.img) in the generated simple-bin binman image, and can be calculated as: SPL_PAD_TO = (16384S - 64S) * 512 = 0x7f8000 Add this value as a default value for ARCH_ROCKCHIP. Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Reviewed-by: Kever Yang <kever.yang@rock-chips.com> Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
2025-05-03spl: imx: use trampoline buffer to load images to secure regionYe Li
When SPL loading image to secure region, for example, ATF and tee to DDR secure region. Because the USDHC controller is non-secure master, it can't access this region and will cause loading issue. So use a trampoline buffer in non-secure region, then use CPU to copy the image from trampoline buffer to destination secure region. Signed-off-by: Ye Li <ye.li@nxp.com> Signed-off-by: Alice Guo <alice.guo@nxp.com> Reviewed-by: Peng Fan <peng.fan@nxp.com>
2025-05-02console: Support a format string for stderr outputSimon Glass
Add a console_printf_select_stderr() function so that it is not necessary for the caller to process the format string. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Alexander Sverdlin <alexander.sverdlin@siemens.com>
2025-05-02Merge patch series "Qualcomm: cleanup OF_LIVE fixup and fix RB1/2"Tom Rini
Caleb Connolly <caleb.connolly@linaro.org> says: Introduce a new event to signal that the live tree has been built, allowing boards to perform fixups on the tree before devices are bound. Crucially this allows for devices to be enabled or disabled, but also allows for properties that are parsed during the bind stage to be modified (such as dr_mode for dwc3). With this in place, mach-snapdragon is switched over to use the event and some hacky U-Boot specific DT overrides (which had to be undone prior to booting an image) are removed in favour of fixing up the livetree (which is not passed on to further boot stages). Finally, some minor fixes are made for the QCM2290 RB1 board, the sdcard is enabled and it now uses USB host mode in U-Boot like it's bigger sibling the RB2. Link: https://lore.kernel.org/r/20250411-livetree-fixup-v2-0-1236823377bb@linaro.org
2025-05-02event: signal when livetree has been builtCaleb Connolly
OF_LIVE offers a variety of benefits, one of them being that the live tree can be modified without caring about the underlying FDT. This is particularly valuable for working around U-Boot limitations like lacking USB superspeed support on Qualcomm platforms, no runtime OTG, or peripherals like the sdcard being broken (and displaying potentially worrying error messages). Add an event to signal when the live tree has been built so that we can apply fixups to it directly before devices are bound. Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2025-04-30common: board: fix build condition of noncached memory initcallWeijie Gao
CONFIG_SYS_NONCACHED_MEMORY is defined as hex, not bool. It should be replaced with CONFIG_SYS_HAS_NONCACHED_MEMORY when switched from #ifdef to CONFIG_IS_ENABLED(). Fixes: 6c171f7a184 (common: board: make initcalls static) Signed-off-by: Weijie Gao <weijie.gao@mediatek.com> Tested-by: Marcel Ziswiler <marcel.ziswiler@codethink.co.uk> # rock5b Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
2025-04-24configs: set SPL_TEXT_BASE by default for k3 platformsAnshul Dalal
SPL_TEXT_BASE is used as the load address for the main domain SPL on k3 platforms. Since the config value is the same for every board, this patch sets the value 0x80080000 as default for all 64-bit ARCH_K3, 0x43c00000 as default for the R5 cores and deletes the instances of SPL_TEXT_BASE in individual defconfigs. Signed-off-by: Anshul Dalal <anshuld@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2025-04-23Merge patch series "Uthreads"Tom Rini
Jerome Forissier <jerome.forissier@linaro.org> says: This series introduces threads and uses them to improve the performance of the USB bus scanning code and to implement background jobs in the shell via two new commands: 'spawn' and 'wait'. The threading framework is called 'uthread' and is inspired from the barebox threads [2]. setjmp() and longjmp() are used to save and restore contexts, as well as a non-standard extension called initjmp(). This new function is added in several patches, one for each architecture that supports HAVE_SETJMP. A new symbol is defined: HAVE_INITJMP. Two tests, one for initjmp() and one for the uthread scheduling, are added to the lib suite. After introducing threads and making schedule() and udelay() a thread re-scheduling point, the USB stack initialization is modified to benefit from concurrency when UTHREAD is enabled, where uthreads are used in usb_init() to initialize and scan multiple busses at the same time. The code was tested on arm64 and arm QEMU with 4 simulated XHCI buses and some devices. On this platform the USB scan takes 2.2 s instead of 5.6 s. Tested on i.MX93 EVK with two USB hubs, one ethernet adapter and one webcam on each, "usb start" takes 2.4 s instead of 4.6 s. Finally, the spawn and wait commands are introduced, allowing the use of threads from the shell. Tested on the i.MX93 EVK with a spinning HDD connected to USB1 and the network connected to ENET1. The USB plus DHCP init sequence "spawn usb start; spawn dhcp; wait" takes 4.5 seconds instead of 8 seconds for "usb start; dhcp". [1] https://patchwork.ozlabs.org/project/uboot/list/?series=446674 [2] https://github.com/barebox/barebox/blob/master/common/bthread.c Link: https://lore.kernel.org/r/20250418141114.2056981-1-jerome.forissier@linaro.org
2025-04-23cyclic: invoke uthread_schedule() from schedule()Jerome Forissier
Make the schedule() call from the CYCLIC framework a uthread scheduling point too. This makes sense since schedule() is called from a lot of places where uthread_schedule() needs to be called. Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Stefan Roese <sr@denx.de>
2025-04-23net: make initr_net() invocation command line agnosticHeinrich Schuchardt
initr_net() initalizes the network devices by calling eth_initalize(). There is no good reason to disable this if no command line interface is present. Let initr_net() depend on CONFIG_NET || CONFIG_NET_LWIP. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-04-16Merge tag 'u-boot-marvell-20250516' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-marvell CI: https://dev.azure.com/sr0718/u-boot/_build/results?buildId=390&view=results - mvebu_espressobin_ultra-88f3720_defconfig: disable SATA - helios4: enable ddr odt0 on write for both chip-select - clearfog,helios4: disable sdhci sdma - mvebu/bubt: Correct usage of IS_ENABLED() macro - mvebu: Correct SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR usage