Support emmc for Thunder OneCloud (#11453)

This commit is contained in:
晓东 2023-08-15 14:32:55 +08:00 committed by GitHub
parent 961ee0e81e
commit 4e7c56f9f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -0,0 +1,48 @@
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -1383,12 +1383,13 @@ static int mmc_select_hs400es(struct mmc
* SEND_STATUS reliably at the initial frequency.
*/
mmc_set_timing(host, MMC_TIMING_MMC_HS);
- mmc_set_bus_speed(card);
err = mmc_switch_status(card, true);
if (err)
goto out_err;
+ mmc_set_clock(host, card->ext_csd.hs_max_dtr);
+
/* Switch card to DDR with strobe bit */
val = EXT_CSD_DDR_BUS_WIDTH_8 | EXT_CSD_BUS_WIDTH_STROBE;
err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
@@ -1446,7 +1447,7 @@ out_err:
static int mmc_select_hs200(struct mmc_card *card)
{
struct mmc_host *host = card->host;
- unsigned int old_timing, old_signal_voltage, old_clock;
+ unsigned int old_timing, old_signal_voltage;
int err = -EINVAL;
u8 val;
@@ -1485,9 +1486,7 @@ static int mmc_select_hs200(struct mmc_c
* successfully switched over.
*/
old_timing = host->ios.timing;
- old_clock = host->ios.clock;
mmc_set_timing(host, MMC_TIMING_MMC_HS200);
- mmc_set_clock(card->host, card->ext_csd.hs_max_dtr);
/*
* For HS200, CRC errors are not a reliable way to know the
@@ -1500,10 +1499,8 @@ static int mmc_select_hs200(struct mmc_c
* mmc_select_timing() assumes timing has not changed if
* it is a switch error.
*/
- if (err == -EBADMSG) {
- mmc_set_clock(host, old_clock);
+ if (err == -EBADMSG)
mmc_set_timing(host, old_timing);
- }
}
err:
if (err) {