2018-05-06 21:58:06 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0+
|
2011-05-31 10:30:37 +00:00
|
|
|
/*
|
|
|
|
* (C) Copyright 2009 SAMSUNG Electronics
|
|
|
|
* Minkyu Kang <mk7.kang@samsung.com>
|
|
|
|
* Jaehoon Chung <jh80.chung@samsung.com>
|
2016-09-13 16:45:48 +00:00
|
|
|
* Portions Copyright 2011-2016 NVIDIA Corporation
|
2011-05-31 10:30:37 +00:00
|
|
|
*/
|
|
|
|
|
2012-11-06 11:27:30 +00:00
|
|
|
#include <bouncebuf.h>
|
2011-05-31 10:30:37 +00:00
|
|
|
#include <common.h>
|
2017-05-17 23:18:03 +00:00
|
|
|
#include <dm.h>
|
2016-07-19 07:33:36 +00:00
|
|
|
#include <errno.h>
|
2017-07-25 14:30:08 +00:00
|
|
|
#include <mmc.h>
|
2011-10-31 06:51:36 +00:00
|
|
|
#include <asm/gpio.h>
|
2011-05-31 10:30:37 +00:00
|
|
|
#include <asm/io.h>
|
2012-09-19 22:50:56 +00:00
|
|
|
#include <asm/arch-tegra/tegra_mmc.h>
|
2020-02-03 14:36:15 +00:00
|
|
|
#include <linux/err.h>
|
2011-05-31 10:30:37 +00:00
|
|
|
|
2017-04-24 02:02:11 +00:00
|
|
|
struct tegra_mmc_plat {
|
|
|
|
struct mmc_config cfg;
|
|
|
|
struct mmc mmc;
|
|
|
|
};
|
|
|
|
|
2016-09-13 16:45:46 +00:00
|
|
|
struct tegra_mmc_priv {
|
|
|
|
struct tegra_mmc *reg;
|
|
|
|
struct reset_ctl reset_ctl;
|
|
|
|
struct clk clk;
|
|
|
|
struct gpio_desc cd_gpio; /* Change Detect GPIO */
|
|
|
|
struct gpio_desc pwr_gpio; /* Power GPIO */
|
|
|
|
struct gpio_desc wp_gpio; /* Write Protect GPIO */
|
|
|
|
unsigned int version; /* SDHCI spec. version */
|
|
|
|
unsigned int clock; /* Current clock (MHz) */
|
|
|
|
};
|
|
|
|
|
|
|
|
static void tegra_mmc_set_power(struct tegra_mmc_priv *priv,
|
|
|
|
unsigned short power)
|
2013-02-26 19:31:26 +00:00
|
|
|
{
|
|
|
|
u8 pwr = 0;
|
|
|
|
debug("%s: power = %x\n", __func__, power);
|
|
|
|
|
|
|
|
if (power != (unsigned short)-1) {
|
|
|
|
switch (1 << power) {
|
|
|
|
case MMC_VDD_165_195:
|
|
|
|
pwr = TEGRA_MMC_PWRCTL_SD_BUS_VOLTAGE_V1_8;
|
|
|
|
break;
|
|
|
|
case MMC_VDD_29_30:
|
|
|
|
case MMC_VDD_30_31:
|
|
|
|
pwr = TEGRA_MMC_PWRCTL_SD_BUS_VOLTAGE_V3_0;
|
|
|
|
break;
|
|
|
|
case MMC_VDD_32_33:
|
|
|
|
case MMC_VDD_33_34:
|
|
|
|
pwr = TEGRA_MMC_PWRCTL_SD_BUS_VOLTAGE_V3_3;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
debug("%s: pwr = %X\n", __func__, pwr);
|
|
|
|
|
|
|
|
/* Set the bus voltage first (if any) */
|
2016-09-13 16:45:46 +00:00
|
|
|
writeb(pwr, &priv->reg->pwrcon);
|
2013-02-26 19:31:26 +00:00
|
|
|
if (pwr == 0)
|
|
|
|
return;
|
|
|
|
|
|
|
|
/* Now enable bus power */
|
|
|
|
pwr |= TEGRA_MMC_PWRCTL_SD_BUS_POWER;
|
2016-09-13 16:45:46 +00:00
|
|
|
writeb(pwr, &priv->reg->pwrcon);
|
2013-02-26 19:31:26 +00:00
|
|
|
}
|
|
|
|
|
2016-09-13 16:45:46 +00:00
|
|
|
static void tegra_mmc_prepare_data(struct tegra_mmc_priv *priv,
|
|
|
|
struct mmc_data *data,
|
|
|
|
struct bounce_buffer *bbstate)
|
2011-05-31 10:30:37 +00:00
|
|
|
{
|
|
|
|
unsigned char ctrl;
|
|
|
|
|
|
|
|
|
2012-11-06 11:27:30 +00:00
|
|
|
debug("buf: %p (%p), data->blocks: %u, data->blocksize: %u\n",
|
|
|
|
bbstate->bounce_buffer, bbstate->user_buffer, data->blocks,
|
|
|
|
data->blocksize);
|
|
|
|
|
2016-09-13 16:45:46 +00:00
|
|
|
writel((u32)(unsigned long)bbstate->bounce_buffer, &priv->reg->sysad);
|
2011-05-31 10:30:37 +00:00
|
|
|
/*
|
|
|
|
* DMASEL[4:3]
|
|
|
|
* 00 = Selects SDMA
|
|
|
|
* 01 = Reserved
|
|
|
|
* 10 = Selects 32-bit Address ADMA2
|
|
|
|
* 11 = Selects 64-bit Address ADMA2
|
|
|
|
*/
|
2016-09-13 16:45:46 +00:00
|
|
|
ctrl = readb(&priv->reg->hostctl);
|
2011-11-10 11:56:49 +00:00
|
|
|
ctrl &= ~TEGRA_MMC_HOSTCTL_DMASEL_MASK;
|
|
|
|
ctrl |= TEGRA_MMC_HOSTCTL_DMASEL_SDMA;
|
2016-09-13 16:45:46 +00:00
|
|
|
writeb(ctrl, &priv->reg->hostctl);
|
2011-05-31 10:30:37 +00:00
|
|
|
|
|
|
|
/* We do not handle DMA boundaries, so set it to max (512 KiB) */
|
2016-09-13 16:45:46 +00:00
|
|
|
writew((7 << 12) | (data->blocksize & 0xFFF), &priv->reg->blksize);
|
|
|
|
writew(data->blocks, &priv->reg->blkcnt);
|
2011-05-31 10:30:37 +00:00
|
|
|
}
|
|
|
|
|
2016-09-13 16:45:46 +00:00
|
|
|
static void tegra_mmc_set_transfer_mode(struct tegra_mmc_priv *priv,
|
|
|
|
struct mmc_data *data)
|
2011-05-31 10:30:37 +00:00
|
|
|
{
|
|
|
|
unsigned short mode;
|
|
|
|
debug(" mmc_set_transfer_mode called\n");
|
|
|
|
/*
|
|
|
|
* TRNMOD
|
|
|
|
* MUL1SIN0[5] : Multi/Single Block Select
|
|
|
|
* RD1WT0[4] : Data Transfer Direction Select
|
|
|
|
* 1 = read
|
|
|
|
* 0 = write
|
|
|
|
* ENACMD12[2] : Auto CMD12 Enable
|
|
|
|
* ENBLKCNT[1] : Block Count Enable
|
|
|
|
* ENDMA[0] : DMA Enable
|
|
|
|
*/
|
2011-11-10 11:56:49 +00:00
|
|
|
mode = (TEGRA_MMC_TRNMOD_DMA_ENABLE |
|
|
|
|
TEGRA_MMC_TRNMOD_BLOCK_COUNT_ENABLE);
|
|
|
|
|
2011-05-31 10:30:37 +00:00
|
|
|
if (data->blocks > 1)
|
2011-11-10 11:56:49 +00:00
|
|
|
mode |= TEGRA_MMC_TRNMOD_MULTI_BLOCK_SELECT;
|
|
|
|
|
2011-05-31 10:30:37 +00:00
|
|
|
if (data->flags & MMC_DATA_READ)
|
2011-11-10 11:56:49 +00:00
|
|
|
mode |= TEGRA_MMC_TRNMOD_DATA_XFER_DIR_SEL_READ;
|
2011-05-31 10:30:37 +00:00
|
|
|
|
2016-09-13 16:45:46 +00:00
|
|
|
writew(mode, &priv->reg->trnmod);
|
2011-05-31 10:30:37 +00:00
|
|
|
}
|
|
|
|
|
2016-09-13 16:45:46 +00:00
|
|
|
static int tegra_mmc_wait_inhibit(struct tegra_mmc_priv *priv,
|
|
|
|
struct mmc_cmd *cmd,
|
|
|
|
struct mmc_data *data,
|
|
|
|
unsigned int timeout)
|
2011-05-31 10:30:37 +00:00
|
|
|
{
|
|
|
|
/*
|
|
|
|
* PRNSTS
|
2011-11-10 11:56:52 +00:00
|
|
|
* CMDINHDAT[1] : Command Inhibit (DAT)
|
|
|
|
* CMDINHCMD[0] : Command Inhibit (CMD)
|
2011-05-31 10:30:37 +00:00
|
|
|
*/
|
2011-11-10 11:56:52 +00:00
|
|
|
unsigned int mask = TEGRA_MMC_PRNSTS_CMD_INHIBIT_CMD;
|
2011-05-31 10:30:37 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* We shouldn't wait for data inhibit for stop commands, even
|
|
|
|
* though they might use busy signaling
|
|
|
|
*/
|
2011-11-10 11:56:52 +00:00
|
|
|
if ((data == NULL) && (cmd->resp_type & MMC_RSP_BUSY))
|
|
|
|
mask |= TEGRA_MMC_PRNSTS_CMD_INHIBIT_DAT;
|
2011-05-31 10:30:37 +00:00
|
|
|
|
2016-09-13 16:45:46 +00:00
|
|
|
while (readl(&priv->reg->prnsts) & mask) {
|
2011-05-31 10:30:37 +00:00
|
|
|
if (timeout == 0) {
|
|
|
|
printf("%s: timeout error\n", __func__);
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
timeout--;
|
|
|
|
udelay(1000);
|
|
|
|
}
|
|
|
|
|
2011-11-10 11:56:52 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2017-04-24 02:02:11 +00:00
|
|
|
static int tegra_mmc_send_cmd_bounced(struct udevice *dev, struct mmc_cmd *cmd,
|
2016-09-13 16:45:46 +00:00
|
|
|
struct mmc_data *data,
|
|
|
|
struct bounce_buffer *bbstate)
|
2011-11-10 11:56:52 +00:00
|
|
|
{
|
2017-04-24 02:02:11 +00:00
|
|
|
struct tegra_mmc_priv *priv = dev_get_priv(dev);
|
2011-11-10 11:56:52 +00:00
|
|
|
int flags, i;
|
|
|
|
int result;
|
2012-03-28 03:40:00 +00:00
|
|
|
unsigned int mask = 0;
|
2011-11-10 11:56:52 +00:00
|
|
|
unsigned int retry = 0x100000;
|
|
|
|
debug(" mmc_send_cmd called\n");
|
|
|
|
|
2016-09-13 16:45:46 +00:00
|
|
|
result = tegra_mmc_wait_inhibit(priv, cmd, data, 10 /* ms */);
|
2011-11-10 11:56:52 +00:00
|
|
|
|
|
|
|
if (result < 0)
|
|
|
|
return result;
|
|
|
|
|
2011-05-31 10:30:37 +00:00
|
|
|
if (data)
|
2016-09-13 16:45:46 +00:00
|
|
|
tegra_mmc_prepare_data(priv, data, bbstate);
|
2011-05-31 10:30:37 +00:00
|
|
|
|
|
|
|
debug("cmd->arg: %08x\n", cmd->cmdarg);
|
2016-09-13 16:45:46 +00:00
|
|
|
writel(cmd->cmdarg, &priv->reg->argument);
|
2011-05-31 10:30:37 +00:00
|
|
|
|
|
|
|
if (data)
|
2016-09-13 16:45:46 +00:00
|
|
|
tegra_mmc_set_transfer_mode(priv, data);
|
2011-05-31 10:30:37 +00:00
|
|
|
|
|
|
|
if ((cmd->resp_type & MMC_RSP_136) && (cmd->resp_type & MMC_RSP_BUSY))
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* CMDREG
|
|
|
|
* CMDIDX[13:8] : Command index
|
|
|
|
* DATAPRNT[5] : Data Present Select
|
|
|
|
* ENCMDIDX[4] : Command Index Check Enable
|
|
|
|
* ENCMDCRC[3] : Command CRC Check Enable
|
|
|
|
* RSPTYP[1:0]
|
|
|
|
* 00 = No Response
|
|
|
|
* 01 = Length 136
|
|
|
|
* 10 = Length 48
|
|
|
|
* 11 = Length 48 Check busy after response
|
|
|
|
*/
|
|
|
|
if (!(cmd->resp_type & MMC_RSP_PRESENT))
|
2011-11-10 11:56:49 +00:00
|
|
|
flags = TEGRA_MMC_CMDREG_RESP_TYPE_SELECT_NO_RESPONSE;
|
2011-05-31 10:30:37 +00:00
|
|
|
else if (cmd->resp_type & MMC_RSP_136)
|
2011-11-10 11:56:49 +00:00
|
|
|
flags = TEGRA_MMC_CMDREG_RESP_TYPE_SELECT_LENGTH_136;
|
2011-05-31 10:30:37 +00:00
|
|
|
else if (cmd->resp_type & MMC_RSP_BUSY)
|
2011-11-10 11:56:49 +00:00
|
|
|
flags = TEGRA_MMC_CMDREG_RESP_TYPE_SELECT_LENGTH_48_BUSY;
|
2011-05-31 10:30:37 +00:00
|
|
|
else
|
2011-11-10 11:56:49 +00:00
|
|
|
flags = TEGRA_MMC_CMDREG_RESP_TYPE_SELECT_LENGTH_48;
|
2011-05-31 10:30:37 +00:00
|
|
|
|
|
|
|
if (cmd->resp_type & MMC_RSP_CRC)
|
2011-11-10 11:56:49 +00:00
|
|
|
flags |= TEGRA_MMC_TRNMOD_CMD_CRC_CHECK;
|
2011-05-31 10:30:37 +00:00
|
|
|
if (cmd->resp_type & MMC_RSP_OPCODE)
|
2011-11-10 11:56:49 +00:00
|
|
|
flags |= TEGRA_MMC_TRNMOD_CMD_INDEX_CHECK;
|
2011-05-31 10:30:37 +00:00
|
|
|
if (data)
|
2011-11-10 11:56:49 +00:00
|
|
|
flags |= TEGRA_MMC_TRNMOD_DATA_PRESENT_SELECT_DATA_TRANSFER;
|
2011-05-31 10:30:37 +00:00
|
|
|
|
|
|
|
debug("cmd: %d\n", cmd->cmdidx);
|
|
|
|
|
2016-09-13 16:45:46 +00:00
|
|
|
writew((cmd->cmdidx << 8) | flags, &priv->reg->cmdreg);
|
2011-05-31 10:30:37 +00:00
|
|
|
|
|
|
|
for (i = 0; i < retry; i++) {
|
2016-09-13 16:45:46 +00:00
|
|
|
mask = readl(&priv->reg->norintsts);
|
2011-05-31 10:30:37 +00:00
|
|
|
/* Command Complete */
|
2011-11-10 11:56:49 +00:00
|
|
|
if (mask & TEGRA_MMC_NORINTSTS_CMD_COMPLETE) {
|
2011-05-31 10:30:37 +00:00
|
|
|
if (!data)
|
2016-09-13 16:45:46 +00:00
|
|
|
writel(mask, &priv->reg->norintsts);
|
2011-05-31 10:30:37 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (i == retry) {
|
|
|
|
printf("%s: waiting for status update\n", __func__);
|
2016-09-13 16:45:46 +00:00
|
|
|
writel(mask, &priv->reg->norintsts);
|
2016-07-19 07:33:36 +00:00
|
|
|
return -ETIMEDOUT;
|
2011-05-31 10:30:37 +00:00
|
|
|
}
|
|
|
|
|
2011-11-10 11:56:49 +00:00
|
|
|
if (mask & TEGRA_MMC_NORINTSTS_CMD_TIMEOUT) {
|
2011-05-31 10:30:37 +00:00
|
|
|
/* Timeout Error */
|
|
|
|
debug("timeout: %08x cmd %d\n", mask, cmd->cmdidx);
|
2016-09-13 16:45:46 +00:00
|
|
|
writel(mask, &priv->reg->norintsts);
|
2016-07-19 07:33:36 +00:00
|
|
|
return -ETIMEDOUT;
|
2011-11-10 11:56:49 +00:00
|
|
|
} else if (mask & TEGRA_MMC_NORINTSTS_ERR_INTERRUPT) {
|
2011-05-31 10:30:37 +00:00
|
|
|
/* Error Interrupt */
|
|
|
|
debug("error: %08x cmd %d\n", mask, cmd->cmdidx);
|
2016-09-13 16:45:46 +00:00
|
|
|
writel(mask, &priv->reg->norintsts);
|
2011-05-31 10:30:37 +00:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (cmd->resp_type & MMC_RSP_PRESENT) {
|
|
|
|
if (cmd->resp_type & MMC_RSP_136) {
|
|
|
|
/* CRC is stripped so we need to do some shifting. */
|
|
|
|
for (i = 0; i < 4; i++) {
|
2016-09-13 16:45:46 +00:00
|
|
|
unsigned long offset = (unsigned long)
|
|
|
|
(&priv->reg->rspreg3 - i);
|
2011-05-31 10:30:37 +00:00
|
|
|
cmd->response[i] = readl(offset) << 8;
|
|
|
|
|
|
|
|
if (i != 3) {
|
|
|
|
cmd->response[i] |=
|
|
|
|
readb(offset - 1);
|
|
|
|
}
|
|
|
|
debug("cmd->resp[%d]: %08x\n",
|
|
|
|
i, cmd->response[i]);
|
|
|
|
}
|
|
|
|
} else if (cmd->resp_type & MMC_RSP_BUSY) {
|
|
|
|
for (i = 0; i < retry; i++) {
|
|
|
|
/* PRNTDATA[23:20] : DAT[3:0] Line Signal */
|
2016-09-13 16:45:46 +00:00
|
|
|
if (readl(&priv->reg->prnsts)
|
2011-05-31 10:30:37 +00:00
|
|
|
& (1 << 20)) /* DAT[0] */
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (i == retry) {
|
|
|
|
printf("%s: card is still busy\n", __func__);
|
2016-09-13 16:45:46 +00:00
|
|
|
writel(mask, &priv->reg->norintsts);
|
2016-07-19 07:33:36 +00:00
|
|
|
return -ETIMEDOUT;
|
2011-05-31 10:30:37 +00:00
|
|
|
}
|
|
|
|
|
2016-09-13 16:45:46 +00:00
|
|
|
cmd->response[0] = readl(&priv->reg->rspreg0);
|
2011-05-31 10:30:37 +00:00
|
|
|
debug("cmd->resp[0]: %08x\n", cmd->response[0]);
|
|
|
|
} else {
|
2016-09-13 16:45:46 +00:00
|
|
|
cmd->response[0] = readl(&priv->reg->rspreg0);
|
2011-05-31 10:30:37 +00:00
|
|
|
debug("cmd->resp[0]: %08x\n", cmd->response[0]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (data) {
|
2011-11-10 11:56:51 +00:00
|
|
|
unsigned long start = get_timer(0);
|
|
|
|
|
2011-05-31 10:30:37 +00:00
|
|
|
while (1) {
|
2016-09-13 16:45:46 +00:00
|
|
|
mask = readl(&priv->reg->norintsts);
|
2011-05-31 10:30:37 +00:00
|
|
|
|
2011-11-10 11:56:49 +00:00
|
|
|
if (mask & TEGRA_MMC_NORINTSTS_ERR_INTERRUPT) {
|
2011-05-31 10:30:37 +00:00
|
|
|
/* Error Interrupt */
|
2016-09-13 16:45:46 +00:00
|
|
|
writel(mask, &priv->reg->norintsts);
|
2011-05-31 10:30:37 +00:00
|
|
|
printf("%s: error during transfer: 0x%08x\n",
|
|
|
|
__func__, mask);
|
|
|
|
return -1;
|
2011-11-10 11:56:49 +00:00
|
|
|
} else if (mask & TEGRA_MMC_NORINTSTS_DMA_INTERRUPT) {
|
2011-11-10 11:56:50 +00:00
|
|
|
/*
|
|
|
|
* DMA Interrupt, restart the transfer where
|
|
|
|
* it was interrupted.
|
|
|
|
*/
|
2016-09-13 16:45:46 +00:00
|
|
|
unsigned int address = readl(&priv->reg->sysad);
|
2011-11-10 11:56:50 +00:00
|
|
|
|
2011-05-31 10:30:37 +00:00
|
|
|
debug("DMA end\n");
|
2011-11-10 11:56:50 +00:00
|
|
|
writel(TEGRA_MMC_NORINTSTS_DMA_INTERRUPT,
|
2016-09-13 16:45:46 +00:00
|
|
|
&priv->reg->norintsts);
|
|
|
|
writel(address, &priv->reg->sysad);
|
2011-11-10 11:56:49 +00:00
|
|
|
} else if (mask & TEGRA_MMC_NORINTSTS_XFER_COMPLETE) {
|
2011-05-31 10:30:37 +00:00
|
|
|
/* Transfer Complete */
|
|
|
|
debug("r/w is done\n");
|
|
|
|
break;
|
2014-10-03 23:48:53 +00:00
|
|
|
} else if (get_timer(start) > 8000UL) {
|
2016-09-13 16:45:46 +00:00
|
|
|
writel(mask, &priv->reg->norintsts);
|
2011-11-10 11:56:51 +00:00
|
|
|
printf("%s: MMC Timeout\n"
|
|
|
|
" Interrupt status 0x%08x\n"
|
|
|
|
" Interrupt status enable 0x%08x\n"
|
|
|
|
" Interrupt signal enable 0x%08x\n"
|
|
|
|
" Present status 0x%08x\n",
|
|
|
|
__func__, mask,
|
2016-09-13 16:45:46 +00:00
|
|
|
readl(&priv->reg->norintstsen),
|
|
|
|
readl(&priv->reg->norintsigen),
|
|
|
|
readl(&priv->reg->prnsts));
|
2011-11-10 11:56:51 +00:00
|
|
|
return -1;
|
2011-05-31 10:30:37 +00:00
|
|
|
}
|
|
|
|
}
|
2016-09-13 16:45:46 +00:00
|
|
|
writel(mask, &priv->reg->norintsts);
|
2011-05-31 10:30:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
udelay(1000);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2017-04-24 02:02:11 +00:00
|
|
|
static int tegra_mmc_send_cmd(struct udevice *dev, struct mmc_cmd *cmd,
|
2016-09-13 16:45:46 +00:00
|
|
|
struct mmc_data *data)
|
2012-11-06 11:27:30 +00:00
|
|
|
{
|
|
|
|
void *buf;
|
|
|
|
unsigned int bbflags;
|
|
|
|
size_t len;
|
|
|
|
struct bounce_buffer bbstate;
|
|
|
|
int ret;
|
|
|
|
|
|
|
|
if (data) {
|
|
|
|
if (data->flags & MMC_DATA_READ) {
|
|
|
|
buf = data->dest;
|
|
|
|
bbflags = GEN_BB_WRITE;
|
|
|
|
} else {
|
|
|
|
buf = (void *)data->src;
|
|
|
|
bbflags = GEN_BB_READ;
|
|
|
|
}
|
|
|
|
len = data->blocks * data->blocksize;
|
|
|
|
|
|
|
|
bounce_buffer_start(&bbstate, buf, len, bbflags);
|
|
|
|
}
|
|
|
|
|
2017-04-24 02:02:11 +00:00
|
|
|
ret = tegra_mmc_send_cmd_bounced(dev, cmd, data, &bbstate);
|
2012-11-06 11:27:30 +00:00
|
|
|
|
|
|
|
if (data)
|
|
|
|
bounce_buffer_stop(&bbstate);
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2016-09-13 16:45:46 +00:00
|
|
|
static void tegra_mmc_change_clock(struct tegra_mmc_priv *priv, uint clock)
|
2011-05-31 10:30:37 +00:00
|
|
|
{
|
2016-09-13 16:46:01 +00:00
|
|
|
ulong rate;
|
2011-09-21 12:40:04 +00:00
|
|
|
int div;
|
2011-05-31 10:30:37 +00:00
|
|
|
unsigned short clk;
|
|
|
|
unsigned long timeout;
|
2011-09-21 12:40:04 +00:00
|
|
|
|
2011-05-31 10:30:37 +00:00
|
|
|
debug(" mmc_change_clock called\n");
|
|
|
|
|
2011-09-21 12:40:04 +00:00
|
|
|
/*
|
2013-02-26 19:31:26 +00:00
|
|
|
* Change Tegra SDMMCx clock divisor here. Source is PLLP_OUT0
|
2011-09-21 12:40:04 +00:00
|
|
|
*/
|
2011-05-31 10:30:37 +00:00
|
|
|
if (clock == 0)
|
|
|
|
goto out;
|
2016-09-13 16:46:01 +00:00
|
|
|
|
|
|
|
rate = clk_set_rate(&priv->clk, clock);
|
|
|
|
div = (rate + clock - 1) / clock;
|
2011-09-21 12:40:04 +00:00
|
|
|
debug("div = %d\n", div);
|
2011-05-31 10:30:37 +00:00
|
|
|
|
2016-09-13 16:45:46 +00:00
|
|
|
writew(0, &priv->reg->clkcon);
|
2011-05-31 10:30:37 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* CLKCON
|
|
|
|
* SELFREQ[15:8] : base clock divided by value
|
|
|
|
* ENSDCLK[2] : SD Clock Enable
|
|
|
|
* STBLINTCLK[1] : Internal Clock Stable
|
|
|
|
* ENINTCLK[0] : Internal Clock Enable
|
|
|
|
*/
|
2011-09-21 12:40:04 +00:00
|
|
|
div >>= 1;
|
2011-11-10 11:56:49 +00:00
|
|
|
clk = ((div << TEGRA_MMC_CLKCON_SDCLK_FREQ_SEL_SHIFT) |
|
|
|
|
TEGRA_MMC_CLKCON_INTERNAL_CLOCK_ENABLE);
|
2016-09-13 16:45:46 +00:00
|
|
|
writew(clk, &priv->reg->clkcon);
|
2011-05-31 10:30:37 +00:00
|
|
|
|
|
|
|
/* Wait max 10 ms */
|
|
|
|
timeout = 10;
|
2016-09-13 16:45:46 +00:00
|
|
|
while (!(readw(&priv->reg->clkcon) &
|
2011-11-10 11:56:49 +00:00
|
|
|
TEGRA_MMC_CLKCON_INTERNAL_CLOCK_STABLE)) {
|
2011-05-31 10:30:37 +00:00
|
|
|
if (timeout == 0) {
|
|
|
|
printf("%s: timeout error\n", __func__);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
timeout--;
|
|
|
|
udelay(1000);
|
|
|
|
}
|
|
|
|
|
2011-11-10 11:56:49 +00:00
|
|
|
clk |= TEGRA_MMC_CLKCON_SD_CLOCK_ENABLE;
|
2016-09-13 16:45:46 +00:00
|
|
|
writew(clk, &priv->reg->clkcon);
|
2011-05-31 10:30:37 +00:00
|
|
|
|
|
|
|
debug("mmc_change_clock: clkcon = %08X\n", clk);
|
|
|
|
|
|
|
|
out:
|
2016-09-13 16:45:46 +00:00
|
|
|
priv->clock = clock;
|
2011-05-31 10:30:37 +00:00
|
|
|
}
|
|
|
|
|
2017-04-24 02:02:11 +00:00
|
|
|
static int tegra_mmc_set_ios(struct udevice *dev)
|
2011-05-31 10:30:37 +00:00
|
|
|
{
|
2017-04-24 02:02:11 +00:00
|
|
|
struct tegra_mmc_priv *priv = dev_get_priv(dev);
|
|
|
|
struct mmc *mmc = mmc_get_mmc_dev(dev);
|
2011-05-31 10:30:37 +00:00
|
|
|
unsigned char ctrl;
|
|
|
|
debug(" mmc_set_ios called\n");
|
|
|
|
|
|
|
|
debug("bus_width: %x, clock: %d\n", mmc->bus_width, mmc->clock);
|
|
|
|
|
|
|
|
/* Change clock first */
|
2016-09-13 16:45:46 +00:00
|
|
|
tegra_mmc_change_clock(priv, mmc->clock);
|
2011-05-31 10:30:37 +00:00
|
|
|
|
2016-09-13 16:45:46 +00:00
|
|
|
ctrl = readb(&priv->reg->hostctl);
|
2011-05-31 10:30:37 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* WIDE8[5]
|
|
|
|
* 0 = Depend on WIDE4
|
|
|
|
* 1 = 8-bit mode
|
|
|
|
* WIDE4[1]
|
|
|
|
* 1 = 4-bit mode
|
|
|
|
* 0 = 1-bit mode
|
|
|
|
*/
|
|
|
|
if (mmc->bus_width == 8)
|
|
|
|
ctrl |= (1 << 5);
|
|
|
|
else if (mmc->bus_width == 4)
|
|
|
|
ctrl |= (1 << 1);
|
|
|
|
else
|
2017-06-08 03:11:48 +00:00
|
|
|
ctrl &= ~(1 << 1 | 1 << 5);
|
2011-05-31 10:30:37 +00:00
|
|
|
|
2016-09-13 16:45:46 +00:00
|
|
|
writeb(ctrl, &priv->reg->hostctl);
|
2011-05-31 10:30:37 +00:00
|
|
|
debug("mmc_set_ios: hostctl = %08X\n", ctrl);
|
2016-12-30 06:30:16 +00:00
|
|
|
|
|
|
|
return 0;
|
2011-05-31 10:30:37 +00:00
|
|
|
}
|
|
|
|
|
2016-09-13 16:45:46 +00:00
|
|
|
static void tegra_mmc_pad_init(struct tegra_mmc_priv *priv)
|
2016-09-13 16:45:44 +00:00
|
|
|
{
|
|
|
|
#if defined(CONFIG_TEGRA30)
|
|
|
|
u32 val;
|
|
|
|
|
2016-09-13 16:45:46 +00:00
|
|
|
debug("%s: sdmmc address = %08x\n", __func__, (unsigned int)priv->reg);
|
2016-09-13 16:45:44 +00:00
|
|
|
|
|
|
|
/* Set the pad drive strength for SDMMC1 or 3 only */
|
2016-09-13 16:45:46 +00:00
|
|
|
if (priv->reg != (void *)0x78000000 &&
|
|
|
|
priv->reg != (void *)0x78000400) {
|
2016-09-13 16:45:44 +00:00
|
|
|
debug("%s: settings are only valid for SDMMC1/SDMMC3!\n",
|
|
|
|
__func__);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2016-09-13 16:45:46 +00:00
|
|
|
val = readl(&priv->reg->sdmemcmppadctl);
|
2016-09-13 16:45:44 +00:00
|
|
|
val &= 0xFFFFFFF0;
|
|
|
|
val |= MEMCOMP_PADCTRL_VREF;
|
2016-09-13 16:45:46 +00:00
|
|
|
writel(val, &priv->reg->sdmemcmppadctl);
|
2016-09-13 16:45:44 +00:00
|
|
|
|
2016-09-13 16:45:46 +00:00
|
|
|
val = readl(&priv->reg->autocalcfg);
|
2016-09-13 16:45:44 +00:00
|
|
|
val &= 0xFFFF0000;
|
|
|
|
val |= AUTO_CAL_PU_OFFSET | AUTO_CAL_PD_OFFSET | AUTO_CAL_ENABLED;
|
2016-09-13 16:45:46 +00:00
|
|
|
writel(val, &priv->reg->autocalcfg);
|
2016-09-13 16:45:44 +00:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2016-09-13 16:45:46 +00:00
|
|
|
static void tegra_mmc_reset(struct tegra_mmc_priv *priv, struct mmc *mmc)
|
2011-05-31 10:30:37 +00:00
|
|
|
{
|
|
|
|
unsigned int timeout;
|
|
|
|
debug(" mmc_reset called\n");
|
|
|
|
|
|
|
|
/*
|
|
|
|
* RSTALL[0] : Software reset for all
|
|
|
|
* 1 = reset
|
|
|
|
* 0 = work
|
|
|
|
*/
|
2016-09-13 16:45:46 +00:00
|
|
|
writeb(TEGRA_MMC_SWRST_SW_RESET_FOR_ALL, &priv->reg->swrst);
|
2011-05-31 10:30:37 +00:00
|
|
|
|
2016-09-13 16:45:46 +00:00
|
|
|
priv->clock = 0;
|
2011-05-31 10:30:37 +00:00
|
|
|
|
|
|
|
/* Wait max 100 ms */
|
|
|
|
timeout = 100;
|
|
|
|
|
|
|
|
/* hw clears the bit when it's done */
|
2016-09-13 16:45:46 +00:00
|
|
|
while (readb(&priv->reg->swrst) & TEGRA_MMC_SWRST_SW_RESET_FOR_ALL) {
|
2011-05-31 10:30:37 +00:00
|
|
|
if (timeout == 0) {
|
|
|
|
printf("%s: timeout error\n", __func__);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
timeout--;
|
|
|
|
udelay(1000);
|
|
|
|
}
|
2013-02-26 19:31:26 +00:00
|
|
|
|
|
|
|
/* Set SD bus voltage & enable bus power */
|
2016-09-13 16:45:46 +00:00
|
|
|
tegra_mmc_set_power(priv, fls(mmc->cfg->voltages) - 1);
|
2013-02-26 19:31:26 +00:00
|
|
|
debug("%s: power control = %02X, host control = %02X\n", __func__,
|
2016-09-13 16:45:46 +00:00
|
|
|
readb(&priv->reg->pwrcon), readb(&priv->reg->hostctl));
|
2013-02-26 19:31:26 +00:00
|
|
|
|
|
|
|
/* Make sure SDIO pads are set up */
|
2016-09-13 16:45:46 +00:00
|
|
|
tegra_mmc_pad_init(priv);
|
2011-05-31 10:30:37 +00:00
|
|
|
}
|
|
|
|
|
2017-04-24 02:02:11 +00:00
|
|
|
static int tegra_mmc_init(struct udevice *dev)
|
2011-05-31 10:30:37 +00:00
|
|
|
{
|
2017-04-24 02:02:11 +00:00
|
|
|
struct tegra_mmc_priv *priv = dev_get_priv(dev);
|
|
|
|
struct mmc *mmc = mmc_get_mmc_dev(dev);
|
2011-05-31 10:30:37 +00:00
|
|
|
unsigned int mask;
|
2016-09-13 16:45:48 +00:00
|
|
|
debug(" tegra_mmc_init called\n");
|
2011-05-31 10:30:37 +00:00
|
|
|
|
2016-09-13 16:45:46 +00:00
|
|
|
tegra_mmc_reset(priv, mmc);
|
2011-05-31 10:30:37 +00:00
|
|
|
|
2017-03-25 00:18:22 +00:00
|
|
|
#if defined(CONFIG_TEGRA124_MMC_DISABLE_EXT_LOOPBACK)
|
|
|
|
/*
|
|
|
|
* Disable the external clock loopback and use the internal one on
|
|
|
|
* SDMMC3 as per the SDMMC_VENDOR_MISC_CNTRL_0 register's SDMMC_SPARE1
|
|
|
|
* bits being set to 0xfffd according to the TRM.
|
|
|
|
*
|
|
|
|
* TODO(marcel.ziswiler@toradex.com): Move to device tree controlled
|
|
|
|
* approach once proper kernel integration made it mainline.
|
|
|
|
*/
|
|
|
|
if (priv->reg == (void *)0x700b0400) {
|
|
|
|
mask = readl(&priv->reg->venmiscctl);
|
|
|
|
mask &= ~TEGRA_MMC_MISCON_ENABLE_EXT_LOOPBACK;
|
|
|
|
writel(mask, &priv->reg->venmiscctl);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2016-09-13 16:45:46 +00:00
|
|
|
priv->version = readw(&priv->reg->hcver);
|
|
|
|
debug("host version = %x\n", priv->version);
|
2011-05-31 10:30:37 +00:00
|
|
|
|
|
|
|
/* mask all */
|
2016-09-13 16:45:46 +00:00
|
|
|
writel(0xffffffff, &priv->reg->norintstsen);
|
|
|
|
writel(0xffffffff, &priv->reg->norintsigen);
|
2011-05-31 10:30:37 +00:00
|
|
|
|
2016-09-13 16:45:46 +00:00
|
|
|
writeb(0xe, &priv->reg->timeoutcon); /* TMCLK * 2^27 */
|
2011-05-31 10:30:37 +00:00
|
|
|
/*
|
|
|
|
* NORMAL Interrupt Status Enable Register init
|
|
|
|
* [5] ENSTABUFRDRDY : Buffer Read Ready Status Enable
|
|
|
|
* [4] ENSTABUFWTRDY : Buffer write Ready Status Enable
|
2011-11-10 11:56:50 +00:00
|
|
|
* [3] ENSTADMAINT : DMA boundary interrupt
|
2011-05-31 10:30:37 +00:00
|
|
|
* [1] ENSTASTANSCMPLT : Transfre Complete Status Enable
|
|
|
|
* [0] ENSTACMDCMPLT : Command Complete Status Enable
|
|
|
|
*/
|
2016-09-13 16:45:46 +00:00
|
|
|
mask = readl(&priv->reg->norintstsen);
|
2011-05-31 10:30:37 +00:00
|
|
|
mask &= ~(0xffff);
|
2011-11-10 11:56:49 +00:00
|
|
|
mask |= (TEGRA_MMC_NORINTSTSEN_CMD_COMPLETE |
|
|
|
|
TEGRA_MMC_NORINTSTSEN_XFER_COMPLETE |
|
2011-11-10 11:56:50 +00:00
|
|
|
TEGRA_MMC_NORINTSTSEN_DMA_INTERRUPT |
|
2011-11-10 11:56:49 +00:00
|
|
|
TEGRA_MMC_NORINTSTSEN_BUFFER_WRITE_READY |
|
|
|
|
TEGRA_MMC_NORINTSTSEN_BUFFER_READ_READY);
|
2016-09-13 16:45:46 +00:00
|
|
|
writel(mask, &priv->reg->norintstsen);
|
2011-05-31 10:30:37 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* NORMAL Interrupt Signal Enable Register init
|
|
|
|
* [1] ENSTACMDCMPLT : Transfer Complete Signal Enable
|
|
|
|
*/
|
2016-09-13 16:45:46 +00:00
|
|
|
mask = readl(&priv->reg->norintsigen);
|
2011-05-31 10:30:37 +00:00
|
|
|
mask &= ~(0xffff);
|
2011-11-10 11:56:49 +00:00
|
|
|
mask |= TEGRA_MMC_NORINTSIGEN_XFER_COMPLETE;
|
2016-09-13 16:45:46 +00:00
|
|
|
writel(mask, &priv->reg->norintsigen);
|
2011-05-31 10:30:37 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2017-04-24 02:02:11 +00:00
|
|
|
static int tegra_mmc_getcd(struct udevice *dev)
|
2012-01-02 01:15:39 +00:00
|
|
|
{
|
2017-04-24 02:02:11 +00:00
|
|
|
struct tegra_mmc_priv *priv = dev_get_priv(dev);
|
2012-01-02 01:15:39 +00:00
|
|
|
|
2012-09-05 00:00:24 +00:00
|
|
|
debug("tegra_mmc_getcd called\n");
|
2012-01-02 01:15:39 +00:00
|
|
|
|
2016-09-13 16:45:46 +00:00
|
|
|
if (dm_gpio_is_valid(&priv->cd_gpio))
|
|
|
|
return dm_gpio_get_value(&priv->cd_gpio);
|
2012-01-02 01:15:39 +00:00
|
|
|
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2017-04-24 02:02:11 +00:00
|
|
|
static const struct dm_mmc_ops tegra_mmc_ops = {
|
2014-02-26 17:28:45 +00:00
|
|
|
.send_cmd = tegra_mmc_send_cmd,
|
|
|
|
.set_ios = tegra_mmc_set_ios,
|
2017-04-24 02:02:11 +00:00
|
|
|
.get_cd = tegra_mmc_getcd,
|
2014-02-26 17:28:45 +00:00
|
|
|
};
|
|
|
|
|
2016-09-13 16:45:48 +00:00
|
|
|
static int tegra_mmc_probe(struct udevice *dev)
|
2011-05-31 10:30:37 +00:00
|
|
|
{
|
2016-09-13 16:45:48 +00:00
|
|
|
struct mmc_uclass_priv *upriv = dev_get_uclass_priv(dev);
|
2017-04-24 02:02:11 +00:00
|
|
|
struct tegra_mmc_plat *plat = dev_get_platdata(dev);
|
2016-09-13 16:45:48 +00:00
|
|
|
struct tegra_mmc_priv *priv = dev_get_priv(dev);
|
2017-04-24 02:02:11 +00:00
|
|
|
struct mmc_config *cfg = &plat->cfg;
|
2016-09-13 16:46:01 +00:00
|
|
|
int bus_width, ret;
|
2011-05-31 10:30:37 +00:00
|
|
|
|
2017-04-24 02:02:11 +00:00
|
|
|
cfg->name = dev->name;
|
2011-05-31 10:30:37 +00:00
|
|
|
|
2017-07-25 14:30:08 +00:00
|
|
|
bus_width = dev_read_u32_default(dev, "bus-width", 1);
|
2016-09-13 16:45:48 +00:00
|
|
|
|
2017-04-24 02:02:11 +00:00
|
|
|
cfg->voltages = MMC_VDD_32_33 | MMC_VDD_33_34 | MMC_VDD_165_195;
|
|
|
|
cfg->host_caps = 0;
|
2016-09-13 16:45:48 +00:00
|
|
|
if (bus_width == 8)
|
2017-04-24 02:02:11 +00:00
|
|
|
cfg->host_caps |= MMC_MODE_8BIT;
|
2016-09-13 16:45:48 +00:00
|
|
|
if (bus_width >= 4)
|
2017-04-24 02:02:11 +00:00
|
|
|
cfg->host_caps |= MMC_MODE_4BIT;
|
|
|
|
cfg->host_caps |= MMC_MODE_HS_52MHz | MMC_MODE_HS;
|
2011-05-31 10:30:37 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* min freq is for card identification, and is the highest
|
|
|
|
* low-speed SDIO card frequency (actually 400KHz)
|
|
|
|
* max freq is highest HS eMMC clock as per the SD/MMC spec
|
|
|
|
* (actually 52MHz)
|
|
|
|
*/
|
2017-04-24 02:02:11 +00:00
|
|
|
cfg->f_min = 375000;
|
|
|
|
cfg->f_max = 48000000;
|
2011-05-31 10:30:37 +00:00
|
|
|
|
2017-04-24 02:02:11 +00:00
|
|
|
cfg->b_max = CONFIG_SYS_MMC_MAX_BLK_COUNT;
|
2014-03-11 17:34:20 +00:00
|
|
|
|
2017-07-25 14:30:08 +00:00
|
|
|
priv->reg = (void *)dev_read_addr(dev);
|
2013-02-21 12:31:30 +00:00
|
|
|
|
2016-09-13 16:45:48 +00:00
|
|
|
ret = reset_get_by_name(dev, "sdhci", &priv->reset_ctl);
|
|
|
|
if (ret) {
|
|
|
|
debug("reset_get_by_name() failed: %d\n", ret);
|
|
|
|
return ret;
|
2016-08-05 22:10:33 +00:00
|
|
|
}
|
2016-09-13 16:45:48 +00:00
|
|
|
ret = clk_get_by_index(dev, 0, &priv->clk);
|
|
|
|
if (ret) {
|
|
|
|
debug("clk_get_by_index() failed: %d\n", ret);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
ret = reset_assert(&priv->reset_ctl);
|
|
|
|
if (ret)
|
|
|
|
return ret;
|
|
|
|
ret = clk_enable(&priv->clk);
|
|
|
|
if (ret)
|
|
|
|
return ret;
|
|
|
|
ret = clk_set_rate(&priv->clk, 20000000);
|
|
|
|
if (IS_ERR_VALUE(ret))
|
|
|
|
return ret;
|
|
|
|
ret = reset_deassert(&priv->reset_ctl);
|
|
|
|
if (ret)
|
|
|
|
return ret;
|
2013-02-21 12:31:30 +00:00
|
|
|
|
2016-09-13 16:45:48 +00:00
|
|
|
/* These GPIOs are optional */
|
2017-07-25 14:30:08 +00:00
|
|
|
gpio_request_by_name(dev, "cd-gpios", 0, &priv->cd_gpio, GPIOD_IS_IN);
|
|
|
|
gpio_request_by_name(dev, "wp-gpios", 0, &priv->wp_gpio, GPIOD_IS_IN);
|
|
|
|
gpio_request_by_name(dev, "power-gpios", 0, &priv->pwr_gpio,
|
|
|
|
GPIOD_IS_OUT);
|
2016-09-13 16:45:48 +00:00
|
|
|
if (dm_gpio_is_valid(&priv->pwr_gpio))
|
|
|
|
dm_gpio_set_value(&priv->pwr_gpio, 1);
|
2013-02-21 12:31:30 +00:00
|
|
|
|
2017-04-24 02:02:11 +00:00
|
|
|
upriv->mmc = &plat->mmc;
|
2013-02-21 12:31:30 +00:00
|
|
|
|
2017-04-24 02:02:11 +00:00
|
|
|
return tegra_mmc_init(dev);
|
|
|
|
}
|
2013-02-21 12:31:30 +00:00
|
|
|
|
2017-04-24 02:02:11 +00:00
|
|
|
static int tegra_mmc_bind(struct udevice *dev)
|
|
|
|
{
|
|
|
|
struct tegra_mmc_plat *plat = dev_get_platdata(dev);
|
|
|
|
|
|
|
|
return mmc_bind(dev, &plat->mmc, &plat->cfg);
|
2013-02-21 12:31:30 +00:00
|
|
|
}
|
|
|
|
|
2016-09-13 16:45:48 +00:00
|
|
|
static const struct udevice_id tegra_mmc_ids[] = {
|
|
|
|
{ .compatible = "nvidia,tegra20-sdhci" },
|
|
|
|
{ .compatible = "nvidia,tegra30-sdhci" },
|
|
|
|
{ .compatible = "nvidia,tegra114-sdhci" },
|
|
|
|
{ .compatible = "nvidia,tegra124-sdhci" },
|
|
|
|
{ .compatible = "nvidia,tegra210-sdhci" },
|
|
|
|
{ .compatible = "nvidia,tegra186-sdhci" },
|
|
|
|
{ }
|
|
|
|
};
|
2013-02-21 12:31:30 +00:00
|
|
|
|
2016-09-13 16:45:48 +00:00
|
|
|
U_BOOT_DRIVER(tegra_mmc_drv) = {
|
|
|
|
.name = "tegra_mmc",
|
|
|
|
.id = UCLASS_MMC,
|
|
|
|
.of_match = tegra_mmc_ids,
|
2017-04-24 02:02:11 +00:00
|
|
|
.bind = tegra_mmc_bind,
|
2016-09-13 16:45:48 +00:00
|
|
|
.probe = tegra_mmc_probe,
|
2017-04-24 02:02:11 +00:00
|
|
|
.ops = &tegra_mmc_ops,
|
|
|
|
.platdata_auto_alloc_size = sizeof(struct tegra_mmc_plat),
|
2016-09-13 16:45:48 +00:00
|
|
|
.priv_auto_alloc_size = sizeof(struct tegra_mmc_priv),
|
|
|
|
};
|