MMC/SDIO stack under CAM

Ilya Bakulin ilya at bakulin.de
Sun Feb 16 11:11:55 UTC 2014


Hi list,
so I still want to move SDIO stack integration forward.
As was already discussed, the best thing to do would be to
have MMC stack under CAM.
I have tried to understand how the CAM works for the existing drivers.

Below is the structure for USB sticks:

+-----------------------+
|Kernel (disk interface)|
+-----------------------+
	 |
	BIO
	 |
+-------------------+
|da (storage driver)|
+-------------------+
	 |
	CCB
	 |
+------------------------+
|CAM Layer sys/cam/scsi/*|
+------------------------+
	 |
	CCB
	 |
+------------------+
|umass (HBA == SIM)|
+------------------+
	 |
	usbd_*
	 |
+--------------------------+
|USB stack (and controller)|
+--------------------------+

So da(4) doesn't know anything about USB.
At this point I thought, that in this case da(4)
will happily communicate with MMC/SD cards, if we provide
a SIM for MMC! So the structure for MMC would be like this:

+-----------------------+
|Kernel (disk interface)|
+-----------------------+
	 |
	BIO
	 |
+-------------------+
|da (storage driver)|
+-------------------+
	 |
	CCB
	 |
+------------------------+
|CAM Layer (sys/cam/mmc/*|
+------------------------+
	 |
	CCB
	 |
+-------------------+
|mmc_cam (HBA == SIM|
+-------------------+
	 |
SD/MMC protocol (struct mmc_request)
	 |
+-------------------------------------------+
| MMC ctrlr driver (sdhci_ti, ..., mmcnull) |
+-------------------------------------------+
	 |
	 |
+------------------+
| MMC/SD/SDIO Card |
+------------------+

(the mmcnull driver is the pseudo-driver that I'm writing
to make it possible to develop and test the whole thing
on the VM).

So MMC SIM and MMC controller driver would exchange mmc_requests,
as it was before, with the exception that command completion will be
reported differently (to utilize async callbacks system of CAM).

For SDIO card, the situation will be different. Essentially,
we should allow a device driver to send arbitrary messages to the card.
So the device driver will attach directly to the scbus.

Please let me know your thoughts about it.
I really want SDIO make its way into the kernel, because there
is an increasing number of ARM boards on the market that have integrated
SDIO WLAN on them and we cannot support them fully.

--
Ilya
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-arm/attachments/20140216/3675533c/attachment.sig>


More information about the freebsd-arm mailing list