mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2025-11-29 14:41:26 +01:00
mmc: Merge SD_LEGACY and MMC_LEGACY bus modes
MMC_LEGACY & SD_LEGACY are not differentiated timings in the spec and don't have any meaningful differences. Therefore, get rid of all references to SD_LEGACY and use MMC_LEGACY to mean both of them. Signed-off-by: Faiz Abbas <faiz_abbas@ti.com> Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
This commit is contained in:
parent
cb884347f4
commit
e8d5dde447
@ -743,7 +743,6 @@ static int esdhc_set_timing(struct mmc *mmc)
|
|||||||
|
|
||||||
switch (mmc->selected_mode) {
|
switch (mmc->selected_mode) {
|
||||||
case MMC_LEGACY:
|
case MMC_LEGACY:
|
||||||
case SD_LEGACY:
|
|
||||||
esdhc_reset_tuning(mmc);
|
esdhc_reset_tuning(mmc);
|
||||||
writel(mixctrl, ®s->mixctrl);
|
writel(mixctrl, ®s->mixctrl);
|
||||||
break;
|
break;
|
||||||
|
|||||||
@ -132,7 +132,6 @@ const char *mmc_mode_name(enum bus_mode mode)
|
|||||||
{
|
{
|
||||||
static const char *const names[] = {
|
static const char *const names[] = {
|
||||||
[MMC_LEGACY] = "MMC legacy",
|
[MMC_LEGACY] = "MMC legacy",
|
||||||
[SD_LEGACY] = "SD Legacy",
|
|
||||||
[MMC_HS] = "MMC High Speed (26MHz)",
|
[MMC_HS] = "MMC High Speed (26MHz)",
|
||||||
[SD_HS] = "SD High Speed (50MHz)",
|
[SD_HS] = "SD High Speed (50MHz)",
|
||||||
[UHS_SDR12] = "UHS SDR12 (25MHz)",
|
[UHS_SDR12] = "UHS SDR12 (25MHz)",
|
||||||
@ -158,7 +157,6 @@ static uint mmc_mode2freq(struct mmc *mmc, enum bus_mode mode)
|
|||||||
{
|
{
|
||||||
static const int freqs[] = {
|
static const int freqs[] = {
|
||||||
[MMC_LEGACY] = 25000000,
|
[MMC_LEGACY] = 25000000,
|
||||||
[SD_LEGACY] = 25000000,
|
|
||||||
[MMC_HS] = 26000000,
|
[MMC_HS] = 26000000,
|
||||||
[SD_HS] = 50000000,
|
[SD_HS] = 50000000,
|
||||||
[MMC_HS_52] = 52000000,
|
[MMC_HS_52] = 52000000,
|
||||||
@ -1239,7 +1237,7 @@ static int sd_get_capabilities(struct mmc *mmc)
|
|||||||
u32 sd3_bus_mode;
|
u32 sd3_bus_mode;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
mmc->card_caps = MMC_MODE_1BIT | MMC_CAP(SD_LEGACY);
|
mmc->card_caps = MMC_MODE_1BIT | MMC_CAP(MMC_LEGACY);
|
||||||
|
|
||||||
if (mmc_host_is_spi(mmc))
|
if (mmc_host_is_spi(mmc))
|
||||||
return 0;
|
return 0;
|
||||||
@ -1352,7 +1350,7 @@ static int sd_set_card_speed(struct mmc *mmc, enum bus_mode mode)
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
case SD_LEGACY:
|
case MMC_LEGACY:
|
||||||
speed = UHS_SDR12_BUS_SPEED;
|
speed = UHS_SDR12_BUS_SPEED;
|
||||||
break;
|
break;
|
||||||
case SD_HS:
|
case SD_HS:
|
||||||
@ -1695,7 +1693,7 @@ static const struct mode_width_tuning sd_modes_by_pref[] = {
|
|||||||
},
|
},
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
.mode = SD_LEGACY,
|
.mode = MMC_LEGACY,
|
||||||
.widths = MMC_MODE_4BIT | MMC_MODE_1BIT,
|
.widths = MMC_MODE_4BIT | MMC_MODE_1BIT,
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -1725,7 +1723,7 @@ static int sd_select_mode_and_width(struct mmc *mmc, uint card_caps)
|
|||||||
|
|
||||||
if (mmc_host_is_spi(mmc)) {
|
if (mmc_host_is_spi(mmc)) {
|
||||||
mmc_set_bus_width(mmc, 1);
|
mmc_set_bus_width(mmc, 1);
|
||||||
mmc_select_mode(mmc, SD_LEGACY);
|
mmc_select_mode(mmc, MMC_LEGACY);
|
||||||
mmc_set_clock(mmc, mmc->tran_speed, MMC_CLK_ENABLE);
|
mmc_set_clock(mmc, mmc->tran_speed, MMC_CLK_ENABLE);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -1784,7 +1782,7 @@ static int sd_select_mode_and_width(struct mmc *mmc, uint card_caps)
|
|||||||
|
|
||||||
error:
|
error:
|
||||||
/* revert to a safer bus speed */
|
/* revert to a safer bus speed */
|
||||||
mmc_select_mode(mmc, SD_LEGACY);
|
mmc_select_mode(mmc, MMC_LEGACY);
|
||||||
mmc_set_clock(mmc, mmc->tran_speed,
|
mmc_set_clock(mmc, mmc->tran_speed,
|
||||||
MMC_CLK_ENABLE);
|
MMC_CLK_ENABLE);
|
||||||
}
|
}
|
||||||
@ -2561,7 +2559,7 @@ static int mmc_startup(struct mmc *mmc)
|
|||||||
|
|
||||||
#if CONFIG_IS_ENABLED(MMC_TINY)
|
#if CONFIG_IS_ENABLED(MMC_TINY)
|
||||||
mmc_set_clock(mmc, mmc->legacy_speed, false);
|
mmc_set_clock(mmc, mmc->legacy_speed, false);
|
||||||
mmc_select_mode(mmc, IS_SD(mmc) ? SD_LEGACY : MMC_LEGACY);
|
mmc_select_mode(mmc, MMC_LEGACY);
|
||||||
mmc_set_bus_width(mmc, 1);
|
mmc_set_bus_width(mmc, 1);
|
||||||
#else
|
#else
|
||||||
if (IS_SD(mmc)) {
|
if (IS_SD(mmc)) {
|
||||||
@ -2843,7 +2841,7 @@ int mmc_start_init(struct mmc *mmc)
|
|||||||
* all hosts are capable of 1 bit bus-width and able to use the legacy
|
* all hosts are capable of 1 bit bus-width and able to use the legacy
|
||||||
* timings.
|
* timings.
|
||||||
*/
|
*/
|
||||||
mmc->host_caps = mmc->cfg->host_caps | MMC_CAP(SD_LEGACY) |
|
mmc->host_caps = mmc->cfg->host_caps | MMC_CAP(MMC_LEGACY) |
|
||||||
MMC_CAP(MMC_LEGACY) | MMC_MODE_1BIT;
|
MMC_CAP(MMC_LEGACY) | MMC_MODE_1BIT;
|
||||||
#if CONFIG_IS_ENABLED(DM_MMC)
|
#if CONFIG_IS_ENABLED(DM_MMC)
|
||||||
mmc_deferred_probe(mmc);
|
mmc_deferred_probe(mmc);
|
||||||
|
|||||||
@ -392,7 +392,6 @@ static void omap_hsmmc_set_timing(struct mmc *mmc)
|
|||||||
break;
|
break;
|
||||||
case MMC_LEGACY:
|
case MMC_LEGACY:
|
||||||
case MMC_HS:
|
case MMC_HS:
|
||||||
case SD_LEGACY:
|
|
||||||
case UHS_SDR12:
|
case UHS_SDR12:
|
||||||
val |= AC12_UHSMC_SDR12;
|
val |= AC12_UHSMC_SDR12;
|
||||||
break;
|
break;
|
||||||
|
|||||||
@ -37,7 +37,6 @@ struct arasan_sdhci_priv {
|
|||||||
|
|
||||||
static const u8 mode2timing[] = {
|
static const u8 mode2timing[] = {
|
||||||
[MMC_LEGACY] = UHS_SDR12_BUS_SPEED,
|
[MMC_LEGACY] = UHS_SDR12_BUS_SPEED,
|
||||||
[SD_LEGACY] = UHS_SDR12_BUS_SPEED,
|
|
||||||
[MMC_HS] = HIGH_SPEED_BUS_SPEED,
|
[MMC_HS] = HIGH_SPEED_BUS_SPEED,
|
||||||
[SD_HS] = HIGH_SPEED_BUS_SPEED,
|
[SD_HS] = HIGH_SPEED_BUS_SPEED,
|
||||||
[MMC_HS_52] = HIGH_SPEED_BUS_SPEED,
|
[MMC_HS_52] = HIGH_SPEED_BUS_SPEED,
|
||||||
|
|||||||
@ -545,7 +545,6 @@ struct sd_ssr {
|
|||||||
|
|
||||||
enum bus_mode {
|
enum bus_mode {
|
||||||
MMC_LEGACY,
|
MMC_LEGACY,
|
||||||
SD_LEGACY,
|
|
||||||
MMC_HS,
|
MMC_HS,
|
||||||
SD_HS,
|
SD_HS,
|
||||||
MMC_HS_52,
|
MMC_HS_52,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user