diff options
Diffstat (limited to 'EmbeddedPkg/Universal/MmcDxe/MmcDebug.c')
-rw-r--r-- | EmbeddedPkg/Universal/MmcDxe/MmcDebug.c | 107 |
1 files changed, 56 insertions, 51 deletions
diff --git a/EmbeddedPkg/Universal/MmcDxe/MmcDebug.c b/EmbeddedPkg/Universal/MmcDxe/MmcDebug.c index 3f23a13..cf1b97f 100644 --- a/EmbeddedPkg/Universal/MmcDxe/MmcDebug.c +++ b/EmbeddedPkg/Universal/MmcDxe/MmcDebug.c @@ -8,33 +8,36 @@ #include "Mmc.h"
-#if !defined(MDEPKG_NDEBUG)
-CONST CHAR8* mStrUnit[] = { "100kbit/s", "1Mbit/s", "10Mbit/s", "100MBit/s",
- "Unknown", "Unknown", "Unknown", "Unknown" };
-CONST CHAR8* mStrValue[] = { "1.0", "1.2", "1.3", "1.5", "2.0", "2.5", "3.0", "3.5", "4.0", "4.5", "5.0",
- "Unknown", "Unknown", "Unknown", "Unknown" };
+#if !defined (MDEPKG_NDEBUG)
+CONST CHAR8 *mStrUnit[] = {
+ "100kbit/s", "1Mbit/s", "10Mbit/s", "100MBit/s",
+ "Unknown", "Unknown", "Unknown", "Unknown"
+};
+CONST CHAR8 *mStrValue[] = {
+ "1.0", "1.2", "1.3", "1.5", "2.0", "2.5", "3.0", "3.5", "4.0", "4.5", "5.0",
+ "Unknown", "Unknown", "Unknown", "Unknown"
+};
#endif
VOID
PrintCID (
- IN UINT32* Cid
+ IN UINT32 *Cid
)
{
DEBUG ((DEBUG_ERROR, "- PrintCID\n"));
DEBUG ((DEBUG_ERROR, "\t- Manufacturing date: %d/%d\n", (Cid[0] >> 8) & 0xF, (Cid[0] >> 12) & 0xFF));
DEBUG ((DEBUG_ERROR, "\t- Product serial number: 0x%X%X\n", Cid[1] & 0xFFFFFF, (Cid[0] >> 24) & 0xFF));
DEBUG ((DEBUG_ERROR, "\t- Product revision: %d\n", Cid[1] >> 24));
- //DEBUG ((DEBUG_ERROR, "\t- Product name: %s\n", (char*)(Cid + 2)));
+ // DEBUG ((DEBUG_ERROR, "\t- Product name: %s\n", (char*)(Cid + 2)));
DEBUG ((DEBUG_ERROR, "\t- OEM ID: %c%c\n", (Cid[3] >> 8) & 0xFF, (Cid[3] >> 16) & 0xFF));
}
-
VOID
PrintCSD (
- IN UINT32* Csd
+ IN UINT32 *Csd
)
{
- UINTN Value;
+ UINTN Value;
if (((Csd[2] >> 30) & 0x3) == 0) {
DEBUG ((DEBUG_ERROR, "- PrintCSD Version 1.01-1.10/Version 2.00/Standard Capacity\n"));
@@ -45,9 +48,9 @@ PrintCSD ( }
DEBUG ((DEBUG_ERROR, "\t- Supported card command class: 0x%X\n", MMC_CSD_GET_CCC (Csd)));
- DEBUG ((DEBUG_ERROR, "\t- Speed: %a %a\n",mStrValue[(MMC_CSD_GET_TRANSPEED (Csd) >> 3) & 0xF],mStrUnit[MMC_CSD_GET_TRANSPEED (Csd) & 7]));
- DEBUG ((DEBUG_ERROR, "\t- Maximum Read Data Block: %d\n",2 << (MMC_CSD_GET_READBLLEN (Csd)-1)));
- DEBUG ((DEBUG_ERROR, "\t- Maximum Write Data Block: %d\n",2 << (MMC_CSD_GET_WRITEBLLEN (Csd)-1)));
+ DEBUG ((DEBUG_ERROR, "\t- Speed: %a %a\n", mStrValue[(MMC_CSD_GET_TRANSPEED (Csd) >> 3) & 0xF], mStrUnit[MMC_CSD_GET_TRANSPEED (Csd) & 7]));
+ DEBUG ((DEBUG_ERROR, "\t- Maximum Read Data Block: %d\n", 2 << (MMC_CSD_GET_READBLLEN (Csd)-1)));
+ DEBUG ((DEBUG_ERROR, "\t- Maximum Write Data Block: %d\n", 2 << (MMC_CSD_GET_WRITEBLLEN (Csd)-1)));
if (!MMC_CSD_GET_FILEFORMATGRP (Csd)) {
Value = MMC_CSD_GET_FILEFORMAT (Csd);
@@ -67,7 +70,7 @@ PrintCSD ( VOID
PrintRCA (
- IN UINT32 Rca
+ IN UINT32 Rca
)
{
DEBUG ((DEBUG_ERROR, "- PrintRCA: 0x%X\n", Rca));
@@ -77,13 +80,13 @@ PrintRCA ( VOID
PrintOCR (
- IN UINT32 Ocr
+ IN UINT32 Ocr
)
{
- UINTN MinV;
- UINTN MaxV;
- UINTN Volts;
- UINTN Loop;
+ UINTN MinV;
+ UINTN MaxV;
+ UINTN Volts;
+ UINTN Loop;
MinV = 36; // 3.6
MaxV = 20; // 2.0
@@ -95,14 +98,16 @@ PrintOCR ( if (MinV > Volts) {
MinV = Volts;
}
+
if (MaxV < Volts) {
MaxV = Volts + 1;
}
}
+
Volts++;
}
- DEBUG ((DEBUG_ERROR, "- PrintOCR Ocr (0x%X)\n",Ocr));
+ DEBUG ((DEBUG_ERROR, "- PrintOCR Ocr (0x%X)\n", Ocr));
DEBUG ((DEBUG_ERROR, "\t- Card operating voltage: %d.%d to %d.%d\n", MinV/10, MinV % 10, MaxV/10, MaxV % 10));
if (((Ocr >> 29) & 3) == 0) {
DEBUG ((DEBUG_ERROR, "\t- AccessMode: Byte Mode\n"));
@@ -119,7 +124,7 @@ PrintOCR ( VOID
PrintResponseR1 (
- IN UINT32 Response
+ IN UINT32 Response
)
{
DEBUG ((DEBUG_INFO, "Response: 0x%X\n", Response));
@@ -128,35 +133,35 @@ PrintResponseR1 ( }
switch ((Response >> 9) & 0xF) {
- case 0:
- DEBUG ((DEBUG_INFO, "\t- State: Idle\n"));
- break;
- case 1:
- DEBUG ((DEBUG_INFO, "\t- State: Ready\n"));
- break;
- case 2:
- DEBUG ((DEBUG_INFO, "\t- State: Ident\n"));
- break;
- case 3:
- DEBUG ((DEBUG_INFO, "\t- State: StandBy\n"));
- break;
- case 4:
- DEBUG ((DEBUG_INFO, "\t- State: Tran\n"));
- break;
- case 5:
- DEBUG ((DEBUG_INFO, "\t- State: Data\n"));
- break;
- case 6:
- DEBUG ((DEBUG_INFO, "\t- State: Rcv\n"));
- break;
- case 7:
- DEBUG ((DEBUG_INFO, "\t- State: Prg\n"));
- break;
- case 8:
- DEBUG ((DEBUG_INFO, "\t- State: Dis\n"));
- break;
- default:
- DEBUG ((DEBUG_INFO, "\t- State: Reserved\n"));
- break;
+ case 0:
+ DEBUG ((DEBUG_INFO, "\t- State: Idle\n"));
+ break;
+ case 1:
+ DEBUG ((DEBUG_INFO, "\t- State: Ready\n"));
+ break;
+ case 2:
+ DEBUG ((DEBUG_INFO, "\t- State: Ident\n"));
+ break;
+ case 3:
+ DEBUG ((DEBUG_INFO, "\t- State: StandBy\n"));
+ break;
+ case 4:
+ DEBUG ((DEBUG_INFO, "\t- State: Tran\n"));
+ break;
+ case 5:
+ DEBUG ((DEBUG_INFO, "\t- State: Data\n"));
+ break;
+ case 6:
+ DEBUG ((DEBUG_INFO, "\t- State: Rcv\n"));
+ break;
+ case 7:
+ DEBUG ((DEBUG_INFO, "\t- State: Prg\n"));
+ break;
+ case 8:
+ DEBUG ((DEBUG_INFO, "\t- State: Dis\n"));
+ break;
+ default:
+ DEBUG ((DEBUG_INFO, "\t- State: Reserved\n"));
+ break;
}
}
|