aboutsummaryrefslogtreecommitdiff
path: root/drivers/mmc
AgeCommit message (Collapse)Author
2009-03-24sdhci: Add support for bus-specific IO memory accessorsAnton Vorontsov
Currently the SDHCI driver works with PCI accessors (write{l,b,w} and read{l,b,w}). With this patch drivers may change memory accessors, so that we can support hosts with "weird" IO memory access requirments. For example, in "FSL eSDHC" SDHCI hardware all registers are 32 bit width, with big-endian addressing. That is, readb(0x2f) should turn into readb(0x2c), and readw(0x2c) should be translated to le16_to_cpu(readw(0x2e)). Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2009-03-24mmc_spi: adjust for delayed data token responseWolfgang Muees
Some cards are not able to send the data token in time, but miss the time frame for some bits(!). So synchronize to the start of the token. Signed-off-by: Wolfgang Muees <wolfgang.mues@auerswald.de> Acked-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2009-03-24omap_hsmmc: Wait for SDBPAdrian Hunter
It is necessary to wait for bus power before sending any commands. Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2009-03-24omap_hsmmc: Fix MMC3 dmaGrazvydas Ignotas
Data transfers on third OMAP3 MMC controller don't work because DMA line numbers are only defined for MMC1 and MMC2. Fix that and store line numbers in mmc_omap_host structure to reduce code size. Tested on OMAP3 pandora board. Signed-off-by: Grazvydas Ignotas <notasas@gmail.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2009-03-24omap_hsmmc: Disable SDBP at suspendJarkko Lavinen
Turn off the bus power at suspend. Signed-off-by: Jarkko Lavinen <jarkko.lavinen@nokia.com> Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2009-03-24omap_hsmmc: Do not prefix slot nameAdrian Hunter
Allow slot_name to be the same as the other OMAP driver, by removing the redundant "slot:" prefix. Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2009-03-24omap_hsmmc: Allow cover switch to cause rescanAdrian Hunter
Allow a cover switch to be used to cause a rescan of the MMC slot. Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2009-03-24omap_hsmmc: Add 8-bit bus width mode supportJarkko Lavinen
Signed-off-by: Jarkko Lavinen <jarkko.lavinen@nokia.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2009-03-24omap_hsmmc: Implement scatter-gather emulationJuha Yrjola
Instead of using the bounce buffer, using scatter-gather emulation (as in the OMAP1/2 MMC driver) removes the need of one extra memory copy and improves performance. Signed-off-by: Juha Yrjola <juha.yrjola@solidboot.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2009-03-24omap_hsmmc: Fix response type for busy after responseAdrian Hunter
Some MMC commands result in the card becoming busy after the response is received. This needs to be specified for the omap_hsmmc host controller, which is what this patch does. However, the effect is that some commands with no data will cause a Transfer Complete (TC) interrupt in addition to the Command Complete (CC) interrupt. In order to deal with that, the irq handler has needed a few changes also. The benefit of this change is that the omap_hsmmc host controller driver now waits for the TC interrupt while the card is busy, so the mmc_block driver needs to poll the card status just once instead of repeatedly. i.e. the net result is more sleep and less cpu. The command sequence for open-ended multi-block write with DMA is now: Issue write command CMD25 Receive CC interrupt Data is sent Receive TC interrupt (DMA is done) Issue stop command CMD12 Receive CC interrupt Card is busy Receive TC interrupt Card is now ready for next transfer Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2009-03-24omap_hsmmc: Do dma cleanup also with data CRC errorsJarkko Lavinen
Signed-off-by: Jarkko Lavinen <jarkko.lavinen@nokia.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2009-03-24mmc: SDIO driver for Marvell SoCsMaen Suleiman
This supports MMC/SD/SDIO currently found on the Kirkwood 88F6281 and 88F6192 SoC controllers. Signed-off-by: Nicolas Pitre <nico@marvell.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2009-03-24MMC: tmio_mmc.h: fix build problemAlexander Beregalov
drivers/mmc/host/tmio_mmc.h: In function 'tmio_mmc_kmap_atomic': drivers/mmc/host/tmio_mmc.h:147: error: implicit declaration of function 'kmap_atomic' drivers/mmc/host/tmio_mmc.h:147: error: 'KM_BIO_SRC_IRQ' undeclared (first use in this function) drivers/mmc/host/tmio_mmc.h: In function 'tmio_mmc_kunmap_atomic': drivers/mmc/host/tmio_mmc.h:153: error: implicit declaration of function 'kunmap_atomic' drivers/mmc/host/tmio_mmc.h:153: error: 'KM_BIO_SRC_IRQ' undeclared (first use in this function) Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2009-03-24tmio_mmc: Fix use after free in remove()Magnus Damm
Update the tmio_mmc code to call mmc_free_host() when done using the private data. Without this fix the driver frees memory and then keeps on using it as private data. Signed-off-by: Magnus Damm <damm@opensource.se> Acked-by: Ian Molton <ian@mnementh.co.uk> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2009-03-24tmio_mmc: Fix one off, use resource_size() in probe()Magnus Damm
Update the tmio_mmc code to use resource_size(). With this patch applied the correct resource size is passed to ioremap(). Signed-off-by: Magnus Damm <damm@opensource.se> Acked-by: Ian Molton <ian@mnementh.co.uk> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2009-03-24mmc_spi: allow higher timeouts for SPI modeWolfgang Muees
Some SD cards have very high timeouts in SPI mode. So adjust the timeouts from theory to practice. Signed-off-by: Wolfgang Muees <wolfgang.mues@auerswald.de> Acked-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2009-03-24mmc_spi: wait more bytes for card responseWolfgang Muees
Some cards are slower than the standard allows and need more time to respond to a command. Max. observed number of bytes was 12. Signed-off-by: Wolfgang Muees <wolfgang.mues@auerswald.de> Acked-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2009-03-24mmc_spi: allow setting of spi mode 3Wolfgang Muees
Allow the platform data structures to specify spi mode 3 (if there is a pullup on the clock line or the spi hardware is not able to serve spi mode 0). Signed-off-by: Wolfgang Muees <wolfgang.mues@auerswald.de> Acked-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2009-03-24mmc: During unsafe resume, select the right volatge for the cardBalaji Rao
During mmc unsafe resume, choose the right voltage for the card after powerup. Although this has not seen to cause trouble, it's the wrong behaviour. Signed-off-by: Balaji Rao <balajirrao@openmoko.org> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2009-03-24sdio: check that addresses are within the address spacePierre Ossman
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2009-03-24sdio: handle null tuplesPierre Ossman
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2009-03-24sdio: handle cis end marker in link fieldPierre Ossman
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2009-03-24omap_hsmmc: Initialize hsmmc controller registers when resumingKim Kyuwon
Most registers lose its state when the processor wakes up from sleep state. Thus registers should be initialized, when the processor wakes up. However the current hsmmc 'resume' function doesn't consider this issue and finally makes deadlock. So this patch fixes this problem. Signed-off-by: Kim Kyuwon <chammoru@gmail.com> Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com> Acked-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2009-03-24omap_hsmmc: do not re-power when powering off MMCAdrian Hunter
Remove code that turns MMC1 power back on after it has been powered off (when the voltage is 1.8V). The offending code is not necessary because the host controller bus voltage is initialized to 3V when probing or resuming. Note that MMC powers up with the highest voltage available (see mmc_power_up()) which will be 3V also. Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com> Acked-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2009-03-24mmc: Add Extended CSD register to debugfsAdrian Hunter
Extended CSD is a MMC card register. As increasingly interesting fields are being added to Extended CSD, it is helpful to see its value. Note that SD cards do not have an Extended CSD register, so it is MMC only. Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2009-03-24mmc: add MODALIAS linkage for MMC/SD devicesAndy Whitcroft
Currently we are using an explicit udev rule to trigger loading of the mmc-block module when an MMC or SD card is detected: SUBSYSTEM=="mmc", RUN+="/sbin/modprobe -Qba mmc-block" It makes much more sense for the mmc bus driver and the mmc-block module to share MODALIAS information so that they are linked automatically. There is no real information of use in the MMC system at the current time. All devices inserted require us to load the mmc-block device. Until such time as useful parameters exist simply reflect the module linkage via the module alias below: mmc:block Signed-off-by: Andy Whitcroft <apw@canonical.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2009-03-24mmc: delayed_work was never cancelledJorg Schummer
The delayed work item mmc_host.detect is now cancelled before flushing the work queue. This takes care of cases when delayed_work was scheduled for mmc_host.detect, but not yet placed in the work queue. Signed-off-by: Jorg Schummer <ext-jorg.2.schummer@nokia.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2009-03-24mmc: struct device - replace bus_id with dev_name(), dev_set_name()Kay Sievers
Acked-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2009-03-19Merge branch 'omap-clks3' into develRussell King
Conflicts: arch/arm/mach-omap2/clock.c
2009-03-13Merge branch 'for-rmk' of git://git.pengutronix.de/git/imx/linux-2.6 into develRussell King
Conflicts: arch/arm/mach-at91/gpio.c
2009-03-13MX2/MX3 SDHC driver: rename platform driverSascha Hauer
Rename driver from imx-mmc to mxc-mmc to avoid conflicts with the mx1 mmc driver. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-03-13mxcmmc: Do not pass clock name, we have only one clock for this deviceSascha Hauer
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-03-12mmc: s3cmci: fix s3c2410_dma_config() arguments.Ben Dooks
The s3cmci driver is calling s3c2410_dma_config with incorrect data for the DCON register. The S3C2410_DCON_HWTRIG is implicit in the channel configuration and the device selection of S3C2410_DCON_CH0_SDI is incorrect as the DMA system may not select channel 0. Signed-off-by: Ben Dooks <ben@simtec.co.uk> Acked-by: Pierre Ossman <drzeus@drzeus.cx> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-03-12[ARM] 5420/1: MMCI devinit and devexit macrosLinus Walleij
This adds __devinit and __devexit macros to the module probe and remove functions in MMCI. Now includes the __devexit_p() thing too. Signed-off-by: Linus Walleij <linus.walleij@ericsson.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-03-09[ARM] pxa: move DMA registers definitions into <mach/dma.h>Eric Miao
1. Driver code where pxa_request_dma() is called will most likely reference DMA registers as well, and it is really unnecessary to include pxa-regs.h just for this. Move the definitions into <mach/dma.h> and make relevant drivers include it instead of <mach/pxa-regs.h>. 2. Introduce DMAC_REGS_VIRT as the virtual address base for these DMA registers. This allows later processors to re-use the same IP while registers may start at different I/O address. Signed-off-by: Eric Miao <eric.miao@marvell.com>
2009-03-08mmc: fix data timeout for SEND_EXT_CSDAdrian Hunter
Commit 0d3e0460f307e84904968aad6cff97bd688583d8 "MMC: CSD and CID timeout values" inadvertently broke the timeout for the MMC command SEND_EXT_CSD. This patch puts it back again. Depending on the characteristics of the controller, this bug may prevent the use of MMC cards. Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2009-03-02sdhci: Add NO_BUSY_IRQ quirk for Marvell CAFE host chipAndres Salomon
As described here: http://lkml.org/lkml/2009/2/20/265 The CAFE chip is broken due to commit e809517f6fa5803a5a1cd5602. Anton added a quirk here: http://lkml.org/lkml/2009/2/20/279 that fixes CAFE's problem. This adds the quirk for CAFE. Signed-off-by: Andres Salomon <dilinger@debian.org> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2009-03-02sdhci: Add quirk for controllers with no end-of-busy IRQBen Dooks
The Samsung SDHCI (and FSL eSDHC) controller block seems to fail to generate an INT_DATA_END after the transfer has completed and the bus busy state finished. Changes in e809517f6fa5803a5a1cd56026f0e2190fc13d5c to use the new busy method are the cause of the behaviour change. Signed-off-by: Ben Dooks <ben-linux@fluff.org> Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2009-02-18Merge branch 'for-linus' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/drzeus/mmc * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/drzeus/mmc: omap_hsmmc: Change while(); loops with finite version omap_hsmmc: recover from transfer failures omap_hsmmc: only MMC1 allows HCTL.SDVS != 1.8V omap_hsmmc: card detect irq bugfix sdhci: fix led naming mmc_test: fix basic read test s3cmci: Fix hangup in do_pio_write() Revert "sdhci: force high speed capability on some controllers" MMC: fix bug - SDHC card capacity not correct
2009-02-18atmel-mci: fix initialization of dma slave dataDan Williams
The conversion of atmel-mci to dma_request_channel missed the initialization of the channel dma_slave information. The filter_fn passed to dma_request_channel is responsible for initializing the channel's private data. This implementation has the additional benefit of enabling a generic client-channel data passing mechanism. Reviewed-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp> Signed-off-by: Dan Williams <dan.j.williams@intel.com> Acked-by: Haavard Skinnemoen <hskinnemoen@atmel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-02-18omap_hsmmc: Change while(); loops with finite versionJean Pihet
Replace the infinite 'while() ;' loops with a finite loop version. Signed-off-by: Jean Pihet <jpihet@mvista.com> Acked-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2009-02-18omap_hsmmc: recover from transfer failuresJean Pihet
Timeouts during a command that has a data phase can result in the next command issued after the command that failed not being processed, i.e. no interrupt ever occurs to indicate the command has completed. This failure can result in a deadlock. This patch resets the data state machine to clear the error in case of a command timeout. Tested on OMAP3430 chip and intensive MMC/SD device removal while transferring data. Signed-off-by: Andy Lowe <alowe@mvista.com> Signed-off-by: Jean Pihet <jpihet@mvista.com> Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Acked-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2009-02-18omap_hsmmc: only MMC1 allows HCTL.SDVS != 1.8VDavid Brownell
Based on a patch from Tony Lindgren ... after initialization, never change HCTL.SDVS except for MMC1. The other controller instances only support 1.8V in that field, although they can suport other card/SDIO/eMMC/... voltages with level shifting solutions such as external transceivers. MMC2 behavior sanity tested on Overo/WLAN, OMAP3430 SDP, and custom hardware. MMC1 also sanity tested on those platforms plus Beagle. This also fixes a bug preventing MMC2 (and also presumably MMC3) from powering down when requested. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Acked-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2009-02-18omap_hsmmc: card detect irq bugfixDavid Brownell
Work around lockdep issue when card detect IRQ handlers run in thread context ... it forces IRQF_DISABLED, which prevents all access to twl4030 card detect signals. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Acked-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2009-02-18sdhci: fix led namingHelmut Schaa
Fix the led device naming for the sdhci driver. The led class documentation defines the led name to have the form "devicename:colour:function" while not applicable sections should be left blank. To comply with the documentation the led device name is changed from "mmc*" to "mmc*::". Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2009-02-18mmc_test: fix basic read testRabin Vincent
Due to a typo in the Basic Read test, it's currently identical to the Basic Write test. Fix this. Signed-off-by: Rabin Vincent <rabin@rab.in> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2009-02-18s3cmci: Fix hangup in do_pio_write()Yauhen Kharuzhy
This commit fixes the regression what was added by commit 088a78af978d0c8e339071a9b2bca1f4cb368f30 "s3cmci: Support transfers which are not multiple of 32 bits." fifo_free() now returns amount of available space in FIFO buffer in bytes. But do_pio_write() writes to FIFO 32-bit words. Condition for return from cycle is (fifo_free() == 0), but when fifo has 1..3 bytes of free space then this condition will never be true and system hangs. This patch changes condition in the while() to (fifo_free() > 3). Signed-off-by: Yauhen Kharuzhy <jekhor@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2009-02-18Revert "sdhci: force high speed capability on some controllers"Pierre Ossman
This reverts commit a4b76193774b463b922cab2f92450efb20d29ef0. It turned out that the controller had problem running at the higher speed, so go back to trusting the hardware capability bits. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2009-02-18MMC: fix bug - SDHC card capacity not correctYi Li
Signed-off-by: Yi Li <yi.li@analog.com> Signed-off-by: Bryan Wu <cooloney@kernel.org> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2009-02-08[ARM] omap: hsmmc: new short connection id namesRussell King
... rather than the clock names themselves. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>