]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EmbeddedPkg/Universal/MmcDxe/Mmc.h
EmbeddedPkg/MmcDxe: set I/O speed and bus width in SD stack
[mirror_edk2.git] / EmbeddedPkg / Universal / MmcDxe / Mmc.h
index 3e1166600bf64da4c1b819d3b8418bf927949d57..c96ff2e12de4f8c39b58de1dc11a199b92a56a3a 100644 (file)
 #define MMC_R0_STATE_TRAN       4\r
 #define MMC_R0_STATE_DATA       5\r
 \r
+#define EMMC_CMD6_ARG_ACCESS(x)             (((x) & 0x3) << 24)\r
+#define EMMC_CMD6_ARG_INDEX(x)              (((x) & 0xFF) << 16)\r
+#define EMMC_CMD6_ARG_VALUE(x)              (((x) & 0xFF) << 8)\r
+#define EMMC_CMD6_ARG_CMD_SET(x)            (((x) & 0x7) << 0)\r
+\r
 typedef enum {\r
   UNKNOWN_CARD,\r
   MMC_CARD,              //MMC card\r
@@ -75,6 +80,22 @@ typedef struct {
   UINT32  PowerUp:     1; // This bit is set to LOW if the card has not finished the power up routine\r
 } OCR;\r
 \r
+typedef struct {\r
+  UINT8   SD_SPEC:               4; // SD Memory Card - Spec. Version [59:56]\r
+  UINT8   SCR_STRUCTURE:         4; // SCR Structure [63:60]\r
+  UINT8   SD_BUS_WIDTHS:         4; // DAT Bus widths supported [51:48]\r
+  UINT8   DATA_STAT_AFTER_ERASE: 1; // Data Status after erases [55]\r
+  UINT8   SD_SECURITY:           3; // CPRM Security Support [54:52]\r
+  UINT8   EX_SECURITY_1:         1; // Extended Security Support [43]\r
+  UINT8   SD_SPEC4:              1; // Spec. Version 4.00 or higher [42]\r
+  UINT8   RESERVED_1:            2; // Reserved [41:40]\r
+  UINT8   SD_SPEC3:              1; // Spec. Version 3.00 or higher [47]\r
+  UINT8   EX_SECURITY_2:         3; // Extended Security Support [46:44]\r
+  UINT8   CMD_SUPPORT:           4; // Command Support bits [35:32]\r
+  UINT8   RESERVED_2:            4; // Reserved [39:36]\r
+  UINT32  RESERVED_3;               // Manufacturer Usage [31:0]\r
+} SCR;\r
+\r
 typedef struct {\r
   UINT32  NOT_USED;   // 1 [0:0]\r
   UINT32  CRC;        // CRC7 checksum [7:1]\r
@@ -128,7 +149,8 @@ typedef struct {
   UINT8   NSAC                ;  // Data read access-time 2 in CLK cycles (NSAC*100) [111:104]\r
   UINT8   TAAC                ;  // Data read access-time 1 [119:112]\r
 \r
-  UINT8   RESERVED_5:         6; // Reserved [125:120]\r
+  UINT8   RESERVED_5:         2; // Reserved [121:120]\r
+  UINT8   SPEC_VERS:          4; // System specification version [125:122]\r
   UINT8   CSD_STRUCTURE:      2; // CSD structure [127:126]\r
 } CSD;\r
 \r