[U-Boot] [PATCH] sunxi: mmc: Fix clk-delay settings

Ian Campbell ijc+uboot at hellion.org.uk
Thu Sep 24 15:56:54 CEST 2015


On Thu, 2015-09-24 at 13:59 +0200, Hans de Goede wrote:
> Hi,
> 
> On 24-09-15 12:29, Ian Campbell wrote:
> > On Thu, 2015-09-24 at 12:01 +0200, Hans de Goede wrote:
> > > Hi,
> > > 
> > > On 24-09-15 11:40, Ian Campbell wrote:
> > > > On Wed, 2015-09-23 at 21:59 +0200, Hans de Goede wrote:
> > > > > In recent allwinner kernel sources the mmc clk-delay settings
> > > > > have
> > > > > been
> > > > > slightly tweaked, and for sun9i they are completely different
> > > > > then
> > > > > what
> > > > > we are using.
> > > > > 
> > > > > This commit brings us in sync with what allwinner does, fixing
> > > > > problems
> > > > > accessing sdcards on some A33 devices (and likely others).
> > > > > 
> > > > > For pre sun9i hardware this makes the following changes:
> > > > > -At 400Khz change the sample delay from 7 to 0 (first introduced
> > > > > in
> > > > > A31 sdk)
> > > > 
> > > > This one applied to sun9i as well as pre I think?
> > > > 
> > > > > -At 50 Mhz change the sample delay from 5 to 4 (first introduced
> > > > > in
> > > > > A23 sdk)
> > > > 
> > > > By my reading it also changes oclk from 2 to 1 on <sun9i @ >50MHz.
> > > 
> > > Right, I did not list that as we never do > 50MHz,
> > 
> > But the being changed here does handle that (the else hz > 50000000
> > case)
> > and that is changing even if we somehow coincidentally arrange that
> > this
> > code is never used today I think it is worth mentioning so that if it
> > does
> > become used we have the history of when/why it was changed.
> 
> Ok, I'll amend the commit message.

Thanks.

> > >   later on in the code
> > > we've:
> > > 
> > > 	cfg->f_max = 52000000;
> > > 
> > > And that 52 is somewhat symbolically there, it is meant for 52MHz
> > > sdio
> > > where as mmc / sdcards run at 50MHz max.
> > 
> > Are these timings used for sdio as well then? That seems worth noting.
> 
> Yes, but we never use sdio in u-boot, more in general mmc/sdio is
> usually used referred to as just mmc (see e.g. the subsystem name, etc.).

Right, which makes it all the more likely that one day this code might be
used for sdio too I think.

Ian.


More information about the U-Boot mailing list