SDHCI Device Driver (first steps)

Warner Losh imp at bsdimp.com
Tue Sep 19 07:51:48 PDT 2006


From: Marian Asokarajan <mail at sashi.de>
Subject: Re: SDHCI Device Driver (first steps)
Date: Tue, 19 Sep 2006 15:54:58 +0200

> M. Warner Losh wrote:
> > : : * NOTE: The driver is experimental and might crash your system!
> > 
> > It crashes mine.  I did tweak it a little to make it reconize the host
> oops. Seems chip 0x8033 doesn't follow specs definied by sdcard.org ?!
> I got the TI 0x803C by reading out driver details from a windows machine
> (HP Laptop) in a shopping mall :)

It does follow the specs, as far as I can tell.  It crahsed when I
tried to fdisk the device that was created...

> > What's the current level?  I didn't get it to see insert/remove from
> > my slot:
> What do you mean by "current level" ?

What's expected to work?

> > There's tests for slots that aren't quite right.  It and's with 0x70,
> > but tests to see > 5, which it always will be if any of the bits are
> > set.
> Oops, huge bad mistake :( . Thanks for pointing that out.
> I forgot the prefix "0x". the line now says:
> if (sc->firstBARat>0x05 || sc->slots>0x50) ...

Shouldn't slots be shifted instead?

> > The code should use more of the higher level interfaces in
> > FreeBSD for accessing the pci bus.
> Could you please give me hint on that ? I thought bus_space_* is already
> an abstraction of the PCI bus (guess, I realy have to walk through the
> pccard sources).

pci_get_vendorid() is what I had in mind.

> > The code should stive to be more style(9) compliant.  Its style is so
> > different from the usual as to be difficult to read.
> I printed out the man pages and had it as my bedtime lecture ;)
> The code has been now "styled" a bit. I'll later setup a web page
> with current codefile. for now the code is available at:
> http://www.sashi.de/downloads/freebsd/sdhci/sdhcidd-current.tbz

I'll take another look.  Thanks!

Warner


More information about the freebsd-drivers mailing list