]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
efi_loader: support for Ctrl() device path node
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Sun, 19 Mar 2023 15:18:08 +0000 (16:18 +0100)
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Sat, 25 Mar 2023 10:05:42 +0000 (11:05 +0100)
* Add the definitions for Ctrl() device path nodes.
* Implement Ctrl() nodes in the device path to text protocol.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
include/efi_api.h
lib/efi_loader/efi_device_path_to_text.c

index 2d18d25a7137bcc400c6e559a207cf285dfa4b06..c57868abbd9c1fcb0ab04509d5f63d450e8bef49 100644 (file)
@@ -570,6 +570,7 @@ struct efi_mac_addr {
 #define DEVICE_PATH_TYPE_HARDWARE_DEVICE       0x01
 #  define DEVICE_PATH_SUB_TYPE_MEMORY          0x03
 #  define DEVICE_PATH_SUB_TYPE_VENDOR          0x04
+#  define DEVICE_PATH_SUB_TYPE_CONTROLLER      0x05
 
 struct efi_device_path_memory {
        struct efi_device_path dp;
@@ -584,6 +585,11 @@ struct efi_device_path_vendor {
        u8 vendor_data[];
 } __packed;
 
+struct efi_device_path_controller {
+       struct efi_device_path dp;
+       u32 controller_number;
+} __packed;
+
 #define DEVICE_PATH_TYPE_ACPI_DEVICE           0x02
 #  define DEVICE_PATH_SUB_TYPE_ACPI_DEVICE     0x01
 
index 9062058ac22966ef4c1d8d40e89f5f4acbf343c0..4b2ade3803fa41da3167eebd19198f22082b17f8 100644 (file)
@@ -77,6 +77,13 @@ static char *dp_hardware(char *s, struct efi_device_path *dp)
                s += sprintf(s, ")");
                break;
        }
+       case DEVICE_PATH_SUB_TYPE_CONTROLLER: {
+               struct efi_device_path_controller *cdp =
+                       (struct efi_device_path_controller *)dp;
+
+               s += sprintf(s, "Ctrl(0x%0x)", cdp->controller_number);
+               break;
+       }
        default:
                s = dp_unknown(s, dp);
                break;