MMC power-up handling

Harald Welte laforge at
Mon Apr 23 21:07:54 CEST 2007

On Wed, Apr 18, 2007 at 08:57:00PM -0300, Werner Almesberger wrote:
> Hi Harald,
> when I saw your change for Bv4 SD/MMC power-up, I thought that we should
> also check for a card on mmc_init, so that cards inserted after booting
> will be powered. (Of course, doing that with our hardware requires a bit
> of acrobatics :-)


> In SVN trunk/src/target/u-boot/patches/mmcinit-power-up.patch
please just add it to the generic mmc core patch.    we have svn for
maintaining revisions...

> BTW, do you know if the use of the "weak" attribute is acceptable coding
> style for u-boot ? If not, I'd have to use yet another #ifdef :-(

Mh, I don't know if it's acceptable. Haven't seen it and would rather
want to avoid it.

You can do it without #ifdef, with either

1) a callback hook (*mmc_power_up()(int on);
2) a #define MMC_POWER_UP_FN mmc_power_up() which can be defined to
   'do { } while (0)' in the case the machine/board config does not
   define it otherwise.

- Harald Welte <laforge at>         
Software for the world's first truly open Free Software mobile phone

More information about the openmoko-uboot mailing list