AM62Px MCU+ SDK  11.01.01
mmcsd/v0/mmcsd.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2021-25 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 <stdbool.h>
58 #include <stdint.h>
59 #include <kernel/dpl/SystemP.h>
60 #include <kernel/dpl/SemaphoreP.h>
61 #include <kernel/dpl/HwiP.h>
63 #include <drivers/hw_include/cslr_mmcsd.h>
64 
65 #ifdef __cplusplus
66 extern "C" {
67 #endif
68 
69 /* ========================================================================== */
70 /* Macros & Typedefs */
71 /* ========================================================================== */
72 
73 #define MMCSD_CARD_TYPE_SD (0U)
74 #define MMCSD_CARD_TYPE_EMMC (1U)
75 #define MMCSD_CARD_TYPE_MMC (2U)
76 
77 /* useful in cases where SoC has MMCSD IP but no device attached to peripheral */
78 #define MMCSD_CARD_TYPE_NO_DEVICE (3U)
79 
80 /*
81 * \brief Macros that can be used for selecting the bus/data width
82 */
83 #define MMCSD_BUS_WIDTH_4BIT (0x4U)
84 #define MMCSD_BUS_WIDTH_8BIT (0x8U)
85 #define MMCSD_BUS_WIDTH_1BIT (0x1U)
86 
87 
88 /*
89 * \brief Macros that can be used for selecting the media transfer speed
90 */
91 #define MMCSD_TRANSPEED_25MBPS (0x32U)
92 #define MMCSD_TRANSPEED_50MBPS (0x5AU)
93 #define MMCSD_TRANSPEED_DEFAULT (0x32U)
94 #define MMCSD_TRANSPEED_HS (0x5AU)
95 #define MMCSD_TRANSPEED_SDR12 (0x32U)
96 #define MMCSD_TRANSPEED_SDR25 (0x5AU)
97 #define MMCSD_TRANSPEED_SDR50 (0xBU)
98 #define MMCSD_TRANSPEED_SDR104 (0x2BU)
99 #define MMCSD_TRANSPEED_DDR50 (0x3BU)
100 #define MMCSD_TRANSPEED_HS200 (0x2BU)
101 #define MMCSD_TRANSPEED_HS400 (0x4BU)
102 /*
103 * \brief Macros that can be used for selecting the bus voltage
104 */
105 #define MMCSD_BUS_VOLT_1_8V (0x5U) /* Embedded */
106 #define MMCSD_BUS_VOLT_3_0V (0x6U) /* Typical */
107 #define MMCSD_BUS_VOLT_3_3V (0x7U) /* Flattop */
108 
109 /*
110 * \brief Macros that can be used for selecting command types
111 */
112 #define MMCSD_CMD_TYPE_NORMAL (0U)
113 #define MMCSD_CMD_TYPE_BUS_SUSPEND (1U)
114 #define MMCSD_CMD_TYPE_FUNC_SEL (2U)
115 #define MMCSD_CMD_TYPE_IO_ABORT (3U)
116 
117 /*
118 * \brief Macros that can be used for selecting command response types
119 */
120 #define MMCSD_CMD_RSP_TYPE_NORSP (0U)
121 #define MMCSD_CMD_RSP_TYPE_L136 (1U)
122 #define MMCSD_CMD_RSP_TYPE_L48 (2U)
123 #define MMCSD_CMD_RSP_TYPE_L48_BUSY (3U)
124 
125 /*
126 * \brief Macros that can be used for selecting transfer types
127 */
128 #define MMCSD_CMD_XFER_TYPE_WRITE (0U)
129 #define MMCSD_CMD_XFER_TYPE_READ (1U)
130 
131 /*
132 * \brief Macros that can be used for selecting supported MMC modes
133 */
134 #define MMCSD_SUPPORT_MMC_DS (0x01U) /* DS (Up to 26Mhz) */
135 #define MMCSD_SUPPORT_MMC_HS_SDR (0x02U) /* HS (Up to 52Mhz) */
136 #define MMCSD_SUPPORT_MMC_HS_DDR (0x04U) /* HS (Up to 52Mhz) */
137 #define MMCSD_SUPPORT_MMC_HS200 (0x08U) /* HS200 (Up to 200Mhz) */
138 #define MMCSD_SUPPORT_MMC_HS400 (0x10U) /* HS400 (Up to 400Mhz) */
139 #define MMCSD_SUPPORT_MMC_ALL (0xFFU) /* All modes */
140 
141 /*
142 * \brief Strobe select value for HS400 operating mode
143 */
144 #define MMCSD_STRBSEL_MMC_HS400 (0x66U)
145 
146 /*
147 * \brief Macros that can be used for selecting the OTAPDLYSEL value based on
148 * core voltage for HS400 operating mode
149 */
150 #define MMCSD_OTAPDLYSEL_MMC_HS400_0_75V (0x6U)
151 #define MMCSD_OTAPDLYSEL_MMC_HS400_0_85V (0x5U)
152 
153 /*
154 * \brief Macros that can be used for selecting supported SD modes
155 */
156 #define MMCSD_SUPPORT_SD_DS (0x01U)
157 #define MMCSD_SUPPORT_SD_HS (0x02U)
158 #define MMCSD_SUPPORT_SD_SDR50 (0x04U)
159 #define MMCSD_SUPPORT_SD_SDR104 (0x08U)
160 #define MMCSD_SUPPORT_SD_DDR50 (0x10U)
161 #define MMCSD_SUPPORT_SD_ALL (0xFFU) /* All modes */
162 
163 /*
164 * \brief Macros that can be used for selecting PHY types
165 */
166 #define MMCSD_PHY_TYPE_HW_PHY (0U)
167 #define MMCSD_PHY_TYPE_SW_PHY (1U)
168 #define MMCSD_PHY_TYPE_NO_PHY (2U)
169 
170 /*
171 * \brief Macros that can be used for selecting PHY tuning type
172 */
173 #define MMCSD_PHY_TUNING_TYPE_AUTO (0U)
174 #define MMCSD_PHY_TUNING_TYPE_MANUAL (1U)
175 
176 /*
177 * \brief Macros that can be used for selecting PHY modes
178 */
179 #define MMCSD_PHY_MODE_HS400 (1U)
180 #define MMCSD_PHY_MODE_HS200 (2U)
181 #define MMCSD_PHY_MODE_HSSDR50 (3U)
182 #define MMCSD_PHY_MODE_HSDDR50 (4U)
183 #define MMCSD_PHY_MODE_SDR104 (5U)
184 #define MMCSD_PHY_MODE_SDR50 (6U)
185 #define MMCSD_PHY_MODE_DDR50 (7U)
186 #define MMCSD_PHY_MODE_SDR25 (8U)
187 #define MMCSD_PHY_MODE_SDR12 (9U)
188 #define MMCSD_PHY_MODE_HS (10U)
189 #define MMCSD_PHY_MODE_DS (11U)
190 
191 /*
192 * \brief Macros that can be used for selecting UHS 1 modes
193 */
194 #define MMCSD_UHS_MODE_SDR12 (0U)
195 #define MMCSD_UHS_MODE_SDR25 (1U)
196 #define MMCSD_UHS_MODE_SDR50 (2U)
197 #define MMCSD_UHS_MODE_SDR104 (3U)
198 #define MMCSD_UHS_MODE_DDR50 (4U)
199 #define MMCSD_UHS_MODE_HS400 (5U)
200 #define MMCSD_UHS_MODE_UHS2 (7U)
201 
202 typedef void* MMCSD_Handle;
203 
204 typedef enum{
209 
210 /* ========================================================================== */
211 /* Structure Declarations */
212 /* ========================================================================== */
218 typedef struct
219 {
220  void* deviceData;
221  /* Pointer to eMMC/SD device data structure. Memory for this structure has to be allocated in application */
222 
223  uint8_t *dataBuf;
224  /* Pointer to a 512 byte dataBuffer used for temporary data transactions internal to driver like ECSD read, tuning etc. To be allocated by application */
225 
226 } MMCSD_Params;
227 
231 typedef struct
232 {
233  uint32_t ocr;
234  /* Operating conditions register */
235 
236  uint32_t rca;
237  /* Relative card address register */
238 
239  uint16_t maxReadBlockLen;
240  /* Maximum supported block length for read */
241 
243  /* Maximum supported block length for read */
244 
245  char manuDate[9];
246  /* ASCII string with the date of manufacture */
247 
248  uint8_t manuID;
249  /* Card manufacturer ID */
250 
251  char productName[7];
252  /* Product name */
253 
254  /* From CSD */
255  uint8_t specVersion;
256  /* eMMC specification version */
257 
258  uint32_t blockCount;
259  /* Number of blocks in the eMMC */
260 
261  uint8_t transferSpeed;
262  /* Transfer speed in code - Freq Unit x Mult Factor */
263 
264  uint16_t dsr;
265  /* Driver stage register */
266 
267  bool impDsr;
268  /* DSR implementation check value. Obtained from the CSD register read. */
269 
270  uint8_t supportedModes;
271  /* Supported speed modes by the device - HS200, HS400 etc */
272 
273  uint8_t eStrobeSupport;
274  /* Support of enhanced strobe */
275 
276  uint8_t driveStrength;
277  /* Drive strength of the device */
278 
280 
284 typedef struct
285 {
286  uint32_t ocr;
287  /* Operating conditions register */
288 
289  uint32_t rca;
290  /* Relative card address register */
291 
292  uint16_t maxReadBlockLen;
293  /* Maximum supported block length for read */
294 
296  /* Maximum supported block length for read */
297 
298  char manuDate[9];
299  /* ASCII string with the date of manufacture */
300 
301  uint8_t manuID;
302  /* Card manufacturer ID */
303 
304  char productName[6];
305  /* Product name */
306 
307  /* From CSD */
308  uint8_t specVersion;
309  /* SD card specification version */
310 
311  uint32_t blockCount;
312  /* Number of blocks in the SD */
313 
314  uint8_t transferSpeed;
315  /* Transfer speed in code - Freq Unit x Mult Factor */
316 
317  uint32_t isCmd23;
318  /* CMD23 support */
319 
321  /* Supported data widths by the device */
322 
324 
332 typedef struct
333 {
334  uint32_t cmd;
337  uint32_t dir;
340  uint32_t arg;
343  void *dataBuf;
346  uint32_t blockSize;
349  uint32_t blockCount;
352  uint32_t autoCmdEn;
353  /* AutoCMD12 or AutoCMD23 or no AutoCMD */
354 
355  uint32_t enableDma;
356  /* Is DMA enabled for the command*/
357 
358  uint32_t isTuning;
359  /* Is transaction used for tuning */
360 
361  uint32_t retries;
362  /* Number of transaction retries */
363 
364  uint32_t response[4];
367  uint32_t status;
368  /* Status of the transaction */
369 
371 
376 typedef struct
377 {
378  uint32_t ctrlBaseAddr;
381  uint32_t ssBaseAddr;
384  uint32_t inputClkFreq;
387  uint32_t outputClkFreq;
390  uint32_t enableDma;
393  uint32_t intrEnable;
396  uint32_t intrNum;
399  uint32_t eventId;
402  uint32_t cardType;
405  uint32_t busWidth;
408  uint32_t supportedModes;
411  uint32_t busVoltage;
414  uint32_t isHS;
417  uint32_t phyType;
420  uint32_t tuningType;
423 } MMCSD_Attrs;
424 
429 typedef struct
430 {
434  uint32_t cardType;
437  uint8_t *tempDataBuf;
438  /* Temporary data buf for receiving tuning data, ecsd, scr etc. To be allocated in app and passed as MMCSD params to MMCSD_open */
439 
441  /* EMMC device data structure. This has to be allocated in the app. Probably using sysconfig */
442 
444  /* SD device data structure. This has to be allocated in the app. Probably using sysconfig */
445 
446  uint8_t sdVer;
452  uint32_t busWidth;
455  uint32_t transferSpeed;
458  uint32_t isHC;
461  uint32_t isUHS;
464  uint32_t is1_8V;
467  uint32_t isSwitch1_8V;
470  uint32_t blockSize;
473  uint64_t blockCount;
476  uint64_t mediaSize;
479  uint32_t enableDma;
482  uint32_t intrEnable;
485  volatile uint32_t cmdComp;
488  volatile uint32_t cmdTimeout;
489  /*< Command timeout flag */
490 
491  volatile uint32_t cmdCRCError;
492  /*< Command CRC error flag */
493 
494  volatile uint32_t cmdEBError;
495  /*< Command EndBit error flag */
496 
497  volatile uint32_t cmdIndexError;
498  /*< Command Index error flag */
499 
500  volatile uint32_t dataTimeoutError;
501  /*< Data Timeout error flag */
502 
503  volatile uint32_t dataCRCError;
504  /*< Data CRC error flag */
505 
506  volatile uint32_t dataEBError;
507  /*< Data end bit error */
508 
509  volatile uint32_t admaError;
510  /*< ADMA error flag */
511 
512  volatile uint32_t cmdError;
513  /*< Any error in processing of the command */
514 
515  volatile uint32_t xferInProgress;
516  /*< Command completion flag */
517 
518  volatile uint32_t xferComp;
519  /*< Transfer completion flag */
520 
521  volatile uint32_t xferTimeout;
522  /*< Transfer timeout flag */
523 
524  uint8_t *dataBufIdx;
525  uint32_t dataBlockCount;
526  uint32_t dataBlockSize;
527 
528  uint8_t *readBufIdx;
529  uint32_t readBlockCount;
530 
531  uint8_t *writeBufIdx;
532  uint32_t writeBlockCount;
533 
534  uint32_t isManualTuning;
537  uint32_t isOpen;
540  uint32_t xferHighSpeedEn;
543  uint32_t uhsmode;
564 } MMCSD_Object;
565 
566 typedef struct
567 {
572 } MMCSD_Config;
573 
574 typedef struct
575 {
576  uint8_t start;
577  uint8_t end;
578  uint8_t length;
580 
581 /* ========================================================================== */
582 /* Externs */
583 /* ========================================================================== */
584 
586 extern MMCSD_Config gMmcsdConfig[];
588 extern uint32_t gMmcsdConfigNum;
589 
590 /* ========================================================================== */
591 /* Internal/Private Structure Declarations */
592 /* ========================================================================== */
593 
594 /* ========================================================================== */
595 /* Function Declarations */
596 /* ========================================================================== */
597 
601 void MMCSD_init(void);
602 
606 void MMCSD_deinit(void);
607 
613 void MMCSD_Params_init(MMCSD_Params *mmcsdParams);
614 
629 MMCSD_Handle MMCSD_open(uint32_t index, const MMCSD_Params *openParams);
630 
641 
655 
669 int32_t MMCSD_read(MMCSD_Handle handle, uint8_t *buf, uint32_t startBlk, uint32_t numBlks);
670 
684 int32_t MMCSD_write(MMCSD_Handle handle, uint8_t *buf, uint32_t startBlk, uint32_t numBlks);
685 
699 
713 
726 uint32_t MMCSD_isHC(MMCSD_Handle handle);
727 
741 int32_t MMCSD_enableBootPartition(MMCSD_Handle handle, uint32_t partitionNum);
742 
756 
767 
770 #ifdef __cplusplus
771 }
772 #endif
773 
774 #endif /* MMCSD_H_ */
MMCSD_TuningPassOrFailWindow::length
uint8_t length
Definition: mmcsd/v0/mmcsd.h:578
MMCSD_Attrs::intrEnable
uint32_t intrEnable
Definition: mmcsd/v0/mmcsd.h:393
MMCSD_TRANS_FAILURE
@ MMCSD_TRANS_FAILURE
Definition: mmcsd/v0/mmcsd.h:206
MMCSD_Transaction::status
uint32_t status
Definition: mmcsd/v0/mmcsd.h:367
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:440
MMCSD_Attrs::eventId
uint32_t eventId
Definition: mmcsd/v0/mmcsd.h:399
MMCSD_SdDeviceData::ocr
uint32_t ocr
Definition: mmcsd/v0/mmcsd.h:286
MMCSD_SdDeviceData::manuID
uint8_t manuID
Definition: mmcsd/v0/mmcsd.h:301
MMCSD_Object::isHC
uint32_t isHC
Definition: mmcsd/v0/mmcsd.h:458
MMCSD_Object::dataCopyCompleteSemObj
SemaphoreP_Object dataCopyCompleteSemObj
Definition: mmcsd/v0/mmcsd.h:555
MMCSD_SdDeviceData::transferSpeed
uint8_t transferSpeed
Definition: mmcsd/v0/mmcsd.h:314
MMCSD_EmmcDeviceData::blockCount
uint32_t blockCount
Definition: mmcsd/v0/mmcsd.h:258
MMCSD_SdDeviceData
SD device properties.
Definition: mmcsd/v0/mmcsd.h:285
MMCSD_Object::dataBlockSize
uint32_t dataBlockSize
Definition: mmcsd/v0/mmcsd.h:526
MMCSD_Object::cmdEBError
volatile uint32_t cmdEBError
Definition: mmcsd/v0/mmcsd.h:494
MMCSD_Attrs::busVoltage
uint32_t busVoltage
Definition: mmcsd/v0/mmcsd.h:411
MMCSD_Transaction::cmd
uint32_t cmd
Definition: mmcsd/v0/mmcsd.h:334
MMCSD_EmmcDeviceData::rca
uint32_t rca
Definition: mmcsd/v0/mmcsd.h:236
index
uint16_t index
Definition: tisci_rm_proxy.h:3
MMCSD_Object::cmdTimeout
volatile uint32_t cmdTimeout
Definition: mmcsd/v0/mmcsd.h:488
MMCSD_Transaction::blockSize
uint32_t blockSize
Definition: mmcsd/v0/mmcsd.h:346
SystemP.h
MMCSD_EmmcDeviceData::impDsr
bool impDsr
Definition: mmcsd/v0/mmcsd.h:267
MMCSD_TRANS_SUCCESS
@ MMCSD_TRANS_SUCCESS
Definition: mmcsd/v0/mmcsd.h:205
MMCSD_Object::xferMutex
SemaphoreP_Object xferMutex
Definition: mmcsd/v0/mmcsd.h:549
MMCSD_Object::cmdCompleteSemObj
SemaphoreP_Object cmdCompleteSemObj
Definition: mmcsd/v0/mmcsd.h:552
MMCSD_Object::writeBufIdx
uint8_t * writeBufIdx
Definition: mmcsd/v0/mmcsd.h:531
MMCSD_SdDeviceData::specVersion
uint8_t specVersion
Definition: mmcsd/v0/mmcsd.h:308
MMCSD_TRANS_IRRECOVERABLE
@ MMCSD_TRANS_IRRECOVERABLE
Definition: mmcsd/v0/mmcsd.h:207
MMCSD_Transaction::isTuning
uint32_t isTuning
Definition: mmcsd/v0/mmcsd.h:358
MMCSD_Object::blockCount
uint64_t blockCount
Definition: mmcsd/v0/mmcsd.h:473
MMCSD_Object::isSwitch1_8V
uint32_t isSwitch1_8V
Definition: mmcsd/v0/mmcsd.h:467
MMCSD_Object::isManualTuning
uint32_t isManualTuning
Definition: mmcsd/v0/mmcsd.h:534
MMCSD_Object::dataEBError
volatile uint32_t dataEBError
Definition: mmcsd/v0/mmcsd.h:506
MMCSD_Object::tempDataBuf
uint8_t * tempDataBuf
Definition: mmcsd/v0/mmcsd.h:437
MMCSD_EmmcDeviceData::dsr
uint16_t dsr
Definition: mmcsd/v0/mmcsd.h:264
MMCSD_Object::busWidth
uint32_t busWidth
Definition: mmcsd/v0/mmcsd.h:452
MMCSD_TuningPassOrFailWindow::start
uint8_t start
Definition: mmcsd/v0/mmcsd.h:576
MMCSD_Object::xferCompleteSemObj
SemaphoreP_Object xferCompleteSemObj
Definition: mmcsd/v0/mmcsd.h:558
MMCSD_Object::mediaSize
uint64_t mediaSize
Definition: mmcsd/v0/mmcsd.h:476
MMCSD_Attrs::ssBaseAddr
uint32_t ssBaseAddr
Definition: mmcsd/v0/mmcsd.h:381
SemaphoreP.h
MMCSD_Attrs::inputClkFreq
uint32_t inputClkFreq
Definition: mmcsd/v0/mmcsd.h:384
MMCSD_SdDeviceData::maxReadBlockLen
uint16_t maxReadBlockLen
Definition: mmcsd/v0/mmcsd.h:292
MMCSD_Object::uhsmode
uint32_t uhsmode
Definition: mmcsd/v0/mmcsd.h:543
MMCSD_Object::isOpen
uint32_t isOpen
Definition: mmcsd/v0/mmcsd.h:537
MMCSD_Config::object
MMCSD_Object * object
Definition: mmcsd/v0/mmcsd.h:570
MMCSD_Object::cardType
uint32_t cardType
Definition: mmcsd/v0/mmcsd.h:434
MMCSD_init
void MMCSD_init(void)
This function initializes the MMCSD module.
MMCSD_Transaction::dir
uint32_t dir
Definition: mmcsd/v0/mmcsd.h:337
MMCSD_Attrs::busWidth
uint32_t busWidth
Definition: mmcsd/v0/mmcsd.h:405
csl_types.h
This file contains the Register Desciptions for CSL types.
MMCSD_Object::sdData
MMCSD_SdDeviceData * sdData
Definition: mmcsd/v0/mmcsd.h:443
MMCSD_Transaction
MMCSD transaction.
Definition: mmcsd/v0/mmcsd.h:333
MMCSD_EmmcDeviceData::eStrobeSupport
uint8_t eStrobeSupport
Definition: mmcsd/v0/mmcsd.h:273
MMCSD_Config::attrs
const MMCSD_Attrs * attrs
Definition: mmcsd/v0/mmcsd.h:568
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:248
MMCSD_Attrs::cardType
uint32_t cardType
Definition: mmcsd/v0/mmcsd.h:402
MMCSD_SdDeviceData::isCmd23
uint32_t isCmd23
Definition: mmcsd/v0/mmcsd.h:317
MMCSD_EmmcDeviceData::specVersion
uint8_t specVersion
Definition: mmcsd/v0/mmcsd.h:255
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:233
MMCSD_Object::cmdCRCError
volatile uint32_t cmdCRCError
Definition: mmcsd/v0/mmcsd.h:491
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:396
MMCSD_Object::isUHS
uint32_t isUHS
Definition: mmcsd/v0/mmcsd.h:461
MMCSD_Transaction::retries
uint32_t retries
Definition: mmcsd/v0/mmcsd.h:361
MMCSD_Attrs::supportedModes
uint32_t supportedModes
Definition: mmcsd/v0/mmcsd.h:408
MMCSD_Object::hwiObj
HwiP_Object hwiObj
Definition: mmcsd/v0/mmcsd.h:561
MMCSD_Object::cmdError
volatile uint32_t cmdError
Definition: mmcsd/v0/mmcsd.h:512
MMCSD_Object::enableDma
uint32_t enableDma
Definition: mmcsd/v0/mmcsd.h:479
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:289
MMCSD_Object::is1_8V
uint32_t is1_8V
Definition: mmcsd/v0/mmcsd.h:464
MMCSD_Attrs::phyType
uint32_t phyType
Definition: mmcsd/v0/mmcsd.h:417
MMCSD_Attrs::ctrlBaseAddr
uint32_t ctrlBaseAddr
Definition: mmcsd/v0/mmcsd.h:378
MMCSD_EmmcDeviceData::supportedModes
uint8_t supportedModes
Definition: mmcsd/v0/mmcsd.h:270
MMCSD_Params::dataBuf
uint8_t * dataBuf
Definition: mmcsd/v0/mmcsd.h:223
MMCSD_Object::readBufIdx
uint8_t * readBufIdx
Definition: mmcsd/v0/mmcsd.h:528
MMCSD_Handle
void * MMCSD_Handle
Definition: mmcsd/v0/mmcsd.h:202
MMCSD_Object::xferInProgress
volatile uint32_t xferInProgress
Definition: mmcsd/v0/mmcsd.h:515
MMCSD_Params
MMCSD instance attributes - used during init time.
Definition: mmcsd/v0/mmcsd.h:219
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:525
MMCSD_EmmcDeviceData
eMMC device properties
Definition: mmcsd/v0/mmcsd.h:232
MMCSD_deinit
void MMCSD_deinit(void)
This function de-initializes the MMCSD module.
MMCSD_EmmcDeviceData::maxReadBlockLen
uint16_t maxReadBlockLen
Definition: mmcsd/v0/mmcsd.h:239
MMCSD_TuningPassOrFailWindow
Definition: mmcsd/v0/mmcsd.h:575
MMCSD_Object
MMCSD driver object.
Definition: mmcsd/v0/mmcsd.h:430
MMCSD_Object::admaError
volatile uint32_t admaError
Definition: mmcsd/v0/mmcsd.h:509
MMCSD_Object::xferComp
volatile uint32_t xferComp
Definition: mmcsd/v0/mmcsd.h:518
MMCSD_EmmcDeviceData::transferSpeed
uint8_t transferSpeed
Definition: mmcsd/v0/mmcsd.h:261
MMCSD_SdDeviceData::supportedDataWidths
uint32_t supportedDataWidths
Definition: mmcsd/v0/mmcsd.h:320
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:343
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:431
MMCSD_Transaction::enableDma
uint32_t enableDma
Definition: mmcsd/v0/mmcsd.h:355
MMCSD_Params::deviceData
void * deviceData
Definition: mmcsd/v0/mmcsd.h:220
MMCSD_Object::dataCRCError
volatile uint32_t dataCRCError
Definition: mmcsd/v0/mmcsd.h:503
MMCSD_EmmcDeviceData::maxWriteBlockLen
uint16_t maxWriteBlockLen
Definition: mmcsd/v0/mmcsd.h:242
MMCSD_Attrs::outputClkFreq
uint32_t outputClkFreq
Definition: mmcsd/v0/mmcsd.h:387
MMCSD_Object::cmdIndexError
volatile uint32_t cmdIndexError
Definition: mmcsd/v0/mmcsd.h:497
MMCSD_Transaction::arg
uint32_t arg
Definition: mmcsd/v0/mmcsd.h:340
MMCSD_Object::sdVer
uint8_t sdVer
Definition: mmcsd/v0/mmcsd.h:446
MMCSD_Object::transferSpeed
uint32_t transferSpeed
Definition: mmcsd/v0/mmcsd.h:455
MMCSD_Config
Definition: mmcsd/v0/mmcsd.h:567
MMCSD_Transaction::blockCount
uint32_t blockCount
Definition: mmcsd/v0/mmcsd.h:349
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:414
gMmcsdConfig
MMCSD_Config gMmcsdConfig[]
Externally defined driver configuration array.
MMCSD_Attrs::enableDma
uint32_t enableDma
Definition: mmcsd/v0/mmcsd.h:390
MMCSD_TransStatus
MMCSD_TransStatus
Definition: mmcsd/v0/mmcsd.h:204
MMCSD_Attrs
MMCSD instance attributes - used during init time.
Definition: mmcsd/v0/mmcsd.h:377
MMCSD_SdDeviceData::blockCount
uint32_t blockCount
Definition: mmcsd/v0/mmcsd.h:311
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:352
MMCSD_Object::cmdMutex
SemaphoreP_Object cmdMutex
Definition: mmcsd/v0/mmcsd.h:546
MMCSD_Object::xferTimeout
volatile uint32_t xferTimeout
Definition: mmcsd/v0/mmcsd.h:521
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:482
MMCSD_Object::readBlockCount
uint32_t readBlockCount
Definition: mmcsd/v0/mmcsd.h:529
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:540
MMCSD_Object::cmdComp
volatile uint32_t cmdComp
Definition: mmcsd/v0/mmcsd.h:485
MMCSD_Object::dataTimeoutError
volatile uint32_t dataTimeoutError
Definition: mmcsd/v0/mmcsd.h:500
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:276
MMCSD_TuningPassOrFailWindow::end
uint8_t end
Definition: mmcsd/v0/mmcsd.h:577
MMCSD_Object::dataBufIdx
uint8_t * dataBufIdx
Definition: mmcsd/v0/mmcsd.h:524
MMCSD_Object::writeBlockCount
uint32_t writeBlockCount
Definition: mmcsd/v0/mmcsd.h:532
MMCSD_Attrs::tuningType
uint32_t tuningType
Definition: mmcsd/v0/mmcsd.h:420
MMCSD_Object::blockSize
uint32_t blockSize
Definition: mmcsd/v0/mmcsd.h:470
MMCSD_Object::switchCmdTimeout
uint8_t switchCmdTimeout
Definition: mmcsd/v0/mmcsd.h:449
MMCSD_SdDeviceData::maxWriteBlockLen
uint16_t maxWriteBlockLen
Definition: mmcsd/v0/mmcsd.h:295