summaryrefslogtreecommitdiffstats
path: root/drivers/mci
Commit message (Collapse)AuthorAgeFilesLines
* MCI: pxa: depend on right symbolLucas Stach2015-06-261-1/+1
| | | | | | | | | Now that we also have PXA3XX support the dependency on ARCH_PXA is too broad for this driver. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Acked-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: imx-esdhc: Replace printf with dev_*Sascha Hauer2015-05-131-14/+15
| | | | | | | This replaces printf with dev_* since a struct device_d * is available. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: imx-esdhc: Check for errors in esdhc_pio_read_writeSascha Hauer2015-05-131-7/+7
| | | | | | | esdhc_pio_read_write can fail, so let it return an error code rather than void. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: imx-esdhc: Use IS_ENABLED() instead of #ifdefSascha Hauer2015-05-131-55/+69
| | | | | | To get rid of some #ifdefery. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* of: use 'const void *' for struct of_device_id.dataAntony Pavlov2015-04-301-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since 2011 barebox' of_device_id struct uses unsigned long type for data field: struct of_device_id { char *compatible; unsigned long data; }; Almost always struct of_device_id.data field are used as pointer and need 'unsigned long' casting. E.g. see 'git grep -A 4 of_device_id drivers/' output: drivers/ata/sata-imx.c:static __maybe_unused struct of_device_id imx_sata_dt_ids[] = { drivers/ata/sata-imx.c- { drivers/ata/sata-imx.c- .compatible = "fsl,imx6q-ahci", drivers/ata/sata-imx.c- .data = (unsigned long)&data_imx6, drivers/ata/sata-imx.c- }, { Here is of_device_id struct in linux kernel v4.0: struct of_device_id { char name[32]; char type[32]; char compatible[128]; const void *data; }; Changing of_device_id.data type to 'const void *data' will increase barebox' linux kernel compatibility and decrease number of 'unsigned long' casts. Part of the patch was done using the 'coccinelle' tool with the following semantic patch: @rule1@ identifier dev; identifier type; identifier func; @@ func(...) { <... - dev_get_drvdata(dev, (unsigned long *)&type) + dev_get_drvdata(dev, (const void **)&type) ...> } @rule2@ identifier dev; identifier type; identifier func; identifier data; @@ func(...) { <... - dev_get_drvdata(dev, (unsigned long *)&type->data) + dev_get_drvdata(dev, (const void **)&type->data) ...> } Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: core: Check return value of dev_add_param_boolWadim Egorov2015-03-191-1/+2
| | | | | | | | | | | | Commit 03b59bdb64e83ebcdb9111681775117ebce0e03b changed the return values of dev_add_param_* to ERR_PTR(-ENOSYS) and broke a few boards. We have now to care about the return value of dev_add_param_bool() in mci_register(). Also set the ret variable when dev_add_param_bool() fails. Signed-off-by: Wadim Egorov <w.egorov@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* MMC: dw_mmc: PIO mode fixesAndrey Panov2015-03-091-73/+56
| | | | | | | | | | Simplify PIO mode routines. Fix a bug when IO is possibly performed twice because of using old interrupt status. Support for slow-speed card writes. Signed-off-by: Andrey Panov <rockford@yandex.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/tegra'Sascha Hauer2015-03-091-0/+3
|\
| * mci: tegra: handle mmc aliasesLucas Stach2015-03-041-0/+3
| | | | | | | | | | | | | | | | This allows to have fixed device names for the SDMMC controllers. Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/streaming-dma'Sascha Hauer2015-03-094-38/+47
|\ \ | | | | | | | | | | | | Conflicts: drivers/mci/dw_mmc.c
| * | MCI: tegra-sdmmc: convert to streaming DMA opsLucas Stach2015-03-061-12/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | Move to the common streaming DMA ops in order to get rid of the direct usage of the ARM MMU functions for the cache maintenance. Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | MCI: imx: convert to streaming DMA opsLucas Stach2015-03-061-11/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | Move to the common streaming DMA ops in order to get rid of the direct usage of the ARM MMU functions for the cache maintenance. Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | MCI: dw-mmc: convert to streaming DMA opsLucas Stach2015-03-062-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | Move to the common streaming DMA ops in order to get rid of the direct usage of the ARM MMU functions for the cache maintenance. Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | ARM: move DMA alloc functions to dma.hLucas Stach2015-03-061-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This better separates the DMA from the MMU functionality. Also move all drivers that only depends on asm/mmu.h for the alloc functions over to the common header. Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | ARM: change dma_alloc/free_coherent to match other architecturesLucas Stach2015-03-061-1/+2
| |/ | | | | | | | | | | | | | | | | As a lot drivers currently rely on the 1:1 virt->phys mapping on ARM we define DMA_ADDRESS_BROKEN to mark them. In order to use them on other architectures with a different mapping they need proper fixing. Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / MMC: dw_mmc: Add support for PIO mode and Rockchip variant of this hardwareAndrey Panov2015-03-052-15/+194
|/ | | | | Signed-off-by: Andrey Panov <rockford@yandex.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/mxs'Sascha Hauer2015-02-041-23/+27
|\
| * mci: mxs: Add devicetree supportSascha Hauer2015-01-281-23/+27
| | | | | | | | | | | | | | Add device tree compatibles and allow retrieving data from device tree instead of platform_data only. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | MMC: IMX: Reset MMC_BOOT register after controller reset.Andrey Panov2015-01-192-0/+4
|/ | | | | | | | This helps with EMMC detection when booting from EMMC directly. Taken from u-boot. Signed-off-by: Andrey Panov <rockford@yandex.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* drivers: remove unnecessary mach/imx-regs.h includeSascha Hauer2015-01-051-1/+0
| | | | | | And replace the ones needed with the SoC specific header. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/randconfig-1'Sascha Hauer2014-12-081-2/+0
|\
| * mci: mxs-mci: add f_min/f_max fields unconditionallySascha Hauer2014-11-281-2/+0
| | | | | | | | | | | | | | Parts of the driver need these regardless of whether CONFIG_MCI_INFO is set, so add these fields unconditionally. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/imx'Sascha Hauer2014-12-081-2/+5
|\ \ | |/ |/|
| * mci: imx-esdhc: Add i.MX6sl compatibleSascha Hauer2014-11-271-0/+2
| | | | | | | | | | | | Which will also be used for the i.MX6sx. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * mci: imx-esdhc: Fix Interrupt enable register for i.MX6sxSascha Hauer2014-11-271-2/+3
| | | | | | | | | | | | | | The reset default of this register has changed on i.MX6sx. Explicitly write the value we want to have to make it work on i.MX6sx. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | mci: esdhc: add back PIO_TIMEOUTLucas Stach2014-11-241-0/+2
|/ | | | | | | | | This got lost during bd1bf53b34c (mci: imx-esdhc: factor out common sdhci registers). Seems the PIO option isn't too heavily used. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Typoes: "whith" -> "with"Antony Pavlov2014-11-031-1/+1
| | | | | | | | | | | | | | This patch is based on linux kernel commit commit e1b8513d21845fbeb93d6d2c4973db874385059f Author: Robert P. J. Day <rpjday@crashcourse.ca> Date: Sun Feb 3 15:14:02 2008 +0200 Typoes: "whith" -> "with" Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Cc: Robert P. J. Day <rpjday@crashcourse.ca> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/resource-err-ptr'Sascha Hauer2014-10-0210-6/+26
|\
| * resource: Let dev_request_mem_region return an error pointerSascha Hauer2014-09-1610-6/+26
| | | | | | | | | | | | For all users fix or add the error check. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | mci: atmel: add new ip version 0x600 supportBo Shen2014-09-221-0/+1
|/ | | | | Signed-off-by: Bo Shen <voice.shen@atmel.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: core: the sd1.0 card can work in 4 bits modeBo Shen2014-07-291-3/+3
| | | | | | | The sd 1.0 card can work in 4 bits mode also. Signed-off-by: Bo Shen <voice.shen@atmel.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* treewide: remove address of the Free Software FoundationAntony Pavlov2014-06-112-8/+0
| | | | | | | | | | | | | | | | | | The FSF address has changed; The FSF site says that address is Free Software Foundation 51 Franklin Street, Fifth Floor Boston, MA 02110-1301 USA (see http://www.fsf.org/about/contact/) Instead of updating it each time the address changes, just drop it completely treewide. Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: tegra: add Tegra124 compatibleLucas Stach2014-06-051-0/+2
| | | | | | | | | The controller is similar enough to the ones found on earlier generation SoCs to not need any additional changes. Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: implement non-removable propertyLucas Stach2014-06-041-1/+4
| | | | | | | | There is no need to check the card-detect status for non-removable devices. Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: tegra: don't set 8bit mode unconditionallyLucas Stach2014-05-151-2/+1
| | | | | | | Those flags should be set from the DT parsing code. Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: tegra: apply pad autocalibration on T30Lucas Stach2014-05-151-0/+25
| | | | | | | | Needed for SD cards connected to sdmmc1 or sdmmc3 to work properly. Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: tegra: add reset controlLucas Stach2014-05-151-0/+9
| | | | | | | Enable the driver to reset the device itself. Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/tegra'Sascha Hauer2014-05-051-2/+2
|\ | | | | | | | | | | | | | | Conflicts: arch/arm/dts/tegra20-colibri.dtsi arch/arm/dts/tegra20-paz00.dts arch/arm/dts/tegra20.dtsi drivers/clk/tegra/clk-periph.c
| * mmc: tegra: fix typoLucas Stach2014-04-231-2/+2
| | | | | | | | | | | | | | | | | | Missed OR, so we never enabled failure interrupt status bits, which prevented the eMMC detect logic to work properly. Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | mci: Add regulator supportSascha Hauer2014-04-291-2/+16
|/ | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: core: Typo fix in printk specifierAlexander Shiyan2014-03-171-1/+1
| | | | | Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: Fix version handlingSascha Hauer2014-02-141-9/+19
| | | | | | | | | | | | Currently the version defines reflect the digits in the version number. MMC_VERSION_4_41 is defined as 0x441 and MMC_VERSION_4_5 is defined as 0x405. This results in MMC_VERSION_4_5 < MMC_VERSION_4_41 becoming true which was surely not intended. Fix this by redefining the versions as 0x<major><minor><micro>. This makes the string generation more complicated but makes versions comparable again. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/mci'Sascha Hauer2014-02-032-11/+79
|\ | | | | | | | | 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: add device tree support for DSRMarkus Niebel2014-01-151-0/+8
| | | | | | | | | | | | | | add optional DSR support. This should go into the kernel, too Signed-off-by: Markus Niebel <Markus.Niebel@tqs.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * mci: add DSR supportMarkus Niebel2014-01-151-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The eMMC and the SD-Card specifications describe the optional SET_DSR command. During measurements at our lab we found that some cards implementing this feature having really strong driver strengts per default. This can lead to voltage peaks above the specification of the host on signal edges for data sent from a card to the host. Since availability of a given card type may be shorter than the time a certain hardware will be produced it is useful to have support for this command (Alternative would be changing termination resistors and adapting the driver strength of the host to the used card.) Signed-off-by: Markus Niebel <Markus.Niebel@tqs.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * mci: production year for eMMC 4.41 and laterMarkus Niebel2014-01-101-4/+11
| | | | | | | | | | | | | | | | | | | | | | | | Year is coded in 4 bits of CID. eMMC 4.41 adds a new interpretation rule: production year for 4.41 cards and newer is between 2010 and 2025 with 0 corresponding to 2013. This fix was inspired by currect kernel code. Signed-off-by: Markus Niebel <Markus.Niebel@tqs.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * mci: Support the correct version for eMMCMarkus Niebel2014-01-101-8/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | eMMC is available up to version 4.5 but the correct version is not decoded. Change version definitions to support more minor verions, add missing versions and parse the minor versions from ext_csd. After this, card detection code and devinfo reports correct versions. Handling is inspired by u-boot code. 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>
* | mci: imx: Add devicetree probe supportSascha Hauer2014-01-291-0/+9
|/ | | | | | Only simple probing, no properties supported yet. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>