Add a new EVT_POST_PREBOOT event type which is fired in main_loop()
after the preboot command has been executed.
Signed-off-by: Michal Simek <michal.simek@amd.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Simon Glass <sjg@chromium.org> says:
This series includes two patches to fix alignment problems with linker
lists. In certain circumstances these can cause the drivers list to be
non-contiguous, causing crashes, hangs, etc.
Link: https://lore.kernel.org/r/20260321134626.516665-1-sjg@chromium.org
The extern declaration in ll_entry_get() lacks the __aligned(4)
attribute present in ll_entry_declare(). When the compiler sees an
unaligned extern reference to a linker list entry in the same
compilation unit as its definition, it may increase the section
alignment beyond the expected struct size. This causes gaps in the
linker list array, which the alignment checker reports as failures.
For example, sandbox_dir is both defined and referenced via
DM_DRIVER_GET() in sandboxfs.c. The compiler applies 32-byte
alignment to its section instead of the 4-byte alignment from the
definition, creating an 8-byte gap before it in the driver list.
Add __aligned(4) to the extern declaration in ll_entry_get() to
match ll_entry_declare()
Signed-off-by: Simon Glass <simon.glass@canonical.com>
Change the alignment of end markers in ll_entry_end() and ll_end_decl()
from __aligned(4) and __aligned(CONFIG_LINKER_LIST_ALIGN) respectively
to __aligned(1).
The linker places zero-size end markers at aligned boundaries based on
what follows them. When the next list's start marker has a high alignment
requirement (e.g., 32 bytes), padding gets inserted before the end
marker. This causes the byte span (end - start) to not be an exact
multiple of the struct size.
The compiler optimises pointer subtraction (end - start) using
magic-number multiplication for division. This optimisation only produces
correct results when the byte span is an exact multiple of the struct
size. With padding, the result is garbage (e.g., -858993444 instead of
15).
By using __aligned(1), the end marker is placed immediately after the
last entry with no padding, ensuring (end - start) equals exactly
(n * sizeof) where n is the number of entries. This makes
ll_entry_count() and direct pointer arithmetic work correctly.
Fixes: 0b2fa98aa5e5 ("linker_lists: Fix alignment issue")
Signed-off-by: Simon Glass <simon.glass@canonical.com>
For some projects, designing the active bootable partition is done by
setting distro_bootpart in the environment instead of changing the bootable
flag on the active partition.
This patch makes it possible to support both models by scanning boot
partitions only if distro_bootpart is not defined in the environment.
Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>
CI: https://source.denx.de/u-boot/custodians/u-boot-fsl-qoriq/-/pipelines/29808
- Add env variables to assist boot for various LS boards
- Add gpio scmi driver
- Fix setting the function for scmi pinctrl
- Use standard device tree pin muxing format for scmi pinctrl
- Fix protocol version fetch for non-CCF platforms in scmi clk
Add LS1043ARDB-specific variables to assist the boot process,
and update the related common and LS1043AQDS settings accordingly.
Signed-off-by: Chunguang Li <chunguang.li_2@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Update the console baudrate to 115200 as default.
Also add env variables to assist boot process.
Signed-off-by: Chunguang Li <chunguang.li_2@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Add LS1046ARDB-specific variables to assist the boot flow,
and update the related common and other LS1046A board settings
accordingly.
Signed-off-by: Chunguang Li <chunguang.li_2@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Add image, extra_bootargs, othbootargs and console_dbg to assist boot.
Signed-off-by: Chunguang Li <chunguang.li_2@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Use DRAM_CH_CNT macro in renesas_dbsc5_board_config channel count.
The macro is defined in the same file a few lines above. This way,
the maximum channel count in the structure and the macro can not
diverge.
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
David Lechner <dlechner@baylibre.com> says:
This is a series adding support for reading U-Boot env directly from
SCSI devices that do not have a partition table, similar to how we can
already do this for MMC devices.
The motivation behind this is that MediaTek's BSP is already using the
same disk images for both MMC and UFS devices, so we need to be able to
read the env from SCSI devices without requiring a partition UUID.
The series starts with cleaning up a few oddities we noticed in the
existing code. Then some refactoring so that the env code manages
calling scsi_scan() so that we don't have to duplicate that for the
new code path. Then finally, the last few patches add and document the
new functionality.
Link: https://lore.kernel.org/r/20260326-env-scsi-hw-part-support-v1-0-55c9dd07a2cb@baylibre.com
Move scsi_scan() call out of scsi_get_blk_by_uuid().
The only caller, env_scsi_get_part(), should be managing this call since
it may also want to use different ways to get the partition information
in the future.
Signed-off-by: David Lechner <dlechner@baylibre.com>
Rework dev_phys_to_bus() and dev_bus_to_phys() to respect the size
of the area specified in dma-ranges DT property. The area outside
of ranges is remapped 1:1, while the area in the ranges is remapped
according to the description in the dma-ranges property.
Adjust the test to test the area within the remapped range, not area
outside the remapped range, which was incorrect.
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Markus Schneider-Pargmann <msp@baylibre.com>
These macros have AFAICT never been used at all. It's also far from
clear what purpose it could serve - for one thing, what _type would
one pass, other than void perhaps? The example using "struct
my_sub_cmd" seems misplaced, as how could one know that the first
linker list consists of those, and moreover, how would one know how
many there are?
The linker list concept is fragile enough on its own, there is no need
to have unused functionality lying around that may or may not bitrot
and certainly will confuse readers of linker_lists.h.
Signed-off-by: Rasmus Villemoes <ravi@prevas.dk>
Reviewed-by: Simon Glass <sjg@chromium.org>
The SoM (TQMa6) can be used on various baseboards. No modifications to
the SoM files should be required to use the SoM on different baseboards.
Therefore, include the SoM headers in the baseboard.
Signed-off-by: Max Merchel <Max.Merchel@ew.tq-group.com>
Remove the definition of CFG_POWER_PFUZE100_I2C_ADDR and
TQMA6_PFUZE100_I2C_BUS as it is not used.
Signed-off-by: Max Merchel <Max.Merchel@ew.tq-group.com>
Prepare moving boiler plate code out of board confguration header and
prepare to share a lot of things between boards.
Signed-off-by: Markus Niebel <Markus.Niebel@ew.tq-group.com>
Signed-off-by: Max Merchel <Max.Merchel@ew.tq-group.com>
As the PHYTEC phyCORE-i.MX91 [1] is just another variant of the existing
PHYTEC phyCORE-i.MX93 SoM but with i.MX91 SoC populated instead, add it
to the existing board-code "phycore_imx93", and rename that board to
"phycore_imx91_93" to reflect the dual SoCs support. While at it, also
rename and change common files accordingly. This way i.MX91 and i.MX93
SoC variants of the phyCORE SoM share most of the code and documentation
without duplication, while maintaining own device-tree and defconfigs
for each CPU variant.
Supported features:
- 1GB LPDDR4 RAM
- Debug UART
- EEPROM
- eMMC
- Ethernet
- SD-card
- USB
Product page SoM:
[1] https://www.phytec.eu/en/produkte/system-on-modules/phycore-imx-91-93/
Signed-off-by: Primoz Fiser <primoz.fiser@norik.com>
Refactor the dirty flag handling a little bit so an inline
function is called instead of directly stuffing a value into
the variable.
This allows variable that holds the flag to be completely removed
if its not used i.e. CONFIG_FAT_WIRTE=n
Signed-off-by: Daniel Palmer <daniel@thingy.jp>
Richard Genoud <richard.genoud@bootlin.com> says:
SquashFS has support in U-Boot, but not in SPL.
This series adds the possibility for the SPL to load files from SquashFS
partitions.
This is useful, for instance, when there's a SquashFS rootfs containing
U-Boot binary.
NB: falcon mode is not supported yet.
Link: https://lore.kernel.org/r/20260313104229.1555236-1-richard.genoud@bootlin.com
Implement spl_load_image_sqfs() in spl code.
This will be used in MMC to read a file from a squashfs partition.
Also, loosen squashfs read checks on file size by not failing when a
bigger size than the actual file size is requested. (Just read the file)
This is needed for FIT loading, because the length is ALIGNed.
Signed-off-by: Richard Genoud <richard.genoud@bootlin.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: João Marcos Costa <joaomarcos.costa@bootlin.com>
Otherwise, we get a lot of errors when including this file.
Signed-off-by: Richard Genoud <richard.genoud@bootlin.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: João Marcos Costa <joaomarcos.costa@bootlin.com>
bootcmd_ti_mmc had cpsw0_qsgmii_phyinit related scripts even though this
was only relevant for the j721e/j7200 SoCs. This patch instead factors
out those scripts into a generic 'board_init' which is called as part of
bootcmd_ti_mmc.
This allows boards to more easily add custom behaviour to the ti_mmc
bootflow instead of having to modify the ti_common.env file.
Signed-off-by: Anshul Dalal <anshuld@ti.com>
The BOOTENV_DEV_UFS macro is incomplete - it only initializes UFS
and scans SCSI devices but does not actually boot anything. This
causes the boot sequence to stop after scsi scan without loading
a kernel.
Update BOOTENV_DEV_UFS to set the devnum environment variable to
the UFS instance number, initialize the device using $devnum, and
delegate the boot process to the shared scsi_boot script. Remove
the explicit scsi scan, as it is already handled by scsi_boot.
This matches the pattern used by other boot device macros and
ensures that UFS devices can successfully boot using the distro
boot framework.
Signed-off-by: Padmarao Begari <padmarao.begari@amd.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/5447ce1d5c4a21b0b62ce76ad642296110364041.1772801284.git.michal.simek@amd.com
Add support for eMMC specification version 5.1B by defining
MMC_VERSION_5_1B and including it in the version array.
eMMC 5.1B (JESD84-B51B) is a minor revision of the 5.1 specification
that primarily addresses MDT (Manufacturing Date) adjustment for dates
beyond 2025. This aligns with the Linux kernel commit 9996707822f82
("mmc: core: Adjust MDT beyond 2025").
Since the manufacturing date field is not currently used in U-Boot,
this change has no functional impact beyond proper device recognition.
It allows the driver to correctly identify and initialize eMMC devices
that report version 5.1B in their Extended CSD register.
Signed-off-by: Han Xu <han.xu@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
This driver adds the base support of pinctrl over SCMI. The driver
does two main things. First, it allows you to configure the initial
pin states. Secondly, it's used a base to build a GPIO driver on
top of it.
To configure the states then add a pinmux config to the scmi_pinctrl
section:
scmi_pinctrl: protocol@19 {
reg = <0x19>;
pinmux1: pinmux_test {
pinmux = <0 1 0xFFFFFFFF 18 1
0 2 0xFFFFFFFF 18 1
0 3 0xFFFFFFFF 18 1>;
function = "f_gpio1";
groups = "grp_1", "grp_3";
};
};
Under linux the pinctrl subsystem will parse the function and group
properties and use that to handle muxing. However, under u-boot the
pin muxing is done using the "pinmux" property, which feeds raw SCMI
pinctrl PINCTRL_SETTINGS_CONFIGURE commands to the server. The
numbers are: selector, identifier, function_id, config_type, and
config_value. In the example above, it sets pins 1, 2, and 3 to 1.
The linux-kernel ignores this pinmux property.
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Delete some extra space characters to make checkpatch.pl happy:
WARNING: please, no space before tabs
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Acked-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Add all the pinctrl message IDs. I renamed SCMI_MSG_PINCTRL_CONFIG_SET
to SCMI_PINCTRL_SETTINGS_CONFIGURE so the naming matches the spec better.
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Linus Walleij <linusw@kernel.org>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
The bit_offset_from_cpcap_lowest_voltage value was inherited from the
downstream kernel as a quirk. With the correct voltage table, it is no
longer needed. An additional benefit is that SW1, SW2, and SW4 now share
the same voltage table.
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
Simon Glass <sjg@chromium.org> says:
Each arch does something slightly different before booting the OS. Some
archs even do different things depending on the CPU type.
It is quite hard to know what actually happens in the final milliseconds
before the OS boot.
This series attempts to start cleaning up U-Boot in this area.
The basic intent is to create a new bootm_final() function which can be
called by all archs. It provides some flags for a couple of necessary
variations but otherwise it is generic.
All architectures are converted over to use this new function.
board_quiesce_devices() is moved into bootm_final() so that all archs
benefit from it.
This series fixes a bug in device_remove() is fixed where removing a
parent with specialised flags (e.g. DM_REMOVE_ACTIVE_ALL) could leave
children activated, since they do not match the flags. This fixes is
needed to avoid bootm_final() causing test failures on sandbox.
Future work could take this a little further:
- Convert EFI loader to use the same function
- Improve comments for cleanup_before_linux() across architectures
- Support fake-run tracing on all archs
Link: https://lore.kernel.org/r/20260306023638.2678886-1-sjg@chromium.org
There are various functions which announce that booting is imminent and
do related preparation. Most of these are arch-specific.
In practice, most archs do a similar thing. It would be better to
have a common function, with perhaps some events for things that are
really arch- and board-specific.
Create a new bootm_final() function with the common pre-boot steps:
printing the "Starting kernel" message, recording bootstage data,
optionally writing bootstage to the FDT and printing a report, and
removing active devices.
Be careful to avoid using BIT() macros which are not available with host
tools.
Signed-off-by: Simon Glass <simon.glass@canonical.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Neither bootstage_fdt_add_report() nor bootstage_report() has a dummy
double for when bootstage is disabled. Add them.
Signed-off-by: Simon Glass <simon.glass@canonical.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Quentin Schulz <quentin.schulz@cherry.de> says:
This migrates the last user of the legacy LED API, IMX233-OLinuXino and
net/bootp.c, to the modern LED framework.
I do have concern about being able to use BOOTP in SPL? In which case, I
should probably add an additional check on CONFIG_IS_ENABLED(LED) in
addition to IS_ENABLED(CONFIG_LED_BOOT)?
I haven't tested this as I do not own an IMX233-OLinuXino, so please
give this a try if you own this device.
Then, since there's no user left of this legacy API, it is entirely
removed.
Link: https://lore.kernel.org/r/20251120-legacy-led-removal-v1-0-369d44338358@cherry.de
No user of the legacy LED API anymore (except Sunxi with the PinePhone
but that is now a Sunxi-specific implementation), so let's remove
anything related.
Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
* New driver for mt8189 clocks.
* The rest is a first wave of a larger effort to refactor and clean up the
mediatek clocks to replace various hacks that built up over time with
something that is easier to understand and maintain.
-----BEGIN PGP SIGNATURE-----
iQFKBAABCgA0FiEE7BjZnmIOg9ac2GiYwswgAf8Bj8AFAmm52/gWHGRsZWNobmVy
QGJheWxpYnJlLmNvbQAKCRDCzCAB/wGPwFr0B/4si1fIH8R+bsEYLKe7S0+gYYog
hCoh5iDqX3/m5o9NjdejGy8/k0yMj0IxMJ3n/w7SdptRiDWKMiT++Sf2gy4kjdHc
7SrHekBoBBILzkcKgzlXCjAIXlwQfj3eYmSOgaJPG3HPfrl8mdi45x8tYmtvOHlg
DRd4/+PYJh4hPtT8gtWeeR6HYZ00dBh4W+7BJx3XRqKSv9T5YiY5T959Ue2NDDfz
vd4oFB0eE2Lepz+tBd059t+aHOUhUxSJjtXN/rD3/ZZHzquiDO0mExEDFRXrrW7U
v0YzWSGDElt2rk9996L1qTkI8yBnzByjVMe3wrJXDno/fOXMcPtAH41nsvuk
=6gCS
-----END PGP SIGNATURE-----
Merge tag 'mediatek-for-next-2026-03-17' of https://source.denx.de/u-boot/custodians/u-boot-mediatek into next
- A fix for mt8188 clock oscillator rates.
- New driver for mt8189 clocks.
- The rest is a first wave of a larger effort to refactor and clean up the
mediatek clocks to replace various hacks that built up over time with
something that is easier to understand and maintain.
Bring U-Boot support for the BeagleV-Fire by adding a device tree and
supporting board files etc.
Signed-off-by: Jamie Gibbons <jamie.gibbons@microchip.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
Add support for i.MX952 15x15 lpddr4x board support.
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Alice Guo <alice.guo@nxp.com>
System Manager(SM) has implemented the MISC protocol to retrieve DDR
information. Using this API, U-Boot can obtain the DDR size dynamically
instead of relying on static configuration macros.
This change addresses the DDR ECC enabled case, where 1/8 of the total
DDR size is reserved for ECC data. The scmi_misc_ddrinfo() returns the
DDR size with EEC overhead already deducted.
Implementation details:
- Query the DDR size via scmi_misc_ddrinfo()
- Replace direct REG_DDR_CS[0,1]_BNDS register reads with SCMI call
- Switch from PHYS_SDRAM[x]_SIZE macros to runtime detection
- For backward compatibility with older SM firmware, fall back to
static PHYS_SDRAM[x]_SIZE configuration if the SCMI call fails
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>
UEFI:
* Require at least 128 KiB of stack space to use EFI sub-system.
* Avoid buffer overrun in efi_var_restore().
* Avoid superfluous variable store writes on unchanged data
* Implement SPI Flash store for EFI variables.
* Add an efidebug ecpt sub-command to display the ECPT table
and a unit test for the command.
Others:
* Add missing include string.h to make exception command build again.
* lib: uuid: add EBBR 2.1 conformance profile GUID
-----BEGIN PGP SIGNATURE-----
iQIzBAABCAAdFiEEbcT5xx8ppvoGt20zxIHbvCwFGsQFAmm1KT0ACgkQxIHbvCwF
GsT+6w/+MA7GsPpoX/9wsJA+8z1RZr1oVFelKsEh6/zTn4P+sidDlebhk+oLeevd
zFFuOJ+G6Uu7XfUWRQ5elMZ7jE+7Mr04uM7wtIbEXz0p20FtTTLfnYijXnCzGtQQ
FBDK8vpuKq3sm1C3k0rakhUmS2HzbWQ5Uprk2Z9YKk+NbDzqT/34OibHmbII/x8s
Vaat8bsE4Vwe6x1ztOOhOMFwU+9Bshycy+5jtYtOcqDg2uH463XUtsGfDXbQRcau
vEtITT9P0hxNE6fVHDPpqdFX25Bkl6EvbAIDPLTSu+aYOq2/tsIT6Ek/+mQpkm53
zIJjNM4jCYsHlFiBpAKLJMo/CFw3FSHx1X1ddh/zd3StP7n9v+ZaMQu+UY8TTb9t
e2GrfzycmhJQpwUCkTTAs3wseqw1ulg1OTcQhnLUmLgyAoKWhpaziwXicZrje17i
ouPFb9UIaISs0zPTYHraXRy0BqV/yM7R7zIwWi+S2XhWHzy0LWsnCsmJQu3w1nm3
rL2L3CujCPsAaOvLCAC5x2JsdxrTJgmVgK6L10K6TgYoJrcf+dQbiif0ViNn/XR7
hzXGCoj443fkS+VvPQC1UdWXx7zZDtHOv1Do5qWS3Uai27DQ1/WOgW2yTONLSoTx
yAv/nsH9Vlqu+D7Zyy+u4q6fbZ57j719WaSTxkZpZZHi0UVljyw=
=Ws6v
-----END PGP SIGNATURE-----
Merge tag 'efi-2026-03-14' of https://source.denx.de/u-boot/custodians/u-boot-efi into next
Pull request efi-2026-03-14
CI: https://source.denx.de/u-boot/custodians/u-boot-efi/-/pipelines/29512
UEFI:
* Require at least 128 KiB of stack space to use EFI sub-system.
* Avoid buffer overrun in efi_var_restore().
* Avoid superfluous variable store writes on unchanged data
* Implement SPI Flash store for EFI variables.
* Add an efidebug ecpt sub-command to display the ECPT table
and a unit test for the command.
Others:
* Add missing include string.h to make exception command build again.
* lib: uuid: add EBBR 2.1 conformance profile GUID