summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZiyuan Xu <xzy.xu@rock-chips.com>2017-05-15 09:07:06 +0300
committerKever Yang <kever.yang@rock-chips.com>2017-07-18 17:05:01 +0300
commit119a7134bfe85ef6fdb2e2a1910185545de41c45 (patch)
tree9f1d288684588c454eb38cf55a412cb122ef3588
parentff3e1e006b2f9f688e201e1dfd063a76ccb780b5 (diff)
downloadu-boot-119a7134bfe85ef6fdb2e2a1910185545de41c45.tar.xz
mmc: remove tran_speed from struct mmc
The clock element is updated by mmc_set_clock every time, it denotes the current transfer speed. Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com>
-rw-r--r--cmd/mmc.c2
-rw-r--r--drivers/mmc/mmc.c10
-rw-r--r--drivers/mmc/xenon_sdhci.c2
-rw-r--r--include/mmc.h1
4 files changed, 7 insertions, 8 deletions
diff --git a/cmd/mmc.c b/cmd/mmc.c
index ef05fa5189..6ead27ae2a 100644
--- a/cmd/mmc.c
+++ b/cmd/mmc.c
@@ -23,7 +23,7 @@ static void print_mmcinfo(struct mmc *mmc)
(mmc->cid[1] >> 24), (mmc->cid[1] >> 16) & 0xff,
(mmc->cid[1] >> 8) & 0xff, mmc->cid[1] & 0xff);
- printf("Tran Speed: %d\n", mmc->tran_speed);
+ printf("Tran Speed: %d\n", mmc->clock);
printf("Rd Block Len: %d\n", mmc->read_bl_len);
printf("%s version %d.%d", IS_SD(mmc) ? "SD" : "MMC",
diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index 042365dc11..2fdf220658 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -1449,7 +1449,7 @@ static bool mmc_can_card_busy(struct mmc *)
static int mmc_startup(struct mmc *mmc)
{
int err, i;
- uint mult, freq;
+ uint mult, freq, tran_speed;
u64 cmult, csize, capacity;
struct mmc_cmd cmd;
ALLOC_CACHE_ALIGN_BUFFER(u8, ext_csd, MMC_MAX_BLOCK_LEN);
@@ -1545,7 +1545,7 @@ static int mmc_startup(struct mmc *mmc)
freq = fbase[(cmd.response[0] & 0x7)];
mult = multipliers[((cmd.response[0] >> 3) & 0xf)];
- mmc->tran_speed = freq * mult;
+ tran_speed = freq * mult;
mmc->dsr_imp = ((cmd.response[1] >> 12) & 0x1);
mmc->read_bl_len = 1 << ((cmd.response[1] >> 16) & 0xf);
@@ -1792,11 +1792,11 @@ static int mmc_startup(struct mmc *mmc)
return err;
if (mmc->card_caps & MMC_MODE_HS)
- mmc->tran_speed = 50000000;
+ tran_speed = 50000000;
else
- mmc->tran_speed = 25000000;
+ tran_speed = 25000000;
- mmc_set_clock(mmc, mmc->tran_speed);
+ mmc_set_clock(mmc, tran_speed);
}
/* Fix the block length for DDR mode */
diff --git a/drivers/mmc/xenon_sdhci.c b/drivers/mmc/xenon_sdhci.c
index 06bbff1ff5..b9a3338666 100644
--- a/drivers/mmc/xenon_sdhci.c
+++ b/drivers/mmc/xenon_sdhci.c
@@ -318,7 +318,7 @@ static void xenon_mask_cmd_conflict_err(struct sdhci_host *host)
static void xenon_sdhci_set_ios_post(struct sdhci_host *host)
{
struct xenon_sdhci_priv *priv = host->mmc->priv;
- uint speed = host->mmc->tran_speed;
+ uint speed = host->mmc->clock;
int pwr_18v = 0;
if ((sdhci_readb(host, SDHCI_POWER_CONTROL) & ~SDHCI_POWER_ON) ==
diff --git a/include/mmc.h b/include/mmc.h
index a37237d877..becac9b2a7 100644
--- a/include/mmc.h
+++ b/include/mmc.h
@@ -504,7 +504,6 @@ struct mmc {
u8 part_attr;
u8 wr_rel_set;
u8 part_config;
- uint tran_speed;
uint read_bl_len;
uint write_bl_len;
uint erase_grp_size; /* in 512-byte sectors */