Re: [PATCH v1 1/1] mmc: core: sdio: Set SDIO clock to ONLY SDR50(100MHz) for Marvell 8887 chip

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Friday 23 March 2018 07:08 PM, Shawn Lin wrote:
> On 2018/3/23 16:39, Harish Jenny K N wrote:
>> From: Diwakar Sharma <diwakar.sharma@xxxxxxxxxxxx>
>>
>> This patch adds a quirk to report "SDR50" mode on IMX side
>> even if support of SDR104 was received from Marvell 8887
>> WiFi + Bluetooth chip side, as Marvell does not recommend
>> to use SDIO at the speed of higher than 150MHz >
>> Signed-off-by: Diwakar Sharma <diwakar.sharma@xxxxxxxxxxxx>
>> Signed-off-by: Harish Jenny K N <harish_kandiga@xxxxxxxxxx>
>> ---
>>   drivers/mmc/core/card.h      |  5 +++++
>>   drivers/mmc/core/quirks.h    |  3 +++
>>   drivers/mmc/core/sdio.c      | 23 +++++++++++++++++++++++
>>   include/linux/mmc/card.h     |  2 ++
>>   include/linux/mmc/sdio_ids.h |  1 +
>>   5 files changed, 34 insertions(+)
>>
>> diff --git a/drivers/mmc/core/card.h b/drivers/mmc/core/card.h
>> index 9c821ee..e6c7dad 100644
>> --- a/drivers/mmc/core/card.h
>> +++ b/drivers/mmc/core/card.h
>> @@ -221,4 +221,9 @@ static inline int mmc_card_broken_hpi(const struct mmc_card *c)
>>       return c->quirks & MMC_QUIRK_BROKEN_HPI;
>>   }
>>
>> +static inline int mmc_card_broken_uhs(const struct mmc_card *c)
>> +{
>> +    return c->quirks & MMC_QUIRK_BROKEN_UHS;
>> +}
>> +
>>   #endif
>> diff --git a/drivers/mmc/core/quirks.h b/drivers/mmc/core/quirks.h
>> index 5153577..575b6f7 100644
>> --- a/drivers/mmc/core/quirks.h
>> +++ b/drivers/mmc/core/quirks.h
>> @@ -132,6 +132,9 @@
>>       SDIO_FIXUP(SDIO_VENDOR_ID_MARVELL, SDIO_DEVICE_ID_MARVELL_8797_F0,
>>              add_quirk, MMC_QUIRK_BROKEN_IRQ_POLLING),
>>
>> +    SDIO_FIXUP(SDIO_VENDOR_ID_MARVELL, SDIO_DEVICE_ID_MARVELL_8887WLAN,
>> +           add_quirk, MMC_QUIRK_BROKEN_UHS),
>> +
>>       END_FIXUP
>>   };
>>
>> diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c
>> index c599a62..9ed8b31 100644
>> --- a/drivers/mmc/core/sdio.c
>> +++ b/drivers/mmc/core/sdio.c
>> @@ -566,6 +566,9 @@ static int mmc_sdio_init_card(struct mmc_host *host, u32 ocr,
>>       int retries = 10;
>>       u32 rocr = 0;
>>       u32 ocr_card = ocr;
>> +    int cccr_vsn;
>> +    unsigned char data;
>> +    int uhs;
>>
>>       WARN_ON(!host->claimed);
>>
>> @@ -740,6 +743,26 @@ static int mmc_sdio_init_card(struct mmc_host *host, u32 ocr,
>>       card->ocr = ocr_card;
>>       mmc_fixup_device(card, sdio_fixup_methods);
>>
>> +    uhs = ocr & R4_18V_PRESENT;
>> +    err = mmc_io_rw_direct(card, 0, 0, SDIO_CCCR_CCCR, 0, &data);
>> +    if (err)
>> +        goto remove;
>> +
>> +    cccr_vsn = data & 0x0f;
>> +    if (cccr_vsn >= SDIO_CCCR_REV_3_00 && uhs) {
>> +        if (mmc_host_uhs(card->host) && mmc_card_broken_uhs(card)) {
>> +            /*
>> +             * The MMC device reports a non-working
>> +             * maximum clock rate, workaround is to
>> +             * force the MMC host controller to report
>> +             * a lower clock rate than supported.
>> +             */
>> +            card->sw_caps.sd3_bus_mode &= ~SD_MODE_UHS_DDR50;
>> +            card->sw_caps.sd3_bus_mode &= ~SD_MODE_UHS_SDR104;
>> +            card->sw_caps.sd3_bus_mode |= SD_MODE_UHS_SDR50;
>
>
> so SDR50 isn't UHS mode? Could you just remove the sd-uhs-sdr104,sd-
> uhs-ddr50 from your host's cap if using this wifi? Or set max-frequency
> to 150M with sd-uhs-sdr104 mode?


Changing host caps does not seem to be correct way ( the host->caps represent the capabilities of the actual host controller used by the card. This shouldn't be changing around IMHO. Please correct me if I am wrong.)
I will send v2 patch by reducing the max-frequency to 150MHz in SDR104 Mode.



Thanks,
Harish Jenny K N
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux