提交 4406ae21 编写于 作者: S Shawn Lin 提交者: Ulf Hansson

mmc: core: correct taac parameter according to the specification

Per the spec of JESD84-B51, section 7.3, replace tacc with taac to
fix the obvious typo.
Signed-off-by: NShawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
上级 30de038d
...@@ -733,8 +733,8 @@ void mmc_set_data_timeout(struct mmc_data *data, const struct mmc_card *card) ...@@ -733,8 +733,8 @@ void mmc_set_data_timeout(struct mmc_data *data, const struct mmc_card *card)
if (data->flags & MMC_DATA_WRITE) if (data->flags & MMC_DATA_WRITE)
mult <<= card->csd.r2w_factor; mult <<= card->csd.r2w_factor;
data->timeout_ns = card->csd.tacc_ns * mult; data->timeout_ns = card->csd.taac_ns * mult;
data->timeout_clks = card->csd.tacc_clks * mult; data->timeout_clks = card->csd.taac_clks * mult;
/* /*
* SD cards also have an upper limit on the timeout. * SD cards also have an upper limit on the timeout.
...@@ -1859,14 +1859,14 @@ static unsigned int mmc_mmc_erase_timeout(struct mmc_card *card, ...@@ -1859,14 +1859,14 @@ static unsigned int mmc_mmc_erase_timeout(struct mmc_card *card,
} else { } else {
/* CSD Erase Group Size uses write timeout */ /* CSD Erase Group Size uses write timeout */
unsigned int mult = (10 << card->csd.r2w_factor); unsigned int mult = (10 << card->csd.r2w_factor);
unsigned int timeout_clks = card->csd.tacc_clks * mult; unsigned int timeout_clks = card->csd.taac_clks * mult;
unsigned int timeout_us; unsigned int timeout_us;
/* Avoid overflow: e.g. tacc_ns=80000000 mult=1280 */ /* Avoid overflow: e.g. taac_ns=80000000 mult=1280 */
if (card->csd.tacc_ns < 1000000) if (card->csd.taac_ns < 1000000)
timeout_us = (card->csd.tacc_ns * mult) / 1000; timeout_us = (card->csd.taac_ns * mult) / 1000;
else else
timeout_us = (card->csd.tacc_ns / 1000) * mult; timeout_us = (card->csd.taac_ns / 1000) * mult;
/* /*
* ios.clock is only a target. The real clock rate might be * ios.clock is only a target. The real clock rate might be
......
...@@ -41,11 +41,11 @@ static const unsigned char tran_mant[] = { ...@@ -41,11 +41,11 @@ static const unsigned char tran_mant[] = {
35, 40, 45, 50, 55, 60, 70, 80, 35, 40, 45, 50, 55, 60, 70, 80,
}; };
static const unsigned int tacc_exp[] = { static const unsigned int taac_exp[] = {
1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 1, 10, 100, 1000, 10000, 100000, 1000000, 10000000,
}; };
static const unsigned int tacc_mant[] = { static const unsigned int taac_mant[] = {
0, 10, 12, 13, 15, 20, 25, 30, 0, 10, 12, 13, 15, 20, 25, 30,
35, 40, 45, 50, 55, 60, 70, 80, 35, 40, 45, 50, 55, 60, 70, 80,
}; };
...@@ -153,8 +153,8 @@ static int mmc_decode_csd(struct mmc_card *card) ...@@ -153,8 +153,8 @@ static int mmc_decode_csd(struct mmc_card *card)
csd->mmca_vsn = UNSTUFF_BITS(resp, 122, 4); csd->mmca_vsn = UNSTUFF_BITS(resp, 122, 4);
m = UNSTUFF_BITS(resp, 115, 4); m = UNSTUFF_BITS(resp, 115, 4);
e = UNSTUFF_BITS(resp, 112, 3); e = UNSTUFF_BITS(resp, 112, 3);
csd->tacc_ns = (tacc_exp[e] * tacc_mant[m] + 9) / 10; csd->taac_ns = (taac_exp[e] * taac_mant[m] + 9) / 10;
csd->tacc_clks = UNSTUFF_BITS(resp, 104, 8) * 100; csd->taac_clks = UNSTUFF_BITS(resp, 104, 8) * 100;
m = UNSTUFF_BITS(resp, 99, 4); m = UNSTUFF_BITS(resp, 99, 4);
e = UNSTUFF_BITS(resp, 96, 3); e = UNSTUFF_BITS(resp, 96, 3);
......
...@@ -39,11 +39,11 @@ static const unsigned char tran_mant[] = { ...@@ -39,11 +39,11 @@ static const unsigned char tran_mant[] = {
35, 40, 45, 50, 55, 60, 70, 80, 35, 40, 45, 50, 55, 60, 70, 80,
}; };
static const unsigned int tacc_exp[] = { static const unsigned int taac_exp[] = {
1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 1, 10, 100, 1000, 10000, 100000, 1000000, 10000000,
}; };
static const unsigned int tacc_mant[] = { static const unsigned int taac_mant[] = {
0, 10, 12, 13, 15, 20, 25, 30, 0, 10, 12, 13, 15, 20, 25, 30,
35, 40, 45, 50, 55, 60, 70, 80, 35, 40, 45, 50, 55, 60, 70, 80,
}; };
...@@ -111,8 +111,8 @@ static int mmc_decode_csd(struct mmc_card *card) ...@@ -111,8 +111,8 @@ static int mmc_decode_csd(struct mmc_card *card)
case 0: case 0:
m = UNSTUFF_BITS(resp, 115, 4); m = UNSTUFF_BITS(resp, 115, 4);
e = UNSTUFF_BITS(resp, 112, 3); e = UNSTUFF_BITS(resp, 112, 3);
csd->tacc_ns = (tacc_exp[e] * tacc_mant[m] + 9) / 10; csd->taac_ns = (taac_exp[e] * taac_mant[m] + 9) / 10;
csd->tacc_clks = UNSTUFF_BITS(resp, 104, 8) * 100; csd->taac_clks = UNSTUFF_BITS(resp, 104, 8) * 100;
m = UNSTUFF_BITS(resp, 99, 4); m = UNSTUFF_BITS(resp, 99, 4);
e = UNSTUFF_BITS(resp, 96, 3); e = UNSTUFF_BITS(resp, 96, 3);
...@@ -148,8 +148,8 @@ static int mmc_decode_csd(struct mmc_card *card) ...@@ -148,8 +148,8 @@ static int mmc_decode_csd(struct mmc_card *card)
*/ */
mmc_card_set_blockaddr(card); mmc_card_set_blockaddr(card);
csd->tacc_ns = 0; /* Unused */ csd->taac_ns = 0; /* Unused */
csd->tacc_clks = 0; /* Unused */ csd->taac_clks = 0; /* Unused */
m = UNSTUFF_BITS(resp, 99, 4); m = UNSTUFF_BITS(resp, 99, 4);
e = UNSTUFF_BITS(resp, 96, 3); e = UNSTUFF_BITS(resp, 96, 3);
......
...@@ -29,8 +29,8 @@ struct mmc_csd { ...@@ -29,8 +29,8 @@ struct mmc_csd {
unsigned char structure; unsigned char structure;
unsigned char mmca_vsn; unsigned char mmca_vsn;
unsigned short cmdclass; unsigned short cmdclass;
unsigned short tacc_clks; unsigned short taac_clks;
unsigned int tacc_ns; unsigned int taac_ns;
unsigned int c_size; unsigned int c_size;
unsigned int r2w_factor; unsigned int r2w_factor;
unsigned int max_dtr; unsigned int max_dtr;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册