Skip to contentSkip to conversation

MMC: modified calculated mmc-capacity & set mmc trans speed

PATCH New Jae hoon Chung 2 participants 2 messages Mar 2, 2010 MMC, SD and SDIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 MMC: modified calculated mmc-capacity & set mmc trans speed

The patches do the following
1. ? ? If mmc is size is more than 2GB, need to calculate using the ext_csd register.

2. ? ? mmc_set_clock() is hard setting, that is not good solution.

If mmc is not MMC_MODE_HS, mmc will set card is tran_speed

---

drivers/mmc/mmc.c | ? 13 +++++++++----

1 files changed, 9 insertions(+), 4 deletions(-)
drivers/mmc/mmc.c +0 -0

index b69ce15..13fa5c9 100644

--- a/drivers/mmc/mmc.c

+++ b/drivers/mmc/mmc.c

@@ -395,6 +395,10 @@ int mmc_change_freq(struct mmc *mmc)

? ? ? ? ?if (ext_csd[212] || ext_csd[213] || ext_csd[214] || ext_csd[215])

? ? ? ? ? ? ? ? ? ? mmc->high_capacity = 1;

+ ? ? ? ? if (mmc->high_capacity)

+ ? ? ? ? ? ? ? ? ? mmc->capacity = ((ext_csd[215] << 24) | (ext_csd[214] << 16) |

+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?(ext_csd[213] << 8 | ext_csd[212]));

+

? ? ? ? ?cardtype = ext_csd[196] & 0xf;

? ? ? ? ?err = mmc_switch(mmc, EXT_CSD_CMD_SET_NORMAL, EXT_CSD_HS_TIMING, 1);

@@ -779,11 +783,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 */

--

1.6.0.4

#1 lore raw

PATCH 1/1 MMC: modified calculated mmc-capacity & set mmc trans speed

Dear Jae hoon Chung,

Quoted 11 lines · In message <[email protected]> you…

The patches do the following
1. =A0 =A0 If mmc is size is more than 2GB, need to calculate using the ext_csd register.

2. =A0 =A0 mmc_set_clock() is hard setting, that is not good solution.

If mmc is not MMC_MODE_HS, mmc will set card is tran_speed

Your patch is line wrapped and white space damaged. Please make sure to use git-send-email to submit your patches (or fix your mailer configuration. Do NOT copy & paste patches, this will not work.

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
You are in a maze of UUCP connections, all alike.