PDK API Guide for AM65xx
MMCSD_soc.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017, Texas Instruments Incorporated
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  *
12  * * Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in the
14  * documentation and/or other materials provided with the 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 "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
47 #ifndef MMCSD_SOC__H
48 #define MMCSD_SOC__H
49 
50 #ifdef __cplusplus
51 extern "C" {
52 #endif
53 
54 #include <stdint.h>
55 #include <stdlib.h>
56 #include <string.h>
57 #include <ti/csl/soc.h>
58 #include <ti/osal/osal.h>
59 
60 #if defined (SOC_AM574x) || defined (SOC_AM572x) || defined (SOC_AM571x) || defined (SOC_DRA72x) || defined (SOC_DRA75x) || defined (SOC_DRA78x) || defined (SOC_AM335x) || defined (SOC_AM437x) || defined(SOC_K2G)
61 #include <ti/drv/mmcsd/soc/MMCSD_v1.h>
62 #elif defined (SOC_OMAPL137) || defined(SOC_OMAPL138)
63 #include <ti/drv/mmcsd/soc/MMCSD_v0.h>
64 #elif defined(SOC_AM65XX) || defined(SOC_J721E) || defined(SOC_J7200) || defined(SOC_AM64X)
65 #include <ti/drv/mmcsd/soc/MMCSD_v2.h>
66 #endif
67 
68 
69 #if defined(SOC_AM574x) || defined(SOC_AM572x) || defined (SOC_AM571x)
70  #define MMCSD_CNT CSL_MPU_MMCHS_CNT
71 #elif defined(SOC_AM437x) || defined (SOC_AM335x)
72  #define MMCSD_CNT 3
73 #elif defined(SOC_DRA72x) || defined(SOC_DRA75x)
74  #define MMCSD_CNT CSL_MMCHS_CNT
75 #elif defined(SOC_DRA78x)
76  #define MMCSD_CNT 1
77 #elif defined(SOC_K2G)
78  #define MMCSD_CNT CSL_MMCSD_CNT
79 #elif defined(SOC_OMAPL137) || defined(SOC_OMAPL138)
80  #define MMCSD_CNT CSL_MMCSD_CNT
81 #elif defined(SOC_AM65XX)
82  #define MMCSD_CNT 2
83 #elif defined(SOC_J721E)
84  #define MMCSD_CNT 3
85 #elif defined(SOC_J7200)
86  #define MMCSD_CNT 2
87 #elif defined(SOC_AM64X)
88  #define MMCSD_CNT 2
89 #endif
90 #ifdef __cplusplus
91 }
92 #endif
93 
94 /*
95 * This function converts the local L2 address to a global address and
96 * will be used for DMA transactions which needs a global address.
97 */
98 uint32_t MMCSD_soc_l2_global_addr (uint32_t addr);
99 
100 /*
101 * This function switches the voltage of the CMD & DAT lines of MMCSD instance (1.8V <-> 3.0V)
102 * during initialization if a UHS-1 card is found. This function is board specific and is implemented
103 * by the Board library.
104 */
105 extern MMCSD_Error Board_mmc_voltageSwitchFxn(uint32_t instance, MMCSD_BusVoltage_e switch_voltage);
106 
107 /* This function will configure the interrupt path to the destination CPU
108 * using DMSC firmware via sciclient. if setIntrPath is set to TRUE,
109 * a path is set, else the interrupt path is released
110 */
111 extern MMCSD_Error MMCSD_configSocIntrPath(const void *hwAttrs_ptr,bool setIntrPath);
112 
113 /* This SOC function will initialize InitConfig[] as per the core/subsystem
114 * the driver is running on. This includes domain specific parameters such as
115 * intNum, baseAddress etc.
116 */
117 extern MMCSD_Error MMCSD_socInit(void);
118 #endif /* _MMCSD_SOC_H */
OS Abstraction Layer header.
uint64_t addr
Definition: csl_udmap_tr.h:214
MMCSD_Error MMCSD_configSocIntrPath(const void *hwAttrs_ptr, bool setIntrPath)
int32_t MMCSD_Error
Return status of MMCSD.
Definition: MMCSD.h:168
MMCSD_Error Board_mmc_voltageSwitchFxn(uint32_t instance, MMCSD_BusVoltage_e switch_voltage)
MMCSD_Error MMCSD_socInit(void)
uint32_t MMCSD_soc_l2_global_addr(uint32_t addr)