Difference between revisions of "Unit PL18X"

From Ultibo.org
Jump to: navigation, search
Line 14: Line 14:
 
----
 
----
  
''To be documented''
+
 
 +
<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;">'''PL18X specific constants''' <code> PL180_MMCI_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>PL180_MMCI_DESCRIPTION = 'ARM PrimeCell PL180 MMCI Host';</code>
 +
| Description of PL180 device
 +
|-
 +
| <code>PL181_MMCI_DESCRIPTION = 'ARM PrimeCell PL181 MMCI Host';</code>
 +
| Description of PL181 device
 +
|-
 +
|}
 +
</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;">'''PL18X power control register''' <code> PL18X_MMCI_POWER_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>PL18X_MMCI_POWER = $000;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_POWER_OFF = $00;</code>
 +
| Power-off
 +
|-
 +
|colspan="2"|''Bits 1:0 - $01 Reserved''
 +
|-
 +
| <code>PL18X_MMCI_POWER_UP = $02;</code>
 +
| Power-up
 +
|-
 +
| <code>PL18X_MMCI_POWER_ON = $03;</code>
 +
| Power-on
 +
|-
 +
|colspan="2"|''Bits 5:2 - Output Voltage''
 +
|-
 +
| <code>PL18X_MMCI_POWER_OD = (1 shl 6);</code>
 +
| MCICMD output control
 +
|-
 +
| <code>PL18X_MMCI_POWER_ROD = (1 shl 7);</code>
 +
| Rod control
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|''The ST Micro version does not have ROD and reuses the voltage registers for direction settings''
 +
|-
 +
| <code>PL18X_MMCI_POWER_ST_DATA2DIREN = (1 shl 2);</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_POWER_ST_CMDDIREN = (1 shl 3);</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_POWER_ST_DATA0DIREN = (1 shl 4);</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_POWER_ST_DATA31DIREN = (1 shl 5);</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_POWER_ST_FBCLKEN = (1 shl 7);</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_POWER_ST_DATA74DIREN = (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;">'''PL18X clock control register''' <code> PL18X_MMCI_CLOCK* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>PL18X_MMCI_CLOCK = $004;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_CLOCK_ENABLE = (1 shl 8);</code>
 +
| Enable MCI bus clock: 0 = Clock disabled / 1 = Clock enabled
 +
|-
 +
| <code>PL18X_MMCI_CLOCK_PWRSAVE = (1 shl 9);</code>
 +
| Disable MCI clock output when bus is idle: 0 = Always enabled / 1 = Clock enabled when bus is active
 +
|-
 +
| <code>PL18X_MMCI_CLOCK_BYPASS = (1 shl 10);</code>
 +
| Enable bypass of clock divide logic: 0 = Disable bypass / 1 = Enable bypass
 +
|-
 +
| <code>PL18X_MMCI_CLOCK_4BIT_BUS = (1 shl 11);</code>
 +
| Enable wide bus mode: 0 = Standard bus mode (only MCIDAT0 used) / 1 = Wide bus mode (MCIDAT3:0 used)
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|''8bit wide buses, hardware flow contronl, negative edges and clock inversion supported in ST Micro U300 and Ux500 versions''
 +
|-
 +
| <code>PL18X_MMCI_CLOCK_ST_8BIT_BUS  = (1 shl 12);</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_CLOCK_ST_U300_HWFCEN = (1 shl 13);</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_CLOCK_ST_UX500_NEG_EDGE = (1 shl 13);</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_CLOCK_ST_UX500_HWFCEN = (1 shl 14);</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_CLOCK_ST_UX500_CLK_INV = (1 shl 15);</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|''Modified PL180 on Versatile Express platform''
 +
|-
 +
| <code>PL18X_MMCI_CLOCK_ARM_HWFCEN = (1 shl 12);</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|''Modified on Qualcomm Integrations''
 +
|-
 +
| <code>PL18X_MMCI_CLOCK_QCOM_WIDEBUS_8 = (1 shl 10) or (1 shl 11);</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_CLOCK_QCOM_FLOWENA = (1 shl 12);</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_CLOCK_QCOM_INVERTOUT = (1 shl 13);</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|''Select in latch data and command in''
 +
|-
 +
| <code>PL18X_MMCI_CLOCK_QCOM_SELECT_IN_FBCLK = (1 shl 15);</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_CLOCK_QCOM_SELECT_IN_DDR_MODE = (1 shl 14) or (1 shl 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;">'''PL18X argument register''' <code> PL18X_MMCI_ARGUMENT* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>PL18X_MMCI_ARGUMENT = $008;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
|colspan="2"|''Bits 31:0 Command Argument''
 +
|-
 +
|}
 +
</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;">'''PL18X command register''' <code> PL18X_MMCI_COMMAND* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>PL18X_MMCI_COMMAND = $00c;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|''Bits 5:0 Command Index''
 +
|-
 +
| <code>PL18X_MMCI_CPSM_RESPONSE = (1 shl 6);</code>
 +
| If set, CPSM waits for a response
 +
|-
 +
| <code>PL18X_MMCI_CPSM_LONGRSP = (1 shl 7);</code>
 +
| If set, CPSM receives a 136-bit long response
 +
|-
 +
| <code>PL18X_MMCI_CPSM_INTERRUPT = (1 shl 8);</code>
 +
| If set, CPSM disables command timer and waits for interrupt request
 +
|-
 +
| <code>PL18X_MMCI_CPSM_PENDING = (1 shl 9);</code>
 +
| If set, CPSM waits for CmdPend before it starts sending a command
 +
|-
 +
| <code>PL18X_MMCI_CPSM_ENABLE = (1 shl 10);</code>
 +
| If set, CPSM is enabled
 +
|-
 +
|colspan="2"|''Argument flag extenstions in the ST Micro versions''
 +
|-
 +
| <code>PL18X_MMCI_CPSM_ST_SDIO_SUSP = (1 shl 11);</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_CPSM_ST_ENCMD_COMPL = (1 shl 12);</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_CPSM_ST_NIEN = (1 shl 13);</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_CPSM_ST_CE_ATACMD = (1 shl 14);</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|''Modified on Qualcomm Integrations''
 +
|-
 +
| <code>PL18X_MMCI_CPSM_QCOM_DATCMD = (1 shl 12);</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_CPSM_QCOM_MCIABORT = (1 shl 13);</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_CPSM_QCOM_CCSENABLE = (1 shl 14);</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_CPSM_QCOM_CCSDISABLE = (1 shl 15);</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_CPSM_QCOM_AUTO_CMD19 = (1 shl 16);</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_CPSM_QCOM_AUTO_CMD21 = (1 shl 21);</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;">'''PL18X command response register''' <code> PL18X_MMCI_RESPCMD* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>PL18X_MMCI_RESPCMD = $010;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
|colspan="2"|''Bits 5:0 Response command index''
 +
|-
 +
|colspan="2"|''Bits 31:6 Reserved''
 +
|-
 +
|}
 +
</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;">'''PL18X response registers''' <code> PL18X_MMCI_RESPONSE* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>PL18X_MMCI_RESPONSE0 = $014;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>PL18X_MMCI_RESPONSE1 = $018;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_RESPONSE2 = $01c;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_RESPONSE3 = $020;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|''Bits 31:0 Card 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;">'''PL18X data timer register''' <code> PL18X_MMCI_DATATIMER* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>PL18X_MMCI_DATATIMER = $024;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
|colspan="2"|''Bits 31:0 Data Timeout Period''
 +
|-
 +
|}
 +
</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;">'''PL18X data length register''' <code> PL18X_MMCI_DATALENGTH* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>PL18X_MMCI_DATALENGTH = $028;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
|colspan="2"|''Bits 15:0 Data Length Value''
 +
|-
 +
|colspan="2"|''Bits 31:16 Reserved''
 +
|-
 +
|}
 +
</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;">'''PL18X data control register''' <code> PL18X_MMCI_DATACTRL* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>PL18X_MMCI_DATACTRL = $02c;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_DPSM_ENABLE = (1 shl 0);</code>
 +
| Data transfer enabled
 +
|-
 +
| <code>PL18X_MMCI_DPSM_DIRECTION = (1 shl 1);</code>
 +
| Data transfer direction: 0 = From controller to card / 1 = From card to controller
 +
|-
 +
| <code>PL18X_MMCI_DPSM_MODE = (1 shl 2);</code>
 +
| Data transfer mode: 0 = Block data transfer / 1 = Stream data transfer
 +
|-
 +
| <code>PL18X_MMCI_DPSM_BLOCKSIZE = (1 shl 4);</code>
 +
| Data block length
 +
|-
 +
|colspan="2"|''Control register extensions in the ST Micro U300 and Ux500 versions''
 +
|-
 +
| <code>PL18X_MMCI_ST_DPSM_RWSTART = (1 shl 8);</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_ST_DPSM_RWSTOP = (1 shl 9);</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_ST_DPSM_RWMOD = (1 shl 10);</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_ST_DPSM_SDIOEN = (1 shl 11);</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|''Control register extensions in the ST Micro Ux500 versions''
 +
|-
 +
| <code>PL18X_MMCI_ST_DPSM_DMAREQCTL = (1 shl 12);</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_ST_DPSM_DBOOTMODEEN = (1 shl 13);</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_ST_DPSM_BUSYMODE = (1 shl 14);</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_ST_DPSM_DDRMODE = (1 shl 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;">'''PL18X data counter register''' <code> PL18X_MMCI_DATACNT* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>PL18X_MMCI_DATACNT = $030;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
|colspan="2"|''Bits 15:0 Remaining Data''
 +
|-
 +
|colspan="2"|''Bits 31:16 Reserved''
 +
|-
 +
|}
 +
</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;">'''PL18X status register''' <code> PL18X_MMCI_STATUS* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>PL18X_MMCI_STATUS = $034;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>PL18X_MMCI_CMDCRCFAIL = (1 shl 0);</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_DATACRCFAIL = (1 shl 1);</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_CMDTIMEOUT = (1 shl 2);</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_DATATIMEOUT = (1 shl 3);</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_TXUNDERRUN = (1 shl 4);</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_RXOVERRUN = (1 shl 5);</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_CMDRESPEND = (1 shl 6);</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_CMDSENT = (1 shl 7);</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_DATAEND = (1 shl 8);</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_STARTBITERR = (1 shl 9);</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_DATABLOCKEND = (1 shl 10);</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_CMDACTIVE = (1 shl 11);</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_TXACTIVE = (1 shl 12);</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_RXACTIVE = (1 shl 13);</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_TXFIFOHALFEMPTY = (1 shl 14);</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_RXFIFOHALFFULL = (1 shl 15);</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_TXFIFOFULL = (1 shl 16);</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_RXFIFOFULL = (1 shl 17);</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_TXFIFOEMPTY = (1 shl 18);</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_RXFIFOEMPTY = (1 shl 19);</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_TXDATAAVLBL = (1 shl 20);</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_RXDATAAVLBL = (1 shl 21);</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|''Extended status bits for the ST Micro variants''
 +
|-
 +
| <code>PL18X_MMCI_ST_SDIOIT = (1 shl 22);</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_ST_CEATAEND = (1 shl 23);</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_ST_CARDBUSY = (1 shl 24);</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;">'''PL18X clear register''' <code> PL18X_MMCI_CLEAR* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>PL18X_MMCI_CLEAR = $038;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>PL18X_MMCI_CMDCRCFAILCLR = (1 shl 0);</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_DATACRCFAILCLR = (1 shl 1);</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_CMDTIMEOUTCLR = (1 shl 2);</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_DATATIMEOUTCLR = (1 shl 3);</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_TXUNDERRUNCLR = (1 shl 4);</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_RXOVERRUNCLR = (1 shl 5);</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_CMDRESPENDCLR = (1 shl 6);</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_CMDSENTCLR = (1 shl 7);</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_DATAENDCLR = (1 shl 8);</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_STARTBITERRCLR = (1 shl 9);</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_DATABLOCKENDCLR = (1 shl 10);</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|''Extended status bits for the ST Micro variants''
 +
|-
 +
| <code>PL18X_MMCI_ST_SDIOITC = (1 shl 22);</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_ST_CEATAENDC = (1 shl 23);</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_ST_BUSYENDC = (1 shl 24);</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;">'''PL18X interrupt mask registers''' <code> PL18X_MMCI_MASK* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>PL18X_MMCI_MASK0 = $03c;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>PL18X_MMCI_MASK1 = $040;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_CMDCRCFAILMASK = (1 shl 0);</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_DATACRCFAILMASK = (1 shl 1);</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_CMDTIMEOUTMASK = (1 shl 2);</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_DATATIMEOUTMASK = (1 shl 3);</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_TXUNDERRUNMASK = (1 shl 4);</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_RXOVERRUNMASK = (1 shl 5);</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_CMDRESPENDMASK = (1 shl 6);</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_CMDSENTMASK = (1 shl 7);</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_DATAENDMASK = (1 shl 8);</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_STARTBITERRMASK = (1 shl 9);</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_DATABLOCKENDMASK = (1 shl 10);</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_CMDACTIVEMASK = (1 shl 11);</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_TXACTIVEMASK = (1 shl 12);</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_RXACTIVEMASK = (1 shl 13);</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_TXFIFOHALFEMPTYMASK = (1 shl 14);</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_RXFIFOHALFFULLMASK = (1 shl 15);</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_TXFIFOFULLMASK  = (1 shl 16);</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_RXFIFOFULLMASK = (1 shl 17);</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_TXFIFOEMPTYMASK = (1 shl 18);</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_RXFIFOEMPTYMASK = (1 shl 19);</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_TXDATAAVLBLMASK = (1 shl 20);</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_RXDATAAVLBLMASK = (1 shl 21);</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|''Extended status bits for the ST Micro variants''
 +
|-
 +
| <code>PL18X_MMCI_ST_SDIOITMASK = (1 shl 22);</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_ST_CEATAENDMASK = (1 shl 23);</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL18X_MMCI_ST_BUSYEND = (1 shl 24);</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;">'''PL18X SD card select register''' <code> PL18X_MMCI_SELECT* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>PL18X_MMCI_SELECT = $044;</code>
 +
| style="width: 50%;"|&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;">'''PL18X FIFO counter register''' <code> PL18X_MMCI_FIFOCNT* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>PL18X_MMCI_FIFOCNT = $048;</code>
 +
| style="width: 50%;"|&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;">'''PL18X data FIFO register''' <code> PL18X_MMCI_FIFO* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>PL18X_MMCI_FIFO = $080;</code>
 +
| To $0bc
 +
|-
 +
|}
 +
</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;">'''PL18X peripheral identification register''' <code> PL18X_MMCI_PERIPHID* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>PL18X_MMCI_PERIPHID = $FE0;</code>
 +
| style="width: 50%;"|&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;">'''PL18X PrimeCell identification register''' <code> PL18X_MMCI_PCELLID* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>PL18X_MMCI_PCELLID = $FF0;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>PL18X_MMCI_IRQENABLE = (PL18X_MMCI_CMDCRCFAILMASK or PL18X_MMCI_DATACRCFAILMASK or PL18X_MMCI_CMDTIMEOUTMASK or PL18X_MMCI_DATATIMEOUTMASK or PL18X_MMCI_TXUNDERRUNMASK or PL18X_MMCI_RXOVERRUNMASK or PL18X_MMCI_CMDRESPENDMASK or PL18X_MMCI_CMDSENTMASK or PL18X_MMCI_STARTBITERRMASK);</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|''These interrupts are directed to IRQ1 when two IRQ lines are available''
 +
|-
 +
| <code>PL18X_MMCI_IRQ1MASK = (PL18X_MMCI_RXFIFOHALFFULLMASK or PL18X_MMCI_RXDATAAVLBLMASK or PL18X_MMCI_TXFIFOHALFEMPTYMASK);</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
<br />
  
 
=== Type definitions ===
 
=== Type definitions ===

Revision as of 06:51, 13 June 2017

Return to Unit Reference


Description


ARM PrimeCell PL180/181 Multimedia Card Interface Driver unit

The PL180/181 Multimedia Card is an ARM peripheral that is compatible with MMC multimedia cards and SD secure digital cards in memory mapped I/O format compatible with the ARM advanced peripheral bus (APB).

The design of the Pl180/181 allows for multiple cards per controller however this driver currently only supports attaching one card.

Constants



[Expand]
PL18X specific constants PL180_MMCI_*


[Expand]
PL18X power control register PL18X_MMCI_POWER_*


[Expand]
PL18X clock control register PL18X_MMCI_CLOCK*


[Expand]
PL18X argument register PL18X_MMCI_ARGUMENT*


[Expand]
PL18X command register PL18X_MMCI_COMMAND*


[Expand]
PL18X command response register PL18X_MMCI_RESPCMD*


[Expand]
PL18X response registers PL18X_MMCI_RESPONSE*


[Expand]
PL18X data timer register PL18X_MMCI_DATATIMER*


[Expand]
PL18X data length register PL18X_MMCI_DATALENGTH*


[Expand]
PL18X data control register PL18X_MMCI_DATACTRL*


[Expand]
PL18X data counter register PL18X_MMCI_DATACNT*


[Expand]
PL18X status register PL18X_MMCI_STATUS*


[Expand]
PL18X clear register PL18X_MMCI_CLEAR*


[Expand]
PL18X interrupt mask registers PL18X_MMCI_MASK*


[Expand]
PL18X SD card select register PL18X_MMCI_SELECT*


[Expand]
PL18X FIFO counter register PL18X_MMCI_FIFOCNT*


[Expand]
PL18X data FIFO register PL18X_MMCI_FIFO*


[Expand]
PL18X peripheral identification register PL18X_MMCI_PERIPHID*


[Expand]
PL18X PrimeCell identification register PL18X_MMCI_PCELLID*


Type definitions



PL18X version Id

[Expand]

PPL18XVersionID = ^TPL18XVersionID;

TPL18XVersionID = record

PL18X version data

[Expand]

PPL18XVersionData = ^TPL18XVersionData;

TPL18XVersionData = record

PL18X MMCI registers

[Expand]

PPL18XMMCIRegisters = ^TPL18XMMCIRegisters;

TPL18XMMCIRegisters = record

PL18X SDHCI get RXFIFO count

TPL18XSDHCIGetRXFIFOCount = function(SDHCI:PPL18XSDHCIHost; Status,Remain:LongWord):LongWord;

PL18X SDHCI host

[Expand]

PPL18XSDHCIHost = ^TPL18XSDHCIHost;

TPL18XSDHCIHost = record


Public variables



PL18X specific variables

PL18X_MMCI_FIQ_ENABLED:LongBool; The SDHCI uses Fast Interrupt Requests (FIQ) instead of IRQ
PL18X_MMCI_MIN_FREQ:LongWord = 400000; Minimum clock frequency for SDHCI (Default minimum of 400KHz)
PL18X_MMCI_MAX_FREQ:LongWord = 400000; Maximum clock frequency for SDHCI (Default maximum of 400KHz)


Function declarations



Initialization functions

[Expand]
procedure PL18XInit;
Description: Initialize the PL18X unit and version table


PL18X functions

[Expand]
function PL180SDHCICreate(Address:LongWord; const Name:String; IRQ0,IRQ1,ClockMinimum,ClockMaximum:LongWord; CardDetect:TMMCDeviceGetCardDetect; WriteProtect:TMMCDeviceGetWriteProtect):PSDHCIHost;
Description: Create and register a new PL180 SDHCI device which can be accessed using the SDHCI API


[Expand]
function PL181SDHCICreate(Address:LongWord; const Name:String; IRQ0,IRQ1,ClockMinimum,ClockMaximum:LongWord; CardDetect:TMMCDeviceGetCardDetect; WriteProtect:TMMCDeviceGetWriteProtect):PSDHCIHost;
Description: Create and register a new PL181 SDHCI device which can be accessed using the SDHCI API


[Expand]
function PL18XSDHCIDestroy(SDHCI:PSDHCIHost):LongWord;
Description: Stop, deregister and destroy a PL18X SDHCI device created by this driver


PL18X MMC functions

[Expand]
function PL18XMMCDeviceInitialize(MMC:PMMCDevice):LongWord;
Description: Implementation of MMCDeviceInitialize API for PL18X SDHCI


[Expand]
function PL18XMMCDeviceGetCardDetect(MMC:PMMCDevice):LongWord;
Description: Implementation of MMCDeviceGetCardDetect API for PL18X SDHCI


[Expand]
function PL18XMMCDeviceGetWriteProtect(MMC:PMMCDevice):LongWord;
Description: Implementation of MMCDeviceGetWriteProtect API for PL18X SDHCI


[Expand]
function PL18XMMCDeviceSendCommand(MMC:PMMCDevice; Command:PMMCCommand):LongWord;
Description: Implementation of MMCDeviceSendCommand API for PL18X SDHCI


[Expand]
function PL18XMMCDeviceSetIOS(MMC:PMMCDevice):LongWord;
Description: Implementation of MMCDeviceSetIOS API for PL18X SDHCI


PL18X SDHCI functions

[Expand]
function PL18XSDHCIHostStart(SDHCI:PSDHCIHost):LongWord;
Description: Implementation of SDHCIHostStart API for PL18X SDHCI


[Expand]
function PL18XSDHCIHostStop(SDHCI:PSDHCIHost):LongWord;
Description: Implementation of SDHCIHostStop API for PL18X SDHCI


[Expand]
function PL18XSDHCIHostReadByte(SDHCI:PSDHCIHost; Reg:LongWord):Byte;
Description: Implementation of SDHCIHostReadByte API for PL18X SDHCI


[Expand]
function PL18XSDHCIHostReadWord(SDHCI:PSDHCIHost; Reg:LongWord):Word;
Description: Implementation of SDHCIHostReadWord API for PL18X SDHCI


[Expand]
function PL18XSDHCIHostReadLong(SDHCI:PSDHCIHost; Reg:LongWord):LongWord;
Description: Implementation of SDHCIHostReadLong API for PL18X SDHCI


[Expand]
procedure PL18XSDHCIHostWriteByte(SDHCI:PSDHCIHost; Reg:LongWord; Value:Byte);
Description: Implementation of SDHCIHostWriteByte API for PL18X SDHCI


[Expand]
procedure PL18XSDHCIHostWriteWord(SDHCI:PSDHCIHost; Reg:LongWord; Value:Word);
Description: Implementation of SDHCIHostWriteWord API for PL18X SDHCI


[Expand]
procedure PL18XSDHCIHostWriteLong(SDHCI:PSDHCIHost; Reg:LongWord; Value:LongWord);
Description: Implementation of SDHCIHostWriteLong API for PL18X SDHCI


[Expand]
procedure PL18XSDHCIInterruptHandler(SDHCI:PPL18XSDHCIHost);
Description: Interrupt handler for the PL18X SDHCI


[Expand]
procedure PL18XSDHCIDataInterrupt(SDHCI:PPL18XSDHCIHost; Status:LongWord);
Description: Data interrupt handler for the PL18X SDHCI


[Expand]
procedure PL18XSDHCICommandInterrupt(SDHCI:PPL18XSDHCIHost; Status:LongWord);
Description: Command interrupt handler for the PL18X SDHCI


[Expand]
procedure PL18XSDHCIStopData(SDHCI:PPL18XSDHCIHost);
Description: Data stop handler for the PL18X SDHCI


[Expand]
procedure PL18XSDHCIPIOInterruptHandler(SDHCI:PPL18XSDHCIHost);
Description: PIO Interrupt handler for the PL18X SDHCI


[Expand]
function PL18XSHDCIReadPIO(SDHCI:PPL18XSDHCIHost ;Buffer:Pointer; Remain:LongWord):LongWord;
Description: PIO read interrupt handler for the PL18X SDHCI


[Expand]
function PL18XSDHCIWritePIO(SDHCI:PPL18XSDHCIHost; Buffer:Pointer; Remain,Status:LongWord):LongWord;
Description: PIO read interrupt handler for the PL18X SDHCI


PL18X helper functions

[Expand]
function PL18XGetPeripheralID(SDHCI:PPL18XSDHCIHost):LongWord;
Description: Return the Peripheral Id for a PL18X SDHCI device


[Expand]
function PL18XGetVersionData(SDHCI:PPL18XSDHCIHost):PPL18XVersionData;
Description: Return the version data for a PL18X SDHCI device based on the Peripheral Id


[Expand]
function PL18XGetRXFIFOCount(SDHCI:PPL18XSDHCIHost; Status,Remain:LongWord):LongWord;
Description: Determine the receive FIFO count available


[Expand]
function PL18XQualcommGetRXFIFOCount(SDHCI:PPL18XSDHCIHost; Status,Remain:LongWord):LongWord;
Description: Determine the receive FIFO count available


[Expand]
procedure PL18XRegisterDelay(SDHCI:PPL18XSDHCIHost);
Description: Delay for the required amount of time after a register write


[Expand]
procedure PL18XSetClockRegister(SDHCI:PPL18XSDHCIHost; MMC:PMMCDevice; Desired:LongWord);
Description: Setup the current clock rate in the clock register


[Expand]
procedure PL18XSetPowerRegister(SDHCI:PPL18XSDHCIHost; Value:LongWord);
Description: Setup the current power state in the power register


[Expand]
procedure PL18XSetInterruptMask1(SDHCI:PPL18XSDHCIHost; Mask:LongWord);
Description: Setup the interrupt mask to use either Mask0 or Mask1 depending on configuration


[Expand]
procedure PL18XWriteClockRegister(SDHCI:PPL18XSDHCIHost; Clock:LongWord);
Description: Write to the clock register


[Expand]
procedure PL18XWritePowerRegister(SDHCI:PPL18XSDHCIHost; Power:LongWord);
Description: Write to the power register


[Expand]
procedure PL18XWriteDataCtrlRegister(SDHCI:PPL18XSDHCIHost; DataCtrl:LongWord);
Description: Write to the data control register


Return to Unit Reference