9
0
Fork 0
Commit Graph

291 Commits

Author SHA1 Message Date
Sascha Hauer 9d6246199e mci omap: make write support optional
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-04-12 10:39:20 +02:00
Sascha Hauer 3381b83a78 mci omap: rename functions from mxc to omap
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-04-12 10:39:20 +02:00
Sascha Hauer 355b713b86 mci omap: hsmmc is also found on the omap3
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-04-12 09:54:57 +02:00
Sascha Hauer 64cc568eda mci: make write support optional
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-04-11 15:57:51 +02:00
Sascha Hauer 1ac850c488 mci: make it compile without info support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-04-11 12:36:07 +02:00
Sascha Hauer 9ba8f95724 Merge branch 'omap-drivers' into next 2011-04-06 09:20:21 +02:00
Sascha Hauer 4cdf069d2a mci: Add omap hsmmc driver
This driver is based on the U-Boot omap hsmmc driver by
Sukumar Ghorai <s-ghorai@ti.com>.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-04-04 15:27:45 +02:00
Sascha Hauer c8df17c05f mmc: check correctness of the voltage mask in ocr
Most cards do not answer if some reserved bits
in the ocr are set. However, some controllers
can set bit 7 (reserved for low voltages), but
how to manage low voltages SD card is not yet
specified.

based on the original U-Boot patch from
Stefano Babic <sbabic@denx.de>

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-04-04 15:02:35 +02:00
Sascha Hauer 086b06aa51 mci mxs: no need to call mxs_mci_setup_clock_speed in init
It will be called by set_ios anyway later. Also, do not
alter host->clock field, this is none of our business.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-03-08 12:30:58 +01:00
Sascha Hauer 5259adf5c9 mci mxs: make the mci_host a member of mxs_mci_host
This allows for more type safety. passing a struct device_d
internally in the driver is not a good idea. Also, this
patch adds a void __iomem *regs to mxs_mci_host. dev->map_base
should not be used for register accesses.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-03-08 12:30:58 +01:00
Sascha Hauer 353d1ffa3d mci mxs: rename mci_pdata to host
struct mci_host is named host in the rest of the driver, so
name it like this consistently.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-03-08 12:30:58 +01:00
Sascha Hauer 11acf70800 mci mxs: give functions a uniq mxs_mci_ namespace
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-03-08 12:30:58 +01:00
Sascha Hauer bbee3017c7 mci mxs: put only once used function inline
Also, rename mci_rename after the callback it implements: stm_mci_initialize.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-03-08 12:28:46 +01:00
Sascha Hauer 246dbb3001 mci i.MX23/28: rename driver to mxs.c
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-03-08 12:28:46 +01:00
Sascha Hauer a4ad98bfa4 mci stmp378x: remove ifdefed code
There is no need to fill the FIFOs before starting a transfer, so
remove corresponding code which is commented out anyway. Additionally
this fixes a compiler warning with gcc4.5

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Acked-by: Jürgen Beisert <jbe@pengutronix.de>
2011-03-08 12:27:43 +01:00
Sascha Hauer e88d86a445 ARM: rename STM arch to mxs
We never supported the sigmatel stm chips and probably
never will. So do the first step and rename the architecture
to mxs just like in the kernel.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-01-20 10:43:24 +01:00
Sascha Hauer 2f0109b1bb Merge branch 'master' into next 2011-01-17 09:43:40 +01:00
Sascha Hauer 7c1e5d6dd7 mci-core: fix printf compiler warnings
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-01-07 11:38:11 +01: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
Krzysztof Halasa c5baa0edc4 Fix error handling with malloc, memalign etc. Introduce xmemalign().
The idea is to panic() when there is no memory available for normal
operation. Exception: code which can consume arbitrary amount of RAM
(example: files allocated in ramfs) must report error instead of panic().

This patch also fixes code which didn't check for NULL from malloc() etc.

Usage: malloc(), memalign() return NULL when out of RAM.
xmalloc(), xmemalign() always return non-NULL or panic().

Signed-off-by: Krzysztof Hałasa <khc@pm.waw.pl>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-01-07 10:21:22 +01:00
Sascha Hauer 50352ae9d9 Merge branch 'led' into next 2010-12-21 08:25:31 +01:00
Juergen Beisert 0df242defb STM378x: Adapt the MCI driver to support i.MX23 and i.MX28
Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-12-14 15:15:07 +01:00
Juergen Beisert 8dc537022e STM378x: Use Hz as the clock unit like in all other arch
i.MX23 currently uses kHz as the unit for its clock handling and calculation
to avoid overflows when calculation with the internal 480 MHz PLL and its
fractional divider. This patch changes all routines to accept Hz and deliver
Hz as the clock unit.

Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-12-14 15:15:06 +01:00
Juergen Beisert f3d7fe0673 Add macro for correct rounding in integer devisions
Just stolen from Linux.

Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-12-14 15:15:06 +01:00
Juergen Beisert 46862a199c STM/MCI: Fix wrong register bit
Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-12-09 16:16:24 +01:00
Marek Belisko 804e0b0084 drivers: mci: Fix compilation warning.
Fix compilation warning:
drivers/mci/mci-core.c:1002:
warning: comparison of distinct pointer types lacks a cast

Signed-off-by: Marek Belisko <marek.belisko@open-nandra.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-11-26 08:24:35 +01:00
Robert Schwebel d65ee96da2 doc: fix parameter name in mci-core
Silence this warning:

drivers/mci/mci-core.c:1324: Warning: argument `pdata' of command @param is not found in the argument list of mci_register(struct mci_host *host)
drivers/mci/mci-core.c:1324: Warning: The following parameters of mci_register(struct mci_host *host) are not documented:
  parameter host

Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-10-22 20:47:03 +02:00
Sascha Hauer 13c09da676 mci: align data for commands
Some mci controllers cannot transfer data with their DMA engines
if the data is not sufficiently aligned. Normally this is a driver
problem, but hey, we have no problem aligning the data and keep
the burden from the drivers.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Juergen Beisert <jbe@pengutronix.de>
Acked-by: Juergen Beisert <jbe@pengurtronix.de>
2010-10-22 19:32:01 +02:00
Sascha Hauer d339b76797 mci-core: add multiple block support
So far only for reading blocks. This is based on the corresponding
U-Boot code.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Juergen Beisert <jbe@pengutronix.de>
Acked-by: Juergen Beisert <jbe@pengurtronix.de>
2010-10-22 19:31:35 +02:00
Juergen Beisert fe366aa8ec Adapt the i.MX23 MCI driver to the v2 i.MX23 patch series
The i.MX23 v2 architecture patch series was sligthly modified to easify
the i.MX28 architecture addition later on. So, we need now an index to
query the SSP clock frequency.

Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-10-21 22:16:10 +02:00
Juergen Beisert 32fc00e72f Make the clock calculation easier to read and correct
Due to a wrong rounding while calculating the clock divider the requested clock
of 25 MHz resulted into a 48 MHz clock. With this patch a clock frequency
below or equal the requested one will be set.
By using 'div' and 'rate' as vars, its also easier to check against the data
sheet.

Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-10-21 22:15:36 +02:00
Eric Bénard 7c9016431b mci-core: add more tested SD Cards
note :
- Transcend 16GiB fails (no log)
- Micron 8GiB eMMC fails (hangs after : Detecting a 4.0 revision card)

Signed-off-by: Eric Bénard <eric@eukrea.com>
2010-10-14 13:07:14 +02:00
Juergen Beisert 869baba658 mci: mark 'old Canon SD 16 MiB' as working
This card is working since 'mci: handle SD cards < 2.0 correctly'

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Tested-by: Jürgen Beisert <jbe@pengutronix.de>
2010-10-11 15:17:43 +02:00
Sascha Hauer be2be409c0 mci: align write buffer if necessary
Most SD controllers need some kind of alignment for writing
blocks. Instead of coding this in every driver, align write
blocks to a 4 byte alignment in the mci layer. For DMA
accesses we may need bigger alignment, but let's solve this
problem when we have it.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-10-11 13:22:13 +02:00
Sascha Hauer f78e8f84fe mci: handle SD cards < 2.0 correctly
With SD cards older than 2.0 the sd_send_if_cond() fails. Do
not assume it's an MMC card in this case. Instead, assume
it's a MMC card if sd_send_op_cond() fails.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-10-11 13:22:13 +02:00
Sascha Hauer b98c977cf0 mci: print error code on failure
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-10-11 13:22:09 +02: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
Sascha Hauer 5492d01eaa mci: Add i.MX27/31 driver
Add i.MX27/31 driver

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-10-11 13:08:27 +02:00
Juergen Beisert 3bf1bd9b33 Add S3C2440 MCI card support
Adding MCI card support for S3C2440 CPUs. This is for reference only, as there
is currently no user in the barebox tree. Maybe one with access to the A9M2440
development kit can check it on his/her system.
Checked here with my own S3C2440 based system which is not in the barebox tree.

Signed-off-by: Juergen Beisert <juergen@kreuzholzen.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-10-11 13:08:27 +02:00
Juergen Beisert 916a1ca70a Add i.MX23 MCI card support
Adding MCI card support for STM378x/i.MX23 CPUs. This is for reference only,
as this architecture is currently not part of barebox (but will coming soon).
Its tested on the i.MX23 based ChumbyOne.

Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-10-11 13:08:27 +02:00
Juergen Beisert 7051227d2e Add MCI card support to barebox
This adds the basic framework to handle MCI cards in barebox.

Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-10-11 13:08:27 +02:00