summaryrefslogtreecommitdiffstats
path: root/drivers/mci
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'pu/mx6-v2' into nextSascha Hauer2012-04-242-4/+13
|\ | | | | | | | | | | | | | | Conflicts: arch/arm/Makefile arch/arm/mach-imx/Kconfig Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * mmc i.MX esdhc: Add i.MX6 supportSascha Hauer2012-04-241-3/+12
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * ARM: add initial i.MX6 supportSascha Hauer2012-04-241-1/+1
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'master' into nextSascha Hauer2012-04-172-18/+32
|\ \
| * | mci: pxamci poweron ramp delayRobert Jarzmik2012-04-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As per MMC spec, once power has been applied to an SD card, the card can take as much as 250ms to complete its power-up cycle, and become responsive to CMD0. When this delay was not in place, activating the SD card in the env init failed sometimes. With it, no more failure are observed. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | mci: pxamci fix R1b responsesRobert Jarzmik2012-04-171-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The pxamci driver was not waiting for the BUSY line to be deasserted. This was specifically breaking the CMD12 at the end of block multiple writes, when the SD card had not time enough to commit the last write. Fix it by waiting for PRG_DONE bit (which is actually the busy signal end condition). Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | mci: pxamci fix CMD12 handlingRobert Jarzmik2012-04-172-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The pxamci requires a bit to be set in the command control register when a CMD12 is sent. Set it, as required in the PXA Developer Manuel, chapter "Stop Data Transmission Command (CMD12 or IO/Abort with CMD52)". Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | mci: pxamci fix response typeRobert Jarzmik2012-04-171-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | When preparing a command, apply a mask so that only the command part will be used for the switch case. This will be more robust for future command response types. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | mci: pxamci change clocks handlingRobert Jarzmik2012-04-171-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix clock handling accordingly to PXA manual : - enable the MMC controller clock once and for all - only disable the MMC bus clock when changing the MMCLK by adjusting the clock ratio, else let the controller and SD card shut down the clock as the see fit. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | mci: pxamci define timeoutsRobert Jarzmik2012-04-171-8/+13
| |/ | | | | | | | | | | | | | | | | Instead of using hard encoded values in the code, use defines to setup the timeouts of reads/writes/commands. Fix the read timeout as defined in the PXA Developer Manual. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / Use DEVICE_ID_DYNAMIC where applicableSascha Hauer2012-04-161-1/+1
|/ | | | | | | We now have DEVICE_ID_DYNAMIC for dynamic allocation of device ids, Use it where applicable. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Remove duplicate voltage setup for imx-esdhcAlexander Shiyan2012-03-181-2/+0
| | | | | | | We are already setup voltages from capabilities register. Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* drivers/mci: fix read/write stallingRobert Jarzmik2012-02-291-21/+10
| | | | | | | | | | | | | | If a read or write operation encounters an error, the card might stay in "recv" or "data" state, and never get back to "tran" state. In these cases, the host is required to send a CMD12 (end transmission) to switch the FSM of the card back to "tran" state, as described in MMC Specification, chapter "Data Transfer Mode". Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'master' into nextSascha Hauer2012-02-151-2/+2
|\
| * Correct Kconfig comment for MCI_OMAP_HSMMC to include OMAP3.Robert P. J. Day2012-02-091-2/+2
| | | | | | | | | | Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | mci i.MX esdhc: make 8bit modes platform dependentSascha Hauer2012-02-091-1/+5
| | | | | | | | | | | | | | | | Whether the controller works in 8bit mode is not only dependent on the controller but also on the board having wired up 8 data lines, so put a capabilities field in platform data. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | mci: Fix 8 bit mmc cardsSascha Hauer2012-02-091-26/+107
| | | | | | | | | | | | | | | | | | | | Currently we test the cards capabilities for being 8bit capable. This does not work since noone ever sets this bit. Unfortunately there is no bit to test 8bit capability, so we introduce a patch from the kernel which puts the mmc card into 8bit mode and tests whether it can succesfully read the ext_csd in this mode. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | mci: Add a complete list of EXT_CSD_* fields from the kernelSascha Hauer2012-02-091-1/+1
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | mci i.MX esdhc: use timeout loopsSascha Hauer2012-02-091-7/+20
| | | | | | | | | | | | | | | | Too often I have waited to get a reaction from this driver when something goes wrong. Use timeout loops instead of inifinite polling loops. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | mci: Be more verbose on what device is associated to which diskSascha Hauer2012-02-091-3/+7
| | | | | | | | | | | | | | This is quite useful when multiple SD cards are present so spare some bytes to print this information. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | mci: cdev_find_free_index won't fail, no need to checkSascha Hauer2012-02-091-2/+0
| | | | | | | | | | | | | | There will always be the next integer number unless we register INT_MAX disk devices which is rarely the case. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | mci: factor out mci/sd specific startup functionsSascha Hauer2012-02-091-56/+77
| | | | | | | | | | | | This saves an indention level and makes the code more readable. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | mci: replace pr_debug with dev_dbgSascha Hauer2012-02-091-59/+59
| | | | | | | | | | | | | | The mci layer uses pr_debug throughout. Use dev_dbg instead which is very useful when multiple cards are involved. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | mci: Use struct mci for internal argument passingSascha Hauer2012-02-092-143/+131
| | | | | | | | | | | | | | | | | | The mci layer currently passes around a struct device_d for its internal use. Apart from being confusing this drops typesafety for no good reason. Instead, pass around a struct mci. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | mci core: fix mixup of max write/read block lenSascha Hauer2012-02-091-1/+1
| | | | | | | | | | | | | | The argmument order in this pr_debug does not match the string printed. Fix this. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | mci: remove unused device argument from set_iosSascha Hauer2012-02-099-18/+9
| | | | | | | | | | | | This argmuent is unused in all drivers, so remove it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | mci s3c: pass around the right pointerSascha Hauer2012-02-091-58/+45
| | | | | | | | | | | | | | | | The s3c driver passes around a struct device_d * internally in which it is never interested in. Instead pass around a struct s3c_mci_host and get rid of all this ugly void * derefs. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | mci s3c: allocate host struct dynamicallySascha Hauer2012-02-091-26/+17
| | | | | | | | | | | | | | | | Yes, it does make sense. First there will always be the next hardware which has multiple controllers. Also, we shouldn't give bad examples to others. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | mci s3c: Do not mess with struct mci_hostSascha Hauer2012-02-091-6/+3
| | | | | | | | | | | | | | This structure is owned by the core, do not change its contents in the driver. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | mci core: replace discrete ios values with struct iosSascha Hauer2012-02-099-52/+83
| | | | | | | | | | | | | | As we'll need more arguments to set_ios over time put them in a struct mci_ios like the kernel does. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | mci mxs: do not use external define for internal useSascha Hauer2012-02-091-1/+1
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | mci: fix high capacity detectionSascha Hauer2012-02-091-3/+0
| | | | | | | | | | | | | | | | | | Whether a card is high capacity is checked in sd_send_op_cond/mmc_send_op_cond. Remove the wrong check in mmc_change_freq which wrongly recognizes some eMMC flash as high capacity. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | mci: use card type definitionsSascha Hauer2012-02-091-2/+2
|/ | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'pu/debug' into nextSascha Hauer2012-01-271-1/+3
|\
| * atmel/mci: fix slot_b supportJean-Christophe PLAGNIOL-VILLARD2012-01-161-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | in commit commit f60f6c58e atmel_mci: check for device id we use to address the right slot the driver use the dev_id to detect the slot which is wrong on 9263 as we have 2 devices with 2 slots use slot_b paramter to specify the slot as done in linux Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Cc: Michael Grzeschik <m.grzeschik@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | mci_spi: specify hw_devJean-Christophe PLAGNIOL-VILLARD2012-01-061-0/+1
|/ | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* MACH SAMSUNG/S3C: Separate S3C24XX clock managementJuergen Beisert2012-01-021-5/+5
| | | | | | | | | | There are major differences in the clock tree of the S3C24xx family and the more recent CPUs of the S3C family. Keep the S3C24XX clock routines separate to avoid an ifdef hell. But also use generic function names to be able to share drivers among the S3C family. Signed-off-by: Juergen Beisert <jbe@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* MACH SAMSUNG/S3C: Parts of the SDHC driver can be shared in the S3C CPU familyJuergen Beisert2012-01-021-1/+1
| | | | | Signed-off-by: Juergen Beisert <jbe@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* MACH SAMSUNG/S3C: Make it more generic for future updatesJuergen Beisert2012-01-021-2/+2
| | | | | | | Start with renaming files to share them in the S3C CPU family, Signed-off-by: Juergen Beisert <jbe@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* drivers/mci: pxa fix clockrateRobert Jarzmik2012-01-021-5/+9
| | | | | | | | | | | | The clock rate was incorrectly calculated, leading to a frequency of 19.5MHz / 64 instead of 19.5Mz for the host controller. with the fix applied, a copy of a file of 230 kB shrinks from 6000ms to 123ms. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* omap_hsmmc: setup mmc voltage on twl6030Alexander Aring2011-12-213-0/+47
| | | | | | | | Support the setup of the mmc voltage, when booting OMAP4 with twl6030 from nand. Signed-off-by: Alexander Aring <a.aring@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* drivers/mci: pxa read data performance boostRobert Jarzmik2011-12-211-2/+8
| | | | | | | | | | | | | | Increase pxa reading performance by reading 4 bytes at a time instead of 4 reads of 1 byte. As the mci controller FIFO accepts reads on bytes, halfwords or words, use words whenether possible. The boost is for a 250KBytes file read and display (bmp): - before: 6900ms - after: 6000ms Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* drivers/mci: pxa writedata timeoutRobert Jarzmik2011-12-211-1/+1
| | | | | | | | | The write data timeout is too small for old cards, especially the Transcend 256MBytes SD card. Increase it from 10ms to 100ms. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* drivers/mci: add PXA host controllerRobert Jarzmik2011-12-084-0/+466
| | | | | | | | | | Add a simple PIO based host controller for MMC and SD cards on PXA SoCs. Reads and writes are available, and no usage is made of DMA or IRQs. SPI mode is not supported yet. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci s3c: remove unused codeSascha Hauer2011-12-071-26/+0
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci Kconfig: select DISK_WRITE instead of ATA_WRITESascha Hauer2011-12-071-1/+1
| | | | | | | ATA_WRITE does not exist anymore. DISK_WRITE is the successor for it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* atmel_mci: check for device id we use to address the right slotMichael Grzeschik2011-12-071-0/+2
| | | | | | | | We have to check which sd card slot we use. The registered mmc_id is the the correct parameter for this. Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: add the probe parameter if any error happened during the probeJean-Christophe PLAGNIOL-VILLARD2011-12-051-1/+1
| | | | | | | as example today if the timeout happened we can not probe the SD card again Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* imx-esdhc: add support of card detectJean-Christophe PLAGNIOL-VILLARD2011-12-051-0/+37
| | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci imx-esdhc: do not overwrite probed host capsSascha Hauer2011-12-051-1/+0
| | | | | | | The caps are read from the hardware but overwritten afterwards. Fix this. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>