summaryrefslogtreecommitdiffstats
path: root/drivers/mci
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'for-next/rpi'Sascha Hauer2019-02-131-5/+5
|\
| * mci: bcm2835: make locally used functions staticRoland Hieber2019-02-051-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The mci-bcm2835 driver registers itself as an MCI driver on probing, and is thereby used through the MCI interface, so these functions are not meant to act as a public interface and only used internally in this compilation unit. This fixes the following build warnings: .../drivers/mci/mci-bcm2835.c:56:6: warning: no previous prototype for 'bcm2835_mci_write' [-Wmissing-prototypes] void bcm2835_mci_write(struct bcm2835_mci_host *host, u32 reg, u32 val) ^~~~~~~~~~~~~~~~~ .../drivers/mci/mci-bcm2835.c:74:5: warning: no previous prototype for 'bcm2835_mci_read' [-Wmissing-prototypes] u32 bcm2835_mci_read(struct bcm2835_mci_host *host, u32 reg) ^~~~~~~~~~~~~~~~ .../drivers/mci/mci-bcm2835.c:83:6: warning: no previous prototype for 'bcm2835_mci_write_data' [-Wmissing-prototypes] void bcm2835_mci_write_data(struct bcm2835_mci_host *host, u32 *p) ^~~~~~~~~~~~~~~~~~~~~~ .../drivers/mci/mci-bcm2835.c:89:6: warning: no previous prototype for 'bcm2835_mci_read_data' [-Wmissing-prototypes] void bcm2835_mci_read_data(struct bcm2835_mci_host *host, u32 *p) ^~~~~~~~~~~~~~~~~~~~~ CC common/date.o .../drivers/mci/mci-bcm2835.c:419:5: warning: no previous prototype for 'bcm2835_mci_reset' [-Wmissing-prototypes] int bcm2835_mci_reset(struct mci_host *mci, struct device_d *mci_dev) Signed-off-by: Roland Hieber <rhi@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | mci: imx-esdhc: Add layerscape supportSascha Hauer2019-02-122-1/+15
| | | | | | | | | | | | | | | | This adds support for the esdhc controller found on Layerscape SoCs. This means adding the compatible and a driver data to access the controller in bigendian mode. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | mci: imx-esdhc: Add bigendian register access supportSascha Hauer2019-02-071-6/+15
| | | | | | | | | | | | Layerscape will need bigendian io accessors. Add support for them. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | mci: imx-esdhc: implement static inline io wrappersSascha Hauer2019-02-072-64/+83
| | | | | | | | | | | | | | Layerscape will need accesses in big endian mode. To make this possible create static inline wrappers for the io accessors. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | mci: imx-esdhc: remove unnecessary includeSascha Hauer2019-02-061-1/+0
| | | | | | | | | | | | Drop inclusion of unnecessary include from mach-imx/include/mach. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | mci: imx-esdhc: make clkidx configurableSascha Hauer2019-02-061-1/+7
| | | | | | | | | | | | | | | | Other architectures using this driver may need a different clk_id to find its clock. Make this configurable as a preparation for layerscape support. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | mci: imx-esdhc: move platform_dataSascha Hauer2019-02-061-1/+1
| | | | | | | | | | | | | | move platform_data from mach-imx/include/mach/ to include/platform_data where it's available for other architectures aswell. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | mci: imx-esdhc: use dev_idSascha Hauer2019-02-061-14/+19
| | | | | | | | | | | | | | Avoid using cpu_is_* macros and use a dev_id instead. This will make it easier to integrate the driver into another architecture. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | mci: imx-esdhc: Do not reset twiceSascha Hauer2019-02-061-47/+34
|/ | | | | | | | | | The esdhc controller is resetted once during probe by calling esdhc_reset() and once open coded in esdhc_init(). Resetting it once is enough, so drop the open coded reset from esdhc_init() and call esdhc_reset() there. With this we can remove the call to esdhc_reset() during probe. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/mmc'Sascha Hauer2019-01-156-22/+5
|\
| * mci: mxs: Drop explicit devname setup codeAndrey Smirnov2018-12-101-6/+0
| | | | | | | | | | | | | | | | Drop explicit devname setup code. Same setup will be done by mci_of_parse(). Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * mci: imx-esdhc: Drop explicit devname setup codeAndrey Smirnov2018-12-101-4/+0
| | | | | | | | | | | | | | | | Drop explicit devname setup code. Same setup will be done by mci_of_parse(). Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * mci: omap_hsmmc: Drop explicit devname setup codeAndrey Smirnov2018-12-101-6/+0
| | | | | | | | | | | | | | | | Drop explicit devname setup code. Same setup will be done by mci_of_parse(). Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * mci: dw_mmc: Drop explicit devname setup codeAndrey Smirnov2018-12-101-3/+0
| | | | | | | | | | | | | | | | Drop explicit devname setup code. Same setup will be done by mci_of_parse(). Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * mci: tegra-sdmmc: Drop explicit devname setup codeAndrey Smirnov2018-12-101-3/+0
| | | | | | | | | | | | | | | | Drop explicit devname setup code. Same setup will be done by mci_of_parse(). Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * mci: core: Use alias as a devname by defaultAndrey Smirnov2018-12-101-0/+5
| | | | | | | | | | | | | | | | This idiom is repeatead by almost every mci driver, so move it to mci_of_parse() in order to reduce amount of duplicated code. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/misc'Sascha Hauer2019-01-151-11/+15
|\ \
| * | mci: skip of_partitions_register_fixup for boot partitionsAhmad Fatoum2019-01-031-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | The bootN-partitions binding is barebox-specific, so it shouldn't be fixed up into the kernel device tree. Suggested-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | mci: Rely on NULL being a dummy regulatorAndrey Smirnov2018-12-171-10/+9
| |/ | | | | | | | | | | | | | | | | Since NULL, is a dummy regulator, we can drop a bit of error checking logic and simplify the code if we assing host->supply to NULL in case we can't find an appropriate regulator during probing. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | mci: omap: use IS_ENABLED() rather than #ifdefSascha Hauer2018-12-141-9/+12
| | | | | | | | | | | | | | While touching it propagate the errors from read/write functions instead of silently ignoring them. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | mci: omap: Improve error handlingSascha Hauer2018-12-141-5/+11
|/ | | | | | | | Return proper error code from read/write functions rather than '1'. Also add messages printing the status register to give a glue what went wrong. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* 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>