X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=EmbeddedPkg%2FUniversal%2FMmcDxe%2FMmc.h;h=df3b3cde9fa6753e17be481ef5f2f091f9799e59;hp=112bc472aad06c9984295a456b256c5b0d13d188;hb=c6a72cd79465594876626e738466441d8b3d61ca;hpb=653bde546200af46573cdfac88257f03b3420d88 diff --git a/EmbeddedPkg/Universal/MmcDxe/Mmc.h b/EmbeddedPkg/Universal/MmcDxe/Mmc.h index 112bc472aa..df3b3cde9f 100644 --- a/EmbeddedPkg/Universal/MmcDxe/Mmc.h +++ b/EmbeddedPkg/Universal/MmcDxe/Mmc.h @@ -3,13 +3,7 @@ Copyright (c) 2011-2015, ARM Limited. All rights reserved. - 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 - http://opensource.org/licenses/bsd-license.php - - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -34,6 +28,10 @@ #define MMC_OCR_POWERUP 0x80000000 +#define MMC_OCR_ACCESS_MASK 0x3 /* bit[30-29] */ +#define MMC_OCR_ACCESS_BYTE 0x1 /* bit[29] */ +#define MMC_OCR_ACCESS_SECTOR 0x2 /* bit[30] */ + #define MMC_CSD_GET_CCC(Response) (Response[2] >> 20) #define MMC_CSD_GET_TRANSPEED(Response) (Response[3] & 0xFF) #define MMC_CSD_GET_READBLLEN(Response) ((Response[2] >> 16) & 0xF) @@ -55,6 +53,21 @@ #define MMC_R0_STATE_TRAN 4 #define MMC_R0_STATE_DATA 5 +#define EMMC_CMD6_ARG_ACCESS(x) (((x) & 0x3) << 24) +#define EMMC_CMD6_ARG_INDEX(x) (((x) & 0xFF) << 16) +#define EMMC_CMD6_ARG_VALUE(x) (((x) & 0xFF) << 8) +#define EMMC_CMD6_ARG_CMD_SET(x) (((x) & 0x7) << 0) + +#define SWITCH_CMD_DATA_LENGTH 64 +#define SD_HIGH_SPEED_SUPPORTED 0x20000 +#define SD_DEFAULT_SPEED 25000000 +#define SD_HIGH_SPEED 50000000 +#define SWITCH_CMD_SUCCESS_MASK 0x0f000000 + +#define SD_CARD_CAPACITY 0x00000002 + +#define BUSWIDTH_4 4 + typedef enum { UNKNOWN_CARD, MMC_CARD, //MMC card @@ -75,6 +88,22 @@ typedef struct { UINT32 PowerUp: 1; // This bit is set to LOW if the card has not finished the power up routine } OCR; +typedef struct { + UINT8 SD_SPEC: 4; // SD Memory Card - Spec. Version [59:56] + UINT8 SCR_STRUCTURE: 4; // SCR Structure [63:60] + UINT8 SD_BUS_WIDTHS: 4; // DAT Bus widths supported [51:48] + UINT8 DATA_STAT_AFTER_ERASE: 1; // Data Status after erases [55] + UINT8 SD_SECURITY: 3; // CPRM Security Support [54:52] + UINT8 EX_SECURITY_1: 1; // Extended Security Support [43] + UINT8 SD_SPEC4: 1; // Spec. Version 4.00 or higher [42] + UINT8 RESERVED_1: 2; // Reserved [41:40] + UINT8 SD_SPEC3: 1; // Spec. Version 3.00 or higher [47] + UINT8 EX_SECURITY_2: 3; // Extended Security Support [46:44] + UINT8 CMD_SUPPORT: 4; // Command Support bits [35:32] + UINT8 RESERVED_2: 4; // Reserved [39:36] + UINT32 RESERVED_3; // Manufacturer Usage [31:0] +} SCR; + typedef struct { UINT32 NOT_USED; // 1 [0:0] UINT32 CRC; // CRC7 checksum [7:1] @@ -226,7 +255,7 @@ typedef struct { UINT8 MIN_PERF_W_8_52; // Minimum write performance for 8bit at 52MHz [210:210] UINT8 RESERVED_18; // Reserved [211:211] UINT32 SECTOR_COUNT; // Sector count [215:212] - UINT8 SLEEP_NOTIFICATION_TIME; // Sleep notification timout [216:216] + UINT8 SLEEP_NOTIFICATION_TIME; // Sleep notification timeout [216:216] UINT8 S_A_TIMEOUT; // Sleep/awake timeout [217:217] UINT8 PRODUCTION_STATE_AWARENESS_TIMEOUT; // Production state awareness timeout [218:218] UINT8 S_C_VCCQ; // Sleep current (VCCQ) [219:219] @@ -294,7 +323,7 @@ typedef struct { OCR OCRData; CID CIDData; CSD CSDData; - ECSD ECSDData; // MMC V4 extended card specific + ECSD *ECSDData; // MMC V4 extended card specific } CARD_INFO; typedef struct _MMC_HOST_INSTANCE {