aboutsummaryrefslogtreecommitdiff
path: root/drivers/mfd/glamo/glamo-mci.c
AgeCommit message (Collapse)Author
2008-12-01fix-err-strength-debug-msg.patchAndy Green
Now Qi is changed to default to loglevel 4 where it will show KERN_ERR on LCM, we need to reduce the debugging KERN_ERR traffic so as not to obscure the real things. Signed-off-by: Andy Green <andy@openmoko.com>
2008-11-20glamo_mci_use_regulator_api.patchBalaji Rao
Changes the glamo-mci driver to use the regulator API.
2008-11-19cleanup-after-adding-andy-tracking-patchset.patchAndy Green
Signed-off-by: Andy Green <andy@openmoko.com>
2008-11-19fix-glamo-mci-ignore-command-properly.patchAndy Green
Signed-off-by: Andy Green <andy@openmoko.com>
2008-11-19fix-rebase-dust.patchAndy Green
Last rebase to stable-2.6.26 left some trash from rebasing the patches on top of this, clean it back out Signed-off-by: Andy Green <andy@openmoko.com>
2008-11-19debug-resume-hang.patchAndy Green
Weeks of frantic effort to control Glamo, traced the issue to two outcomes: nWAIT is forced down and the device is hard locked, or we survive immediate Glamo resume and die again with nWAIT forced down when the framebuffer driver tries to flash the soft cursor. Signed-off-by: Andy Green <andy@openmoko.com>
2008-11-19fix-remove-resume-dependencies-on-pmu-for-pmu-children.patchAndy Green
All that stuff should be enforced by device tree now, out with it Signed-off-by: Andy Green <andy@openmoko.com>
2008-11-19fix-glamo-mci-no-need-for-suspend-fake-command.patchAndy Green
Signed-off-by: Andy Green <andy@openmoko.com>
2008-11-19change-glamo-mci-try-memcpy.patchAndy Green
Trial to see if (mainly 32-bit) memcpy is any better than u16 loop Signed-off-by: Andy Green <andy@openmoko.com>
2008-11-19fix-glamofb-remove-soft-delays.patchAndy Green
The delay versions of the access to registers were based on a misunderstanding of the Glamo docs: it can force nWAIT differently depending on the access type. Therefore we don't need to take special care about delays on CPU side. Signed-off-by: Andy Green <andy@openmoko.com>
2008-11-19Fixing trivial warningsNelson Castillo
The function glamo_mci_reset is not being used. Let's comment it out. Signed-off-by: Nelson Castillo <nelsoneci@gmail.com>
2008-11-19revert-fix-build-with-no-config_mmc-glamo-resume-callback-part.patchAndy Green
Thomas White noticed that the recent patch from Andrzej cleaning up a nasty cast in the resume_dependency stuff for Glamo broke resume. The problem was that the wrong resume callback was arrived at by the new code, the one in the device's device_driver struct rather than the struct platform_driver that actually holds the right pointer. Since this code will be gone in 2.6.26, I reverted this part of Andrzej's patch, tidying the cast a bit anyway. Reported-by: Thomas White <taw27@cam.ac.uk> Signed-off-by: Andy Green <andy@openmoko.com>
2008-11-19fix-build-with-no-CONFIG_MMCAndrzej Zaborowski
I hit this when updating to 2.6.26. Also if CONFIG_MMC is enabled this patch converts this horrible horrible hack into a horrible hack by using dev->resume() (untested). Signed-off-by: Andrzej Zaborowski <balrog@zabor.org>
2008-11-19fix-glamo-mci-slow-clock-until-first-bulk.patchAndy Green
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>
2008-11-19fix-glamo-idleclock-around-suspend.patchAndy Green
Possible implementation of SD Card corruption workaround reported here https://docs.openmoko.org/trac/ticket/1802#comment:5 Signed-off-by: Andy Green <andy@openmoko.com>
2008-11-19tracking-2.6.27-mmc-ultiwrite-gone.patchAndy Green
Signed-off-by: Andy Green <andy@openmoko.com>
2008-11-19add-glamo-mci-slower-clocking-dynamic-switching.patchAndy Green
This patch gives glamo-mci a concept of a platform-defined dynamic clock slowing callback. It means that platform code can associate some completely external state to decide if we run the SD clock at normal rate or a rate divided by a module parameter "sd_slow_ratio", which you can set on kernel commandline like this: glamo_mci.sd_slow_ratio=8 you can also change it at runtime by echo 8 > /sys/module/glamo_mci/parameters/sd_slow_ratio If no platform callback is defined, then no slow mode is used. If it is defined, then the default division action is / 8, eg, 16MHz normal -> 2MHz slow mode. Signed-off-by: Andy Green <andy@openmoko.com>
2008-11-19fix-glamo-mci-dont-filter-voltage-change.patchAndy Green
Signed-off-by: Andy Green <andy@openmoko.com>
2008-11-19fix-glamo-mci-ensure-more-than-74-clocks-after-power.patchAndy Green
We are meant to run SD_CLK a little while after power-on for the SD Card, but with the no idle clock changes we didn't take care about it. This makes us sleep a little bit before disabling clock if we just powered up the SD Card. Signed-off-by: Andy Green <andy@openmoko.com>
2008-11-19fix-glamo-mci-possible-timeout-overflow.patchAndy Green
The MMC stack hands us a timeout calibrated in SD_CLK clocks, but the Glamo can only deal with up to 65520 clocks of timeout. If the stack handed us a request bigger than this, it would just wrap and the timeout we actually used would be way too short. With this patch if that happens, we use the longest timeout we can, 65520 clocks and give it our best shot. Signed-off-by: Andy Green <andy@openmoko.com>
2008-11-19fix-glamo-mci-set-default-drive-level-0.patchAndy Green
Tests on access to SD Card with Glamo drive level "0" show that it reduces SD_CLK energy at 1.5GHz by 24dBm compared to drive level 3. This puts it only 6dB above the background noise floor compared to 30dB and should make a solution for GPS trouble with SD Card in. SD card communication seems unaffected so far on the Sandisk 512MB card we ship. Signed-off-by: Andy Green <andy@openmoko.com>
2008-11-19debug-add-glamo-drive-strength-module-param.patchAndy Green
Suggested-by: Werner Almesberger <werner@openmoko.org> This patch allows users to control two additional settings in Glamo MCI driver from kernel commandline or module parameters. First is Glamo drive strength on SD IOs including CLK. This ranges from 0 (weakest) to 3 (strongest). echo 0 > /sys/module/glamo_mci/parameters/sd_drive (Changes to this take effect on next SD Card transaction) or, from kernel commandline glamo_mci.sd_drive=0 On tests here with 0 strength, communication to SD card (shipped 512MB Sandisk) seemed fine, and a dd of 10MB urandom had the same md5 when written to cache as after a reboot. I set the default to 2. Second is whether we allow SD_CLK when the SD interface is idle. # stop the clock when we are idle (default) echo 0 > /sys/module/glamo_mci/parameters/sd_idleclk # run the SD clock all the time echo 1 > /sys/module/glamo_mci/parameters/sd_idleclk (changes take effect on next SD Card transaction) From kernel commandline, eg: glamo_mci.sd_idleclk=1 Normally you don't want to run the SD Clock all the time. Signed-off-by: Andy Green <andy@openmoko.com>
2008-11-19fix-scard-stop-on-resume.patchAndy Green
Reported-by: Ville-Pekka Vainio <vpivaini@cs.helsinki.fi> The reporter noticed SD Card clock is running again after resume. After looking at the code I saw I missed two tricks, this will force it off after resume and will do better generally depending on what the last SD Card packet was. Since bulk read packet is normally last action (which set the clock off even without this) the old patch worked for normal cases. But after resume, the last packet on the wire was not a bulk transfer and we didn't take care about the clock then. Signed-off-by: Andy Green <andy@openmoko.com>
2008-11-19add-limit-sdcard-clk-cmdline.patchAndy Green
This patch allows you to control the maximum clock rate that will be selected for SD Card access, from the kernel commandline using glamo_mci.sd_max_clk=10000000 and also from echo 10000000 > /sys/module/glamo_mci/parameters/sd_max_clk although you have to suspend and resume to make the limit operational on the actual SD_CLK line. Clocks that are possible are divided down from ~50MHz, so 25000000, 16666666, 12500000, 10000000, etc. With Freerunner A5 revision that has 100R series resistors in SD Card signals, I didn't get reliable operation above 16MHz. With A6 revision the series resistors went down to 75R, maybe it can work at 25MHz. Reducing the clock rate is something to try if you find that your SD Card is not communicating properly with the default speed. Signed-off-by: Andy Green <andy@openmoko.com>
2008-11-19fix-force-sdcard-clk-off-when-idle.patchAndy Green
Existing Glamo bit for stopping SD Card Clock when there is no transfer taking place does not work. This patch adds stuff around the transfer code to force the SD clock up when something is going on and down when it is idle. This'll save a little power and noise ;-) I tested it briefly and was able to SD Boot normally on Sandisk 512M. Wider testing is appreciated. Signed-off-by: Andy Green <andy@openmoko.com>
2008-11-19fix-glamo-mci-resume-dependency-on-pcf50633.patchAndy Green
Glamo MCI has a resume order dependncy on pcf50633, it has to be able to power the SD slot via it. Signed-off-by: Andy Green <andy@openmoko.com>
2008-11-19OpenMoko => OpenmokoHolger Freyther
Signed-Off-By: Holger Freyther <zecke@openmoko.org>
2008-11-19fix-glamo-mci-fake-reset-opcode-in-suspend.patchwarmcat
2008-11-19fix-glamo-mci-defeat-ops-during-suspend.patchAndy Green
We need to be able to use the config option CONFIG_MMC_UNSAFE_RESUME that allows the rootfs to live on SD. But when we use this, it tries to send a reset command to the SD card during suspend -- and unfortunately many things like Power have suspended by then. This patch again rejects IO on the MMC device during suspend of the MMC device, and it gives the result the rootfs on SD card works okay. Signed-off-by: Andy Green <andy@openmoko.com>
2008-11-19glamo-mmc.patchmokopatches