Commit 2d0d68f5 authored by Philip Rakity's avatar Philip Rakity Committed by Chris Ball

mmc: core: UHS sdio card that fails should not exceed 50MHz

A UHS sdio card that fails initialization at 1.8v signaling is not in
UHS mode.  We cannot use the speed in the the cis to reflect the bus
speed as this is the maxiumum value and will not reflect the fact
that the host is operating at a lower (non uhs) bus speed.
Signed-off-by: default avatarPhilip Rakity <prakity@marvell.com>
Signed-off-by: default avatarBing Zhao <bzhao@marvell.com>
Reviewed-by: default avatarAaron Lu <aaron.lu@amd.com>
Signed-off-by: default avatarChris Ball <cjb@laptop.org>
parent ba8c4dc9
...@@ -98,10 +98,11 @@ static int sdio_init_func(struct mmc_card *card, unsigned int fn) ...@@ -98,10 +98,11 @@ static int sdio_init_func(struct mmc_card *card, unsigned int fn)
return ret; return ret;
} }
static int sdio_read_cccr(struct mmc_card *card) static int sdio_read_cccr(struct mmc_card *card, u32 ocr)
{ {
int ret; int ret;
int cccr_vsn; int cccr_vsn;
int uhs = ocr & R4_18V_PRESENT;
unsigned char data; unsigned char data;
unsigned char speed; unsigned char speed;
...@@ -149,7 +150,7 @@ static int sdio_read_cccr(struct mmc_card *card) ...@@ -149,7 +150,7 @@ static int sdio_read_cccr(struct mmc_card *card)
card->scr.sda_spec3 = 0; card->scr.sda_spec3 = 0;
card->sw_caps.sd3_bus_mode = 0; card->sw_caps.sd3_bus_mode = 0;
card->sw_caps.sd3_drv_type = 0; card->sw_caps.sd3_drv_type = 0;
if (cccr_vsn >= SDIO_CCCR_REV_3_00) { if (cccr_vsn >= SDIO_CCCR_REV_3_00 && uhs) {
card->scr.sda_spec3 = 1; card->scr.sda_spec3 = 1;
ret = mmc_io_rw_direct(card, 0, 0, ret = mmc_io_rw_direct(card, 0, 0,
SDIO_CCCR_UHS, 0, &data); SDIO_CCCR_UHS, 0, &data);
...@@ -712,7 +713,7 @@ static int mmc_sdio_init_card(struct mmc_host *host, u32 ocr, ...@@ -712,7 +713,7 @@ static int mmc_sdio_init_card(struct mmc_host *host, u32 ocr,
/* /*
* Read the common registers. * Read the common registers.
*/ */
err = sdio_read_cccr(card); err = sdio_read_cccr(card, ocr);
if (err) if (err)
goto remove; goto remove;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment