Re: [PATCH v1] mmc: sdhci-of-esdhc: Workaround for reducing the maximum speed on ls1021atwr

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

 



On 22 December 2017 at 09:13, Y.b. Lu <yangbo.lu@xxxxxxx> wrote:
> Hi Uffe,
>
>
>> -----Original Message-----
>> From: Ulf Hansson [mailto:ulf.hansson@xxxxxxxxxx]
>> Sent: 2017年11月16日 15:34
>> To: Yinbo Zhu <yinbo.zhu@xxxxxxx>
>> Cc: Adrian Hunter <adrian.hunter@xxxxxxxxx>; Y.b. Lu <yangbo.lu@xxxxxxx>;
>> linux-mmc@xxxxxxxxxxxxxxx
>> Subject: Re: [PATCH v1] mmc: sdhci-of-esdhc: Workaround for reducing the
>> maximum speed on ls1021atwr
>>
>> On 15 November 2017 at 10:01,  <yinbo.zhu@xxxxxxx> wrote:
>> > From: "yinbo.zhu" <yinbo.zhu@xxxxxxx>
>> >
>> > In SDHC high speed AC timing, the tshivkh parameter is defined as
>> > input setup times:SDHC_CMD, SDHC_DATx, to SDHC_CLK. The value of the
>> > tshivkh should be 2.5 ns considering the round trip delay, board/data
>> > skew.
>> > However, because of this erratum, it needs at least 4.1 ns.
>> >
>> > eSDHC cannot run at the maximum clock speed for the high speed mode,
>> > or there is a limit on the length of the trace on the board for data,
>> > command, and clock lines of the SDHC.
>> >
>> > Signed-off-by: yinbo.zhu <yinbo.zhu@xxxxxxx>
>> > ---
>> >  drivers/mmc/host/sdhci-of-esdhc.c | 6 ++++++
>> >  1 file changed, 6 insertions(+)
>> >
>> > diff --git a/drivers/mmc/host/sdhci-of-esdhc.c
>> > b/drivers/mmc/host/sdhci-of-esdhc.c
>> > index 023c24bd0d94..2744dd58a573 100644
>> > --- a/drivers/mmc/host/sdhci-of-esdhc.c
>> > +++ b/drivers/mmc/host/sdhci-of-esdhc.c
>> > @@ -498,6 +498,12 @@ static void esdhc_of_set_clock(struct sdhci_host
>> *host, unsigned int clock)
>> >                         clock -= 5000000;
>> >         }
>> >
>> > +       /* Workaround to reduce the clock frequency for ls1021a esdhc */
>> > +       if (of_find_compatible_node(NULL, NULL, "fsl,ls1021a-esdhc"))
>> > + {
>>
>> It's better to use the ->data pointer in the struct of_device_id for this kind of
>> variant data.
>>
>> In ->probe() you then call of_match_device() and pick up the ->data pointer
>> and assign it to your driver private data.
>>
>> Many drivers already do like this. Have a look at dw_mmc-exynos.c for
>> example.
>>
>
> [Y.b. Lu] How about using soc_device_match()? There is also .data member could be used in soc_device_attribute structure.
> Use soc_device_match() in esdhc_init and get .data information into sdhci_esdhc structure which is private data.
> Current incorrect host version register value fix-up for some platforms is using this method.

I think you need to answer the question: is the problem SoC specific
or device-variant specific. Depending on the answer, you should pick
the correct solution.

[...]

Kind regards
Uffe
--
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