diff options
Diffstat (limited to 'firmware/target/arm/imx233/ssp-imx233.h')
-rw-r--r-- | firmware/target/arm/imx233/ssp-imx233.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/firmware/target/arm/imx233/ssp-imx233.h b/firmware/target/arm/imx233/ssp-imx233.h index c7c891ec0b..c9083d8d75 100644 --- a/firmware/target/arm/imx233/ssp-imx233.h +++ b/firmware/target/arm/imx233/ssp-imx233.h | |||
@@ -27,6 +27,7 @@ | |||
27 | #include "cpu.h" | 27 | #include "cpu.h" |
28 | #include "system.h" | 28 | #include "system.h" |
29 | #include "system-target.h" | 29 | #include "system-target.h" |
30 | #include "pinctrl-imx233.h" | ||
30 | 31 | ||
31 | /* ssp can value 1 or 2 */ | 32 | /* ssp can value 1 or 2 */ |
32 | #define __SSP_SELECT(ssp, ssp1, ssp2) ((ssp) == 1 ? (ssp1) : (ssp2)) | 33 | #define __SSP_SELECT(ssp, ssp1, ssp2) ((ssp) == 1 ? (ssp1) : (ssp2)) |
@@ -122,6 +123,7 @@ | |||
122 | #define HW_SSP_STATUS__RESP_TIMEOUT (1 << 14) | 123 | #define HW_SSP_STATUS__RESP_TIMEOUT (1 << 14) |
123 | #define HW_SSP_STATUS__RESP_ERR (1 << 15) | 124 | #define HW_SSP_STATUS__RESP_ERR (1 << 15) |
124 | #define HW_SSP_STATUS__RESP_CRC_ERR (1 << 16) | 125 | #define HW_SSP_STATUS__RESP_CRC_ERR (1 << 16) |
126 | #define HW_SSP_STATUS__CARD_DETECT (1 << 28) | ||
125 | #define HW_SSP_STATUS__ALL_ERRORS 0x1f800 | 127 | #define HW_SSP_STATUS__ALL_ERRORS 0x1f800 |
126 | 128 | ||
127 | #define HW_SSP_DEBUG(ssp) (*(volatile uint32_t *)(HW_SSP_BASE(ssp) + 0x100)) | 129 | #define HW_SSP_DEBUG(ssp) (*(volatile uint32_t *)(HW_SSP_BASE(ssp) + 0x100)) |
@@ -142,6 +144,8 @@ enum imx233_ssp_resp_t | |||
142 | SSP_LONG_RESP | 144 | SSP_LONG_RESP |
143 | }; | 145 | }; |
144 | 146 | ||
147 | typedef void (*ssp_detect_cb_t)(int ssp); | ||
148 | |||
145 | void imx233_ssp_init(void); | 149 | void imx233_ssp_init(void); |
146 | void imx233_ssp_start(int ssp); | 150 | void imx233_ssp_start(int ssp); |
147 | void imx233_ssp_stop(int ssp); | 151 | void imx233_ssp_stop(int ssp); |
@@ -156,8 +160,14 @@ void imx233_ssp_set_block_size(int ssp, unsigned log_block_size); | |||
156 | enum imx233_ssp_error_t imx233_ssp_sd_mmc_transfer(int ssp, uint8_t cmd, | 160 | enum imx233_ssp_error_t imx233_ssp_sd_mmc_transfer(int ssp, uint8_t cmd, |
157 | uint32_t cmd_arg, enum imx233_ssp_resp_t resp, void *buffer, unsigned block_count, | 161 | uint32_t cmd_arg, enum imx233_ssp_resp_t resp, void *buffer, unsigned block_count, |
158 | bool wait4irq, bool read, uint32_t *resp_ptr); | 162 | bool wait4irq, bool read, uint32_t *resp_ptr); |
163 | void imx233_ssp_setup_ssp1_sd_mmc_pins(bool enable_pullups, unsigned bus_width, | ||
164 | unsigned drive_strength, bool use_alt); | ||
159 | void imx233_ssp_setup_ssp2_sd_mmc_pins(bool enable_pullups, unsigned bus_width, | 165 | void imx233_ssp_setup_ssp2_sd_mmc_pins(bool enable_pullups, unsigned bus_width, |
160 | unsigned drive_strength); | 166 | unsigned drive_strength); |
167 | /* after callback is fired, imx233_ssp_sdmmc_setup_detect needs to be called | ||
168 | * to enable detection again */ | ||
169 | void imx233_ssp_sdmmc_setup_detect(int ssp, bool enable, ssp_detect_cb_t fn); | ||
170 | bool imx233_ssp_sdmmc_detect(int ssp); | ||
161 | /* SD/MMC requires that the card be provided the clock during an init sequence of | 171 | /* SD/MMC requires that the card be provided the clock during an init sequence of |
162 | * at least 1msec (or 74 clocks). Does NOT touch the clock so it has to be correct. */ | 172 | * at least 1msec (or 74 clocks). Does NOT touch the clock so it has to be correct. */ |
163 | void imx233_ssp_sd_mmc_power_up_sequence(int ssp); | 173 | void imx233_ssp_sd_mmc_power_up_sequence(int ssp); |