summaryrefslogtreecommitdiffstats
path: root/drivers/mci
Commit message (Collapse)AuthorAgeFilesLines
* drivers: Introduce dev_set_name()Andrey Smirnov2018-10-181-2/+2
| | | | | | | | Introduce dev_set_name() in order to hide implementation details of setting device's name so it'd be easier to change it. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: imx-esdhc: Return EFAULT when DMA mapping failsAndrey Smirnov2018-08-311-1/+1
| | | | | | | | EFAULT seems to be much more appropriate error code for DMA mapping failure Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: imx-esdhc: Specify that DMA is 32-bit onlyAndrey Smirnov2018-08-311-0/+2
| | | | | | | | ESDHC can only do a DMA transfer to 32-bit address space, so mark it as such. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/socfpga'Sascha Hauer2018-08-132-133/+159
|\
| * mci: dw: move defines to headerfileSteffen Trumtrar2018-08-082-114/+141
| | | | | | | | | | Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * mci: dw_mmc: convert to BIT() macroSteffen Trumtrar2018-08-081-49/+50
| | | | | | | | | | Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * mci: dw_mmc: remove device_d pointerSteffen Trumtrar2018-08-081-19/+17
| | | | | | | | | | | | | | | | The pointer to the struct device_d *dev is also saved to the struct mci_host. Get rid of it. Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/misc'Sascha Hauer2018-08-131-1/+1
|\ \
| * | mci: s3c: fix providing info callbackUwe Kleine-König2018-08-081-1/+1
| |/ | | | | | | | | | | | | | | | | There is no symbol iCONFIG_MCI_INFO, CONFIG_MCI_INFO makes sense here and matches what was added in the same commit to other drivers. Fixes: 73b0d228e5b0 ("driver: Attach info callback to device, not to driver") Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / mci: imx-esdhc: send required clock pulses to card on initLucas Stach2018-08-091-1/+4
|/ | | | | | | | | | | | | | | | | MMC cards need at least 74 clock pulses before any bus communication can occur. The i.MX SDHC controller auto-gates the clock when inactive, so if the SD enumeration is skipped for slots where we know that only a MMC card can be present (which is possible since b5289b742a89 "mmc: allow skipping SD card initialization") those inititialization clock pulses won't be sent out, resulting in command timeouts when trying to enumerate the card. Luckily the eSDHC controller has a hardware feature to send out 80 clock pulses. This has been validated to be available by checking the reference manual back to i.MX25. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mmc: i.MX esdhc: Add i.MX8 supportSascha Hauer2018-06-111-0/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: imx-esdhc: use dma mapping functionsSascha Hauer2018-06-111-27/+26
| | | | | | | | | | Rather than relying on the fact that addresses can be just casted into DMA addresses use proper DMA mapping functions. This fixes compiler warnings when we do DMA on this 32bit only device on aarch64 SoCs. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2018-01-221-10/+6
|\
| * mci: drop unused parameter from mci_switch()Uwe Kleine-König2018-01-221-10/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The SWITCH command has two purposes: a) switch the command set b) Write to the EXT_CSD register If the access field (bits [25:24]) in the argument are b00, we're in case a), otherwise in b). As mci_switch() always passes MMC_SWITCH_MODE_WRITE_BYTE (0b3) in the access field, only case b) is relevant here. According to the eMMC specification[1] the command set field is ignored in case b) and so the respective parameter (that is unused already now) can be dropped. [1] Embedded Multi-Media Card (e•MMC) Electrical Standard (5.1), February 2015; paragraph 6.6.1 Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Revert "mci: imx-esdhc: Enable clock"Andrey Smirnov2018-01-111-1/+0
|/ | | | | | | | | | | | This reverts commit 61c6c24958934b6b226aa37b3b3a2c089189f52b which is pretty much a duplicate of: a97345102 "i.MX: esdhc: Enable host->clk during initialization" Since we don't need to enable that clock twice reverse the former and keep the latter. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* i.MX: esdhc: wait until SDSTB is asserted, not other way arroundOleksij Rempel2017-11-171-1/+1
| | | | | | | this added 10msec on each sd/mmc clock switch request. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2017-10-191-4/+8
|\
| * mmc: allow skipping SD card initializationPhilipp Zabel2017-09-261-4/+8
| | | | | | | | | | | | | | | | | | This patch allows to skip SD card initialization for eMMCs by setting the "no-sd" property in the host controller device tree node. Avoiding two SD command timeouts speeds up detection time by well over 200 ms. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | mci: mmci: add DT supportLucas Stach2017-10-171-3/+36
|/ | | | | | | | | | | Just adds the minimal implementation to fill platform_data from the DT properties with Linux binding. As all MMC controllers are supposed to support at least the 3.3V signalling level, this gets exposed regardless of the platform data, just as other controller drivers in Barebox handle this. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/mmc'Lucas Stach2017-07-311-24/+30
|\
| * mmc: add eMMC v5 and V5.1 detection supportPeter Seiderer2017-07-061-0/+6
| | | | | | | | | | | | | | Just add the defines. Signed-off-by: Peter Seiderer <ps.report@gmx.net> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
| * mmc: Consistently use EXT_CSD_* names from eMMC 5.1 specSascha Hauer2017-07-061-24/+24
| | | | | | | | | | | | | | | | | | | | We have kept the EXT_CSD registers which were added in the 5.1 spec separately for no good reason. Order the EXT_CSD defines by register number instead. Also we had some duplicates, for these consistently use the names from the 5.1 spec. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
* | mci: atmel_mci: fix devinfo DEV with OF enabledSam Ravnborg2017-07-201-2/+1
|/ | | | | | | | | | devinfo DEV resulted in a NULL pointer expection. As platform_data is only valid in non-DT setup, fix this so we no longer reference platform_data outside the probe function Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
* Merge branch 'for-next/mvebu'Sascha Hauer2017-05-054-0/+459
|\
| * mci: add Marvell Dove SDHCI driverMichael Grzeschik2017-04-194-0/+459
| | | | | | | | | | | | | | | | | | | | | | | | | | This adds a driver for the SDHCI controller found on Marvell Dove SoCs. Despite a missing pinctrl driver, corresponding MPP config has to be set on a per board basis. This driver was succesfully tested with Solidrun Dove Cubox. Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de> Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Acked-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | mci: be more verbose about wrong bus-widthChristoph Fritz2017-05-031-4/+7
|/ | | | | | | | | | | | | | If configured or default bus-width is wrong for the current hardware, registration of card/emmc is likely to fail. This patch adds more verbosity in the case of a failed detection: | omap-hsmmc 48060000.mmc: registered as 48060000.mmc | mmc0: detected MMC card version 4.41 | mmc0: Changing MMC bus width failed: -110 | mmc0: Card's startup fails with -110 Signed-off-by: Christoph Fritz <chf.fritz@googlemail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/ofpart'Sascha Hauer2017-04-071-1/+3
|\
| * of: partition: Register the of partition fixup for of partition usersSascha Hauer2017-03-311-1/+3
| | | | | | | | | | | | | | at24, at25 and mci core are using of_parse_partitions(). Register the fixup for them aswell. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | mci: atmel_mci: Add DT supportAndrey Smirnov2017-03-301-31/+70
| | | | | | | | | | | | Acked-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | mci: Allow parsing for explicit DT nodeAndrey Smirnov2017-03-301-5/+8
|/ | | | | | | | | | | | | | Convert mci_of_parse into mci_of_parse_node, a function that takes explicit deivce tree node pointer to be used for SD/MMC related properties extraction. Implement original mci_of_parse as a wrapper around the call to new function. This is useful for controllers who specify parameter like bus witdth and GPIOs as a part of main controller's child nodes (e.g. AT91 SoCs). Acked-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci-bcm2835: enable devicetree probingEnrico Joerns2017-03-021-0/+9
| | | | | Signed-off-by: Enrico Joerns <ejo@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* i.MX: esdhc: fix imx-esdhc driver for non-OF boardsAlexander Kurz2017-02-141-15/+15
| | | | | | | | | | Commit 39f7a7ee8b68 ("i.MX: esdhc: Do not rely on CPU type for quirks") made imx-esdhc dependent on OF and broke probing for all non-OF boards. Since newer platforms like mx6 and vf610 are restricted to OF, the non-OF probing only needs to distinguish mx5 vs earlier SoC. Signed-off-by: Alexander Kurz <akurz@blala.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: imx-esdhci: remove wrong write protection testSascha Hauer2017-01-191-12/+2
| | | | | | | | | | | Testing for the write protection bit to determine if a card is write protected or not is wrong. The bit may have the wrong value for permanently plugged cards (eMMC) or for boards using a GPIO for write protection detection. Since the core will test for write protection before actually calling into the driver this test can just be removed. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: Allow to partition eMMC boot partitionsSascha Hauer2017-01-191-23/+55
| | | | | | | | | So far the eMMC boot partitions cannot be partitioned from the device tree. Since they are often 4MiB in size they are big enough to hold a barebox image and the environment. Add partition parsing to the boot partitions to allow this usecase. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: imx-esdhc: Enable clockSascha Hauer2017-01-191-0/+1
| | | | | | For architectures which do not enable all clocks during initialization. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* i.MX: esdhc: Enable host->clk during initializationAndrey Smirnov2017-01-121-0/+7
| | | | | Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/vybrid'Sascha Hauer2017-01-121-24/+105
|\
| * i.MX: esdhc: Request "per" clock explicitlyAndrey Smirnov2017-01-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Calling clk_get() with NULL as the second argument will give us "ipg" clock as a result. The actual clock feeding into the peripheral is "per" and, depending on the SoC, "ipg" and "per" may be separated by a clock divider, so querying "ipg"'s rate may not result in rate that does not represent the actual peripheral clock rate. Change the code to request "per" as our peripheral clock to avoid aforementioned problem. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * i.MX: esdhc: Do not rely on CPU type for quirksAndrey Smirnov2017-01-111-21/+100
| | | | | | | | | | | | | | | | | | | | | | | | CPU type is not a reliable indicator of the underlying type of IP core used, since there's no 1:1 mapping between the two. As example of one such violation consider Vybrid SoC which contains IP block from i.MX53. Instead port feature flags from corresponding Linux kernel driver and use the ones that are relevant. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/misc'Sascha Hauer2017-01-111-0/+2
|\ \
| * | mci: omap: Add devicetree options parsing by MCI core.Alexander Shiyan2017-01-101-0/+2
| |/ | | | | | | | | | | | | | | This patch adds a callback to parsing devicetree options for MMC: bus-width, etc.. Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / mci: imx: Add imx6sx compatibleChristian Hemp2017-01-101-0/+2
|/ | | | | | | To let the driver probe on i.MX6SX and i.MX6UL. Signed-off-by: Christian Hemp <c.hemp@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/rockchip'Sascha Hauer2016-09-131-0/+2
|\
| * mci: dw_mmc: Add RK3288 compatible stringWadim Egorov2016-08-261-0/+2
| | | | | | | | | | | | | | | | The SDHC used in the RK2928 and RK3288 are compatible with each other. Add a compatible string for RK3288's SDHC. Signed-off-by: Wadim Egorov <w.egorov@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/misc'Sascha Hauer2016-09-131-2/+1
|\ \
| * | mci: mmci: Fix read FIFO handlingMichael Olbrich2016-09-051-2/+1
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to the Linux kernel and the qemu code, the MMCIFIFOCNT contains the remaining number of words to read, excluding those that are already in the FIFO. So the current number of bytes in the FIFO is host_remain - (readl(base + MMCIFIFOCNT) << 2). Also writing to MMCIDATACTRL will reset the read counter. As a result, MCI_DATABLOCKEND is never set and read_bytes() waits forever. With this change, SD-Card support on qemu vexpress works correctly. Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / ARM: i.MX drivers: enable i.MX50 where already supportedAlexander Kurz2016-09-121-1/+3
|/ | | | | | | | The i.MX50 SOC includes one ESDHCv3, three ESDHCv2, one cspi and two ecspi instances which are supported by existing drivers. Signed-off-by: Alexander Kurz <akurz@blala.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Revert "mci: imx-esdhc: Remove excess function"Sascha Hauer2016-07-141-0/+9
| | | | | | | | | | | This reverts commit 8a6896971d093b9d8d1c36eb0d7af891b6ca5369. With this patch it's no longer possible to call detect on the physical device which is necessary for example to make environment on MMC work. Unlike the commit message for 8a6896971d claims mci_detect_card() is not called from mci_register(). Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: imx-esdhc: Remove excess functionAlexander Shiyan2016-06-201-9/+0
| | | | | | | | Function detect() is defined in the MCI core and mci_detect_card() is already called form mci_register(). Remove excess fuction. Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: core: Do not fail if vmmc regulator failAlexander Shiyan2016-06-201-9/+10
| | | | | | | | The vmmc regulator can be an usupported device for barebox, the specific MFD regulator type, for example. Just lets think is all ok. Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>