AM64x MCU+ SDK
10.00.00
Go to the documentation of this file.
61 #include <drivers/hw_include/csl_types.h>
62 #include <drivers/hw_include/cslr_mmcsd.h>
72 #define MMCSD_CARD_TYPE_SD (0U)
73 #define MMCSD_CARD_TYPE_EMMC (1U)
74 #define MMCSD_CARD_TYPE_MMC (2U)
77 #define MMCSD_CARD_TYPE_NO_DEVICE (3U)
82 #define MMCSD_BUS_WIDTH_4BIT (0x4U)
83 #define MMCSD_BUS_WIDTH_8BIT (0x8U)
84 #define MMCSD_BUS_WIDTH_1BIT (0x1U)
90 #define MMCSD_TRANSPEED_25MBPS (0x32U)
91 #define MMCSD_TRANSPEED_50MBPS (0x5AU)
92 #define MMCSD_TRANSPEED_DEFAULT (0x32U)
93 #define MMCSD_TRANSPEED_HS (0x5AU)
94 #define MMCSD_TRANSPEED_SDR12 (0x32U)
95 #define MMCSD_TRANSPEED_SDR25 (0x5AU)
96 #define MMCSD_TRANSPEED_SDR50 (0xBU)
97 #define MMCSD_TRANSPEED_SDR104 (0x2BU)
98 #define MMCSD_TRANSPEED_DDR50 (0x3BU)
99 #define MMCSD_TRANSPEED_HS200 (0x2BU)
100 #define MMCSD_TRANSPEED_HS400 (0x4BU)
104 #define MMCSD_BUS_VOLT_1_8V (0x5U)
105 #define MMCSD_BUS_VOLT_3_0V (0x6U)
106 #define MMCSD_BUS_VOLT_3_3V (0x7U)
111 #define MMCSD_CMD_TYPE_NORMAL (0U)
112 #define MMCSD_CMD_TYPE_BUS_SUSPEND (1U)
113 #define MMCSD_CMD_TYPE_FUNC_SEL (2U)
114 #define MMCSD_CMD_TYPE_IO_ABORT (3U)
119 #define MMCSD_CMD_RSP_TYPE_NORSP (0U)
120 #define MMCSD_CMD_RSP_TYPE_L136 (1U)
121 #define MMCSD_CMD_RSP_TYPE_L48 (2U)
122 #define MMCSD_CMD_RSP_TYPE_L48_BUSY (3U)
127 #define MMCSD_CMD_XFER_TYPE_WRITE (0U)
128 #define MMCSD_CMD_XFER_TYPE_READ (1U)
133 #define MMCSD_SUPPORT_MMC_DS (0x01U)
134 #define MMCSD_SUPPORT_MMC_HS_SDR (0x02U)
135 #define MMCSD_SUPPORT_MMC_HS_DDR (0x04U)
136 #define MMCSD_SUPPORT_MMC_HS200 (0x08U)
137 #define MMCSD_SUPPORT_MMC_HS400 (0x10U)
138 #define MMCSD_SUPPORT_MMC_HS400_ES (0x20U)
139 #define MMCSD_SUPPORT_MMC_ALL (0xFFU)
144 #define MMCSD_SUPPORT_SD_DS (0x01U)
145 #define MMCSD_SUPPORT_SD_HS (0x02U)
146 #define MMCSD_SUPPORT_SD_SDR50 (0x04U)
147 #define MMCSD_SUPPORT_SD_SDR104 (0x08U)
148 #define MMCSD_SUPPORT_SD_DDR50 (0x10U)
149 #define MMCSD_SUPPORT_SD_ALL (0xFFU)
154 #define MMCSD_PHY_TYPE_HW_PHY (0U)
155 #define MMCSD_PHY_TYPE_SW_PHY (1U)
156 #define MMCSD_PHY_TYPE_NO_PHY (2U)
161 #define MMCSD_PHY_TUNING_TYPE_AUTO (0U)
162 #define MMCSD_PHY_TUNING_TYPE_MANUAL (1U)
167 #define MMCSD_PHY_MODE_HS400 (1U)
168 #define MMCSD_PHY_MODE_HS200 (2U)
169 #define MMCSD_PHY_MODE_HSSDR50 (3U)
170 #define MMCSD_PHY_MODE_HSDDR50 (4U)
171 #define MMCSD_PHY_MODE_ENHANCED_STROBE (5U)
172 #define MMCSD_PHY_MODE_SDR104 (6U)
173 #define MMCSD_PHY_MODE_SDR50 (7U)
174 #define MMCSD_PHY_MODE_DDR50 (8U)
175 #define MMCSD_PHY_MODE_SDR25 (9U)
176 #define MMCSD_PHY_MODE_SDR12 (10U)
177 #define MMCSD_PHY_MODE_HS (11U)
178 #define MMCSD_PHY_MODE_DS (12U)
183 #define MMCSD_UHS_MODE_SDR12 (0U)
184 #define MMCSD_UHS_MODE_SDR25 (1U)
185 #define MMCSD_UHS_MODE_SDR50 (2U)
186 #define MMCSD_UHS_MODE_SDR104 (3U)
187 #define MMCSD_UHS_MODE_DDR50 (4U)
188 #define MMCSD_UHS_MODE_HS400 (5U)
189 #define MMCSD_UHS_MODE_UHS2 (7U)
338 uint32_t response[4];
uint32_t intrEnable
Definition: mmcsd/v0/mmcsd.h:364
MMCSD_Handle MMCSD_open(uint32_t index, const MMCSD_Params *openParams)
This function opens a given MMCSD peripheral.
MMCSD_EmmcDeviceData * emmcData
Definition: mmcsd/v0/mmcsd.h:411
uint32_t eventId
Definition: mmcsd/v0/mmcsd.h:370
uint32_t ocr
Definition: mmcsd/v0/mmcsd.h:263
uint8_t manuID
Definition: mmcsd/v0/mmcsd.h:278
uint32_t isHC
Definition: mmcsd/v0/mmcsd.h:426
SemaphoreP_Object dataCopyCompleteSemObj
Definition: mmcsd/v0/mmcsd.h:522
uint8_t transferSpeed
Definition: mmcsd/v0/mmcsd.h:291
uint32_t blockCount
Definition: mmcsd/v0/mmcsd.h:241
SD device properties.
Definition: mmcsd/v0/mmcsd.h:262
uint32_t dataBlockSize
Definition: mmcsd/v0/mmcsd.h:494
volatile uint32_t cmdEBError
Definition: mmcsd/v0/mmcsd.h:465
uint32_t busVoltage
Definition: mmcsd/v0/mmcsd.h:382
uint32_t isCmd23
Definition: mmcsd/v0/mmcsd.h:432
uint32_t cmd
Definition: mmcsd/v0/mmcsd.h:311
uint32_t rca
Definition: mmcsd/v0/mmcsd.h:219
uint16_t index
Definition: tisci_rm_proxy.h:3
volatile uint32_t cmdTimeout
Definition: mmcsd/v0/mmcsd.h:459
uint32_t blockSize
Definition: mmcsd/v0/mmcsd.h:323
SemaphoreP_Object xferMutex
Definition: mmcsd/v0/mmcsd.h:516
SemaphoreP_Object cmdCompleteSemObj
Definition: mmcsd/v0/mmcsd.h:519
uint8_t * writeBufIdx
Definition: mmcsd/v0/mmcsd.h:500
uint8_t specVersion
Definition: mmcsd/v0/mmcsd.h:285
uint32_t isTuning
Definition: mmcsd/v0/mmcsd.h:335
uint64_t blockCount
Definition: mmcsd/v0/mmcsd.h:444
uint32_t isSwitch1_8V
Definition: mmcsd/v0/mmcsd.h:438
uint32_t isManualTuning
Definition: mmcsd/v0/mmcsd.h:504
volatile uint32_t dataEBError
Definition: mmcsd/v0/mmcsd.h:474
uint8_t * tempDataBuf
Definition: mmcsd/v0/mmcsd.h:408
uint32_t busWidth
Definition: mmcsd/v0/mmcsd.h:420
SemaphoreP_Object xferCompleteSemObj
Definition: mmcsd/v0/mmcsd.h:525
uint64_t mediaSize
Definition: mmcsd/v0/mmcsd.h:447
uint32_t ssBaseAddr
Definition: mmcsd/v0/mmcsd.h:352
uint32_t inputClkFreq
Definition: mmcsd/v0/mmcsd.h:355
uint16_t maxReadBlockLen
Definition: mmcsd/v0/mmcsd.h:269
uint32_t isOpen
Definition: mmcsd/v0/mmcsd.h:507
MMCSD_Object * object
Definition: mmcsd/v0/mmcsd.h:537
uint32_t cardType
Definition: mmcsd/v0/mmcsd.h:405
void MMCSD_init(void)
This function initializes the MMCSD module.
uint32_t dir
Definition: mmcsd/v0/mmcsd.h:314
uint32_t busWidth
Definition: mmcsd/v0/mmcsd.h:376
MMCSD_SdDeviceData * sdData
Definition: mmcsd/v0/mmcsd.h:414
MMCSD transaction.
Definition: mmcsd/v0/mmcsd.h:310
uint8_t eStrobeSupport
Definition: mmcsd/v0/mmcsd.h:250
const MMCSD_Attrs * attrs
Definition: mmcsd/v0/mmcsd.h:535
int32_t MMCSD_enableBootPartition(MMCSD_Handle handle, uint32_t partitionNum)
This function enables the boot partition if the connected media is eMMC.
uint8_t manuID
Definition: mmcsd/v0/mmcsd.h:231
uint32_t cardType
Definition: mmcsd/v0/mmcsd.h:373
uint32_t isCmd23
Definition: mmcsd/v0/mmcsd.h:294
uint8_t specVersion
Definition: mmcsd/v0/mmcsd.h:238
uint32_t ocr
Definition: mmcsd/v0/mmcsd.h:216
volatile uint32_t cmdCRCError
Definition: mmcsd/v0/mmcsd.h:462
int32_t MMCSD_read(MMCSD_Handle handle, uint8_t *buf, uint32_t startBlk, uint32_t numBlks)
Function to perform block reads from the MMC/SD media.
uint32_t gMmcsdConfigNum
Externally defined driver configuration array size.
uint32_t MMCSD_isHC(MMCSD_Handle handle)
This function returns if the media connected is High Capacity (> 2GB in size) or not.
uint32_t intrNum
Definition: mmcsd/v0/mmcsd.h:367
uint32_t isUHS
Definition: mmcsd/v0/mmcsd.h:429
uint32_t supportedModes
Definition: mmcsd/v0/mmcsd.h:379
HwiP_Object hwiObj
Definition: mmcsd/v0/mmcsd.h:528
volatile uint32_t cmdError
Definition: mmcsd/v0/mmcsd.h:477
uint32_t enableDma
Definition: mmcsd/v0/mmcsd.h:450
uint32_t MMCSD_getBlockCount(MMCSD_Handle handle)
This function returns the block count of User Data Area of the MMC/SD media connected to the MMCSD co...
uint32_t rca
Definition: mmcsd/v0/mmcsd.h:266
uint32_t is1_8V
Definition: mmcsd/v0/mmcsd.h:435
uint32_t phyType
Definition: mmcsd/v0/mmcsd.h:388
uint32_t ctrlBaseAddr
Definition: mmcsd/v0/mmcsd.h:349
uint8_t supportedModes
Definition: mmcsd/v0/mmcsd.h:247
uint8_t * dataBuf
Definition: mmcsd/v0/mmcsd.h:206
uint8_t * readBufIdx
Definition: mmcsd/v0/mmcsd.h:496
void * MMCSD_Handle
Definition: mmcsd/v0/mmcsd.h:191
volatile uint32_t xferInProgress
Definition: mmcsd/v0/mmcsd.h:480
MMCSD instance attributes - used during init time.
Definition: mmcsd/v0/mmcsd.h:202
uint32_t MMCSD_getBlockSize(MMCSD_Handle handle)
This function returns the block size of the MMC/SD media connected to the MMCSD controller.
uint32_t dataBlockCount
Definition: mmcsd/v0/mmcsd.h:492
eMMC device properties
Definition: mmcsd/v0/mmcsd.h:215
void MMCSD_deinit(void)
This function de-initializes the MMCSD module.
uint16_t maxReadBlockLen
Definition: mmcsd/v0/mmcsd.h:222
MMCSD driver object.
Definition: mmcsd/v0/mmcsd.h:401
volatile uint32_t xferComp
Definition: mmcsd/v0/mmcsd.h:483
uint8_t transferSpeed
Definition: mmcsd/v0/mmcsd.h:244
uint32_t supportedDataWidths
Definition: mmcsd/v0/mmcsd.h:297
void MMCSD_Params_init(MMCSD_Params *mmcsdParams)
Initialize data structure with defaults.
void * dataBuf
Definition: mmcsd/v0/mmcsd.h:320
Opaque Hwi object used with the Hwi APIs.
Definition: HwiP.h:93
MMCSD_Handle handle
Definition: mmcsd/v0/mmcsd.h:402
uint32_t enableDma
Definition: mmcsd/v0/mmcsd.h:332
void * deviceData
Definition: mmcsd/v0/mmcsd.h:203
volatile uint32_t dataCRCError
Definition: mmcsd/v0/mmcsd.h:471
uint16_t maxWriteBlockLen
Definition: mmcsd/v0/mmcsd.h:225
uint32_t outputClkFreq
Definition: mmcsd/v0/mmcsd.h:358
volatile uint32_t cmdIndexError
Definition: mmcsd/v0/mmcsd.h:468
uint32_t arg
Definition: mmcsd/v0/mmcsd.h:317
uint8_t sdVer
Definition: mmcsd/v0/mmcsd.h:417
uint32_t transferSpeed
Definition: mmcsd/v0/mmcsd.h:423
Definition: mmcsd/v0/mmcsd.h:534
uint32_t blockCount
Definition: mmcsd/v0/mmcsd.h:326
Opaque semaphore object used with the semaphore APIs.
Definition: SemaphoreP.h:59
uint32_t isHS
Definition: mmcsd/v0/mmcsd.h:385
MMCSD_Config gMmcsdConfig[]
Externally defined driver configuration array.
uint32_t enableDma
Definition: mmcsd/v0/mmcsd.h:361
MMCSD instance attributes - used during init time.
Definition: mmcsd/v0/mmcsd.h:348
uint32_t blockCount
Definition: mmcsd/v0/mmcsd.h:288
void MMCSD_close(MMCSD_Handle handle)
Function to close a MMCSD peripheral specified by the MMCSD handle.
uint32_t autoCmdEn
Definition: mmcsd/v0/mmcsd.h:329
SemaphoreP_Object cmdMutex
Definition: mmcsd/v0/mmcsd.h:513
volatile uint32_t xferTimeout
Definition: mmcsd/v0/mmcsd.h:486
int32_t MMCSD_disableBootPartition(MMCSD_Handle handle)
This function disables the boot partition if the connected media is eMMC.
uint32_t intrEnable
Definition: mmcsd/v0/mmcsd.h:453
uint32_t readBlockCount
Definition: mmcsd/v0/mmcsd.h:498
int32_t MMCSD_write(MMCSD_Handle handle, uint8_t *buf, uint32_t startBlk, uint32_t numBlks)
Function to perform block writes to the MMC/SD media.
uint32_t xferHighSpeedEn
Definition: mmcsd/v0/mmcsd.h:510
volatile uint32_t cmdComp
Definition: mmcsd/v0/mmcsd.h:456
MMCSD_Handle MMCSD_getHandle(uint32_t index)
This function returns the handle of an open MMCSD Instance from the instance index.
uint8_t driveStrength
Definition: mmcsd/v0/mmcsd.h:253
uint8_t * dataBufIdx
Definition: mmcsd/v0/mmcsd.h:489
uint32_t writeBlockCount
Definition: mmcsd/v0/mmcsd.h:502
uint32_t tuningType
Definition: mmcsd/v0/mmcsd.h:391
uint32_t blockSize
Definition: mmcsd/v0/mmcsd.h:441
uint16_t maxWriteBlockLen
Definition: mmcsd/v0/mmcsd.h:272