aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilip Rakity <prakity@marvell.com>2011-03-19 14:10:33 -0400
committerChris Ball <cjb@laptop.org>2011-05-24 20:59:13 -0400
commit41e2a4893566ced3c46af15df5b727326881e47d (patch)
tree62263d47bf1f034857e8138095af724aa61c53bb
parent7c21738efd0b5e8c2a9ac2440e7ffbf432d6f239 (diff)
mmc: Ensure linux starts in eMMC user partition
uBoot sometimes leaves eMMC pointing to the private boot partition. Ensure we always start looking at the user partition. Signed-off-by: Philip Rakity <prakity@marvell.com> Signed-off-by: Bruce Clemens <bpclemens@marvell.com> Signed-off-by: Mark F. Brown <markb@marvell.com> Signed-off-by: Chris Ball <cjb@laptop.org>
-rw-r--r--drivers/mmc/core/mmc.c10
-rw-r--r--include/linux/mmc/card.h1
-rw-r--r--include/linux/mmc/mmc.h1
3 files changed, 12 insertions, 0 deletions
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index 772d0d0a541b..5c611a6e0080 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -288,6 +288,7 @@ static int mmc_read_ext_csd(struct mmc_card *card)
288 288
289 if (card->ext_csd.rev >= 3) { 289 if (card->ext_csd.rev >= 3) {
290 u8 sa_shift = ext_csd[EXT_CSD_S_A_TIMEOUT]; 290 u8 sa_shift = ext_csd[EXT_CSD_S_A_TIMEOUT];
291 card->ext_csd.bootconfig = ext_csd[EXT_CSD_BOOT_CONFIG];
291 292
292 /* Sleep / awake timeout in 100ns units */ 293 /* Sleep / awake timeout in 100ns units */
293 if (sa_shift > 0 && sa_shift <= 0x17) 294 if (sa_shift > 0 && sa_shift <= 0x17)
@@ -568,6 +569,15 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
568 } 569 }
569 570
570 /* 571 /*
572 * Ensure eMMC user default partition is enabled
573 */
574 if (card->ext_csd.bootconfig & 0x7) {
575 card->ext_csd.bootconfig &= ~0x7;
576 mmc_switch(card, EXT_CSD_CMD_SET_NORMAL, EXT_CSD_BOOT_CONFIG,
577 card->ext_csd.bootconfig);
578 }
579
580 /*
571 * Activate high speed (if supported) 581 * Activate high speed (if supported)
572 */ 582 */
573 if ((card->ext_csd.hs_max_dtr != 0) && 583 if ((card->ext_csd.hs_max_dtr != 0) &&
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h
index adb4888248be..557b73263390 100644
--- a/include/linux/mmc/card.h
+++ b/include/linux/mmc/card.h
@@ -45,6 +45,7 @@ struct mmc_ext_csd {
45 u8 rev; 45 u8 rev;
46 u8 erase_group_def; 46 u8 erase_group_def;
47 u8 sec_feature_support; 47 u8 sec_feature_support;
48 u8 bootconfig;
48 unsigned int sa_timeout; /* Units: 100ns */ 49 unsigned int sa_timeout; /* Units: 100ns */
49 unsigned int hs_max_dtr; 50 unsigned int hs_max_dtr;
50 unsigned int sectors; 51 unsigned int sectors;
diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h
index 264ba5451e3b..b5ec88fd1352 100644
--- a/include/linux/mmc/mmc.h
+++ b/include/linux/mmc/mmc.h
@@ -256,6 +256,7 @@ struct _mmc_csd {
256#define EXT_CSD_PARTITION_ATTRIBUTE 156 /* R/W */ 256#define EXT_CSD_PARTITION_ATTRIBUTE 156 /* R/W */
257#define EXT_CSD_PARTITION_SUPPORT 160 /* RO */ 257#define EXT_CSD_PARTITION_SUPPORT 160 /* RO */
258#define EXT_CSD_ERASE_GROUP_DEF 175 /* R/W */ 258#define EXT_CSD_ERASE_GROUP_DEF 175 /* R/W */
259#define EXT_CSD_BOOT_CONFIG 179 /* R/W */
259#define EXT_CSD_ERASED_MEM_CONT 181 /* RO */ 260#define EXT_CSD_ERASED_MEM_CONT 181 /* RO */
260#define EXT_CSD_BUS_WIDTH 183 /* R/W */ 261#define EXT_CSD_BUS_WIDTH 183 /* R/W */
261#define EXT_CSD_HS_TIMING 185 /* R/W */ 262#define EXT_CSD_HS_TIMING 185 /* R/W */