diff options
| author | Tom Rini <[email protected]> | 2025-11-07 08:26:59 -0600 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2025-11-07 08:26:59 -0600 |
| commit | df786b4c57f582b4f875effe68d3ae22bbb478a9 (patch) | |
| tree | d58021af29a136ce4a9764ac31c2b91c15e868fb | |
| parent | b660df558545b42f7257899807b83cfc620b2983 (diff) | |
| parent | 6bb374b1a1226b964db8476b2939a280c7477e4a (diff) | |
Merge tag 'efi-2026-01-rc2' of https://source.denx.de/u-boot/custodians/u-boot-efi
Pull request efi-2026-01-rc2
CI: https://source.denx.de/u-boot/custodians/u-boot-efi/-/pipelines/28208
Documentation:
* bootstd: Describe environment variable extension_overlay_addr
environment and remove extension support from TODO list
EFI:
* Correct the detection of the video mode in the EFI payload app:
- Use struct efi_gop_mode_info in the definition of struct
efi_entry_gopmode.
- In function get_mode_from_entry() use the correct type for the video
mode structure.
* Use a valid error code as return value in efi_store_memory_map().
* Avoid a memory leak for the variable name in efi_bl_create_block_device().
* Correct the code indentation in efi_uc_stop().
* Correct the description of struct efi_priv.
* Fix typos in code comments.
Other:
* qfw: Add more fields and a heading to qfw list
* Fix the support for ACPI pass-through on ARM and RISC-V:
Avoid zeroing out the XSDT address
* test: provide unit test for 'acpi list' command
# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCAAdFiEEbcT5xx8ppvoGt20zxIHbvCwFGsQFAmkNj/kACgkQxIHbvCwF
# GsS8NQ/6Aj+Z54HJTIEfoXssvElLr5ATactrCxszq42i/yy6dLqa2Ym1afG6w1XS
# 1ZbCeU/bCXFke5Tsz+x89gEfckUm83oTwngwcID0WR1qn8mWjwR7tM5MuORq8NxU
# 7NwLuFs9O/QZihagKdz6hv1/Y+cBwiAYLY16EYVSuUlbLaKQo3QvxwWkqG3jdKWV
# Rm58/PolU+2h04MBwP0SxSduX4OyRF/tMOGjf5RGLyqCyj8kIgdu7PvUAPMM+Gps
# KemL59V0Bdv8hlF4JknmPz+idtZg2nHIDdNrBZvoxwzwGQeRZ1YXAMruRxZXqDYL
# tiuDp6HMv/GfIIGkz14tJtJMdboaAybAnluPWGalx8JQJqJzEPww0R+9s4KKQeWL
# mHgRyl6PxVV9p19f79Qq6q6ETwrFDX0YH3pdrGUk3DBa3lDt0UsEAnuW4FvaJ8tx
# 3PMrjKAxpxocT0hglsMVnptnfvDEigMsjwH/TWrau83mY+juxFQLjm+U4vye+qCa
# 4zXjjLas18+eRcrv2KxU7teakyi1Jp+WbqHq37L26YcQMaLq/RkBc0bTrsreKKLu
# jprYFpvc7EJpH2Fd1XWaZ2EnxXcVSJSvrY/iwRQqb6wbwQ6XGtMvSh3IFY8IzAoh
# N2Pj78oaYqyL1q/TftuZWhEHo3a0M/HfM4D+oMSHzJtWCb0wZHE=
# =OGcS
# -----END PGP SIGNATURE-----
# gpg: Signature made Fri 07 Nov 2025 12:21:45 AM CST
# gpg: using RSA key 6DC4F9C71F29A6FA06B76D33C481DBBC2C051AC4
# gpg: Good signature from "Heinrich Schuchardt <[email protected]>" [unknown]
# gpg: aka "[jpeg image of size 1389]" [unknown]
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg: There is no indication that the signature belongs to the owner.
# Primary key fingerprint: 6DC4 F9C7 1F29 A6FA 06B7 6D33 C481 DBBC 2C05 1AC4
| -rw-r--r-- | cmd/qfw.c | 6 | ||||
| -rw-r--r-- | doc/develop/bootstd/overview.rst | 4 | ||||
| -rw-r--r-- | doc/usage/cmd/qfw.rst | 27 | ||||
| -rw-r--r-- | drivers/misc/qfw_acpi.c | 1 | ||||
| -rw-r--r-- | drivers/video/efi.c | 2 | ||||
| -rw-r--r-- | include/efi.h | 38 | ||||
| -rw-r--r-- | include/efi_api.h | 9 | ||||
| -rw-r--r-- | lib/efi_client/efi.c | 6 | ||||
| -rw-r--r-- | lib/efi_driver/efi_block_device.c | 8 | ||||
| -rw-r--r-- | lib/efi_driver/efi_uclass.c | 2 | ||||
| -rw-r--r-- | lib/efi_loader/efi_net.c | 2 | ||||
| -rw-r--r-- | test/cmd/Makefile | 4 | ||||
| -rw-r--r-- | test/cmd/acpi.c | 52 | ||||
| -rw-r--r-- | test/cmd/qfw.c | 40 |
14 files changed, 151 insertions, 50 deletions
diff --git a/cmd/qfw.c b/cmd/qfw.c index 1b108118658..09bd7d9849d 100644 --- a/cmd/qfw.c +++ b/cmd/qfw.c @@ -22,10 +22,14 @@ static int qemu_fwcfg_cmd_list_firmware(void) if (ret) return ret; + printf(" Addr Size Sel Name\n"); + printf("---------------- -------- --- ------------\n"); for (file = qfw_file_iter_init(qfw_dev, &iter); !qfw_file_iter_end(&iter); file = qfw_file_iter_next(&iter)) { - printf("%08lx %-56s\n", file->addr, file->cfg.name); + printf("%16lx %8x %3x %-48s\n", file->addr, + be32_to_cpu(file->cfg.size), + be16_to_cpu(file->cfg.select), file->cfg.name); } return 0; diff --git a/doc/develop/bootstd/overview.rst b/doc/develop/bootstd/overview.rst index abb616adc77..397f6db18b4 100644 --- a/doc/develop/bootstd/overview.rst +++ b/doc/develop/bootstd/overview.rst @@ -252,6 +252,9 @@ Various environment variables are used by standard boot. These allow the board to control where things are placed when booting the OS. You should ensure that your boards sets values for these. +extension_overlay_addr (needed if extension is used) + Address at which to load the extension FDT overlays, e.g. 0x02000000 + fdtfile Name of the flattened device tree (FDT) file to load, e.g. "rockchip/rk3399-rockpro64.dtb" @@ -868,7 +871,6 @@ To do Some things that need to be done to completely replace the distro-boot scripts: -- implement extensions (devicetree overlays with add-on boards) - implement legacy (boot image v2) android boot flow Other ideas: diff --git a/doc/usage/cmd/qfw.rst b/doc/usage/cmd/qfw.rst index 40770acb3c0..0a65a247b44 100644 --- a/doc/usage/cmd/qfw.rst +++ b/doc/usage/cmd/qfw.rst @@ -44,18 +44,21 @@ QEMU firmware files are listed via the *qfw list* command: :: => qfw list - 00000000 bios-geometry - 00000000 bootorder - 000f0060 etc/acpi/rsdp - bed14040 etc/acpi/tables - 00000000 etc/boot-fail-wait - 00000000 etc/e820 - 00000000 etc/smbios/smbios-anchor - 00000000 etc/smbios/smbios-tables - 00000000 etc/system-states - 00000000 etc/table-loader - 00000000 etc/tpm/log - 00000000 genroms/kvmvapic.bin + Addr Size Sel Name + ---------------- -------- --- ------------ + 0 0 20 bios-geometry + 0 0 21 bootorder + 1fc6c000 14 22 etc/acpi/rsdp + 1fc6c040 20000 23 etc/acpi/tables + 0 4 24 etc/boot-fail-wait + 0 28 25 etc/e820 + 0 8 26 etc/msr_feature_control + 0 18 27 etc/smbios/smbios-anchor + 0 151 28 etc/smbios/smbios-tables + 0 6 29 etc/system-states + 0 1000 2a etc/table-loader + 0 0 2b etc/tpm/log + 0 2400 2c genroms/kvmvapic.bin Where an address is shown, it indicates where the data is available for inspection, e.g. using the :doc:`md`. diff --git a/drivers/misc/qfw_acpi.c b/drivers/misc/qfw_acpi.c index c6c052ac6c3..721f42ecbc3 100644 --- a/drivers/misc/qfw_acpi.c +++ b/drivers/misc/qfw_acpi.c @@ -265,7 +265,6 @@ out: struct acpi_rsdp *rsdp = ctx->rsdp; rsdp->length = sizeof(*rsdp); - rsdp->xsdt_address = 0; rsdp->ext_checksum = table_compute_checksum((u8 *)rsdp, sizeof(*rsdp)); gd_set_acpi_start(acpi_get_rsdp_addr()); diff --git a/drivers/video/efi.c b/drivers/video/efi.c index 78d123fad4b..8ce2ef9dc67 100644 --- a/drivers/video/efi.c +++ b/drivers/video/efi.c @@ -104,7 +104,7 @@ static int get_mode_info(struct vesa_mode_info *vesa, u64 *fbp, static int get_mode_from_entry(struct vesa_mode_info *vesa, u64 *fbp, struct efi_gop_mode_info **infop) { - struct efi_gop_mode *mode; + struct efi_entry_gopmode *mode; int size; int ret; diff --git a/include/efi.h b/include/efi.h index f9bbb175c3a..b98871fedad 100644 --- a/include/efi.h +++ b/include/efi.h @@ -386,6 +386,28 @@ struct efi_entry_memmap { }; /** + * struct efi_gop_mode_info - graphics output mode information + */ +struct efi_gop_mode_info { + /** @version: version of the data structure (use zero) */ + u32 version; + /** @width: horizontal screen size */ + u32 width; + /** @height: vertical screen size */ + u32 height; + /** @pixel_format: enum that specifies the storage format of pixels */ + u32 pixel_format; + /** + * @pixel_bitmask: bitmasks used with PixelPixelBitMask + * + * The values which bits are used for red, green, blue, and alpha. + */ + u32 pixel_bitmask[4]; + /** @pixels_per_scanline: pixels per video memory line */ + u32 pixels_per_scanline; +}; + +/** * struct efi_entry_gopmode - a GOP mode table passed to U-Boot * * @fb_base: EFI's framebuffer base address @@ -404,19 +426,7 @@ struct efi_entry_gopmode { */ u64 fb_size; u64 info_size; - /* - * We cannot directly use 'struct efi_gop_mode_info info[]' here as - * it causes compiler to complain: array type has incomplete element - * type 'struct efi_gop_mode_info'. - */ - struct /* efi_gop_mode_info */ { - u32 version; - u32 width; - u32 height; - u32 pixel_format; - u32 pixel_bitmask[4]; - u32 pixels_per_scanline; - } info[]; + struct efi_gop_mode_info info[]; }; /** @@ -444,7 +454,7 @@ static inline struct efi_mem_desc *efi_get_next_mem_desc( * @memmap_key: Key returned from get_memory_map() * @memmap_desc: List of memory-map records * @memmap_alloc: Amount of memory allocated for memory map list - * @memmap_size Size of memory-map list in bytes + * @memmap_size: Size of memory-map list in bytes * @memmap_desc_size: Size of an individual memory-map record, in bytes * @memmap_version: Memory-map version * diff --git a/include/efi_api.h b/include/efi_api.h index 77a05f752e5..d4fdd50c49e 100644 --- a/include/efi_api.h +++ b/include/efi_api.h @@ -1490,15 +1490,6 @@ struct efi_hii_config_access_protocol { #define EFI_GOT_BGRA8 1 #define EFI_GOT_BITMASK 2 -struct efi_gop_mode_info { - u32 version; - u32 width; - u32 height; - u32 pixel_format; - u32 pixel_bitmask[4]; - u32 pixels_per_scanline; -}; - struct efi_gop_mode { u32 max_mode; u32 mode; diff --git a/lib/efi_client/efi.c b/lib/efi_client/efi.c index bcb34d67465..a3a40b5549d 100644 --- a/lib/efi_client/efi.c +++ b/lib/efi_client/efi.c @@ -155,7 +155,7 @@ int efi_store_memory_map(struct efi_priv *priv) putc(' '); printhex2(ret); puts(" No memory map\n"); - return ret; + return -EFAULT; } /* * Since doing a malloc() may change the memory map and also we want to @@ -168,7 +168,7 @@ int efi_store_memory_map(struct efi_priv *priv) if (!priv->memmap_desc) { printhex2(ret); puts(" No memory for memory descriptor\n"); - return ret; + return -EFAULT; } ret = boot->get_memory_map(&priv->memmap_size, priv->memmap_desc, @@ -177,7 +177,7 @@ int efi_store_memory_map(struct efi_priv *priv) if (ret) { printhex2(ret); puts(" Can't get memory map\n"); - return ret; + return -EFAULT; } return 0; diff --git a/lib/efi_driver/efi_block_device.c b/lib/efi_driver/efi_block_device.c index 070747de515..9ab956c7ef7 100644 --- a/lib/efi_driver/efi_block_device.c +++ b/lib/efi_driver/efi_block_device.c @@ -84,7 +84,7 @@ static ulong efi_bl_read(struct udevice *dev, lbaint_t blknr, lbaint_t blkcnt, * efi_bl_write() - write to block device * * @dev: device - * @blknr: first block to be write + * @blknr: first block to write * @blkcnt: number of blocks to write * @buffer: input buffer * Return: number of blocks transferred @@ -124,7 +124,7 @@ efi_bl_create_block_device(efi_handle_t handle, void *interface) efi_status_t ret; int r; int devnum; - char *name; + char name[18]; /* strlen("efiblk#2147483648") + 1 */ struct efi_block_io *io = interface; struct efi_blk_plat *plat; @@ -136,9 +136,6 @@ efi_bl_create_block_device(efi_handle_t handle, void *interface) if (devnum < 0) return EFI_OUT_OF_RESOURCES; - name = calloc(1, 18); /* strlen("efiblk#2147483648") + 1 */ - if (!name) - return EFI_OUT_OF_RESOURCES; sprintf(name, "efiblk#%d", devnum); /* Create driver model udevice for the EFI block io device */ @@ -146,7 +143,6 @@ efi_bl_create_block_device(efi_handle_t handle, void *interface) devnum, io->media->block_size, (lbaint_t)io->media->last_block, &bdev)) { ret = EFI_OUT_OF_RESOURCES; - free(name); goto err; } diff --git a/lib/efi_driver/efi_uclass.c b/lib/efi_driver/efi_uclass.c index 7392c60f0f9..bd46c9f5539 100644 --- a/lib/efi_driver/efi_uclass.c +++ b/lib/efi_driver/efi_uclass.c @@ -227,7 +227,7 @@ static efi_status_t EFIAPI efi_uc_stop( goto out; } ret = EFI_SUCCESS; - goto out; + goto out; } /* Destroy all children */ diff --git a/lib/efi_loader/efi_net.c b/lib/efi_loader/efi_net.c index b8a6e08ba8e..0f8a851e3f2 100644 --- a/lib/efi_loader/efi_net.c +++ b/lib/efi_loader/efi_net.c @@ -372,7 +372,7 @@ out: } /* - * efi_net_receive_filters() - mange multicast receive filters + * efi_net_receive_filters() - manage multicast receive filters * * This function implements the ReceiveFilters service of the * EFI_SIMPLE_NETWORK_PROTOCOL. See the Unified Extensible Firmware Interface diff --git a/test/cmd/Makefile b/test/cmd/Makefile index e71c80a5b2e..841763fec02 100644 --- a/test/cmd/Makefile +++ b/test/cmd/Makefile @@ -13,6 +13,9 @@ endif obj-y += exit.o obj-$(CONFIG_X86) += cpuid.o msr.o obj-$(CONFIG_CMD_ADDRMAP) += addrmap.o +ifdef CONFIG_CONSOLE_RECORD +obj-$(CONFIG_CMD_ACPI) += acpi.o +endif obj-$(CONFIG_CMD_BDI) += bdinfo.o obj-$(CONFIG_COREBOOT_SYSINFO) += coreboot.o obj-$(CONFIG_CMD_FDT) += fdt.o @@ -27,6 +30,7 @@ obj-$(CONFIG_CMD_MEM_SEARCH) += mem_search.o ifdef CONFIG_CMD_PCI obj-$(CONFIG_CMD_PCI_MPS) += pci_mps.o endif +obj-$(CONFIG_CMD_QFW) += qfw.o obj-$(CONFIG_CMD_SEAMA) += seama.o ifdef CONFIG_SANDBOX obj-$(CONFIG_CMD_MBR) += mbr.o diff --git a/test/cmd/acpi.c b/test/cmd/acpi.c new file mode 100644 index 00000000000..3669060733a --- /dev/null +++ b/test/cmd/acpi.c @@ -0,0 +1,52 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Tests for acpi command + */ + +#include <linux/bitops.h> +#include <test/cmd.h> +#include <test/ut.h> + +#define HAVE_RSDP BIT(0) +#define HAVE_XSDT BIT(1) +#define HAVE_FADT BIT(2) +#define HAVE_ALL (HAVE_RSDP | HAVE_XSDT | HAVE_FADT) + +/** + * cmd_test_acpi() - test the acpi command + */ +static int cmd_test_acpi(struct unit_test_state *uts) +{ + unsigned int actual = 0; + int ret; + + /* + * Check that some mandatory ACPI tables exist: + * - RSDP + * - RSDT or XSDT + * - FADT + */ + ut_assertok(run_commandf("acpi list")); + ut_assert_nextline("Name Base Size Detail"); + ut_assert_nextline("---- ---------------- ----- ----------------------------"); + for (;;) { + ret = console_record_readline(uts->actual_str, sizeof(uts->actual_str)); + if (ret == -ENOENT) { + ut_asserteq(HAVE_ALL, actual); + + return 0; + } + if (ret < 0) + ut_asserteq(0, ret); + + if (!strncmp("RSDP", uts->actual_str, 4)) + actual |= HAVE_RSDP; + else if (!strncmp("RSDT", uts->actual_str, 4)) + actual |= HAVE_XSDT; + else if (!strncmp("XSDT", uts->actual_str, 4)) + actual |= HAVE_XSDT; + else if (!strncmp("FACP", uts->actual_str, 4)) + actual |= HAVE_FADT; + } +} +CMD_TEST(cmd_test_acpi, UTF_CONSOLE); diff --git a/test/cmd/qfw.c b/test/cmd/qfw.c new file mode 100644 index 00000000000..e615a82b31a --- /dev/null +++ b/test/cmd/qfw.c @@ -0,0 +1,40 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Tests for qfw command + * + * Copyright 2025 Simon Glass <[email protected]> + */ + +#include <console.h> +#include <dm.h> +#include <mapmem.h> +#include <qfw.h> +#include <dm/test.h> +#include <test/cmd.h> +#include <test/ut.h> + +/* Test 'qfw list' command */ +static int cmd_test_qfw_list(struct unit_test_state *uts) +{ + struct fw_cfg_file_iter iter; + struct fw_file *file; + struct udevice *dev; + + ut_assertok(uclass_first_device_err(UCLASS_QFW, &dev)); + + ut_assertok(run_command("qfw list", 0)); + ut_assert_nextline(" Addr Size Sel Name"); + ut_assert_nextlinen("--"); + + for (file = qfw_file_iter_init(dev, &iter); !qfw_file_iter_end(&iter); + file = qfw_file_iter_next(&iter)) { + ut_assert_nextline("%16lx %8x %3x %-48s", file->addr, + be32_to_cpu(file->cfg.size), + be16_to_cpu(file->cfg.select), + file->cfg.name); + } + ut_assert_console_end(); + + return 0; +} +CMD_TEST(cmd_test_qfw_list, UTF_CONSOLE); |
