fix-glamo-mci-slow-clock-until-first-bulk.patch
commit749fb079525c64dff23a1969a5be5d2a6a6aeb75
authorAndy Green <andy@openmoko.com>
Mon, 22 Sep 2008 21:38:03 +0000 (22 22:38 +0100)
committerMike Westerhof <mwester@dls.net>
Sun, 28 Sep 2008 04:38:41 +0000 (27 23:38 -0500)
treec4257138abce67111001df9bcbb46fc4e769b20b
parent8be188acf635dbb5b7e5ed42195713a80ced436b
fix-glamo-mci-slow-clock-until-first-bulk.patch

This patch adds another module parameter to glamo-mci which sets the
SD Card clock rate used inbetween powering the card and the completion of
the first bulk transfer.  You can set it from kernel commandline like this.

glamo_mci.sd_post_power_clock=1000000

The period between changing the power state and the first bulk transfer
completion is critical because larger SDHC cards take longer to initialize
before they can service the bulk transfer, and the Glamo MMC unit has a
fixed timeout length of a maximum of 4095 x 16 x SD Card clocks.  Large
cards like 8GB Sandisk SDHC are not ready before this timeout is used up
at default 16MHz.

Subsequently, the card can handle 16MHz SD Clock and timeout durations
okay.

By default this patch operates the SD Clock at only 1MHz until the first
bulk transfer is completed after each powerup action from the MCI stack.  It
also keeps the SD Clock running during this time, and disables the SD Clock
if the card is not present and the MCI stack removes power.

Signed-off-by: Andy Green <andy@openmoko.com>
drivers/mfd/glamo/glamo-mci.c
drivers/mfd/glamo/glamo-mci.h