aboutsummaryrefslogtreecommitdiff
path: root/drivers/mfd/glamo/glamo-mci.c
AgeCommit message (Collapse)Author
2009-09-11Merge commit 'remotes/openmoko/andy-tracking' into drm-trackingThomas White
2009-08-27Silence suspend/resumeThomas White
This removes a few excess printks to tidy up suspend/resume. Identical changes exist in andy-tracking already Signed-off-by: Thomas White <taw@bitwiz.org.uk>
2009-06-13gta02: move debugging messages to the appropriate levelsPaul Fertser
Clean up debugging messages so that we don't see any output with loglevel=4 (default for Qi). This avoids slowing down suspend/resume by slow fb output. Checkpatch barks on this patch but i guess most of that debugging would have to be changed prior to upstream submission anyway. Signed-off-by: Paul Fertser <fercerpav@gmail.com>
2009-03-26Fix MMC buffer locationsThomas White
This fixes the MMC buffer locations in glamo-mci.c, which were broken by the reorganisation of Glamo's memory. Signed-off-by: Thomas White <taw@bitwiz.org.uk>
2009-02-20fix-glamo-mci-move-stop-out-of-isr.patchAndy Green
This patch moves the bulk transfer action outside of interrupt context, along with the STOP transmission action for multiblock transfers. It's prompted by https://docs.openmoko.org/trac/ticket/2180 But it can impact throughput to SD card, so it's for testing currently. Signed-off-by: Andy Green <andy@openmoko.com>
2009-01-27fix-glamo-core-from-balaji-tree.patchAndy Green
Signed-off-by: Andy Green <andy@openmoko.com>
2009-01-22MERGE-via-pending-tracking-hist-MERGE-via-stable-tracking-MERGE-via-mokopatc ↵merge
hes-tracking-fix-stray-endmenu-patch-1232632040-1232632141 pending-tracking-hist top was MERGE-via-stable-tracking-MERGE-via-mokopatches-tracking-fix-stray-endmenu-patch-1232632040-1232632141 / fdf777a63bcb59e0dfd78bfe2c6242e01f6d4eb9 ... parent commitmessage: From: merge <null@invalid> MERGE-via-stable-tracking-hist-MERGE-via-mokopatches-tracking-fix-stray-endmenu-patch-1232632040 stable-tracking-hist top was MERGE-via-mokopatches-tracking-fix-stray-endmenu-patch-1232632040 / 90463bfd2d5a3c8b52f6e6d71024a00e052b0ced ... parent commitmessage: From: merge <null@invalid> MERGE-via-mokopatches-tracking-hist-fix-stray-endmenu-patch mokopatches-tracking-hist top was fix-stray-endmenu-patch / 3630e0be570de8057e7f8d2fe501ed353cdf34e6 ... parent commitmessage: From: Andy Green <andy@openmoko.com> fix-stray-endmenu.patch Signed-off-by: Andy Green <andy@openmoko.com>
2009-01-15avoid using irq_desc in glamo-mci.cWerner Almesberger
When building the MMC subsystem as modules, drivers/mfd/glamo/glamo-mci.ko cannot access irq_desc, because it isn't exported by kernel/irq/handle.c All the functions that indirectly access irq_desc are inlined, so they cannot be used to avoid having to resolve irq_desc. Fortunately, we can solve the problem locally: we don't really need to access irq_desc anyway. This patch splits glamo_mci_irq into a small wrapper that implements the IRQ handler interface and the main code that doesn't need to know about the semantics of the latter. Then we simply call the main code with the information we already have. Signed-off-by: Werner Almesberger <werner@openmoko.org> Tested-by: Rafael Ignacio Zurita <rizurita@yahoo.com>
2009-01-04fix-glamo-mci-ambiguous-timeout.patchAndy Green
Sometimes we see failures with cards where the status is eg, 0x310. This corresponds to a "no data" timeout and an assertion that the data is present. This patch makes the data present status have priority over the timeout status. Signed-off-by: Andy Green <andy@openmoko.com>
2008-12-04MERGE-via-pending-tracking-hist-MERGE-via-stable-tracking-workaround-glamo-m ↵merge
mc-insanity-1228425445 pending-tracking-hist top was MERGE-via-stable-tracking-workaround-glamo-mmc-insanity-1228425445 / 8c97326a7ad33d8690a4b433abc14918e5900e58 ... parent commitmessage: From: merge <null@invalid> MERGE-via-stable-tracking-hist-workaround-glamo-mmc-insanity- stable-tracking-hist top was workaround-glamo-mmc-insanity- / 7a55cd6f948a33c4452dd99da39e15efe832f2e2 ... parent commitmessage: From: sprite_tm <unknown@invalid> workaround-glamo-mmc-insanity-timeout-warning-only.patch Modified version of one line patch from https://docs.openmoko.org/trac/ticket/2078 by sprite_tm Signed-off-by: Andy Green <andy@openmoko.com>
2008-12-01fix-glamo-mci-no-wait-ack-deselect.patchAndy Green
Now the card is powered when we send the last command from the stack, SELECT CARD with arg 0, we learn that the card can't reply when deselected. So detect SELECT CARD and arg 0 and don't bother waiting for an ack that isn't coming. This chops three seconds off suspend :-) Signed-off-by: Andy Green <andy@openmoko.com>
2008-12-01fix-glamo-mmc-reduce-insanity-timeout.patchAndy Green
Nothing on the card can really take 3s.. reduce to 300ms Signed-off-by: Andy Green <andy@openmoko.com>
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