Commit graph

6703 commits

Author SHA1 Message Date
Tom Rini
1f0281294d Merge patch series "Annotate switch/case fallthrough cases"
Andre Przywara <andre.przywara@arm.com> says:

C's implicit fallthrough behaviour in switch/case statements can lead to
subtle bugs. Quite some while ago many compilers introduced warnings in
those cases, requiring intentional fallthrough's to be annotated.

So far we were not enabling that compiler option, so many ambiguities
and some bugs in the code went unnoticed.

This series adds the required annotations in code paths that the first
stage of the U-Boot CI covers. There is a large number of cases left
in the libbz2 code. The usage of switch/case is borderline insane there,
labels are hidden in macros, and there are no breaks, but just goto's.
Upstream still uses very similar code, without any annotations. I still
am not 100% sure those are meant to fall through or not, and plan to do
further investigations, but didn't want to hold the rest of the patches
back. You can see for yourself by applying patch 18/18 and building for
sandbox64, for instance.

Because of this we cannot quite enable the warning in the Makefile yet,
but those fixes are worth regardless, and be it to increase readability.

Please note that those patches do not fix anything, really, they just add
those fallthrough annotations, so the series is not really critical.

Link: https://lore.kernel.org/r/20250327153313.2105227-1-andre.przywara@arm.com
2025-04-08 16:24:12 -06:00
Andre Przywara
26b2482f12 use proper fallthrough annotations
In some cases in the generic code, we were already using switch/case
fallthrough annotations comments, though in a way which might not be
understood by most compilers.

Replace two non-standard /* no break */ comments with our fallthrough;
statement-like macro, to make this visible to the compiler.
Also use this macro in place of an /* Fall through */ comment, to be
more consistent.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2025-04-08 16:23:51 -06:00
Andre Przywara
a6a9d32733 spl: mmc: properly annotate fallthrough
Depending on the various MMC boot configurations, we might end up with
trying filesystem mode when a raw image boot failed. This fall-through
in the switch/case statement is explained in a comment, but this is not
visible to the compiler, which still will complain.

Add the proper compiler-visible annotation, to allow enabling the
compiler check in the future.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2025-04-08 16:23:51 -06:00
Tom Rini
a1dd42950d Merge patch series "Change DRAM message and add RAM doc"
Neha Malcom Francis <n-francis@ti.com> says:

This short series is an ongoing effort to make RAM utilization clearer for
easier debugging and understanding of code. Intention is for users to quickly
be able to identify the CONFIGs needed to modify for their RAM usecase.

Link: https://lore.kernel.org/r/20250319140327.301266-1-n-francis@ti.com
2025-04-08 16:23:27 -06:00
Neha Malcom Francis
7dfe3cdc6c board_f: Modify DRAM message
The message "DRAM:  2 GiB (effective 32 GiB)" can be a little confusing,
modify the message s/effective/total to make it more evident.

Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
2025-04-08 15:20:30 -06:00
Tom Rini
1aa8b03c01 Merge patch series "membuff: Add tests and update to support a flag for empty/full"
Simon Glass <sjg@chromium.org> says:

The membuff implementation curently has no tests. It also assumes that
head and tail can never correspond unless the buffer is empty.

This series provides a compile-time flag to support a 'full' flag. It
also adds some tests of the main routines.

The data structure is also renamed to membuf which fits better with
U-Boot.

There may be some cases in the code which could be optimised a little,
but the implementation is functional.

Link: https://lore.kernel.org/r/20250318152059.1464369-1-sjg@chromium.org
2025-04-03 16:54:59 -06:00
Simon Glass
68b0af2127 membuf: Rename struct
Rename the struct to match the function prefix and filenames.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-04-03 16:54:49 -06:00
Simon Glass
4662e5286a membuff: Rename functions to have membuf_ prefix
The double 'f' is not necessary and is a bit annoying as elsewhere in
U-Boot we use 'buf'. Rename all the functions before it is used more
widely.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-04-03 16:54:49 -06:00
Tom Rini
8b0fe584ae Merge patch series "Various toolchain compatibility fixes/improvements"
Sam Edwards <cfsworks@gmail.com> says:

This is v2 of my "misc. fixes" series, sent to prepare the codebase for more
direct LLVM support in the near future. This series contains several fixes that
I found in the process of preparing that support and which address issues
independent of any future feature or enhancement. I am sending these now, both
so that their inclusion is not delayed by discussion on my upcoming series and
to make the latter more manageable.

Link: https://lore.kernel.org/r/20250315221813.1265193-1-CFSworks@gmail.com
2025-04-02 14:34:08 -06:00
Sam Edwards
358d1cc232 spl: Align FDT load address
While the image size is generally a multiple of 8 bytes, this is not
actually guaranteed; some linkers (like LLD) will shave a few bytes off
of the end of output sections if there are no content bytes there. Since
libfdt imposes a hard rule of 8-byte alignment, make the SPL also be
explicit about the alignment when loading the FDT.

Signed-off-by: Sam Edwards <CFSworks@gmail.com>
2025-04-02 14:33:50 -06:00
Sam Edwards
17d830cb4b spl: riscv: opensbi: Error on misaligned FDT
libfdt 1.6.1+ requires the FDT to be 8-byte aligned and returns an error
if not. OpenSBI 1.0+ includes this version of libfdt and will also
reject misaligned FDTs.

However, OpenSBI cannot indicate the error to the user: since it cannot
access the serial console, it can only silently hang. This proved very
difficult to diagnose without proper debugging facilities. Therefore,
give the U-Boot SPL, which *can* print error messages, an additional
check for proper FDT alignment. Hopefully this saves a lot of
development cycles if another developer encounters alignment problems.

Signed-off-by: Sam Edwards <CFSworks@gmail.com>
2025-04-02 14:33:50 -06:00
Anshul Dalal
fd2bccec19 spl: return header size to spl_load in os boot
During linux build process the header size is computed including the BSS
whereas it's removed when creating the uncompressed image. Therefore the
size of the uncompressed image on filesystem will be smaller than the
size specified in the header.

This causes issues when loading the kernel image from the SPL (as in
falcon boot) with spl_load since it compares the read file size from the
FS to the header size form the image. Which leads to the following check
in `include/spl_load.h` failing to -EIO when loading kernel image:

  return read < spl_image->size ? -EIO : 0;

Therefore we should return the header size back to spl_load instead of
the file size in falcon boot when not loading a FIT image.

Bug report:
https://lore.kernel.org/u-boot/20250214111656.2358748-1-anshuld@ti.com/

Fixes: 775074165d ("spl: Add generic spl_load function")
Reported-by: Anshul Dalal <anshuld@ti.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Signed-off-by: Anshul Dalal <anshuld@ti.com>
2025-03-30 09:15:34 -06:00
Anshul Dalal
bcb8cac2d5 config: falcon: move CFG_SYS_SPI_* to Kconfig
CFG_SYS_SPI_* are used in falcon boot to specify the offsets and size of
the respective payloads. This patch moves them to Kconfig keeping the
values consistent for each of the affected boards.

Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
Signed-off-by: Anshul Dalal <anshuld@ti.com>
2025-03-30 09:15:31 -06:00
Tom Rini
02d95aaee0 Merge branch 'next' of https://source.denx.de/u-boot/custodians/u-boot-sunxi into next
Assorted fixes, refactorings and additions that are ready, and shave
off some load from upcoming series'.

Improves MMC performance on D1/T113 (missed clock divider), enables
eMMC access on the H616 family (never worked, many thanks to Jernej for
the fix!), DRAM detection fixes for the H616 (now reportedly stable).

Some patches for the upcoming Allwinner A133 SoC support: a few
refactorings, plus the DM clock and pinctrl driver. The DRAM init
routines work, but need some more polishing, that also holds back the
actual enablement patch, which will hopefully follow for v2025.07 still.

Also some preparatory patches for the Allwinner A523 SoC support, for
now just to improve the FEL save/restore code. There will be more patches
coming up for this, ideally also in the coming cycle still.

Gitlab CI passed, and I booted that briefly on some boards.
2025-03-27 08:10:06 -06:00
Andre Przywara
1f8374ebef spl: reorder SPL_MAX_SIZE defaults for sunxi
Reorder the Kconfig defaults for the maximum SPL size, to make the
Allwinner specific values more readable and extensible: many older SoCs
need to be limited to 32KB, so make this the last ARCH_SUNXI entry, used
as a fallback unless explicitly overridden before.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>
2025-03-27 00:26:35 +00:00
Tom Rini
4adbf64ff8 Merge branch 'staging' of https://source.denx.de/u-boot/custodians/u-boot-tegra into next
- More Tegra video improvements
2025-03-26 14:07:37 -06:00
Svyatoslav Ryhel
37a37ad608 video: edid: guard standard timings EDID expansion behind kconfig
Since EDID only indicates supported standard timings, a large table with
detailed timing information is necessary, consuming significant space. To
mitigate this, the table is made configurable via kconfig, allowing it to
be excluded when not needed.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
2025-03-19 10:59:23 +02:00
Dragan Simic
f853295a6a common: console: Delete obsolete VIDCONSOLE_AS_{LCD, NAME} options
The configuration options CONFIG_VIDCONSOLE_AS_LCD and CONFIG_VIDCONSOLE_AS_
NAME have been marked as obsolete and scheduled for deletion in late 2020.

That's already long overdue and the last remaining consumers of these options
have already migrated to using "vidconsole" in their "stdout" and "stderr"
environment variables, so let's delete these two configuration options.

Signed-off-by: Dragan Simic <dsimic@manjaro.org>
Acked-by: Soeren Moch <smoch@web.de> # tbs2910
2025-03-14 14:35:56 -06:00
Ilias Apalodimas
fb553201b6 arm64: Enable RW, RX and RO mappings for the relocated binary
Now that we have everything in place switch the page permissions for
.rodata, .text and .data just after we relocate everything in top of the
RAM.

Unfortunately we can't enable this by default, since we have examples of
U-Boot crashing due to invalid access. This usually happens because code
defines const variables that it later writes. So hide it behind a Kconfig
option until we sort it out.

It's worth noting that EFI runtime services are not covered by this
patch on purpose. Since the OS can call SetVirtualAddressMap which can
relocate runtime services, we need to set them to RX initially but remap
them as RWX right before ExitBootServices.

Link: https://lore.kernel.org/u-boot/20250129-rockchip-pinctrl-const-v1-0-450ccdadfa7e@cherry.de/
Link: https://lore.kernel.org/u-boot/20250130133646.2177194-1-andre.przywara@arm.com/
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-03-14 13:37:54 +02:00
Tom Rini
3e73373c37 Merge patch series "xPL-stack cleanup"
Simon Glass <sjg@chromium.org> says:

This series was split from the VBE part H series. It adjusts the logic
for selecting the top of the stack so that it is more consistent across
xPL phases.

Link: https://lore.kernel.org/r/20250228122042.1277079-1-sjg@chromium.org
2025-03-13 10:36:11 -06:00
Simon Glass
f09d5b28ff arm: Support a separate stack for VPL
VPL has the same needs as TPL in situations where the stack is at the
top of SRAM. Add an option for this and implement it for arm

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-13 10:36:10 -06:00
Simon Glass
ffa98c08e8 spl: Use CONFIG_VAL() to obtain the SPL stack
Now that we have the same option for SPL and TPL, simplify the logic for
determining the initial stack.

Note that this changes behaviour as current SPL_STACK is a fallback for
TPL. However, that was likely unintended and can be handled with Kconfig
defaults if needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Suggested-by: Tom Rini <trini@konsulko.com>
2025-03-13 10:36:10 -06:00
Simon Glass
d6a53f523a spl: Add an SPL_HAVE_INIT_STACK option
At present there is a hex value SPL_STACK which both determines whether
SPL has its own initial stack and the hex value of that stack.

Split off the former into SPL_HAVE_INIT_STACK with SPL_STACK depending
on that and only providing the latter.

Signed-off-by: Simon Glass <sjg@chromium.org>
[trini: Resync defconfig files]
2025-03-13 10:36:09 -06:00
Simon Glass
e7741f1124 tpl: Rename TPL_NEEDS_SEPARATE_STACK to TPL_HAVE_INIT_STACK
The most common word for features that make a platform work is to use
'HAVE_xxx'. Rename this option to match.

Update the help to use the word 'phase' rather than 'stage', since
that is the current terminology. Also clarify that, absent this setting,
the stack pointer generally comes from the value used by U-Boot proper,
rather than SPL.

Move the option just above TPL_STACK which depends on it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-13 10:35:22 -06:00
Tom Rini
0731697f9d Merge branch 'staging' of https://source.denx.de/u-boot/custodians/u-boot-tegra into next 2025-03-12 07:56:16 -06:00
Tom Rini
cf1c0f3963 Merge branch 'graph' of https://source.denx.de/u-boot/custodians/u-boot-tegra into next 2025-03-12 07:55:47 -06:00
Marek Vasut
33ccfae853 net: miiphybb: Drop mdio_init()
Inline mdio_init() back into mdio_alloc(), separate
access to mdio_init() is no longer necessary.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Paul Barker <paul.barker.ct@bp.renesas.com>
2025-03-11 23:06:18 +01:00
Jonas Schwöbel
8fb7ed59a8 common: edid: update timing selection logic
Older EDID timing algorithms relied solely on detailed timings, typically
optimized for a display's native resolution. This caused issues with newer
4K panels on older hardware, which couldn't handle those high resolutions.
To address this, the algorithm now also considers standard timings, offering
lower, compatible resolutions. Future improvements may include checking
established timings for even broader compatibility.

Signed-off-by: Jonas Schwöbel <jonasschwoebel@yahoo.de>
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
2025-03-11 17:39:52 +02:00
Tom Rini
1b42f57ec8 Prepare v2025.04-rc4
-----BEGIN PGP SIGNATURE-----
 
 iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmfPdnYACgkQFHw5/5Y0
 tyw17wv+KqFxDoJKTGVWeP4fu+zhTQlFo0f2tAlWylAdJnDP6nR/I49zid2mjRbZ
 2Bq3mE3G2Ag1efJ3UGHck0Zn1O9OpqVvk734IHSJFygN77l2xmNSMXZd8MLOsbaU
 4JXhxbLUdumCSkwVjjc9/sN+kJUfpwmFBwjqPWmE8rVU+IjApdZP0hBmfxACivl3
 p0JJZ870JkgSd5KuAGO/MUbinl/QYOdpitbo2EinOyqnLnivw5PzlcAYF0STNcgJ
 XfsT7Ap9T3woPTkT1mXGo+0gBs1OPxXcXp6nywFY75EVIGYRetDEXr8/jf74Jg83
 XK8+mqFP+bhlLOMydCdRHyQU8+WGNPfWtcOa7ekC3DjR9Kf7VwoTujqa9B9ILg6m
 UBagI/zUIWGAHi4oe2vMV16nR1cPT1ZexPoswZJrj/iDC6WaN0gWwDQgcPODm0UL
 rPYYNPWne/iGYgbkhy1zqZMEj7ytnvtjaVMRFdbTSwWUR3s23q9btqjlOwfXbtYZ
 0ENfAAu0
 =xGcd
 -----END PGP SIGNATURE-----

Merge tag 'v2025.04-rc4' into next

This uses Heinrich's merge of lib/efi_loader/efi_net.c which results in
no changes.
2025-03-10 20:18:51 -06:00
Tom Rini
6689b0c955 usb: gadget: Remove the legacy usbtty driver
The lone user of this driver has been removed for some time. Remove this
driver as well.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Link: https://lore.kernel.org/r/20250227205101.4127604-2-trini@konsulko.com
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
2025-03-10 09:22:35 +01:00
Svyatoslav Ryhel
e6883b6b30 sandbox: remap memory load addresses
The existing memory layout places the bloblist at 0xb000 and the fdt at
0x100, resulting in a 0xaf00 size constraint for the fdt. This constraint
has been reached. Lets modify the layout by moving the bloblist to 0x100,
device tree to 0x1000 and placing early memory allocation after pre-console
buffer at 0xf4000. This should guarantee sufficient memory allocation for
future expansion.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
2025-03-08 16:27:22 +02:00
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
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
Marek Vasut
f15919436b net: miiphy: Introduce mdio_init()
Introduce mdio_init() split off from mdio_alloc(), which is used
to initialize already allocated struct mii_dev.

Reviewed-by: Paul Barker <paul.barker.ct@bp.renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2025-02-26 18:26:57 +01:00
Marek Vasut
8cc464c334 net: miiphybb: Drop bb_miiphy_init() and .init callback
The .init callback is not called by any function, drop it.
There are no more users of the init callback, drop the entire
mechanism.

Reviewed-by: Paul Barker <paul.barker.ct@bp.renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2025-02-26 18:26:57 +01:00
Tom Rini
c33ccc8725 Merge patch series "bloblist: refactor xferlist and bloblist"
Tom Rini <trini@konsulko.com> says:

This small series separates "bloblist" and "standard passage" to allow
for these similar concepts to explore solutions to problems without
introduces breaking changes to the other.

Link: https://lore.kernel.org/r/20250220000223.1044376-1-raymond.mao@linaro.org
2025-02-19 18:49:47 -06:00
Raymond Mao
03a76b1a73 bloblist: kconfig for mandatory incoming standard passage
In previous commit, incoming standard passage is used by default
when initializing the bloblist, so explicitly BLOBLIST_PASSAGE is
no more needed.
Rename it as BLOBLIST_PASSAGE_MANDATORY to determine the behaviors
when an incoming transfer list does not exist or is invalid.
When it is selected, incoming standard passage is mandatory and
U-Boot will report an error when a valid incoming transfer list is
missing.

Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
2025-02-19 18:49:36 -06:00
Raymond Mao
6799f09069 bloblist: refactor xferlist and bloblist
Refactor the xferlist to remove the relocating when bloblist passed
from the boot args.
Refactor bloblist init to use incoming standard passage by default
if a valid transfer list exists in the boot args.
For bloblist relocation, use the actual total size if it has a smaller
BLOBLIST_SIZE_RELOC.

Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
Suggested-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-02-19 18:49:36 -06:00
Tom Rini
3f19062d46 Merge patch series "Introduce K3 remoteproc driver for M4 subsystem"
Judith Mendez <jm@ti.com> says:

Some K3 devices like am62x and am64x have a M4 processor in the MCU
voltage domain. This patch series introduces remoteproc M4 driver which
will be used to load firmware into and start the M4 remote core.

This series also adds support for R5F cores on am64x SoCs in patch 2 and
sets up environment to load FW in remote cores in patch 3,4,5.

This patch series also enables remoteproc drivers by default as per what
remoteproc sybsystem is supported per SoC, thus all remoteproc options
are now deleted in configs/* since they are no longer required.

This patch series was tested on am64x EVM, am62x SK, am62ax SK,
am62px SK boards.

Any additional tested by's are welcome since I was not able to
test any additional boards.

Tested by running the following commands in u-boot prompt:

=> setenv dorprocboot 1
=> run boot_rprocs

Link: https://lore.kernel.org/r/20250210202944.1071931-1-jm@ti.com
2025-02-14 13:39:10 -06:00
Judith Mendez
526a485810 spl: Enable SPL remoteproc by default for K3 ARCH
If building for v7R and K3 architecture, enable SPL
remoteproc so that it does not have to be defined in each
board defconfig file.

Signed-off-by: Judith Mendez <jm@ti.com>
2025-02-14 13:17:36 -06:00
Tom Rini
87dec3078a Merge patch series "Enable bloblist support on Vexpress64"
Harrison Mutai <harrison.mutai@arm.com> says:

This series of patches enhances the vexpress64 platform by enabling bloblist
support. It also introduces support for CONFIG_BLOBLIST_PASSAGE. This is
necessary to boot vexpress64 and other boards without manually specifying a
fixed address and size for the bloblist.

After this change, all the bloblist init modes are supported (i.e., fixed,
alloc, passage) and Vexpress64 boots with CONFIG_BLOBLIST_PASSAGE.

Link: https://lore.kernel.org/r/20250204175844.19890-1-harrison.mutai@arm.com
2025-02-11 18:09:05 -06:00
Harrison Mutai
7d521f2054 bloblist: add support for CONFIG_BLOBLIST_PASSAGE
When the configuration option CONFIG_BLOBLIST_PASSAGE is selected, the
bloblist present in the incoming standard passage is utilised in-place.
There is no need to specify the size of the bloblist as the system
automatically detects it using the header information.

Signed-off-by: Harrison Mutai <harrison.mutai@arm.com>
2025-02-11 18:08:58 -06:00
Harrison Mutai
1d1c54f458 bloblist: fix typo in code comments
Fix the two typos in the spelling of same and set in common/Kconfig and
include/bloblist.h.

Signed-off-by: Harrison Mutai <harrison.mutai@arm.com>
2025-02-11 18:08:58 -06:00
Anton Moryakov
b4df7003df common: Add NULL checks for xrealloc in make_string cli_hush.c
- Check return value of xrealloc for NULL.
- Free allocated memory and return NULL if xrealloc fails.
- Prevent NULL pointer dereference in strlen and strcat.

Triggers found by static analyzer Svace.

Signed-off-by: Anton Moryakov <ant.v.moryakov@gmail.com>
2025-02-11 08:17:23 -06:00
Anton Moryakov
bdf056441d common: Add NULL checks for malloc_cache_aligned in autoboot.c
- Check return value of malloc_cache_aligned for presskey and sha.
- Return -ENOMEM if memory allocation fails.
- Free allocated memory in error paths."

Triggers found by static analyzer Svace.

Signed-off-by: Anton Moryakov <ant.v.moryakov@gmail.com>
2025-02-11 08:17:23 -06:00
Simon Glass
f4415f2a37 vbe: Allow VBE to disable adding loadables to the FDT
When VBE operates within VPL it does not want the FDT to be changed.
Provide a way to disable this feature.

Move the FIT_IMAGE_TINY condition out of spl_fit_record_loadable() so
that both conditions are together. This makes the code easier to
understand.

Replace the existing fit_loaded member, which is no-longer used.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-02-03 16:01:36 -06:00
Simon Glass
dab3bbc2b8 vbe: Provide VPL binman-symbols for the next phase
Add support for moving from TPL->VPL->SPL so that the VPL build can fit
properly into the boot flow.

Use #ifdefs to avoid creating unwanted symbols which Binman would then
try (and perhaps fail) to provide.

Add debugging to indicate the next phase.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-02-03 16:01:36 -06:00
Simon Glass
384f815d08 vbe: Support providing a linker script
Allow a linker script to be provided for VPL as it is for other U-Boot
phases.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-02-03 16:01:36 -06:00
Simon Glass
873112db9c spl: Support selecting images based on phase in simple FIT
At present the simple FIT-loader always loads images, ignoring whether
they are intended for the next phase or not.

VBE packages up several images in the same FIT, some destined for VPL
and some for SPL. Add logic to check the phase before loading the
image. Return -EPERM in that case and handle it gracefully.

Fix a unnecessary re-computation of read_offset while here.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-02-03 16:01:36 -06:00
Simon Glass
b0407ace97 spl: Adjust debugging and xPL symbols
The size of some malloc() fields has reduced on 64-bit machines, but
the spl_reloc code was not updated. Fix this to avoid a compiler
warning.

Also update for the new xPL naming.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
2025-02-03 16:00:42 -06:00