summaryrefslogtreecommitdiffstats
path: root/drivers/mmc
Commit message (Collapse)AuthorAgeFilesLines
* mmc: rpmb: add mmc_rpmb_route_frames()Jens Wiklander2018-10-071-0/+160
| | | | | | | | | Adds mmc_rpmb_route_frames() to route RPMB data frames from/to an external entity. Tested-by: Igor Opaniuk <igor.opaniuk@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
* rockchip: dwmmc: add rk2928-dw-mshc compatibleHeiko Stuebner2018-10-021-0/+1
| | | | | | | | | The rk3188 works nicely with the rockchip mmc driver, so we just need to add the different compatible for it - as used in the Linux kernel. Signed-off-by: Heiko Stuebner <heiko@sntech.de> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
* mmc: dw_mmc: check fifo status with a timeout in fifo modeHeiko Stuebner2018-10-021-2/+30
| | | | | | | | | | | | | | | While trying to enable the dw_mmc on rk3188 I managed to confuse and hang the dw_mmc controller into not delivering further data. The fifo state never became ready and the driver was iterating in the while loop reading 0-byte packets forever. So inspired by how other implementations handle this, check the fifo- state beforhand and add a timeout to catch any glaring fifo issues without hanging uboot altogether. Signed-off-by: Heiko Stuebner <heiko@sntech.de> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
* mmc: omap_mmc: Remove invert referencesAdam Ford2018-09-291-11/+1
| | | | | | | | | | With DM_GPIO and DM_MMC translating GPIO_ACTIVE_LOW, any boards using the 'cd-invert' option will no longer need to do this. This patch removes the support for 'invert' from the MMC driver. Signed-off-by: Adam Ford <aford173@gmail.com> [trini: Fix warning over when !DM_GPIO] Signed-off-by: Tom Rini <trini@konsulko.com>
* mmc: omap_hsmmc: Fix pbias for omap3_logic to enable CD pinAdam Ford2018-09-251-0/+4
| | | | | | | | | The MMC card detect pin is connected to gpio127 on omap3_logic. When setting up the pbias register for MMC, let's also enable gpio_127 for the card detect. As part of the package deal, gpio_126 and gpio_129 are also enabled. Signed-off-by: Adam Ford <aford173@gmail.com>
* MMC: davinici_mmc: Enable CD and WP with DM and OF_CONTROLAdam Ford2018-09-111-0/+41
| | | | | | | | | When used with a device tree, this will extract the card detect and write protect pins from the device tree and configure them accordingly. This assumes the GPIO_ACTIVE_LOW/HIGH is supported by da8xx_gpio. Signed-off-by: Adam Ford <aford173@gmail.com>
* MMC: Enable DM_MMC for DavinciAdam Ford2018-09-111-11/+147
| | | | | | | | | | | With CONFIG_BLK becoming a requirement, the Davinci MMC driver needs to be updated with DM_MMC support. Since SPL is tiny and many boards do not support DM in SPL, this retains the backwards compatibility for those boards who need to initialize MMC manually in SPL. Signed-off-by: Peter Howard <phoward@gme.net.au> Signed-off-by: Adam Ford <aford173@gmail.com>
* mmc: omap_hsmmc: Make DM_GPIO calls dependent on DM_GPIOAdam Ford2018-09-111-5/+9
| | | | | | | | The getcd and getwp functions when DM_MMC is enabled are assumming the DM_GPIO is enabled. In cases (like SPL) where DM_GPIO may not be enabled, wrap these calls in an #ifdef Signed-off-by: Adam Ford <aford173@gmail.com>
* Merge branch 'master' of git://git.denx.de/u-boot-uniphierTom Rini2018-09-111-1/+3
|\
| * mmc: uniphier-sd: sync with LinuxMasahiro Yamada2018-09-111-1/+3
| | | | | | | | | | | | Sync with the driver code and the binding recently merged in Linux. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
* | mmc: k3_arasan: Add sdhci driver support for K3 family SoCsLokesh Vutla2018-09-113-0/+119
| | | | | | | | | | | | | | | | | | AM654 has an arasan sdhci controller and a mmc phy attached to it. Add basic support for K3 specific arasan sdhci controller. Cc: Jaehoon Chung <jh80.chung@samsung.com> Reviewed-by: Tom Rini <trini@konsulko.com> Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
* | mmc: fsl_esdhc: enable HS400 featurePeng Fan2018-09-101-1/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The strobe dll code is ported from Linux Kernel: drivers/mmc/host/sdhci-esdhc-imx.c The comments are from the above file, "For HS400 eMMC, there is a data_strobe line. This signal is generated by the device and used for data output and CRC status response output in HS400 mode. The frequency of this signal follows the frequency of CLK generated by host. The host receives the data which is aligned to the edge of data_strobe line. Due to the time delay between CLK line and data_strobe line, if the delay time is larger than one clock cycle, then CLK and data_strobe line will be misaligned, read error shows up. So when the CLK is higher than 100MHz, each clock cycle is short enough, host should configure the delay target. " Signed-off-by: Peng Fan <peng.fan@nxp.com> Cc: Jaehoon Chung <jh80.chung@samsung.com> Cc: Stefano Babic <sbabic@denx.de>
* | mmc: add HS400 supportPeng Fan2018-09-102-27/+123
|/ | | | | | | | | | | | | | | | | | Add HS400 support. Selecting HS400 needs first select HS200 according to spec, so use a dedicated function for HS400. Add HS400 related macros. Remove the restriction of only using the low 6 bits of EXT_CSD_CARD_TYPE, using all the 8 bits. Signed-off-by: Peng Fan <peng.fan@nxp.com> Cc: Jaehoon Chung <jh80.chung@samsung.com> Cc: Jean-Jacques Hiblot <jjhiblot@ti.com> Cc: Stefano Babic <sbabic@denx.de> Cc: Kishon Vijay Abraham I <kishon@ti.com> Cc: Faiz Abbas <faiz_abbas@ti.com> Cc: Marek Vasut <marex@denx.de> Signed-off-by: Peng Fan <peng.fan@nxp.com>
* mmc: renesas-sdhi: Use priv directlyMarek Vasut2018-08-301-1/+1
| | | | | | | | | The dev_get_priv(dev) is used twice in the probe function. Replace the second invocation with priv variable. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Masahiro Yamada <yamada.masahiro@socionext.com> Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
* mmc: socfpga: Add clock framework supportMarek Vasut2018-08-131-9/+31
| | | | | | | | | | | | | Add support for fetching the clock frequency both using the legacy method in case clock framework is disabled as well as via the clock framework if it is enabled. This allows for migration to the clock framework on platforms which supports it while not breaking legacy platforms. That said, the legacy method must be removed eventually. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Chin Liang See <chin.liang.see@intel.com> Cc: Dinh Nguyen <dinguyen@kernel.org> Cc: Ley Foon Tan <ley.foon.tan@intel.com>
* Merge branch 'master' of git://git.denx.de/u-boot-samsungTom Rini2018-08-071-16/+21
|\
| * ARM: Odroid XU3: Modify exynos dw_mmc driver to support Odroid XU3 in DM MMCLukasz Majewski2018-08-061-0/+1
| | | | | | | | | | | | | | | | This commit enables support for Exynos Designware MMC driver based on DM. Signed-off-by: Lukasz Majewski <lukma@denx.de> Tested-by: Anand Moon <linux.amoon@gmail.com> Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
| * ARM: Odroid XU3: Fix the dwmci_exynos *priv data assignment for DM_MMC ↵Lukasz Majewski2018-08-061-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (sdr_timing) By convention for DM_MMC the host->priv is used to store struct udevice *dev pointer. Unfortunately, the legacy Exynos DW MMC code uses this field to store pointer to dwmci_exynos_priv_data struct Hence, we do need to get data in other way - namely by using container_of when host pointer is present. In this way the sdr_timing data is properly accessed. Signed-off-by: Lukasz Majewski <lukma@denx.de> Tested-by: Anand Moon <linux.amoon@gmail.com> Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
| * ARM: dw_mmc: Exclude dwmci Exynos priv_data allocation from ↵Lukasz Majewski2018-08-061-15/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | exynos_dwmci_get_config() This commit prevents memory leak when this function is used with DM_MMC as the struct dwmci_exynos_priv_data is already allocated by DM. It is necessary for NON DM aware devices to allocate this struct first. Signed-off-by: Lukasz Majewski <lukma@denx.de> Tested-by: Anand Moon <linux.amoon@gmail.com> Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
* | Merge branch 'master' of git://git.denx.de/u-boot-sunxiTom Rini2018-08-041-1/+12
|\ \
| * | sunxi: add MMC support for H6Icenowy Zheng2018-07-311-1/+12
| |/ | | | | | | | | | | | | | | | | | | | | The Allwinner H6 SoC has 3 MMC controllers like the ones in A64, with the MMC2 come with the capability to do crypto by EMCE. Add MMC support for H6. EMCE support is not added yet. Signed-off-by: Icenowy Zheng <icenowy@aosc.io> Reviewed-by: Jagan Teki <jagan@openedev.com> Tested-by: Jagan Teki <jagan@amarulasolutions.com>
* | mmc: arm_pl180_mmci: Remove cd_inverted host's struct fieldPatrice Chotard2018-08-032-5/+1
| | | | | | | | | | | | | | | | | | | | As platform uses GPIOs for card detection, it's simpler and more readable to use GPIO_ACTIVE_(LOW|HIGH) in the gpio flags instead of using the cd-inverted property. Reported-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi> Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
* | mmc: arm_pl180_mmci: Add missing clk_freePatrice Chotard2018-08-031-0/+1
| | | | | | | | | | | | | | | | Add missing clk_free() call in case of failure when enabling the clock. Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* | mmc: arm_pl180_mmci: Update to support CONFIG_BLKPatrice Chotard2018-08-031-27/+40
|/ | | | | | | | | | | Config flag CONFIG_BLK becomes mandatory, update arm_pl180_mmci to support this config. This driver is used by STM32Fx and by Vexpress platforms. Only STM32Fx are DM ready. No DM code is isolated and will be removed easily when wexpress will be converted to DM. Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
* mmc: break out get_op_cond code to its own functionJon Nettleton2018-07-231-26/+35
| | | | | | | | | | | This code is useful for testing the existance of devices that do not have card detect capabilities. This breaks out the core functionality and leaves the actual init logic and error reporting in mmc_start_init(). Signed-off-by: Jon Nettleton <jon@solid-run.com> Signed-off-by: Baruch Siach <baruch@tkos.co.il> Reviewed-by: Stefano Babic <sbabic@denx.de>
* mmc: stm32_sdmmc2: update pwron managementPatrick Delaunay2018-07-191-11/+67
| | | | | | | | | | | | | | Correctly manage the SDMMC reset and card cycle power to fully handle the power cycle added in the MMC uclass and avoid issue with level-shifter with some uSDCARD. 3 states managed in driver: 1/ reset: SDMMC disable, signal HiZ 2/ power-cycle: SDMMC disable, signals drive to 0 3/ power-on: SDMMC enabled Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
* dm: mmc: sunxi: Add A10/A20 compatible stringsAdam Sampson2018-07-161-0/+2
| | | | | | | | | | | | | | | | Commit dd27918c2252 ("dm: mmc: sunxi: Add support for driver model") only added the allwinner,sun5i-a13-mmc compatible string for this driver. The DM initialisation code here also works with (at least) A10 and A20, so add the appropriate compatible strings as per Linux 4.17's driver. Tested on A10 Cubieboard and A20 pcDuino3 Nano with CONFIG_DM_MMC. (A20 worked already, because sun7i-a20.dtsi specifies both the A13 and A20 strings.) Signed-off-by: Adam Sampson <ats@offog.org> Acked-by: Maxime Ripard <maxime.ripard@bootlin.com> Reviewed-by: Jagan Teki <jteki@openedev.com>
* board: arm: Add support for Broadcom BCM7445Thomas Fitzsimmons2018-07-103-0/+79
| | | | | | | | | | | | Add support for loading U-Boot on the Broadcom 7445 SoC. This port assumes Broadcom's BOLT bootloader is acting as the second stage bootloader, and U-Boot is acting as the third stage bootloader, loaded as an ELF program by BOLT. Signed-off-by: Thomas Fitzsimmons <fitzsim@fitzsim.org> Cc: Stefan Roese <sr@denx.de> Cc: Tom Rini <trini@konsulko.com> Cc: Florian Fainelli <f.fainelli@gmail.com>
* mmc: dwmmc: socfpga: Add reset ctrl to driverLey Foon Tan2018-07-091-0/+17
| | | | | | | | | | | | Add code to reset all reset signals as in mmc DT node. A reset property is an optional feature, so only print out a warning and do not fail if a reset property is not present. If a reset property is discovered, then use it to deassert, thus bringing the IP out of reset. Signed-off-by: Ley Foon Tan <ley.foon.tan@intel.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* mmc: zynq: Fix tuning_loop_counter type in arasan_sdhci_execute_tuning()Michal Simek2018-06-151-1/+1
| | | | | | | Code around tuning_loop_counter variable expects to go below zero. That's why this variable can't use unsigned type. Signed-off-by: Michal Simek <michal.simek@xilinx.com>
* mmc: sdhci: Fix MMC HS200 tuning command failuresSiva Durga Prasad Paladugu2018-06-151-4/+4
| | | | | | | | | | | This patch fixes the mmc tuning command failures when tuning pattern data needs to read back for comparision against the expected bit pattern. Reported-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com> Tested-by: Masahiro Yamada <yamada.masahiro@socionext.com>
* Merge branch 'master' of git://git.denx.de/u-boot-shTom Rini2018-06-021-0/+1
|\
| * mmc: renesas-sdhi: Add R8A77990 E3 compatibleMarek Vasut2018-06-011-0/+1
| | | | | | | | | | | | | | | | Add new compatible to the Uniphier SD driver for R8A77990 E3 SoC. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Masahiro Yamada <yamada.masahiro@socionext.com> Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
* | Merge tag 'xilinx-for-v2018.07-2' of git://www.denx.de/git/u-boot-microblazeTom Rini2018-06-012-24/+32
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Xilinx changes for v2018.07 second pull zynqmp: - Show reset reason - Remove emulation platform - Update pmufw version - Simplify mmc bootmode - Remove dc2 useless configuration file - Cleanup mini config - Defconfig syncup - zcu100, zcu104 and zcu111 dts fixes xilinx: - Use live-tree functions in some drivers - Add support for Avnet Minized and Antminer S9 fpga: - Add secure bitstream loading support mmc: - Add hs200 mode support usb xhci: - Header fix
| * | mmc: zynqmp: Add HS200 modes support for ZynqMPSiva Durga Prasad Paladugu2018-05-311-8/+17
| | | | | | | | | | | | | | | | | | | | | | | | This patch adds HS200 suuport for ZynqMP and enables the same for ZC1751 DC1 board which has eMMC on it. Signed-off-by: Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
| * | mmc: sdhci: Update sdhci_send_command() to handle HS200Siva Durga Prasad Paladugu2018-05-311-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | This patch updates sdhci_send_command() to handle MMC HS200 tuning command. Signed-off-by: Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
| * | mmc: zynq: Use live-tree functionsMichal Simek2018-05-311-13/+9
| |/ | | | | | | | | | | | | Use live-tree functions. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* / mmc: ftsdc010_mci: Sync compatible with DT mmc nodeRick Chen2018-05-291-1/+1
|/ | | | | | | | | The compatible string of ftsdc010_mci.c is different from the mmc driver in Linux Kernel. Modify it for consistency. Signed-off-by: Rick Chen <rick@andestech.com> Signed-off-by: Rick Chen <rickchen36@gmail.com> Cc: Greentime Hu <green.hu@gmail.com>
* mmc: stm32_sdmmc2: Fix stm32_sdmmc2_start_cmd()Patrice Chotard2018-05-261-2/+2
| | | | | | | SDMMC_CMD_CPSMEN bit is wrongly check and set in SDMMC_ARG register instead of SDMMC_CMD register. Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
* Merge tag 'signed-rpi-next' of git://github.com/agraf/u-bootTom Rini2018-05-241-218/+47
|\ | | | | | | | | | | | | | | | | Patch queue for rpi - 2018-05-24 Some minor fixes for the Raspberry Pi: - Fix SD writes on new sdhost controller - Sanitize default load addresses, allowing for better payload placement
| * mmc: Unirqify bcm2835_sdhost and fix writesAlexander Graf2018-05-231-218/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The bcm2835 sdhost driver has a problem with "write multiple" commands. It seems to boil down to the fact that the controller dislikes its FIFO to get drained at the end of a block when a write multiple blocks command is in flight. The easy fix is to simply get rid of all the IRQ driven logic and make the driver push as much data into the FIFO as it can. That way we never drain and we never run into the problem. Reported-by: Jan Leonhardt <jan@cyberdesigner.net> Signed-off-by: Alexander Graf <agraf@suse.de>
* | Convert CONFIG_SUPPORT_EMMC_RPMB to KconfigAlex Kiernan2018-05-231-0/+7
|/ | | | | | | Convert CONFIG_SUPPORT_EMMC_RPMB to Kconfig. Split the command handling from the underlying support and expose this through CMD_MMC_RPMB. Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
* mmc: sdhci: Check that ops are definedRamon Fried2018-05-141-2/+2
| | | | | | | The check is necessary to avoid NULL pointer dereference. Signed-off-by: Ramon Fried <ramon.fried@gmail.com> Reviewed-by: Michal Simek <michal.simek@xilinx.com>
* mmc: Improve tinificationMarek Vasut2018-05-132-26/+59
| | | | | | | | | | | | | | | | | Drop all the extra content from the MMC core, so that tiny MMC support is really tiny, no fancy anything. That means the tiny MMC support does only 1-bit transfers at default speed settings. Moreover, this patch drops duplicate instance of struct mmc mmc_static, which wasted about 360 bytes. Furthermore, since MMC tiny supports only one controller at all times, get rid of mallocating the ext csd backup and replace it with static array. All in all, this patch saves ~4 kiB of bloat from the MMC core, which on platforms with severe limitations can be beneficial. Signed-off-by: Marek Vasut <marek.vasut@gmail.com> Cc: Jaehoon Chung <jh80.chung@samsung.com> [trini: Fixup checkpatch.pl style warnings] Signed-off-by: Tom Rini <trini@konsulko.com>
* mmc: zynq_sdhci: Add support for SD3.0Siva Durga Prasad Paladugu2018-05-111-5/+226
| | | | | | | This patch adds support of SD3.0 for ZynqMP. Signed-off-by: Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
* mmc: sdhci: Read capabilities register1 and update host capsSiva Durga Prasad Paladugu2018-05-111-1/+27
| | | | | | | | | This patch reads the capabilities register1 and update the host caps accordingly for mmc layer usage. This patch mainly reads for UHS capabilities inorder to support SD3.0. Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
* mmc: sdhci: Invoke platform specific tuning and delay routinesSiva Durga Prasad Paladugu2018-05-111-0/+24
| | | | | | | | This patch adds support to invoke any platform specific tuning and delay routines if available. Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
* mmc: sdhci: Handle execute tuning command in sdhci_send_commandSiva Durga Prasad Paladugu2018-05-111-2/+6
| | | | | | | | This patch upadted sdhci_send_command to handle execute tuning command. Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
* mmc: sdhci: Add support for disabling clockSiva Durga Prasad Paladugu2018-05-111-0/+3
| | | | | | | | | This patch adds support to disable clock if clk_disable was set and then enable or set clock if the clock was changed or clock was disabled when clock needs to be enabled. Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
* mmc: Changed the datatype of the variable to handle 64-bit archVipul Kumar2018-05-112-3/+3
| | | | | | | | | This patch changed the datatype of variable "start" from uint to ulong to work properly on 64-bit machines as well. Also the return type of get_timer() function is ulong. Signed-off-by: Vipul Kumar <vipul.kumar@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>