mmc_queue_bounce_post(mq);
+#if defined(CONFIG_SDMMC_RK29) && !defined(CONFIG_SDMMC_RK29_OLD)
+ //delete all retry code. modifyed by xbw at 2011-11-17
+#else
/*
* sbc.error indicates a problem with the set block count
* command. No data will have been transferred.
break;
}
}
+#endif
/*
* Check for errors relating to the execution of the
goto cmd_abort;
}
+#if defined(CONFIG_SDMMC_RK29) && !defined(CONFIG_SDMMC_RK29_OLD)
+ //delete all retry code. modifyed by xbw at 2011-11-17
+#else
/*
* Everything else is either success, or a data error of some
* kind. If it was a write, we may have transitioned to
} while (!(status & R1_READY_FOR_DATA) ||
(R1_CURRENT_STATE(status) == R1_STATE_PRG));
}
+#endif
+#if defined(CONFIG_SDMMC_RK29) && !defined(CONFIG_SDMMC_RK29_OLD)
+ if (brq.sbc.error || brq.cmd.error || brq.stop.error || brq.data.error) { //modifyed by xbw at 2011-11-17
+#else
if (brq.data.error) {
+#endif
pr_err("%s: error %d transferring data, sector %u, nr %u, cmd response %#x, card status %#x\n",
req->rq_disk->disk_name, brq.data.error,
(unsigned)blk_rq_pos(req),
*/
void mmc_wait_for_req(struct mmc_host *host, struct mmc_request *mrq)
{
+#if defined(CONFIG_SDMMC_RK29) && !defined(CONFIG_SDMMC_RK29_OLD)
unsigned long datasize, waittime = 0xFFFF;
u32 multi, unit;
+#endif
DECLARE_COMPLETION_ONSTACK(complete);
* to reach the minimum voltage.
*/
mmc_delay(10);
-
+
+#if defined(CONFIG_SDMMC_RK29) || !defined(CONFIG_SDMMC_RK29_OLD) //Modifyed by xbw at 2011-11-17
+ host->ios.clock = host->f_min;
+#else
host->ios.clock = host->f_init;
+#endif
host->ios.power_mode = MMC_POWER_ON;
mmc_set_ios(host);
{
host->f_init = freq;
+#if defined(CONFIG_SDMMC_RK29) || !defined(CONFIG_SDMMC_RK29_OLD) //Modifyed by xbw at 2011-11-17
+ int init_ret=0;
+#endif
+
#ifdef CONFIG_MMC_DEBUG
pr_info("%s: %s: trying to init card at %u Hz\n",
mmc_hostname(host), __func__, host->f_init);
* if the card is being re-initialized, just send it. CMD52
* should be ignored by SD/eMMC cards.
*/
- sdio_reset(host);
+#if defined(CONFIG_SDMMC_RK29) || !defined(CONFIG_SDMMC_RK29_OLD) //Modifyed by xbw at 2011-11-17
+//the process is default for rockchip SDK. noted by xbw at 2011-11-17
+
+/* Order's important: probe SDIO, then SD, then MMC */
+
+#if !defined(CONFIG_USE_SDMMC0_FOR_WIFI_DEVELOP_BOARD)
+ if( strncmp( mmc_hostname(host) ,"mmc0" , strlen("mmc0")) )
+ {
+ sdio_reset(host);
+ mmc_go_idle(host);
+
+ if (!(init_ret=mmc_attach_sdio(host)))
+ {
+ printk("%s..%d.. ===== Initialize SDIO successfully. ===xbw[%s]===\n",\
+ __FUNCTION__, __LINE__, mmc_hostname(host));
+ return 0;
+ }
+ else
+ {
+ if(0xFF!=init_ret)
+ {
+ printk("\n=====\n %s..%d.. ===== Initialize SDIO-card unsuccessfully!!! ===xbw[%s]===\n=====\n",\
+ __FUNCTION__, __LINE__, mmc_hostname(host));
+
+ goto freq_out;
+ }
+ }
+ }
+ else
+ {
+ mmc_go_idle(host);
+ }
+#else
+ sdio_reset(host);
+ mmc_go_idle(host);
+
+ if (!(init_ret=mmc_attach_sdio(host)))
+ {
+ printk("%s..%d.. ===== Initialize SDIO successfully. ===xbw[%s]===\n",\
+ __FUNCTION__, __LINE__, mmc_hostname(host));
+ return 0;
+ }
+ else
+ {
+ if(0xFF!=init_ret)
+ {
+ printk("\n=====\n %s..%d.. ===== Initialize SDIO-card unsuccessfully!!! ===xbw[%s]===\n=====\n",\
+ __FUNCTION__, __LINE__, mmc_hostname(host));
+
+ goto freq_out;
+ }
+ }
+#endif // #end--#if !defined(CONFIG_USE_SDMMC0_FOR_WIFI_DEVELOP_BOARD)
+
+ if (!(init_ret=mmc_attach_sd(host)))
+ {
+ printk("%s..%d.. ===== Initialize SD-card successfully. ===xbw[%s]===\n",\
+ __FUNCTION__, __LINE__, mmc_hostname(host));
+
+ return 0;
+ }
+ else
+ {
+ if(0xFF!=init_ret)
+ {
+ printk("\n=====\n%s..%d.. ===== Initialize SD-card unsuccessfully!!! ===xbw[%s]===\n====\n",\
+ __FUNCTION__, __LINE__, mmc_hostname(host));
+
+ goto freq_out;
+ }
+ }
+
+
+ if (!(init_ret=mmc_attach_mmc(host)))
+ {
+ printk("%s...%d.. ===== Initialize MMC-card successfully. ===xbw[%s]===\n",\
+ __FUNCTION__, __LINE__, mmc_hostname(host));
+
+ return 0;
+ }
+ else
+ {
+ if(0xFF!=init_ret)
+ {
+ printk("\n =====\n%s..%d.. ===== Initialize MMC-card unsuccessfully!!! ===xbw[%s]===\n======\n",\
+ __FUNCTION__, __LINE__, mmc_hostname(host));
+
+ goto freq_out;
+ }
+ }
+
+freq_out:
+ mmc_power_off(host);
+ return -EIO;
+
+#else // the default process in ICS.
+
+ sdio_reset(host);
mmc_go_idle(host);
mmc_send_if_cond(host, host->ocr_avail);
mmc_power_off(host);
return -EIO;
+#endif
+
}
void mmc_rescan(struct work_struct *work)
*/
mmc_bus_put(host);
+#if defined(CONFIG_SDMMC_RK29) || !defined(CONFIG_SDMMC_RK29_OLD) //Modifyed by xbw at 2011-11-17
+ printk("\n%s...%d.. ===== mmc_rescan Begin....======xbw[%s]=====\n",__FILE__, __LINE__, mmc_hostname(host));
+#endif
+
if (host->ops->get_cd && host->ops->get_cd(host) == 0)
+ {
+#if defined(CONFIG_SDMMC_RK29) || !defined(CONFIG_SDMMC_RK29_OLD) //Modifyed by xbw at 2011-11-17
+ printk("\n=================\n%s..%d.. ====find no SDMMC host.====xbw[%s]=====\n", \
+ __FUNCTION__, __LINE__, mmc_hostname(host));
+#endif
+
goto out;
+ }
mmc_claim_host(host);
+
+#if defined(CONFIG_SDMMC_RK29) || !defined(CONFIG_SDMMC_RK29_OLD) //Modifyed by xbw at 2011-11-17
+ if (!mmc_rescan_try_freq(host, host->f_min))
+ extend_wakelock = true;
+
+#else
for (i = 0; i < ARRAY_SIZE(freqs); i++) {
if (!mmc_rescan_try_freq(host, max(freqs[i], host->f_min))) {
extend_wakelock = true;
if (freqs[i] <= host->f_min)
break;
}
+#endif
+
mmc_release_host(host);
out:
if (err)
goto remove;
-#if !defined(CONFIG_SDMMC_RK29) || defined(CONFIG_SDMMC_RK29_OLD)
/*
* Update oldcard with the new RCA received from the SDIO
* device -- we're doing this so that it's updated in the
*/
if (oldcard)
oldcard->rca = card->rca;
-#endif
mmc_set_bus_mode(host, MMC_BUSMODE_PUSHPULL);
}
WARN_ON(!host->claimed);
err = mmc_send_io_op_cond(host, 0, &ocr);
+
+#if defined(CONFIG_SDMMC_RK29) && !defined(CONFIG_SDMMC_RK29_OLD)
if (err)
+ return 0xFF;//return err; //Modifyed by xbw at 2011-11-17
+
+ printk("\n%s..%d.. ===== Begin to identify card as SDIO-card===xbw[%s]===\n",\
+ __FUNCTION__, __LINE__, mmc_hostname(host));
+#else
+ if (err)
return err;
-
+#endif
mmc_attach_bus(host, &mmc_sdio_ops);
if (host->ocr_avail_sdio)
host->ocr_avail = host->ocr_avail_sdio;