summaryrefslogtreecommitdiffstats
path: root/drivers/mci
Commit message (Collapse)AuthorAgeFilesLines
* esdhc-xload: invalidate icache before jumping to imageSascha Hauer2019-05-101-0/+3
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: imx-esdhc-pbl: ls1046a: Set better divider valuesSascha Hauer2019-05-081-1/+1
| | | | | | | MMC Frequency was set to something like 55MHz. This doesn't work for all SD cards. Set to 25MHz which is supported by all SD cards. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/layerscape'Sascha Hauer2019-04-082-2/+61
|\
| * esdhc-xload: Add support for LayerscapeSascha Hauer2019-03-131-1/+59
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * mci: imx-esdhc: Actually enable cache snoopingSascha Hauer2019-03-131-1/+2
| | | | | | | | | | | | | | | | | | | | 15b64fd520 introduced the ESDHC_FLAG_CACHE_SNOOPING for layerscape support, but didn't actually set it for layerscape. Add the new flag to the layerscape SoC data. Fixes: 15b64fd520 ("mci: imx-esdhc: Add layerscape support") Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | mci: imx-esdhc: resolve conflicting flagsAlexander Kurz2019-03-181-4/+5
| | | | | | | | | | | | | | | | | | | | | | With commit 3354adee3920 ("mci: imx-esdhc: Add bigendian register access support") and commit 15b64fd520c2 ("mci: imx-esdhc: Add layerscape support") two ESDHC_FLAGs got assigned to already existing values. This conflict made the imx6sl usdhc appear to be big endian. Resolve this conflict by assign the new flags to the next vacant values. Signed-off-by: Alexander Kurz <akurz@blala.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | mci: imx-esdhc-pbl: initialize is_beChristian Hemp2019-03-181-0/+2
|/ | | | | | | | | Initialize is_be, otherwise the value of is_be is undefined. So it is possible that the i.MX8 will not boot because the bigendian functions are used. Signed-off-by: Christian Hemp <c.hemp@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/spd'Sascha Hauer2019-03-072-3/+3
|\
| * crc: import crc_itu_t() from kernelSascha Hauer2019-03-042-3/+3
| | | | | | | | | | | | | | | | Our cyc_crc16() function is the same function as crc_itu_t() in the Linux kernel. Import and use crc_itu_t() from the Kernel for consistency. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/rpi'Sascha Hauer2019-03-071-1/+4
|\ \
| * | mci: bcm2835: parse other device tree properties.Tomaz Solc2019-02-191-0/+3
| | | | | | | | | | | | | | | | | | | | | The driver was missing a call to mci_of_parse() which fills in properties such as "bus-width", "no-sd" into the mci_host struct. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | mci: bcm2835: use device_initcall(), not coredev.Tomaz Solc2019-02-191-1/+1
| |/ | | | | | | | | | | | | | | | | | | | | | | pinctrl driver needs to be initialized before mci driver on Raspberry Pi. Otherwise the pinctrl device tree properties in the mci node are ignored. pinctrl is initialized by coredevice_initcall(), so moving mci-bcm2835 to device_initcall() ensures that it is initialized later. There is no reason for mci-bcm2835 to use coredevice_initcall(). Other mci drivers already use device_initcall(). Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | esdhc-xload: check for PRSSTAT_BREN only after each blockSascha Hauer2019-03-051-9/+16
| | | | | | | | | | | | | | | | | | The BREN bit tells us a watermark level sized buffer is ready for read. Instead of testing it before each FIFO read we must only check it once and then read a watermark level sized buffer. This is at least necessary on Layerscape, otherwise timeouts occur while reading the buffer. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | esdhc-xload: Add bigendian supportSascha Hauer2019-03-051-3/+10
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | esdhc-xload: Use static inline io wrappersSascha Hauer2019-03-051-27/+33
| | | | | | | | | | | | | | We'll need big endian support for Layerscape, so put the io accessors into static inline wrappers. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | esdhc-xload: move some register defines to header fileSascha Hauer2019-03-053-10/+8
| | | | | | | | | | | | To make them usable for the PBL driver aswell. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | esdhc-xload: Move to drivers/mciSascha Hauer2019-03-053-0/+391
|/ | | | | | | The esdhc-xload code will be used by upcoming Layerscape support aswell, so move it from architecture code to drivers/mci/. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* 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>