aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2023-10-25 09:16:19 -0400
committerTom Rini <trini@konsulko.com>2023-10-25 09:16:19 -0400
commitc889d2604b0e20267627196507804b2b4f5b1da7 (patch)
treec38c9b526c685d78f77fe25fa474bfd36fc9c633
parentfb428b61819444b9337075f49c72f326f5d12085 (diff)
parent916dad34af0e53181dfe21f5764d3a787cb24bdc (diff)
downloadu-boot-WIP/25Oct2023.zip
u-boot-WIP/25Oct2023.tar.gz
u-boot-WIP/25Oct2023.tar.bz2
Merge tag 'efi-2024-01-rc2' of https://source.denx.de/u-boot/custodians/u-boot-efiWIP/25Oct2023
Pull request efi-2024-01-rc2 Documentation: * Bump urllib3 version * Replace references to dm_dump_all() with dm_dump_tree() * Update description of build dependencies for Alpine Linux * Fix typo in gpt example * Fix ordering of shell commands UEFI: * Fix build failure without network * Expose the device-tree file name as UEFI variable * Move misplace EFI_ENTRY macro.
-rw-r--r--doc/build/gcc.rst10
-rw-r--r--doc/develop/driver-model/debugging.rst2
-rw-r--r--doc/develop/uefi/uefi.rst14
-rw-r--r--doc/sphinx/requirements.txt2
-rw-r--r--doc/usage/cmd/gpt.rst5
-rw-r--r--doc/usage/index.rst8
-rw-r--r--include/efi_loader.h5
-rw-r--r--lib/efi_loader/efi_device_path.c5
-rw-r--r--lib/efi_loader/efi_setup.c30
-rw-r--r--lib/efi_loader/efi_tcg2.c3
10 files changed, 72 insertions, 12 deletions
diff --git a/doc/build/gcc.rst b/doc/build/gcc.rst
index a0650a5..23501de 100644
--- a/doc/build/gcc.rst
+++ b/doc/build/gcc.rst
@@ -60,8 +60,14 @@ For building U-Boot on Alpine Linux at least the following packages are needed:
.. code-block:: bash
- apk add alpine-sdk bc bison dtc flex linux-headers ncurses-dev \
- openssl-dev perl python3 py3-setuptools python3-dev sdl2-dev
+ apk add alpine-sdk bc bison dtc flex gnutls-dev linux-headers ncurses-dev \
+ openssl-dev py3-elftools py3-setuptools python3-dev swig util-linux-dev
+
+Depending on the build target further packages may be needed:
+
+* sandbox with lcd: sdl2-dev
+* riscv64 S-mode targests: opensbi
+* some arm64 targets: arm-trusted-firmware
Prerequisites
-------------
diff --git a/doc/develop/driver-model/debugging.rst b/doc/develop/driver-model/debugging.rst
index bbb2794..e13abdd 100644
--- a/doc/develop/driver-model/debugging.rst
+++ b/doc/develop/driver-model/debugging.rst
@@ -49,7 +49,7 @@ to see errors. Common ones are:
of_to_plat() method in the driver.
If there is no error, you should check if the device is actually bound. Call
-dm_dump_all() just before you locate the device to make sure it exists.
+dm_dump_tree() just before you locate the device to make sure it exists.
If it does not exist, check your device tree compatible strings match up with
what the driver expects (in the struct udevice_id array).
diff --git a/doc/develop/uefi/uefi.rst b/doc/develop/uefi/uefi.rst
index fb16ac7..702c490 100644
--- a/doc/develop/uefi/uefi.rst
+++ b/doc/develop/uefi/uefi.rst
@@ -916,6 +916,20 @@ So our final format of the FilePathList[] is::
Loaded image - end node (0xff) - VenMedia - initrd_1 - [end node (0x01) - initrd_n ...] - end node (0xff)
+EFI variable FdtFile
+~~~~~~~~~~~~~~~~~~~~
+
+Ideally U-Boot would always expose a device-tree that can be used for booting
+any operating systems. Unfortunately operating systems like Linux sometimes
+break forward and backward compatibility. In this case there is a need to load
+an operating system version specific device-tree.
+
+U-Boot has an environment variable fdtfile identifying the device-tree file to
+load. The content of this variable is exposed as EFI variable Fdtfile, vendor
+GUID d45dde69-3bd6-40e0-90d5-6b606aa57730. It contains the device-tree path
+name as a NUL terminated ASCII string. On many architectures the file name is
+preceded by a vendor directory ('vendor-directory/board-name.dtb').
+
Links
-----
diff --git a/doc/sphinx/requirements.txt b/doc/sphinx/requirements.txt
index 6d45a3f..39ececb 100644
--- a/doc/sphinx/requirements.txt
+++ b/doc/sphinx/requirements.txt
@@ -23,4 +23,4 @@ sphinxcontrib-htmlhelp==2.0.0
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.5
-urllib3==2.0.6
+urllib3==2.0.7
diff --git a/doc/usage/cmd/gpt.rst b/doc/usage/cmd/gpt.rst
index f6115ec..cbbe44a 100644
--- a/doc/usage/cmd/gpt.rst
+++ b/doc/usage/cmd/gpt.rst
@@ -156,6 +156,7 @@ read', 'gpt swap' and 'gpt rename', you must specify CONFIG_CMD_GPT_RENAME=y.
Examples
~~~~~~~~
+
Create 6 partitions on a disk::
=> setenv gpt_parts 'uuid_disk=bec9fc2a-86c1-483d-8a0e-0109732277d7;
@@ -192,10 +193,9 @@ Get the information about the partition named 'rootfs'::
Get the list of partition names on the disk::
=> gpt enumerate
- => echo gpt_partition_list
+ => echo ${gpt_partition_list}
boot rootfs system-data [ext] user modules ramdisk
-
Get the GUID for a disk::
=> gpt guid mmc 0
@@ -209,6 +209,7 @@ Set the bootable flag for the 'boot' partition and clear it for all others::
=> gpt set-bootable mmc 0 boot
Swap the order of the 'boot' and 'rootfs' partition table entries::
+
=> gpt setenv mmc 0 rootfs
=> echo ${gpt_partition_entry}
2
diff --git a/doc/usage/index.rst b/doc/usage/index.rst
index 98b4719..839589c 100644
--- a/doc/usage/index.rst
+++ b/doc/usage/index.rst
@@ -37,8 +37,8 @@ Shell commands
cmd/bootm
cmd/bootmenu
cmd/bootmeth
- cmd/button
cmd/bootz
+ cmd/button
cmd/cat
cmd/cbsysinfo
cmd/cedit
@@ -56,8 +56,8 @@ Shell commands
cmd/env
cmd/event
cmd/exception
- cmd/extension
cmd/exit
+ cmd/extension
cmd/false
cmd/fatinfo
cmd/fatload
@@ -93,15 +93,15 @@ Shell commands
cmd/rng
cmd/saves
cmd/sbi
- cmd/sf
cmd/scp03
cmd/seama
cmd/setexpr
+ cmd/sf
cmd/size
cmd/sleep
+ cmd/sm
cmd/sound
cmd/source
- cmd/sm
cmd/temperature
cmd/tftpput
cmd/trace
diff --git a/include/efi_loader.h b/include/efi_loader.h
index e244105..146e7f1 100644
--- a/include/efi_loader.h
+++ b/include/efi_loader.h
@@ -152,6 +152,11 @@ static inline efi_status_t efi_launch_capsules(void)
EFI_GUID(0x8108ac4e, 0x9f11, 0x4d59, \
0x85, 0x0e, 0xe2, 0x1a, 0x52, 0x2c, 0x59, 0xb2)
+/* Vendor GUID for the FdtFile variable */
+#define VENDOR_FDTFILE_GUID \
+ EFI_GUID(0xd45dde69, 0x3bd6, 0x40e0, \
+ 0x90, 0xd5, 0x6b, 0x60, 0x6a, 0xa5, 0x77, 0x30)
+
/* Use internal device tree when starting UEFI application */
#define EFI_FDT_USE_INTERNAL NULL
diff --git a/lib/efi_loader/efi_device_path.c b/lib/efi_loader/efi_device_path.c
index ed7214f..f3a0e85 100644
--- a/lib/efi_loader/efi_device_path.c
+++ b/lib/efi_loader/efi_device_path.c
@@ -977,11 +977,14 @@ struct efi_device_path *efi_dp_from_uart(void)
return buf;
}
-struct efi_device_path __maybe_unused *efi_dp_from_eth(void)
+struct efi_device_path *efi_dp_from_eth(void)
{
void *buf, *start;
unsigned dpsize = 0;
+ if (!IS_ENABLED(CONFIG_NETDEVICES))
+ return NULL;
+
assert(eth_get_dev());
dpsize += dp_size(eth_get_dev());
diff --git a/lib/efi_loader/efi_setup.c b/lib/efi_loader/efi_setup.c
index e6de685..71bcde6 100644
--- a/lib/efi_loader/efi_setup.c
+++ b/lib/efi_loader/efi_setup.c
@@ -17,6 +17,8 @@
efi_status_t efi_obj_list_initialized = OBJ_LIST_NOT_INITIALIZED;
+efi_guid_t vendor_fdtfile_guid = VENDOR_FDTFILE_GUID;
+
/*
* Allow unaligned memory access.
*
@@ -27,6 +29,27 @@ void __weak allow_unaligned(void)
}
/**
+ * efi_init_fdtfile() - set EFI variable FdtFile
+ *
+ * Return: status code
+ */
+static efi_status_t efi_init_fdtfile(void)
+{
+ char *val;
+
+ val = env_get("fdtfile");
+ if (!val)
+ return EFI_SUCCESS;
+
+ return efi_set_variable_int(u"FdtFile",
+ &vendor_fdtfile_guid,
+ EFI_VARIABLE_BOOTSERVICE_ACCESS |
+ EFI_VARIABLE_RUNTIME_ACCESS |
+ EFI_VARIABLE_READ_ONLY,
+ strlen(val) + 1, val, false);
+}
+
+/**
* efi_init_platform_lang() - define supported languages
*
* Set the PlatformLangCodes and PlatformLang variables.
@@ -250,6 +273,13 @@ efi_status_t efi_init_obj_list(void)
if (ret != EFI_SUCCESS)
goto out;
+ /* Define EFI variable FdtFile */
+ if (!CONFIG_IS_ENABLED(GENERATE_ACPI_TABLE)) {
+ ret = efi_init_fdtfile();
+ if (ret != EFI_SUCCESS)
+ goto out;
+ }
+
/* Indicate supported features */
ret = efi_init_os_indications();
if (ret != EFI_SUCCESS)
diff --git a/lib/efi_loader/efi_tcg2.c b/lib/efi_loader/efi_tcg2.c
index 7b7926a..626df12 100644
--- a/lib/efi_loader/efi_tcg2.c
+++ b/lib/efi_loader/efi_tcg2.c
@@ -1211,12 +1211,13 @@ efi_tcg2_get_active_pcr_banks(struct efi_tcg2_protocol *this,
{
efi_status_t ret;
+ EFI_ENTRY("%p, %p", this, active_pcr_banks);
+
if (!this || !active_pcr_banks) {
ret = EFI_INVALID_PARAMETER;
goto out;
}
- EFI_ENTRY("%p, %p", this, active_pcr_banks);
ret = __get_active_pcr_banks(active_pcr_banks);
out: