|
AM243x MCU+ SDK
10.01.00
|
|
Go to the documentation of this file.
70 #include <drivers/hw_include/cslr.h>
71 #include <drivers/hw_include/cslr64.h>
72 #include <drivers/hw_include/hw_types.h>
73 #include <drivers/hw_include/cslr_mmcsd.h>
74 #include <drivers/mmcsd/v0/cslr_mmcsd.h>
87 #define MMCSD_STS_SUCCESS ((int32_t) 0)
90 #define MMCSD_STS_ERR ((int32_t)-1)
93 #define MMCSD_STS_ERR_TIMEOUT ((int32_t)-2)
95 #define MMCSD_STS_ERR_INVALID_PARAM ((int32_t)-3)
97 #define MMCSD_STS_ERR_BUSY ((int32_t)-4)
99 #define MMCSD_STS_ERR_CARD_NOT_FOUND ((int32_t)-5)
101 #define MMCSD_STS_ERR_CARD_UNUSEABLE ((int32_t)-6)
103 #define MMCSD_STS_ERR_CARD_UNLOCK_FAIL ((int32_t)-7)
115 #define MMCSD_NO_WAIT ((uint32_t)0)
118 #define MMCSD_WAIT_FOREVER ((uint32_t)-1)
130 #define MMCSD_STATE_RESET ((uint8_t) 0U)
133 #define MMCSD_STATE_IDLE ((uint8_t) 1U)
136 #define MMCSD_STATE_BUSY ((uint8_t) 2U)
139 #define MMCSD_STATE_ERROR ((uint8_t) 3U)
150 #define MMCSD_XFER_IDLE_STATE ((uint8_t) 0U)
152 #define MMCSD_XFER_CMD_STATE ((uint8_t) 1U)
154 #define MMCSD_XFER_WRITE_STATE ((uint8_t) 2U)
156 #define MMCSD_XFER_READ_STATE ((uint8_t) 3U)
166 #define MMCSD_SLOT_TYPE_VAL_REMOVABLE ((uint8_t) 0x0U)
167 #define MMCSD_SLOT_TYPE_VAL_EMBEDDED ((uint8_t) 0x1U)
168 #define MMCSD_SLOT_TYPE_VAL_SHARED ((uint8_t) 0x2U)
178 #define MMCSD_CARD_TYPE_SD ((uint32_t) 0U)
179 #define MMCSD_CARD_TYPE_EMMC ((uint32_t) 2U)
180 #define MMCSD_CARD_TYPE_NO_DEVICE ((uint32_t) 3U)
190 #define MMCSD_PHY_TYPE_HW_PHY ((uint32_t) 0U)
191 #define MMCSD_PHY_TYPE_SW_PHY ((uint32_t) 1U)
192 #define MMCSD_PHY_TYPE_NO_PHY ((uint32_t) 2U)
202 #define MMCSD_BUS_WIDTH_4BIT ((uint32_t) 0x4U)
203 #define MMCSD_BUS_WIDTH_8BIT ((uint32_t) 0x8U)
204 #define MMCSD_BUS_WIDTH_1BIT ((uint32_t) 0x1U)
214 #define MMCSD_PHY_TUNING_TYPE_AUTO ((uint32_t) 0U)
215 #define MMCSD_PHY_TUNING_TYPE_MANUAL ((uint32_t) 1U)
225 #define MMCSD_SD_MODE_HS ((uint32_t) 10U)
226 #define MMCSD_SD_MODE_DS ((uint32_t) 11U)
227 #define MMCSD_SD_MODE_SDR12 ((uint32_t) 12U)
228 #define MMCSD_SD_MODE_SDR25 ((uint32_t) 13U)
229 #define MMCSD_SD_MODE_SDR50 ((uint32_t) 14U)
230 #define MMCSD_SD_MODE_DDR50 ((uint32_t) 15U)
231 #define MMCSD_SD_MODE_SDR104 ((uint32_t) 16U)
241 #define MMCSD_MMC_MODE_SDR25 ((uint32_t) 20U)
242 #define MMCSD_MMC_MODE_SDR50 ((uint32_t) 21U)
243 #define MMCSD_MMC_MODE_HS200 ((uint32_t) 23U)
392 uint32_t response[4];
528 uint32_t startBlk, uint32_t numBlks);
541 uint32_t startBlk, uint32_t numBlks);
554 uint32_t startBlk, uint32_t numBlks);
567 uint32_t startBlk, uint32_t numBlks);
580 uint32_t startBlk, uint32_t numBlks);
593 uint32_t startBlk, uint32_t numBlks);
606 uint32_t startBlk, uint32_t numBlks);
619 uint32_t startBlk, uint32_t numBlks);
631 uint32_t busSpeed, uint32_t busWidth);
653 uint32_t tuningType);
668 uint32_t partitionNum);
uint32_t setBusSpeed
Definition: mmcsd_lld.h:465
uint8_t * dataBufIdx
Definition: mmcsd_lld.h:452
uint32_t slotType
Definition: mmcsd_lld.h:419
int32_t MMCSD_lld_read_SD_Poll(MMCSDLLD_Handle handle, uint8_t *buf, uint32_t startBlk, uint32_t numBlks)
Function to perform block reads from the SD media in Polling Mode.
uint32_t intrNum
Definition: mmcsd_lld.h:417
uint32_t ocr
Definition: mmcsd_lld.h:336
bool autoAssignMaxSpeed
Definition: mmcsd_lld.h:410
uint8_t manuID
Definition: mmcsd_lld.h:346
MMCSD_lld_transferCompleteCallback transferCompleteCallback
Definition: mmcsd_lld.h:477
uint8_t transferSpeed
Definition: mmcsd_lld.h:354
uint8_t * dataBuf
Definition: mmcsd_lld.h:433
uint32_t blockCount
Definition: mmcsd_lld.h:316
bool enableDma
Definition: mmcsd_lld.h:423
SD device properties.
Definition: mmcsd_lld.h:333
uint32_t(* MMCSD_Clock_usecToTicks)(uint64_t usecs)
The definition of a micro seconds to ticks function used by the MMCSD driver to get ticks from micros...
Definition: mmcsd_lld.h:269
uint32_t rca
Definition: mmcsd_lld.h:302
uint8_t state
Definition: mmcsd_lld.h:471
int32_t MMCSD_lld_enableBootPartition(MMCSDLLD_Handle handle, uint32_t partitionNum)
Function to enable the boot partition given the media is eMMC.
void MMCSD_lld_Isr(void *args)
This is the MMCSD Controller ISR and can be used as IRQ handler.
uint8_t specVersion
Definition: mmcsd_lld.h:350
int32_t MMCSD_lld_read_MMC_Intr(MMCSDLLD_Handle handle, uint8_t *buf, uint32_t startBlk, uint32_t numBlks)
Function to perform block reads from the MMC media in Interrupt Mode.
uint32_t setBusWidth
Definition: mmcsd_lld.h:467
MMCSDLLD Transaction.
Definition: mmcsd_lld.h:371
bool pllEnableSD
Definition: mmcsd_lld.h:427
uint32_t tuningType
Definition: mmcsd_lld.h:415
uint32_t arg
Definition: mmcsd_lld.h:378
uint16_t xferErrorStat
Definition: mmcsd_lld.h:450
uint16_t maxReadBlockLen
Definition: mmcsd_lld.h:340
uint32_t ctrlBaseAddr
Definition: mmcsd_lld.h:402
int32_t MMCSD_lld_write_MMC_Intr(MMCSDLLD_Handle handle, uint8_t *buf, uint32_t startBlk, uint32_t numBlks)
Function to perform block writes to the MMC media in Interrupt Mode.
bool isHC
Definition: mmcsd_lld.h:360
int32_t MMCSD_lld_deInit(MMCSDLLD_Handle handle)
This API De-Initializes the MMCSD instance.
uint32_t autoCmdEn
Definition: mmcsd_lld.h:386
uint32_t(* MMCSD_Clock_getTicks)(void)
The definition of a get System Tick function used by the MMCSD driver to keep track of time.
Definition: mmcsd_lld.h:258
int32_t MMCSD_lld_write_SD_Intr(MMCSDLLD_Handle handle, uint8_t *buf, uint32_t startBlk, uint32_t numBlks)
Function to perform block writes to the SD media in Interrupt Mode.
MMCSDLLD_Transaction * currentTxn
Definition: mmcsd_lld.h:460
MMCSD Driver Initialization Object.
Definition: mmcsd_lld.h:399
uint8_t eStrobeSupport
Definition: mmcsd_lld.h:322
uint8_t manuID
Definition: mmcsd_lld.h:310
uint32_t isCmd23
Definition: mmcsd_lld.h:356
uint8_t specVersion
Definition: mmcsd_lld.h:314
uint32_t ocr
Definition: mmcsd_lld.h:300
uint32_t cardType
Definition: mmcsd_lld.h:408
uint32_t ssBaseAddr
Definition: mmcsd_lld.h:404
int32_t MMCSD_lld_change_Bus_Config_MMC(MMCSDLLD_Handle handle, uint32_t busSpeed, uint32_t busWidth)
Function to reconfigure the bus Speed and Bus width of the bus for MMC.
MMCSD Driver Object.
Definition: mmcsd_lld.h:445
uint32_t blockCount
Definition: mmcsd_lld.h:384
struct MMCSDLLD_InitObject * MMCSDLLD_InitHandle
MMCSD_Clock_getTicks Clock_getTicks
Definition: mmcsd_lld.h:435
uint8_t * dataBuf
Definition: mmcsd_lld.h:380
int32_t MMCSD_lld_read_SD_Intr(MMCSDLLD_Handle handle, uint8_t *buf, uint32_t startBlk, uint32_t numBlks)
Function to perform block reads from the SD media in Interrupt Mode.
uint32_t rca
Definition: mmcsd_lld.h:338
int32_t MMCSD_lld_disableBootPartition(MMCSDLLD_Handle handle)
This function disables the boot partition if the media is eMMC.
uint32_t remainingBlockCount
Definition: mmcsd_lld.h:458
uint8_t supportedModes
Definition: mmcsd_lld.h:320
uint32_t blockSize
Definition: mmcsd_lld.h:382
int32_t MMCSD_lld_write_SD_Poll(MMCSDLLD_Handle handle, uint8_t *buf, uint32_t startBlk, uint32_t numBlks)
Function to perform block writes to the SD media in Polling Mode.
uint32_t dataBlockCount
Definition: mmcsd_lld.h:454
int32_t MMCSD_lld_read_MMC_Poll(MMCSDLLD_Handle handle, uint8_t *buf, uint32_t startBlk, uint32_t numBlks)
Function to perform block reads from the MMC media in Polling Mode.
int32_t MMCSD_lld_init(MMCSDLLD_Handle handle)
This API Initializes the MMCSD instance.
eMMC device properties
Definition: mmcsd_lld.h:297
uint16_t maxReadBlockLen
Definition: mmcsd_lld.h:304
uint32_t busWidth
Definition: mmcsd_lld.h:421
struct MMCSDLLD_Object * MMCSDLLD_Handle
uint8_t transferSpeed
Definition: mmcsd_lld.h:318
uint32_t supportedDataWidths
Definition: mmcsd_lld.h:358
MMCSDLLD_Transaction mmcsdTxn
Definition: mmcsd_lld.h:462
uint16_t maxWriteBlockLen
Definition: mmcsd_lld.h:306
uint32_t isTuning
Definition: mmcsd_lld.h:390
int32_t MMCSD_lld_change_Bus_Config_SD(MMCSDLLD_Handle handle, uint32_t busSpeed)
Function to reconfigure the bus Speed and Bus width of the bus for MMC.
uint32_t MMCSD_lld_getBlockSize(MMCSDLLD_Handle handle)
This function returns the block size of the MMC/SD media connected to the MMCSD controller.
void * deviceData
Definition: mmcsd_lld.h:429
uint32_t dir
Definition: mmcsd_lld.h:376
int32_t MMCSD_lld_write_MMC_Poll(MMCSDLLD_Handle handle, uint8_t *buf, uint32_t startBlk, uint32_t numBlks)
Function to perform block writes to the MMC media in Polling Mode.
bool isHC
Definition: mmcsd_lld.h:326
uint32_t phyType
Definition: mmcsd_lld.h:425
uint32_t dataBlockSize
Definition: mmcsd_lld.h:456
uint32_t blockCount
Definition: mmcsd_lld.h:352
MMCSDLLD_InitHandle initHandle
Definition: mmcsd_lld.h:473
uint32_t cmd
Definition: mmcsd_lld.h:374
uint32_t enableDma
Definition: mmcsd_lld.h:388
void(* MMCSD_lld_transferCompleteCallback)(void *args, int32_t xferStatus)
The definition of a transfer completion callback function used by the MMCSD driver when used in Callb...
Definition: mmcsd_lld.h:287
uint32_t inputClkFreq
Definition: mmcsd_lld.h:406
void * args
Definition: mmcsd_lld.h:475
uint8_t xferState
Definition: mmcsd_lld.h:469
MMCSD_Clock_uSleep Clock_uSleep
Definition: mmcsd_lld.h:437
uint16_t cmdErrorStat
Definition: mmcsd_lld.h:448
uint8_t driveStrength
Definition: mmcsd_lld.h:324
void(* MMCSD_Clock_uSleep)(uint32_t usec)
The definition of a sleep function used by the MMCSD driver for delay.
Definition: mmcsd_lld.h:278
uint32_t uaBusSpeed
Definition: mmcsd_lld.h:412
int32_t MMCSD_lld_change_Tuning_Type(MMCSDLLD_Handle handle, uint32_t tuningType)
Function to reconfigure the bus Speed and Bus width of the bus for MMC.
uint16_t maxWriteBlockLen
Definition: mmcsd_lld.h:342