Writing a driver for a card reader controller - how?

M. Warner Losh imp at bsdimp.com
Fri Nov 25 00:15:57 GMT 2005

In message: <20051124202519.GA84564 at mygiea.ham01.thiemo.net>
            Thiemo Nordenholz <listmember at thiemo.net> writes:
: > how to setup the base address for each of the sets of registers
: > without actually talking about the sets of registers themselves.  Nor
: > can I find in the document a pointer to the different register sets.
: > Do you have one of those as well?  It looks fairly easy to program
: As far as I have understood what I have seen so far, this chip will just
: handle the communication between "the computer" and the SD/MMC (both seem to
: be very similar to access, unfortunately the SD standard is not publicly
: available) card. 

I understand that.  However, there are 8 bytes that are consumed by
the device.  Even if it was just one byte, what are the bit patterns
in it?  Given that it has a DRQ associated with it, one would need to
setup addresses and such for DMA.  The SD/MMC cards are a serial
interface where you give it commands and things happen.  There are
variations on this theme (SD has a nibble mode, while MMC doesn't).

The SD standard is available publicly, it is just really expensive and
comes with significant NDA requirements.  The MMC standard is also
available for a more modest $500 or so (still a little too pricy for
me to buy on my own) and has much less restricive license
restrictions.  There's reduced versions of both standards available,
but they are useless to actually program device with.  They tell you
the basics, but not enough to do anything useful.

: I think once this controller has been programmed to use IRQ, DRQ and
: register base address, what one wants to access are those resources in the
: card itself, which can happen through those resources.

Yes.  things will happen through those resources, but without knowing
the layout of the registers, it would be impossible to actually use

: My plan therefore was to first be able to make those settings and then
: talk to the card as defined in the MMC standard... Finding out if a card is
: in the slot, though, should work first as that's done by the controller.

Do you have a copy of the MMC standard?  Does the MMC standard
actually define a standard host interface?


More information about the freebsd-hackers mailing list