Skip to contentSkip to conversation

mmc: modify setting tran_speed and change csd's instead of response value

PATCH New Jaehoon Chung 3 participants 4 messages Jun 18, 2010 – Aug 8, 2010 MMC, SD and SDIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mmc: modify setting tran_speed and change csd's instead of response value

This patch do the following
1. we need not use cmd.response, because we assinged cmd.response value to mmc->csd.
2. mmc_set_clock() is hard setting, that is not good solution
and if mmc is not MMC_MODE_HS, mmc will set card's tran_speed.

---
 drivers/mmc/mmc.c |   19 ++++++++++---------
 1 files changed, 10 insertions(+), 9 deletions(-)
drivers/mmc/mmc.c +10 -9
index cf4ea16..fd80a27 100644
@@ -666,7 +666,7 @@ int mmc_startup(struct mmc *mmc)
 	mmc->csd[3] = cmd.response[3];
 
 	if (mmc->version == MMC_VERSION_UNKNOWN) {
-		int version = (cmd.response[0] >> 26) & 0xf;
+		int version = (mmc->csd[0] >> 26) & 0xf;
 
 		switch (version) {
 			case 0:
@@ -691,17 +691,17 @@ int mmc_startup(struct mmc *mmc)
 	}
 
 	/* divide frequency by 10, since the mults are 10x bigger */
-	freq = fbase[(cmd.response[0] & 0x7)];
-	mult = multipliers[((cmd.response[0] >> 3) & 0xf)];
+	freq = fbase[(mmc->csd[0] & 0x7)];
+	mult = multipliers[((mmc->csd[0] >> 3) & 0xf)];
 
 	mmc->tran_speed = freq * mult;
 
-	mmc->read_bl_len = 1 << ((cmd.response[1] >> 16) & 0xf);
+	mmc->read_bl_len = 1 << ((mmc->csd[1] >> 16) & 0xf);
 
 	if (IS_SD(mmc))
 		mmc->write_bl_len = mmc->read_bl_len;
 	else
-		mmc->write_bl_len = 1 << ((cmd.response[3] >> 22) & 0xf);
+		mmc->write_bl_len = 1 << ((mmc->csd[3] >> 22) & 0xf);
 
 	if (mmc->high_capacity) {
 		csize = (mmc->csd[1] & 0x3f) << 16
@@ -794,11 +794,12 @@ int mmc_startup(struct mmc *mmc)
 
 		if (mmc->card_caps & MMC_MODE_HS) {
 			if (mmc->card_caps & MMC_MODE_HS_52MHz)
-				mmc_set_clock(mmc, 52000000);
+				mmc->tran_speed = 52000000;
 			else
-				mmc_set_clock(mmc, 26000000);
-		} else
-			mmc_set_clock(mmc, 20000000);
+				mmc->tran_speed = 26000000;
+		}
+
+		mmc_set_clock(mmc, mmc->tran_speed);
 	}
 
 	/* fill in device description */
Signature · 1 line
1.6.0.4
#1 lore raw

PATCH 1/1 mmc: modify setting tran_speed and change csd's instead of response value

Quoted 11 lines · Jaehoon Chung

This patch do the following
1. we need not use cmd.response, because we assinged cmd.response value to mmc->csd.
2. mmc_set_clock() is hard setting, that is not good solution
? and if mmc is not MMC_MODE_HS, mmc will set card's tran_speed.

?Signed-off-by: Jaehoon Chung <[email protected]>

---
?drivers/mmc/mmc.c | ? 19 ++++++++++--------- ?1 files changed, 10 insertions(+), 9 deletions(-)

Thanks.
Minkyu Kang

Signature · 2 lines
from. prom.
www.promsoft.net
#2 lore raw

PATCH 1/1 mmc: modify setting tran_speed and change csd's instead of response value

Dear Andy,

Quoted 6 lines · Minkyu Kang
Quoted 5 lines · Jaehoon Chung

This patch do the following
1. we need not use cmd.response, because we assinged cmd.response value to mmc->csd.
2. mmc_set_clock() is hard setting, that is not good solution
? and if mmc is not MMC_MODE_HS, mmc will set card's tran_speed.

Quoted 9 lines
Quoted 6 lines

?Signed-off-by: Jaehoon Chung <[email protected]>

---
?drivers/mmc/mmc.c | ? 19 ++++++++++--------- ?1 files changed, 10 insertions(+), 9 deletions(-)

Please let me know your opinion.

Thanks.
Minkyu Kang

Signature · 2 lines
from. prom.
www.promsoft.net
#3 lore raw

PATCH 1/1 mmc: modify setting tran_speed and change csd's instead of response value

In reply to Jaehoon Chung

Dear Andy

Quoted 10 lines · In message <[email protected]> Jaehoon Chung wrote:

This patch do the following
1. we need not use cmd.response, because we assinged cmd.response value to mmc->csd.
2. mmc_set_clock() is hard setting, that is not good solution
and if mmc is not MMC_MODE_HS, mmc will set card's tran_speed.

---
 drivers/mmc/mmc.c |   19 ++++++++++---------
 1 files changed, 10 insertions(+), 9 deletions(-)

See http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/80067

Is this patch in your queue?

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Democracy is mob rule, but with income taxes.