Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Feng Tian <[email protected]>
Reviewed-by: Star Zeng <[email protected]>
---
MdePkg/Include/Ppi/BlockIo.h | 5 +++-
MdePkg/Include/Protocol/DevicePath.h | 18 ++++++++++++
MdePkg/Include/Protocol/DiskInfo.h | 11 +++++++-
.../Library/UefiDevicePathLib/DevicePathFromText.c | 32 ++++++++++++++++++++++
.../Library/UefiDevicePathLib/DevicePathToText.c | 28 +++++++++++++++++++
MdePkg/MdePkg.dec | 7 +++++
6 files changed, 99 insertions(+), 2 deletions(-)
diff --git a/MdePkg/Include/Ppi/BlockIo.h b/MdePkg/Include/Ppi/BlockIo.h
index f2980f5..a69419e 100644
--- a/MdePkg/Include/Ppi/BlockIo.h
+++ b/MdePkg/Include/Ppi/BlockIo.h
@@ -10,7 +10,7 @@
Block I/O PPIs that are provided by the PEI ATAPI driver and PEI legacy
floppy
driver are the same, here we define a set of general PPIs for both drivers
to use.
-Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2007 - 2015, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available
under
the terms and conditions of the BSD License that accompanies this
distribution.
The full text of the license may be found at
@@ -54,6 +54,9 @@ typedef enum {
IdeCDROM = 1, ///< The recovery device is an IDE CD-ROM
IdeLS120 = 2, ///< The recovery device is an IDE LS-120
UsbMassStorage= 3, ///< The recovery device is a USB Mass Storage device
+ SD = 4, ///< The recovery device is a Secure Digital device
+ EMMC = 5, ///< The recovery device is a eMMC device
+ UfsDevice = 6, ///< The recovery device is a Universal Flash Storage
device
MaxDeviceType
} EFI_PEI_BLOCK_DEVICE_TYPE;
diff --git a/MdePkg/Include/Protocol/DevicePath.h
b/MdePkg/Include/Protocol/DevicePath.h
index a27ea5d..3c9b1ec 100644
--- a/MdePkg/Include/Protocol/DevicePath.h
+++ b/MdePkg/Include/Protocol/DevicePath.h
@@ -796,6 +796,22 @@ typedef struct {
} NVME_NAMESPACE_DEVICE_PATH;
///
+/// Universal Flash Storage (UFS) Device Path SubType.
+///
+#define MSG_UFS_DP 0x19
+typedef struct {
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ ///
+ /// Target ID on the UFS bus (PUN).
+ ///
+ UINT8 Pun;
+ ///
+ /// Logical Unit Number (LUN).
+ ///
+ UINT8 Lun;
+} UFS_DEVICE_PATH;
+
+///
/// iSCSI Device Path SubType
///
#define MSG_ISCSI_DP 0x13
@@ -1094,6 +1110,7 @@ typedef union {
SAS_DEVICE_PATH Sas;
SASEX_DEVICE_PATH SasEx;
NVME_NAMESPACE_DEVICE_PATH NvmeNamespace;
+ UFS_DEVICE_PATH Ufs;
HARDDRIVE_DEVICE_PATH HardDrive;
CDROM_DEVICE_PATH CD;
@@ -1144,6 +1161,7 @@ typedef union {
SAS_DEVICE_PATH *Sas;
SASEX_DEVICE_PATH *SasEx;
NVME_NAMESPACE_DEVICE_PATH *NvmeNamespace;
+ UFS_DEVICE_PATH *Ufs;
HARDDRIVE_DEVICE_PATH *HardDrive;
CDROM_DEVICE_PATH *CD;
diff --git a/MdePkg/Include/Protocol/DiskInfo.h
b/MdePkg/Include/Protocol/DiskInfo.h
index bce27e8..a094bc8 100644
--- a/MdePkg/Include/Protocol/DiskInfo.h
+++ b/MdePkg/Include/Protocol/DiskInfo.h
@@ -2,7 +2,7 @@
Provides the basic interfaces to abstract platform information regarding an
IDE controller.
- Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD
License
which accompanies this distribution. The full text of the license may be
found at
@@ -73,6 +73,14 @@ typedef struct _EFI_DISK_INFO_PROTOCOL
EFI_DISK_INFO_PROTOCOL;
0x3ab14680, 0x5d3f, 0x4a4d, {0xbc, 0xdc, 0xcc, 0x38, 0x0, 0x18, 0xc7, 0xf7
} \
}
+///
+/// Global ID for a UFS interface. Used to fill in
EFI_DISK_INFO_PROTOCOL.Interface
+///
+#define EFI_DISK_INFO_UFS_INTERFACE_GUID \
+ { \
+ 0x4b3029cc, 0x6b98, 0x47fb, { 0xbc, 0x96, 0x76, 0xdc, 0xb8, 0x4, 0x41,
0xf0 } \
+ }
+
/**
Provides inquiry information for the controller type.
@@ -205,5 +213,6 @@ extern EFI_GUID gEfiDiskInfoScsiInterfaceGuid;
extern EFI_GUID gEfiDiskInfoUsbInterfaceGuid;
extern EFI_GUID gEfiDiskInfoAhciInterfaceGuid;
extern EFI_GUID gEfiDiskInfoNvmeInterfaceGuid;
+extern EFI_GUID gEfiDiskInfoUfsInterfaceGuid;
#endif
diff --git a/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c
b/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c
index 6ec0a4c..f688c1a 100644
--- a/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c
+++ b/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c
@@ -1810,6 +1810,37 @@ DevPathFromTextNVMe (
}
/**
+ Converts a text device path node to UFS device path structure.
+
+ @param TextDeviceNode The input Text device path node.
+
+ @return A pointer to the newly-created UFS device path structure.
+
+**/
+EFI_DEVICE_PATH_PROTOCOL *
+DevPathFromTextUfs (
+ IN CHAR16 *TextDeviceNode
+ )
+{
+ CHAR16 *PunStr;
+ CHAR16 *LunStr;
+ UFS_DEVICE_PATH *Ufs;
+
+ PunStr = GetNextParamStr (&TextDeviceNode);
+ LunStr = GetNextParamStr (&TextDeviceNode);
+ Ufs = (UFS_DEVICE_PATH *) CreateDeviceNode (
+ MESSAGING_DEVICE_PATH,
+ MSG_UFS_DP,
+ (UINT16) sizeof (UFS_DEVICE_PATH)
+ );
+
+ Ufs->Pun = (UINT8) Strtoi (PunStr);
+ Ufs->Lun = (UINT8) Strtoi (LunStr);
+
+ return (EFI_DEVICE_PATH_PROTOCOL *) Ufs;
+}
+
+/**
Converts a text device path node to Debug Port device path structure.
@param TextDeviceNode The input Text device path node.
@@ -3079,6 +3110,7 @@ GLOBAL_REMOVE_IF_UNREFERENCED DEVICE_PATH_FROM_TEXT_TABLE
mUefiDevicePathLibDevP
{L"SAS", DevPathFromTextSAS },
{L"SasEx", DevPathFromTextSasEx },
{L"NVMe", DevPathFromTextNVMe },
+ {L"UFS", DevPathFromTextUfs },
{L"DebugPort", DevPathFromTextDebugPort },
{L"MAC", DevPathFromTextMAC },
{L"IPv4", DevPathFromTextIPv4 },
diff --git a/MdePkg/Library/UefiDevicePathLib/DevicePathToText.c
b/MdePkg/Library/UefiDevicePathLib/DevicePathToText.c
index 0300019..2dbbdda 100644
--- a/MdePkg/Library/UefiDevicePathLib/DevicePathToText.c
+++ b/MdePkg/Library/UefiDevicePathLib/DevicePathToText.c
@@ -732,6 +732,33 @@ DevPathToTextNVMe (
}
/**
+ Converts a UFS device path structure to its string representative.
+
+ @param Str The string representative of input device.
+ @param DevPath The input device path structure.
+ @param DisplayOnly If DisplayOnly is TRUE, then the shorter text
representation
+ of the display node is used, where applicable. If
DisplayOnly
+ is FALSE, then the longer text representation of the
display node
+ is used.
+ @param AllowShortcuts If AllowShortcuts is TRUE, then the shortcut forms of
text
+ representation for a device node can be used, where
applicable.
+
+**/
+VOID
+DevPathToTextUfs (
+ IN OUT POOL_PRINT *Str,
+ IN VOID *DevPath,
+ IN BOOLEAN DisplayOnly,
+ IN BOOLEAN AllowShortcuts
+ )
+{
+ UFS_DEVICE_PATH *Ufs;
+
+ Ufs = DevPath;
+ UefiDevicePathLibCatPrint (Str, L"UFS(0x%x,0x%x)", Ufs->Pun, Ufs->Lun);
+}
+
+/**
Converts a 1394 device path structure to its string representative.
@param Str The string representative of input device.
@@ -1869,6 +1896,7 @@ GLOBAL_REMOVE_IF_UNREFERENCED const
DEVICE_PATH_TO_TEXT_TABLE mUefiDevicePathLib
{MESSAGING_DEVICE_PATH, MSG_FIBRECHANNELEX_DP,
DevPathToTextFibreEx },
{MESSAGING_DEVICE_PATH, MSG_SASEX_DP, DevPathToTextSasEx
},
{MESSAGING_DEVICE_PATH, MSG_NVME_NAMESPACE_DP, DevPathToTextNVMe
},
+ {MESSAGING_DEVICE_PATH, MSG_UFS_DP, DevPathToTextUfs
},
{MESSAGING_DEVICE_PATH, MSG_1394_DP, DevPathToText1394
},
{MESSAGING_DEVICE_PATH, MSG_USB_DP, DevPathToTextUsb
},
{MESSAGING_DEVICE_PATH, MSG_USB_WWID_DP,
DevPathToTextUsbWWID },
diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec
index 494dfba..61744f3 100644
--- a/MdePkg/MdePkg.dec
+++ b/MdePkg/MdePkg.dec
@@ -646,6 +646,13 @@
## Include/Protocol/DiskInfo.h
gEfiDiskInfoNvmeInterfaceGuid = { 0x3ab14680, 0x5d3f, 0x4a4d, { 0xbc, 0xdc,
0xcc, 0x38, 0x0, 0x18, 0xc7, 0xf7 }}
+ #
+ # GUID defined in PI1.4
+ #
+ ## Guid for EFI_DISK_INFO_PROTOCOL.Interface to specify UFS interface.
+ ## Include/Protocol/DiskInfo.h
+ gEfiDiskInfoUfsInterfaceGuid = { 0x4b3029cc, 0x6b98, 0x47fb, { 0xbc, 0x96,
0x76, 0xdc, 0xb8, 0x4, 0x41, 0xf0 }}
+
[Guids.IA32, Guids.X64]
## Include/Guid/Cper.h
gEfiIa32X64ErrorTypeCacheCheckGuid = { 0xA55701F5, 0xE3EF, 0x43de, { 0xAC,
0x72, 0x24, 0x9B, 0x57, 0x3F, 0xAD, 0x2C }}
--
1.9.5.msysgit.0
------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel