summaryrefslogtreecommitdiff
path: root/drivers/mmc
AgeCommit message (Collapse)Author
2019-10-27MLK-22851-2 mmc: fsl_esdhc: Update compatible string for imx8mYe Li
To enable HS400 and UHS for imx8m platforms, update the driver data to share with imx8x platforms and add relevant compatible string. Signed-off-by: Ye Li <ye.li@nxp.com>
2019-10-27MLK-22851-1 mmc: fsl_esdhc: reduce unnecessary clock changeYe Li
In mmc initial state, the mmc framework sets clock to 0, so the fsl_esdhc driver converts to use min clock 400Khz. But the priv->clock is logged 400Khz not 0, and cause following calls to set_ios to set clock again. Each set to clock has 10ms delay for stable, then the problem accumulates some unnecessary delay. Signed-off-by: Ye Li <ye.li@nxp.com>
2019-05-08MLK-21354-2 mmc: fsl_esdhc: fix pre_divPeng Fan
We have initialized pre_div, so no need to override it. And it will break those have pre_div initialized as 2. Signed-off-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Ye Li <ye.li@nxp.com>
2019-03-19MLK-21176 mmc: correct the HS400 initialization processHaibo Chen
After the commit b9a2a0e2e9c0 ("mmc: Add support for downgrading HS200/HS400 to HS mode"), it add a parameter in mmc_set_card_speed() which indicates that the HS200/HS400 to HS downgrade is happening. During the HS400 initialization, first select to HS200, and config the related clock rate, then downgrade to HS mode. So here also need to config the downgrade value to be true, make sure in the function mmc_set_card_speed(), after switch to HS mode, first config the clock rate, then read the EXT_CSD. Otherwise read EXT_CSD in HS mode at wrong clock rate, e.g. 200MHz, may lead to uncertain result. Test on i.MX8QM MEK board, some Micron eMMC will stuck in transfer mode in this case, and USDHC will never get data transfer complete status, cause the uboot hang. Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
2019-03-19mmc: Do not poll using CMD13 when changing timingMarek Vasut
When using CMD6 to switch eMMC card timing from HS200/HS400 to HS/legacy, do not poll for the completion status using CMD13, but rather wait 50mS. Once the card receives the CMD6 and starts executing it, the bus is in undefined state until both the card finishes executing the command and until the controller switches the bus to matching timing configuration. During this time, it is not possible to transport any commands or data across the bus, which includes the CMD13. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Jaehoon Chung <jh80.chung@samsung.com>
2019-03-19mmc: Add support for downgrading HS200/HS400 to HS modeMarek Vasut
The mmc_select_mode_and_width() function can be called while the card is in HS200/HS400 mode and can be used to downgrade the card to lower mode, e.g. HS. This is used for example by mmc_boot_part_access_chk() which cannot access the card in HS200/HS400 mode and which is in turn called by saveenv if env is in the MMC. In such case, forcing the card clock to legacy frequency cannot work. Instead, the card must be switched to HS mode first, from which it can then be reprogrammed as needed. However, this procedure needs additional code changes, since the current implementation checks whether the card correctly switched to HS mode in mmc_set_card_speed(). The check only expects that the card will be going to HS mode from lower modes, not from higher modes, hence add a parameter which indicates that the HS200/HS400 to HS downgrade is happening. This makes the code send the switch command first, reconfigure the controller next and finally perform the EXT_CSD readback check. The last two steps cannot be done in reverse order as the card is already in HS mode when the clock are being switched on the controller side. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Jaehoon Chung <jh80.chung@samsung.com>
2018-11-12MLK-20240-5 fsl_usdhc: Fix fsl_esdhc_get_cd issueYe Li
Fix coverity issue CID 3606685: Structurally dead code (UNREACHABLE) unreachable: This code cannot be reached: return esdhc_getcd_common Should not return true directly, otherwise the esdhc_getcd_common is bypassed. Signed-off-by: Ye Li <ye.li@nxp.com>
2018-08-20[iot] Enlarge the sdhc timeout for erasing system partionChen Guoyin
Change-Id: Ia8bb6634aa00d7a5dc59a7a33845613155543eaa Signed-off-by: Chen Guoyin <guoyin.chen@nxp.com>
2018-08-12MLK-19200-2 Revert "Add iMX8DX DDR3 arm2 board support"Ye Li
This is debug patch, pushed by mistake. Since we already support DDR3 ARM2 in previous commit, must revert it. This reverts commit d0602d2ee64c9ad2bf38a38bfb84f8ff9ac9b68d. Signed-off-by: Ye Li <ye.li@nxp.com>
2018-08-10Add iMX8DX DDR3 arm2 board supportYe Li
When rewoked eMMC to MMC socket, change MMC driver can recognize the card Enable the fastboot to test usb gadget Signed-off-by: Ye Li <ye.li@nxp.com>
2018-06-13MLK-18591-5 android: iot: Export eMMC RPMB interface for Secure Storage proxyHaoran.Wang
Secure Storage service in Trusty OS will compute the encrypted mmc frame and the rpmb proxy inject the frame to driver directly. So that need to export RPMB related interface for Secure Storage proxy use. Change-Id: I7f69831a20a440f597d323b610fa615fd4344d05 Signed-off-by: Haoran.Wang <elven.wang@nxp.com> (cherry picked from commit 4d2c1873ce8221e35874265e41dc42a6df169659)
2018-04-27MA-11789 Flash system.img failed due to erasing timeoutguoyin.chen
Flash system partition with fastboot will earse the partition firstly The 1.2s timeout will fail on some SD Card. Enlarge it to 5s to make it works for most of sdcard Change-Id: I285df411c7a07025251fd19f4c8e8b549bee2421 Signed-off-by: guoyin.chen <guoyin.chen@nxp.com> (cherry picked from commit 642d77fb6d6412095faa6584eeef7bb0132cae57)
2018-04-27MLK-18161-16 fsl_esdhc: Update esdhc driver to support HS400 ES modeYe Li
Update for HS400 ES and enable iMX8QM/QXP for HS400 and HS400 ES. Signed-off-by: Ye Li <ye.li@nxp.com>
2018-04-27MLK-18161-15 mmc: Add HS400 Enhanced Strobe mode supportYe Li
The eMMC 5.1 supports the HS400 Enhanced Strobe mode, add this support to mmc. Signed-off-by: Ye Li <ye.li@nxp.com>
2018-04-27MA-10633 [Android] enlarge the timeout for waiting DATA0zhang sanshan
600ms is not enough to erase erase_grp_size for some sdcard. enlarge to to 1200ms. Change-Id: Ic980794fa3064f92b479b87380e694f853f83c6a Signed-off-by: zhang sanshan <sanshan.zhang@nxp.com> (cherry picked from commit 4a1db2cd700ea434e25c0692c545e571f5841a00)
2018-04-27MLK-17239 mmc: fsl_esdhc: fix sd/mmc ddr mode clock setting issueYe Li
When sd/mmc work at DDR mode, like HS400/HS400ES/DDR52/DDR50 mode, the actual clock rate is just half of the expected clock. This patch set the DDR_EN bit first for DDR mode, hardware divide the usdhc clock automatically, then follow the original sdr clock setting method. Signed-off-by: Haibo Chen <haibo.chen@nxp.com> Signed-off-by: Ye Li <ye.li@nxp.com>
2018-04-27MLK-14938-10 fsl_esdhc: Update usdhc driver to support i.MX8Ye Li
Add CONFIG_MX8 to use the 64bits support in usdhc driver. Signed-off-by: Ye Li <ye.li@nxp.com> (cherry picked from commit ec3bed8d0a73cea364981839c7a8ea716640c92f)
2018-04-27MLK-18159-1 imx8m: Change name from mx8m to imx8mYe Li
The formal production name starts with imx, so change relevant names in codes to use this prefix. Signed-off-by: Ye Li <ye.li@nxp.com>
2018-04-27MLK-12483-4 mx6: Modify drivers to disable fused modulesYe Li
Add the fuse checking in drivers, when the module is disabled in fuse, the driver will not work. Changed drivers: BEE, GPMI, APBH-DMA, ESDHC, FEC, QSPI, ECSPI, I2C, USB-EHCI, GIS, LCDIF and EPDC. Signed-off-by: Ye Li <ye.li@nxp.com> (cherry picked from commit 1704e116f9b39aeb99201919a18bc2b1e19a980e) (cherry picked from commit 2d3b5df8530cd5ef883750378838dea7c40259af)
2018-04-27MLK-14608 fsl_esdhc: Fix wp_enable issueYe Li
The wp-gpios property is used for gpio, if this is set, the WP pin is muxed to gpio function, can't be used as internal WP checking. This patch changes to examine the "fsl,wp-controller" for using internal WP checking. And wp-gpios for using gpio pin. Signed-off-by: Ye Li <ye.li@nxp.com> (cherry picked from commit 733a7fde6fea35d6f2ea18c7759a06904b655e54)
2018-04-27MLK-18149-2 mmc: fsl_esdhc: enable HS400 featurePeng Fan
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>
2018-04-27MLK-18149-1 mmc: add HS400 supportPeng Fan
Add HS400 support. Selecting HS400 needs first select HS199 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: Simon Glass <sjg@chromium.org> Cc: Kishon Vijay Abraham I <kishon@ti.com> Cc: Bin Meng <bmeng.cn@gmail.com>
2018-04-27MLK-18148 mmc: fix return value check conditionPeng Fan
sd_read_ssr returns 0, means no error. Fixes: 5b2e72f32721484("mmc: read ssr only if MMC write support is enabled") Signed-off-by: Peng Fan <peng.fan@nxp.com> Cc: Jaehoon Chung <jh80.chung@samsung.com> Cc: Jean-Jacques Hiblot <jjhiblot@ti.com>
2018-03-05Merge git://git.denx.de/u-boot-shTom Rini
2018-03-05libfdt: move headers to <linux/libfdt.h> and <linux/libfdt_env.h>Masahiro Yamada
Thomas reported U-Boot failed to build host tools if libfdt-devel package is installed because tools include libfdt headers from /usr/include/ instead of using internal ones. This commit moves the header code: include/libfdt.h -> include/linux/libfdt.h include/libfdt_env.h -> include/linux/libfdt_env.h and replaces include directives: #include <libfdt.h> -> #include <linux/libfdt.h> #include <libfdt_env.h> -> #include <linux/libfdt_env.h> Reported-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2018-03-05mmc: uniphier-sd: Add R8A77965 M3N entriesMarek Vasut
Add entries for the R8A77965 M3N SoC. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org> Cc: Jaehoon Chung <jh80.chung@samsung.com> Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
2018-03-01mmc: Added Kconfig support for CONFIG_ZYNQ_SDHCI_MIN_FREQVipul Kumar
This patch added Kconfig support for CONFIG_ZYNQ_SDHCI_MIN_FREQ and enabled it in respective defconfig. Signed-off-by: Vipul Kumar <vipulk@xilinx.com> Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2018-03-01mmc: Added Kconfig support for CONFIG_ZYNQ_SDHCI_MAX_FREQVipul Kumar
This patch added Kconfig support for CONFIG_ZYNQ_SDHCI_MAX_FREQ and enabled it in respective defconfig. Signed-off-by: Vipul Kumar <vipulk@xilinx.com> Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2018-02-25Merge git://git.denx.de/u-boot-mmcTom Rini
2018-02-26mmc: omap_hsmmc: use a default 52MHz max clock rate if none is specifiedJean-Jacques Hiblot
mmc_of_parse() doesn't set a default value if none is available in DT. In that case, use a default 52MHz clock rate. Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Tested-by: Adam Ford <aford173@gmail.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2018-02-26mmc: omap_hsmmc: make it possible to compile out ADMA supportJean-Jacques Hiblot
Some platforms don't have ADMA controllers. For those platforms, compiling it out reduces the size of the binary by about 600 bytes. Leaving the support in doesn't break things as the driver checks at runtime if the ADMA2 controller is present. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Tested-by: Adam Ford <aford173@gmail.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2018-02-26mmc: omap_hsmmc: compile out write support if not neededJean-Jacques Hiblot
This reduces the size of the binary by about 196 bytes. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Tested-by: Adam Ford <aford173@gmail.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2018-02-26mmc: omap_hsmmc: do not embed struct mmc in struct omap_hsmmc_platJean-Jacques Hiblot
The area for struct mmc can be allocated dynamically. It greatly reduces the size of struct omap_hsmmc_plat. This is useful in cases where the board level code declares one or two struct omap_hsmmc_plat because it doesn't use the Driver Model. This saves around 740 bytes for the am335x_evm SPL. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Tested-by: Adam Ford <aford173@gmail.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2018-02-23mmc: fix off-by-one bug in mmc_startup_v4()Alexander Kochetkov
MMC card with EXT_CSD_REV value 9 will trigger off-by-one bug while accessing mmc_versions array. The patch fix that. Signed-off-by: Alexander Kochetkov <al.kochet@gmail.com>
2018-02-23mmc: Drop unnecessary case for mmc_probe()Faiz Abbas
Drop the unnecessary empty function case for mmc_probe(). Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
2018-02-23mmc: uniphier-sd: Add compatible strings for RCar Gen2Marek Vasut
Add DT compatible strings for RCar Gen2 SoCs, so that this driver can bind with them. Unlike Gen3, which uses 64bit FIFO, the Gen2 uses 16bit FIFO. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Jaehoon Chung <jh80.chung@samsung.com> Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
2018-02-21mmc: synchronize the sequence with enum bus_mode in mmc.hJaehoon Chung
If some configs are disabled, number of freqs array will not assigned to correct value with bus_mode. Synchornize the ordering with enum bus_mode in mmc.h. Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
2018-02-19mmc: Fix uninitialised priv memberAlex Kiernan
When using omap_hsmmc without the device model then the allocation of mmc->priv ends up uninitialised. Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> Tested-by: Robert Nelson <robertcnelson@gmail.com> Reviewed-by: Sam Protsenko <semen.protsenko@linaro.org>
2018-02-19mmc: fix bug in mmc_startup_v4()Jean-Jacques Hiblot
The correspondence between mmc versions as used in u-boot and the version numbers reported in register EXT_CSD_REV is wrong for versions above and including MMC_VERSION_4_41. All those versions were shifted by one: real 4.5 hardware appeared to be MMC_VERSION_5_0. Fix this by adding the missing version in the correspondence table. Reported-by: eil Eilmsteiner Heribert <eil@keba.com> Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Sam Protsenko <semen.protsenko@linaro.org>
2018-02-19mmc: Fix bug in sd_set_card_speed()Jean-Jacques Hiblot
After settings the speed of the sd with the switch command, a check is done to make sure that the new speed has been set. The current check has a masking error: speed are encoded on 4 bits only. Fix it by masking the upper bits. This fixes a problem seen with QEmu emulating a vexpress-a15. Reported-by: Jonathan Gray <jsg@jsg.id.au> Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Tested-by: Jonathan Gray <jsg@jsg.id.au>
2018-02-19mmc: omap_hsmmc: add signal voltage selection supportJean-Jacques Hiblot
I/O data lines of UHS SD card operates at 1.8V when in UHS speed mode (same is true for eMMC in DDR and HS200 modes). Add support to switch signal voltage to 1.8V in order to support UHS cards and eMMC HS200 and DDR modes. Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com> Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
2018-02-19mmc: omap_hsmmc: allow mmc clock to be gatedKishon Vijay Abraham I
mmc core has defined a new parameter *clk_disable* to gate the clock. Disable the clock here if *clk_disable* is set. Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com> Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
2018-02-19mmc: omap_hsmmc: implement send_init_stream callbackJean-Jacques Hiblot
This callback is used to send the 74 clock cycles after power up. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
2018-02-19mmc: omap_hsmmc: update mmc->clock with the actual bus speedJean-Jacques Hiblot
When the clock is applied, compute the actual value of the clock. It may be slightly different from the requested value (max freq, divisor threshold) Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
2018-02-19mmc: omap_hsmmc: allow the simple HS modes to use the default pinctrlJean-Jacques Hiblot
The default configuration is usually working fine for the the HS modes. Don't enforce the presence of a dedicated pinmux for the HS modes. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
2018-02-19mmc: omap_hsmmc: Add support to get pinctrl values and max frequency for ↵Kishon Vijay Abraham I
different hw revisions AM572x SR1.1 requires different IODelay values to be used than that used in AM572x SR2.0. These values are populated in device tree. Add capability in omap_hsmmc driver to extract IOdelay values for different silicon revision. The maximum frequency is also reduced when using a ES1.1. To keep the ability to boot both revsions with the same dtb, those values can be provided by the platform code. Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com> Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
2018-02-19mmc: omap_hsmmc: Add support to set IODELAY valuesKishon Vijay Abraham I
The data manual of J6/J6 Eco recommends to set different IODELAY values depending on the mode in which the MMC/SD is enumerated in order to ensure IO timings are met. Add support to parse mux values and iodelay values from device tree and set these depending on the enumerated MMC mode. Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com> Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
2018-02-19mmc: omap_hsmmc: use mmc_of_parse to populate mmc_configKishon Vijay Abraham I
Use the mmc_of_parse library function to populate mmc_config instead of repeating the same code in host controller driver. Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com> Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
2018-02-19mmc: omap_hsmmc: Reduce the max timeout for reset controller fsmJean-Jacques Hiblot
>From OMAP3 SoCs (OMAP3, OMAP4, OMAP5, AM572x, AM571x), the DAT/CMD lines reset procedure section in TRM suggests to first poll the SRD/SRC bit until it is set to 0x1. But looks like that bit is never set to 1 and there is an observable delay of 1sec everytime the driver tries to reset DAT/CMD. (The same is observed in linux kernel). Reduce the time the driver waits for the controller to set the SRC/SRD bits to 1 so that there is no observable delay. Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com> Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
2018-02-19mmc: omap_hsmmc: Workaround for errata id i802Jean-Jacques Hiblot
According to errata i802, DCRC error interrupts (MMCHS_STAT[21] DCRC=0x1) can occur during the tuning procedure. The DCRC interrupt, occurs when the last tuning block fails (the last ratio tested). The delay from CRC check until the interrupt is asserted is bigger than the delay until assertion of the tuning end flag. Assertion of tuning end flag is what masks the interrupts. Because of this race, an erroneous DCRC interrupt occurs. The suggested workaround is to disable DCRC interrupts during the tuning procedure which is implemented here. Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com> Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>