X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=EmbeddedPkg%2FUniversal%2FMmcDxe%2FMmc.h;h=58027973ffff78d8a14e7087f4521f47055ff7cf;hb=878b807a435eefbb1d76f9bdec30cb3526521a5e;hp=fb3f6c9cba12fd900f2a13139a8055ebc043a943;hpb=752ae80514ccb3532a6d6d16a122642573eabdee;p=mirror_edk2.git diff --git a/EmbeddedPkg/Universal/MmcDxe/Mmc.h b/EmbeddedPkg/Universal/MmcDxe/Mmc.h index fb3f6c9cba..58027973ff 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) @@ -60,6 +58,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 @@ -80,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] @@ -299,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 {