[PATCH] sdhci: Add support for hosts that are only capable of 1-bit transfers

Anton Vorontsov avorontsov at ru.mvista.com
Thu Jun 18 06:13:29 EST 2009


On Sat, Jun 13, 2009 at 09:40:02AM -0600, Grant Likely wrote:
> On Thu, Jun 11, 2009 at 2:15 PM, Anton
> Vorontsov<avorontsov at ru.mvista.com> wrote:
> > Some hosts (hardware configurations, or particular SD/MMC slots) may
> > not support 4-bit bus. For example, on MPC8569E-MDS boards we can
> > switch between serial (1-bit only) and nibble (4-bit) modes, thought
> > we have to disable more peripherals to work in 4-bit mode.
> >
> > Along with some small core changes, this patch modifies sdhci-of
> > driver, so that now it looks for "mode" property in the device-tree.
> >
> > Signed-off-by: Anton Vorontsov <avorontsov at ru.mvista.com>
> > ---
> >
> > Pierre, I'm not sure if a quirk would be appropriate here. If so,
> > I can redo the patch with FORCE_1_BIT_DATA quirk.
> >
> > Thanks,
> >
> >  Documentation/powerpc/dts-bindings/fsl/esdhc.txt |    2 ++
> >  drivers/mmc/host/sdhci-of.c                      |    7 +++++++
> >  drivers/mmc/host/sdhci-pci.c                     |    1 +
> >  drivers/mmc/host/sdhci.c                         |    2 +-
> >  4 files changed, 11 insertions(+), 1 deletions(-)
> >
> > diff --git a/Documentation/powerpc/dts-bindings/fsl/esdhc.txt b/Documentation/powerpc/dts-bindings/fsl/esdhc.txt
> > index 5093ddf..298b865 100644
> > --- a/Documentation/powerpc/dts-bindings/fsl/esdhc.txt
> > +++ b/Documentation/powerpc/dts-bindings/fsl/esdhc.txt
> > @@ -10,6 +10,8 @@ Required properties:
> >   - interrupts : should contain eSDHC interrupt.
> >   - interrupt-parent : interrupt source phandle.
> >   - clock-frequency : specifies eSDHC base clock frequency.
> > +  - mode : specifies eSDHC mode, valid values are: "1-bit" and "4-bit".
> > +    If mode is unspecified, then 4-bit mode is assumed.
> 
> In light of Pierre's comment that 4-bit is mandatory and this is a
> deviation, perhaps it would be better to define an empty property to
> indicate that only 1-bit transfers work.  Maybe something along the
> lines of "sdhc-1-bit-only"?

Yeah, since it turned up to be a quirk, we'd better use a named
property.

(I think that by convention we should use commas for
controller-specific properties, i.e. "sdhci,property".)


Thanks!

-- 
Anton Vorontsov
email: cbouatmailru at gmail.com
irc://irc.freenode.net/bd2



More information about the devicetree-discuss mailing list