blob: 7ed532843bca8f859546078397a1d32a18006038 [file] [log] [blame]
Sukumar Ghoraic53f5e52010-09-18 20:32:33 -07001/*
2 * (C) Copyright 2008
3 * Texas Instruments, <www.ti.com>
4 * Sukumar Ghorai <s-ghorai@ti.com>
5 *
6 * See file CREDITS for list of people who contributed to this
7 * project.
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation's version 2 of
12 * the License.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
22 * MA 02111-1307 USA
23 */
24
25#include <config.h>
26#include <common.h>
Pantelis Antoniou2c850462014-03-11 19:34:20 +020027#include <malloc.h>
Sukumar Ghoraic53f5e52010-09-18 20:32:33 -070028#include <mmc.h>
29#include <part.h>
30#include <i2c.h>
31#include <twl4030.h>
Balaji T Kf843d332011-09-08 06:34:57 +000032#include <twl6030.h>
Nishanth Menon627612c2013-03-26 05:20:54 +000033#include <palmas.h>
Sukumar Ghoraic53f5e52010-09-18 20:32:33 -070034#include <asm/io.h>
35#include <asm/arch/mmc_host_def.h>
Roger Quadros44157de2015-09-19 16:26:53 +053036#if !defined(CONFIG_SOC_KEYSTONE)
37#include <asm/gpio.h>
Dirk Behme74140232011-05-15 09:04:47 +000038#include <asm/arch/sys_proto.h>
Roger Quadros44157de2015-09-19 16:26:53 +053039#endif
Tom Rinidf5338c2017-02-09 13:41:28 -050040#ifdef CONFIG_MMC_OMAP36XX_PINS
41#include <asm/arch/mux.h>
42#endif
Mugunthan V Nd97631a2015-09-28 12:56:30 +053043#include <dm.h>
44
45DECLARE_GLOBAL_DATA_PTR;
Sukumar Ghoraic53f5e52010-09-18 20:32:33 -070046
Pantelis Antoniouc9e75912014-02-26 19:28:45 +020047/* simplify defines to OMAP_HSMMC_USE_GPIO */
48#if (defined(CONFIG_OMAP_GPIO) && !defined(CONFIG_SPL_BUILD)) || \
49 (defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_GPIO_SUPPORT))
50#define OMAP_HSMMC_USE_GPIO
51#else
52#undef OMAP_HSMMC_USE_GPIO
53#endif
54
Grazvydas Ignotasddde1882012-03-19 12:12:06 +000055/* common definitions for all OMAPs */
56#define SYSCTL_SRC (1 << 25)
57#define SYSCTL_SRD (1 << 26)
58
Nikita Kiryanov13822862012-12-03 02:19:43 +000059struct omap_hsmmc_data {
60 struct hsmmc *base_addr;
Pantelis Antoniou2c850462014-03-11 19:34:20 +020061 struct mmc_config cfg;
Pantelis Antoniouc9e75912014-02-26 19:28:45 +020062#ifdef OMAP_HSMMC_USE_GPIO
Mugunthan V Nd97631a2015-09-28 12:56:30 +053063#ifdef CONFIG_DM_MMC
64 struct gpio_desc cd_gpio; /* Change Detect GPIO */
65 struct gpio_desc wp_gpio; /* Write Protect GPIO */
66 bool cd_inverted;
67#else
Nikita Kiryanov4eae05c2012-12-03 02:19:44 +000068 int cd_gpio;
Nikita Kiryanov4be9dbc2012-12-03 02:19:47 +000069 int wp_gpio;
Pantelis Antoniouc9e75912014-02-26 19:28:45 +020070#endif
Mugunthan V Nd97631a2015-09-28 12:56:30 +053071#endif
Nikita Kiryanov13822862012-12-03 02:19:43 +000072};
73
Nishanth Menond3bfaac2010-11-19 11:18:12 -050074/* If we fail after 1 second wait, something is really bad */
75#define MAX_RETRY_MS 1000
76
Sricharanf72611f2011-11-15 09:49:53 -050077static int mmc_read_data(struct hsmmc *mmc_base, char *buf, unsigned int size);
78static int mmc_write_data(struct hsmmc *mmc_base, const char *buf,
79 unsigned int siz);
Balaji T Kf843d332011-09-08 06:34:57 +000080
Mugunthan V Nd97631a2015-09-28 12:56:30 +053081#if defined(OMAP_HSMMC_USE_GPIO) && !defined(CONFIG_DM_MMC)
Nikita Kiryanov4eae05c2012-12-03 02:19:44 +000082static int omap_mmc_setup_gpio_in(int gpio, const char *label)
83{
Simon Glass1a96d7f2014-10-22 21:37:09 -060084 int ret;
Nikita Kiryanov4eae05c2012-12-03 02:19:44 +000085
Simon Glass1a96d7f2014-10-22 21:37:09 -060086#ifndef CONFIG_DM_GPIO
87 if (!gpio_is_valid(gpio))
Nikita Kiryanov4eae05c2012-12-03 02:19:44 +000088 return -1;
Simon Glass1a96d7f2014-10-22 21:37:09 -060089#endif
90 ret = gpio_request(gpio, label);
91 if (ret)
92 return ret;
Nikita Kiryanov4eae05c2012-12-03 02:19:44 +000093
Simon Glass1a96d7f2014-10-22 21:37:09 -060094 ret = gpio_direction_input(gpio);
95 if (ret)
96 return ret;
Nikita Kiryanov4eae05c2012-12-03 02:19:44 +000097
98 return gpio;
99}
Nikita Kiryanov4eae05c2012-12-03 02:19:44 +0000100#endif
101
Jeroen Hofsteeaedeeaa2014-07-12 21:24:08 +0200102static unsigned char mmc_board_init(struct mmc *mmc)
Sukumar Ghoraic53f5e52010-09-18 20:32:33 -0700103{
Sukumar Ghoraic53f5e52010-09-18 20:32:33 -0700104#if defined(CONFIG_OMAP34XX)
105 t2_t *t2_base = (t2_t *)T2_BASE;
106 struct prcm *prcm_base = (struct prcm *)PRCM_BASE;
Grazvydas Ignotasef2b7292012-03-19 03:50:53 +0000107 u32 pbias_lite;
Adam Fordef354962017-02-06 11:31:43 -0600108#ifdef CONFIG_MMC_OMAP36XX_PINS
109 u32 wkup_ctrl = readl(OMAP34XX_CTRL_WKUP_CTRL);
110#endif
Sukumar Ghoraic53f5e52010-09-18 20:32:33 -0700111
Grazvydas Ignotasef2b7292012-03-19 03:50:53 +0000112 pbias_lite = readl(&t2_base->pbias_lite);
113 pbias_lite &= ~(PBIASLITEPWRDNZ1 | PBIASLITEPWRDNZ0);
Albert ARIBAUD \(3ADEV\)6ad09812015-01-16 09:09:50 +0100114#ifdef CONFIG_TARGET_OMAP3_CAIRO
115 /* for cairo board, we need to set up 1.8 Volt bias level on MMC1 */
116 pbias_lite &= ~PBIASLITEVMODE0;
117#endif
Adam Fordef354962017-02-06 11:31:43 -0600118#ifdef CONFIG_MMC_OMAP36XX_PINS
119 if (get_cpu_family() == CPU_OMAP36XX) {
120 /* Disable extended drain IO before changing PBIAS */
121 wkup_ctrl &= ~OMAP34XX_CTRL_WKUP_CTRL_GPIO_IO_PWRDNZ;
122 writel(wkup_ctrl, OMAP34XX_CTRL_WKUP_CTRL);
123 }
124#endif
Grazvydas Ignotasef2b7292012-03-19 03:50:53 +0000125 writel(pbias_lite, &t2_base->pbias_lite);
Paul Kocialkowski69559892014-11-08 20:55:47 +0100126
Grazvydas Ignotasef2b7292012-03-19 03:50:53 +0000127 writel(pbias_lite | PBIASLITEPWRDNZ1 |
Sukumar Ghoraic53f5e52010-09-18 20:32:33 -0700128 PBIASSPEEDCTRL0 | PBIASLITEPWRDNZ0,
129 &t2_base->pbias_lite);
130
Adam Fordef354962017-02-06 11:31:43 -0600131#ifdef CONFIG_MMC_OMAP36XX_PINS
132 if (get_cpu_family() == CPU_OMAP36XX)
133 /* Enable extended drain IO after changing PBIAS */
134 writel(wkup_ctrl |
135 OMAP34XX_CTRL_WKUP_CTRL_GPIO_IO_PWRDNZ,
136 OMAP34XX_CTRL_WKUP_CTRL);
137#endif
Sukumar Ghoraic53f5e52010-09-18 20:32:33 -0700138 writel(readl(&t2_base->devconf0) | MMCSDIO1ADPCLKISEL,
139 &t2_base->devconf0);
140
141 writel(readl(&t2_base->devconf1) | MMCSDIO2ADPCLKISEL,
142 &t2_base->devconf1);
143
Jonathan Solnita9b05562012-02-24 11:30:18 +0000144 /* Change from default of 52MHz to 26MHz if necessary */
Pantelis Antoniou2c850462014-03-11 19:34:20 +0200145 if (!(mmc->cfg->host_caps & MMC_MODE_HS_52MHz))
Jonathan Solnita9b05562012-02-24 11:30:18 +0000146 writel(readl(&t2_base->ctl_prog_io1) & ~CTLPROGIO1SPEEDCTRL,
147 &t2_base->ctl_prog_io1);
148
Sukumar Ghoraic53f5e52010-09-18 20:32:33 -0700149 writel(readl(&prcm_base->fclken1_core) |
150 EN_MMC1 | EN_MMC2 | EN_MMC3,
151 &prcm_base->fclken1_core);
152
153 writel(readl(&prcm_base->iclken1_core) |
154 EN_MMC1 | EN_MMC2 | EN_MMC3,
155 &prcm_base->iclken1_core);
156#endif
157
Lokesh Vutlad999d052016-11-23 13:25:28 +0530158#if defined(CONFIG_OMAP54XX) || defined(CONFIG_OMAP44XX)
Balaji T Kf843d332011-09-08 06:34:57 +0000159 /* PBIAS config needed for MMC1 only */
Simon Glass2f26fff2016-02-29 15:25:51 -0700160 if (mmc->block_dev.devnum == 0)
Lokesh Vutlad999d052016-11-23 13:25:28 +0530161 vmmc_pbias_config(LDO_VOLT_3V0);
Balaji T Kd9cf8362012-03-12 02:25:49 +0000162#endif
Sukumar Ghoraic53f5e52010-09-18 20:32:33 -0700163
164 return 0;
165}
166
Sricharanf72611f2011-11-15 09:49:53 -0500167void mmc_init_stream(struct hsmmc *mmc_base)
Sukumar Ghoraic53f5e52010-09-18 20:32:33 -0700168{
Nishanth Menond3bfaac2010-11-19 11:18:12 -0500169 ulong start;
Sukumar Ghoraic53f5e52010-09-18 20:32:33 -0700170
171 writel(readl(&mmc_base->con) | INIT_INITSTREAM, &mmc_base->con);
172
173 writel(MMC_CMD0, &mmc_base->cmd);
Nishanth Menond3bfaac2010-11-19 11:18:12 -0500174 start = get_timer(0);
175 while (!(readl(&mmc_base->stat) & CC_MASK)) {
176 if (get_timer(0) - start > MAX_RETRY_MS) {
177 printf("%s: timedout waiting for cc!\n", __func__);
178 return;
179 }
180 }
Sukumar Ghoraic53f5e52010-09-18 20:32:33 -0700181 writel(CC_MASK, &mmc_base->stat)
182 ;
183 writel(MMC_CMD0, &mmc_base->cmd)
184 ;
Nishanth Menond3bfaac2010-11-19 11:18:12 -0500185 start = get_timer(0);
186 while (!(readl(&mmc_base->stat) & CC_MASK)) {
187 if (get_timer(0) - start > MAX_RETRY_MS) {
188 printf("%s: timedout waiting for cc2!\n", __func__);
189 return;
190 }
191 }
Sukumar Ghoraic53f5e52010-09-18 20:32:33 -0700192 writel(readl(&mmc_base->con) & ~INIT_INITSTREAM, &mmc_base->con);
193}
194
Pantelis Antoniouc9e75912014-02-26 19:28:45 +0200195static int omap_hsmmc_init_setup(struct mmc *mmc)
Sukumar Ghoraic53f5e52010-09-18 20:32:33 -0700196{
Nikita Kiryanov13822862012-12-03 02:19:43 +0000197 struct hsmmc *mmc_base;
Sukumar Ghoraic53f5e52010-09-18 20:32:33 -0700198 unsigned int reg_val;
199 unsigned int dsor;
Nishanth Menond3bfaac2010-11-19 11:18:12 -0500200 ulong start;
Sukumar Ghoraic53f5e52010-09-18 20:32:33 -0700201
Nikita Kiryanov13822862012-12-03 02:19:43 +0000202 mmc_base = ((struct omap_hsmmc_data *)mmc->priv)->base_addr;
Balaji T Kf843d332011-09-08 06:34:57 +0000203 mmc_board_init(mmc);
Sukumar Ghoraic53f5e52010-09-18 20:32:33 -0700204
205 writel(readl(&mmc_base->sysconfig) | MMC_SOFTRESET,
206 &mmc_base->sysconfig);
Nishanth Menond3bfaac2010-11-19 11:18:12 -0500207 start = get_timer(0);
208 while ((readl(&mmc_base->sysstatus) & RESETDONE) == 0) {
209 if (get_timer(0) - start > MAX_RETRY_MS) {
210 printf("%s: timedout waiting for cc2!\n", __func__);
Jaehoon Chung7825d202016-07-19 16:33:36 +0900211 return -ETIMEDOUT;
Nishanth Menond3bfaac2010-11-19 11:18:12 -0500212 }
213 }
Sukumar Ghoraic53f5e52010-09-18 20:32:33 -0700214 writel(readl(&mmc_base->sysctl) | SOFTRESETALL, &mmc_base->sysctl);
Nishanth Menond3bfaac2010-11-19 11:18:12 -0500215 start = get_timer(0);
216 while ((readl(&mmc_base->sysctl) & SOFTRESETALL) != 0x0) {
217 if (get_timer(0) - start > MAX_RETRY_MS) {
218 printf("%s: timedout waiting for softresetall!\n",
219 __func__);
Jaehoon Chung7825d202016-07-19 16:33:36 +0900220 return -ETIMEDOUT;
Nishanth Menond3bfaac2010-11-19 11:18:12 -0500221 }
222 }
Sukumar Ghoraic53f5e52010-09-18 20:32:33 -0700223 writel(DTW_1_BITMODE | SDBP_PWROFF | SDVS_3V0, &mmc_base->hctl);
224 writel(readl(&mmc_base->capa) | VS30_3V0SUP | VS18_1V8SUP,
225 &mmc_base->capa);
226
227 reg_val = readl(&mmc_base->con) & RESERVED_MASK;
228
229 writel(CTPL_MMC_SD | reg_val | WPP_ACTIVEHIGH | CDP_ACTIVEHIGH |
230 MIT_CTO | DW8_1_4BITMODE | MODE_FUNC | STR_BLOCK |
231 HR_NOHOSTRESP | INIT_NOINIT | NOOPENDRAIN, &mmc_base->con);
232
233 dsor = 240;
234 mmc_reg_out(&mmc_base->sysctl, (ICE_MASK | DTO_MASK | CEN_MASK),
235 (ICE_STOP | DTO_15THDTO | CEN_DISABLE));
236 mmc_reg_out(&mmc_base->sysctl, ICE_MASK | CLKD_MASK,
237 (dsor << CLKD_OFFSET) | ICE_OSCILLATE);
Nishanth Menond3bfaac2010-11-19 11:18:12 -0500238 start = get_timer(0);
239 while ((readl(&mmc_base->sysctl) & ICS_MASK) == ICS_NOTREADY) {
240 if (get_timer(0) - start > MAX_RETRY_MS) {
241 printf("%s: timedout waiting for ics!\n", __func__);
Jaehoon Chung7825d202016-07-19 16:33:36 +0900242 return -ETIMEDOUT;
Nishanth Menond3bfaac2010-11-19 11:18:12 -0500243 }
244 }
Sukumar Ghoraic53f5e52010-09-18 20:32:33 -0700245 writel(readl(&mmc_base->sysctl) | CEN_ENABLE, &mmc_base->sysctl);
246
247 writel(readl(&mmc_base->hctl) | SDBP_PWRON, &mmc_base->hctl);
248
249 writel(IE_BADA | IE_CERR | IE_DEB | IE_DCRC | IE_DTO | IE_CIE |
250 IE_CEB | IE_CCRC | IE_CTO | IE_BRR | IE_BWR | IE_TC | IE_CC,
251 &mmc_base->ie);
252
253 mmc_init_stream(mmc_base);
254
255 return 0;
256}
257
Grazvydas Ignotasddde1882012-03-19 12:12:06 +0000258/*
259 * MMC controller internal finite state machine reset
260 *
261 * Used to reset command or data internal state machines, using respectively
262 * SRC or SRD bit of SYSCTL register
263 */
264static void mmc_reset_controller_fsm(struct hsmmc *mmc_base, u32 bit)
265{
266 ulong start;
267
268 mmc_reg_out(&mmc_base->sysctl, bit, bit);
269
Oleksandr Tyshchenko06640ca2013-08-06 13:44:16 +0300270 /*
271 * CMD(DAT) lines reset procedures are slightly different
272 * for OMAP3 and OMAP4(AM335x,OMAP5,DRA7xx).
273 * According to OMAP3 TRM:
274 * Set SRC(SRD) bit in MMCHS_SYSCTL register to 0x1 and wait until it
275 * returns to 0x0.
276 * According to OMAP4(AM335x,OMAP5,DRA7xx) TRMs, CMD(DATA) lines reset
277 * procedure steps must be as follows:
278 * 1. Initiate CMD(DAT) line reset by writing 0x1 to SRC(SRD) bit in
279 * MMCHS_SYSCTL register (SD_SYSCTL for AM335x).
280 * 2. Poll the SRC(SRD) bit until it is set to 0x1.
281 * 3. Wait until the SRC (SRD) bit returns to 0x0
282 * (reset procedure is completed).
283 */
284#if defined(CONFIG_OMAP44XX) || defined(CONFIG_OMAP54XX) || \
Nikita Kiryanov5ffdd852015-07-30 23:56:20 +0300285 defined(CONFIG_AM33XX) || defined(CONFIG_AM43XX)
Oleksandr Tyshchenko06640ca2013-08-06 13:44:16 +0300286 if (!(readl(&mmc_base->sysctl) & bit)) {
287 start = get_timer(0);
288 while (!(readl(&mmc_base->sysctl) & bit)) {
289 if (get_timer(0) - start > MAX_RETRY_MS)
290 return;
291 }
292 }
293#endif
Grazvydas Ignotasddde1882012-03-19 12:12:06 +0000294 start = get_timer(0);
295 while ((readl(&mmc_base->sysctl) & bit) != 0) {
296 if (get_timer(0) - start > MAX_RETRY_MS) {
297 printf("%s: timedout waiting for sysctl %x to clear\n",
298 __func__, bit);
299 return;
300 }
301 }
302}
Sukumar Ghoraic53f5e52010-09-18 20:32:33 -0700303
Pantelis Antoniouc9e75912014-02-26 19:28:45 +0200304static int omap_hsmmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd,
Sukumar Ghoraic53f5e52010-09-18 20:32:33 -0700305 struct mmc_data *data)
306{
Nikita Kiryanov13822862012-12-03 02:19:43 +0000307 struct hsmmc *mmc_base;
Sukumar Ghoraic53f5e52010-09-18 20:32:33 -0700308 unsigned int flags, mmc_stat;
Nishanth Menond3bfaac2010-11-19 11:18:12 -0500309 ulong start;
Sukumar Ghoraic53f5e52010-09-18 20:32:33 -0700310
Nikita Kiryanov13822862012-12-03 02:19:43 +0000311 mmc_base = ((struct omap_hsmmc_data *)mmc->priv)->base_addr;
Nishanth Menond3bfaac2010-11-19 11:18:12 -0500312 start = get_timer(0);
Tom Rini32ec3252012-01-30 11:22:25 +0000313 while ((readl(&mmc_base->pstate) & (DATI_MASK | CMDI_MASK)) != 0) {
Nishanth Menond3bfaac2010-11-19 11:18:12 -0500314 if (get_timer(0) - start > MAX_RETRY_MS) {
Tom Rini32ec3252012-01-30 11:22:25 +0000315 printf("%s: timedout waiting on cmd inhibit to clear\n",
316 __func__);
Jaehoon Chung7825d202016-07-19 16:33:36 +0900317 return -ETIMEDOUT;
Nishanth Menond3bfaac2010-11-19 11:18:12 -0500318 }
319 }
Sukumar Ghoraic53f5e52010-09-18 20:32:33 -0700320 writel(0xFFFFFFFF, &mmc_base->stat);
Nishanth Menond3bfaac2010-11-19 11:18:12 -0500321 start = get_timer(0);
322 while (readl(&mmc_base->stat)) {
323 if (get_timer(0) - start > MAX_RETRY_MS) {
Grazvydas Ignotas8927ac92012-03-19 12:11:43 +0000324 printf("%s: timedout waiting for STAT (%x) to clear\n",
325 __func__, readl(&mmc_base->stat));
Jaehoon Chung7825d202016-07-19 16:33:36 +0900326 return -ETIMEDOUT;
Nishanth Menond3bfaac2010-11-19 11:18:12 -0500327 }
328 }
Sukumar Ghoraic53f5e52010-09-18 20:32:33 -0700329 /*
330 * CMDREG
331 * CMDIDX[13:8] : Command index
332 * DATAPRNT[5] : Data Present Select
333 * ENCMDIDX[4] : Command Index Check Enable
334 * ENCMDCRC[3] : Command CRC Check Enable
335 * RSPTYP[1:0]
336 * 00 = No Response
337 * 01 = Length 136
338 * 10 = Length 48
339 * 11 = Length 48 Check busy after response
340 */
341 /* Delay added before checking the status of frq change
342 * retry not supported by mmc.c(core file)
343 */
344 if (cmd->cmdidx == SD_CMD_APP_SEND_SCR)
345 udelay(50000); /* wait 50 ms */
346
347 if (!(cmd->resp_type & MMC_RSP_PRESENT))
348 flags = 0;
349 else if (cmd->resp_type & MMC_RSP_136)
350 flags = RSP_TYPE_LGHT136 | CICE_NOCHECK;
351 else if (cmd->resp_type & MMC_RSP_BUSY)
352 flags = RSP_TYPE_LGHT48B;
353 else
354 flags = RSP_TYPE_LGHT48;
355
356 /* enable default flags */
357 flags = flags | (CMD_TYPE_NORMAL | CICE_NOCHECK | CCCE_NOCHECK |
358 MSBS_SGLEBLK | ACEN_DISABLE | BCE_DISABLE | DE_DISABLE);
359
360 if (cmd->resp_type & MMC_RSP_CRC)
361 flags |= CCCE_CHECK;
362 if (cmd->resp_type & MMC_RSP_OPCODE)
363 flags |= CICE_CHECK;
364
365 if (data) {
366 if ((cmd->cmdidx == MMC_CMD_READ_MULTIPLE_BLOCK) ||
367 (cmd->cmdidx == MMC_CMD_WRITE_MULTIPLE_BLOCK)) {
368 flags |= (MSBS_MULTIBLK | BCE_ENABLE);
369 data->blocksize = 512;
370 writel(data->blocksize | (data->blocks << 16),
371 &mmc_base->blk);
372 } else
373 writel(data->blocksize | NBLK_STPCNT, &mmc_base->blk);
374
375 if (data->flags & MMC_DATA_READ)
376 flags |= (DP_DATA | DDIR_READ);
377 else
378 flags |= (DP_DATA | DDIR_WRITE);
379 }
380
381 writel(cmd->cmdarg, &mmc_base->arg);
Lubomir Popov19df4122013-08-14 18:59:18 +0300382 udelay(20); /* To fix "No status update" error on eMMC */
Sukumar Ghoraic53f5e52010-09-18 20:32:33 -0700383 writel((cmd->cmdidx << 24) | flags, &mmc_base->cmd);
384
Nishanth Menond3bfaac2010-11-19 11:18:12 -0500385 start = get_timer(0);
Sukumar Ghoraic53f5e52010-09-18 20:32:33 -0700386 do {
387 mmc_stat = readl(&mmc_base->stat);
Nishanth Menond3bfaac2010-11-19 11:18:12 -0500388 if (get_timer(0) - start > MAX_RETRY_MS) {
389 printf("%s : timeout: No status update\n", __func__);
Jaehoon Chung7825d202016-07-19 16:33:36 +0900390 return -ETIMEDOUT;
Nishanth Menond3bfaac2010-11-19 11:18:12 -0500391 }
392 } while (!mmc_stat);
Sukumar Ghoraic53f5e52010-09-18 20:32:33 -0700393
Grazvydas Ignotasddde1882012-03-19 12:12:06 +0000394 if ((mmc_stat & IE_CTO) != 0) {
395 mmc_reset_controller_fsm(mmc_base, SYSCTL_SRC);
Jaehoon Chung7825d202016-07-19 16:33:36 +0900396 return -ETIMEDOUT;
Grazvydas Ignotasddde1882012-03-19 12:12:06 +0000397 } else if ((mmc_stat & ERRI_MASK) != 0)
Sukumar Ghoraic53f5e52010-09-18 20:32:33 -0700398 return -1;
399
400 if (mmc_stat & CC_MASK) {
401 writel(CC_MASK, &mmc_base->stat);
402 if (cmd->resp_type & MMC_RSP_PRESENT) {
403 if (cmd->resp_type & MMC_RSP_136) {
404 /* response type 2 */
405 cmd->response[3] = readl(&mmc_base->rsp10);
406 cmd->response[2] = readl(&mmc_base->rsp32);
407 cmd->response[1] = readl(&mmc_base->rsp54);
408 cmd->response[0] = readl(&mmc_base->rsp76);
409 } else
410 /* response types 1, 1b, 3, 4, 5, 6 */
411 cmd->response[0] = readl(&mmc_base->rsp10);
412 }
413 }
414
415 if (data && (data->flags & MMC_DATA_READ)) {
416 mmc_read_data(mmc_base, data->dest,
417 data->blocksize * data->blocks);
418 } else if (data && (data->flags & MMC_DATA_WRITE)) {
419 mmc_write_data(mmc_base, data->src,
420 data->blocksize * data->blocks);
421 }
422 return 0;
423}
424
Sricharanf72611f2011-11-15 09:49:53 -0500425static int mmc_read_data(struct hsmmc *mmc_base, char *buf, unsigned int size)
Sukumar Ghoraic53f5e52010-09-18 20:32:33 -0700426{
427 unsigned int *output_buf = (unsigned int *)buf;
428 unsigned int mmc_stat;
429 unsigned int count;
430
431 /*
432 * Start Polled Read
433 */
434 count = (size > MMCSD_SECTOR_SIZE) ? MMCSD_SECTOR_SIZE : size;
435 count /= 4;
436
437 while (size) {
Nishanth Menond3bfaac2010-11-19 11:18:12 -0500438 ulong start = get_timer(0);
Sukumar Ghoraic53f5e52010-09-18 20:32:33 -0700439 do {
440 mmc_stat = readl(&mmc_base->stat);
Nishanth Menond3bfaac2010-11-19 11:18:12 -0500441 if (get_timer(0) - start > MAX_RETRY_MS) {
442 printf("%s: timedout waiting for status!\n",
443 __func__);
Jaehoon Chung7825d202016-07-19 16:33:36 +0900444 return -ETIMEDOUT;
Nishanth Menond3bfaac2010-11-19 11:18:12 -0500445 }
Sukumar Ghoraic53f5e52010-09-18 20:32:33 -0700446 } while (mmc_stat == 0);
447
Grazvydas Ignotasddde1882012-03-19 12:12:06 +0000448 if ((mmc_stat & (IE_DTO | IE_DCRC | IE_DEB)) != 0)
449 mmc_reset_controller_fsm(mmc_base, SYSCTL_SRD);
450
Sukumar Ghoraic53f5e52010-09-18 20:32:33 -0700451 if ((mmc_stat & ERRI_MASK) != 0)
452 return 1;
453
454 if (mmc_stat & BRR_MASK) {
455 unsigned int k;
456
457 writel(readl(&mmc_base->stat) | BRR_MASK,
458 &mmc_base->stat);
459 for (k = 0; k < count; k++) {
460 *output_buf = readl(&mmc_base->data);
461 output_buf++;
462 }
463 size -= (count*4);
464 }
465
466 if (mmc_stat & BWR_MASK)
467 writel(readl(&mmc_base->stat) | BWR_MASK,
468 &mmc_base->stat);
469
470 if (mmc_stat & TC_MASK) {
471 writel(readl(&mmc_base->stat) | TC_MASK,
472 &mmc_base->stat);
473 break;
474 }
475 }
476 return 0;
477}
478
Sricharanf72611f2011-11-15 09:49:53 -0500479static int mmc_write_data(struct hsmmc *mmc_base, const char *buf,
480 unsigned int size)
Sukumar Ghoraic53f5e52010-09-18 20:32:33 -0700481{
482 unsigned int *input_buf = (unsigned int *)buf;
483 unsigned int mmc_stat;
484 unsigned int count;
485
486 /*
Lubomir Popov19df4122013-08-14 18:59:18 +0300487 * Start Polled Write
Sukumar Ghoraic53f5e52010-09-18 20:32:33 -0700488 */
489 count = (size > MMCSD_SECTOR_SIZE) ? MMCSD_SECTOR_SIZE : size;
490 count /= 4;
491
492 while (size) {
Nishanth Menond3bfaac2010-11-19 11:18:12 -0500493 ulong start = get_timer(0);
Sukumar Ghoraic53f5e52010-09-18 20:32:33 -0700494 do {
495 mmc_stat = readl(&mmc_base->stat);
Nishanth Menond3bfaac2010-11-19 11:18:12 -0500496 if (get_timer(0) - start > MAX_RETRY_MS) {
497 printf("%s: timedout waiting for status!\n",
498 __func__);
Jaehoon Chung7825d202016-07-19 16:33:36 +0900499 return -ETIMEDOUT;
Nishanth Menond3bfaac2010-11-19 11:18:12 -0500500 }
Sukumar Ghoraic53f5e52010-09-18 20:32:33 -0700501 } while (mmc_stat == 0);
502
Grazvydas Ignotasddde1882012-03-19 12:12:06 +0000503 if ((mmc_stat & (IE_DTO | IE_DCRC | IE_DEB)) != 0)
504 mmc_reset_controller_fsm(mmc_base, SYSCTL_SRD);
505
Sukumar Ghoraic53f5e52010-09-18 20:32:33 -0700506 if ((mmc_stat & ERRI_MASK) != 0)
507 return 1;
508
509 if (mmc_stat & BWR_MASK) {
510 unsigned int k;
511
512 writel(readl(&mmc_base->stat) | BWR_MASK,
513 &mmc_base->stat);
514 for (k = 0; k < count; k++) {
515 writel(*input_buf, &mmc_base->data);
516 input_buf++;
517 }
518 size -= (count*4);
519 }
520
521 if (mmc_stat & BRR_MASK)
522 writel(readl(&mmc_base->stat) | BRR_MASK,
523 &mmc_base->stat);
524
525 if (mmc_stat & TC_MASK) {
526 writel(readl(&mmc_base->stat) | TC_MASK,
527 &mmc_base->stat);
528 break;
529 }
530 }
531 return 0;
532}
533
Jaehoon Chungb6cd1d32016-12-30 15:30:16 +0900534static int omap_hsmmc_set_ios(struct mmc *mmc)
Sukumar Ghoraic53f5e52010-09-18 20:32:33 -0700535{
Nikita Kiryanov13822862012-12-03 02:19:43 +0000536 struct hsmmc *mmc_base;
Sukumar Ghoraic53f5e52010-09-18 20:32:33 -0700537 unsigned int dsor = 0;
Nishanth Menond3bfaac2010-11-19 11:18:12 -0500538 ulong start;
Sukumar Ghoraic53f5e52010-09-18 20:32:33 -0700539
Nikita Kiryanov13822862012-12-03 02:19:43 +0000540 mmc_base = ((struct omap_hsmmc_data *)mmc->priv)->base_addr;
Sukumar Ghoraic53f5e52010-09-18 20:32:33 -0700541 /* configue bus width */
542 switch (mmc->bus_width) {
543 case 8:
544 writel(readl(&mmc_base->con) | DTW_8_BITMODE,
545 &mmc_base->con);
546 break;
547
548 case 4:
549 writel(readl(&mmc_base->con) & ~DTW_8_BITMODE,
550 &mmc_base->con);
551 writel(readl(&mmc_base->hctl) | DTW_4_BITMODE,
552 &mmc_base->hctl);
553 break;
554
555 case 1:
556 default:
557 writel(readl(&mmc_base->con) & ~DTW_8_BITMODE,
558 &mmc_base->con);
559 writel(readl(&mmc_base->hctl) & ~DTW_4_BITMODE,
560 &mmc_base->hctl);
561 break;
562 }
563
564 /* configure clock with 96Mhz system clock.
565 */
566 if (mmc->clock != 0) {
567 dsor = (MMC_CLOCK_REFERENCE * 1000000 / mmc->clock);
568 if ((MMC_CLOCK_REFERENCE * 1000000) / dsor > mmc->clock)
569 dsor++;
570 }
571
572 mmc_reg_out(&mmc_base->sysctl, (ICE_MASK | DTO_MASK | CEN_MASK),
573 (ICE_STOP | DTO_15THDTO | CEN_DISABLE));
574
575 mmc_reg_out(&mmc_base->sysctl, ICE_MASK | CLKD_MASK,
576 (dsor << CLKD_OFFSET) | ICE_OSCILLATE);
577
Nishanth Menond3bfaac2010-11-19 11:18:12 -0500578 start = get_timer(0);
579 while ((readl(&mmc_base->sysctl) & ICS_MASK) == ICS_NOTREADY) {
580 if (get_timer(0) - start > MAX_RETRY_MS) {
581 printf("%s: timedout waiting for ics!\n", __func__);
Jaehoon Chungb6cd1d32016-12-30 15:30:16 +0900582 return -ETIMEDOUT;
Nishanth Menond3bfaac2010-11-19 11:18:12 -0500583 }
584 }
Sukumar Ghoraic53f5e52010-09-18 20:32:33 -0700585 writel(readl(&mmc_base->sysctl) | CEN_ENABLE, &mmc_base->sysctl);
Jaehoon Chungb6cd1d32016-12-30 15:30:16 +0900586
587 return 0;
Sukumar Ghoraic53f5e52010-09-18 20:32:33 -0700588}
589
Pantelis Antoniouc9e75912014-02-26 19:28:45 +0200590#ifdef OMAP_HSMMC_USE_GPIO
Mugunthan V Nd97631a2015-09-28 12:56:30 +0530591#ifdef CONFIG_DM_MMC
Pantelis Antoniouc9e75912014-02-26 19:28:45 +0200592static int omap_hsmmc_getcd(struct mmc *mmc)
593{
Mugunthan V Nd97631a2015-09-28 12:56:30 +0530594 struct omap_hsmmc_data *priv = mmc->priv;
595 int value;
596
597 value = dm_gpio_get_value(&priv->cd_gpio);
598 /* if no CD return as 1 */
599 if (value < 0)
600 return 1;
601
602 if (priv->cd_inverted)
603 return !value;
604 return value;
605}
606
607static int omap_hsmmc_getwp(struct mmc *mmc)
608{
609 struct omap_hsmmc_data *priv = mmc->priv;
610 int value;
611
612 value = dm_gpio_get_value(&priv->wp_gpio);
613 /* if no WP return as 0 */
614 if (value < 0)
615 return 0;
616 return value;
617}
618#else
619static int omap_hsmmc_getcd(struct mmc *mmc)
620{
Pantelis Antoniouc9e75912014-02-26 19:28:45 +0200621 struct omap_hsmmc_data *priv_data = mmc->priv;
622 int cd_gpio;
623
624 /* if no CD return as 1 */
625 cd_gpio = priv_data->cd_gpio;
626 if (cd_gpio < 0)
627 return 1;
628
Igor Grinberg2f4e0952014-11-03 11:32:23 +0200629 /* NOTE: assumes card detect signal is active-low */
630 return !gpio_get_value(cd_gpio);
Pantelis Antoniouc9e75912014-02-26 19:28:45 +0200631}
632
633static int omap_hsmmc_getwp(struct mmc *mmc)
634{
635 struct omap_hsmmc_data *priv_data = mmc->priv;
636 int wp_gpio;
637
638 /* if no WP return as 0 */
639 wp_gpio = priv_data->wp_gpio;
640 if (wp_gpio < 0)
641 return 0;
642
Igor Grinberg2f4e0952014-11-03 11:32:23 +0200643 /* NOTE: assumes write protect signal is active-high */
Pantelis Antoniouc9e75912014-02-26 19:28:45 +0200644 return gpio_get_value(wp_gpio);
645}
646#endif
Mugunthan V Nd97631a2015-09-28 12:56:30 +0530647#endif
Pantelis Antoniouc9e75912014-02-26 19:28:45 +0200648
649static const struct mmc_ops omap_hsmmc_ops = {
650 .send_cmd = omap_hsmmc_send_cmd,
651 .set_ios = omap_hsmmc_set_ios,
652 .init = omap_hsmmc_init_setup,
653#ifdef OMAP_HSMMC_USE_GPIO
654 .getcd = omap_hsmmc_getcd,
655 .getwp = omap_hsmmc_getwp,
656#endif
657};
658
Mugunthan V Nd97631a2015-09-28 12:56:30 +0530659#ifndef CONFIG_DM_MMC
Nikita Kiryanov4be9dbc2012-12-03 02:19:47 +0000660int omap_mmc_init(int dev_index, uint host_caps_mask, uint f_max, int cd_gpio,
661 int wp_gpio)
Sukumar Ghoraic53f5e52010-09-18 20:32:33 -0700662{
Pantelis Antoniou2c850462014-03-11 19:34:20 +0200663 struct mmc *mmc;
664 struct omap_hsmmc_data *priv_data;
665 struct mmc_config *cfg;
666 uint host_caps_val;
667
668 priv_data = malloc(sizeof(*priv_data));
669 if (priv_data == NULL)
670 return -1;
Sukumar Ghoraic53f5e52010-09-18 20:32:33 -0700671
Rob Herring5fd3edd2015-03-23 17:56:59 -0500672 host_caps_val = MMC_MODE_4BIT | MMC_MODE_HS_52MHz | MMC_MODE_HS;
Sukumar Ghoraic53f5e52010-09-18 20:32:33 -0700673
674 switch (dev_index) {
675 case 0:
Nikita Kiryanov13822862012-12-03 02:19:43 +0000676 priv_data->base_addr = (struct hsmmc *)OMAP_HSMMC1_BASE;
Sukumar Ghoraic53f5e52010-09-18 20:32:33 -0700677 break;
Tom Rinifd6e2942011-10-12 06:20:50 +0000678#ifdef OMAP_HSMMC2_BASE
Sukumar Ghoraic53f5e52010-09-18 20:32:33 -0700679 case 1:
Nikita Kiryanov13822862012-12-03 02:19:43 +0000680 priv_data->base_addr = (struct hsmmc *)OMAP_HSMMC2_BASE;
Lubomir Popov19df4122013-08-14 18:59:18 +0300681#if (defined(CONFIG_OMAP44XX) || defined(CONFIG_OMAP54XX) || \
Nishanth Menon813fe9d2016-11-29 15:22:00 +0530682 defined(CONFIG_DRA7XX) || defined(CONFIG_AM33XX) || \
Roger Quadros44157de2015-09-19 16:26:53 +0530683 defined(CONFIG_AM43XX) || defined(CONFIG_SOC_KEYSTONE)) && \
684 defined(CONFIG_HSMMC2_8BIT)
Lubomir Popov19df4122013-08-14 18:59:18 +0300685 /* Enable 8-bit interface for eMMC on OMAP4/5 or DRA7XX */
686 host_caps_val |= MMC_MODE_8BIT;
687#endif
Sukumar Ghoraic53f5e52010-09-18 20:32:33 -0700688 break;
Tom Rinifd6e2942011-10-12 06:20:50 +0000689#endif
690#ifdef OMAP_HSMMC3_BASE
Sukumar Ghoraic53f5e52010-09-18 20:32:33 -0700691 case 2:
Nikita Kiryanov13822862012-12-03 02:19:43 +0000692 priv_data->base_addr = (struct hsmmc *)OMAP_HSMMC3_BASE;
Nishanth Menon813fe9d2016-11-29 15:22:00 +0530693#if defined(CONFIG_DRA7XX) && defined(CONFIG_HSMMC3_8BIT)
Lubomir Popov19df4122013-08-14 18:59:18 +0300694 /* Enable 8-bit interface for eMMC on DRA7XX */
695 host_caps_val |= MMC_MODE_8BIT;
696#endif
Sukumar Ghoraic53f5e52010-09-18 20:32:33 -0700697 break;
Tom Rinifd6e2942011-10-12 06:20:50 +0000698#endif
Sukumar Ghoraic53f5e52010-09-18 20:32:33 -0700699 default:
Nikita Kiryanov13822862012-12-03 02:19:43 +0000700 priv_data->base_addr = (struct hsmmc *)OMAP_HSMMC1_BASE;
Sukumar Ghoraic53f5e52010-09-18 20:32:33 -0700701 return 1;
702 }
Pantelis Antoniouc9e75912014-02-26 19:28:45 +0200703#ifdef OMAP_HSMMC_USE_GPIO
704 /* on error gpio values are set to -1, which is what we want */
Nikita Kiryanov4eae05c2012-12-03 02:19:44 +0000705 priv_data->cd_gpio = omap_mmc_setup_gpio_in(cd_gpio, "mmc_cd");
Nikita Kiryanov4be9dbc2012-12-03 02:19:47 +0000706 priv_data->wp_gpio = omap_mmc_setup_gpio_in(wp_gpio, "mmc_wp");
Pantelis Antoniouc9e75912014-02-26 19:28:45 +0200707#endif
Peter Korsgaard47c6b2a2013-03-21 04:00:04 +0000708
Pantelis Antoniou2c850462014-03-11 19:34:20 +0200709 cfg = &priv_data->cfg;
Sukumar Ghoraic53f5e52010-09-18 20:32:33 -0700710
Pantelis Antoniou2c850462014-03-11 19:34:20 +0200711 cfg->name = "OMAP SD/MMC";
712 cfg->ops = &omap_hsmmc_ops;
713
714 cfg->voltages = MMC_VDD_32_33 | MMC_VDD_33_34 | MMC_VDD_165_195;
715 cfg->host_caps = host_caps_val & ~host_caps_mask;
716
717 cfg->f_min = 400000;
Jonathan Solnita9b05562012-02-24 11:30:18 +0000718
719 if (f_max != 0)
Pantelis Antoniou2c850462014-03-11 19:34:20 +0200720 cfg->f_max = f_max;
Jonathan Solnita9b05562012-02-24 11:30:18 +0000721 else {
Pantelis Antoniou2c850462014-03-11 19:34:20 +0200722 if (cfg->host_caps & MMC_MODE_HS) {
723 if (cfg->host_caps & MMC_MODE_HS_52MHz)
724 cfg->f_max = 52000000;
Jonathan Solnita9b05562012-02-24 11:30:18 +0000725 else
Pantelis Antoniou2c850462014-03-11 19:34:20 +0200726 cfg->f_max = 26000000;
Jonathan Solnita9b05562012-02-24 11:30:18 +0000727 } else
Pantelis Antoniou2c850462014-03-11 19:34:20 +0200728 cfg->f_max = 20000000;
Jonathan Solnita9b05562012-02-24 11:30:18 +0000729 }
Sukumar Ghoraic53f5e52010-09-18 20:32:33 -0700730
Pantelis Antoniou2c850462014-03-11 19:34:20 +0200731 cfg->b_max = CONFIG_SYS_MMC_MAX_BLK_COUNT;
John Rigbyf2f43662011-04-18 05:50:08 +0000732
John Rigby91fcc4b2011-04-19 05:48:14 +0000733#if defined(CONFIG_OMAP34XX)
734 /*
735 * Silicon revs 2.1 and older do not support multiblock transfers.
736 */
737 if ((get_cpu_family() == CPU_OMAP34XX) && (get_cpu_rev() <= CPU_3XX_ES21))
Pantelis Antoniou2c850462014-03-11 19:34:20 +0200738 cfg->b_max = 1;
John Rigby91fcc4b2011-04-19 05:48:14 +0000739#endif
Pantelis Antoniou2c850462014-03-11 19:34:20 +0200740 mmc = mmc_create(cfg, priv_data);
741 if (mmc == NULL)
742 return -1;
Sukumar Ghoraic53f5e52010-09-18 20:32:33 -0700743
744 return 0;
745}
Mugunthan V Nd97631a2015-09-28 12:56:30 +0530746#else
747static int omap_hsmmc_ofdata_to_platdata(struct udevice *dev)
748{
749 struct omap_hsmmc_data *priv = dev_get_priv(dev);
750 const void *fdt = gd->fdt_blob;
Simon Glassdd79d6e2017-01-17 16:52:55 -0700751 int node = dev_of_offset(dev);
Mugunthan V Nd97631a2015-09-28 12:56:30 +0530752 struct mmc_config *cfg;
753 int val;
754
Mugunthan V N1fda80c2016-04-04 15:22:49 +0530755 priv->base_addr = map_physmem(dev_get_addr(dev), sizeof(struct hsmmc *),
756 MAP_NOCACHE);
Mugunthan V Nd97631a2015-09-28 12:56:30 +0530757 cfg = &priv->cfg;
758
759 cfg->host_caps = MMC_MODE_HS_52MHz | MMC_MODE_HS;
760 val = fdtdec_get_int(fdt, node, "bus-width", -1);
761 if (val < 0) {
762 printf("error: bus-width property missing\n");
763 return -ENOENT;
764 }
765
766 switch (val) {
767 case 0x8:
768 cfg->host_caps |= MMC_MODE_8BIT;
769 case 0x4:
770 cfg->host_caps |= MMC_MODE_4BIT;
771 break;
772 default:
773 printf("error: invalid bus-width property\n");
774 return -ENOENT;
775 }
776
777 cfg->f_min = 400000;
778 cfg->f_max = fdtdec_get_int(fdt, node, "max-frequency", 52000000);
779 cfg->voltages = MMC_VDD_32_33 | MMC_VDD_33_34 | MMC_VDD_165_195;
780 cfg->b_max = CONFIG_SYS_MMC_MAX_BLK_COUNT;
781
Sekhar Nori640fd702016-08-10 19:24:03 +0530782#ifdef OMAP_HSMMC_USE_GPIO
Mugunthan V Nd97631a2015-09-28 12:56:30 +0530783 priv->cd_inverted = fdtdec_get_bool(fdt, node, "cd-inverted");
Sekhar Nori640fd702016-08-10 19:24:03 +0530784#endif
Mugunthan V Nd97631a2015-09-28 12:56:30 +0530785
786 return 0;
787}
788
789static int omap_hsmmc_probe(struct udevice *dev)
790{
791 struct mmc_uclass_priv *upriv = dev_get_uclass_priv(dev);
792 struct omap_hsmmc_data *priv = dev_get_priv(dev);
793 struct mmc_config *cfg;
794 struct mmc *mmc;
795
796 cfg = &priv->cfg;
797 cfg->name = "OMAP SD/MMC";
798 cfg->ops = &omap_hsmmc_ops;
799
800 mmc = mmc_create(cfg, priv);
801 if (mmc == NULL)
802 return -1;
803
Mugunthan V Na9a0aa72016-04-04 17:28:01 +0530804#ifdef OMAP_HSMMC_USE_GPIO
805 gpio_request_by_name(dev, "cd-gpios", 0, &priv->cd_gpio, GPIOD_IS_IN);
806 gpio_request_by_name(dev, "wp-gpios", 0, &priv->wp_gpio, GPIOD_IS_IN);
807#endif
808
Simon Glass77ca42b2016-05-01 13:52:34 -0600809 mmc->dev = dev;
Mugunthan V Nd97631a2015-09-28 12:56:30 +0530810 upriv->mmc = mmc;
811
812 return 0;
813}
814
815static const struct udevice_id omap_hsmmc_ids[] = {
816 { .compatible = "ti,omap3-hsmmc" },
817 { .compatible = "ti,omap4-hsmmc" },
818 { .compatible = "ti,am33xx-hsmmc" },
819 { }
820};
821
822U_BOOT_DRIVER(omap_hsmmc) = {
823 .name = "omap_hsmmc",
824 .id = UCLASS_MMC,
825 .of_match = omap_hsmmc_ids,
826 .ofdata_to_platdata = omap_hsmmc_ofdata_to_platdata,
827 .probe = omap_hsmmc_probe,
828 .priv_auto_alloc_size = sizeof(struct omap_hsmmc_data),
829};
830#endif