mmc: host: rk_sdmmc: fix IP bug for div larger than 1
authorlintao <lintao@rock-chips.com>
Thu, 15 May 2014 10:21:52 +0000 (18:21 +0800)
committerlintao <lintao@rock-chips.com>
Thu, 15 May 2014 10:22:14 +0000 (18:22 +0800)
drivers/mmc/host/rk_sdmmc.c

index 2fe9f14997df77557c8119c00a02ea6bad910fa2..747941668bacac35c992d261fb9bf208afb3e169 100755 (executable)
@@ -906,6 +906,20 @@ static void dw_mci_setup_bus(struct dw_mci_slot *slot, bool force_clkinit)
                mci_send_cmd(slot,
                             SDMMC_CMD_UPD_CLK | SDMMC_CMD_PRV_DAT_WAIT, 0);
 
+                
+                if(div > 1){
+                        if((host->mmc->restrict_caps & RESTRICT_CARD_TYPE_EMMC)
+                          && clock > 100000000){
+                                printk("rk_sdmmc: emmc : div larger than 1, illegal clk in dts ![%s]\n ", 
+                                        mmc_hostname(host->mmc));
+                                printk("eMMC ERROR, emergancy halt!!!!!!!!!\n");        
+                                printk("Please refer to your eMMC datasheet to determine speed mode!\n");
+                                printk("DDR mode: clk in dts should <= 50MHz!\n");
+                                printk("SDR mode: clk in dts should <= 50MHz!\n");
+                                printk("HS200 mode: clk in dts should <= 150MHz!\n");
+                                BUG();
+                        }
+                }
                /* set clock to desired speed */
                mci_writel(host, CLKDIV, div);