Revision: 17245
          http://sourceforge.net/p/edk2/code/17245
Author:   erictian
Date:     2015-04-29 02:37:30 +0000 (Wed, 29 Apr 2015)
Log Message:
-----------
MdePkg: Add UFS (Universal Flash Storage) related definitions

These definitions are defined in UEFI2.5/PI1.4 spec.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Feng Tian <[email protected]>
Reviewed-by: Star Zeng <[email protected]>

Modified Paths:
--------------
    trunk/edk2/MdePkg/Include/Ppi/BlockIo.h
    trunk/edk2/MdePkg/Include/Protocol/DevicePath.h
    trunk/edk2/MdePkg/Include/Protocol/DiskInfo.h
    trunk/edk2/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c
    trunk/edk2/MdePkg/Library/UefiDevicePathLib/DevicePathToText.c
    trunk/edk2/MdePkg/MdePkg.dec

Modified: trunk/edk2/MdePkg/Include/Ppi/BlockIo.h
===================================================================
--- trunk/edk2/MdePkg/Include/Ppi/BlockIo.h     2015-04-29 01:38:01 UTC (rev 
17244)
+++ trunk/edk2/MdePkg/Include/Ppi/BlockIo.h     2015-04-29 02:37:30 UTC (rev 
17245)
@@ -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 @@
   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;
 

Modified: trunk/edk2/MdePkg/Include/Protocol/DevicePath.h
===================================================================
--- trunk/edk2/MdePkg/Include/Protocol/DevicePath.h     2015-04-29 01:38:01 UTC 
(rev 17244)
+++ trunk/edk2/MdePkg/Include/Protocol/DevicePath.h     2015-04-29 02:37:30 UTC 
(rev 17245)
@@ -796,6 +796,22 @@
 } 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 @@
   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 @@
   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;
 

Modified: trunk/edk2/MdePkg/Include/Protocol/DiskInfo.h
===================================================================
--- trunk/edk2/MdePkg/Include/Protocol/DiskInfo.h       2015-04-29 01:38:01 UTC 
(rev 17244)
+++ trunk/edk2/MdePkg/Include/Protocol/DiskInfo.h       2015-04-29 02:37:30 UTC 
(rev 17245)
@@ -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 @@
     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 gEfiDiskInfoUsbInterfaceGuid;
 extern EFI_GUID gEfiDiskInfoAhciInterfaceGuid;
 extern EFI_GUID gEfiDiskInfoNvmeInterfaceGuid;
+extern EFI_GUID gEfiDiskInfoUfsInterfaceGuid;
 
 #endif

Modified: trunk/edk2/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c
===================================================================
--- trunk/edk2/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c    
2015-04-29 01:38:01 UTC (rev 17244)
+++ trunk/edk2/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c    
2015-04-29 02:37:30 UTC (rev 17245)
@@ -1810,6 +1810,37 @@
 }
 
 /**
+  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 @@
   {L"SAS",                     DevPathFromTextSAS                     },
   {L"SasEx",                   DevPathFromTextSasEx                   },
   {L"NVMe",                    DevPathFromTextNVMe                    },
+  {L"UFS",                     DevPathFromTextUfs                     },
   {L"DebugPort",               DevPathFromTextDebugPort               },
   {L"MAC",                     DevPathFromTextMAC                     },
   {L"IPv4",                    DevPathFromTextIPv4                    },

Modified: trunk/edk2/MdePkg/Library/UefiDevicePathLib/DevicePathToText.c
===================================================================
--- trunk/edk2/MdePkg/Library/UefiDevicePathLib/DevicePathToText.c      
2015-04-29 01:38:01 UTC (rev 17244)
+++ trunk/edk2/MdePkg/Library/UefiDevicePathLib/DevicePathToText.c      
2015-04-29 02:37:30 UTC (rev 17245)
@@ -732,6 +732,33 @@
 }
 
 /**
+  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 @@
   {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        },

Modified: trunk/edk2/MdePkg/MdePkg.dec
===================================================================
--- trunk/edk2/MdePkg/MdePkg.dec        2015-04-29 01:38:01 UTC (rev 17244)
+++ trunk/edk2/MdePkg/MdePkg.dec        2015-04-29 02:37:30 UTC (rev 17245)
@@ -658,6 +658,10 @@
   ## Include/Guid/GraphicsInfoHob.h
   gEfiGraphicsInfoHobGuid           = { 0x39f62cce, 0x6825, 0x4669, { 0xbb, 
0x56, 0x54, 0x1a, 0xba, 0x75, 0x3a, 0x07 }}
 
+  ## 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 }}


------------------------------------------------------------------------------
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-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to