From mboxrd@z Thu Jan 1 00:00:00 1970 From: AKASHI Takahiro Date: Fri, 23 Aug 2019 08:25:06 +0900 Subject: [U-Boot] [PATCH 1/2] efi_loader: device_path: add Device Logical Unit sub type In-Reply-To: <3a037ad3-c04e-3850-68a0-306a50c24a1d@gmx.de> References: <20190822085441.11253-1-takahiro.akashi@linaro.org> <3a037ad3-c04e-3850-68a0-306a50c24a1d@gmx.de> Message-ID: <20190822232505.GC14152@linaro.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Thu, Aug 22, 2019 at 08:44:49PM +0200, Heinrich Schuchardt wrote: > On 8/22/19 10:54 AM, AKASHI Takahiro wrote: > >This sub type may not be very useful for normal systems, > >but it will be used to support "host" devices on U-Boot sandbox > >build. > > > >See UEFI Specification 2.8, section 10.3.4.8. > > > >Signed-off-by: AKASHI Takahiro > >--- > > include/efi_api.h | 6 ++++++ > > lib/efi_loader/efi_device_path_to_text.c | 6 ++++++ > > 2 files changed, 12 insertions(+) > > > >diff --git a/include/efi_api.h b/include/efi_api.h > >index d3fff3c57936..bb028546c864 100644 > >--- a/include/efi_api.h > >+++ b/include/efi_api.h > >@@ -427,6 +427,7 @@ struct efi_device_path_acpi_path { > > # define DEVICE_PATH_SUB_TYPE_MSG_USB 0x05 > > # define DEVICE_PATH_SUB_TYPE_MSG_MAC_ADDR 0x0b > > # define DEVICE_PATH_SUB_TYPE_MSG_USB_CLASS 0x0f > >+# define DEVICE_PATH_SUB_TYPE_MSG_LUN 0x11 > > # define DEVICE_PATH_SUB_TYPE_MSG_SD 0x1a > > # define DEVICE_PATH_SUB_TYPE_MSG_MMC 0x1d > > > >@@ -443,6 +444,11 @@ struct efi_device_path_scsi { > > u16 logical_unit_number; > > } __packed; > > > >+struct efi_device_path_lun { > >+ struct efi_device_path dp; > >+ u8 logical_unit_number; > >+} __packed; > >+ > > struct efi_device_path_usb { > > struct efi_device_path dp; > > u8 parent_port_number; > >diff --git a/lib/efi_loader/efi_device_path_to_text.c b/lib/efi_loader/efi_device_path_to_text.c > >index 96fd08971b73..8aae8215e1af 100644 > >--- a/lib/efi_loader/efi_device_path_to_text.c > >+++ b/lib/efi_loader/efi_device_path_to_text.c > >@@ -107,6 +107,12 @@ static char *dp_msging(char *s, struct efi_device_path *dp) > > ide->logical_unit_number); > > break; > > } > >+ case DEVICE_PATH_SUB_TYPE_MSG_LUN: { > >+ struct efi_device_path_lun *lun = > >+ (struct efi_device_path_lun *)dp; > >+ s += sprintf(s, "LUN(%u)", lun->logical_unit_number); > > The UEFI spec 2 has this output example: > Unit(LUN) > > In EDK2: > MdePkg/Library/UefiDevicePathLib/DevicePathToText.c:1019: > UefiDevicePathLibCatPrint (Str, L"Unit(0x%x)", LogicalUnit->Lun); > > Please, correct the output format to match EDK2 (and the spec). Good catch, thank you. Will fix. -Takahiro Akashi > Best regards > > Heinrich > > >+ break; > >+ } > > case DEVICE_PATH_SUB_TYPE_MSG_USB: { > > struct efi_device_path_usb *udp = > > (struct efi_device_path_usb *)dp; > > >