SDHCI Device Driver (first steps)

M. Warner Losh imp at bsdimp.com
Mon Sep 18 09:59:52 PDT 2006


In message: <20060918.083758.63053354.imp at bsdimp.com>
            "M. Warner Losh" <imp at bsdimp.com> writes:
: In message: <450E571A.8030200 at sashi.de>
:             Marian Asokarajan <mail at sashi.de> writes:
: : Hello,
: : 
: : I'm trying to write an universal SD Host-Controller Device Driver,
: : which I'd like to contribute to the FreeBSD community.
: : So far the driver is able to recognize SD card insertion and removal.
: : Via a device node (/dev/sdhci0), it's also possible to dump
: : the SDHC's register set.
: : 
: : Could someone please help testing the code ?
: : The kernel module and sources can be download here:
: : http://www.sashi.de/downloads/freebsd/sdhci/sdhcidd-0.0.1.tbz
: : * 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
controller generically (there's little chance we'd keep up with all
the bridges anyway).

What's the current level?  I didn't get it to see insert/remove from
my slot:

none6 at pci6:4:3: class=0x018000 card=0x30a4103c chip=0x8033104c rev=0x00 hdr=0x00
    vendor   = 'Texas Instruments (TI)'
    device   = 'PCIxx21 Integrated FlashMedia Controller'
    class    = mass storage

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.

The code should use more of the higher level interfaces in
FreeBSD for accessing the pci bus.

The code should stive to be more style(9) compliant.  Its style is so
different from the usual as to be difficult to read.

Warner

: : I'm developing it on an ASUS laptop with a RICOH chipset and
: : it's the only chipset (beside Texas Instruments) supported.
: : Therefore, it would be great to receive a "pciconf -lv" block
: : of other SD host controllers.
: : 
: : Thanks for your help.
: 
: I'll be happy to do so.
: 
: I too am working on the SD/MMC card stack.  I have one boot loader for
: the AT91RM9200 working, and have been hacking on a quick and dirty
: driver for that part, but it needs to have the transport layer
: separated out from the MMC/SD protocol goo.  Maybe we can work
: together to produce something that fits both our needs?


More information about the freebsd-drivers mailing list