Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 24 Nov 2005 17:15:18 -0700 (MST)
From:      "M. Warner Losh" <imp@bsdimp.com>
To:        listmember@thiemo.net
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: Writing a driver for a card reader controller - how?
Message-ID:  <20051124.171518.102581285.imp@bsdimp.com>
In-Reply-To: <20051124202519.GA84564@mygiea.ham01.thiemo.net>
References:  <20051124111241.GB75190@mygiea.ham01.thiemo.net> <20051124.112632.65222526.imp@bsdimp.com> <20051124202519.GA84564@mygiea.ham01.thiemo.net>

next in thread | previous in thread | raw e-mail | index | archive | help
In message: <20051124202519.GA84564@mygiea.ham01.thiemo.net>
            Thiemo Nordenholz <listmember@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
them.

: 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?

Warner



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20051124.171518.102581285.imp>