mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-06-07 07:11:35 +00:00
ARM: OMAP: Enable 8-bit eMMC access for OMAP4/5/DRA7xx
Enable 8-bit host capability for HSMMC2 and/or HSMMC3. CONFIG_HSMMC2_8BIT (for OMAP4/5/DRA7xx) and/or CONFIG_HSMMC3_8BIT (for DRA7xx only) must be defined in the board header if an 8-bit eMMC device is connected to the corresponding port. Fix the "No status update" error that appeared for eMMC devices by inserting a 20 us delay between writing arguments and command. This solution has been proposed by Michael Cashwell <mboards@prograde.net>. A minor cosmetic fix in a comment as well. Signed-off-by: Lubomir Popov <lpopov@mm-sol.com>
This commit is contained in:
parent
61a6cc27bc
commit
152ba36362
1 changed files with 14 additions and 3 deletions
|
@ -400,6 +400,7 @@ static int mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd,
|
||||||
}
|
}
|
||||||
|
|
||||||
writel(cmd->cmdarg, &mmc_base->arg);
|
writel(cmd->cmdarg, &mmc_base->arg);
|
||||||
|
udelay(20); /* To fix "No status update" error on eMMC */
|
||||||
writel((cmd->cmdidx << 24) | flags, &mmc_base->cmd);
|
writel((cmd->cmdidx << 24) | flags, &mmc_base->cmd);
|
||||||
|
|
||||||
start = get_timer(0);
|
start = get_timer(0);
|
||||||
|
@ -504,7 +505,7 @@ static int mmc_write_data(struct hsmmc *mmc_base, const char *buf,
|
||||||
unsigned int count;
|
unsigned int count;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Start Polled Read
|
* Start Polled Write
|
||||||
*/
|
*/
|
||||||
count = (size > MMCSD_SECTOR_SIZE) ? MMCSD_SECTOR_SIZE : size;
|
count = (size > MMCSD_SECTOR_SIZE) ? MMCSD_SECTOR_SIZE : size;
|
||||||
count /= 4;
|
count /= 4;
|
||||||
|
@ -610,6 +611,8 @@ int omap_mmc_init(int dev_index, uint host_caps_mask, uint f_max, int cd_gpio,
|
||||||
{
|
{
|
||||||
struct mmc *mmc = &hsmmc_dev[dev_index];
|
struct mmc *mmc = &hsmmc_dev[dev_index];
|
||||||
struct omap_hsmmc_data *priv_data = &hsmmc_dev_data[dev_index];
|
struct omap_hsmmc_data *priv_data = &hsmmc_dev_data[dev_index];
|
||||||
|
uint host_caps_val = MMC_MODE_4BIT | MMC_MODE_HS_52MHz | MMC_MODE_HS |
|
||||||
|
MMC_MODE_HC;
|
||||||
|
|
||||||
sprintf(mmc->name, "OMAP SD/MMC");
|
sprintf(mmc->name, "OMAP SD/MMC");
|
||||||
mmc->send_cmd = mmc_send_cmd;
|
mmc->send_cmd = mmc_send_cmd;
|
||||||
|
@ -624,11 +627,20 @@ int omap_mmc_init(int dev_index, uint host_caps_mask, uint f_max, int cd_gpio,
|
||||||
#ifdef OMAP_HSMMC2_BASE
|
#ifdef OMAP_HSMMC2_BASE
|
||||||
case 1:
|
case 1:
|
||||||
priv_data->base_addr = (struct hsmmc *)OMAP_HSMMC2_BASE;
|
priv_data->base_addr = (struct hsmmc *)OMAP_HSMMC2_BASE;
|
||||||
|
#if (defined(CONFIG_OMAP44XX) || defined(CONFIG_OMAP54XX) || \
|
||||||
|
defined(CONFIG_DRA7XX)) && defined(CONFIG_HSMMC2_8BIT)
|
||||||
|
/* Enable 8-bit interface for eMMC on OMAP4/5 or DRA7XX */
|
||||||
|
host_caps_val |= MMC_MODE_8BIT;
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
#ifdef OMAP_HSMMC3_BASE
|
#ifdef OMAP_HSMMC3_BASE
|
||||||
case 2:
|
case 2:
|
||||||
priv_data->base_addr = (struct hsmmc *)OMAP_HSMMC3_BASE;
|
priv_data->base_addr = (struct hsmmc *)OMAP_HSMMC3_BASE;
|
||||||
|
#if defined(CONFIG_DRA7XX) && defined(CONFIG_HSMMC3_8BIT)
|
||||||
|
/* Enable 8-bit interface for eMMC on DRA7XX */
|
||||||
|
host_caps_val |= MMC_MODE_8BIT;
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
default:
|
default:
|
||||||
|
@ -644,8 +656,7 @@ int omap_mmc_init(int dev_index, uint host_caps_mask, uint f_max, int cd_gpio,
|
||||||
mmc->getwp = omap_mmc_getwp;
|
mmc->getwp = omap_mmc_getwp;
|
||||||
|
|
||||||
mmc->voltages = MMC_VDD_32_33 | MMC_VDD_33_34 | MMC_VDD_165_195;
|
mmc->voltages = MMC_VDD_32_33 | MMC_VDD_33_34 | MMC_VDD_165_195;
|
||||||
mmc->host_caps = (MMC_MODE_4BIT | MMC_MODE_HS_52MHz | MMC_MODE_HS |
|
mmc->host_caps = host_caps_val & ~host_caps_mask;
|
||||||
MMC_MODE_HC) & ~host_caps_mask;
|
|
||||||
|
|
||||||
mmc->f_min = 400000;
|
mmc->f_min = 400000;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue