Skip to content

Updated SDHC/MMC4 enabled kernel for the n800

Since my last post with my updated n800 kernel, I’ve spent some time looking at a troublesome MMC card – it’s a Transcend 4GB MMCplus card. It’s one of these technically out-of-spec byte-addressed 4GB cards, but in theory it should work just fine. I was alerted about the card by Frantisek Dufka who bought one and has had a lot of trouble with it in the n800, so I picked one up to take a look at what was going on. Now, unfortunately, I was unable to replicate Frantisek’s problem which remains unsolved, but I did see another problem – where the card would almost always freak out when switched into highspeed mode – yet the card worked just fine in highspeed mode in laptop’s SDHCI reader.

At around the same time I was looking at this, Pierre Ossman was doing some investigating of his own and concluded that it was not safe to assume that all controllers can handle the MMC and SD highspeed timings. These are close to the legacy timings, and to each other, but all three are slightly different. Accordingly, he made a change upstream to add explicit capability flags for highspeed support and to default that support to off. I took this patch and applied it to my n800 kernel, and then being the foolhardy guy I am, marked the omap reader as highspeed capable. I did this becaue I knew that my other highspeed cards work fine, but I did not expect it to make the Transcend card work – yet it did!

The only change that Pierre made that could cause this was that he updated the host controller with the current card flags after toggling the highspeed mode. I believe that this update, which is technically gratuitous as the controller state is already correct, introduces a delay that smooths over whatever was confusing the card originally. Now, I can consistently use the Transcend card.

An additional thing I investigated was why my dual-voltage MMCmobile cards were not running at 1.8V even though the omap controller claimed to support low voltage operations. When I looked into this, I saw that the MMC subsystem was interpreting the voltage flags incorrectly, apparently due to being based on an inaccurate spec that originated from Sandisk. This caused the code to interpret the actual low voltage support bit as a higher voltage and a set of reserved bits as indicating low voltage support. Once I fixed this, low voltage cards were able to run at 1.8V in the n800. This is nice because low voltage operations means lower power consumption and longer battery life. The only catch is that when I tried out the 64MB RS-MMC card that originally came with the Nokia 770, the card freaked out despite claiming to support low voltage operations; it would work fine at 2.0V or higher. Very strange.

Anyway, I’ve built a new kernel binary with all of these patches applied and it is available here. If you’re feeling cautious about my highspeed or low voltage patches, you can build your own kernel and exclude the patches you don’t want – but it would be great if you could try the full kernel out and report any problems you observe.

Update: So, I didn’t explain how to interpret the debug output, and that would probably be a good thing to do:

  • clock: The clockspeed the card is being run at.
    • MMC: 20Mhz
    • SD: 25Mhz
    • Highspeed MMC: 26Mhz or 52Mhz (clamped to 48MHz by the controller)
    • Highspeed SD: 50Mhz (also clamped to 48MHz
  • vdd: The selected voltage. There’s a long list but in practice, you’ll only see three values used.
    • 16: 3.0V in the internal slot
    • 15: 2.8V in the external slot
    • 7: Low-voltage. 1.85V in the internal slot and 1.8V in the external slot

    Yes, that means that the two slots actually run at different voltages. The external slot supports a wider range of voltages but as the lowest possible is always chosen, you won’t see them used.

  • width: The width of the data bus
    • 0: 1 bit
    • 2: 4 bits
  • timing: The timing mode. You can deduce this from the card type and the printed clockspeed, so this isn’t very profound.
    • 0: Lowspeed (same for MMC and SD)
    • 1: MMC highspeed
    • 2: SD highspeed

{ 16 } Comments

  1. Milhouse | 11th March 2007 at 12:10 | Permalink

    Hi Phil

    The following messages were output to dmesg when mounting 5 different SDHC/RSMMC/MiniSD cards:

    1. Internal Slot, 8GB SDHC Transcend Class 2 – clocked at 48000000Hz

    2. External Slot, 4GB SDHC Transcend Class 2 – clocked at 48000000Hz

    3. External Slot, 4GB SDHC SanDisk Class 2 – clock yo-yo’s around using different speeds before settling on 25000000Hz

    4. External Slot, 1GB RS-MMC SanDisk – clocked at 20000000Hz

    5. External Slot, 128MB Mini-SD Nokia (as supplied with N800) – clocked at 25000000Hz

    Can you briefly explain what the different busmode, powermode, width, timing values mean? Judging by clock speed alone, of the 3 SDHC cards it looks like Transcend trumps SanDisk. However other factors such as timing (o on SanDisk, 2 on Transcend) may also have an important part to play in terms of performance.

    Thanks for all your efforts producing these patches and kernels! :)

  2. Philip Langdale | 11th March 2007 at 13:07 | Permalink

    I’ve updated the entry to describe the important fields in the debug output. The values you are seeing are what I would expect to see for these sorts of cards.

    Interestingly, I have a sandisk microSD card that exhibits the same problem as yours does – it seems to claim highspeed support and then fails to switch into the highspeed mode.

    I’m glad your finding these patches useful.

  3. Josh | 13th March 2007 at 16:46 | Permalink

    I just posted this at itt, and it was suggested that I tell you about it:

    Do mmc cards just die? I think mine did today. I am not able to format it. My external card reader won’t even register it.

    This happened one day after I installed the updated SDHC kernel, with a few reboots. I’m not saying that it did it – just letting people know what things had changed recently. Nothing else had changed.

    So – do they just die – or could the SDHC kernel have anything to do with it?

  4. Philip Langdale | 13th March 2007 at 18:12 | Permalink

    Well, card’s can certainly die, but nothing in these patches should be able to kill a card. What is the card in question? The only thing that affects anything remotely related is the low voltage support which means that cards that claim to support low voltage operations will actually run at the lower voltage where they previously didn’t. As I described, this did freak one bad card out but it still worked fine at higher voltages after that.

  5. Josh | 14th March 2007 at 08:53 | Permalink

    It was a SanDisk RS-MMC 1.0GB. I am guessing it had something wrong with it to begin with. I wonder if SanDisk would replace it… HA! I ordered an 8GB SDHC card yesterday, so I thank you for your work with getting them to operate in the n800! Cheers.

  6. Dave | 23rd March 2007 at 14:05 | Permalink

    Hi. Any chance that you could create one of your kernels for firmware release OS 2007 edition v. 3.2007.10-7 ?.
    Nokia have not included SDHC support in the latest release.

  7. Philip Langdale | 23rd March 2007 at 18:24 | Permalink

    There’s currently no source update to go along with this release, so we don’t know what, if anything, changed in the kernel. If nothing changed, then my existing kernels can just be reinstalled after you upgrade the firmware.

  8. Milhouse | 24th March 2007 at 20:00 | Permalink

    Kernel sources should become available sometime next week (w/c Mon 26 March)

  9. HOPE | 26th March 2007 at 08:52 | Permalink

    Hi,Wubble,I am a newbie.
    would you please tell me how to build the file sdhc-kernel.bin into N800?
    Thank you.

  10. Philip Langdale | 26th March 2007 at 22:19 | Permalink

    See my first post for the link to the guide on how to build and install kernels.

  11. Eric | 30th March 2007 at 01:46 | Permalink

    Philip, any news about how works the SDHC-patched kernel with the updated v3.2007.10-7 OS ? Is it compatible or what ?

    Milhouse : you told that source should come to the community on march, 26th … Is it out ? Where can we check it ?

  12. Gregg | 30th March 2007 at 06:30 | Permalink

    Being a new owner of an N800 and absorbing as much of the talk on internettablettalk as possible, I want to take the plunge with the new firmware, but am willing to wait until an updated firmware that can support my new 8GB SDHC card is available. would this blog be the place where this would be first announced when it is ready?

  13. Philip Langdale | 30th March 2007 at 07:22 | Permalink

    There’s still no sign of the 3.2007.10 source so I still can’t build a new kernel. I’ll certainly do it when it appears.

    Gregg, yes, I’ll certainly post a new entry when that’s done.

  14. Zoran | 30th March 2007 at 11:21 | Permalink

    Well, the source code seems to be out, I’m going to check your blog quite frequently during this weekend, Philip, hoping you’ll find some time to build the SDHC support for all of us who have a currently useless piece of plastic in SD-slots. Thank you indeed for your efforts!

  15. Gregg | 2nd April 2007 at 09:44 | Permalink

    Just wanted to point out the reply at:
    which states:
    “The patches from

    applied fine to the new kernel sources, so I went ahead and built a
    SDHC kernel with otherwise default config.


    verify with md5sum:” … and continues

    Having just come across the article, I have not tried it, but thought it might be of some use here, since the patches applied came from here…

  16. Philip Langdale | 2nd April 2007 at 12:44 | Permalink

    Indeed. I’ve also rebuild the kernel with those patches as described in my latest post.

Post a Comment

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