mmc: set mmc boot buswidth instead of hard setting
authorJaehoon Chung <jh80.chung@samsung.com>
Thu, 23 Dec 2010 04:30:39 +0000 (13:30 +0900)
committerJaehoon Chung <jh80.chung@samsung.com>
Thu, 23 Dec 2010 04:30:39 +0000 (13:30 +0900)
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
drivers/mmc/mmc.c
drivers/mmc/s5p_mmc.c
include/mmc.h

index d63514c..77abe9a 100644 (file)
@@ -438,7 +438,7 @@ int mmc_change_freq(struct mmc *mmc)
         */
        if (mmc->boot_config & 0x7) {
                err = mmc_switch(mmc, EXT_CSD_CMD_SET_NORMAL,
-                               EXT_CSD_BOOT_BUS_WIDTH, 0x2);
+                               EXT_CSD_BOOT_BUS_WIDTH, mmc->boot_buswidth);
                if (err)
                        return err;
        }
index feb43ef..7090b59 100644 (file)
@@ -551,10 +551,13 @@ static int s5p_mmc_initialize(int dev_index, int bus_width)
 
        mmc->voltages = MMC_VDD_32_33 | MMC_VDD_33_34 | MMC_VDD_165_195;
 
-       if (bus_width == 8)
+       if (bus_width == 8) {
                mmc->host_caps = MMC_MODE_8BIT;
-       else
+               mmc->boot_buswidth = MMC_BOOT_8BIT;
+       } else {
                mmc->host_caps = MMC_MODE_4BIT;
+               mmc->boot_buswidth = MMC_BOOT_4BIT;
+       }
        mmc->host_caps |= MMC_MODE_HS_52MHz | MMC_MODE_HS;
 
        mmc->f_min = 400000;
index fa755ca..d1729f6 100644 (file)
@@ -44,6 +44,8 @@
 #define MMC_MODE_HS_52MHz      0x010
 #define MMC_MODE_4BIT          0x100
 #define MMC_MODE_8BIT          0x200
+#define MMC_BOOT_4BIT          0x1
+#define MMC_BOOT_8BIT          0x2
 
 #define SD_DATA_4BIT   0x00040000
 
@@ -282,6 +284,7 @@ struct mmc {
        u64 capacity;
        block_dev_desc_t block_dev;
        uint boot_config;
+       uint boot_buswidth;
        int check_rev;  /* check version 4.3+ or 4.41 (1: 4.3+, 0: 4.41) */
        int (*send_cmd)(struct mmc *mmc,
                        struct mmc_cmd *cmd, struct mmc_data *data);