9
0
Fork 0
Commit Graph

43 Commits

Author SHA1 Message Date
Sascha Hauer d3c96d6522 Merge branch 'for-next/mci'
Conflicts:
	arch/arm/boards/tqma53/board.c
2014-02-03 09:55:52 +01:00
Sascha Hauer 8e174d41f0 mci: imx-esdhc: Add i.MX25 compatible entry
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-31 18:51:53 +01:00
Markus Niebel fa5bdb30ee mci: imx-esdhc: add DSR support
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>
2014-01-15 15:22:56 +01:00
Sascha Hauer b67b2671c2 treewide: Add missing includes
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>
2013-11-08 15:42:04 +01:00
Markus Niebel e3ab3078dc MCI: imx-esdhc: implement workaround for errata ENGcm12360
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>
2013-09-11 12:20:01 +02:00
Sascha Hauer 2302fc6076 mci: rename capabilities flags
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>
2013-06-03 10:59:53 +02:00
Sascha Hauer 9aad0fb2d6 mci: i.MX esdhc: get additional parameters from devicetree
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-05-31 18:19:16 +02:00
Sascha Hauer 0ea008e15b mci fsl-esdhc: implement detect driver callback
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-05-31 12:32:16 +02:00
Sascha Hauer 86974b5d99 mci: imx-esdhc: allow to specify devicename via OF alias
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-05-30 12:18:28 +02:00
Sascha Hauer 93b1578323 mci i.MX esdhc: Fix clock divider calculation
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>
2013-05-30 12:18:27 +02:00
Sascha Hauer bd1bf53b34 mci: imx-esdhc: factor out common sdhci registers
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>
2013-05-30 12:18:27 +02:00
Sascha Hauer aec4ccd96b mci: imx-esdhc: remove cache snoop register access
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>
2013-04-26 23:20:24 +02:00
Alexander Shiyan 6a256321b8 Use new device_platform_driver() macro for drivers
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-02-13 09:23:28 +01:00
Sascha Hauer d21575ddea mci i.MX esdhc: implement card_present callback
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-01-20 10:53:30 +01:00
Sascha Hauer de3c258d41 mci i.MX esdhc: Allow to specify devicename from platformdata
For boards which need to have persistent names for the device file.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-12-17 08:42:32 +01:00
Sascha Hauer 63cfa83739 mci i.MX esdhc: turn error message into debug message
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>
2012-12-05 19:57:47 +01:00
Sascha Hauer 94de405d8f Merge branch 'for-next/imx-clk' 2012-10-04 15:24:57 +02:00
Sascha Hauer d4edd480b2 ARM i.MX: Remove old clock support
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>
2012-10-04 15:19:57 +02:00
Sascha Hauer c7cea55e0a mci i.MX ESDHC: Switch to clock support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-10-04 15:19:56 +02:00
Jean-Christophe PLAGNIOL-VILLARD 3c5327e660 switch all platform_bus device/driver registering to 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>
2012-10-04 15:19:12 +02:00
Sascha Hauer d1e65d2a7b Merge branch 'for-next/remove-fsf-address'
Conflicts:
	drivers/net/miidev.c
	include/miidev.h
2012-10-03 21:12:48 +02:00
Sascha Hauer d4541ee94f Merge branch 'for-next/driver' 2012-10-03 21:09:34 +02:00
Sascha Hauer 4062e094db mci imx-esdhc: increase write timeout
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>
2012-09-29 12:55:07 +02:00
Sascha Hauer c6fb692a92 mci i.MX esdhc: Add oftree support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-09-23 21:15:12 +02:00
Sascha Hauer 77322aa896 Treewide: remove address of the Free Software Foundation
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>
2012-09-17 10:57:41 +02:00
Sascha Hauer cbba269403 MMC i.MX esdhc: Fix sparse warnings
mostly by moving the registers into the correct address space.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-30 22:34:54 +02:00
Sascha Hauer 6f20c7bc70 mmc i.MX esdhc: Add i.MX6 support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-04-24 10:31:47 +02:00
Alexander Shiyan e316d92fa4 Remove duplicate voltage setup for imx-esdhc
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>
2012-03-18 16:16:26 +01:00
Sascha Hauer 3c30f3b971 mci i.MX esdhc: make 8bit modes platform dependent
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>
2012-02-09 14:35:38 +01:00
Sascha Hauer 7cb73292e2 mci i.MX esdhc: use timeout loops
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>
2012-02-09 14:35:07 +01:00
Sascha Hauer 0b3c58c820 mci: remove unused device argument from set_ios
This argmuent is unused in all drivers, so remove it.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-02-09 12:44:27 +01:00
Sascha Hauer 0f9892cce8 mci core: replace discrete ios values with struct ios
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>
2012-02-09 12:40:11 +01:00
Jean-Christophe PLAGNIOL-VILLARD 521c8ff41e imx-esdhc: add support of card detect
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-05 17:57:38 +01:00
Sascha Hauer 2a169b51b1 mci imx-esdhc: do not overwrite probed host caps
The caps are read from the hardware but overwritten afterwards.
Fix this.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-05 09:56:46 +01:00
Sascha Hauer 8675e8c575 mci imx esdhc: enable i.MX53 fix for i.MX51 aswell
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-05 09:56:35 +01:00
Sascha Hauer 3ee7877a48 introduce io.h
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>
2011-09-22 19:03:05 +02:00
Sascha Hauer c41360cd20 mci: parent fixups
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>
2011-08-17 09:36:30 +02:00
Sascha Hauer db0c472af8 MCI imx-esdhc: remove unnecessary large delay
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-07-25 11:14:01 +02:00
Sascha Hauer d8f171b96e MCI imx-esdhc: Fix multiblock transfers on i.MX53
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>
2011-07-25 11:14:01 +02:00
Sascha Hauer 50f998edf4 mci i.MX esdhc: convert to struct resource
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-07-19 00:12:51 +08:00
Sascha Hauer 26daaaa730 MCI imx-esdhc: Fix cache flush/inval for multi block support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-07-05 09:32:19 +02:00
Sascha Hauer 48a028bb8d imx-esdhc: fix printf compiler warnings
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-01-07 11:38:02 +01:00
Sascha Hauer 84c7dc4df2 mci: Add i.MX esdhc support
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>
2010-10-11 13:10:44 +02:00