summaryrefslogtreecommitdiffstats
path: root/drivers/mci
Commit message (Collapse)AuthorAgeFilesLines
* atmel_mci: add devname pdata supportJean-Christophe PLAGNIOL-VILLARD2013-09-181-0/+1
| | | | | | | so we can specify the devname in the board Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: add designware mmc controller supportSascha Hauer2013-09-113-0/+618
| | | | | | Based on the U-Boot driver. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* MCI: imx-esdhc: implement workaround for errata ENGcm12360Markus Niebel2013-09-112-0/+16
| | | | | | | | | | | | | | | | | | | | 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>
* Merge branch 'for-next/omap'Sascha Hauer2013-09-051-5/+21
|\ | | | | | | | | Conflicts: arch/arm/boards/pcm051/env/config
| * mci: omap: Allow to set mmc devname via platformdataSascha Hauer2013-08-271-4/+10
| | | | | | | | | | | | To be able to get persistent names for the sd/mmc devices. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * mci: omap: implement device detect callbackSascha Hauer2013-08-271-0/+10
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * mci: omap: advertise 8 bit supportSascha Hauer2013-08-271-1/+1
| | | | | | | | | | | | | | The driver is already capable of 8 bit buswidth support, so advertise it to actually make use of it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | mci: sdhci: fix IRQSTAT_DMAE bit shiftSteffen Trumtrar2013-08-261-1/+3
|/ | | | | | | | | | According to the SD Host Controller Specification Version 3.00, the ADMA error status bit is on the wrong bit. Fix this. While at it, add the missing standard error status bits. Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/of'Sascha Hauer2013-08-051-5/+8
|\ | | | | | | | | | | Conflicts: arch/arm/boards/freescale-mx53-loco/board.c drivers/of/Makefile
| * mci: Add devicetree partition parsingSascha Hauer2013-07-181-0/+1
| | | | | | | | | | | | | | | | | | MMC/SD cards normally have a DOS/GPT partition table, but sometimes barebox uses the unpartitioned area to store its environment. Add devicetree partition parsing also for SD/MMC cards so that we have a way to describe the partition in the devicetree. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * mci: set partnames of eMMC boot partitionsSascha Hauer2013-07-151-5/+7
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | ARM: MXS: introduce stmp device supportSascha Hauer2013-07-231-2/+2
|/ | | | | | | | | | | | 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>
* Merge branch 'for-next/mxs'Sascha Hauer2013-07-011-56/+37
|\
| * mci: mxs: use common clk APISascha Hauer2013-06-201-41/+19
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * mci: mxs: Use dev_*Sascha Hauer2013-06-201-17/+20
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | mci: Use tran_speed field to fix highspeed MMC card clockSascha Hauer2013-06-201-13/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The tran_speed field as decoded from csd is valid in most cases, so use it to determine the maximum clock we can support. It is not valid though for MMC highspeed cards, in this case the csd contains invalid values and we have to set tran_speed explicitly to the maximum speed. As the values passed into mci_set_clock are now based on tran_speed we no longer have to limit the rate to tran_speed in mci_set_clock. The (intended) effect of this patch is that highspeed MMC cards are no longer limited to non highspeed rates. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | mci: add mci_caps functionSascha Hauer2013-06-201-9/+9
| | | | | | | | | | | | | | To let the card caps be card caps and not the intersection between card caps and host caps. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | mci: provide static inline function for mmc_host_is_spiSascha Hauer2013-06-201-2/+0
| | | | | | | | | | | | | | | | | | | | To prevent compiler warnings like: warning: unused variable 'host' When CONFIG_MCI_SPI is disabled. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | mci: Print more infoSascha Hauer2013-06-031-1/+27
| | | | | | | | | | | | | | | | | | | | In devinfo for the card also print: - capabilities for host and card - current bus width - current clock Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | mci: rename capabilities flagsSascha Hauer2013-06-037-21/+23
|/ | | | | | | | | | 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>
* Merge branch 'for-next/mci'Sascha Hauer2013-06-0212-419/+1225
|\ | | | | | | | | Conflicts: include/driver.h
| * mci: i.MX esdhc: get additional parameters from devicetreeSascha Hauer2013-05-311-0/+2
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * mci: Add devicetree helper functionSascha Hauer2013-05-311-0/+38
| | | | | | | | | | | | | | This adds helper code to parse the bus-width and max-frequency property from devicetree. 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: implement detect driver callbackSascha Hauer2013-05-311-0/+21
| | | | | | | | 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: set name of mci device to same name as the filenameSascha Hauer2013-05-301-2/+8
| | | | | | | | | | | | | | | | | | | | We already have the possibility to register a mci with a certain filename to get persistent names. However, the device needed to find the probe parameter still has the name 'mcix'. This patch changes this by registering the mci device with the same name as the filename. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * mci: embed mci device into struct mciSascha Hauer2013-05-301-122/+95
| | | | | | | | | | | | To safe a separate allocation and to make the code simpler. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * mci: make mci device a pure deviceSascha Hauer2013-05-301-8/+20
| | | | | | | | | | | | | | No need to match and probe the device if all that we want is a logical deivice for the mci. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * driver: Attach info callback to device, not to driverSascha Hauer2013-05-304-24/+14
| | | | | | | | | | | | | | | | 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>
| * mci: Add support for MMC boot partitionsSascha Hauer2013-05-302-42/+154
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some MMC cards support boot partitions. These are special regions on the MMC card intended to put a bootloader on. This patch adds support for these partitions, they are accessible as /dev/diskx.boot[0|1]. Additionally the partitions can be configured bootable using a device parameter. This can be used to mark the user area or one of the boot partitions as bootable. Since this feature is mostly seen on eMMC cards it is made optional to lower the size impact for boards which do not have eMMC. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * mci i.MX esdhc: Fix clock divider calculationSascha Hauer2013-05-302-19/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Sort Makefile entriesAlexander Shiyan2013-05-301-9/+9
| | | | | | | | | | Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * ARM: OMAP MCI: Move TWL6030 power initialization into OMAP directoryAlexander Shiyan2013-05-302-30/+0
| | | | | | | | | | Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * Added sd driver for bcm2835 (Raspberry PI)wilhelm2013-05-304-0/+669
| | | | | | | | | | | | Replaced defines according to sdhci.h Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * mci: imx-esdhc: factor out common sdhci registersSascha Hauer2013-05-303-185/+175
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | treewide: Fix typo seperate -> separateSascha Hauer2013-05-211-1/+1
|/ | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* MCI/MXS: fix signed/unsigned mismatchJuergen Beisert2013-05-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Merge branch 'for-next/param'Sascha Hauer2013-05-061-33/+13
|\ | | | | | | | | Conflicts: drivers/mci/mci-core.c
| * console: Use dev_add_param_int for baudrate parameterSascha Hauer2013-04-111-7/+8
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * mci: Use dev_add_param_int for probe parameterSascha Hauer2013-04-111-28/+10
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/mxs'Sascha Hauer2013-05-061-14/+2
|\ \
| * | MXS/MCI: simplify reset of the MCI device blockJuergen Beisert2013-04-271-14/+2
| |/ | | | | | | | | | | | | | | 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>
* | Merge branch 'for-next/misc'Sascha Hauer2013-05-062-3/+6
|\ \
| * | MCI: imx: Fix possible null pointer dereferenceAlexander Shiyan2013-04-301-2/+3
| | | | | | | | | | | | | | | Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | MCI: atmel: Fix possible null pointer dereferenceAlexander Shiyan2013-04-301-1/+3
| |/ | | | | | | | | Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/mci'Sascha Hauer2013-05-063-11/+9
|\ \
| * | MCI/MXS: report a better matching error code when the transfer failsJuergen Beisert2013-04-271-2/+2
| | | | | | | | | | | | | | | | | | | | | 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>
| * | MCI/Core: honor transmission limits at the card's sideJuergen Beisert2013-04-271-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | The host limits are only one limit we must honor when changing the transmission frequency. The SD cards have their own limits, so take them also into account. Signed-off-by: Juergen Beisert <jbe@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | MCI/Core: increase the transmission frequency while card detectionJuergen Beisert2013-04-271-1/+2
| | | | | | | | | | | | | | | | | | | | | According to the SD card spec the detection can happen at 400 kHz Signed-off-by: Juergen Beisert <jbe@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>