9
0
Fork 0
Commit Graph

31 Commits

Author SHA1 Message Date
Uwe Kleine-König 3bd7f80d8f mci: mxs: support overwriting the device name via platform data
The current implementation of the bootloader specification depends on the
hardware name and the name of the device in /dev to match. As the default
hardware name is mciX and the device name is diskY the bootloader spec
cannot be used as is.

This patch implements a way to overwrite the device name similar to what is
possible for the imx-esdhc driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-11-11 11:16:22 +01:00
Sascha Hauer ca13a84ac2 ARM: MXS: introduce stmp device support
MXS specific devices have some common infrastructure in the kernel
known as STMP devices. We have the same in barebox, but with a
mxs_ prefix instead of a stmp_ prefix. As some STMP devices are
also found on i.MX6 move the common infrastructure out of MXS
specific files and use the stmp_ prefix.

This is done in preparation for i.MX6 NAND support.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-23 16:25:13 +02:00
Sascha Hauer 1d0e15f098 mci: mxs: use common clk API
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-06-20 08:49:56 +02:00
Sascha Hauer 97f88df3fd mci: mxs: Use dev_*
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-06-20 08:49:56 +02:00
Sascha Hauer 73b0d228e5 driver: Attach info callback to device, not to driver
Since the info is device specific and not driver specific, attach
the callback to the device. This makes it possible to have a info
callback for a device which does not have a driver attached.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-05-30 12:18:27 +02:00
Juergen Beisert 6a5e4f0c89 MCI/MXS: fix signed/unsigned mismatch
Using the MXS MCI driver with an eight bit capable eMMC results into the
'devinfo' message the interface uses '0' bits for data transfer:

 barebox:/ devinfo mxs_mci0
 resources:
 num   : 0
 start : 0x80034000
 size  : 0x00002000
 driver: mxs_mci
 bus: platform

  Interface
   Min. bus clock: 1476 Hz
   Max. bus clock: 48000000 Hz
   Current bus clock: 24000000 Hz
   Bus width: 0 bit

The eight bit interface width is stored internally as value '2'. And a two bit
'2' ends up into 0xfffffffe when used as an array index. Using an unsigned
field instead fixes this issue:

 barebox:/ devinfo mxs_mci0
 resources:
 num   : 0
 start : 0x80034000
 size  : 0x00002000
 driver: mxs_mci
 bus: platform

  Interface
   Min. bus clock: 1476 Hz
   Max. bus clock: 48000000 Hz
   Current bus clock: 24000000 Hz
   Bus width: 8 bit

Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-05-08 23:24:50 +02:00
Sascha Hauer 646a0d058d Merge branch 'for-next/mxs' 2013-05-06 09:30:28 +02:00
Sascha Hauer a20caf6c57 Merge branch 'for-next/mci' 2013-05-06 09:30:27 +02:00
Juergen Beisert 47e2d9f6e5 MCI/MXS: report a better matching error code when the transfer fails
EIO is a better error message to describe the data transfer to or from the SD cards has failed.

Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-04-27 00:06:24 +02:00
Juergen Beisert 93c90a9636 MXS/MCI: simplify reset of the MCI device block
Since a generic block reset function is a available, also the MCI driver
should make use of it.

Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-04-27 00:05:27 +02:00
Juergen Beisert 57c64582a0 MXS/MCI: don't touch variables in the host structure
MMC_BUS_WIDTH_* macros do not correspond with the real bus width.
After setting a bus width larger than 1 bit the next call to change the
frequency ends in the default handler and the host interface stays silently
at the previous frequency.

Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-04-26 23:59:34 +02:00
Sascha Hauer ea0f831cd0 Merge branch 'for-next/mxs' 2013-03-04 09:21:54 +01: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
Michael Grzeschik a90c32c861 ARM mxs: ssp move to common register layout
This patch moves the register defines and bit definitions
into one include file. As the defines are common for ssp
and mci devices they can be shared.

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-02-11 20:58:34 +01:00
Sascha Hauer a01e54d201 treewide: fix format specifiers
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-01-27 14:24:10 +01: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 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 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
Sascha Hauer 74b83f9119 mci mxs: do not use external define for internal use
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-02-09 12:40:11 +01:00
Sascha Hauer 597da1b76e Merge branch 'next' 2011-10-09 03:58:49 +02: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
Wolfram Sang 75d9c8abeb mci: mxs: fix 'use resources' conversion
Commit 4c542622 used the wrong variable name and caused a build failure.

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-09-14 10:37:10 +02:00
Sascha Hauer ad8d12dd66 mci mxs: fix line endings
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-08-15 09:45:48 +02:00
Jean-Christophe PLAGNIOL-VILLARD 4c542622cb mci: switch to "struct resource"
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2011-07-23 13:52:17 +08: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