mmcreg.h revision 188044
1163516Simp/*- 2163516Simp * Copyright (c) 2006 M. Warner Losh. All rights reserved. 3163516Simp * 4163516Simp * Redistribution and use in source and binary forms, with or without 5163516Simp * modification, are permitted provided that the following conditions 6163516Simp * are met: 7163516Simp * 1. Redistributions of source code must retain the above copyright 8163516Simp * notice, this list of conditions and the following disclaimer. 9163516Simp * 2. Redistributions in binary form must reproduce the above copyright 10163516Simp * notice, this list of conditions and the following disclaimer in the 11163516Simp * documentation and/or other materials provided with the distribution. 12163516Simp * 13163516Simp * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 14163516Simp * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 15163516Simp * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 16163516Simp * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 17163516Simp * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 18163516Simp * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 19163516Simp * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 20163516Simp * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21163516Simp * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 22163516Simp * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23163516Simp * 24170002Simp * Portions of this software may have been developed with reference to 25170002Simp * the SD Simplified Specification. The following disclaimer may apply: 26170002Simp * 27170002Simp * The following conditions apply to the release of the simplified 28170002Simp * specification ("Simplified Specification") by the SD Card Association and 29170002Simp * the SD Group. The Simplified Specification is a subset of the complete SD 30170002Simp * Specification which is owned by the SD Card Association and the SD 31170002Simp * Group. This Simplified Specification is provided on a non-confidential 32170002Simp * basis subject to the disclaimers below. Any implementation of the 33170002Simp * Simplified Specification may require a license from the SD Card 34170002Simp * Association, SD Group, SD-3C LLC or other third parties. 35170002Simp * 36170002Simp * Disclaimers: 37170002Simp * 38170002Simp * The information contained in the Simplified Specification is presented only 39170002Simp * as a standard specification for SD Cards and SD Host/Ancillary products and 40170002Simp * is provided "AS-IS" without any representations or warranties of any 41170002Simp * kind. No responsibility is assumed by the SD Group, SD-3C LLC or the SD 42170002Simp * Card Association for any damages, any infringements of patents or other 43170002Simp * right of the SD Group, SD-3C LLC, the SD Card Association or any third 44170002Simp * parties, which may result from its use. No license is granted by 45170002Simp * implication, estoppel or otherwise under any patent or other rights of the 46170002Simp * SD Group, SD-3C LLC, the SD Card Association or any third party. Nothing 47170002Simp * herein shall be construed as an obligation by the SD Group, the SD-3C LLC 48170002Simp * or the SD Card Association to disclose or distribute any technical 49170002Simp * information, know-how or other confidential information to any third party. 50170002Simp * 51163516Simp * $FreeBSD: head/sys/dev/mmc/mmcreg.h 188044 2009-02-03 04:28:45Z imp $ 52163516Simp */ 53163516Simp 54163516Simp#ifndef DEV_MMC_MMCREG_H 55163516Simp#define DEV_MMC_MMCREG_H 56163516Simp 57163516Simp/* 58163516Simp * This file contains the register definitions for the mmc and sd busses. 59163516Simp * They are taken from publicly available sources. 60163516Simp */ 61163516Simp 62163516Simpstruct mmc_data; 63163516Simpstruct mmc_request; 64163516Simp 65163516Simpstruct mmc_command { 66163516Simp uint32_t opcode; 67163516Simp uint32_t arg; 68163516Simp uint32_t resp[4]; 69163516Simp uint32_t flags; /* Expected responses */ 70163516Simp#define MMC_RSP_PRESENT (1ul << 0) /* Response */ 71163516Simp#define MMC_RSP_136 (1ul << 1) /* 136 bit response */ 72163516Simp#define MMC_RSP_CRC (1ul << 2) /* Expect valid crc */ 73163516Simp#define MMC_RSP_BUSY (1ul << 3) /* Card may send busy */ 74163516Simp#define MMC_RSP_OPCODE (1ul << 4) /* Response include opcode */ 75163516Simp#define MMC_RSP_MASK 0x1ful 76163516Simp#define MMC_CMD_AC (0ul << 5) /* Addressed Command, no data */ 77163516Simp#define MMC_CMD_ADTC (1ul << 5) /* Addressed Data transfer cmd */ 78163516Simp#define MMC_CMD_BC (2ul << 5) /* Broadcast command, no response */ 79163516Simp#define MMC_CMD_BCR (3ul << 5) /* Broadcast command with response */ 80163516Simp#define MMC_CMD_MASK (3ul << 5) 81163516Simp 82163516Simp/* Possible response types defined in the standard: */ 83163516Simp#define MMC_RSP_NONE (0) 84163516Simp#define MMC_RSP_R1 (MMC_RSP_PRESENT | MMC_RSP_CRC | MMC_RSP_OPCODE) 85163516Simp#define MMC_RSP_R1B (MMC_RSP_PRESENT | MMC_RSP_CRC | MMC_RSP_OPCODE | MMC_RSP_BUSY) 86163516Simp#define MMC_RSP_R2 (MMC_RSP_PRESENT | MMC_RSP_136 | MMC_RSP_CRC) 87163516Simp#define MMC_RSP_R3 (MMC_RSP_PRESENT) 88163516Simp#define MMC_RSP_R6 (MMC_RSP_PRESENT | MMC_RSP_CRC) 89183704Smav#define MMC_RSP_R7 (MMC_RSP_PRESENT | MMC_RSP_CRC) 90163516Simp#define MMC_RSP(x) ((x) & MMC_RSP_MASK) 91163516Simp uint32_t retries; 92163516Simp uint32_t error; 93163516Simp#define MMC_ERR_NONE 0 94163516Simp#define MMC_ERR_TIMEOUT 1 95163516Simp#define MMC_ERR_BADCRC 2 96163516Simp#define MMC_ERR_FIFO 3 97163516Simp#define MMC_ERR_FAILED 4 98163516Simp#define MMC_ERR_INVALID 5 99183468Simp#define MMC_ERR_NO_MEMORY 6 100188044Simp#define MMC_ERR_MAX 6 101163516Simp struct mmc_data *data; /* Data segment with cmd */ 102163516Simp struct mmc_request *mrq; /* backpointer to request */ 103163516Simp}; 104163516Simp 105163516Simp/* 106163516Simp * R1 responses 107163516Simp * 108163516Simp * Types (per SD 2.0 standard) 109163516Simp * e : error bit 110163516Simp * s : status bit 111163516Simp * r : detected and set for the actual command response 112163516Simp * x : Detected and set during command execution. The host can get 113163516Simp * the status by issuing a command with R1 response. 114163516Simp * 115163516Simp * Clear Condition (per SD 2.0 standard) 116163516Simp * a : according to the card current state. 117163516Simp * b : always related to the previous command. reception of a valid 118163516Simp * command will clear it (with a delay of one command). 119163516Simp * c : clear by read 120163516Simp */ 121163516Simp#define R1_OUT_OF_RANGE (1u << 31) /* erx, c */ 122163516Simp#define R1_ADDRESS_ERROR (1u << 30) /* erx, c */ 123163516Simp#define R1_BLOCK_LEN_ERROR (1u << 29) /* erx, c */ 124163516Simp#define R1_ERASE_SEQ_ERROR (1u << 28) /* er, c */ 125163516Simp#define R1_ERASE_PARAM (1u << 27) /* erx, c */ 126163516Simp#define R1_WP_VIOLATION (1u << 26) /* erx, c */ 127163516Simp#define R1_CARD_IS_LOCKED (1u << 25) /* sx, a */ 128163516Simp#define R1_LOCK_UNLOCK_FAILED (1u << 24) /* erx, c */ 129163516Simp#define R1_COM_CRC_ERROR (1u << 23) /* er, b */ 130163516Simp#define R1_ILLEGAL_COMMAND (1u << 22) /* er, b */ 131163516Simp#define R1_CARD_ECC_FAILED (1u << 21) /* erx, c */ 132163516Simp#define R1_CC_ERROR (1u << 20) /* erx, c */ 133163516Simp#define R1_ERROR (1u << 19) /* erx, c */ 134163516Simp#define R1_CSD_OVERWRITE (1u << 16) /* erx, c */ 135163516Simp#define R1_WP_ERASE_SKIP (1u << 15) /* erx, c */ 136163516Simp#define R1_CARD_ECC_DISABLED (1u << 14) /* sx, a */ 137163516Simp#define R1_ERASE_RESET (1u << 13) /* sr, c */ 138163516Simp#define R1_CURRENT_STATE_MASK (0xfu << 9) /* sx, b */ 139163516Simp#define R1_READY_FOR_DATA (1u << 8) /* sx, a */ 140163516Simp#define R1_APP_CMD (1u << 5) /* sr, c */ 141163516Simp#define R1_AKE_SEQ_ERROR (1u << 3) /* er, c */ 142163516Simp#define R1_STATUS(x) (x & 0xFFFFE000 143163516Simp#define R1_CURRENT_STATE(x) ((x) & R1_CURRENT_STATE_MASK) >> 9 144163516Simp#define R1_STATE_IDLE 0 145163516Simp#define R1_STATE_READY 1 146163516Simp#define R1_STATE_IDENT 2 147163516Simp#define R1_STATE_STBY 3 148163516Simp#define R1_STATE_TRAN 4 149163516Simp#define R1_STATE_DATA 5 150163516Simp#define R1_STATE_RCV 6 151163516Simp#define R1_STATE_PRG 7 152163516Simp#define R1_STATE_DIS 8 153163516Simp 154163516Simpstruct mmc_data { 155163516Simp size_t len; /* size of the data */ 156163516Simp size_t xfer_len; 157163516Simp void *data; /* data buffer */ 158163516Simp uint32_t flags; 159163516Simp#define MMC_DATA_WRITE (1UL << 0) 160163516Simp#define MMC_DATA_READ (1UL << 1) 161163516Simp#define MMC_DATA_STREAM (1UL << 2) 162163516Simp#define MMC_DATA_MULTI (1UL << 3) 163163516Simp struct mmc_request *mrq; 164163516Simp}; 165163516Simp 166163516Simpstruct mmc_request { 167163516Simp struct mmc_command *cmd; 168163516Simp struct mmc_command *stop; 169163516Simp void (*done)(struct mmc_request *); /* Completion function */ 170163516Simp void *done_data; /* requestor set data */ 171163516Simp uint32_t flags; 172163516Simp#define MMC_REQ_DONE 1 173163516Simp}; 174163516Simp 175163516Simp/* Command definitions */ 176163516Simp 177163516Simp/* Class 0 and 1: Basic commands & read stream commands */ 178163516Simp#define MMC_GO_IDLE_STATE 0 179163516Simp#define MMC_SEND_OP_COND 1 180163516Simp#define MMC_ALL_SEND_CID 2 181163516Simp#define MMC_SET_RELATIVE_ADDR 3 182163516Simp#define SD_SEND_RELATIVE_ADDR 3 183163516Simp#define MMC_SET_DSR 4 184163516Simp /* reserved: 5 */ 185183704Smav#define MMC_SWITCH_FUNC 6 186183704Smav#define MMC_SWITCH_FUNC_CMDS 0 187183704Smav#define MMC_SWITCH_FUNC_SET 1 188183704Smav#define MMC_SWITCH_FUNC_CLR 2 189183704Smav#define MMC_SWITCH_FUNC_WR 3 190163516Simp#define MMC_SELECT_CARD 7 191163516Simp#define MMC_DESELECT_CARD 7 192183704Smav#define MMC_SEND_EXT_CSD 8 193183704Smav#define SD_SEND_IF_COND 8 194163516Simp#define MMC_SEND_CSD 9 195163516Simp#define MMC_SEND_CID 10 196163516Simp#define MMC_READ_DAT_UNTIL_STOP 11 197163516Simp#define MMC_STOP_TRANSMISSION 12 198163516Simp#define MMC_SEND_STATUS 13 199183704Smav#define MMC_BUSTEST_R 14 200163516Simp#define MMC_GO_INACTIVE_STATE 15 201183704Smav#define MMC_BUSTEST_W 19 202163516Simp 203163516Simp/* Class 2: Block oriented read commands */ 204163516Simp#define MMC_SET_BLOCKLEN 16 205163516Simp#define MMC_READ_SINGLE_BLOCK 17 206163516Simp#define MMC_READ_MULTIPLE_BLOCK 18 207163516Simp /* reserved: 19 */ 208163516Simp 209163516Simp/* Class 3: Stream write commands */ 210163516Simp#define MMC_WRITE_DAT_UNTIL_STOP 20 211163516Simp /* reserved: 21 */ 212163516Simp /* reserved: 22 */ 213163516Simp 214163516Simp/* Class 4: Block oriented write commands */ 215163516Simp#define MMC_SET_BLOCK_COUNT 23 216163516Simp#define MMC_WRITE_BLOCK 24 217163516Simp#define MMC_WRITE_MULTIPLE_BLOCK 25 218163516Simp#define MMC_PROGARM_CID 26 219163516Simp#define MMC_PROGRAM_CSD 27 220163516Simp 221163516Simp/* Class 6: Block oriented write protection commands */ 222163516Simp#define MMC_SET_WRITE_PROT 28 223163516Simp#define MMC_CLR_WRITE_PROT 29 224163516Simp#define MMC_SEND_WRITE_PROT 30 225163516Simp /* reserved: 31 */ 226163516Simp 227163516Simp/* Class 5: Erase commands */ 228163516Simp#define SD_ERASE_WR_BLK_START 32 229163516Simp#define SD_ERASE_WR_BLK_END 33 230163516Simp /* 34 -- reserved old command */ 231163516Simp#define MMC_ERASE_GROUP_START 35 232163516Simp#define MMC_ERASE_GROUP_END 36 233163516Simp /* 37 -- reserved old command */ 234163516Simp#define MMC_ERASE 38 235163516Simp 236163516Simp/* Class 9: I/O mode commands */ 237163516Simp#define MMC_FAST_IO 39 238163516Simp#define MMC_GO_IRQ_STATE 40 239163516Simp /* reserved: 41 */ 240163516Simp 241163516Simp/* Class 7: Lock card */ 242163516Simp#define MMC_LOCK_UNLOCK 42 243163516Simp /* reserved: 43 */ 244163516Simp /* reserved: 44 */ 245163516Simp /* reserved: 45 */ 246163516Simp /* reserved: 46 */ 247163516Simp /* reserved: 47 */ 248163516Simp /* reserved: 48 */ 249163516Simp /* reserved: 49 */ 250163516Simp /* reserved: 50 */ 251163516Simp /* reserved: 51 */ 252163516Simp /* reserved: 54 */ 253163516Simp 254163516Simp/* Class 8: Application specific commands */ 255163516Simp#define MMC_APP_CMD 55 256163516Simp#define MMC_GEN_CMD 56 257163516Simp /* reserved: 57 */ 258163516Simp /* reserved: 58 */ 259163516Simp /* reserved: 59 */ 260163516Simp /* reserved for mfg: 60 */ 261163516Simp /* reserved for mfg: 61 */ 262163516Simp /* reserved for mfg: 62 */ 263163516Simp /* reserved for mfg: 63 */ 264163516Simp 265163516Simp/* Class 9: I/O cards (sd) */ 266163516Simp#define SD_IO_RW_DIRECT 52 267163516Simp#define SD_IO_RW_EXTENDED 53 268163516Simp 269163516Simp/* Class 10: Switch function commands */ 270163516Simp#define SD_SWITCH_FUNC 6 271163516Simp /* reserved: 34 */ 272163516Simp /* reserved: 35 */ 273163516Simp /* reserved: 36 */ 274163516Simp /* reserved: 37 */ 275163516Simp /* reserved: 50 */ 276163516Simp /* reserved: 57 */ 277163516Simp 278163516Simp 279163516Simp/* Application specific commands for SD */ 280163516Simp#define ACMD_SET_BUS_WIDTH 6 281163516Simp#define ACMD_SD_STATUS 13 282163516Simp#define ACMD_SEND_NUM_WR_BLOCKS 22 283163516Simp#define ACMD_SET_WR_BLK_ERASE_COUNT 23 284163516Simp#define ACMD_SD_SEND_OP_COND 41 285163516Simp#define ACMD_SET_CLR_CARD_DETECT 42 286163516Simp#define ACMD_SEND_SCR 51 287163516Simp 288183704Smav/* 289183704Smav * EXT_CSD fields 290183704Smav */ 291184033Smav#define EXT_CSD_ERASE_GRP_DEF 175 /* R/W */ 292183704Smav#define EXT_CSD_BUS_WIDTH 183 /* R/W */ 293183704Smav#define EXT_CSD_HS_TIMING 185 /* R/W */ 294183704Smav#define EXT_CSD_CARD_TYPE 196 /* RO */ 295183704Smav#define EXT_CSD_REV 192 /* RO */ 296183704Smav#define EXT_CSD_SEC_CNT 212 /* RO, 4 bytes */ 297184033Smav#define EXT_CSD_ERASE_TO_MULT 223 /* RO */ 298184033Smav#define EXT_CSD_ERASE_GRP_SIZE 224 /* RO */ 299183704Smav 300183704Smav/* 301183704Smav * EXT_CSD field definitions 302183704Smav */ 303183704Smav#define EXT_CSD_CMD_SET_NORMAL 1 304183704Smav#define EXT_CSD_CMD_SET_SECURE 2 305183704Smav#define EXT_CSD_CMD_SET_CPSECURE 4 306183704Smav 307183704Smav#define EXT_CSD_CARD_TYPE_26 1 308183704Smav#define EXT_CSD_CARD_TYPE_52 2 309183704Smav 310183704Smav#define EXT_CSD_BUS_WIDTH_1 0 311183704Smav#define EXT_CSD_BUS_WIDTH_4 1 312183704Smav#define EXT_CSD_BUS_WIDTH_8 2 313183704Smav 314188044Simp#define MMC_TYPE_26_MAX_HS 26000000 315188044Simp#define MMC_TYPE_52_MAX_HS 52000000 316188044Simp 317183704Smav/* 318183704Smav * SD bus widths 319183704Smav */ 320183704Smav#define SD_BUS_WIDTH_1 0 321183704Smav#define SD_BUS_WIDTH_4 2 322183704Smav 323188044Simp/* 324188044Simp * SD Switch 325188044Simp */ 326188044Simp#define SD_SWITCH_MODE_CHECK 0 327188044Simp#define SD_SWITCH_MODE_SET 1 328188044Simp#define SD_SWITCH_GROUP1 0 329188044Simp#define SD_SWITCH_NORMAL_MODE 0 330188044Simp#define SD_SWITCH_HS_MODE 1 331188044Simp#define SD_SWITCH_NOCHANGE 0xF 332188044Simp 333188044Simp#define SD_MAX_HS 50000000 334188044Simp 335163516Simp/* OCR bits */ 336163516Simp 337163516Simp/* 338163516Simp * in SD 2.0 spec, bits 8-14 are now marked reserved 339163516Simp * Low voltage in SD2.0 spec is bit 7, TBD voltage 340163516Simp * Low voltage in MC 3.31 spec is bit 7, 1.65-1.95V 341163516Simp * Specs prior to MMC 3.31 defined bits 0-7 as voltages down to 1.5V. 342163516Simp * 3.31 redefined them to be reserved and also said that cards had to 343163516Simp * support the 2.7-3.6V and fixed the OCR to be 0xfff8000 for high voltage 344163516Simp * cards. MMC 4.0 says that a dual voltage card responds with 0xfff8080. 345163516Simp * Looks like the fine-grained control of the voltage tolerance ranges 346163516Simp * was abandoned. 347163516Simp * 348163516Simp * The MMC_OCR_CCS appears to be valid for only SD cards. 349163516Simp */ 350183468Simp#define MMC_OCR_VOLTAGE 0x3fffffffU /* Vdd Voltage mask */ 351163516Simp#define MMC_OCR_LOW_VOLTAGE (1u << 7) /* Low Voltage Range -- tbd */ 352163516Simp#define MMC_OCR_200_210 (1U << 8) /* Vdd voltage 2.00 ~ 2.10 */ 353163516Simp#define MMC_OCR_210_220 (1U << 9) /* Vdd voltage 2.10 ~ 2.20 */ 354163516Simp#define MMC_OCR_220_230 (1U << 10) /* Vdd voltage 2.20 ~ 2.30 */ 355163516Simp#define MMC_OCR_230_240 (1U << 11) /* Vdd voltage 2.30 ~ 2.40 */ 356163516Simp#define MMC_OCR_240_250 (1U << 12) /* Vdd voltage 2.40 ~ 2.50 */ 357163516Simp#define MMC_OCR_250_260 (1U << 13) /* Vdd voltage 2.50 ~ 2.60 */ 358163516Simp#define MMC_OCR_260_270 (1U << 14) /* Vdd voltage 2.60 ~ 2.70 */ 359163516Simp#define MMC_OCR_270_280 (1U << 15) /* Vdd voltage 2.70 ~ 2.80 */ 360163516Simp#define MMC_OCR_280_290 (1U << 16) /* Vdd voltage 2.80 ~ 2.90 */ 361163516Simp#define MMC_OCR_290_300 (1U << 17) /* Vdd voltage 2.90 ~ 3.00 */ 362163516Simp#define MMC_OCR_300_310 (1U << 18) /* Vdd voltage 3.00 ~ 3.10 */ 363163516Simp#define MMC_OCR_310_320 (1U << 19) /* Vdd voltage 3.10 ~ 3.20 */ 364163516Simp#define MMC_OCR_320_330 (1U << 20) /* Vdd voltage 3.20 ~ 3.30 */ 365163516Simp#define MMC_OCR_330_340 (1U << 21) /* Vdd voltage 3.30 ~ 3.40 */ 366163516Simp#define MMC_OCR_340_350 (1U << 22) /* Vdd voltage 3.40 ~ 3.50 */ 367163516Simp#define MMC_OCR_350_360 (1U << 23) /* Vdd voltage 3.50 ~ 3.60 */ 368163516Simp#define MMC_OCR_CCS (1u << 30) /* Card Capacity status (SD vs SDHC) */ 369163516Simp#define MMC_OCR_CARD_BUSY (1U << 31) /* Card Power up status */ 370163516Simp 371163516Simp/* CSD -- decoded structure */ 372163516Simpstruct mmc_cid { 373163516Simp uint32_t mid; 374163516Simp char pnm[8]; 375163516Simp uint32_t psn; 376163516Simp uint16_t oid; 377163516Simp uint16_t mdt_year; 378163516Simp uint8_t mdt_month; 379163516Simp uint8_t prv; 380163516Simp uint8_t fwrev; 381163516Simp}; 382163516Simp 383163516Simpstruct mmc_csd 384163516Simp{ 385163516Simp uint8_t csd_structure; 386183704Smav uint8_t spec_vers; 387163516Simp uint16_t ccc; 388163516Simp uint16_t tacc; 389163516Simp uint32_t nsac; 390163516Simp uint32_t r2w_factor; 391163516Simp uint32_t tran_speed; 392163516Simp uint32_t read_bl_len; 393163516Simp uint32_t write_bl_len; 394163516Simp uint32_t vdd_r_curr_min; 395163516Simp uint32_t vdd_r_curr_max; 396163516Simp uint32_t vdd_w_curr_min; 397163516Simp uint32_t vdd_w_curr_max; 398163516Simp uint32_t wp_grp_size; 399184033Smav uint32_t erase_sector; 400163516Simp uint64_t capacity; 401163516Simp unsigned int read_bl_partial:1, 402163516Simp read_blk_misalign:1, 403163516Simp write_bl_partial:1, 404163516Simp write_blk_misalign:1, 405163516Simp dsr_imp:1, 406163516Simp erase_blk_en:1, 407163516Simp wp_grp_enable:1; 408163516Simp}; 409163516Simp 410183704Smavstruct mmc_scr 411183704Smav{ 412183704Smav unsigned char sda_vsn; 413183704Smav unsigned char bus_widths; 414183704Smav#define SD_SCR_BUS_WIDTH_1 (1<<0) 415183704Smav#define SD_SCR_BUS_WIDTH_4 (1<<2) 416183704Smav}; 417183704Smav 418184033Smavstruct mmc_sd_status 419184033Smav{ 420184033Smav uint8_t bus_width; 421184033Smav uint8_t secured_mode; 422184033Smav uint16_t card_type; 423184033Smav uint16_t prot_area; 424184033Smav uint8_t speed_class; 425184033Smav uint8_t perf_move; 426184033Smav uint8_t au_size; 427184033Smav uint16_t erase_size; 428184033Smav uint8_t erase_timeout; 429184033Smav uint8_t erase_offset; 430184033Smav}; 431184033Smav 432183542Simp/* 433183542Simp * Older versions of the MMC standard had a variable sector size. However, 434183542Simp * I've been able to find no old MMC or SD cards that have a non 512 435183542Simp * byte sector size anywhere, so we assume that such cards are very rare 436183542Simp * and only note their existance in passing here... 437183542Simp */ 438183542Simp#define MMC_SECTOR_SIZE 512 439183542Simp 440163516Simp#endif /* DEV_MMCREG_H */ 441