Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 16 Feb 2014 12:11:53 +0100
From:      Ilya Bakulin <ilya@bakulin.de>
To:        Adrian Chadd <adrian.chadd@gmail.com>, Alexander Motin <mav@freebsd.org>, Warner Losh <imp@bsdimp.com>
Cc:        freebsd-hackers@freebsd.org, freebsd-arm@freebsd.org
Subject:   MMC/SDIO stack under CAM
Message-ID:  <20140216111153.GA74858@olymp.kibab.com>

next in thread | raw e-mail | index | archive | help

--VbJkn9YxBvnuCH5J
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

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

--VbJkn9YxBvnuCH5J
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.15 (FreeBSD)

iEYEARECAAYFAlMAnPcACgkQo9vlj1oadwhvqQCdHvVy3fWYl6m49MBpKpDfk2XG
i/UAn1LsZym1H2QokRa3V9KowxHqgqrK
=rC+Z
-----END PGP SIGNATURE-----

--VbJkn9YxBvnuCH5J--



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