diff options
author | Al Cooper <alcooperx@gmail.com> | 2012-11-30 10:53:35 -0500 |
---|---|---|
committer | Chris Ball <cjb@laptop.org> | 2012-12-06 13:55:11 -0500 |
commit | ccb52a00fd3fdea428e29816cbacb0a78090d474 (patch) | |
tree | 280a46cf6b880f5ba7cb3f172c328052d7fe4427 /drivers/mmc/core | |
parent | 780f22af85991be4f7c51c512726eee931707fff (diff) |
mmc: Limit MMC speed to 52MHz if not HS200
If "caps2" host capabilities does not indicate support for MMC
HS200, don't allow clock speeds >52MHz. Currently, for MMC, the
clock speed is set to the lesser of the max speed the eMMC module
supports (card->ext_csd.hs_max_dtr) or the max base clock of the
host controller (host->f_max based on BASE_CLK_FREQ in the host
CAPS register). This means that a host controller that doesn't
support HS200 mode but has a base clock of 100MHz and an eMMC module
that supports HS200 speeds will end up using a 100MHz clock.
Signed-off-by: Al Cooper <alcooperx@gmail.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers/mmc/core')
-rw-r--r-- | drivers/mmc/core/mmc.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c index f605d6e3d2cd..e6e39111e05b 100644 --- a/drivers/mmc/core/mmc.c +++ b/drivers/mmc/core/mmc.c | |||
@@ -1066,6 +1066,8 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr, | |||
1066 | if (mmc_card_highspeed(card) || mmc_card_hs200(card)) { | 1066 | if (mmc_card_highspeed(card) || mmc_card_hs200(card)) { |
1067 | if (max_dtr > card->ext_csd.hs_max_dtr) | 1067 | if (max_dtr > card->ext_csd.hs_max_dtr) |
1068 | max_dtr = card->ext_csd.hs_max_dtr; | 1068 | max_dtr = card->ext_csd.hs_max_dtr; |
1069 | if (mmc_card_highspeed(card) && (max_dtr > 52000000)) | ||
1070 | max_dtr = 52000000; | ||
1069 | } else if (max_dtr > card->csd.max_dtr) { | 1071 | } else if (max_dtr > card->csd.max_dtr) { |
1070 | max_dtr = card->csd.max_dtr; | 1072 | max_dtr = card->csd.max_dtr; |
1071 | } | 1073 | } |