Nice too see that you're alive Ian ;)
I've been trying to send you some mail regarding your SD implementation but I haven't received any replies. Perhaps they've gotten lost somewhere?
A summary of what I've done (relative your work):
* flags renamed to caps to better reflect what it does.
* SD_4_BITS changed to 4_BIT_DATA. Hopefully 4-bit mode in SD and MMC will be compatible, at least on the driver level.
* HOST_ changed to MMC_ to conform with the rest of the macros.
* Added a function in the driver to test for SD read-only switch.
* Moved SD-specific commands to a separate section in the header so they are more easily distinguished.
* SCR register is read from card and used when determining bus width.
* I've separated SD detection a bit.
* The mode (SD/MMC) of the host is stored. Since MMC uses a bus topology and SD uses a star one it is useful to be able to see which mode the controller is in.
I also couldn't find the reason for the ACMD flags you've added. Application commands only differ in semantics, not format, so I couldn't figure out why these where needed. Perhaps I'm missing something.
as such my code should be 100% safe to commit to the kernel.
My code is based on the SD card specs I've found so it probably isn't as safe.