100689 Commits

Author SHA1 Message Date
Venkatesh Yadav Abbarapu
bfa3f147e1 spi: cadence_qspi: Set tshsl_ns to at least one sclk_ns
tshsl_ns is the clock delay for chip select deassert. This is the delay in
master reference clocks for the length that the master mode chip select
outputs are de-asserted between transactions.

The minimum delay is always SCLK period to ensure the chip select is never
re-asserted within one SCLK period.

That is why tshsl_ns delay should be at least one sclk_ns value. If it is
less than sclk_ns, set it equal to sclk_ns.

Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@amd.com>
Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Link: https://lore.kernel.org/r/20250702065717.3871435-1-venkatesh.abbarapu@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
2025-07-08 15:01:25 +02:00
Michal Simek
92fcd3c168 xilinx: Disable help command for all mini configurations
There is no reason to have help command available because none is calling
it and only make binary bigger that's why disable it.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/885a74b7f5b28ea7850a6ebaaf879dd8b13e18c8.1751286059.git.michal.simek@amd.com
2025-07-08 15:01:25 +02:00
Michal Simek
43341fc021 cmd: Introduce CMD_HELP
Add option to disable help command in size constrained systems to save some
space. There is also no need to have ifdefs around CMDLINE because all
commands depends on it.
And also mark cmd_help dependency in test_help.py.

Reviewed-by: Peter Robinson <pbrobinson@gmail.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/c17f825fb8a74e1d1912a3fd09a9a880c84a8bfd.1751286059.git.michal.simek@amd.com
2025-07-08 15:00:17 +02:00
Michal Simek
229ec06353 arm64: zynqmp: Enable rng-seed generation
SOM has TPM with RNG in it that's why enable rng-seed generation.

Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/0e55eb3eade94e9cd0ffe04da0618aa6b1589f01.1751442246.git.michal.simek@amd.com
2025-07-08 14:58:44 +02:00
Venkatesh Yadav Abbarapu
cd91235070 spi: cadence_qspi: Fix odd byte write issue in STIG mode
Starting from 'commit <8077d296adff> ("spi: cadence-quadspi: Use STIG
mode for all ops with small payload") the utilization of STIG mode
has been implemented for read and write operations involving less
than 8 bytes of data.

However, following this commit, encountering timeout issues occurs when
writing odd bytes of data in DDR mode, as indicated below:
"jedec_spi_nor flash@0: flash operation timed out
SF: 3 bytes @ 0x0 Written: ERROR -110"

To resolve this issue, the number of bytes to write has been updated
specifically for DDR mode.

Signed-off-by: Tejas Bhumkar <tejas.arvind.bhumkar@amd.com>
Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Link: https://lore.kernel.org/r/20250704040444.671604-1-venkatesh.abbarapu@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
2025-07-08 14:58:44 +02:00
Venkatesh Yadav Abbarapu
28fe6ea6e5 config: versal2: Update timer clock to 100Mhz
U-Boot timer clock is not updated when it is migrated from
emulator to silicon. Update CONFIG_COUNTER_FREQUENCY to 100Mhz.

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Link: https://lore.kernel.org/r/20250704090920.678557-1-venkatesh.abbarapu@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
2025-07-08 14:58:44 +02:00
Venkatesh Yadav Abbarapu
22add070a4 arm64: versal2: Enable reset and poweroff via sysreset framework
reset and poweroff are called via hooks in psci driver which is going
around sysreset framework that's why enable sysreset drivers and do
reset and poweroff via this framework.

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Link: https://lore.kernel.org/r/20250707040607.758919-2-venkatesh.abbarapu@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
2025-07-08 14:58:44 +02:00
Venkatesh Yadav Abbarapu
fbd586d358 arm64: versal2: Do not define do_reset() if sysreset is enabled
If sysreset is enabled reset_cpu is defined in sysreset uclass
that's why it can't be in platform/board code.

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Link: https://lore.kernel.org/r/20250707040607.758919-3-venkatesh.abbarapu@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
2025-07-08 14:58:44 +02:00
Venkatesh Yadav Abbarapu
7d8eafcf98 xilinx: zynqmp: disable CONFIG_SPI_FLASH_BAR
Legacy SPI flash devices used a 24-bit (3-byte) addressing scheme,
limiting the addressable memory to 16 MB. To support larger densities
(256 Mbit and higher), extended addressing schemes, such as 32-bit
(4-byte) addressing, were introduced. If the flash density exceeds
16 MB and CONFIG_SPI_FLASH_BAR is disabled, the device will use a
4-byte addressing mode.

Signed-off-by: Prasad Kummari <prasad.kummari@amd.com>
Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Link: https://lore.kernel.org/r/20250707043738.795179-1-venkatesh.abbarapu@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
2025-07-08 14:58:44 +02:00
Venkatesh Yadav Abbarapu
f289c36f07 config: amd: Enable the SPI_STACKED_PARALLEL config option
Enable the SPI_STACKED_PARALLEL config option for
AMD versal2 platform, as this is required for parallel and
stacked memories.

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Link: https://lore.kernel.org/r/20250707043037.792987-1-venkatesh.abbarapu@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
2025-07-08 14:58:43 +02:00
Naresh Kumar Ravulapalli
a988d4ea00 drivers: fpga: intel_sdm_mb: Check SIP SMC status in send_bitstream()
While sending bitstream via SIP SMC, busy status received does not
correspond to error, instead it means transfer is accepted but SDM
doesn't have any more free buffer space. Hence, data transmission
is continued when busy status is received.

Signed-off-by: Naresh Kumar Ravulapalli <nareshkumar.ravulapalli@altera.com>
Link: https://lore.kernel.org/r/20250701044311.3670-1-nareshkumar.ravulapalli@altera.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
2025-07-08 14:58:43 +02:00
Michal Simek
14f627bf43 xilinx: Remove simple-bus description from mini configurations
simple bus node and drivers not bringing up any value for mini
configuration that's why remove it and disable drivers for it to save some
space.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/a51b11fa21c504a19701ebdccc1e61e899e1aed5.1751016029.git.michal.simek@amd.com
2025-07-08 14:58:43 +02:00
Venkatesh Yadav Abbarapu
b714685577 mmc: zynq_sdhci: Reset the host controller
Reset the host controller at the early stage of probe so that the
configuration will be done properly for reboot cases.

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Link: https://lore.kernel.org/r/20250626062440.295301-1-venkatesh.abbarapu@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
2025-07-08 14:58:43 +02:00
Michal Simek
1b267fe182 firmware: xilinx: Prepare code for new SMC firmware format
Separate code to own function to be able to add new enhancement format.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/cf99fe1af82bc004de3e313d4018464f4504f380.1750858165.git.michal.simek@amd.com
2025-07-08 14:58:43 +02:00
Tom Rini
237574c181 firmware: xilinx: Tighten dependencies for ZYNQMP_FIRMWARE
The ZYNQMP_FIRMWARE code  cannot build without platform specific headers
being available. Express that requirement in Kconfig as well.

Signed-off-by: Tom Rini <trini@konsulko.com>
Link: https://lore.kernel.org/r/20250702010410.18828-1-trini@konsulko.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
2025-07-08 14:58:43 +02:00
Padmarao Begari
d8510df627 xilinx: zynqmp: Enable xilinx ethernet phy
Enable xilinx ethernet phy on ZynqMP by default.

Signed-off-by: Padmarao Begari <padmarao.begari@amd.com>
Link: https://lore.kernel.org/r/20250624084645.1185428-1-padmarao.begari@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
2025-07-08 14:58:43 +02:00
Padmarao Begari
a5f2aa4b38 clk: zynqmp: Add support for dpll clock source
The clock driver fails to correctly calculate the PLL clock
rate for peripherals when using the DPLL as the clock source.
The DPLL operates within the full power domain, while peripheral
clocks reside in the low power domain. To ensure accurate PLL
clock rate computation when the peripheral clock source is set
to DPLL, the DPLL-to-LPD cross divisor is used.

Signed-off-by: Padmarao Begari <padmarao.begari@amd.com>
Link: https://lore.kernel.org/r/20250618094329.296731-1-padmarao.begari@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
2025-07-08 14:58:43 +02:00
Tom Rini
4216a86343 arm: zynqmp: Remove local copy of 'dt-bindings/clock/xlnx-zynqmp-clk.h'
As part of the recent cleanup of dt-bindigns header files we did not
remove our copy of dt-bindings/clock/xlnx-zynqmp-clk.h at the time. This
is because the difference between ours and current upstream is that
current upstream has a #warning to not use it and to instead use
xlnx-zynqmp-clk.h. So we change zynqmp-clk-ccf.dtsi to use the other
and upstream-only file and then delete our dt-bindings file.

Signed-off-by: Tom Rini <trini@konsulko.com>
Tested-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/20250612181128.340232-1-trini@konsulko.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
2025-07-08 14:58:43 +02:00
Michal Simek
ed1c1385ce clk: versal: Fix clock driver dependency
Driver fully depends on firmware driver to be present that's why change
imply to depends on to cover it.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/bd18a4ce3e65411bb956636d4a2ef4b5fbe8b9e1.1749104235.git.michal.simek@amd.com
2025-07-08 14:58:43 +02:00
Tom Rini
b379335f14 configs: Resync with savedefconfig
Resync all defconfig files using qconfig.py

Signed-off-by: Tom Rini <trini@konsulko.com>
2025-07-07 14:15:18 -06:00
Tom Rini
6d0b8874fd Merge branch 'next' 2025-07-07 14:10:59 -06:00
Tom Rini
e37de002fa Prepare v2025.07
Signed-off-by: Tom Rini <trini@konsulko.com>
v2025.07
2025-07-07 09:48:28 -06:00
David Lechner
15182ce25d configs: legoev3: adjust to reduce binary size
Adjust legoev3_defconfig to reduce the binary output size.

As u-boot has bloated a bit over the years, the legoev3_defconfig can no
longer build something that fits in the 256kB size limit of the EV3.
This drops a few unused features, but the real difference-makers are
enabling thumb instructions and using link time optimization to reduce
the size.

This reduced u-boot.bin from 279,920 to 198,416 bytes on my local
machine with arm-none-eabi-gcc (15:13.2.rel1-2) 13.2.1 20231009.

HAS_BOARD_SIZE_LIMIT is also added to catch any future regressions.

Signed-off-by: David Lechner <david@lechnology.com>
2025-07-04 14:48:06 -06:00
Fabio Estevam
d1d53c252a mx6sabresd: Reduce U-Boot proper size to fix boot regression
The mx6sabresd U-Boot proper binary size has grown beyond the
CONFIG_BOARD_SIZE_LIMIT.

Reduce its size by removing the CONFIG_MULTI_DTB_FIT, BOOTM_PLAN9 and
BOOTM_RTEMS options.

According to doc/README.multi-dtb-fit:

"Usually the DTB is selected by the SPL and passed down to U-Boot. But some
platforms don't use the SPL. In this case MULTI_DTB_FIT can used to provide
U-Boot with a choice of DTBs"

mx6sabresd uses SPL, so MULTI_DTB_FIT can be safely dropped as the DTB
selection in SPL is done by board_fit_config_name_match().

Tested boot on the imx6dl and imx6q variants.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
2025-07-04 10:55:42 -06:00
Tom Rini
7598b469c1 u-boot-dfu-next-20250703
Android:
 - Fix uninitialized vhdr pointer in image-android.c
 - Fix uninitialized vhdr pointer in abootimg cmd
 
 DFU:
 - Update maintainers file to include spl/spl_dfu
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEELulCp7Yfar5TE60AGQ0dtGZOGTUFAmhma+QACgkQGQ0dtGZO
 GTVgcwf/R5OcG4vbo5cRLV1fOH1zKplcXbHnWz55OHjZGESfAUa58Qtu1nz0zSOl
 FEcMnEUBAQV0pq0bEfU1jsZzZh81T9pnOuOYw5MOVwr00KosF0AxIwoRx2duif2P
 zclPkd0XLNsAACj9SPXE0t2UGoz+xBY0XnylNSns5zrKtMiYgWsZtVolGLtBsiVw
 laUnzKK9VkNPvCGIyOW6U9Pgdx+t0QPmTJ3z/oRpE6hRVm26IM7qF203Vdrk21Ji
 c8mZF3URGBLSICsFJTIjF1aWyzcqmMii8i765Qvlol3TYh+HsNtJT1hXsbmu40Rg
 POKVbFS070uRF7fZXxG8FRJrACOo2w==
 =pMG3
 -----END PGP SIGNATURE-----

Merge tag 'u-boot-dfu-next-20250703' of https://source.denx.de/u-boot/custodians/u-boot-dfu into next

u-boot-dfu-next-20250703

CI job:
- https://source.denx.de/u-boot/custodians/u-boot-dfu/-/pipelines/26938

Android:
- Fix uninitialized vhdr pointer in image-android.c
- Fix uninitialized vhdr pointer in abootimg cmd

DFU:
- Update maintainers file to include spl/spl_dfu
2025-07-03 08:27:29 -06:00
Tom Rini
1323b480a6 Merge branch 'next' of https://source.denx.de/u-boot/custodians/u-boot-riscv into next
CI: https://source.denx.de/u-boot/custodians/u-boot-riscv/-/pipelines/26936

- RISC-V: Add big-endian build support
- Board: aclint_ipi: Support T-Head C900 CLINT
- Board: mpfs_icicle: Implement
  board_fdt_blob_setup()/board_fit_config_name_match()
- Driver: pinctrl: Port pin controller driver for T-Head TH1520 SoC
- Driver: cache: Update dependency for ANDES_L2_CACHE
2025-07-03 08:26:50 -06:00
Tom Rini
218db7bdbd Sughosh added EFI HTTP(s) support into our eficonfig application. Up to
now we could only enable that via our efidebug command. Users now get that
 option on the eficonfig menu.
 
 Javier implemented support for the EFI_PARTITION_INFO_PROTOCOL,
 to provide cached partition information for GPT partition types.
 The protocol describes legacy MBR partition types, but that's for backward
 compatibility and not implemented by this series.
 The protocol is needed by [0], an implementation of a UEFI based A/B boot
 protocol for the root filesystem.
 
 Paul added support for EFI_DEBUG_IMAGE_INFO_TABLE. This is part of the EFI
 spec and is defining a debug protocol that Google currently uses to debug
 their Generic Bootloader project [1][2], using EFI to load Android.
 Heinrich contributed a test EFI application for it as well.
 The efi_realloc() function he added will realloc any type of memory to
 BootServicesData, but keeping in mind the new protocol is the only consumer
 he will fix that on a followup patch.
 
 Finally another round of smatch fixes from Andrew cleans up coding errors.
 
 [0] https://gitlab.com/CentOS/automotive/src/ukiboot
 [1] https://lpc.events/event/18/contributions/1704/attachments/1550/3231/Android%20Generic%20Boot%20Loader.pdf
 [2] https://source.android.com/docs/core/architecture/bootloader/generic-bootloader
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEgWII69YpahbL5iK5gS8AYozs+qIFAmhmUT8ACgkQgS8AYozs
 +qJMmA//fB6vyIWZEGtlDRoY8VEh58aaPQldo3fLC4MY3CxPBEmTZHTEJlz6MdLt
 ZRCOqHx2xbYeUDxarz+m5hsZhrnwnBJ4fJR6IC4TwG7ilC7OyDXek1k8pXaIZnTk
 PiWd1rRgqYHnZl5FiY/FUNQLGI+XqyLjzgdL//BRNGJa+++d3COMDLmOSIbhFfDm
 JcHmJn7obUzEo+W5Y9MRktzzqKFvZAL+bobjJyVDJYu0Xk+PTwO7WgJaGwjxSYqU
 8qMAIyAjc/MX2oKLDRECCY45UcoW32RsDempqKCrMcDc00lMb/kKmnqX0Qhh0gbT
 HTjwvRsMD3qqG81SV8hBoP5JWe27bv1zVJygRO/69BlPzJZsoVBjCvUAyTqvg/bW
 wAPUXYBh6kBt7AGUgdVMEwpPNN/vpIO9ITsM5pfyp33KJHsgvp47Mggkq3A/y/ag
 D3hvfKd35euyMySLnBq4yqzu+x6q+52fhmHxEjbDBxJEALRVvhzm70mlTIUzkIY3
 J5DBj8jkrsTOflfzdk2Q2S0T4pUEkA20a9OtyxGrES5uF1I4b1eAeIwB5QSOqCWi
 PwklRjVb/44CsmwuHrnUF7t8WkGLdSQsqVbxiuArAPRI9h1G8JswhConvVlOOR5R
 5zmHGxe6hgXPdgBVowq4lIX+NUXdDsSgWeK8+2cZq+P7TegB1ac=
 =Ynnd
 -----END PGP SIGNATURE-----

Merge tag 'efi-next-03072025' of https://source.denx.de/u-boot/custodians/u-boot-tpm into next

Sughosh added EFI HTTP(s) support into our eficonfig application. Up to
now we could only enable that via our efidebug command. Users now get that
option on the eficonfig menu.

Javier implemented support for the EFI_PARTITION_INFO_PROTOCOL,
to provide cached partition information for GPT partition types.
The protocol describes legacy MBR partition types, but that's for backward
compatibility and not implemented by this series.
The protocol is needed by [0], an implementation of a UEFI based A/B boot
protocol for the root filesystem.

Paul added support for EFI_DEBUG_IMAGE_INFO_TABLE. This is part of the EFI
spec and is defining a debug protocol that Google currently uses to debug
their Generic Bootloader project [1][2], using EFI to load Android.
Heinrich contributed a test EFI application for it as well.
The efi_realloc() function he added will realloc any type of memory to
BootServicesData, but keeping in mind the new protocol is the only consumer
he will fix that on a followup patch.

Finally another round of smatch fixes from Andrew cleans up coding errors.

The CI https://source.denx.de/u-boot/custodians/u-boot-tpm/-/pipelines/26935
seems happy

[0] https://gitlab.com/CentOS/automotive/src/ukiboot
[1] https://lpc.events/event/18/contributions/1704/attachments/1550/3231/Android%20Generic%20Boot%20Loader.pdf
[2] https://source.android.com/docs/core/architecture/bootloader/generic-bootloader
2025-07-03 08:25:38 -06:00
Tom Rini
f62062a64d cache: Update dependency for ANDES_L2_CACHE
The cache driver here can only build on RISCV due to header
dependencies. Express that requirement in Kconfig as well.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2025-07-03 18:11:06 +08:00
Conor Dooley
7c16ebba1e board: mpfs_icicle: implement board_fdt_blob_setup()/board_fit_config_name_match()
The firmware on the Icicle is capable of providing a devicetree in a1 to
U-Boot, but until now the devicetree has been packaged in a "payload" [1]
alongside U-Boot (or other bootloaders/RTOSes) and appended to the image.
The address of this appended devicetree is placed in a1 by the firmware.
This meant that the mechanism used by OF_SEPARATE to locate the
devicetree at the end of the image would pick up the one provided by the
firmware when u-boot-nodtb.bin was in the payload and U-Boot's devicetree
when u-boot.bin was.

The firmware is now going to be capable of providing a minimal devicetree
(quite cut down due to severe space constraints), but this devicetree is
linked into the firmware that runs out of the L2 rather than at the end
of the U-Boot image.

Implement board_fdt_blob_setup() so that this devicetree can be
optionally used, and the devicetree provided in the "payload" can be
used without relying on "happening" to implement the same strategy as
OF_SEPARATE expects in combination with u-boot-nodtb.bin.
Unlike other RISC-V boards, the firmware provided devicetree is only
used when OF_BOARD is set, so that the almost certainly more complete
devicetree in U-Boot will be used unless explicitly requested otherwise.

Implement board_fit_config_name_match(), so that, using the firmware
provided cut-down/minimal dtb, U-Boot can select one of several
devicetrees when MULTI_DTB_FIT is enabled.

Enabling both MULTI_DTB_FIT and OF_BOARD will lead to a conflict
between the two options, with the latter taking priority due to
board_fdt_blob_setup() being executed before board_fit_config_name_match(),
which causes gd->fdt_blob to be overwritten with a pointer to the
minimal devicetree rather than the location of the fit image containing
the multiple dtbs. Let MULTI_DTB_FIT take priority in this case, by
explicitly blocking the override when MULTI_DTB_FIT is enabled.

Link: https://github.com/polarfire-soc/hart-software-services/blob/master/tools/hss-payload-generator/README.md [1]
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
Acked-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2025-07-03 18:11:02 +08:00
Yao Zi
c7e27f9a4a riscv: cpu: th1520: Enable pinctrl by default
Select PINCTRL_TH1520 in CPU Kconfig entry and update defconfig for
existing TH1520-based boards to ensure PINCTRL is enabled.

Signed-off-by: Yao Zi <ziyao@disroot.org>
Acked-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2025-07-03 18:10:58 +08:00
Yao Zi
a4f9013e31 riscv: dts: th1520: Add pin controllers
Describe the three pin controllers integrated in TH1520 SoC. Since we
don't have support for clocks in the AON region, a dummy fixed-clock
node is added to supply the pin controller locating in it.

Signed-off-by: Yao Zi <ziyao@disroot.org>
Acked-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2025-07-03 18:10:58 +08:00
Yao Zi
4981db8130 pinctrl: Port pin controller driver for T-Head TH1520 SoC
The SoC pads of TH1520 are separated into three groups (AP 1, AP 2 and
AON) controlled by independent pin controllers. This patch ports their
driver from Linux kernel with most code for setting pinconf and pinmux
kept as is.

The dt-binding of TH1520 pin controller uses a schema where pins to
configure are specfied as strings and looked up at runtime, which the
generic pinctrl helpers of U-Boot cannot parse, thus a customized
set_state() callback is implemented to parse pinconfig nodes and setup
the configuration.

Signed-off-by: Yao Zi <ziyao@disroot.org>
Acked-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2025-07-03 18:10:58 +08:00
Ben Dooks
364627596c riscv: byteorder: add test for big-endian
Test for big-endian either via __RISCVEB__ which migth be
rather old, or check the BYTE_ORDER if the compiler defines
it (which should be any modern gcc like v12)

Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
Acked-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2025-07-03 18:10:50 +08:00
Ben Dooks
7bd65e89ad riscv: add build support for big-endian
Add support to build code big-endian if the board supports
it. Updates the makefile to pass the correct compiler and
elf flags.

Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
Reviewed-by: Tom Rini <trini@konsulko.com>
2025-07-03 18:10:50 +08:00
Heinrich Schuchardt
95732f2bf8 efi_loader: add dbginfodump.efi
Provide a test application to dump the EFI_DEBUG_IMAGE_INFO_TABLE
as implemented in EDK II.

EFI_DEBUG_IMAGE_INFO is not packed in contrast to many other EFI
structures.

As of today EDK II when removing an entry in the EfiDebugImageInfoTable
just sets NormalImage = NULL but does not compact the array. So
TableSize reflects the number of non-NULL entries and not the array
size as reported independently in
https://github.com/tianocore/edk2/pull/11013 and
https://github.com/tianocore/edk2/pull/11019.

The current implementation tolerates this deviation from the UEFI
specification.

This is what the output may look like:

    Debug Info Table Dump
    =====================

    => dump
    Modified
    Number of entries: 0x0000004a
    Info type 0x00000001
      Address: [0x000000008315a000, 0x00000000831bafff]
      File: FvFile(D6A2CB7F-6A18-4E2F-B43B-9920A733700A)
      Handle: 0x000000017fe3cb18
    ...
    Info type 0x00000001
      Address: [0x000000017e8db000, 0x000000017ea00f3f]
      File: FvFile(7C04A583-9E3E-4F1C-AD65-E05268D0B4D1)
      Handle: 0x000000017f358e98
    Info type 0x00000001
      Address: [0x000000017eae5000, 0x000000017eae81ff]
      File: \dbginfodump.efi
      Handle: 0x000000017eaf0298
    =>

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-07-03 12:26:45 +03:00
Ying-Chun Liu (PaulLiu)
2e5ca84aad efi: selftest: add selftest for EFI_DEBUG_SUPPORT
Add selftest to check the installed configuration table that has
the correct GUID.

Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ying-Chun Liu (PaulLiu) <paul.liu@linaro.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-07-03 12:25:56 +03:00
Ying-Chun Liu (PaulLiu)
146546138a efi: add EFI_DEBUG_IMAGE_INFO for debug
This commit adds the functionality of generate EFI_DEBUG_IMAGE_INFO
while loading the image.

This feature is described in UEFI Spec 2.10. Section 18.4.3.
The implementation ensures support for hardware-assisted debugging and
provides a standardized mechanism for debuggers to discover the load
address of an EFI application.

Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Cc: Peter Robinson <pbrobinson@gmail.com>
Cc: Simon Glass <sjg@chromium.org>
Signed-off-by: Ying-Chun Liu (PaulLiu) <paul.liu@linaro.org>
Tested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-07-03 12:25:56 +03:00
Ying-Chun Liu (PaulLiu)
3c08df58cc lib: efi_loader: efi_memory.c: add efi_realloc() for realloc memory
Add efi_realloc() for realloc memory that previously alloc by efi_alloc().
Note that if realloced memory is explicitly allocated as BootServicesData.

Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Cc: Peter Robinson <pbrobinson@gmail.com>
Cc: Simon Glass <sjg@chromium.org>
Signed-off-by: Ying-Chun Liu (PaulLiu) <paul.liu@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-07-03 12:25:56 +03:00
Ying-Chun Liu (PaulLiu)
e7a85ec651 efi: add EFI_DEBUG_IMAGE_INFO_TABLE for debug
EFI_DEBUG_IMAGE_INFO_TABLE is used to store EFI_LOADED_IMAGE for
debug purpose. This commit adds the table to the EFI_CONFIGURATION_TABLE.

This feature is described in UEFI Spec version 2.10. Section 18.4.
The implementation ensures support for hardware-assisted debugging and
provides a standardized mechanism for debuggers to discover and interact
with system-level debug resources.

Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
Cc: Peter Robinson <pbrobinson@gmail.com>
Cc: Simon Glass <sjg@chromium.org>
Signed-off-by: Ying-Chun Liu (PaulLiu) <paul.liu@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-07-03 12:25:56 +03:00
Ying-Chun Liu (PaulLiu)
aaf7be96c2 efi: add EFI_SYSTEM_TABLE_POINTER for debug
Add EFI_SYSTEM_TABLE_POINTER structure for remote debugger to locate
the address of EFI_SYSTEM_TABLE.

This feature is described in UEFI SPEC version 2.10. Section 18.4.2.
The implementation ensures support for hardware-assisted debugging and
provides a standardized mechanism for debuggers to discover the EFI
system table.

Cc: Peter Robinson <pbrobinson@gmail.com>
Cc: Simon Glass <sjg@chromium.org>
Signed-off-by: Ying-Chun Liu (PaulLiu) <paul.liu@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Tested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> # change memset(systab_pointer, 0 ...) -> systab_pointer->crc32 = 0;
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-07-03 12:25:47 +03:00
Sughosh Ganu
46a564d689 test: wget: add a test case for validating URI
The wget module has a function wget_validate_uri() which is used for
validating the URI to be used by wget. Add a basic test case for this
function.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-07-03 11:34:20 +03:00
Sughosh Ganu
ed004a260a cmd: eficonfig: add support for URI device path based boot options
The eficonfig command provides a menu based interface for maintenance
of the EFI boot options. Add support for adding a URI based boot
option. This boot option can then be used for HTTP boot.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Tested-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-07-03 11:34:10 +03:00
Andrew Goodbody
9a64eecad6 efi_loader: Prevent free of uninitialised pointer
Taking a goto to out_of_resources before receive_lengths is assigned
will result in an attempt to free an unitialised pointer. Instead
initialise receive_lengths to NULL on declaration to prevent this from
occurring.

This issue was found by Smatch.

Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-07-03 11:32:49 +03:00
Andrew Goodbody
5753dc3f65 efi_loader: Prevent dereference of uninitialised variable
If phandler is returned as NULL from efi_search_protocol then
protocol_interface is never assigned to. Instead return
EFI_UNSUPPORTED as per the spec.

This issue found by Smatch.

Also eliminate the use of the variable protocol_interface as it is not
needed.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-07-03 11:32:49 +03:00
Andrew Goodbody
9d95a35715 efi_loader: Prevent dereferencing NULL pointer
Taking the first goto error: in file_open could either result in an
attempt to dereference fh when NULL or else free fh->path which has
not been assigned to and so will be unknown. Avoid both of these
problems by passing path to free instead of fh->path.

This issue found by Smatch.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-07-03 11:32:49 +03:00
Javier Martinez Canillas
4e103418be efi_selftest: Add basic partition info check to block io test
Test the EFI_PARTITION_INFO_PROTOCOL in the existing EFI_BLOCK_IO_PROTOCOL
unit test. It is fairly basic, since it only checks that the values of the
struct efi_partition_info .revision, .type and .system fields are correct.

It doesn't check the MBR partition record information, because that's not
supported by the EFI_PARTITION_INFO_PROTOCOL implementation yet. The test
can be extended once the support is implemented, or if the in-memory disk
image used for the test is modified to have a GPT partition type instead.

Suggested-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-07-03 11:32:49 +03:00
Javier Martinez Canillas
2fdfb802e3 efi_loader: disk: add EFI_PARTITION_INFO_PROTOCOL support
The UEFI 2.10 specification mentions that this protocol shall be installed
along with EFI_BLOCK_IO_PROTOCOL. It provides cached partition information
for MBR and GPT partition types.

This patch just implements support for GPT partition types. The legacy MBR
partition types is only needed for backward compatibility and can be added
as a follow-up if needed, to make it fully compliant with the EFI spec.

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-07-03 11:32:49 +03:00
Javier Martinez Canillas
f517d93842 disk: efi: expose the part_get_gpt_pte() helper function
This function will be used by the EFI application disk support code
to provide data required by the EFI_PARTITION_INFORMATION_PROTOCOL.

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-07-03 11:32:49 +03:00
Javier Martinez Canillas
4b0414d146 disk: efi: Move logic to get a GPT entry into a helper function
Factor out the logic to get the Partition Table Entry (PTE) of a given
partition into a helper function, since it could be used by other code.

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-07-03 11:32:49 +03:00
Yao Zi
a23c1b3fc0 board: thead: licheepi4a: Bring up secondary cores in SPL
Setup core information and bring secondary HARTs up for a functional
multi-core system.

Signed-off-by: Yao Zi <ziyao@disroot.org>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2025-07-03 16:14:13 +08:00