mmc: Support tSD or SD booting OS.
authorlintao <lintao@rock-chips.com>
Thu, 4 Sep 2014 08:05:28 +0000 (16:05 +0800)
committerlintao <lintao@rock-chips.com>
Thu, 4 Sep 2014 08:11:05 +0000 (16:11 +0800)
In case of tSD board or SD booting project, BSP engineers could
only add "supports-tSD" into emmc_of_node claim. Refer to arch/arm/boot/dts/rk3288-tb.dts

arch/arm/boot/dts/rk3288-tb.dts
arch/arm/boot/dts/rk3288-tb_8846.dts
drivers/mmc/core/core.c
drivers/mmc/host/rk_sdmmc.c
include/linux/mmc/host.h

index 097ba0ea1d0873ce87614f1558191e25295d7860..b36765b905e865f07cdeb9cb7666d7995e3aca2a 100755 (executable)
         supports-highspeed;
        supports-emmc;
         bootpart-no-access;
-
+       
+       //supports-tSD;
        //supports-DDR_MODE; //you should set the two value in your project. only close in RK3288-SDK board.
        //caps2-mmc-hs200;
 
index e7f654c6e61fa9ebe3e34cebe265b1a3c1b3d0d3..874bc791a56fe797bcc1da0021a6b93030538313 100644 (file)
        supports-emmc;
         bootpart-no-access;
 
+       //supports-tSD;
        //supports-DDR_MODE; //you should set the two value in your project. only close in RK3288-SDK board.
        //caps2-mmc-hs200;
 
index 6c56ec597bc4b1e62a8c07b55131af9f33386790..efc26a00665cf4ede5404306dc0e7ca420bda105 100755 (executable)
@@ -2395,12 +2395,12 @@ static int mmc_rescan_try_freq(struct mmc_host *host, unsigned freq)
        if(host->restrict_caps & (RESTRICT_CARD_TYPE_SDIO |RESTRICT_CARD_TYPE_SD))
            mmc_send_if_cond(host, host->ocr_avail);
 
-    /* Order's important: probe SDIO, then SD, then MMC */
-       if ((host->restrict_caps &RESTRICT_CARD_TYPE_SDIO) && !mmc_attach_sdio(host))
+        /* Order's important: probe SDIO, then SD, then MMC */
+       if ((host->restrict_caps & RESTRICT_CARD_TYPE_SDIO) && !mmc_attach_sdio(host))
                return 0;
-       if ((host->restrict_caps &RESTRICT_CARD_TYPE_SD) && !mmc_attach_sd(host))
+       if ((host->restrict_caps & (RESTRICT_CARD_TYPE_SD | RESTRICT_CARD_TYPE_TSD)) && !mmc_attach_sd(host))
                return 0;
-       if ((host->restrict_caps &(RESTRICT_CARD_TYPE_EMMC|RESTRICT_CARD_TYPE_SD)) && !mmc_attach_mmc(host))
+       if ((host->restrict_caps & RESTRICT_CARD_TYPE_EMMC) && !mmc_attach_mmc(host))
                return 0;   
 #endif
 
index 7e8d03653d2207d96fe148af81260c5f5d50ae91..473eb0ed181d1a237f9fc4e60b440847249c8aba 100755 (executable)
@@ -3256,6 +3256,10 @@ static int dw_mci_init_slot(struct dw_mci *host, unsigned int id)
                mmc->restrict_caps |= RESTRICT_CARD_TYPE_SDIO;  
        if (of_find_property(host->dev->of_node, "supports-emmc", NULL))
                mmc->restrict_caps |= RESTRICT_CARD_TYPE_EMMC;
+       /* Fixup for tSD */
+        if (of_find_property(host->dev->of_node, "supports-tSD", NULL))
+               mmc->restrict_caps |= RESTRICT_CARD_TYPE_TSD;
+
 
         /* We assume only low-level chip use gpio_cd */
         if (cpu_is_rk312x() &&
index 7f45c684ec0bb5784ddd00f7f748d26f65a6632a..d0410856a8a01d86864bbbd9d1fad50022d4e66c 100755 (executable)
@@ -288,9 +288,10 @@ struct mmc_host {
        mmc_pm_flag_t           pm_caps;        /* supported pm features */
        
     u32      restrict_caps;    /*restrict the SDMMC controller to support card type;1--SD card; 2--sdio; 4--eMMC */
-#define RESTRICT_CARD_TYPE_SD  (1 << 0)        /*noted by XBW, Rockchip Co.Ld*/
-#define RESTRICT_CARD_TYPE_SDIO        (1 << 1)        
-#define RESTRICT_CARD_TYPE_EMMC        (1 << 2)        
+#define RESTRICT_CARD_TYPE_SD   (1 << 0)        /*support SD*/
+#define RESTRICT_CARD_TYPE_SDIO (1 << 1)        /*support SDIO*/
+#define RESTRICT_CARD_TYPE_EMMC (1 << 2)        /*support EMMC*/
+#define RESTRICT_CARD_TYPE_TSD  (1 << 3)        /*support tSD*/
     unsigned int    hold_reg_flag;//to fix the hold_reg value