SDIO for FreeBSD: CAM integration
Ilya Bakulin
ilya at bakulin.de
Thu Oct 10 21:04:04 UTC 2013
On 09.10.13 00:57, Alexander Motin wrote:
> CAM has mechanism of asynchronous notifications, that is quite alike to
> interupts.
That's good to know!
So, after reading a bit more about CAM I have some kind of design proposal.
In CAM world, we have peripheral modules (da, cd, pt, ses) and software
interface modules, SIMs (USB, ATA, ATAPI, Firewire).
The current implementation of MMC stack has three layers:
1. mmcsd(4) driver, later also SDIO device drivers {mv_sdiowl, ar6xxx,...}
2. mmc(4) stack
3. SD controller {sdhci(4), mvsdio, ti_mmc,...}
As far as I understand, it makes sense to convert the mmcsd driver to
"peripheral module" and mmc stack will be then SIM.
The relation of mmc stack and SD controller is then... well,
essentially, those are just two parts of the SIM.
They will still find each other using the NewBus.
We can then drop that msleep() in MMC stack waiting for the SD
controller to signal the completion of our request and just return,
setting CAM_REQ_INPROG status in the CCB.
When the controller receives an interrupt, its ISR calls into the MMC
stack directly, the MMC stack then calls xpt_done() and the CCB is
returned to the peripheral driver.
In the SDIO case, when there is no active CCB, the MMC stack issues an
asynchronous notification.
So, based on this proposal, the first thing I will do is adding a CAM
layer between mmcsd(4) and mmc(4) so this will still work as before :-)
Does this all make sense to you?
--
Regards,
Ilya Bakulin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 243 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freebsd.org/pipermail/freebsd-embedded/attachments/20131010/e9614d1e/attachment.sig>
More information about the freebsd-embedded
mailing list