AM62x MCU+ SDK  10.00.00
mmcsd/v0/mmcsd.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2021-24 Texas Instruments Incorporated
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  *
8  * Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  *
11  * Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in the
13  * documentation and/or other materials provided with the
14  * distribution.
15  *
16  * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
32 
50 #ifndef MMCSD_H_
51 #define MMCSD_H_
52 
53 /* ========================================================================== */
54 /* Include Files */
55 /* ========================================================================== */
56 
57 #include <stdint.h>
58 #include <kernel/dpl/SystemP.h>
59 #include <kernel/dpl/SemaphoreP.h>
60 #include <kernel/dpl/HwiP.h>
61 #include <drivers/hw_include/csl_types.h>
62 #include <drivers/hw_include/cslr_mmcsd.h>
63 
64 #ifdef __cplusplus
65 extern "C" {
66 #endif
67 
68 /* ========================================================================== */
69 /* Macros & Typedefs */
70 /* ========================================================================== */
71 
72 #define MMCSD_CARD_TYPE_SD (0U)
73 #define MMCSD_CARD_TYPE_EMMC (1U)
74 #define MMCSD_CARD_TYPE_MMC (2U)
75 
76 /* useful in cases where SoC has MMCSD IP but no device attached to peripheral */
77 #define MMCSD_CARD_TYPE_NO_DEVICE (3U)
78 
79 /*
80 * \brief Macros that can be used for selecting the bus/data width
81 */
82 #define MMCSD_BUS_WIDTH_4BIT (0x4U)
83 #define MMCSD_BUS_WIDTH_8BIT (0x8U)
84 #define MMCSD_BUS_WIDTH_1BIT (0x1U)
85 
86 
87 /*
88 * \brief Macros that can be used for selecting the media transfer speed
89 */
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)
101 /*
102 * \brief Macros that can be used for selecting the bus voltage
103 */
104 #define MMCSD_BUS_VOLT_1_8V (0x5U) /* Embedded */
105 #define MMCSD_BUS_VOLT_3_0V (0x6U) /* Typical */
106 #define MMCSD_BUS_VOLT_3_3V (0x7U) /* Flattop */
107 
108 /*
109 * \brief Macros that can be used for selecting command types
110 */
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)
115 
116 /*
117 * \brief Macros that can be used for selecting command response types
118 */
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)
123 
124 /*
125 * \brief Macros that can be used for selecting transfer types
126 */
127 #define MMCSD_CMD_XFER_TYPE_WRITE (0U)
128 #define MMCSD_CMD_XFER_TYPE_READ (1U)
129 
130 /*
131 * \brief Macros that can be used for selecting supported MMC modes
132 */
133 #define MMCSD_SUPPORT_MMC_DS (0x01U) /* DS (Up to 26Mhz) */
134 #define MMCSD_SUPPORT_MMC_HS_SDR (0x02U) /* HS (Up to 52Mhz) */
135 #define MMCSD_SUPPORT_MMC_HS_DDR (0x04U) /* HS (Up to 52Mhz) */
136 #define MMCSD_SUPPORT_MMC_HS200 (0x08U) /* HS200 (Up to 200Mhz) */
137 #define MMCSD_SUPPORT_MMC_HS400 (0x10U) /* HS400 (Up to 400Mhz) */
138 #define MMCSD_SUPPORT_MMC_ALL (0xFFU) /* All modes */
139 
140 /*
141 * \brief Macros that can be used for selecting supported SD modes
142 */
143 #define MMCSD_SUPPORT_SD_DS (0x01U)
144 #define MMCSD_SUPPORT_SD_HS (0x02U)
145 #define MMCSD_SUPPORT_SD_SDR50 (0x04U)
146 #define MMCSD_SUPPORT_SD_SDR104 (0x08U)
147 #define MMCSD_SUPPORT_SD_DDR50 (0x10U)
148 #define MMCSD_SUPPORT_SD_ALL (0xFFU) /* All modes */
149 
150 /*
151 * \brief Macros that can be used for selecting PHY types
152 */
153 #define MMCSD_PHY_TYPE_HW_PHY (0U)
154 #define MMCSD_PHY_TYPE_SW_PHY (1U)
155 #define MMCSD_PHY_TYPE_NO_PHY (2U)
156 
157 /*
158 * \brief Macros that can be used for selecting PHY tuning type
159 */
160 #define MMCSD_PHY_TUNING_TYPE_AUTO (0U)
161 #define MMCSD_PHY_TUNING_TYPE_MANUAL (1U)
162 
163 /*
164 * \brief Macros that can be used for selecting PHY modes
165 */
166 #define MMCSD_PHY_MODE_HS400 (1U)
167 #define MMCSD_PHY_MODE_HS200 (2U)
168 #define MMCSD_PHY_MODE_HSSDR50 (3U)
169 #define MMCSD_PHY_MODE_HSDDR50 (4U)
170 #define MMCSD_PHY_MODE_SDR104 (5U)
171 #define MMCSD_PHY_MODE_SDR50 (6U)
172 #define MMCSD_PHY_MODE_DDR50 (7U)
173 #define MMCSD_PHY_MODE_SDR25 (8U)
174 #define MMCSD_PHY_MODE_SDR12 (9U)
175 #define MMCSD_PHY_MODE_HS (10U)
176 #define MMCSD_PHY_MODE_DS (11U)
177 
178 /*
179 * \brief Macros that can be used for selecting UHS 1 modes
180 */
181 #define MMCSD_UHS_MODE_SDR12 (0U)
182 #define MMCSD_UHS_MODE_SDR25 (1U)
183 #define MMCSD_UHS_MODE_SDR50 (2U)
184 #define MMCSD_UHS_MODE_SDR104 (3U)
185 #define MMCSD_UHS_MODE_DDR50 (4U)
186 #define MMCSD_UHS_MODE_HS400 (5U)
187 #define MMCSD_UHS_MODE_UHS2 (7U)
188 
189 typedef void* MMCSD_Handle;
190 
191 /* ========================================================================== */
192 /* Structure Declarations */
193 /* ========================================================================== */
199 typedef struct
200 {
201  void* deviceData;
202  /* Pointer to eMMC/SD device data structure. Memory for this structure has to be allocated in application */
203 
204  uint8_t *dataBuf;
205  /* Pointer to a 512 byte dataBuffer used for temporary data transactions internal to driver like ECSD read, tuning etc. To be allocated by application */
206 
207 } MMCSD_Params;
208 
212 typedef struct
213 {
214  uint32_t ocr;
215  /* Operating conditions register */
216 
217  uint32_t rca;
218  /* Relative card address register */
219 
220  uint16_t maxReadBlockLen;
221  /* Maximum supported block length for read */
222 
224  /* Maximum supported block length for read */
225 
226  char manuDate[9];
227  /* ASCII string with the date of manufacture */
228 
229  uint8_t manuID;
230  /* Card manufacturer ID */
231 
232  char productName[7];
233  /* Product name */
234 
235  /* From CSD */
236  uint8_t specVersion;
237  /* eMMC specification version */
238 
239  uint32_t blockCount;
240  /* Number of blocks in the eMMC */
241 
242  uint8_t transferSpeed;
243  /* Transfer speed in code - Freq Unit x Mult Factor */
244 
245  uint16_t dsr;
246  /* Driver stage register */
247 
248  bool impDsr;
249  /* DSR implementation check value. Obtained from the CSD register read. */
250 
251  uint8_t supportedModes;
252  /* Supported speed modes by the device - HS200, HS400 etc */
253 
254  uint8_t eStrobeSupport;
255  /* Support of enhanced strobe */
256 
257  uint8_t driveStrength;
258  /* Drive strength of the device */
259 
261 
265 typedef struct
266 {
267  uint32_t ocr;
268  /* Operating conditions register */
269 
270  uint32_t rca;
271  /* Relative card address register */
272 
273  uint16_t maxReadBlockLen;
274  /* Maximum supported block length for read */
275 
277  /* Maximum supported block length for read */
278 
279  char manuDate[9];
280  /* ASCII string with the date of manufacture */
281 
282  uint8_t manuID;
283  /* Card manufacturer ID */
284 
285  char productName[6];
286  /* Product name */
287 
288  /* From CSD */
289  uint8_t specVersion;
290  /* SD card specification version */
291 
292  uint32_t blockCount;
293  /* Number of blocks in the SD */
294 
295  uint8_t transferSpeed;
296  /* Transfer speed in code - Freq Unit x Mult Factor */
297 
298  uint32_t isCmd23;
299  /* CMD23 support */
300 
302  /* Supported data widths by the device */
303 
305 
313 typedef struct
314 {
315  uint32_t cmd;
318  uint32_t dir;
321  uint32_t arg;
324  void *dataBuf;
327  uint32_t blockSize;
330  uint32_t blockCount;
333  uint32_t autoCmdEn;
334  /* AutoCMD12 or AutoCMD23 or no AutoCMD */
335 
336  uint32_t enableDma;
337  /* Is DMA enabled for the command*/
338 
339  uint32_t isTuning;
340  /* Is transaction used for tuning */
341 
342  uint32_t response[4];
346 
351 typedef struct
352 {
353  uint32_t ctrlBaseAddr;
356  uint32_t ssBaseAddr;
359  uint32_t inputClkFreq;
362  uint32_t outputClkFreq;
365  uint32_t enableDma;
368  uint32_t intrEnable;
371  uint32_t intrNum;
374  uint32_t eventId;
377  uint32_t cardType;
380  uint32_t busWidth;
383  uint32_t supportedModes;
386  uint32_t busVoltage;
389  uint32_t isHS;
392  uint32_t phyType;
395  uint32_t tuningType;
398 } MMCSD_Attrs;
399 
404 typedef struct
405 {
409  uint32_t cardType;
412  uint8_t *tempDataBuf;
413  /* Temporary data buf for receiving tuning data, ecsd, scr etc. To be allocated in app and passed as MMCSD params to MMCSD_open */
414 
416  /* EMMC device data structure. This has to be allocated in the app. Probably using sysconfig */
417 
419  /* SD device data structure. This has to be allocated in the app. Probably using sysconfig */
420 
421  uint8_t sdVer;
424  uint32_t busWidth;
427  uint32_t transferSpeed;
430  uint32_t isHC;
433  uint32_t isUHS;
436  uint32_t isCmd23;
439  uint32_t is1_8V;
442  uint32_t isSwitch1_8V;
445  uint32_t blockSize;
448  uint64_t blockCount;
451  uint64_t mediaSize;
454  uint32_t enableDma;
457  uint32_t intrEnable;
460  volatile uint32_t cmdComp;
463  volatile uint32_t cmdTimeout;
464  /*< Command timeout flag */
465 
466  volatile uint32_t cmdCRCError;
467  /*< Command CRC error flag */
468 
469  volatile uint32_t cmdEBError;
470  /*< Command CRC error flag */
471 
472  volatile uint32_t cmdIndexError;
473  /*< Command Index error flag */
474 
475  volatile uint32_t dataCRCError;
476  /*< Data CRC error flag */
477 
478  volatile uint32_t dataEBError;
479  /*< Data end bit error */
480 
481  volatile uint32_t cmdError;
482  /*< Any error in processing of the command */
483 
484  volatile uint32_t xferInProgress;
485  /*< Command completion flag */
486 
487  volatile uint32_t xferComp;
488  /*< Transfer completion flag */
489 
490  volatile uint32_t xferTimeout;
491  /*< Transfer timeout flag */
492 
493  uint8_t *dataBufIdx;
494  uint32_t dataBlockCount;
495  uint32_t dataBlockSize;
496 
497  uint8_t *readBufIdx;
498  uint32_t readBlockCount;
499 
500  uint8_t *writeBufIdx;
501  uint32_t writeBlockCount;
502 
503  uint32_t isManualTuning;
506  uint32_t isOpen;
509  uint32_t xferHighSpeedEn;
512  uint32_t uhsmode;
533 } MMCSD_Object;
534 
535 typedef struct
536 {
541 } MMCSD_Config;
542 
543 typedef struct
544 {
545  uint8_t start;
546  uint8_t end;
547  uint8_t length;
549 
550 /* ========================================================================== */
551 /* Externs */
552 /* ========================================================================== */
553 
555 extern MMCSD_Config gMmcsdConfig[];
557 extern uint32_t gMmcsdConfigNum;
558 
559 /* ========================================================================== */
560 /* Internal/Private Structure Declarations */
561 /* ========================================================================== */
562 
563 /* ========================================================================== */
564 /* Function Declarations */
565 /* ========================================================================== */
566 
570 void MMCSD_init(void);
571 
575 void MMCSD_deinit(void);
576 
582 void MMCSD_Params_init(MMCSD_Params *mmcsdParams);
583 
598 MMCSD_Handle MMCSD_open(uint32_t index, const MMCSD_Params *openParams);
599 
610 
624 
638 int32_t MMCSD_read(MMCSD_Handle handle, uint8_t *buf, uint32_t startBlk, uint32_t numBlks);
639 
653 int32_t MMCSD_write(MMCSD_Handle handle, uint8_t *buf, uint32_t startBlk, uint32_t numBlks);
654 
668 
682 
695 uint32_t MMCSD_isHC(MMCSD_Handle handle);
696 
710 int32_t MMCSD_enableBootPartition(MMCSD_Handle handle, uint32_t partitionNum);
711 
725 
736 
739 #ifdef __cplusplus
740 }
741 #endif
742 
743 #endif /* MMCSD_H_ */
MMCSD_TuningPassOrFailWindow::length
uint8_t length
Definition: mmcsd/v0/mmcsd.h:547
MMCSD_Attrs::intrEnable
uint32_t intrEnable
Definition: mmcsd/v0/mmcsd.h:368
MMCSD_open
MMCSD_Handle MMCSD_open(uint32_t index, const MMCSD_Params *openParams)
This function opens a given MMCSD peripheral.
MMCSD_Object::emmcData
MMCSD_EmmcDeviceData * emmcData
Definition: mmcsd/v0/mmcsd.h:415
MMCSD_Attrs::eventId
uint32_t eventId
Definition: mmcsd/v0/mmcsd.h:374
MMCSD_SdDeviceData::ocr
uint32_t ocr
Definition: mmcsd/v0/mmcsd.h:267
MMCSD_SdDeviceData::manuID
uint8_t manuID
Definition: mmcsd/v0/mmcsd.h:282
MMCSD_Object::isHC
uint32_t isHC
Definition: mmcsd/v0/mmcsd.h:430
MMCSD_Object::dataCopyCompleteSemObj
SemaphoreP_Object dataCopyCompleteSemObj
Definition: mmcsd/v0/mmcsd.h:524
MMCSD_SdDeviceData::transferSpeed
uint8_t transferSpeed
Definition: mmcsd/v0/mmcsd.h:295
MMCSD_EmmcDeviceData::blockCount
uint32_t blockCount
Definition: mmcsd/v0/mmcsd.h:239
MMCSD_SdDeviceData
SD device properties.
Definition: mmcsd/v0/mmcsd.h:266
MMCSD_Object::dataBlockSize
uint32_t dataBlockSize
Definition: mmcsd/v0/mmcsd.h:495
MMCSD_Object::cmdEBError
volatile uint32_t cmdEBError
Definition: mmcsd/v0/mmcsd.h:469
MMCSD_Attrs::busVoltage
uint32_t busVoltage
Definition: mmcsd/v0/mmcsd.h:386
MMCSD_Object::isCmd23
uint32_t isCmd23
Definition: mmcsd/v0/mmcsd.h:436
MMCSD_Transaction::cmd
uint32_t cmd
Definition: mmcsd/v0/mmcsd.h:315
MMCSD_EmmcDeviceData::rca
uint32_t rca
Definition: mmcsd/v0/mmcsd.h:217
index
uint16_t index
Definition: tisci_rm_proxy.h:3
MMCSD_Object::cmdTimeout
volatile uint32_t cmdTimeout
Definition: mmcsd/v0/mmcsd.h:463
MMCSD_Transaction::blockSize
uint32_t blockSize
Definition: mmcsd/v0/mmcsd.h:327
SystemP.h
MMCSD_EmmcDeviceData::impDsr
bool impDsr
Definition: mmcsd/v0/mmcsd.h:248
MMCSD_Object::xferMutex
SemaphoreP_Object xferMutex
Definition: mmcsd/v0/mmcsd.h:518
MMCSD_Object::cmdCompleteSemObj
SemaphoreP_Object cmdCompleteSemObj
Definition: mmcsd/v0/mmcsd.h:521
MMCSD_Object::writeBufIdx
uint8_t * writeBufIdx
Definition: mmcsd/v0/mmcsd.h:500
MMCSD_SdDeviceData::specVersion
uint8_t specVersion
Definition: mmcsd/v0/mmcsd.h:289
MMCSD_Transaction::isTuning
uint32_t isTuning
Definition: mmcsd/v0/mmcsd.h:339
MMCSD_Object::blockCount
uint64_t blockCount
Definition: mmcsd/v0/mmcsd.h:448
MMCSD_Object::isSwitch1_8V
uint32_t isSwitch1_8V
Definition: mmcsd/v0/mmcsd.h:442
MMCSD_Object::isManualTuning
uint32_t isManualTuning
Definition: mmcsd/v0/mmcsd.h:503
MMCSD_Object::dataEBError
volatile uint32_t dataEBError
Definition: mmcsd/v0/mmcsd.h:478
MMCSD_Object::tempDataBuf
uint8_t * tempDataBuf
Definition: mmcsd/v0/mmcsd.h:412
MMCSD_EmmcDeviceData::dsr
uint16_t dsr
Definition: mmcsd/v0/mmcsd.h:245
MMCSD_Object::busWidth
uint32_t busWidth
Definition: mmcsd/v0/mmcsd.h:424
MMCSD_TuningPassOrFailWindow::start
uint8_t start
Definition: mmcsd/v0/mmcsd.h:545
MMCSD_Object::xferCompleteSemObj
SemaphoreP_Object xferCompleteSemObj
Definition: mmcsd/v0/mmcsd.h:527
MMCSD_Object::mediaSize
uint64_t mediaSize
Definition: mmcsd/v0/mmcsd.h:451
MMCSD_Attrs::ssBaseAddr
uint32_t ssBaseAddr
Definition: mmcsd/v0/mmcsd.h:356
SemaphoreP.h
MMCSD_Attrs::inputClkFreq
uint32_t inputClkFreq
Definition: mmcsd/v0/mmcsd.h:359
MMCSD_SdDeviceData::maxReadBlockLen
uint16_t maxReadBlockLen
Definition: mmcsd/v0/mmcsd.h:273
MMCSD_Object::uhsmode
uint32_t uhsmode
Definition: mmcsd/v0/mmcsd.h:512
MMCSD_Object::isOpen
uint32_t isOpen
Definition: mmcsd/v0/mmcsd.h:506
MMCSD_Config::object
MMCSD_Object * object
Definition: mmcsd/v0/mmcsd.h:539
MMCSD_Object::cardType
uint32_t cardType
Definition: mmcsd/v0/mmcsd.h:409
MMCSD_init
void MMCSD_init(void)
This function initializes the MMCSD module.
MMCSD_Transaction::dir
uint32_t dir
Definition: mmcsd/v0/mmcsd.h:318
MMCSD_Attrs::busWidth
uint32_t busWidth
Definition: mmcsd/v0/mmcsd.h:380
MMCSD_Object::sdData
MMCSD_SdDeviceData * sdData
Definition: mmcsd/v0/mmcsd.h:418
MMCSD_Transaction
MMCSD transaction.
Definition: mmcsd/v0/mmcsd.h:314
MMCSD_EmmcDeviceData::eStrobeSupport
uint8_t eStrobeSupport
Definition: mmcsd/v0/mmcsd.h:254
MMCSD_Config::attrs
const MMCSD_Attrs * attrs
Definition: mmcsd/v0/mmcsd.h:537
MMCSD_enableBootPartition
int32_t MMCSD_enableBootPartition(MMCSD_Handle handle, uint32_t partitionNum)
This function enables the boot partition if the connected media is eMMC.
MMCSD_EmmcDeviceData::manuID
uint8_t manuID
Definition: mmcsd/v0/mmcsd.h:229
MMCSD_Attrs::cardType
uint32_t cardType
Definition: mmcsd/v0/mmcsd.h:377
MMCSD_SdDeviceData::isCmd23
uint32_t isCmd23
Definition: mmcsd/v0/mmcsd.h:298
MMCSD_EmmcDeviceData::specVersion
uint8_t specVersion
Definition: mmcsd/v0/mmcsd.h:236
MMCSD_getInputClk
uint32_t MMCSD_getInputClk(MMCSD_Handle handle)
This function returns the input clk frequency MMCSD was programmed at.
MMCSD_EmmcDeviceData::ocr
uint32_t ocr
Definition: mmcsd/v0/mmcsd.h:214
MMCSD_Object::cmdCRCError
volatile uint32_t cmdCRCError
Definition: mmcsd/v0/mmcsd.h:466
MMCSD_read
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.
gMmcsdConfigNum
uint32_t gMmcsdConfigNum
Externally defined driver configuration array size.
MMCSD_isHC
uint32_t MMCSD_isHC(MMCSD_Handle handle)
This function returns if the media connected is High Capacity (> 2GB in size) or not.
HwiP.h
MMCSD_Attrs::intrNum
uint32_t intrNum
Definition: mmcsd/v0/mmcsd.h:371
MMCSD_Object::isUHS
uint32_t isUHS
Definition: mmcsd/v0/mmcsd.h:433
MMCSD_Attrs::supportedModes
uint32_t supportedModes
Definition: mmcsd/v0/mmcsd.h:383
MMCSD_Object::hwiObj
HwiP_Object hwiObj
Definition: mmcsd/v0/mmcsd.h:530
MMCSD_Object::cmdError
volatile uint32_t cmdError
Definition: mmcsd/v0/mmcsd.h:481
MMCSD_Object::enableDma
uint32_t enableDma
Definition: mmcsd/v0/mmcsd.h:454
MMCSD_getBlockCount
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...
MMCSD_SdDeviceData::rca
uint32_t rca
Definition: mmcsd/v0/mmcsd.h:270
MMCSD_Object::is1_8V
uint32_t is1_8V
Definition: mmcsd/v0/mmcsd.h:439
MMCSD_Attrs::phyType
uint32_t phyType
Definition: mmcsd/v0/mmcsd.h:392
MMCSD_Attrs::ctrlBaseAddr
uint32_t ctrlBaseAddr
Definition: mmcsd/v0/mmcsd.h:353
MMCSD_EmmcDeviceData::supportedModes
uint8_t supportedModes
Definition: mmcsd/v0/mmcsd.h:251
MMCSD_Params::dataBuf
uint8_t * dataBuf
Definition: mmcsd/v0/mmcsd.h:204
MMCSD_Object::readBufIdx
uint8_t * readBufIdx
Definition: mmcsd/v0/mmcsd.h:497
MMCSD_Handle
void * MMCSD_Handle
Definition: mmcsd/v0/mmcsd.h:189
MMCSD_Object::xferInProgress
volatile uint32_t xferInProgress
Definition: mmcsd/v0/mmcsd.h:484
MMCSD_Params
MMCSD instance attributes - used during init time.
Definition: mmcsd/v0/mmcsd.h:200
MMCSD_getBlockSize
uint32_t MMCSD_getBlockSize(MMCSD_Handle handle)
This function returns the block size of the MMC/SD media connected to the MMCSD controller.
MMCSD_Object::dataBlockCount
uint32_t dataBlockCount
Definition: mmcsd/v0/mmcsd.h:494
MMCSD_EmmcDeviceData
eMMC device properties
Definition: mmcsd/v0/mmcsd.h:213
MMCSD_deinit
void MMCSD_deinit(void)
This function de-initializes the MMCSD module.
MMCSD_EmmcDeviceData::maxReadBlockLen
uint16_t maxReadBlockLen
Definition: mmcsd/v0/mmcsd.h:220
MMCSD_TuningPassOrFailWindow
Definition: mmcsd/v0/mmcsd.h:544
MMCSD_Object
MMCSD driver object.
Definition: mmcsd/v0/mmcsd.h:405
MMCSD_Object::xferComp
volatile uint32_t xferComp
Definition: mmcsd/v0/mmcsd.h:487
MMCSD_EmmcDeviceData::transferSpeed
uint8_t transferSpeed
Definition: mmcsd/v0/mmcsd.h:242
MMCSD_SdDeviceData::supportedDataWidths
uint32_t supportedDataWidths
Definition: mmcsd/v0/mmcsd.h:301
MMCSD_Params_init
void MMCSD_Params_init(MMCSD_Params *mmcsdParams)
Initialize data structure with defaults.
MMCSD_Transaction::dataBuf
void * dataBuf
Definition: mmcsd/v0/mmcsd.h:324
HwiP_Object
Opaque Hwi object used with the Hwi APIs.
Definition: HwiP.h:93
MMCSD_Object::handle
MMCSD_Handle handle
Definition: mmcsd/v0/mmcsd.h:406
MMCSD_Transaction::enableDma
uint32_t enableDma
Definition: mmcsd/v0/mmcsd.h:336
MMCSD_Params::deviceData
void * deviceData
Definition: mmcsd/v0/mmcsd.h:201
MMCSD_Object::dataCRCError
volatile uint32_t dataCRCError
Definition: mmcsd/v0/mmcsd.h:475
MMCSD_EmmcDeviceData::maxWriteBlockLen
uint16_t maxWriteBlockLen
Definition: mmcsd/v0/mmcsd.h:223
MMCSD_Attrs::outputClkFreq
uint32_t outputClkFreq
Definition: mmcsd/v0/mmcsd.h:362
MMCSD_Object::cmdIndexError
volatile uint32_t cmdIndexError
Definition: mmcsd/v0/mmcsd.h:472
MMCSD_Transaction::arg
uint32_t arg
Definition: mmcsd/v0/mmcsd.h:321
MMCSD_Object::sdVer
uint8_t sdVer
Definition: mmcsd/v0/mmcsd.h:421
MMCSD_Object::transferSpeed
uint32_t transferSpeed
Definition: mmcsd/v0/mmcsd.h:427
MMCSD_Config
Definition: mmcsd/v0/mmcsd.h:536
MMCSD_Transaction::blockCount
uint32_t blockCount
Definition: mmcsd/v0/mmcsd.h:330
SemaphoreP_Object
Opaque semaphore object used with the semaphore APIs.
Definition: SemaphoreP.h:59
MMCSD_Attrs::isHS
uint32_t isHS
Definition: mmcsd/v0/mmcsd.h:389
gMmcsdConfig
MMCSD_Config gMmcsdConfig[]
Externally defined driver configuration array.
MMCSD_Attrs::enableDma
uint32_t enableDma
Definition: mmcsd/v0/mmcsd.h:365
MMCSD_Attrs
MMCSD instance attributes - used during init time.
Definition: mmcsd/v0/mmcsd.h:352
MMCSD_SdDeviceData::blockCount
uint32_t blockCount
Definition: mmcsd/v0/mmcsd.h:292
MMCSD_close
void MMCSD_close(MMCSD_Handle handle)
Function to close a MMCSD peripheral specified by the MMCSD handle.
MMCSD_Transaction::autoCmdEn
uint32_t autoCmdEn
Definition: mmcsd/v0/mmcsd.h:333
MMCSD_Object::cmdMutex
SemaphoreP_Object cmdMutex
Definition: mmcsd/v0/mmcsd.h:515
MMCSD_Object::xferTimeout
volatile uint32_t xferTimeout
Definition: mmcsd/v0/mmcsd.h:490
MMCSD_disableBootPartition
int32_t MMCSD_disableBootPartition(MMCSD_Handle handle)
This function disables the boot partition if the connected media is eMMC.
MMCSD_Object::intrEnable
uint32_t intrEnable
Definition: mmcsd/v0/mmcsd.h:457
MMCSD_Object::readBlockCount
uint32_t readBlockCount
Definition: mmcsd/v0/mmcsd.h:498
MMCSD_write
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.
MMCSD_Object::xferHighSpeedEn
uint32_t xferHighSpeedEn
Definition: mmcsd/v0/mmcsd.h:509
MMCSD_Object::cmdComp
volatile uint32_t cmdComp
Definition: mmcsd/v0/mmcsd.h:460
MMCSD_getHandle
MMCSD_Handle MMCSD_getHandle(uint32_t index)
This function returns the handle of an open MMCSD Instance from the instance index.
MMCSD_EmmcDeviceData::driveStrength
uint8_t driveStrength
Definition: mmcsd/v0/mmcsd.h:257
MMCSD_TuningPassOrFailWindow::end
uint8_t end
Definition: mmcsd/v0/mmcsd.h:546
MMCSD_Object::dataBufIdx
uint8_t * dataBufIdx
Definition: mmcsd/v0/mmcsd.h:493
MMCSD_Object::writeBlockCount
uint32_t writeBlockCount
Definition: mmcsd/v0/mmcsd.h:501
MMCSD_Attrs::tuningType
uint32_t tuningType
Definition: mmcsd/v0/mmcsd.h:395
MMCSD_Object::blockSize
uint32_t blockSize
Definition: mmcsd/v0/mmcsd.h:445
MMCSD_SdDeviceData::maxWriteBlockLen
uint16_t maxWriteBlockLen
Definition: mmcsd/v0/mmcsd.h:276