Unit BCMSDHOST

From Ultibo.org
Jump to: navigation, search

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



[Expand]
BCMSDHOST specific constants BCMSDHOST_*


[Expand]
BCMSDHOST register BCMSDHOST_*


[Expand]
BCMSDHOST command register BCMSDHOST_SDCMD_*


[Expand]
BCMSDHOST clock divider register BCMSDHOST_SDCDIV_*


[Expand]
BCMSDHOST host status register BCMSDHOST_SDHSTS_*


[Expand]
BCMSDHOST host configuration register BCMSDHOST_SDHCFG_*


[Expand]
BCMSDHOST emergency debug mode register BCMSDHOST_SDEDM_*


[Expand]
BCMSDHOST mailbox constants BCMSDHOST_MBOX_TAG_SET_*


Type definitions



BCMSDHOST mailbox tag request

[Expand]

TBCMSDHOSTMailboxTagSetSDHostClock = record

BCMSDHOST host

[Expand]

PBCMSDHOSTHost = ^TBCMSDHOSTHost;

TBCMSDHOSTHost = record


Public variables


None defined

Function declarations



Initialization functions

[Expand]
procedure BCMSDHOSTInit;
Description: Initialize the BCMSDHOST unit and parameters


BCMSDHOST functions

[Expand]
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


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


BCMSDHOST MMC functions

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


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


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


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


BCMSDHOST SDHCI functions

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


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


[Expand]
function BCMSDHOSTReset(SDHCI:PSDHCIHost; Mask:Byte):LongWord;
Description: Implementation of SDHCIReset API for BCMSDHOST SDHCI


[Expand]
function BCMSDHOSTHardwareReset(SDHCI:PSDHCIHost):LongWord;
Description: Implementation of SDHCIHardwareReset API for BCMSDHOST SDHCI


[Expand]
function BCMSDHOSTSetPower(SDHCI:PSDHCIHost; Power:Word):LongWord;
Description: Implementation of SDHCISetPower API for BCMSDHOST SDHCI


[Expand]
function BCMSDHOSTSetClock(SDHCI:PSDHCIHost; Clock:LongWord):LongWord;
Description: Implementation of SDHCISetClock API for BCMSDHOST SDHCI


[Expand]
procedure BCMSDHOSTCommandWaitWorker(SDHCI:PSDHCIHost);
Description: Worker thread task to wait for BCMSDHOST command completion


[Expand]
procedure BCMSDHOSTDMARequestCompleted(Request:PDMARequest);
Description: DMA Request completion callback for the BCMSDHOST host controller


[Expand]
function BCMSDHOSTSharedInterruptHandler(Number,CPUID,Flags:LongWord; SDHCI:PSDHCIHost):LongWord;
Description: Interrupt handler for the BCMSDHOST host controller


BCMSDHOST helper functions

[Expand]
function BCMSDHOSTSetSDHostClock(var Clock,Value1,Value2:LongWord):LongWord;
Description: Set the SD Host Clock value in the Mailbox property tags channel


Return to Unit Reference