Wednesday, June 30, 2010

U-Boot: PXA SDHC support

Today, it'll be just a quick entry about a recent achievement in the U-Boot land. I was reported by some people from the Zipit Z2 project that U-Boot doesn't detect their SDHC cards. That was really troublesome and so was the state of the pxa_mmc driver in U-Boot.

Actually, pxa_mmc was probably the last SD/MMC driver in U-Boot that used the old driver interface there. I decided it needs a rewrite. I based the new code on the Linux version of pxa_mmc driver. The resulting pxa_mmc_gen.c now uses the generic SD/MMC framework in U-Boot and the code is much more cleaner. It also supports SDHC well. And one more benefit is that the timing issues that were observed with the old driver are gone now.

The code wasn't merged mainline yet and is currently held as a separate driver to make the transition from the old driver to the new one as smooth as possible. Also, I'd like the driver to get some testing before some other boards are converted to use it.

The code is currently available in the u-boot-pxa.git -devel branch. Also, it was submitted to the u-boot mailing list. To enable the new driver, you'll have to replace
#define CONFIG_PXA_MMC
with
#define CONFIG_GENERIC_MMC
#define CONFIG_PXA_MMC_GENERIC

And recompile the U-Boot.

To use the new driver, you can use commands like:
$ mmcinfo
$ fatls mmc 0

etc. Note, that the "mmcinfo" command is new and the old "mmc" command class is gone. So no "mmc init" anymore.

1 comment:

Anonymous said...

Hi! Great news although as i'm new to Zipit, i'm outdated here so seen this post recently. How the progress? Did anybody commited this piece of code (supporting of SDHC) to main branch already? Do you have Zipit Z2 device personally?

Did you get any reports? I'm highgly interesting in using highest acceptable SDHC 2.0 cards of 32GB. Is it possible to use them with full capacity possible to use?
Which exactly? Only high capacity miniSD cards or microSD via miniSD adapters will work too?

Anyway any reports or thoughts about cards upper than 8GB in Zipit Z2 are very interesting to me.

Thank you.