Skip to content

Performs best when used with Linux

When it comes to hardware support, we often find ourselves confronted with statements that such-and-such a piece of hardware can’t be used to its full capability under linux or feature ‘X’ isn’t supported yet. For a long time, the SD card reader in many recent laptops fell into that category but thanks to the efforts of Pierre Ossman, who managed to reverse engineer the SDHCI standard from trial-and-error and partial documentation, many of us are now able to use that reader. Although I can’t prove it, I feel that the subsequent publishing of the ‘simplified’ spec (without the DRM bits that we don’t care about) by the SD Association was provoked by his efforts (Why bother hiding it now?) Thanks to those specs, Pierre was able to polish the driver up even more and support a wider range of implementations (of course, there are some that are so out there that even having the SDHCI spec isn’t enough to get them working).

Now, one of the interesting things to fallout of Pierre’s work was that you could use MMC cards in these readers. SD is a fork of MMC and due to the nature of how the hardware works, it is essentially impossible to build a reader that can read SD but not read MMC (the key differences are at the protocol level). So, you ask, why doesn’t the windows driver support MMC cards in the drive? and why can’t my laptop’s BIOS boot from an MMC card in the drive? Well, I can’t speak for their exact motivations but the unquestionable part is that it requires *effort* to not support MMC. The conspiracy theorist may observe that both Microsoft and my laptop’s manufacturer (Toshiba) are both SD backers.

So, if you want to get the most out of your SDHCI reader, you’ve better be running Linux.

And to reinforce that point even further, my changes to support mmc 4.0/4.1 cards were accepted into the Linux kernel and will be present in 2.6.20. w00t! Thanks again to Pierre, wearing his hat as the new MMC subsystem maintainer. So now, not only will that same old SDHCI reader support MMC cards in Linux, it’ll be able to read and write to mmc 4 cards as fast as the hardware allows. And that’s pretty fast. On my laptop it’s a 4-fold increase. If we ever see an 8-bit wide SDHCI 2.0 controller, we’ll be able to make that even faster.

My next goal, and Pierre might beat me to it, is to add support for the new high capacity MMC and SD cards. The original standard uses byte-level addressing, which limits addressable capacity to 4GB – the new revisions (SD 2.0 and MMC 4.2) use block level addressing to access 2TB. Interestingly, the first generation of block addressable cards are 4GB in size – which seems slightly pointless as it introduces incompatibility without gaining anything. Anyway.

The SD literature on these cards (branded SDHC for SD High Capacity) says that they are not compatible with existing readers. While this is true for any reader with a fixed firmware (like most USB readers) and almost certainly true for poor Windows users, it will not stay true for Linux users with SDHCI or other direct-connected controllers – once we get support into the MMC subsystem, you’ll be able to stick these new cards into your existing reader and use them just as well as the old ones.

So, while there are times when using Linux means missing out on some capabilities of your hardware, there are others when it’s the only way to use it to its full potential. Now that’s pretty cool.

{ 4 } Comments

  1. Eitan | 8th December 2006 at 20:07 | Permalink

    Very cool,
    Thank you very much.

  2. nolan | 9th December 2006 at 19:19 | Permalink

    Congrats on getting your changes in!

    I’d imagine shipping a byte addressable 4GB card is a support disaster. Given the number of different reader firmwares (and host drivers) and given how many C programmers can’t seem to understand the difference between signed and unsigned ints.

    Presumably the early shippers of 4GB cards were more willing to deal with the returns due to busted readers given what an absurd premium you can get away with on the top-capacity anything. Newer ones are content to simply require a SDHC branded reader.

    And memory card compatibility continues to be a complete nightmare. Kudos for making it slightly less so for Linux users.

  3. Sandeep K | 28th December 2007 at 02:14 | Permalink

    This means current linux kernel supports SD/MMC cards with the size upto 4 GB.

    am I correct ???

  4. Philip Langdale | 28th December 2007 at 03:26 | Permalink

    They support 4GB and greater. The current spec defines up to 32GB cards but the implementation can scale up to the FAT32 filesystem limit

Post a Comment

Your email is never published nor shared. Required fields are marked *