summaryrefslogtreecommitdiff
path: root/drivers/mmc
AgeCommit message (Collapse)Author
2019-08-23Convert CONFIG_FSL_USDHC to KconfigAdam Ford
This converts the following to Kconfig: CONFIG_FSL_USDHC Signed-off-by: Adam Ford <aford173@gmail.com> [trini: Add IMX8M, TARGET_S32V234EVB to FSL_USDHC list] Signed-off-by: Tom Rini <trini@konsulko.com>
2019-08-20mmc: mtk-sd: Add MT8183 SoC supportFabien Parent
Add support for the MT8183 in the MediaTek MMC driver. Signed-off-by: Fabien Parent <fparent@baylibre.com>
2019-08-11mmc: Add support for HI3660 SoC reusing hi6220_dw_mmc driverManivannan Sadhasivam
This commit adds MMC driver support for HI3660 SoC reusing hi6220_dw_mmc driver. Since HI3660 operates at different clock rate and uses fifo mode now, let's introduce the platform data and utilize it for different SoCs supported by this driver. Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
2019-08-09mmc: Move tegra loopback disable option to be under tegraTrent Piepho
This is a configuration option specific to the tegra controller. Doing it this way makes it show up directly under the tegra controller option, indented one level, as "Disable external clock loopback". The way it is now, it shows up at the end of the controller list, not indented, as if it's some kind of generic MMC configuration option. Cc: Marcel Ziswiler <marcel.ziswiler@toradex.com> Cc: Simon Glass <sjg@chromium.org> Cc: Jaehoon Chung <jh80.chung@samsung.com> Cc: Tom Warren <twarren@nvidia.com> Signed-off-by: Trent Piepho <tpiepho@impinj.com> Reviewed-by: Simon Glass <sjg@chromium.org> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Signed-off-by: Tom Warren <twarren@nvidia.com>
2019-08-09Merge tag 'mmc-8-9' of https://gitlab.denx.de/u-boot/custodians/u-boot-mmcTom Rini
- mmc test fix - sdhci driver fix
2019-08-09Merge tag 'u-boot-rockchip-20190809' of ↵Tom Rini
https://gitlab.denx.de/u-boot/custodians/u-boot-rockchip - Add rk3399 boards Khadas Edge/-V/-Captain - Add fully souce code support for rk3328 including TPL/DRAM init - Enable boot from eMMC for rk3399 rock960/ficus boards - turn on the IO supply for dw_mmc
2019-08-09mmc: tangier_sdhci: fix uninitialized pointer deref on probePeng Fan
Commit 3d296365e4e8 ("mmc: sdhci: Add support for sdhci-caps-mask") sdhci_setup_cfg() expects a valid sdhci_host mmc field. Fixes: 3d296365e4e8 ("mmc: sdhci: Add support for sdhci-caps-mask") Cc: Faiz Abbas <faiz_abbas@ti.com> Cc: Vincent Tinelli <vincent.tinelli@intel.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
2019-08-09mmc: sdhci-cadence: fix uninitialized pointer deref on probePeng Fan
Commit 3d296365e4e8 ("mmc: sdhci: Add support for sdhci-caps-mask") sdhci_setup_cfg() expects a valid sdhci_host mmc field. Fixes: 3d296365e4e8 ("mmc: sdhci: Add support for sdhci-caps-mask") Cc: Faiz Abbas <faiz_abbas@ti.com> Cc: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Peng Fan <peng.fan@nxp.com> Acked-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2019-08-09mmc: s5p: fix uninitialized pointer deref on probePeng Fan
Commit 3d296365e4e8 ("mmc: sdhci: Add support for sdhci-caps-mask") sdhci_setup_cfg() expects a valid sdhci_host mmc field. Fixes: 3d296365e4e8 ("mmc: sdhci: Add support for sdhci-caps-mask") Cc: Faiz Abbas <faiz_abbas@ti.com> Cc: Jaehoon Chung <jh80.chung@samsung.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
2019-08-09mmc: pci: fix uninitialized pointer deref on probePeng Fan
Commit 3d296365e4e8 ("mmc: sdhci: Add support for sdhci-caps-mask") sdhci_setup_cfg() expects a valid sdhci_host mmc field. Fixes: 3d296365e4e8 ("mmc: sdhci: Add support for sdhci-caps-mask") Cc: Faiz Abbas <faiz_abbas@ti.com> Cc: Simon Glass <sjg@chromium.org> Cc: Bin Meng <bmeng.cn@gmail.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
2019-08-09mmc: msm_sdhci: fix uninitialized pointer deref on probePeng Fan
Commit 3d296365e4e8 ("mmc: sdhci: Add support for sdhci-caps-mask") sdhci_setup_cfg() expects a valid sdhci_host mmc field. Fixes: 3d296365e4e8 ("mmc: sdhci: Add support for sdhci-caps-mask") Cc: Faiz Abbas <faiz_abbas@ti.com> Cc: Ramon Fried <rfried.dev@gmail.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
2019-08-09mmc: bcm: fix uninitialized pointer deref on probePeng Fan
Commit 3d296365e4e8 ("mmc: sdhci: Add support for sdhci-caps-mask") sdhci_setup_cfg() expects a valid sdhci_host mmc field. Fixes: 3d296365e4e8 ("mmc: sdhci: Add support for sdhci-caps-mask") Cc: Faiz Abbas <faiz_abbas@ti.com> Cc: Matthias Brugger <mbrugger@suse.com> Cc: Thomas Fitzsimmons <fitzsim@fitzsim.org> Signed-off-by: Peng Fan <peng.fan@nxp.com>
2019-08-09mmc: atmel_sdhci: fix uninitialized pointer deref on probePeng Fan
Commit 3d296365e4e8 ("mmc: sdhci: Add support for sdhci-caps-mask") sdhci_setup_cfg() expects a valid sdhci_host mmc field. Fixes: 3d296365e4e8 ("mmc: sdhci: Add support for sdhci-caps-mask") Cc: Faiz Abbas <faiz_abbas@ti.com> Cc: Wenyou Yang <wenyou.yang@atmel.com> Signed-off-by: Peng Fan <peng.fan@nxp.com> Tested-by: Eugen Hristev <eugen.hristev@microchip.com>
2019-08-09mmc: zynq_sdhci: fix uninitialized pointer deref on probeMatwey V. Kornilov
Since commit 3d296365e4e8 ("mmc: sdhci: Add support for sdhci-caps-mask") sdhci_setup_cfg() expects a valid sdhci_host mmc field. Move the mmc field initialization before sdhci_setup_cfg() call to avoid crash on mmc pointer dereference. [this patch is based on commit 41a9fab8dac8 ("mmc: mv_sdhci: fix uninitialized pointer deref on probe") by Baruch Siach] Fixes: 3d296365e4e8 ("mmc: sdhci: Add support for sdhci-caps-mask") Cc: Faiz Abbas <faiz_abbas@ti.com> Cc: Baruch Siach <baruch@tkos.co.il> Signed-off-by: Matwey V. Kornilov <matwey.kornilov@gmail.com> Reviewed-by: Peng Fan <peng.fan@nxp.com> Tested-by: Michal Simek <michal.simek@xilinx.com> (on zcu102/zc706)
2019-08-09mmc: Select SPL_HS200_SUPPORT if SPL_HS400_SUPPORT is selectedFaiz Abbas
Select SPL_HS200_SUPPORT if SPL_HS400_SUPPORT is selected as is being done for the U-boot case. Signed-off-by: Faiz Abbas <faiz_abbas@ti.com> Reviewed-by: Peng Fan <peng.fan@nxp.com>
2019-07-31mmc: relocate code commentBaruch Siach
The comment about init op being NULL used to be next to the NULL check code. Commit 8ca51e51c182 ("dm: mmc: Add a way to use driver model for MMC operations") separated the comment from the code. Put them back together. Fixes: 8ca51e51c182 ("dm: mmc: Add a way to use driver model for MMC operations") Signed-off-by: Baruch Siach <baruch@tkos.co.il> Reviewed-by: Peng Fan <peng.fan@nxp.com>
2019-07-31mmc: mtk-sd: add WATCHDOG_RESET() to prevent watchdog timeoutWeijie Gao
When reading large data in once (reading 512MiB is tested on MT7623), a watchdog timeout is triggered due to watchdog not being fed. This patch adds WATCHDOG_RESET() to msdc_start_data() so the watchdog will be fed every 1024 blocks are read/written. Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2019-07-31mmc: sdhci: fix chip detect gpio property nameBaruch Siach
The standard property name for chip-detect gpio is "cd-gpios". All in-tree DT files use only this name. Fixes: 451931ea700 ("mmc: sdhci: Read cd-gpio from devicetree") Cc: T Karthik Reddy <t.karthik.reddy@xilinx.com> Cc: Michal Simek <michal.simek@xilinx.com> Signed-off-by: Baruch Siach <baruch@tkos.co.il> Reviewed-by: Peng Fan <peng.fan@nxp.com>
2019-07-31mmc: mv_sdhci: fix uninitialized pointer deref on probeBaruch Siach
Since commit 3d296365e4e8 ("mmc: sdhci: Add support for sdhci-caps-mask") sdhci_setup_cfg() expects a valid sdhci_host mmc field. Move the mmc field initialization before sdhci_setup_cfg() call to avoid crash on mmc pointer dereference. Fixes: 3d296365e4e8 ("mmc: sdhci: Add support for sdhci-caps-mask") Cc: Faiz Abbas <faiz_abbas@ti.com> Signed-off-by: Baruch Siach <baruch@tkos.co.il>
2019-07-31dw_mmc: turn on the IO supplyUrja Rannikko
Fixes the microSD slot on the ASUS C201. Signed-off-by: Urja Rannikko <urjaman@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Peng Fan <peng.fan@nxp.com<mailto:peng.fan@nxp.com>>
2019-07-27Merge branch '2019-07-26-ti-imports'Tom Rini
- Bring in the rest of the J271E platform - Various OMAP3/AM3517, DA850 fixes
2019-07-27Merge branch 'master' of https://gitlab.denx.de/u-boot/custodians/u-boot-spiTom Rini
- fix for fsl_qspi read timeout (Thomas) - spi-mem read data size fix (Ye Li) - SiFive SPI driver, mmc_spi flags (Bhargav, Anup) - Micron spi-nor parts (Ashish) - MT7629 spi-mem driver(Weijie)
2019-07-26mmc: am654_sdhci: Separate J721E compatible into 8bit and 4bit versionsFaiz Abbas
The j721e 4 bit instances don't have a hard DLL and therefore don't need any DLL related configurations. Split the compatibles into an 8 bit and a 4 bit one. Add a private flags field which can be used to check if the DLL is present and don't register the set_ios_post callback for the 4 bit compatible instances. Also update the compatibles in k3-j721e-main.dtsi to avoid breaking boot with the new compatibles. Signed-off-by: Faiz Abbas <faiz_abbas@ti.com> Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
2019-07-20rockchip: sdhci: Fix sdhci mmc driver probe abortKever Yang
This patch fix mmc driver abort caused by below patch: 3d296365e4 mmc: sdhci: Add support for sdhci-caps-mask After the patch sdhci_setup_cfg() access to host->mmc->dev, so we have to do init before make the call to the function() Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2019-07-18mmc: mmc_spi: Use SPI_XFER_BEGIN and SPI_XFER_END flagsAnup Patel
Most DM based SPI host controller drivers use SPI_XFER_BEGIN and SPI_XFER_END flags to enable/disable slave chip select. This patch extends MMC SPI driver to pass SPI_XFER_BEGIN flag when MMC command is send at start and pass SPI_XFER_END flag using a dummy transfer (of bitlen = 0) at the end of MMC command. Suggested-by: Jagan Teki <jagan@amarulasolutions.com> Signed-off-by: Anup Patel <anup.patel@wdc.com> Tested-by: Sagar Kadam <sagar.kadam@sifive.com> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
2019-07-17mmc: am654_sdhci: Allow driver to probe without PDs specifiedAndreas Dannenberg
We would like to use the driver even without power domains being specified for cases such as during early boot when the required power domains have already gotten enabled by the SoC's boot ROM and such explicit initialization is not needed and possible. Signed-off-by: Andreas Dannenberg <dannenberg@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2019-07-17mmc: am654_sdhci: Add a platform specific set_control_reg() callbackFaiz Abbas
Add a platform specific set_control_reg() callback to help switch to UHS speed modes. Signed-off-by: Faiz Abbas <faiz_abbas@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2019-07-17mmc: sdhci: Add support for HOST_CONTROL2 and setting UHS timingsFaiz Abbas
The HOST_CONTROL2 register is a part of SDHC v3.00 and not just specific to arasan/zynq controllers. Add the same to sdhci.h. Also create a common API to set UHS timings in HOST_CONTROL2. Signed-off-by: Faiz Abbas <faiz_abbas@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2019-07-17mmc: am654_sdhci: Add Support for PHYFaiz Abbas
Add support in the driver for handling phy specific registers. Signed-off-by: Faiz Abbas <faiz_abbas@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2019-07-17mmc: sdhci: Make set_ios_post() return intFaiz Abbas
Make set_ios_post() return int to faciliate error handling in platform drivers. Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
2019-07-17mmc: sdhci: Make sdhci_set_clock() non staticFaiz Abbas
The am654_sdhci driver needs to switch the clock off before disabling its phy dll and needs to re-enable the clock before enabling the phy again. Therefore, make the sdhci_set_clock() function accessible in the am654_sdhci driver. Signed-off-by: Faiz Abbas <faiz_abbas@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2019-07-17mmc: sdhci: Add support for sdhci-caps-maskFaiz Abbas
Add Support for masking some bits in the capabilities register of a host controller. Also remove the redundant readl() into caps1. Signed-off-by: Faiz Abbas <faiz_abbas@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2019-07-17mmc: am654_sdhci: Remove quirksFaiz Abbas
The host controller works perfectly well without having to add any quirks. Remove them. Signed-off-by: Faiz Abbas <faiz_abbas@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2019-07-17arm64: dts: k3: Sync sdhci0 node from kernel and change driver nameFaiz Abbas
Sync the sdhci0 node from kernel. This changes the compatible that is required to be there in the driver. Change the same for the SD card node which is not yet supported in kernel. This also syncs the main_pmx0 node as a side effect. Also change the name of the driver to match the compatible in kernel. Signed-off-by: Faiz Abbas <faiz_abbas@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2019-07-15Merge tag 'mmc-2019-7-15' of https://gitlab.denx.de/u-boot/custodians/u-boot-mmcTom Rini
- mmc spi driver model support - drop mmc_spi command - enhanced Strobe mmc HS400 support - minor mmc bug/fixes and optimization - omap hsmmc and mvbeu update - sdhci card detect support
2019-07-15mmc: fsl_esdhc_imx: enlarge mmc timeoutPeng Fan
Flash system partition with fastboot will earse the partition firstly The 600ms timeout will fail on some SD Card. Enlarge it to 5s to make it works for most of sdcard Cc: guoyin.chen <guoyin.chen@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
2019-07-15mmc: fsl_esdhc_imx: add i.MX8QM compatiblePeng Fan
Add i.MX8QM compatible and soc data, the soc data is following Linux i.MX SDHC driver. Signed-off-by: Peng Fan <peng.fan@nxp.com>
2019-07-15mmc: fsl_esdhc_imx: add HS400 Enhanced strobe supportPeng Fan
Implement set_enhanced_strobe hook for fsl_esdhc_imx, ,in esdhc_set_timing and esdhc_change_pinstate, also handle HS400_ES. Signed-off-by: Peng Fan <peng.fan@nxp.com>
2019-07-15mmc: fsl_esdhc_imx: use mmc_of_parse to set host_capsPeng Fan
Use mmc_of_parse to set host_caps. Signed-off-by: Peng Fan <peng.fan@nxp.com>
2019-07-15mmc: Parse no-1-8-v DT propertyPeng Fan
Parse no-1-8-v DT Signed-off-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Cc: Marek Vasut <marek.vasut+renesas@gmail.com>
2019-07-15mmc: Parse HS400 Enhanced strobe DT propertiesPeng Fan
Add HS400 Enhanced strobe properties parsing support to mmc_of_parse(). Signed-off-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Cc: Marek Vasut <marek.vasut+renesas@gmail.com>
2019-07-15mmc: support hs400 enhanced strobe modePeng Fan
eMMC 5.1+ supports HS400 Enhances Strobe mode without the need for tuning procedure. The flow is as following: - set HS_TIMIMG (Highspeed) - Host change freq to <= 52Mhz - set the bus width to Enhanced strobe and DDR8Bit(CMD6), EXT_CSD[183] = 0x86 instead of 0x80 - set HS_TIMING to 0x3 (HS400) - Host change freq to <= 200Mhz - Host select HS400 enhanced strobe complete Signed-off-by: Peng Fan <peng.fan@nxp.com>
2019-07-15mmc: fsl_esdhc_imx: fix config check issue when building in SPLYe Li
Should use CONFIG_IS_ENABLED not IS_ENABLED for clock and regulator drivers, CONFIG_IS_ENABLED will check the CONFIG_SPL_CLK and CONFIG_SPL_DM_REGULATOR when building SPL. Signed-off-by: Ye Li <ye.li@nxp.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2019-07-15mmc: mmc_spi: Re-write driver using DM frameworkBhargav Shah
This patch rewrites MMC SPI driver using U-Boot DM framework and get it's working on SiFive Unleashed board. Signed-off-by: Bhargav Shah <bhargavshah1988@gmail.com> Signed-off-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com>
2019-07-15mmc: skip select_mode_and_width for MMC SPI hostAnup Patel
The MMC mode and width are fixed for MMC SPI host hence we skip sd_select_mode_and_width() and mmc_select_mode_and_width() for MMC SPI host. Signed-off-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com>
2019-07-15mmc: retry a few times if a partition switch failedJean-Jacques Hiblot
This operation may fail. Retry it a few times before giving up and report a failure. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
2019-07-15mmc: do not change mode when accessing a boot partitionJean-Jacques Hiblot
Accessing the boot partition had been error prone with HS200 and HS400 and was disabled. The driver first switched to a lesser mode and then switched the partition access. It was mostly due to a bad handling of the switch and has been fixed, so let's remove this 'feature' Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
2019-07-15mmc: During a switch, poll on dat0 if available and check the final statusJean-Jacques Hiblot
The switch operation can sometimes make the bus unreliable, in that case the send_status parameter should be false to indicate not to poll using CMD13. If polling on dat0 is possible, we should use it to detect the end of the operation. At the end of the operation it is safe to use CMD13 to get the status of the card. It is important to do so because the operation may have failed. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
2019-07-15mmc: When switching partition, use the timeout specified in the ext_csdJean-Jacques Hiblot
The e-MMC spec allows the e-MMC to specify a timeout for the partition switch command. It can take up to 2550 ms. There is no lower limit to this value in the spec, but do as the the linux driver does and force it to be at least 300ms. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
2019-07-15mmc: use the generic timeout for cmd6 (SWITCH) provided in the ext_csdJean-Jacques Hiblot
Starting with rev 4.5, the eMMC can define a generic timeout for the SWITCH command. Following Linux Kernel code, the timeout also changed from 1000 -> 500 Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>