Difference between revisions of "Unit MMC"

From Ultibo.org
Jump to: navigation, search
Line 1,599: Line 1,599:
 
| <code>MMC_LOG_LEVEL_NONE = LOG_LEVEL_NONE;</code>
 
| <code>MMC_LOG_LEVEL_NONE = LOG_LEVEL_NONE;</code>
 
| No MMC messages
 
| No MMC messages
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''SD specific constants''' <code> SD_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>SD_DEFAULT_BLOCKSIZE = 512;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>SD_DEFAULT_BLOCKSHIFT = 9;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''SD bus width constants''' <code> SD_BUS_WIDTH_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>SD_BUS_WIDTH_1 = 0;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>SD_BUS_WIDTH_4 = 2;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''SD bus speed (Hz) constants''' <code> SD_BUS_SPEED_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>SD_BUS_SPEED_DEFAULT = 25000000;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>SD_BUS_SPEED_HS = 50000000;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SD_BUS_SPEED_UHS_SDR12 = 25000000;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SD_BUS_SPEED_UHS_SDR25 = 50000000;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SD_BUS_SPEED_UHS_DDR50 = 50000000;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SD_BUS_SPEED_UHS_SDR50 = 100000000;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SD_BUS_SPEED_UHS_SDR104 = 208000000;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''SD command constants''' <code> SD_CMD_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|From: /include/linux/mmc/sd.h
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|''Class 0''
 +
|-
 +
| <code>SD_CMD_SEND_RELATIVE_ADDR = 3;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SD_CMD_SEND_IF_COND = 8;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SD_CMD_SWITCH_VOLTAGE = 11;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|''Class 10''
 +
|-
 +
| <code>SD_CMD_SWITCH = 6;</code>
 +
| See: 4.3.10 Switch Function Command
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|''Class 5''
 +
|-
 +
| <code>SD_CMD_ERASE_WR_BLK_START = 32;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SD_CMD_ERASE_WR_BLK_END = 33;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|''Application commands''
 +
|-
 +
| <code>SD_CMD_APP_SET_BUS_WIDTH = 6;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SD_CMD_APP_SD_STATUS = 13;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SD_CMD_APP_SEND_NUM_WR_BLKS = 22;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SD_CMD_APP_SEND_OP_COND = 41;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SD_CMD_APP_SEND_SCR = 51;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|SD_CMD_SWITCH argument format:
 +
|-
 +
| <code>[31] Check (0) or switch (1)</code>
 +
| &nbsp;
 +
|-
 +
| <code>[30:24] Reserved (0)</code>
 +
| &nbsp;
 +
|-
 +
| <code>[23:20] Function group 6</code>
 +
| &nbsp;
 +
|-
 +
| <code>[19:16] Function group 5</code>
 +
| &nbsp;
 +
|-
 +
| <code>[15:12] Function group 4</code>
 +
| &nbsp;
 +
|-
 +
| <code>[11:8] Function group 3</code>
 +
| &nbsp;
 +
|-
 +
| <code>[7:4] Function group 2</code>
 +
| &nbsp;
 +
|-
 +
| <code>[3:0] Function group 1</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''SD switch mode value constants''' <code> SD_SWITCH_MODE_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>SD_SWITCH_MODE_CHECK = 0;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>SD_SWITCH_MODE_SWITCH = 1;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''SD switch function group constants''' <code> SD_SWITCH_FUNCTION_GROUP_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>SD_SWITCH_FUNCTION_GROUP_ACCESS = 0;</code>
 +
| Access Mode
 +
|-
 +
| <code>SD_SWITCH_FUNCTION_GROUP_COMMAND = 1;</code>
 +
| Command System
 +
|-
 +
| <code>SD_SWITCH_FUNCTION_GROUP_DRIVER = 2;</code>
 +
| Driver Strength
 +
|-
 +
| <code>SD_SWITCH_FUNCTION_GROUP_POWER = 3;</code>
 +
| Power Limit
 +
|-
 +
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''SD switch access mode constants''' <code> SD_SWITCH_ACCESS_MODE_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>SD_SWITCH_ACCESS_MODE_DEF = 0;</code>
 +
| Default SDR12
 +
|-
 +
| <code>SD_SWITCH_ACCESS_MODE_HS = 1;</code>
 +
| High Speed SDR25
 +
|-
 +
| <code>SD_SWITCH_ACCESS_MODE_SDR50 = 2;</code>
 +
| SDR50 (1.8V only)
 +
|-
 +
| <code>SD_SWITCH_ACCESS_MODE_SDR104 = 3;</code>
 +
| SDR104 (1.8V only)
 +
|-
 +
| <code>SD_SWITCH_ACCESS_MODE_DDR50 = 4;</code>
 +
| DDR50 (1.8V only)
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''SD switch command system constants''' <code> SD_SWITCH_COMMAND_SYSTEM_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>SD_SWITCH_COMMAND_SYSTEM_DEF = 0;</code>
 +
| Default
 +
|-
 +
| <code>SD_SWITCH_COMMAND_SYSTEM_EC = 1;</code>
 +
| For eC
 +
|-
 +
| <code>SD_SWITCH_COMMAND_SYSTEM_OTP = 3;</code>
 +
| OTP
 +
|-
 +
| <code>SD_SWITCH_COMMAND_SYSTEM_ASSD = 4;</code>
 +
| ASSD
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''SD switch driver strength constants''' <code> SD_SWITCH_DRIVER_STRENGTH_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>SD_SWITCH_DRIVER_STRENGTH_DEF = 0;</code>
 +
| Default Type B
 +
|-
 +
| <code>SD_SWITCH_DRIVER_STRENGTH_TYPE_A = 1;</code>
 +
| Type A
 +
|-
 +
| <code>SD_SWITCH_DRIVER_STRENGTH_TYPE_C = 2;</code>
 +
| Type C
 +
|-
 +
| <code>SD_SWITCH_DRIVER_STRENGTH_TYPE_D = 3;</code>
 +
| Type D
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''SD switch power limit constants''' <code> SD_SWITCH_POWER_LIMIT_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>SD_SWITCH_POWER_LIMIT_DEF = 0;</code>
 +
| Default 0.72W
 +
|-
 +
| <code>SD_SWITCH_POWER_LIMIT_144 = 1;</code>
 +
| 1.44W
 +
|-
 +
| <code>SD_SWITCH_POWER_LIMIT_216 = 2;</code>
 +
| 2.16W (Embedded only)
 +
|-
 +
| <code>SD_SWITCH_POWER_LIMIT_216 = 2;</code>
 +
| 2.16W (Embedded only)
 +
|-
 +
| <code>SD_SWITCH_POWER_LIMIT_288 = 3;</code>
 +
| 2.88W (Embedded only)
 +
|-
 +
| <code>SD_SWITCH_POWER_LIMIT_180 = 4;</code>
 +
| 1.80W
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''SD send interface condition value constants''' <code> SD_SEND_IF_COND_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>SD_SEND_IF_COND_CHECK_PATTERN = $AA;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SD_SEND_IF_COND_VOLTAGE_MASK = $00FF8000;</code>
 +
| MMC_VDD_27_28, MMC_VDD_28_29, MMC_VDD_29_30, MMC_VDD_30_31, MMC_VDD_31_32, MMC_VDD_32_33, MMC_VDD_33_34, MMC_VDD_34_35, MMC_VDD_35_36
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|SD_CMD_SEND_IF_COND argument format:
 +
|-
 +
| <code>[31:12] Reserved (0)</code>
 +
| &nbsp;
 +
|-
 +
| <code>[11:8] Host Voltage Supply Flags</code>
 +
| &nbsp;
 +
|-
 +
| <code>[7:0] Check Pattern (0xAA)</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''SD send operation condition value constants''' <code> SD_SEND_OP_COND_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>SD_SEND_OP_COND_VOLTAGE_MASK  = $00FF8000;</code>
 +
| MMC_VDD_27_28, MMC_VDD_28_29, MMC_VDD_29_30, MMC_VDD_30_31, MMC_VDD_31_32, MMC_VDD_32_33, MMC_VDD_33_34, MMC_VDD_34_35, MMC_VDD_35_36
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''SD operation condition register value constants''' <code> SD_OCR_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|See: Section 5.1 of SD Physical Layer Simplified Specification V4.10
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>SD_OCR_CCS = $40000000;</code>
 +
| Card Capacity Status - 0 = SDSC / 1 = SDHC or SDXC
 +
|-
 +
| <code>SD_OCR_CCS = $40000000;</code>
 +
| Card Capacity Status - 0 = SDSC / 1 = SDHC or SDXC
 +
|-
 +
| <code>SD_OCR_UHS_II = $20000000;</code>
 +
| UHS-II Card Status - 0 = Non UHS-II Card / 1 = UHS-II Card
 +
|-
 +
| <code>SD_OCR_XPC = $10000000;</code>
 +
| SDXC Power Control
 +
|-
 +
| <code>SD_OCR_S18A = $01000000;</code>
 +
| 1.8V Switching Accepted
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''SD CSD structure value constants''' <code> SD_CSD_STRUCT_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>SD_CSD_STRUCT_VER_1_0 = 0;</code>
 +
| Standard Capacity
 +
|-
 +
| <code>SD_CSD_STRUCT_VER_2_0 = 1;</code>
 +
| High Capacity and Extended Capacity
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''SD SD status register (SSR) value constants''' <code> SD_SSR_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|See: Section 4.10.2 of SD Physical Layer Simplified Specification Version 4.10
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|''SD SSR Fields''
 +
|-
 +
| <code>SD_SSR_DAT_BUS_WIDTH = 1;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>SD_SSR_SECURED_MODE = 2;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SD_SSR_SD_CARD_TYPE = 3;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SD_SSR_SIZE_OF_PROTECTED_AREA = 4;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SD_SSR_SPEED_CLASS = 5;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SD_SSR_PERFORMANCE_MOVE = 6;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SD_SSR_AU_SIZE = 7;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SD_SSR_ERASE_SIZE = 8;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SD_SSR_ERASE_TIMEOUT = 9;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SD_SSR_ERASE_OFFSET = 10;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SD_SSR_UHS_SPEED_GRADE = 11;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SD_SSR_UHS_AU_SIZE = 12;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''SD SSR bus width value constants''' <code> SD_SSR_BUS_WIDTH_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>SD_SSR_BUS_WIDTH_1 = 0;</code>
 +
| 1 (default)
 +
|-
 +
| <code>SD_SSR_BUS_WIDTH_4 = 2;</code>
 +
| 4 bit width
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''SD SSR card type value constants''' <code> SD_SSR_CARD_TYPE_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>SD_SSR_CARD_TYPE_RW = $0000;</code>
 +
| Regular SD RD/WR Card
 +
|-
 +
| <code>SD_SSR_CARD_TYPE_ROM = $0001;</code>
 +
| SD ROM Card
 +
|-
 +
| <code>SD_SSR_CARD_TYPE_OTP = $0002;</code>
 +
| OTP
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''SD SSR speed class value constants''' <code> SD_SSR_SPEED_CLASS_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>SD_SSR_SPEED_CLASS_0 = $00;</code>
 +
| Class 0
 +
|-
 +
| <code>SD_SSR_SPEED_CLASS_2 = $01;</code>
 +
| Class 2
 +
|-
 +
| <code>SD_SSR_SPEED_CLASS_4 = $02;</code>
 +
| Class 4
 +
|-
 +
| <code>SD_SSR_SPEED_CLASS_6 = $03;</code>
 +
| Class 6
 +
|-
 +
| <code>SD_SSR_SPEED_CLASS_10 = $04;</code>
 +
| Class 10
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''SD SSR AU size value constants''' <code> SD_SSR_AU_SIZE_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|<code>SD_SSR_AU_SIZE_VALUES:array[0..15] of LongWord = (</code>
 +
|-
 +
| <code>0,</code>
 +
| Not Defined
 +
|-
 +
| <code>$00004000,</code>
 +
| 16 KB
 +
|-
 +
| <code>$00008000,</code>
 +
| 32 KB
 +
|-
 +
| <code>$00010000,</code>
 +
| 64 KB
 +
|-
 +
| <code>$00020000,</code>
 +
| 128 KB
 +
|-
 +
| <code>$00040000,</code>
 +
| 256 KB
 +
|-
 +
| <code>$00080000,</code>
 +
| 512 KB
 +
|-
 +
| <code>$00100000,</code>
 +
| 1 MB
 +
|-
 +
| <code>$00200000,</code>
 +
| 2 MB
 +
|-
 +
| <code>$00400000,</code>
 +
| 4 MB
 +
|-
 +
| <code>$00800000,</code>
 +
| 8 MB
 +
|-
 +
| <code>$00800000 + $00400000,</code>
 +
| 12 MB
 +
|-
 +
| <code>$01000000,</code>
 +
| 16 MB
 +
|-
 +
| <code>$01000000 + $00800000,</code>
 +
| 24 MB
 +
|-
 +
| <code>$02000000,</code>
 +
| 32 MB
 +
|-
 +
| <code>$04000000);</code>
 +
| 64 MB
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''SD SSR UHS speed grade value constants''' <code> SD_SSR_UHS_SPEED_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>SD_SSR_UHS_SPEED_GRADE_0 = 0;</code>
 +
| Less than 10MB/sec
 +
|-
 +
| <code>SD_SSR_UHS_SPEED_GRADE_1 = 1;</code>
 +
| 10MB/sec and above
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''SD SSR UHS AU size value constants''' <code> SD_SSR_UHS_AU_SIZE_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|<code>SD_SSR_UHS_AU_SIZE_VALUES:array[0..15] of LongWord = (</code>
 +
|-
 +
| <code>0,</code>
 +
| Not Defined
 +
|-
 +
| <code>0,</code>
 +
| Not Used
 +
|-
 +
| <code>0,</code>
 +
| Not Used
 +
|-
 +
| <code>0,</code>
 +
| Not Used
 +
|-
 +
| <code>0,</code>
 +
| Not Used
 +
|-
 +
| <code>0,</code>
 +
| Not Used
 +
|-
 +
| <code>0,</code>
 +
| Not Used
 +
|-
 +
| <code>$00100000,</code>
 +
| 1 MB
 +
|-
 +
| <code>$00200000,</code>
 +
| 2 MB
 +
|-
 +
| <code>$00400000,</code>
 +
| 4 MB
 +
|-
 +
| <code>$00800000,</code>
 +
| 8 MB
 +
|-
 +
| <code>$00800000 + $00400000,</code>
 +
| 12 MB
 +
|-
 +
| <code>$01000000,</code>
 +
| 16 MB
 +
|-
 +
| <code>$01000000 + $00800000,</code>
 +
| 24 MB
 +
|-
 +
| <code>$02000000,</code>
 +
| 32 MB
 +
|-
 +
| <code>$04000000);</code>
 +
| 64 MB
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''SD switch status value constants''' <code> SD_SWITCH_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|See: Section 4.3.10 of SD Physical Layer Simplified Specification Version 4.10
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|''SD Switch Fields''
 +
|-
 +
| <code>SD_SWITCH_MAXIMUM_CURRENT = 1;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SD_SWITCH_GROUP6_SUPPORT = 2;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SD_SWITCH_GROUP5_SUPPORT = 3;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SD_SWITCH_GROUP4_SUPPORT = 4;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SD_SWITCH_GROUP3_SUPPORT = 5;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SD_SWITCH_GROUP2_SUPPORT = 6;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SD_SWITCH_GROUP1_SUPPORT = 7;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SD_SWITCH_GROUP6_SELECTION = 8;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SD_SWITCH_GROUP5_SELECTION = 9;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SD_SWITCH_GROUP4_SELECTION = 10;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SD_SWITCH_GROUP3_SELECTION = 11;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SD_SWITCH_GROUP2_SELECTION = 12;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SD_SWITCH_GROUP1_SELECTION = 13;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SD_SWITCH_STRUCT_VERSION = 14;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SD_SWITCH_GROUP6_BUSY_STATUS = 15;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SD_SWITCH_GROUP5_BUSY_STATUS = 16;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SD_SWITCH_GROUP4_BUSY_STATUS = 17;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SD_SWITCH_GROUP3_BUSY_STATUS = 18;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SD_SWITCH_GROUP2_BUSY_STATUS = 19;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SD_SWITCH_GROUP1_BUSY_STATUS = 20;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|''SD Switch Access Mode (Bus Speed) Support (Group 1)''
 +
|-
 +
| <code>SD_SWITCH_GROUP1_SDR12 = (1 shl 0);</code>
 +
| &nbsp;
 +
|-
 +
| <code>SD_SWITCH_GROUP1_HS = (1 shl 1);</code>
 +
| &nbsp;
 +
|-
 +
| <code>SD_SWITCH_GROUP1_SDR25 = (1 shl 1);</code>
 +
| &nbsp;
 +
|-
 +
| <code>SD_SWITCH_GROUP1_SDR50 = (1 shl 2);</code>
 +
| &nbsp;
 +
|-
 +
| <code>SD_SWITCH_GROUP1_SDR104 = (1 shl 3);</code>
 +
| &nbsp;
 +
|-
 +
| <code>SD_SWITCH_GROUP1_DDR50 = (1 shl 4);</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|''SD Switch Driver Strength Support (Group 3)''
 +
|-
 +
| <code>SD_SWITCH_GROUP3_TYPE_B = (1 shl 0);</code>
 +
| &nbsp;
 +
|-
 +
| <code>SD_SWITCH_GROUP3_TYPE_A = (1 shl 1);</code>
 +
| &nbsp;
 +
|-
 +
| <code>SD_SWITCH_GROUP3_TYPE_C = (1 shl 2);</code>
 +
| &nbsp;
 +
|-
 +
| <code>SD_SWITCH_GROUP3_TYPE_D = (1 shl 3);</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|''SD Switch Structure Versions''
 +
|-
 +
| <code>SD_SWITCH_STRUCT_VER_0 = 0;</code>
 +
| Bits 511:376 are defined (SD_SWITCH_MAXIMUM_CURRENT to SD_SWITCH_GROUP1_SELECTION)
 +
|-
 +
| <code>SD_SWITCH_STRUCT_VER_1 = 1;</code>
 +
| Bits 511:272 are defined (SD_SWITCH_MAXIMUM_CURRENT to SD_SWITCH_GROUP1_BUSY_STATUS
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''SD SD configuration register (SCR) value constants''' <code> SD_SCR_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|See: Section 5.6 of SD Physical Layer Simplified Specification Version 4.10
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|''SD SCR Fields''
 +
|-
 +
| <code>SD_SCR_STRUCTURE = 1;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>SD_SCR_SD_SPEC = 2;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SD_SCR_DATA_STAT_AFTER_ERASE = 3;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SD_SCR_SD_SECURITY = 4;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SD_SCR_SD_BUS_WIDTHS = 5;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SD_SCR_SD_SPEC3 = 6;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SD_SCR_EX_SECURITY = 7;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SD_SCR_SD_SPEC4 = 8;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SD_SCR_CMD_SUPPORT = 9;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''SD SCR structure value constants''' <code> SD_SCR_STRUCT_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>SD_SCR_STRUCT_VER_1_0 = 0;</code>
 +
| Valid for system specification 1.01 - 4.0
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''SD SCR Spec version value constants''' <code> SD_SCR_SPEC_VER_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>SD_SCR_SPEC_VER_0 = 0;</code>
 +
| Implements system specification 1.0 - 1.01
 +
|-
 +
| <code>SD_SCR_SPEC_VER_1 = 1;</code>
 +
| Implements system specification 1.10
 +
|-
 +
| <code>SD_SCR_SPEC_VER_2 = 2;</code>
 +
| Implements system specification 2.00-4.0X
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''SD SCR security value constants''' <code> SD_SCR_SECURITY_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>SD_SCR_SECURITY_VER_0 = 0;</code>
 +
| No Security
 +
|-
 +
| <code>SD_SCR_SECURITY_VER_2 = 2;</code>
 +
| SDSC Card (Security Version 1.01)
 +
|-
 +
| <code>SD_SCR_SECURITY_VER_3 = 3;</code>
 +
| SDHC Card (Security Version 2.00)
 +
|-
 +
| <code>SD_SCR_SECURITY_VER_4 = 4;</code>
 +
| SDXC Card (Security Version 3.xx)
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''SD SCR bus width value constants''' <code> SD_SCR_BUS_WIDTH_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>SD_SCR_BUS_WIDTH_1 = (1 shl 0);</code>
 +
| 1 bit (DAT0)
 +
|-
 +
| <code>SD_SCR_BUS_WIDTH_4 = (1 shl 2);    {4 bit (DAT0-3)}</code>
 +
| 4 bit (DAT0-3)
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''SD SCR extended security value constants''' <code> SD_SCR_EX_SECURITY_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>SD_SCR_EX_SECURITY_VER_0 = 0;</code>
 +
| Extended Security is not supported
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''SD SCR command support value constants''' <code> SD_SCR_*_SUPPORT </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>SD_SCR_CMD20_SUPPORT = (1 shl 0);</code>
 +
| Mandatory for SDXC card
 +
|-
 +
| <code>SD_SCR_CMD23_SUPPORT = (1 shl 1);</code>
 +
| Mandatory for UHS104 card
 +
|-
 +
| <code>SD_SCR_CMD48_49_SUPPORT = (1 shl 2);</code>
 +
| Optional
 +
|-
 +
| <code>SD_SCR_CMD58_59_SUPPORT = (1 shl 3);</code>
 +
| Optional (If CMD58/59 is supported, CMD48/49 shall be supported)
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''SDIO command constants''' <code> SDIO_CMD_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|From: /include/linux/mmc/sdio.h
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>SDIO_CMD_SEND_OP_COND = 5;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>SDIO_CMD_RW_DIRECT = 52;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDIO_CMD_RW_EXTENDED = 53;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|SDIO_CMD_RW_DIRECT argument format:
 +
|-
 +
| <code>[31] R/W flag</code>
 +
| &nbsp;
 +
|-
 +
| <code>[30:28] Function number</code>
 +
| &nbsp;
 +
|-
 +
| <code>[27] RAW flag</code>
 +
| &nbsp;
 +
|-
 +
| <code>[25:9] Register address</code>
 +
| &nbsp;
 +
|-
 +
| <code>[7:0] Data</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|SDIO_CMD_RW_EXTENDED argument format:
 +
|-
 +
| <code>[31] R/W flag</code>
 +
| &nbsp;
 +
|-
 +
| <code>[30:28] Function number</code>
 +
| &nbsp;
 +
|-
 +
| <code>[27] Block mode</code>
 +
| &nbsp;
 +
|-
 +
| <code>[26] Increment address</code>
 +
| &nbsp;
 +
|-
 +
| <code>[25:9] Register address</code>
 +
| &nbsp;
 +
|-
 +
| <code>[8:0] Byte/block count</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''SDIO response value constants''' <code> SDIO_RSP_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|From: /include/linux/mmc/sdio.h
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|''R4''
 +
|-
 +
| <code>SDIO_RSP_R4_18V_PRESENT = (1 shl 24);</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>SDIO_RSP_R4_MEMORY_PRESENT = (1 shl 27);</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|''R5''
 +
|-
 +
| <code>SDIO_RSP_R5_COM_CRC_ERROR = (1 shl 15);</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDIO_RSP_R5_ILLEGAL_COMMAND = (1 shl 14);</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDIO_RSP_R5_ERROR = (1 shl 11);</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDIO_RSP_R5_FUNCTION_NUMBER = (1 shl 9);</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDIO_RSP_R5_OUT_OF_RANGE = (1 shl 8);</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
<br /> 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''SDIO card common control registers (CCCR) constants''' <code> SDIO_CCCR_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>SDIO_CCCR_CCCR = $00;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDIO_CCCR_SD = $01;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDIO_CCCR_IOEx = $02;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDIO_CCCR_IORx = $03;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDIO_CCCR_IENx = $04;</code>
 +
| Function/Master Interrupt Enable
 +
|-
 +
| <code>SDIO_CCCR_INTx = $05;</code>
 +
| Function Interrupt Pending
 +
|-
 +
| <code>SDIO_CCCR_ABORT = $06;</code>
 +
| function abort/card reset
 +
|-
 +
| <code>SDIO_CCCR_IF = $07;</code>
 +
| bus interface controls
 +
|-
 +
| <code>SDIO_CCCR_CAPS = $08;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDIO_CCCR_CIS = $09;</code>
 +
| common CIS pointer (3 bytes)
 +
|-
 +
|colspan="2"|''Following 4 regs are valid only if SBS is set''
 +
|-
 +
| <code>SDIO_CCCR_SUSPEND = $0c;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDIO_CCCR_SELx = $0d;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDIO_CCCR_EXECx = $0e;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDIO_CCCR_READYx = $0f;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDIO_CCCR_BLKSIZE = $10;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDIO_CCCR_POWER = $12;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDIO_CCCR_SPEED = $13;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDIO_CCCR_UHS = $14;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDIO_CCCR_DRIVE_STRENGTH = $15;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''SDIO revision constants''' <code> SDIO_*_REV_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|''SDIO CCCR Register values''
 +
|-
 +
| <code>SDIO_CCCR_REV_1_00 = 0;</code>
 +
| CCCR/FBR Version 1.00
 +
|-
 +
| <code>SDIO_CCCR_REV_1_10 = 1;</code>
 +
| CCCR/FBR Version 1.10
 +
|-
 +
| <code>SDIO_CCCR_REV_1_20 = 2;</code>
 +
| CCCR/FBR Version 1.20
 +
|-
 +
| <code>SDIO_CCCR_REV_3_00 = 3;</code>
 +
| CCCR/FBR Version 3.00
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>SDIO_SDIO_REV_1_00 = 0;</code>
 +
| SDIO Spec Version 1.00
 +
|-
 +
| <code>SDIO_SDIO_REV_1_10 = 1;</code>
 +
| SDIO Spec Version 1.10
 +
|-
 +
| <code>SDIO_SDIO_REV_1_20 = 2;</code>
 +
| SDIO Spec Version 1.20
 +
|-
 +
| <code>SDIO_SDIO_REV_2_00 = 3;</code>
 +
| SDIO Spec Version 2.00
 +
|-
 +
| <code>SDIO_SDIO_REV_3_00 = 4;</code>
 +
| SDIO Spec Version 3.00
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|SDIO CCCR SD Register values
 +
|-
 +
| <code>SDIO_SD_REV_1_01 = 0;</code>
 +
| SD Physical Spec Version 1.01
 +
|-
 +
| <code>SDIO_SD_REV_1_10 = 1;</code>
 +
| SD Physical Spec Version 1.10
 +
|-
 +
| <code>SDIO_SD_REV_2_00 = 2;</code>
 +
| SD Physical Spec Version 2.00
 +
|-
 +
| <code>SDIO_SD_REV_3_00 = 3;</code>
 +
| SD Physical Spev Version 3.00
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''SDIO bus width constants''' <code> SDIO_BUS_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|''SDIO CCCR IF Register values''
 +
|-
 +
| <code>SDIO_BUS_WIDTH_MASK = $03;</code>
 +
| data bus width setting
 +
|-
 +
| <code>SDIO_BUS_WIDTH_1BIT = $00;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDIO_BUS_WIDTH_RESERVED = $01;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDIO_BUS_WIDTH_4BIT = $02;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDIO_BUS_ECSI = $20;</code>
 +
| Enable continuous SPI interrupt
 +
|-
 +
| <code>SDIO_BUS_SCSI = $40;</code>
 +
| Support continuous SPI interrupt
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>SDIO_BUS_ASYNC_INT = $20;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>SDIO_BUS_CD_DISABLE = $80;</code>
 +
| disable pull-up on DAT3 (pin 1)
 +
|-
 +
|}
 +
</div></div>
 +
<br /> 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''SDIO CCCR caps register value constants''' <code> SDIO_CCCR_CAP_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>SDIO_CCCR_CAP_SDC = $01;</code>
 +
| can do CMD52 while data transfer
 +
|-
 +
| <code>SDIO_CCCR_CAP_SMB = $02;</code>
 +
| can do multi-block xfers (CMD53)
 +
|-
 +
| <code>SDIO_CCCR_CAP_SRW = $04;</code>
 +
| supports read-wait protocol
 +
|-
 +
| <code>SDIO_CCCR_CAP_SBS = $08;</code>
 +
| supports suspend/resume
 +
|-
 +
| <code>SDIO_CCCR_CAP_S4MI = $10;</code>
 +
| interrupt during 4-bit CMD53
 +
|-
 +
| <code>SDIO_CCCR_CAP_E4MI = $20;</code>
 +
| enable ints during 4-bit CMD53
 +
|-
 +
| <code>SDIO_CCCR_CAP_LSC = $40;</code>
 +
| low speed card
 +
|-
 +
| <code>SDIO_CCCR_CAP_4BLS = $80;</code>
 +
| 4 bit low speed card
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''SDIO CCCR power register value constants ''' <code> SDIO_POWER_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>SDIO_POWER_SMPC = $01;</code>
 +
| Supports Master Power Control
 +
|-
 +
| <code>SDIO_POWER_EMPC = $02;</code>
 +
| Enable Master Power Control
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''SDIO CCCR speed register value constants''' <code> SDIO_SPEED_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>SDIO_SPEED_SHS = $01;</code>
 +
| Supports High-Speed mode
 +
|-
 +
| <code>SDIO_SPEED_BSS_SHIFT = 1;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDIO_SPEED_BSS_MASK = (7 shl SDIO_SPEED_BSS_SHIFT);</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDIO_SPEED_SDR12 = (0 shl SDIO_SPEED_BSS_SHIFT);</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDIO_SPEED_SDR25 = (1 shl SDIO_SPEED_BSS_SHIFT);</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDIO_SPEED_SDR50 = (2 shl SDIO_SPEED_BSS_SHIFT);</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDIO_SPEED_SDR104 = (3 shl SDIO_SPEED_BSS_SHIFT);</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDIO_SPEED_DDR50 = (4 shl SDIO_SPEED_BSS_SHIFT);</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDIO_SPEED_EHS = SDIO_SPEED_SDR25;</code>
 +
| Enable High-Speed
 +
|-
 +
|}
 +
</div></div>
 +
<br /> 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''SDIO CCCR UHS register value constants''' <code> SDIO_UHS_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>SDIO_UHS_SDR50 = $01;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>SDIO_UHS_SDR104 = $02;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDIO_UHS_DDR50 = $04;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
<br /> 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''SDIO CCCR drive strength register value constants''' <code> SDIO_DRIVE_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>SDIO_SDTx_MASK = $07;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>SDIO_DRIVE_SDTA = (1 shl 0);</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDIO_DRIVE_SDTC = (1 shl 1);</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDIO_DRIVE_SDTD = (1 shl 2);</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDIO_DRIVE_DTSx_MASK = $03;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDIO_DRIVE_DTSx_SHIFT = 4;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDIO_DTSx_SET_TYPE_B = (0 shl SDIO_DRIVE_DTSx_SHIFT);</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDIO_DTSx_SET_TYPE_A = (1 shl SDIO_DRIVE_DTSx_SHIFT);</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDIO_DTSx_SET_TYPE_C = (2 shl SDIO_DRIVE_DTSx_SHIFT);</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDIO_DTSx_SET_TYPE_D = (3 shl SDIO_DRIVE_DTSx_SHIFT);</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''SDIO function basic register (FBR) constants''' <code> SDIO_FBR_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>SDIO_FBR_BASE(f) ((f) * $100)</code>
 +
| base of function f's FBRs
 +
|-
 +
| <code>SDIO_FBR_STD_IF = $00;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDIO_FBR_STD_IF_EXT = $01;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDIO_FBR_POWER = $02;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDIO_FBR_CIS = $09;</code>
 +
| CIS pointer (3 bytes)
 +
|-
 +
| <code>SDIO_FBR_CSA = $0C;</code>
 +
| CSA pointer (3 bytes)
 +
|-
 +
| <code>SDIO_FBR_BLKSIZE = $10;</code>
 +
| block size (2 bytes)
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|''SDIO FBR IF Register values''
 +
|-
 +
| <code>SDIO_FBR_SUPPORTS_CSA = $40;</code>
 +
| supports Code Storage Area
 +
|-
 +
| <code>SDIO_FBR_ENABLE_CSA = $80;</code>
 +
| enable Code Storage Area
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|''SDIO FBR POWER Register values''
 +
|-
 +
| <code>SDIO_FBR_POWER_SPS = $01;</code>
 +
| Supports Power Selection
 +
|-
 +
| <code>SDIO_FBR_POWER_EPS = $02;</code>
 +
| Enable (low) Power Selection
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''SDHCI specific constants''' <code> SDHCI_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>SDHCI_NAME_PREFIX = 'SDHCI';</code>
 +
| Name prefix for SDHCI Devices
 +
|-
 +
|}
 +
</div></div>
 +
<br /> 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''SDHCI host type constants''' <code> SDHCI_TYPE_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>SDHCI_TYPE_NONE = 0;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>SDHCI_TYPE_MAX = 0;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp; 
 +
|-
 +
|colspan="2"|''SDHCI Type Names''
 +
|-
 +
|colspan="2"|<code>SDHCI_TYPE_NAMES:array[SDHCI_TYPE_NONE..SDHCI_TYPE_MAX] of String = (</code>
 +
|-
 +
| <code>'SDHCI_TYPE_NONE');</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
<br /> 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''SDHCI host state constants''' <code> SDHCI_STATE_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>SDHCI_STATE_DISABLED = 0;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>SDHCI_STATE_ENABLED = 1;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>SDHCI_STATE_MAX = 1;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|''SDHCI State Names''
 +
|-
 +
|colspan="2"|<code>SDHCI_STATE_NAMES:array[SDHCI_STATE_DISABLED..SDHCI_STATE_MAX] of String = (</code>
 +
|-
 +
| <code>'SDHCI_STATE_DISABLED',</code>
 +
| &nbsp;
 +
|-
 +
| <code>'SDHCI_STATE_ENABLED');</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''SDHCI host flag constants''' <code> SDHCI_FLAG_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>SDHCI_FLAG_NONE = $00000000;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>SDHCI_FLAG_SDMA = $00000001;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_FLAG_ADMA = $00000002;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_FLAG_SPI = $00000004;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_FLAG_CRC_ENABLE = $00000008;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''SDHCI controller register constants''' <code> SDHCI_DMA_*, SDHCI_BLOCK_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>SDHCI_DMA_ADDRESS = $00;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>SDHCI_BLOCK_SIZE = $04;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_BLOCK_COUNT = $06;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_ARGUMENT = $08;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_TRANSFER_MODE = $0C;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_COMMAND = $0E;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_RESPONSE = $10;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_BUFFER = $20;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_PRESENT_STATE = $24;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_HOST_CONTROL = $28;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_POWER_CONTROL = $29;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_BLOCK_GAP_CONTROL = $2A;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_WAKE_UP_CONTROL = $2B;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_CLOCK_CONTROL = $2C;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_TIMEOUT_CONTROL = $2E;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_SOFTWARE_RESET = $2F;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_INT_STATUS = $30;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_INT_ENABLE = $34;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_SIGNAL_ENABLE = $38;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_ACMD12_ERR = $3C;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|''3E-3F reserved''
 +
|-
 +
| <code>SDHCI_CAPABILITIES = $40;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_CAPABILITIES_1 = $44;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_MAX_CURRENT = $48;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|''4C-4F reserved for more max current''
 +
|-
 +
| <code>SDHCI_SET_ACMD12_ERROR = $50;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_SET_INT_ERROR = $52;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_ADMA_ERROR = $54;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|''55-57 reserved''
 +
|-
 +
| <code>SDHCI_ADMA_ADDRESS = $58;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|''60-FB reserved''
 +
|-
 +
| <code>SDHCI_SLOT_INT_STATUS = $FC;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_HOST_VERSION = $FE;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
<br /> 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''SDHCI transfer mode constants''' <code> SDHCI_TRNS_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>SDHCI_TRNS_DMA = $01;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_TRNS_BLK_CNT_EN = $02;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_TRNS_AUTO_CMD12 = $04;</code>
 +
| SDHCI_TRNS_ACMD12
 +
|-
 +
| <code>SDHCI_TRNS_AUTO_CMD23 = $08;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_TRNS_READ = $10;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_TRNS_MULTI = $20;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''SDHCI command value constants''' <code> SDHCI_CMD_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>SDHCI_CMD_RESP_MASK = $03;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>SDHCI_CMD_CRC = $08;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_CMD_INDEX = $10;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_CMD_DATA = $20;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_CMD_ABORTCMD = $C0;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''SDHCI command response value constants''' <code> SDHCI_CMD_RESP_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>SDHCI_CMD_RESP_NONE = $00;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>SDHCI_CMD_RESP_LONG = $01;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_CMD_RESP_SHORT = $02;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_CMD_RESP_SHORT_BUSY = $03;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
<br /> 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''SDHCI present state value constants''' <code> SDHCI_DATA_*, SDHCI_CARD_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>SDHCI_CMD_INHIBIT = $00000001;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_DATA_INHIBIT = $00000002;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_DOING_WRITE = $00000100;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_DOING_READ = $00000200;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_SPACE_AVAILABLE = $00000400;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_DATA_AVAILABLE = $00000800;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_CARD_PRESENT = $00010000;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_CARD_STATE_STABLE = $00020000;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_CARD_DETECT_PIN_LEVEL = $00040000;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_WRITE_PROTECT = $00080000;</code>
 +
| Set if Write Enabled / Clear if Write Protected
 +
|-
 +
|}
 +
</div></div>
 +
<br /> 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''SDHCI host control value constants''' <code> SDHCI_CTRL_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>SDHCI_CTRL_LED = $01;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>SDHCI_CTRL_4BITBUS = $02;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_CTRL_HISPD = $04;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_CTRL_DMA_MASK = $18;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_CTRL_SDMA = $00;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_CTRL_ADMA1 = $08;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_CTRL_ADMA32 = $10;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_CTRL_ADMA64 = $18;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_CTRL_8BITBUS = $20;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_CTRL_CD_TEST_INS = $40;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_CTRL_CD_TEST = $80;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
<br /> 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''SDHCI power control value constants''' <code> SDHCI_POWER_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>SDHCI_POWER_ON = $01;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>SDHCI_POWER_180 = $0A;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_POWER_300 = $0C;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_POWER_330 = $0E;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
<br /> 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''SDHCI wakeup control value constants''' <code> SDHCI_WAKE_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>SDHCI_WAKE_ON_INT = $01;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>SDHCI_WAKE_ON_INSERT = $02;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_WAKE_ON_REMOVE = $04;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''SDHCI clock control value constants''' <code> SDHCI_CLOCK_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>SDHCI_DIVIDER_SHIFT = 8;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>SDHCI_DIVIDER_HI_SHIFT = 6;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_DIV_MASK = $FF;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_DIV_MASK_LEN = 8;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_DIV_HI_MASK = $0300;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_CLOCK_CARD_EN = $0004;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_CLOCK_INT_STABLE = $0002;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_CLOCK_INT_EN = $0001;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
<br /> 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''SDHCI software reset value constants''' <code> SDHCI_RESET_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>SDHCI_RESET_ALL = $01;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>SDHCI_RESET_CMD = $02;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_RESET_DATA = $04;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
<br /> 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''SDHCI interrupt value constants''' <code> SDHCI_INT_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>SDHCI_INT_RESPONSE = $00000001;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>SDHCI_INT_DATA_END = $00000002;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_INT_BLK_GAP = $00000004;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_INT_DMA_END = $00000008;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_INT_SPACE_AVAIL = $00000010;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_INT_DATA_AVAIL = $00000020;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_INT_CARD_INSERT = $00000040;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_INT_CARD_REMOVE = $00000080;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_INT_CARD_INT = $00000100;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_INT_ERROR = $00008000;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_INT_TIMEOUT = $00010000;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_INT_CRC = $00020000;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_INT_END_BIT = $00040000;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_INT_INDEX = $00080000;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_INT_DATA_TIMEOUT = $00100000;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_INT_DATA_CRC = $00200000;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_INT_DATA_END_BIT = $00400000;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_INT_BUS_POWER = $00800000;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_INT_ACMD12ERR = $01000000;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_INT_ADMA_ERROR = $02000000;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>SDHCI_INT_NORMAL_MASK = $00007FFF;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_INT_ERROR_MASK = $FFFF8000;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|<code>SDHCI_INT_CMD_MASK = (SDHCI_INT_RESPONSE or SDHCI_INT_TIMEOUT or SDHCI_INT_CRC or SDHCI_INT_END_BIT or SDHCI_INT_INDEX);</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_INT_DATA_MASK = (SDHCI_INT_DATA_END or SDHCI_INT_DMA_END or SDHCI_INT_DATA_AVAIL or SDHCI_INT_SPACE_AVAIL or SDHCI_INT_DATA_TIMEOUT or SDHCI_INT_DATA_CRC or SDHCI_INT_DATA_END_BIT or  SDHCI_INT_ADMA_ERROR or SDHCI_INT_BLK_GAP);</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_INT_ALL_MASK = (LongWord(-1));</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
<br /> 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''SDHCI capabilities value constants''' <code> SDHCI_*_MASK*, SDHCI_*SHIFT </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>SDHCI_TIMEOUT_CLK_MASK = $0000003F;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>SDHCI_TIMEOUT_CLK_SHIFT = 0;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_TIMEOUT_CLK_UNIT = $00000080;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_CLOCK_BASE_MASK = $00003F00;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_CLOCK_V3_BASE_MASK = $0000FF00;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_CLOCK_BASE_SHIFT = 8;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_CLOCK_BASE_MULTIPLIER = 1000000;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_MAX_BLOCK_MASK = $00030000;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_MAX_BLOCK_SHIFT = 16;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_CAN_DO_8BIT = $00040000;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_CAN_DO_ADMA2 = $00080000;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_CAN_DO_ADMA1 = $00100000;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_CAN_DO_HISPD = $00200000;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_CAN_DO_SDMA = $00400000;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_CAN_VDD_330 = $01000000;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_CAN_VDD_300 = $02000000;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_CAN_VDD_180 = $04000000;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_CAN_64BIT = $10000000;</code>
 +
| &nbsp;
 +
|-
 +
| <code>NAME_</code>
 +
| &nbsp;
 +
|-
 +
| <code>NAME_</code>
 +
| &nbsp;
 +
|-
 +
| <code>NAME_</code>
 +
| &nbsp;
 +
|-
 +
| <code>NAME_</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
<br /> 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''SDHCI host version value constants''' <code> SDHCI_*_VER_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>SDHCI_VENDOR_VER_MASK = $FF00;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>SDHCI_VENDOR_VER_SHIFT = 8;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_SPEC_VER_MASK = $00FF;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_SPEC_VER_SHIFT = 0;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_SPEC_100 = 0;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_SPEC_200 = 1;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_SPEC_300 = 2;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
<br /> 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''SDHCI clock divider constants''' <code> SDHCI_MAX_CLOCK_DIV_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>SDHCI_MAX_CLOCK_DIV_SPEC_200 = 256;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>SDHCI_MAX_CLOCK_DIV_SPEC_300 = 2046;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
<br /> 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''SDHCI quirks/bug constants''' <code> SDHCI_QUIRK* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|From: U-Boot sdhci.h
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>*SDHCI_QUIRK_32BIT_DMA_ADDR = (1 shl 0);</code>
 +
| See: SDHCI_QUIRK_32BIT_DMA_ADDR below
 +
|-
 +
| <code>SDHCI_QUIRK_REG32_RW = (1 shl 1);</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_QUIRK_BROKEN_R1B = (1 shl 2);</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_QUIRK_NO_HISPD_BIT = (1 shl 3);</code>
 +
| See: SDHCI_QUIRK_NO_HISPD_BIT below
 +
|-
 +
| <code>SDHCI_QUIRK_BROKEN_VOLTAGE = (1 shl 4);</code>
 +
| Use SDHCI_QUIRK_MISSING_CAPS instead
 +
|-
 +
| <code>SDHCI_QUIRK_NO_CD = (1 shl 5);</code>
 +
| See: SDHCI_QUIRK_BROKEN_CARD_DETECTION below
 +
|-
 +
| <code>SDHCI_QUIRK_WAIT_SEND_CMD = (1 shl 6);</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_QUIRK_NO_SIMULT_VDD_AND_POWER = (1 shl 7);</code>
 +
| See: SDHCI_QUIRK_NO_SIMULT_VDD_AND_POWER below
 +
|-
 +
| <code>SDHCI_QUIRK_USE_WIDE8 = (1 shl 8);</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_QUIRK_MISSING_CAPS = (1 shl 9);</code>
 +
| See: SDHCI_QUIRK_MISSING_CAPS below*
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|From Linux /include/linux/mmc/sdhci.h
 +
|-
 +
| <code>SDHCI_QUIRK_CLOCK_BEFORE_RESET = (1 shl 0);</code>
 +
| Controller doesn't honor resets unless we touch the clock register
 +
|-
 +
| <code>SDHCI_QUIRK_FORCE_DMA = (1 shl 1);</code>
 +
| Controller has bad caps bits, but really supports DMA
 +
|-
 +
| <code>SDHCI_QUIRK_NO_CARD_NO_RESET = (1 shl 2);</code>
 +
| Controller doesn't like to be reset when there is no card inserted
 +
|-
 +
| <code>SDHCI_QUIRK_SINGLE_POWER_WRITE = (1 shl 3);</code>
 +
| Controller doesn't like clearing the power reg before a change
 +
|-
 +
| <code>SDHCI_QUIRK_RESET_CMD_DATA_ON_IOS = (1 shl 4);/code>
 +
| Controller has flaky internal state so reset it on each ios change}
 +
|-
 +
| <code>SDHCI_QUIRK_BROKEN_DMA = (1 shl 5);</code>
 +
| Controller has an unusable DMA engine
 +
|-
 +
| <code>SDHCI_QUIRK_BROKEN_ADMA = (1 shl 6);</code>
 +
| Controller has an unusable ADMA engine
 +
|-
 +
| <code>SDHCI_QUIRK_32BIT_DMA_ADDR = (1 shl 7);</code>
 +
| Controller can only DMA from 32-bit aligned addresses
 +
|-
 +
| <code>SDHCI_QUIRK_32BIT_DMA_SIZE = (1 shl 8);</code>
 +
| Controller can only DMA chunk sizes that are a multiple of 32 bits
 +
|-
 +
| <code>SDHCI_QUIRK_32BIT_ADMA_SIZE = (1 shl 9);</code>
 +
| Controller can only ADMA chunks that are a multiple of 32 bits
 +
|-
 +
| <code>SDHCI_QUIRK_RESET_AFTER_REQUEST = (1 shl 10);</code>
 +
| Controller needs to be reset after each request to stay stable
 +
|-
 +
| <code>SDHCI_QUIRK_NO_SIMULT_VDD_AND_POWER = (1 shl 11);</code>
 +
| Controller needs voltage and power writes to happen separately
 +
|-
 +
| <code>SDHCI_QUIRK_BROKEN_TIMEOUT_VAL = (1 shl 12);</code>
 +
| Controller provides an incorrect timeout value for transfers
 +
|-
 +
| <code>SDHCI_QUIRK_BROKEN_SMALL_PIO = (1 shl 13);</code>
 +
| Controller has an issue with buffer bits for small transfers
 +
|-
 +
| <code>SDHCI_QUIRK_NO_BUSY_IRQ = (1 shl 14);</code>
 +
| Controller does not provide transfer-complete interrupt when not busy
 +
|-
 +
| <code>SDHCI_QUIRK_BROKEN_CARD_DETECTION = (1 shl 15);</code>
 +
| Controller has unreliable card detection
 +
|-
 +
| <code>SDHCI_QUIRK_INVERTED_WRITE_PROTECT = (1 shl 16);</code>
 +
| Controller reports inverted write-protect state
 +
|-
 +
| <code>SDHCI_QUIRK_PIO_NEEDS_DELAY = (1 shl 18);</code>
 +
| Controller does not like fast PIO transfers
 +
|-
 +
| <code>SDHCI_QUIRK_FORCE_BLK_SZ_2048 = (1 shl 20);</code>
 +
| Controller has to be forced to use block size of 2048 bytes
 +
|-
 +
| <code>SDHCI_QUIRK_NO_MULTIBLOCK = (1 shl 21);</code>
 +
| Controller cannot do multi-block transfers
 +
|-
 +
| <code>SDHCI_QUIRK_FORCE_1_BIT_DATA = (1 shl 22);</code>
 +
| Controller can only handle 1-bit data transfers
 +
|-
 +
| <code>SDHCI_QUIRK_DELAY_AFTER_POWER = (1 shl 23);</code>
 +
| Controller needs 10ms delay between applying power and clock
 +
|-
 +
| <code>SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK = (1 shl 24);</code>
 +
| Controller uses SDCLK instead of TMCLK for data timeouts
 +
|-
 +
| <code>SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN = (1 shl 25);</code>
 +
| Controller reports wrong base clock capability
 +
|-
 +
| <code>SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC = (1 shl 26);</code>
 +
| Controller cannot support End Attribute in NOP ADMA descriptor
 +
|-
 +
| <code>SDHCI_QUIRK_MISSING_CAPS = (1 shl 27);</code>
 +
| Controller is missing device caps. Use caps provided by host
 +
|-
 +
| <code>SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12 = (1 shl 28);</code>
 +
| Controller uses Auto CMD12 command to stop the transfer
 +
|-
 +
| <code>SDHCI_QUIRK_NO_HISPD_BIT = (1 shl 29);</code>
 +
| Controller doesn't have HISPD bit field in HI-SPEED SD card
 +
|-
 +
| <code>SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC = (1 shl 30);</code>
 +
| Controller treats ADMA descriptors with length 0000h incorrectly
 +
|-
 +
| <code>SDHCI_QUIRK_UNSTABLE_RO_DETECT = (1 shl 31);</code>
 +
| The read-only detection via SDHCI_PRESENT_STATE register is unstable
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|''SDHCI More Quirks/Bugs''
 +
|-
 +
|colspan="2"|From Linux /include/linux/mmc/sdhci.h
 +
|-
 +
| <code>SDHCI_QUIRK2_HOST_OFF_CARD_ON = (1 shl 0);</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_QUIRK2_HOST_NO_CMD23 = (1 shl 1);</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_QUIRK2_NO_1_8_V = (1 shl 2);</code>
 +
| The system physically doesn't support 1.8v, even if the host does
 +
|-
 +
| <code>SDHCI_QUIRK2_PRESET_VALUE_BROKEN = (1 shl 3);</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_QUIRK2_CARD_ON_NEEDS_BUS_ON = (1 shl 4);</code>
 +
| &nbsp;
 +
|-
 +
| <code>SDHCI_QUIRK2_BROKEN_HOST_CONTROL = (1 shl 5);</code>
 +
| Controller has a non-standard host control register
 +
|-
 +
| <code>SDHCI_QUIRK2_BROKEN_HS200 = (1 shl 6);</code>
 +
| Controller does not support HS200
 +
|-
 +
| <code>SDHCI_QUIRK2_BROKEN_DDR50 = (1 shl 7);</code>
 +
| Controller does not support DDR50
 +
|-
 +
| <code>SDHCI_QUIRK2_STOP_WITH_TC = (1 shl 8);</code>
 +
| Stop command(CMD12) can set Transfer Complete when not using MMC_RSP_BUSY
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|''Additions from U-Boot''
 +
|-
 +
| <code>SDHCI_QUIRK2_REG32_RW = (1 shl 28);</code>
 +
| Controller requires all register reads and writes as 32bit
 +
|-
 +
| <code>SDHCI_QUIRK2_BROKEN_R1B = (1 shl 29);</code>
 +
| Response type R1B is broken
 +
|-
 +
| <code>SDHCI_QUIRK2_WAIT_SEND_CMD = (1 shl 30);</code>
 +
| Controller requires a delay between each command write
 +
|-
 +
| <code>SDHCI_QUIRK2_USE_WIDE8 = (1 shl 31);</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''SDHCI host SDMA buffer boundary constants''' <code> SDHCI_DEFAULT_BOUNDARY_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|Valid values from 4K to 512K in powers of 2
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>SDHCI_DEFAULT_BOUNDARY_SIZE = (512 * 1024);</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>SDHCI_DEFAULT_BOUNDARY_ARG = (7);</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
<br /> 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''SDHCI timeout value constants''' <code> SDHCI_TIMEOUT_VALUE* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>SDHCI_TIMEOUT_VALUE = $0E;</code>
 +
| style="width: 50%;"|&nbsp;
 
|-
 
|-
 
|}
 
|}

Revision as of 02:27, 3 January 2017

Return to Unit Reference


Description


Ultibo MMC/SD interface unit

This unit implements the standards based part of the SD/MMC specification including the standard SDHCI interfaces.

For each platform a SDHCI module needs to be provided that implements the platform specific parts of the SDHCI interface.

This is similar in model to USB and other interfaces in Ultibo, where the generic interface unit requires a platform specific module to register with it in order to communicate with platform specific devices.

The SD/MMC interfaces are 2 tier (ie Host and Device) whereas the USB interface is 3 tier (Host, Device and Driver).

Constants



[Expand]
MMC specific constants MMC_*


[Expand]
MMC device type constants MMC_TYPE_*


[Expand]
MMC device state constants MMC_STATE_*


[Expand]
MMC device flag constants MMC_FLAG_*


[Expand]
MMC/SD status code constants MMC_STATUS_*


[Expand]
MMC/SD version constants SD_VERSION_*, MMC_VERSION_*


[Expand]
MMC/SD mode constants MMC_MODE_*


[Expand]
MMC/SD direction constants MMC_DATA_*


[Expand]
MMC/SD bus width constants MMC_BUS_WIDTH_*


[Expand]
MMC bus speed (Hz) constants MMC_BUS_SPEED_*


[Expand]
MMC command constants MMC_CMD_*


[Expand]
MMC response type constants MMC_RSP_*


[Expand]
MMC response value constants MMC_RSP_R1_*, MMC_RSP_R2_*


[Expand]
MMC operation condition register (OCR) value constants MMC_OCR_*


[Expand]
MMC card status register (CSR) value constants MMC_CARD_STATUS_*


[Expand]
MMC current state value constants MMC_CURRENT_STATE_*


[Expand]
MMC card identification data (CID) value constants MMC_CID_*


[Expand]
MMC card specific data (CSD) value constants MMC_CSD_*


[Expand]
MMC CSD structure value constants MMC_CSD_STRUCT_*


[Expand]
MMC CSD spec version value constants MMC_CSD_SPEC_VER_*


[Expand]
MMC CSD TAAC time unit constants MMC_CSD_TAAC_UNITS*


[Expand]
MMC CSD TAAC time value constants MMC_CSD_TAAC_VALUES*


[Expand]
MMC CSD card command class (CCC) value constants MMC_CCC_*


[Expand]
MMC CSD transfer speed rate unit constants MMC_CSD_TRAN_SPEED_UNITS*


[Expand]
MMC CSD transfer speed time value constants MMC_CSD_TRAN_SPEED_VALUES*


[Expand]
MMC voltage value constants MMC_VDD_*


[Expand]
MMC switch mode value constants MMC_SWITCH_MODE_*


[Expand]
MMC EXT_CSD field constants EXT_CSD_*


[Expand]
MMC EXT_CSD field definition constants EXT_CSD_*


[Expand]
MMC Misc constants MMCPART_*, MMC_MAX_*


[Expand]
MMC logging constants MMC_LOG_*


[Expand]
SD specific constants SD_*


[Expand]
SD bus width constants SD_BUS_WIDTH_*


[Expand]
SD bus speed (Hz) constants SD_BUS_SPEED_*


[Expand]
SD command constants SD_CMD_*


[Expand]
SD switch mode value constants SD_SWITCH_MODE_*


[Expand]
SD switch function group constants SD_SWITCH_FUNCTION_GROUP_*


[Expand]
SD switch access mode constants SD_SWITCH_ACCESS_MODE_*


[Expand]
SD switch command system constants SD_SWITCH_COMMAND_SYSTEM_*


[Expand]
SD switch driver strength constants SD_SWITCH_DRIVER_STRENGTH_*


[Expand]
SD switch power limit constants SD_SWITCH_POWER_LIMIT_*


[Expand]
SD send interface condition value constants SD_SEND_IF_COND_*


[Expand]
SD send operation condition value constants SD_SEND_OP_COND_*


[Expand]
SD operation condition register value constants SD_OCR_*


[Expand]
SD CSD structure value constants SD_CSD_STRUCT_*


[Expand]
SD SD status register (SSR) value constants SD_SSR_*


[Expand]
SD SSR bus width value constants SD_SSR_BUS_WIDTH_*


[Expand]
SD SSR card type value constants SD_SSR_CARD_TYPE_*


[Expand]
SD SSR speed class value constants SD_SSR_SPEED_CLASS_*


[Expand]
SD SSR AU size value constants SD_SSR_AU_SIZE_*


[Expand]
SD SSR UHS speed grade value constants SD_SSR_UHS_SPEED_*


[Expand]
SD SSR UHS AU size value constants SD_SSR_UHS_AU_SIZE_*


[Expand]
SD switch status value constants SD_SWITCH_*


[Expand]
SD SD configuration register (SCR) value constants SD_SCR_*


[Expand]
SD SCR structure value constants SD_SCR_STRUCT_*


[Expand]
SD SCR Spec version value constants SD_SCR_SPEC_VER_*


[Expand]
SD SCR security value constants SD_SCR_SECURITY_*


[Expand]
SD SCR bus width value constants SD_SCR_BUS_WIDTH_*


[Expand]
SD SCR extended security value constants SD_SCR_EX_SECURITY_*


[Expand]
SD SCR command support value constants SD_SCR_*_SUPPORT


[Expand]
SDIO command constants SDIO_CMD_*


[Expand]
SDIO response value constants SDIO_RSP_*


[Expand]
SDIO card common control registers (CCCR) constants SDIO_CCCR_*


[Expand]
SDIO revision constants SDIO_*_REV_*


[Expand]
SDIO bus width constants SDIO_BUS_*


[Expand]
SDIO CCCR caps register value constants SDIO_CCCR_CAP_*


[Expand]
SDIO CCCR power register value constants SDIO_POWER_*


[Expand]
SDIO CCCR speed register value constants SDIO_SPEED_*


[Expand]
SDIO CCCR UHS register value constants SDIO_UHS_*


[Expand]
SDIO CCCR drive strength register value constants SDIO_DRIVE_*


[Expand]
SDIO function basic register (FBR) constants SDIO_FBR_*


[Expand]
SDHCI specific constants SDHCI_*


[Expand]
SDHCI host type constants SDHCI_TYPE_*


[Expand]
SDHCI host state constants SDHCI_STATE_*


[Expand]
SDHCI host flag constants SDHCI_FLAG_*


[Expand]
SDHCI controller register constants SDHCI_DMA_*, SDHCI_BLOCK_*


[Expand]
SDHCI transfer mode constants SDHCI_TRNS_*


[Expand]
SDHCI command value constants SDHCI_CMD_*


[Expand]
SDHCI command response value constants SDHCI_CMD_RESP_*


[Expand]
SDHCI present state value constants SDHCI_DATA_*, SDHCI_CARD_*


[Expand]
SDHCI host control value constants SDHCI_CTRL_*


[Expand]
SDHCI power control value constants SDHCI_POWER_*


[Expand]
SDHCI wakeup control value constants SDHCI_WAKE_*


[Expand]
SDHCI clock control value constants SDHCI_CLOCK_*


[Expand]
SDHCI software reset value constants SDHCI_RESET_*


[Expand]
SDHCI interrupt value constants SDHCI_INT_*


[Expand]
SDHCI capabilities value constants SDHCI_*_MASK*, SDHCI_*SHIFT


[Expand]
SDHCI host version value constants SDHCI_*_VER_*


[Expand]
SDHCI clock divider constants SDHCI_MAX_CLOCK_DIV_*


[Expand]
SDHCI quirks/bug constants SDHCI_QUIRK*


[Expand]
SDHCI host SDMA buffer boundary constants SDHCI_DEFAULT_BOUNDARY_*


[Expand]
SDHCI timeout value constants SDHCI_TIMEOUT_VALUE*


Type definitions


To be documented

Public variables


To be documented

Function declarations



Initialization functions

[Expand]
procedure MMCInit;
Description: To be documented


[Expand]
function MMCStart:LongWord;
Description: To be documented


[Expand]
function MMCStop:LongWord;
Description: To be documented


[Expand]
procedure MMCAsyncStart(SDHCI:PSDHCIHost);
Description: To be documented


MMC functions

[Expand]
function MMCDeviceReadBlocks(MMC:PMMCDevice; const Start,Count:Int64; Buffer:Pointer):LongWord;
Description: To be documented


[Expand]
function MMCDeviceWriteBlocks(MMC:PMMCDevice; const Start,Count:Int64; Buffer:Pointer):LongWord;
Description: To be documented


[Expand]
function MMCDeviceEraseBlocks(MMC:PMMCDevice; const Start,Count:Int64):LongWord;
Description: To be documented


[Expand]
function MMCDeviceGoIdle(MMC:PMMCDevice):LongWord;
Description: To be documented


[Expand]
function MMCDeviceSetClock(MMC:PMMCDevice; Clock:LongWord):LongWord;
Description: To be documented


[Expand]
function MMCDeviceSetBusWidth(MMC:PMMCDevice; Width:LongWord):LongWord;
Description: To be documented


[Expand]
function MMCDeviceSetBlockLength(MMC:PMMCDevice; Length:LongWord):LongWord;
Description: To be documented


[Expand]
function MMCDeviceSetBlockCount(MMC:PMMCDevice; Count:LongWord; Relative:Boolean):LongWord;
Description: To be documented


[Expand]
function MMCDeviceSetDriverStage(MMC:PMMCDevice; DriverStage:LongWord):LongWord;
Description: To be documented


[Expand]
function MMCDeviceSelectCard(MMC:PMMCDevice):LongWord;
Description: To be documented


[Expand]
function MMCDeviceDeselectCard(MMC:PMMCDevice):LongWord;
Description: To be documented


[Expand]
function MMCDeviceSwitch(MMC:PMMCDevice; Setting,Index,Value:Byte):LongWord;
Description: To be documented


[Expand]
function MMCDeviceSendCardStatus(MMC:PMMCDevice):LongWord;
Description: To be documented


[Expand]
function MMCDeviceSendOperationCondition(MMC:PMMCDevice; Probe:Boolean):LongWord;
Description: To be documented


[Expand]
function MMCDeviceSendCardSpecific(MMC:PMMCDevice):LongWord;
Description: To be documented


[Expand]
function MMCDeviceDecodeCardSpecific(MMC:PMMCDevice):LongWord;
Description: Given a 128-bit response, decode to our card CSD structure


[Expand]
function MMCDeviceSendCardIdentification(MMC:PMMCDevice):LongWord;
Description: To be documented


[Expand]
function MMCDeviceSendAllCardIdentification(MMC:PMMCDevice):LongWord;
Description: To be documented


[Expand]
function MMCDeviceDecodeCardIdentification(MMC:PMMCDevice):LongWord;
Description: Given a 128-bit response, decode to our card CID structure


[Expand]
function MMCDeviceGetExtendedCardSpecific(MMC:PMMCDevice):LongWord;
Description: To be documented


[Expand]
function MMCDeviceSendExtendedCardSpecific(MMC:PMMCDevice):LongWord;
Description: To be documented


[Expand]
function MMCDeviceDecodeExtendedCardSpecific(MMC:PMMCDevice):LongWord;
Description: To be documented


[Expand]
function MMCDeviceSetRelativeAddress(MMC:PMMCDevice):LongWord;
Description: To be documented


[Expand]
function MMCDeviceSPISetCRC(MMC:PMMCDevice; Enable:Boolean):LongWord;
Description: To be documented


[Expand]
function MMCDeviceSPIReadOperationCondition(MMC:PMMCDevice; HighCapacity:Boolean):LongWord;
Description: To be documented


[Expand]
function MMCDeviceInsert(MMC:PMMCDevice):LongWord;
Description: To be documented


[Expand]
function MMCDeviceRemove(MMC:PMMCDevice):LongWord;
Description: To be documented


[Expand]
function MMCDeviceInitialize(MMC:PMMCDevice):LongWord;
Description: To be documented


[Expand]
function MMCDeviceDeinitialize(MMC:PMMCDevice):LongWord;
Description: To be documented


[Expand]
function MMCDeviceGetCardDetect(MMC:PMMCDevice):LongWord;
Description: To be documented


[Expand]
function MMCDeviceGetWriteProtect(MMC:PMMCDevice):LongWord;
Description: To be documented


[Expand]
function MMCDeviceSendCommand(MMC:PMMCDevice; Command:PMMCCommand):LongWord;
Description: To be documented


[Expand]
function MMCDeviceSetIOS(MMC:PMMCDevice):LongWord;
Description: To be documented


[Expand]
function MMCDeviceCreate:PMMCDevice;
Description: Create a new MMC entry


[Expand]
function MMCDeviceCreateEx(Size:LongWord):PMMCDevice;
Description: Create a new MMC entry


[Expand]
function MMCDeviceDestroy(MMC:PMMCDevice):LongWord;
Description: Destroy an existing MMC entry


[Expand]
function MMCDeviceRegister(MMC:PMMCDevice):LongWord;
Description: Register a new MMC in the MMC table


[Expand]
function MMCDeviceDeregister(MMC:PMMCDevice):LongWord;
Description: Deregister a MMC from the MMC table


[Expand]
function MMCDeviceFind(MMCId:LongWord):PMMCDevice;
Description: To be documented


[Expand]
function MMCDeviceFindByName(const Name:String):PMMCDevice; inline;
Description: To be documented


[Expand]
function MMCDeviceFindByDescription(const Description:String):PMMCDevice; inline;
Description: To be documented


[Expand]
function MMCDeviceEnumerate(Callback:TMMCEnumerate; Data:Pointer):LongWord;
Description: To be documented


[Expand]
function MMCDeviceNotification(MMC:PMMCDevice; Callback:TMMCNotification; Data:Pointer; Notification,Flags:LongWord):LongWord;
Description: To be documented


SD functions

[Expand]
function SDDeviceSwitch(MMC:PMMCDevice; Mode,Group:Integer; Value:Byte; Buffer:Pointer):LongWord;
Description: To be documented


[Expand]
function SDDeviceSwitchHighspeed(MMC:PMMCDevice):LongWord;
Description: To be documented


[Expand]
function SDDeviceSetBusSpeed(MMC:PMMCDevice; Speed:LongWord):LongWord;
Description: To be documented


[Expand]
function SDDeviceSetBusWidth(MMC:PMMCDevice; Width:LongWord):LongWord;
Description: To be documented


[Expand]
function SDDeviceSendInterfaceCondition(MMC:PMMCDevice):LongWord;
Description: To be documented


[Expand]
function SDDeviceSendOperationCondition(MMC:PMMCDevice; Probe:Boolean):LongWord;
Description: To be documented


[Expand]
function SDDeviceGetCardSpecific(MMC:PMMCDevice):LongWord;
Description: To be documented


[Expand]
function SDDeviceDecodeCardSpecific(MMC:PMMCDevice):LongWord;
Description: Given a 128-bit response, decode to our card CSD structure


[Expand]
function SDDeviceGetCardIdentification(MMC:PMMCDevice):LongWord;
Description: To be documented


[Expand]
function SDDeviceDecodeCardIdentification(MMC:PMMCDevice):LongWord;
Description: Given a 128-bit response, decode to our card CID structure


[Expand]
function SDDeviceSendSDStatus(MMC:PMMCDevice):LongWord;
Description: To be documented


[Expand]
function SDDeviceDecodeSDStatus(MMC:PMMCDevice):LongWord;
Description: To be documented


[Expand]
function SDDeviceSendSDSwitch(MMC:PMMCDevice):LongWord;
Description: To be documented


[Expand]
function SDDeviceDecodeSDSwitch(MMC:PMMCDevice):LongWord;
Description: To be documented


[Expand]
function SDDeviceSendSDConfiguration(MMC:PMMCDevice):LongWord;
Description: To be documented


[Expand]
function SDDeviceDecodeSDConfiguration(MMC:PMMCDevice):LongWord;
Description: Given a 64-bit response, decode to our card SCR structure


[Expand]
function SDDeviceSendRelativeAddress(MMC:PMMCDevice):LongWord;
Description: To be documented


[Expand]
function SDDeviceSendApplicationCommand(MMC:PMMCDevice; Command:PMMCCommand):LongWord;
Description: To be documented


SDIO functions

[Expand]
function SDIODeviceReset(MMC:PMMCDevice):LongWord;
Description: To be documented


[Expand]
function SDIODeviceSendOperationCondition(MMC:PMMCDevice; Probe:Boolean):LongWord;
Description: To be documented


[Expand]
function SDIODeviceReadWriteDirect(MMC:PMMCDevice; Write:Boolean; Operation,Address:LongWord; Input:Byte; Output:PByte):LongWord;
Description: To be documented


[Expand]
function SDIODeviceReadWriteExtended(MMC:PMMCDevice; Write:Boolean; Operation,Address:LongWord; Increment:Boolean; Buffer:Pointer; BlockCount,BlockSize:LongWord):LongWord;
Description: To be documented


SDHCI functions

[Expand]
function SDHCIHostReset(SDHCI:PSDHCIHost; Mask:Byte):LongWord;
Description: To be documented


[Expand]
function SDHCIHostSetPower(SDHCI:PSDHCIHost; Power:Word):LongWord;
Description: To be documented


[Expand]
function SDHCIHostSetClock(SDHCI:PSDHCIHost; Clock:LongWord):LongWord;
Description: To be documented


[Expand]
function SDHCIHostTransferPIO(SDHCI:PSDHCIHost):LongWord;
Description: To be documented


[Expand]
function SDHCIHostTransferDMA(SDHCI:PSDHCIHost):LongWord;
Description: To be documented


[Expand]
function SDHCIHostFinishCommand(SDHCI:PSDHCIHost):LongWord;
Description: Called by Interrupt Command handler when an SDHCI_INT_RESPONSE is received


[Expand]
function SDHCIHostFinishData(SDHCI:PSDHCIHost):LongWord;
Description: Called by Interrupt Data handler when data is received


[Expand]
function SDHCIHostCommandInterrupt(SDHCI:PSDHCIHost; InterruptMask:LongWord; var ReturnMask:LongWord):LongWord;
Description: To be documented


[Expand]
function SDHCIHostDataInterrupt(SDHCI:PSDHCIHost; InterruptMask:LongWord):LongWord;
Description: To be documented


[Expand]
function SDHCIHostStart(SDHCI:PSDHCIHost):LongWord;
Description: To be documented


[Expand]
function SDHCIHostStop(SDHCI:PSDHCIHost):LongWord;
Description: To be documented


[Expand]
function SDHCIHostReadByte(SDHCI:PSDHCIHost; Reg:LongWord):Byte; inline;
Description: To be documented


[Expand]
function SDHCIHostReadWord(SDHCI:PSDHCIHost; Reg:LongWord):Word; inline;
Description: To be documented


[Expand]
function SDHCIHostReadLong(SDHCI:PSDHCIHost; Reg:LongWord):LongWord; inline;
Description: To be documented


[Expand]
procedure SDHCIHostWriteByte(SDHCI:PSDHCIHost; Reg:LongWord; Value:Byte); inline;
Description: To be documented


[Expand]
procedure SDHCIHostWriteWord(SDHCI:PSDHCIHost; Reg:LongWord; Value:Word); inline;
Description: To be documented


[Expand]
procedure SDHCIHostWriteLong(SDHCI:PSDHCIHost; Reg:LongWord; Value:LongWord); inline;
Description: To be documented


[Expand]
function SDHCIHostSetClockDivider(SDHCI:PSDHCIHost; Index:Integer; Divider:LongWord):LongWord;
Description: To be documented


[Expand]
function SDHCIHostSetControlRegister(SDHCI:PSDHCIHost):LongWord;
Description: To be documented


[Expand]
function SDHCIHostCreate:PSDHCIHost;
Description: Create a new SDHCI entry


[Expand]
function SDHCIHostCreateEx(Size:LongWord):PSDHCIHost;
Description: Create a new SDHCI entry


[Expand]
function SDHCIHostDestroy(SDHCI:PSDHCIHost):LongWord;
Description: Destroy an existing SDHCI entry


[Expand]
function SDHCIHostRegister(SDHCI:PSDHCIHost):LongWord;
Description: Register a new SDHCI in the SDHCI table


[Expand]
function SDHCIHostDeregister(SDHCI:PSDHCIHost):LongWord;
Description: Deregister a SDHCI from the SDHCI table


[Expand]
function SDHCIHostFind(SDHCIId:LongWord):PSDHCIHost;
Description: To be documented


[Expand]
function SDHCIHostEnumerate(Callback:TSDHCIEnumerate; Data:Pointer):LongWord;
Description: To be documented


[Expand]
function SDHCIHostNotification(SDHCI:PSDHCIHost; Callback:TSDHCINotification; Data:Pointer; Notification,Flags:LongWord):LongWord;
Description: To be documented


MMC helper functions

[Expand]
function MMCGetCount:LongWord; inline;
Description: Get the current MMC count


[Expand]
function MMCDeviceCheck(MMC:PMMCDevice):PMMCDevice;
Description: Check if the supplied MMC is in the MMC table


[Expand]
function MMCIsSD(MMC:PMMCDevice):Boolean;
Description: To be documented


[Expand]
function MMCGetCIDValue(MMC:PMMCDevice; Version,Value:LongWord):LongWord;
Description: Extract a CID field value from the 128 bit Card Identification register


[Expand]
function MMCGetCSDValue(MMC:PMMCDevice; Value:LongWord):LongWord;
Description: Extract a CSD field value from the 128 bit Card Specific register


[Expand]
function MMCGetExtendedCSDValue(MMC:PMMCDevice; Value:LongWord):LongWord;
Description: Extract an Extended CSD field value from the 512 byte Extended Card Specific register


[Expand]
function MMCExtractBits(Buffer:Pointer; Start,Size:LongWord):LongWord;
Description: To be documented


[Expand]
function MMCExtractBitsEx(Buffer:Pointer; Length,Start,Size:LongWord):LongWord;
Description: To be documented


[Expand]
function MMCIsMultiCommand(Command:Word):Boolean;
Description: To be documented


[Expand]
function MMCStatusToString(Status:LongWord):String;
Description: Translates an MMC status code into a string describing it


[Expand]
function MMCDeviceTypeToString(MMCType:LongWord):String;
Description: To be documented


[Expand]
function MMCDeviceStateToString(MMCState:LongWord):String;
Description: To be documented


[Expand]
procedure MMCLog(Level:LongWord; MMC:PMMCDevice; const AText:String);
Description: To be documented


[Expand]
procedure MMCLogInfo(MMC:PMMCDevice; const AText:String);
Description: To be documented


[Expand]
procedure MMCLogError(MMC:PMMCDevice; const AText:String);
Description: To be documented


[Expand]
procedure MMCLogDebug(MMC:PMMCDevice; const AText:String);
Description: To be documented


SD helper functions

[Expand]
function SDGetMaxClock(MMC:PMMCDevice):LongWord;
Description: Determine the Maximum Clock (DTR) for the current card


[Expand]
function SDGetCIDValue(MMC:PMMCDevice; Value:LongWord):LongWord;
Description: Extract a CID field value from the 128 bit Card Identification register


[Expand]
function SDGetCSDValue(MMC:PMMCDevice; Version,Value:LongWord):LongWord;
Description: Extract a CSD field value from the 128 bit Card Specific register


[Expand]
function SDGetSCRValue(MMC:PMMCDevice; Value:LongWord):LongWord;
Description: Extract an SCR field value from the 64 bit SD Configuration register


[Expand]
function SDGetSSRValue(MMC:PMMCDevice; Value:LongWord):LongWord;
Description: Extract an SCR field value from the 512 bit SD Status register


[Expand]
function SDGetSwitchValue(MMC:PMMCDevice; Value:LongWord):LongWord;
Description: Extract a Switch field value from the 512 bit SD Switch status


SDHCI helper functions

[Expand]
function SDHCIGetCount:LongWord; inline;
Description: Get the current SDHCI count


[Expand]
function SDHCIHostCheck(SDHCI:PSDHCIHost):PSDHCIHost;
Description: Check if the supplied SDHCI is in the SDHCI table


[Expand]
function SDHCIIsSPI(SDHCI:PSDHCIHost):Boolean;
Description: To be documented


[Expand]
function SDHCIGetVersion(SDHCI:PSDHCIHost):Word;
Description: To be documented


[Expand]
function SDHCIGetCommand(Command:Word):Word;
Description: To be documented


[Expand]
function SDHCIMakeCommand(Command,Flags:Word):Word;
Description: To be documented


[Expand]
function SDHCIMakeBlockSize(DMA,BlockSize:Word):Word;
Description: To be documented


[Expand]
function SDHCIDeviceTypeToString(SDHCIType:LongWord):String;
Description: To be documented


[Expand]
function SDHCIDeviceStateToString(SDHCIState:LongWord):String;
Description: To be documented


MMC storage functions

[Expand]
function MMCStorageDeviceRead(Storage:PStorageDevice; const Start,Count:Int64; Buffer:Pointer):LongWord;
Description: To be documented


[Expand]
function MMCStorageDeviceWrite(Storage:PStorageDevice; const Start,Count:Int64; Buffer:Pointer):LongWord;
Description: To be documented


[Expand]
function MMCStorageDeviceErase(Storage:PStorageDevice; const Start,Count:Int64):LongWord;
Description: To be documented


[Expand]
function MMCStorageDeviceControl(Storage:PStorageDevice; Request:Integer; Argument1:LongWord; var Argument2:LongWord):LongWord;
Description: To be documented


Return to Unit Reference