summaryrefslogtreecommitdiffstats
path: root/drivers/mci/imx-esdhc.c
Commit message (Collapse)AuthorAgeFilesLines
* resource: Let dev_request_mem_region return an error pointerSascha Hauer2014-09-161-0/+2
| | | | | | For all users fix or add the error check. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/mci'Sascha Hauer2014-02-031-0/+4
|\ | | | | | | | | Conflicts: arch/arm/boards/tqma53/board.c
| * mci: imx-esdhc: add DSR supportMarkus Niebel2014-01-151-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | having DSR support in mci-core we need a way to forward the DSR value to the driver. Add it to platform data for imx-esdhc TODO: implement the same for other host controller drivers Signed-off-by: Markus Niebel <Markus.Niebel@tqs.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | mci: imx-esdhc: Add i.MX25 compatible entrySascha Hauer2014-01-311-0/+2
|/ | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* treewide: Add missing includesSascha Hauer2013-11-081-0/+1
| | | | | | | | A lot of files rely on include/driver.h including include/of.h (and this including include/errno.h. include the files explicitly so we can eventually get rid of including of.h from driver.h Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* MCI: imx-esdhc: implement workaround for errata ENGcm12360Markus Niebel2013-09-111-0/+15
| | | | | | | | | | | | | | | | | | | | At least i.MX53 has errata ENGcm12360: Occurs when a pending command which issues busy is completed. For a command with R1b response, the proper software sequence is to poll the DLA for R1b commands to determine busy state completion. The DLA polling is not working properly for the ESDHC module. This is relevant for all eSDHC ports (eSDHC1-4 ports) DLA bit in PRSSTAT register cannot be polled to wait for busy state completion. Updated block guide to reflect that DLA is not applicable to detect busy state, instead, should poll bit 24 in PRSSTAT register (DLSL[0] bit) to check that wait busy state is over. Signed-off-by: Markus Niebel <Markus.Niebel@tqs.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: rename capabilities flagsSascha Hauer2013-06-031-2/+2
| | | | | | | | | | Use MMC_CAP_ names instead of MMC_MODE_. This makes it more clear that these are capabilities of host/card and do not refer to the current mode. These are in line with the Linux Kernel except for MMC_CAP_MMC_HIGHSPEED_52MHZ which could be fixed later. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: i.MX esdhc: get additional parameters from devicetreeSascha Hauer2013-05-311-0/+2
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci fsl-esdhc: implement detect driver callbackSascha Hauer2013-05-311-2/+11
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: imx-esdhc: allow to specify devicename via OF aliasSascha Hauer2013-05-301-1/+6
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci i.MX esdhc: Fix clock divider calculationSascha Hauer2013-05-301-19/+27
| | | | | | | | | | | | | | | This updates the i.MX esdhc divider settings to FSLs U-Boot. Current timings work fine for SD cards, but not for eMMC. Although the calculation is fine according to the datasheet and reading from eMMC works, writing is broken. Atleast on i.MX53/tqma53. With this patch the result is the same, but uses different divider values to achieve it. While at it, replace the udelay with a busy-loop. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: imx-esdhc: factor out common sdhci registersSascha Hauer2013-05-301-96/+87
| | | | | | | | | | | | | | | | This gives the SDHCI specific registers a common name and moves them to a separate file for use by other SDHCI like drivers. The SDHCI spec has some 16bit and 8bit registers. The i.MX accesses these as 32bit registers. These register defines now are named after the SDHCI registers they combine into one, for example: SDHCI_HOST_CONTROL__POWER_CONTROL__BLOCK_GAP_CONTROL is the 32bit version of the SDHCI registers HOST_CONTROL, POWER_CONTROL and BLOCK_GAP_CONTROL. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: imx-esdhc: remove cache snoop register accessSascha Hauer2013-04-261-7/+0
| | | | | | | Remove some leftover from former powerpc support which has no relevance for i.MX based esdhc controllers. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Use new device_platform_driver() macro for driversAlexander Shiyan2013-02-131-8/+1
| | | | | Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci i.MX esdhc: implement card_present callbackSascha Hauer2013-01-201-11/+3
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci i.MX esdhc: Allow to specify devicename from platformdataSascha Hauer2012-12-171-0/+3
| | | | | | For boards which need to have persistent names for the device file. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci i.MX esdhc: turn error message into debug messageSascha Hauer2012-12-051-1/+1
| | | | | | | | During card probe the mci core may send commands to the card which the card doesn't understand. This is intended, so do not print an error message here. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/imx-clk'Sascha Hauer2012-10-041-4/+12
|\
| * ARM i.MX: Remove old clock supportSascha Hauer2012-10-041-1/+0
| | | | | | | | | | | | | | The old clock support is now unused. Remove it. The former i.MX clko command is superseeded by generic clock manipulation commands. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * mci i.MX ESDHC: Switch to clock supportSascha Hauer2012-10-041-3/+12
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | switch all platform_bus device/driver registering to ↵Jean-Christophe PLAGNIOL-VILLARD2012-10-041-1/+1
|/ | | | | | | | platform_driver/device_register now register_driver and register_device are for bus only usage. Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* Merge branch 'for-next/remove-fsf-address'Sascha Hauer2012-10-031-4/+0
|\ | | | | | | | | | | Conflicts: drivers/net/miidev.c include/miidev.h
| * Treewide: remove address of the Free Software FoundationSascha Hauer2012-09-171-4/+0
| | | | | | | | | | | | | | The FSF address has changed in the past. Instead of updating it each time the address changes, just drop it completely treewide. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/driver'Sascha Hauer2012-10-031-5/+17
|\ \
| * | mci i.MX esdhc: Add oftree supportSascha Hauer2012-09-231-5/+17
| |/ | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / mci imx-esdhc: increase write timeoutSascha Hauer2012-09-291-1/+1
|/ | | | | | | | | | The timeout for wating for the bus to be idle is too short when the card does internal garbage collection. This was triggered with filling an SD card under Linux with /dev/urandom, then doing a saveenv under barebox afterwards. Linux has timeouts here up to 300ms. Use a second to be safe. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* MMC i.MX esdhc: Fix sparse warningsSascha Hauer2012-06-301-10/+10
| | | | | | mostly by moving the registers into the correct address space. 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>
* 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>
* 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 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: remove unused device argument from set_iosSascha Hauer2012-02-091-2/+1
| | | | | | This argmuent is unused in all drivers, so remove it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci core: replace discrete ios values with struct iosSascha Hauer2012-02-091-4/+12
| | | | | | | 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>
* 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>
* mci imx esdhc: enable i.MX53 fix for i.MX51 aswellSascha Hauer2011-12-051-1/+2
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* introduce io.hSascha Hauer2011-09-221-1/+1
| | | | | | | To allow for some generic io accessors introduce io.h and use this instead of asm/io.h throughout the tree. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: parent fixupsSascha Hauer2011-08-171-0/+1
| | | | | | | Make the mci host a child of the hardware device and the disk a child of the mci host. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* MCI imx-esdhc: remove unnecessary large delaySascha Hauer2011-07-251-5/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* MCI imx-esdhc: Fix multiblock transfers on i.MX53Sascha Hauer2011-07-251-8/+13
| | | | | | | | | | | | | | | | | | | In the Kernel this bug is described like this: > The CMDTYPE of the CMD register (offset 0xE) should be set to > "11" when the STOP CMD12 is issued on imx53 to abort one > open ended multi-blk IO. Otherwise the TC INT wouldn't > be generated. > In exact block transfer, the controller doesn't complete the > operations automatically as required at the end of the > transfer and remains on hold if the abort command is not sent. > As a result, the TC flag is not asserted and SW received timeout > exeception. Bit1 of Vendor Spec registor is used to fix it. We do not use exact block transfers in barebox, so we only need the first part of this fix. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci i.MX esdhc: convert to struct resourceSascha Hauer2011-07-191-1/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* MCI imx-esdhc: Fix cache flush/inval for multi block supportSascha Hauer2011-07-051-3/+3
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* imx-esdhc: fix printf compiler warningsSascha Hauer2011-01-071-1/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: Add i.MX esdhc supportSascha Hauer2010-10-111-0/+512
This adds a driver for the esdhc controller found on Freescale i.MX25/35/51 SoCs. This code is based on the U-Boot driver. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>