Difference between revisions of "Unit BCMSDHOST"

From Ultibo.org
Jump to: navigation, search
 
(8 intermediate revisions by the same user not shown)
Line 5: Line 5:
 
----
 
----
  
'''Broadcom BCM27XX SDHOST driver'''
+
'''Broadcom BCM27XX SDHOST Driver unit'''
  
 
The SDHOST controller on the BCM27XX is a non SDHCI-compliant device which requires a specific driver.
 
The SDHOST controller on the BCM27XX is a non SDHCI-compliant device which requires a specific driver.
Line 16: Line 16:
 
----
 
----
  
''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;">'''BCMSDHOST specific constants''' <code> BCMSDHOST_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>BCMSDHOST_DESCRIPTION = 'Broadcom BCM27XX SDHOST';</code>
 +
| style="width: 50%;"|Description of BCMSDHOST device
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>BCMSDHOST_FIFO_READ_THRESHOLD = 4;</code>
 +
| &nbsp;
 +
|-
 +
| <code>BCMSDHOST_FIFO_WRITE_THRESHOLD = 4;</code>
 +
| &nbsp;
 +
|-
 +
| <code>BCMSDHOST_ALLOW_CMD23_READ = 1;</code>
 +
| &nbsp;
 +
|-
 +
| <code>BCMSDHOST_ALLOW_CMD23_WRITE = 0;</code>
 +
| &nbsp;
 +
|-
 +
| <code>BCMSDHOST_SDDATA_FIFO_PIO_BURST = 8;</code>
 +
| &nbsp;
 +
|-
 +
| <code>BCMSDHOST_CMD_DALLY_US = 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;">'''BCMSDHOST register''' <code> BCMSDHOST_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>BCMSDHOST_SDCMD = $00;</code>
 +
| style="width: 50%;"|Command to SD card - 16 R/W
 +
|-
 +
| <code>BCMSDHOST_SDARG = $04;</code>
 +
| Argument to SD card - 32 R/W
 +
|-
 +
| <code>BCMSDHOST_SDTOUT = $08;</code>
 +
| Start value for timeout counter - 32 R/W
 +
|-
 +
| <code>BCMSDHOST_SDCDIV = $0c;</code>
 +
| Start value for clock divider - 11 R/W
 +
|-
 +
| <code>BCMSDHOST_SDRSP0 = $10;</code>
 +
| SD card response (31:0)- 32 R
 +
|-
 +
| <code>BCMSDHOST_SDRSP1 = $14;</code>
 +
| SD card response (63:32) - 32 R
 +
|-
 +
| <code>BCMSDHOST_SDRSP2 = $18;</code>
 +
| SD card response (95:64) - 32 R
 +
|-
 +
| <code>BCMSDHOST_SDRSP3 = $1c;</code>
 +
| SD card response (127:96)- 32 R
 +
|-
 +
| <code>BCMSDHOST_SDHSTS = $20;</code>
 +
| SD host status - 11 R
 +
|-
 +
| <code>BCMSDHOST_SDVDD = $30;</code>
 +
| SD card power control - 1 R/W
 +
|-
 +
| <code>BCMSDHOST_SDEDM = $34;</code>
 +
| Emergency Debug Mode - 13 R/W
 +
|-
 +
| <code>BCMSDHOST_SDHCFG = $38;</code>
 +
| Host configuration - 2 R/W
 +
|-
 +
| <code>BCMSDHOST_SDHBCT = $3c;</code>
 +
| Host byte count (debug) - 32 R/W
 +
|-
 +
| <code>BCMSDHOST_SDDATA = $40;</code>
 +
| Data to/from SD card - 32 R/W
 +
|-
 +
| <code>BCMSDHOST_SDHBLC = $50;</code>
 +
| Host block count (SDIO/SDHC) - 9 R/W
 +
|-
 +
|}
 +
</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;">'''BCMSDHOST command register''' <code> BCMSDHOST_SDCMD_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>BCMSDHOST_SDCMD_NEW_FLAG = $8000;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>BCMSDHOST_SDCMD_FAIL_FLAG = $4000;</code>
 +
| &nbsp;
 +
|-
 +
| <code>BCMSDHOST_SDCMD_BUSYWAIT = $800;</code>
 +
| &nbsp;
 +
|-
 +
| <code>BCMSDHOST_SDCMD_NO_RESPONSE = $400;</code>
 +
| &nbsp;
 +
|-
 +
| <code>BCMSDHOST_SDCMD_LONG_RESPONSE = $200;</code>
 +
| &nbsp;
 +
|-
 +
| <code>BCMSDHOST_SDCMD_WRITE_CMD = $80;</code>
 +
| &nbsp;
 +
|-
 +
| <code>BCMSDHOST_SDCMD_READ_CMD = $40;</code>
 +
| &nbsp;
 +
|-
 +
| <code>BCMSDHOST_SDCMD_CMD_MASK = $3f;</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;">'''BCMSDHOST clock divider register''' <code> BCMSDHOST_SDCDIV_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>BCMSDHOST_SDCDIV_MAX_CDIV = $7ff;</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;">'''BCMSDHOST host status register''' <code> BCMSDHOST_SDHSTS_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>BCMSDHOST_SDHSTS_BUSY_IRPT = $400;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>BCMSDHOST_SDHSTS_BLOCK_IRPT = $200;</code>
 +
| &nbsp;
 +
|-
 +
| <code>BCMSDHOST_SDHSTS_SDIO_IRPT = $100;</code>
 +
| &nbsp;
 +
|-
 +
| <code>BCMSDHOST_SDHSTS_REW_TIME_OUT = $80;</code>
 +
| &nbsp;
 +
|-
 +
| <code>BCMSDHOST_SDHSTS_CMD_TIME_OUT = $40;</code>
 +
| &nbsp;
 +
|-
 +
| <code>BCMSDHOST_SDHSTS_CRC16_ERROR = $20;</code>
 +
| &nbsp;
 +
|-
 +
| <code>BCMSDHOST_SDHSTS_CRC7_ERROR = $10;</code>
 +
| &nbsp;
 +
|-
 +
| <code>BCMSDHOST_SDHSTS_FIFO_ERROR = $08;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|04 Reserved
 +
|-
 +
|colspan="2"|02 Reserved
 +
|-
 +
| <code>BCMSDHOST_SDHSTS_DATA_FLAG = $01;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>BCMSDHOST_SDHSTS_TRANSFER_ERROR_MASK = BCMSDHOST_SDHSTS_CRC7_ERROR or BCMSDHOST_SDHSTS_CRC16_ERROR or BCMSDHOST_SDHSTS_REW_TIME_OUT or BCMSDHOST_SDHSTS_FIFO_ERROR;</code>
 +
| &nbsp;
 +
|-
 +
| <code>BCMSDHOST_SDHSTS_ERROR_MASK = BCMSDHOST_SDHSTS_CMD_TIME_OUT or BCMSDHOST_SDHSTS_TRANSFER_ERROR_MASK;</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;">'''BCMSDHOST host configuration register''' <code> BCMSDHOST_SDHCFG_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>BCMSDHOST_SDHCFG_BUSY_IRPT_EN = (1 shl 10);</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>BCMSDHOST_SDHCFG_BLOCK_IRPT_EN = (1 shl 8);</code>
 +
| &nbsp;
 +
|-
 +
| <code>BCMSDHOST_SDHCFG_SDIO_IRPT_EN = (1 shl 5);</code>
 +
| &nbsp;
 +
|-
 +
| <code>BCMSDHOST_SDHCFG_DATA_IRPT_EN = (1 shl 4);</code>
 +
| &nbsp;
 +
|-
 +
| <code>BCMSDHOST_SDHCFG_SLOW_CARD = (1 shl 3);</code>
 +
| &nbsp;
 +
|-
 +
| <code>BCMSDHOST_SDHCFG_WIDE_EXT_BUS = (1 shl 2);</code>
 +
| &nbsp;
 +
|-
 +
| <code>BCMSDHOST_SDHCFG_WIDE_INT_BUS = (1 shl 1);</code>
 +
| &nbsp;
 +
|-
 +
| <code>BCMSDHOST_SDHCFG_REL_CMD_LINE = (1 shl 0);</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;">'''BCMSDHOST emergency debug mode register''' <code> BCMSDHOST_SDEDM_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>BCMSDHOST_SDEDM_FORCE_DATA_MODE = (1 shl 19);</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>BCMSDHOST_SDEDM_CLOCK_PULSE = (1 shl 20);</code>
 +
| &nbsp;
 +
|-
 +
| <code>BCMSDHOST_SDEDM_BYPASS = (1 shl 21);</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>BCMSDHOST_SDEDM_WRITE_THRESHOLD_SHIFT = 9;</code>
 +
| &nbsp;
 +
|-
 +
| <code>BCMSDHOST_SDEDM_READ_THRESHOLD_SHIFT = 14;</code>
 +
| &nbsp;
 +
|-
 +
| <code>BCMSDHOST_SDEDM_THRESHOLD_MASK = $1f;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>BCMSDHOST_SDEDM_FSM_MASK = $f;</code>
 +
| &nbsp;
 +
|-
 +
| <code>BCMSDHOST_SDEDM_FSM_IDENTMODE = $0;</code>
 +
| &nbsp;
 +
|-
 +
| <code>BCMSDHOST_SDEDM_FSM_DATAMODE = $1;</code>
 +
| &nbsp;
 +
|-
 +
| <code>BCMSDHOST_SDEDM_FSM_READDATA = $2;</code>
 +
| &nbsp;
 +
|-
 +
| <code>BCMSDHOST_SDEDM_FSM_WRITEDATA = $3;</code>
 +
| &nbsp;
 +
|-
 +
| <code>BCMSDHOST_SDEDM_FSM_READWAIT = $4;</code>
 +
| &nbsp;
 +
|-
 +
| <code>BCMSDHOST_SDEDM_FSM_READCRC = $5;</code>
 +
| &nbsp;
 +
|-
 +
| <code>BCMSDHOST_SDEDM_FSM_WRITECRC = $6;</code>
 +
| &nbsp;
 +
|-
 +
| <code>BCMSDHOST_SDEDM_FSM_WRITEWAIT1 = $7;</code>
 +
| &nbsp;
 +
|-
 +
| <code>BCMSDHOST_SDEDM_FSM_POWERDOWN = $8;</code>
 +
| &nbsp;
 +
|-
 +
| <code>BCMSDHOST_SDEDM_FSM_POWERUP = $9;</code>
 +
| &nbsp;
 +
|-
 +
| <code>BCMSDHOST_SDEDM_FSM_WRITESTART1 = $a;</code>
 +
| &nbsp;
 +
|-
 +
| <code>BCMSDHOST_SDEDM_FSM_WRITESTART2 = $b;</code>
 +
| &nbsp;
 +
|-
 +
| <code>BCMSDHOST_SDEDM_FSM_GENPULSES = $c;</code>
 +
| &nbsp;
 +
|-
 +
| <code>BCMSDHOST_SDEDM_FSM_WRITEWAIT2 = $d;</code>
 +
| &nbsp;
 +
|-
 +
| <code>BCMSDHOST_SDEDM_FSM_STARTPOWDOWN = $f;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>BCMSDHOST_SDDATA_FIFO_WORDS = 16;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>BCMSDHOST_USE_CMD23_FLAGS = (BCMSDHOST_ALLOW_CMD23_READ * MMC_DATA_READ) or (BCMSDHOST_ALLOW_CMD23_WRITE * MMC_DATA_WRITE);</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;">'''BCMSDHOST mailbox constants''' <code> BCMSDHOST_MBOX_TAG_SET_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>BCMSDHOST_MBOX_TAG_SET_SDHOST_CLOCK = $00038042;</code>
 +
| style="width: 50%;"|Tell the firmware the SD Host clock setting so it will be adjusted for changes in core frequency
 +
|-
 +
|}
 +
</div></div>
 +
<br />
  
 
=== Type definitions ===
 
=== Type definitions ===
 
----
 
----
  
''To be documented''
+
 
 +
'''BCMSDHOST mailbox tag request'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
 
 +
<code>TBCMSDHOSTMailboxTagSetSDHostClock = record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|Mailbox tag request for BCMSDHOST_MBOX_TAG_SET_SDHOST_CLOCK
 +
|-
 +
| <code>Clock:LongWord;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>Value1:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>Value2:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
 
 +
'''BCMSDHOST host'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>PBCMSDHOSTHost = ^TBCMSDHOSTHost;</code>
 +
 
 +
<code>TBCMSDHOSTHost = record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|''SDHCI Properties''
 +
|-
 +
| <code>SDHCI:TSDHCIHost;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
|colspan="2"|''BCMSDHOST Properties''
 +
|-
 +
| <code>IRQ:LongWord;</code>
 +
| The IRQ number for this device
 +
|-
 +
| <code>Lock:TSpinHandle;</code>
 +
| Host lock (Differs from lock in Host portion) (Spin lock due to use by interrupt handler)
 +
|-
 +
| <code>EnableFIQ:LongBool;</code>
 +
| Use FIQ instead of IRQ
 +
|-
 +
| <code>GPIOFirst:LongWord;</code>
 +
| The starting pin number for GPIO assignments (or GPIO_PIN_UNKNOWN if externally configured)
 +
|-
 +
| <code>GPIOLast:LongWord;</code>
 +
| The ending pin number for GPIO assignments (or GPIO_PIN_UNKNOWN if externally configured)
 +
|-
 +
| <code>GPIOFunction:LongWord;</code>
 +
| The function number for GPIO assignments (or GPIO_FUNCTION_UNKNOWN if externally configured)
 +
|-
 +
| <code>ClockDivider:LongWord;</code>
 +
| Cached Clock Divider (CDIV) register
 +
|-
 +
| <code>HostConfiguration:LongWord;</code>
 +
| Cached Host Configuration (HCFG) register
 +
|-
 +
| <code>FirmwareSetsClockDivider:LongBool;</code>
 +
| True if the firmware controls the clock divider
 +
|-
 +
| <code>CommandQuickPollRetries:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>NanosecondsPerFifoWord:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>AllowDMA:LongBool;</code>
 +
| Allow DMA to be used for data transfers
 +
|-
 +
| <code>ResetClock:LongBool;</code>
 +
| Reset the clock for the next request
 +
|-
 +
| <code>MaxDelay:LongWord;</code>
 +
| Maximum length of time spent waiting (in Milliseconds)
 +
|-
 +
| <code>StopTime:Int64;</code>
 +
| When the last stop was issued (in Clock Ticks)
 +
|-
 +
| <code>DrainWords:LongWord;</code>
 +
| Last words of FIFO to drain on DMA read
 +
|-
 +
| <code>DrainOffset:LongWord;</code>
 +
| Offset for data during FIFO drain on DMA read
 +
|-
 +
| <code>UseSBC:LongBool;</code>
 +
| Use CMD23 (Set Block Count) for the current transfer
 +
|-
 +
| <code>UseBusy:LongBool;</code>
 +
| Wait for busy interrupt on current command
 +
|-
 +
| <code>DelayAfterStop:LongWord;</code>
 +
| Minimum time between stop and subsequent data transfer (in Microseconds)
 +
|-
 +
| <code>DelayAfterThisStop:LongWord;</code>
 +
| Minimum time between this stop and subsequent data transfer (in Microseconds)
 +
|-
 +
| <code>UserOverclock50:LongWord;</code>
 +
| User's preferred frequency to use when 50MHz is requested (in MHz)
 +
|-
 +
| <code>Overclock50:LongWord;</code>
 +
| Frequency to use when 50MHz is requested (in MHz)
 +
|-
 +
| <code>Overclock:LongWord;</code>
 +
| Current frequency if overclocked, else zero (in Hz)
 +
|-
 +
| <code>PIOLimit:LongWord;</code>
 +
| Maximum block count for PIO (0 = always DMA / 0x7FFFFFF = always PIO)
 +
|-
 +
| <code>PIOTimeout:LongWord;</code>
 +
| PIO Read or Write block timeout (in milliseconds)
 +
|-
 +
|}
 +
</div></div>
 +
<br />
  
 
=== Public variables ===
 
=== Public variables ===
 
----
 
----
  
''To be documented''
+
''None defined''
  
 
=== Function declarations ===
 
=== Function declarations ===
 
----
 
----
  
''To be documented''
 
  
 +
'''Initialization functions'''
 +
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">procedure BCMSDHOSTInit;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Initialize the BCMSDHOST unit and parameters</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| Called only during system startup
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
 +
'''BCMSDHOST functions'''
 +
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function BCMSDHOSTCreate(Address:PtrUInt; const Name:String; IRQ,DREQ,ClockMinimum,ClockMaximum,GPIOFirst,GPIOLast,GPIOFunction:LongWord; EnableFIQ:Boolean):PSDHCIHost;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Create and register a new BCMSDHOST SDHCI device which can be accessed using the SDHCI API</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Address
 +
| The address of the BCMSDHOST registers
 +
|-
 +
! Name
 +
| The text description of this device which will show in the device list (Optional)
 +
|-
 +
! IRQ
 +
| The interrupt number for the BCMSDHOST
 +
|-
 +
! DREQ
 +
| The DMA data request ID for the BCMSDHOST
 +
|-
 +
! ClockMinimum
 +
| The minimum frequency for the BCMSDHOST clock
 +
|-
 +
! ClockMaximum
 +
| The maximum frequency for the BCMSDHOST clock
 +
|-
 +
! GPIOFirst
 +
| The starting pin number for GPIO assignments (or GPIO_PIN_UNKNOWN if externally configured)
 +
|-
 +
! GPIOLast
 +
| The ending pin number for GPIO assignments (or GPIO_PIN_UNKNOWN if externally configured)
 +
|-
 +
! GPIOFunction
 +
| The function number for GPIO assignments (or GPIO_FUNCTION_UNKNOWN if externally configured)
 +
|-
 +
! EnableFIQ
 +
| Enable fast interrupt support for the BCMSDHOST
 +
|-
 +
! Return
 +
| Pointer to the new SDHCI device or nil if the SDHCI device could not be created
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function BCMSDHOSTDestroy(SDHCI:PSDHCIHost):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Stop, deregister and destroy a BCMSDHOST SDHCI device created by this driver</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! SDHCI
 +
| The SDHCI device to destroy
 +
|-
 +
! Return
 +
| ERROR_SUCCESS if completed or another error code on failure
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
 +
'''BCMSDHOST MMC functions'''
 +
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function BCMSDHOSTSendCommand(MMC:PMMCDevice; Command:PMMCCommand):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Implementation of MMCDeviceSendCommand API for BCMSDHOST SDHCI</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| Not intended to be called directly by applications, use MMCDeviceSendCommand instead.
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function BCMSDHOSTSetIOS(MMC:PMMCDevice):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Implementation of MMCDeviceSetIOS API for BCMSDHOST SDHCI</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| Not intended to be called directly by applications, use MMCDeviceSetIOS instead.
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function BCMSDHOSTGetCardDetect(MMC:PMMCDevice):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Implementation of MMCDeviceGetCardDetect API for BCMSDHOST SDHCI</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| Not intended to be called directly by applications, use MMCDeviceGetCardDetect instead.
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function BCMSDHOSTGetWriteProtect(MMC:PMMCDevice):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Implementation of MMCDeviceGetWriteProtect API for BCMSDHOST SDHCI</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| Not intended to be called directly by applications, use MMCDeviceGetWriteProtect instead.
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
 +
'''BCMSDHOST SDHCI functions'''
 +
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function BCMSDHOSTHostStart(SDHCI:PSDHCIHost):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Implementation of SDHCIHostStart API for BCMSDHOST SDHCI</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| Not intended to be called directly by applications, use SDHCIHostStart instead.
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function BCMSDHOSTHostStop(SDHCI:PSDHCIHost):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Implementation of SDHCIHostStop API for BCMSDHOST SDHCI</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| Not intended to be called directly by applications, use SDHCIHostStop instead.
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function BCMSDHOSTReset(SDHCI:PSDHCIHost; Mask:Byte):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Implementation of SDHCIReset API for BCMSDHOST SDHCI</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| Not intended to be called directly by applications, use SDHCIReset instead.
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function BCMSDHOSTHardwareReset(SDHCI:PSDHCIHost):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Implementation of SDHCIHardwareReset API for BCMSDHOST SDHCI</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| Not intended to be called directly by applications, use SDHCIHardwareReset instead.
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function BCMSDHOSTSetPower(SDHCI:PSDHCIHost; Power:Word):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Implementation of SDHCISetPower API for BCMSDHOST SDHCI</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| Not intended to be called directly by applications, use SDHCISetPower instead.
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function BCMSDHOSTSetClock(SDHCI:PSDHCIHost; Clock:LongWord):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Implementation of SDHCISetClock API for BCMSDHOST SDHCI</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| Not intended to be called directly by applications, use SDHCISetClock instead.
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">procedure BCMSDHOSTCommandWaitWorker(SDHCI:PSDHCIHost);</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Worker thread task to wait for BCMSDHOST command completion</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| Not intended to be called directly by applications
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">procedure BCMSDHOSTDMARequestCompleted(Request:PDMARequest);</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' DMA Request completion callback for the BCMSDHOST host controller</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| Not intended to be called directly by applications
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function BCMSDHOSTSharedInterruptHandler(Number,CPUID,Flags:LongWord; SDHCI:PSDHCIHost):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Interrupt handler for the BCMSDHOST host controller</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| Not intended to be called directly by applications
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
 +
'''BCMSDHOST helper functions'''
 +
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function BCMSDHOSTSetSDHostClock(var Clock,Value1,Value2:LongWord):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Set the SD Host Clock value in the Mailbox property tags channel</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
  
 
Return to [[Unit_Reference|Unit Reference]]
 
Return to [[Unit_Reference|Unit Reference]]

Latest revision as of 04:45, 29 October 2021

Return to Unit Reference


Description


Broadcom BCM27XX SDHOST Driver unit

The SDHOST controller on the BCM27XX is a non SDHCI-compliant device which requires a specific driver.

It can be routed to GPIO pins 22 to 27 (ALT0) or 48 to 53 (ALT0) in order to control the SD card slot when the SDHCI device is being used for the on board WiFi.

Note that on the Raspberry Pi 4 the SD card is no longer connected to pins 48 to 53 so the SDHOST controller cannot control the primary SD card, there is an additional SDHCI controller (EMMC2) for that purpose.

Constants



BCMSDHOST specific constants BCMSDHOST_*
BCMSDHOST_DESCRIPTION = 'Broadcom BCM27XX SDHOST'; Description of BCMSDHOST device
 
BCMSDHOST_FIFO_READ_THRESHOLD = 4;  
BCMSDHOST_FIFO_WRITE_THRESHOLD = 4;  
BCMSDHOST_ALLOW_CMD23_READ = 1;  
BCMSDHOST_ALLOW_CMD23_WRITE = 0;  
BCMSDHOST_SDDATA_FIFO_PIO_BURST = 8;  
BCMSDHOST_CMD_DALLY_US = 1;  


BCMSDHOST register BCMSDHOST_*
BCMSDHOST_SDCMD = $00; Command to SD card - 16 R/W
BCMSDHOST_SDARG = $04; Argument to SD card - 32 R/W
BCMSDHOST_SDTOUT = $08; Start value for timeout counter - 32 R/W
BCMSDHOST_SDCDIV = $0c; Start value for clock divider - 11 R/W
BCMSDHOST_SDRSP0 = $10; SD card response (31:0)- 32 R
BCMSDHOST_SDRSP1 = $14; SD card response (63:32) - 32 R
BCMSDHOST_SDRSP2 = $18; SD card response (95:64) - 32 R
BCMSDHOST_SDRSP3 = $1c; SD card response (127:96)- 32 R
BCMSDHOST_SDHSTS = $20; SD host status - 11 R
BCMSDHOST_SDVDD = $30; SD card power control - 1 R/W
BCMSDHOST_SDEDM = $34; Emergency Debug Mode - 13 R/W
BCMSDHOST_SDHCFG = $38; Host configuration - 2 R/W
BCMSDHOST_SDHBCT = $3c; Host byte count (debug) - 32 R/W
BCMSDHOST_SDDATA = $40; Data to/from SD card - 32 R/W
BCMSDHOST_SDHBLC = $50; Host block count (SDIO/SDHC) - 9 R/W


BCMSDHOST command register BCMSDHOST_SDCMD_*
BCMSDHOST_SDCMD_NEW_FLAG = $8000;  
BCMSDHOST_SDCMD_FAIL_FLAG = $4000;  
BCMSDHOST_SDCMD_BUSYWAIT = $800;  
BCMSDHOST_SDCMD_NO_RESPONSE = $400;  
BCMSDHOST_SDCMD_LONG_RESPONSE = $200;  
BCMSDHOST_SDCMD_WRITE_CMD = $80;  
BCMSDHOST_SDCMD_READ_CMD = $40;  
BCMSDHOST_SDCMD_CMD_MASK = $3f;  


BCMSDHOST clock divider register BCMSDHOST_SDCDIV_*
BCMSDHOST_SDCDIV_MAX_CDIV = $7ff;  


BCMSDHOST host status register BCMSDHOST_SDHSTS_*
BCMSDHOST_SDHSTS_BUSY_IRPT = $400;  
BCMSDHOST_SDHSTS_BLOCK_IRPT = $200;  
BCMSDHOST_SDHSTS_SDIO_IRPT = $100;  
BCMSDHOST_SDHSTS_REW_TIME_OUT = $80;  
BCMSDHOST_SDHSTS_CMD_TIME_OUT = $40;  
BCMSDHOST_SDHSTS_CRC16_ERROR = $20;  
BCMSDHOST_SDHSTS_CRC7_ERROR = $10;  
BCMSDHOST_SDHSTS_FIFO_ERROR = $08;  
04 Reserved
02 Reserved
BCMSDHOST_SDHSTS_DATA_FLAG = $01;  
 
BCMSDHOST_SDHSTS_TRANSFER_ERROR_MASK = BCMSDHOST_SDHSTS_CRC7_ERROR or BCMSDHOST_SDHSTS_CRC16_ERROR or BCMSDHOST_SDHSTS_REW_TIME_OUT or BCMSDHOST_SDHSTS_FIFO_ERROR;  
BCMSDHOST_SDHSTS_ERROR_MASK = BCMSDHOST_SDHSTS_CMD_TIME_OUT or BCMSDHOST_SDHSTS_TRANSFER_ERROR_MASK;  


BCMSDHOST host configuration register BCMSDHOST_SDHCFG_*
BCMSDHOST_SDHCFG_BUSY_IRPT_EN = (1 shl 10);  
BCMSDHOST_SDHCFG_BLOCK_IRPT_EN = (1 shl 8);  
BCMSDHOST_SDHCFG_SDIO_IRPT_EN = (1 shl 5);  
BCMSDHOST_SDHCFG_DATA_IRPT_EN = (1 shl 4);  
BCMSDHOST_SDHCFG_SLOW_CARD = (1 shl 3);  
BCMSDHOST_SDHCFG_WIDE_EXT_BUS = (1 shl 2);  
BCMSDHOST_SDHCFG_WIDE_INT_BUS = (1 shl 1);  
BCMSDHOST_SDHCFG_REL_CMD_LINE = (1 shl 0);  


BCMSDHOST emergency debug mode register BCMSDHOST_SDEDM_*
BCMSDHOST_SDEDM_FORCE_DATA_MODE = (1 shl 19);  
BCMSDHOST_SDEDM_CLOCK_PULSE = (1 shl 20);  
BCMSDHOST_SDEDM_BYPASS = (1 shl 21);  
 
BCMSDHOST_SDEDM_WRITE_THRESHOLD_SHIFT = 9;  
BCMSDHOST_SDEDM_READ_THRESHOLD_SHIFT = 14;  
BCMSDHOST_SDEDM_THRESHOLD_MASK = $1f;  
 
BCMSDHOST_SDEDM_FSM_MASK = $f;  
BCMSDHOST_SDEDM_FSM_IDENTMODE = $0;  
BCMSDHOST_SDEDM_FSM_DATAMODE = $1;  
BCMSDHOST_SDEDM_FSM_READDATA = $2;  
BCMSDHOST_SDEDM_FSM_WRITEDATA = $3;  
BCMSDHOST_SDEDM_FSM_READWAIT = $4;  
BCMSDHOST_SDEDM_FSM_READCRC = $5;  
BCMSDHOST_SDEDM_FSM_WRITECRC = $6;  
BCMSDHOST_SDEDM_FSM_WRITEWAIT1 = $7;  
BCMSDHOST_SDEDM_FSM_POWERDOWN = $8;  
BCMSDHOST_SDEDM_FSM_POWERUP = $9;  
BCMSDHOST_SDEDM_FSM_WRITESTART1 = $a;  
BCMSDHOST_SDEDM_FSM_WRITESTART2 = $b;  
BCMSDHOST_SDEDM_FSM_GENPULSES = $c;  
BCMSDHOST_SDEDM_FSM_WRITEWAIT2 = $d;  
BCMSDHOST_SDEDM_FSM_STARTPOWDOWN = $f;  
 
BCMSDHOST_SDDATA_FIFO_WORDS = 16;  
 
BCMSDHOST_USE_CMD23_FLAGS = (BCMSDHOST_ALLOW_CMD23_READ * MMC_DATA_READ) or (BCMSDHOST_ALLOW_CMD23_WRITE * MMC_DATA_WRITE);  


BCMSDHOST mailbox constants BCMSDHOST_MBOX_TAG_SET_*
BCMSDHOST_MBOX_TAG_SET_SDHOST_CLOCK = $00038042; Tell the firmware the SD Host clock setting so it will be adjusted for changes in core frequency


Type definitions



BCMSDHOST mailbox tag request

TBCMSDHOSTMailboxTagSetSDHostClock = record

Mailbox tag request for BCMSDHOST_MBOX_TAG_SET_SDHOST_CLOCK
Clock:LongWord;  
Value1:LongWord;  
Value2:LongWord;  

BCMSDHOST host

PBCMSDHOSTHost = ^TBCMSDHOSTHost;

TBCMSDHOSTHost = record

SDHCI Properties
SDHCI:TSDHCIHost;  
BCMSDHOST Properties
IRQ:LongWord; The IRQ number for this device
Lock:TSpinHandle; Host lock (Differs from lock in Host portion) (Spin lock due to use by interrupt handler)
EnableFIQ:LongBool; Use FIQ instead of IRQ
GPIOFirst:LongWord; The starting pin number for GPIO assignments (or GPIO_PIN_UNKNOWN if externally configured)
GPIOLast:LongWord; The ending pin number for GPIO assignments (or GPIO_PIN_UNKNOWN if externally configured)
GPIOFunction:LongWord; The function number for GPIO assignments (or GPIO_FUNCTION_UNKNOWN if externally configured)
ClockDivider:LongWord; Cached Clock Divider (CDIV) register
HostConfiguration:LongWord; Cached Host Configuration (HCFG) register
FirmwareSetsClockDivider:LongBool; True if the firmware controls the clock divider
CommandQuickPollRetries:LongWord;  
NanosecondsPerFifoWord:LongWord;  
AllowDMA:LongBool; Allow DMA to be used for data transfers
ResetClock:LongBool; Reset the clock for the next request
MaxDelay:LongWord; Maximum length of time spent waiting (in Milliseconds)
StopTime:Int64; When the last stop was issued (in Clock Ticks)
DrainWords:LongWord; Last words of FIFO to drain on DMA read
DrainOffset:LongWord; Offset for data during FIFO drain on DMA read
UseSBC:LongBool; Use CMD23 (Set Block Count) for the current transfer
UseBusy:LongBool; Wait for busy interrupt on current command
DelayAfterStop:LongWord; Minimum time between stop and subsequent data transfer (in Microseconds)
DelayAfterThisStop:LongWord; Minimum time between this stop and subsequent data transfer (in Microseconds)
UserOverclock50:LongWord; User's preferred frequency to use when 50MHz is requested (in MHz)
Overclock50:LongWord; Frequency to use when 50MHz is requested (in MHz)
Overclock:LongWord; Current frequency if overclocked, else zero (in Hz)
PIOLimit:LongWord; Maximum block count for PIO (0 = always DMA / 0x7FFFFFF = always PIO)
PIOTimeout:LongWord; PIO Read or Write block timeout (in milliseconds)


Public variables


None defined

Function declarations



Initialization functions

procedure BCMSDHOSTInit;
Description: Initialize the BCMSDHOST unit and parameters
Note Called only during system startup


BCMSDHOST functions

function BCMSDHOSTCreate(Address:PtrUInt; const Name:String; IRQ,DREQ,ClockMinimum,ClockMaximum,GPIOFirst,GPIOLast,GPIOFunction:LongWord; EnableFIQ:Boolean):PSDHCIHost;
Description: Create and register a new BCMSDHOST SDHCI device which can be accessed using the SDHCI API
Address The address of the BCMSDHOST registers
Name The text description of this device which will show in the device list (Optional)
IRQ The interrupt number for the BCMSDHOST
DREQ The DMA data request ID for the BCMSDHOST
ClockMinimum The minimum frequency for the BCMSDHOST clock
ClockMaximum The maximum frequency for the BCMSDHOST clock
GPIOFirst The starting pin number for GPIO assignments (or GPIO_PIN_UNKNOWN if externally configured)
GPIOLast The ending pin number for GPIO assignments (or GPIO_PIN_UNKNOWN if externally configured)
GPIOFunction The function number for GPIO assignments (or GPIO_FUNCTION_UNKNOWN if externally configured)
EnableFIQ Enable fast interrupt support for the BCMSDHOST
Return Pointer to the new SDHCI device or nil if the SDHCI device could not be created


function BCMSDHOSTDestroy(SDHCI:PSDHCIHost):LongWord;
Description: Stop, deregister and destroy a BCMSDHOST SDHCI device created by this driver
SDHCI The SDHCI device to destroy
Return ERROR_SUCCESS if completed or another error code on failure


BCMSDHOST MMC functions

function BCMSDHOSTSendCommand(MMC:PMMCDevice; Command:PMMCCommand):LongWord;
Description: Implementation of MMCDeviceSendCommand API for BCMSDHOST SDHCI
Note Not intended to be called directly by applications, use MMCDeviceSendCommand instead.


function BCMSDHOSTSetIOS(MMC:PMMCDevice):LongWord;
Description: Implementation of MMCDeviceSetIOS API for BCMSDHOST SDHCI
Note Not intended to be called directly by applications, use MMCDeviceSetIOS instead.


function BCMSDHOSTGetCardDetect(MMC:PMMCDevice):LongWord;
Description: Implementation of MMCDeviceGetCardDetect API for BCMSDHOST SDHCI
Note Not intended to be called directly by applications, use MMCDeviceGetCardDetect instead.


function BCMSDHOSTGetWriteProtect(MMC:PMMCDevice):LongWord;
Description: Implementation of MMCDeviceGetWriteProtect API for BCMSDHOST SDHCI
Note Not intended to be called directly by applications, use MMCDeviceGetWriteProtect instead.


BCMSDHOST SDHCI functions

function BCMSDHOSTHostStart(SDHCI:PSDHCIHost):LongWord;
Description: Implementation of SDHCIHostStart API for BCMSDHOST SDHCI
Note Not intended to be called directly by applications, use SDHCIHostStart instead.


function BCMSDHOSTHostStop(SDHCI:PSDHCIHost):LongWord;
Description: Implementation of SDHCIHostStop API for BCMSDHOST SDHCI
Note Not intended to be called directly by applications, use SDHCIHostStop instead.


function BCMSDHOSTReset(SDHCI:PSDHCIHost; Mask:Byte):LongWord;
Description: Implementation of SDHCIReset API for BCMSDHOST SDHCI
Note Not intended to be called directly by applications, use SDHCIReset instead.


function BCMSDHOSTHardwareReset(SDHCI:PSDHCIHost):LongWord;
Description: Implementation of SDHCIHardwareReset API for BCMSDHOST SDHCI
Note Not intended to be called directly by applications, use SDHCIHardwareReset instead.


function BCMSDHOSTSetPower(SDHCI:PSDHCIHost; Power:Word):LongWord;
Description: Implementation of SDHCISetPower API for BCMSDHOST SDHCI
Note Not intended to be called directly by applications, use SDHCISetPower instead.


function BCMSDHOSTSetClock(SDHCI:PSDHCIHost; Clock:LongWord):LongWord;
Description: Implementation of SDHCISetClock API for BCMSDHOST SDHCI
Note Not intended to be called directly by applications, use SDHCISetClock instead.


procedure BCMSDHOSTCommandWaitWorker(SDHCI:PSDHCIHost);
Description: Worker thread task to wait for BCMSDHOST command completion
Note Not intended to be called directly by applications


procedure BCMSDHOSTDMARequestCompleted(Request:PDMARequest);
Description: DMA Request completion callback for the BCMSDHOST host controller
Note Not intended to be called directly by applications


function BCMSDHOSTSharedInterruptHandler(Number,CPUID,Flags:LongWord; SDHCI:PSDHCIHost):LongWord;
Description: Interrupt handler for the BCMSDHOST host controller
Note Not intended to be called directly by applications


BCMSDHOST helper functions

function BCMSDHOSTSetSDHostClock(var Clock,Value1,Value2:LongWord):LongWord;
Description: Set the SD Host Clock value in the Mailbox property tags channel
Note None documented


Return to Unit Reference