summaryrefslogtreecommitdiff
path: root/drivers/mmc
Commit message (Collapse)AuthorAgeLines
* mmc: atmel_sdhci: Convert to the driver model supportWenyou Yang2016-08-15-0/+133
| | | | | | | | | | | Convert the driver to the driver model while retaining the existing legacy code. This allows the driver to support boards that have converted to driver model as well as those that have not. Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com> Reviewed-by: Heiko Schocher <hs@denx.de>
* fdt: allow fdtdec_get_addr_size_*() to translate addressesStephen Warren2016-08-12-1/+2
| | | | | | | | | | | | | | | Some code may want to read reg values from DT, but from nodes that aren't associated with DM devices, so using dev_get_addr_index() isn't appropriate. In this case, fdtdec_get_addr_size_*() are the functions to use. However, "translation" (via the chain of ranges properties in parent nodes) may still be desirable. Add a function parameter to request that, and implement it. Update all call sites to default to the original behaviour. Signed-off-by: Stephen Warren <swarren@nvidia.com> Reviewed-by: Simon Glass <sjg@chromium.org> Squashed in build fix from Stephen: Signed-off-by: Simon Glass <sjg@chromium.org>
* zynq_sdhci.c: Fix warning in arasan_sdhci_probeTom Rini2016-08-05-2/+0
| | | | | | | | | We no longer need to set 'caps' as it's not passed to sdhci_setup_cfg anymore. Fixes: 14bed52d276a ("mmc: sdhci: remove the unnecessary arguments for sdhci_setup_cfg") Signed-off-by: Tom Rini <trini@konsulko.com>
* mmc: sdhci: fix the compiler warning when disable CONFIG_MMC_SDMAJaehoon Chung2016-08-05-1/+1
| | | | | | | When disabled CONFIG_MMC_SDMA, variable caps didn't use. This patch fixes the compiler error for -Wunused-but-set-variable Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
* mmc: dw_mmc: fix data starvation by host timeout under FIFO modeXu Ziyuan2016-08-05-0/+1
| | | | | | | | | | | | | | This patch fixes data starvation by host timeout(HTO) error interrupt which occurred under FIFO mode transfer on rk3036 board. The former implement, the actual bytes were transmitted may be less than should be. The size will still subtract value of len in case of there is no receive/transmit FIFO data request interrupt. Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com> Acked-by: Jaehoon Chung <jh80.chung@samsung.com> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
* mmc: dw_mmc: transfer proper bytes to FIFOXu Ziyuan2016-08-05-0/+2
| | | | | | | | | | | The former implement, dw_mmc will push and pop the redundant data to FIFO, we should transfer it according to the real size. Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com> Acked-by: Jaehoon Chung <jh80.chung@samsung.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Shawn Lin <shawn.lin@rock-chips.com> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
* mmc: sdhci: remove the unnecessary arguments for sdhci_setup_cfgJaehoon Chung2016-08-05-25/+19
| | | | | | | | | | | | | | Some arguments don't need to pass to sdhci_setup_cfg. Generic variable can be used in sdhci_setup_cfg, and some arguments are already included in sdhci_host struct. It's enough that just pass the board specific things to sdhci_setup_cfg(). After removing the unnecessary arguments, it's more simpler than before. It doesn't consider "Version" and "Capabilities" anymore in each SoC driver. Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* mmc: sdhci: remove the unused argument for sdhci_setup_cfgJaehoon Chung2016-08-05-5/+5
| | | | | | | | buswidth isn't used anywhere in sdhci_setup_cfg. Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com> Reviewed-by: Minkyu Kang <mk7.kang@samsung.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* mmc: sdhci: revert "mmc: sdhci: Claer high speed if not supported"Jaehoon Chung2016-08-05-3/+0
| | | | | | | | | | | | | | | | This "commit 429790026021d522d51617217d4b86218cca5750" is wrong. SDHCI_QUIRK_NO_HISPD_BIT is for skipping to set CTRL_HISPD bit. For example, Exynos didn't have CTRL_HISPD. But Highspeed mode is supported. (This quirks doesn't mean that driver didn't support the Highseepd mode.) Note: If driver didn't support the Highspeed Mode, use or add the other quirks. After applied this patch, all Exynos SoCs are just running with 25MHz. Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
* mmc: display mmc list information like mmc_legacy typeXu Ziyuan2016-08-05-1/+1
| | | | | | | | | | | | | | | | | | | | | It's nicer to see this: => mmc list dwmmc@ff0c0000: 0 dwmmc@ff0f0000: 1 (eMMC) than this: => mmc list dwmmc@ff0c0000: 0dwmmc@ff0f0000: 1 (eMMC) With the former, it's much clearer which mmc devices are on. Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com> Acked-by: Simon Glass <sjg@chromium.org> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com> Tested-by: Jaehoon Chung <jh80.chung@samsung.com> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
* mmc: use the generic error numberJaehoon Chung2016-08-05-90/+95
| | | | | | | | | Use the generic error number instead of specific error number. If use the generic error number, it can debug more easier. Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Minkyu Kang <mk7.kang@samsung.com>
* mmc: fsl_esdhc: remove the duplicated header fileJaehoon Chung2016-08-05-1/+0
| | | | | | | "mmc.h" is already included. It's duplicated. Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* mmc: dw_mmc: remove the duplicated header fileJaehoon Chung2016-08-05-2/+1
| | | | | | | | <asm-generic/errno.h> is already included in <errno.h>. It can use <errno.h> instead of <asm-generic/errno.h> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* mmc: s5p_sdhci: unset the SDHCI_QUIRK_BROKEN_R1BJaehoon Chung2016-08-05-1/+1
| | | | | | | | | Unset the SDHCI_QUIRK_BROKEN_R1B for exynos SoC. (Tested on Exynos4 Boards.) Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com> Acked-by: Lukasz Majewski <l.majewski@samsung.com> Tested-by: Lukasz Majewski <l.majewski@samsung.com>
* mmc: sdhci: set to INT_DATA_END when there are dataJaehoon Chung2016-08-05-1/+2
| | | | | | | | | | | | There is no data, it doesn't needs to wait for completing data transfer. (It seems that it can be removed.) Almost all timeout error is occured from stop command without data. After applied this patch, I hope that we don't need to increase timeout value anymore. Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com> Acked-by: Lukasz Majewski <l.majewski@samsung.com> Tested-by: Lukasz Majewski <l.majewski@samsung.com> Acked-by: Minkyu Kang <mk7.kang@samsung.com>
* mmc: sdhci: clean up timeout detectionMasahiro Yamada2016-08-05-9/+9
| | | | | | | | | | | | | The current timeout detection logic is not very nice; it calls get_timer(start) in the while() loop, and then calls it again after the loop to check if a timeout error happened. Because of the time difference between the two calls of get_timer(), the timeout detected after the loop may not be true. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Acked-by: Jaehoon Chung <jh80.chung@samsung.com> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
* mmc-uclass: correct the device numberKever Yang2016-07-31-3/+3
| | | | | | | | | Not like the mmc-legacy which the devnum starts from 1, it starts from 0 in mmc-uclass, so the device number should be (devnum + 1) in get_mmc_num(). Signed-off-by: Kever Yang <kever.yang@rock-chips.com> Acked-by: Simon Glass <sjg@chromium.org> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
* mmc: dw_mmc: reduce timeout detection cycleXu Ziyuan2016-07-27-1/+1
| | | | | | | | | It's no need to speed 10 seconds to wait the mmc device out from busy status. 500 milliseconds enough. Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com> Tested-by: Jaehoon Chung <jh80.chung@samsung.com>
* dm: socfpga: mmc: Support CONFIG_BLKSimon Glass2016-07-27-1/+31
| | | | | | Update the driver to support using driver model for block devices. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: mmc: zynq: Convert zynq to use driver model for MMCSimon Glass2016-07-27-5/+34
| | | | | | | Move zynq to the latest driver model support by enabling CONFIG_DM_MMC, CONFIG_DM_MMC_OPS and CONFIG_BLK. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: mmc: dwmmc: use the callback functions as staticJaehoon Chung2016-07-27-2/+2
| | | | | | | | | There are no places to call these functions. It should be used the callback function. Then it can be used as static functions. Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* mmc: rockchip: add SDHCI driver support for rockchip socKever Yang2016-07-25-0/+100
| | | | | | | | | | | | | | | | | | Rockchip rk3399 using arasan sdhci-5.1 controller. This patch add the controller support to enable mmc device with full driver-model support, tested on rk3399 evb board. According to my test result, this driver should be OK, the command "part list mmc 0" can result in a right output, but all the mmc command failed like this: => mmc info No MMC device available Command failed, result=1 The result of get_mmc_num in cmd/mmc.c is always 0? Signed-off-by: Kever Yang <kever.yang@rock-chips.com> Acked-by: Simon Glass <sjg@chromium.org>
* ARM: uniphier: use (devm_)ioremap() instead of map_sysmem()Masahiro Yamada2016-07-24-4/+3
| | | | | | | | This does not have much impact on behavior, but makes code look more more like Linux. The use of devm_ioremap() often helps to delete .remove callbacks entirely. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
* mmc: sdhci: Disable internal clock enable bitSiva Durga Prasad Paladugu2016-07-22-1/+1
| | | | | | | | | | | Disable internal clock by clearing the internal clock enable bit. This bit needs to be cleared too when we stop the SDCLK for changing the frequency divisor. This bit should be set to zero when the device is not using the Host controller. Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
* Various, unrelated tree-wide typo fixes.Robert P. J. Day2016-07-16-1/+1
| | | | | | | | | | | | | | | | | | | Fix a number of typos, including: * "compatble" -> "compatible" * "eanbeld" -> "enabled" * "envrionment" -> "environment" * "FTD" -> "FDT" (for "flattened device tree") * "ommitted" -> "omitted" * "overriden" -> "overridden" * "partiton" -> "partition" * "propogate" -> "propagate" * "resourse" -> "resource" * "rest in piece" -> "rest in peace" * "suport" -> "support" * "varible" -> "variable" Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
* Merge branch 'master' of http://git.denx.de/u-boot-sunxiTom Rini2016-07-15-22/+5
|\
| * sunxi: Use BROM stored boot_media value to determine our boot-sourceHans de Goede2016-07-15-17/+0
| | | | | | | | | | | | | | | | | | Now that we know that the BROM stores a value indicating the boot-source at the beginning of SRAM, use that instead of trying to recreate the BROM's boot probing. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Ian Campbell <ijc@hellion.org.uk>
| * sunxi: mmc: increase status register polling rate for data transfersTobias Doerffel2016-07-15-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | With a recent bunch of SD3.0 cards in our A20-based board we experienced data transfer rates of about 250 KiB/s instead of 10 MiB/s with previous cards from the same vendor (both 4 GB/class 10). By increasing status register polling rate from 1 kHz to 1 MHz we were able to reach the original transfer rates again. With the old cards we now even reach about 16 MiB/s. Signed-off-by: Tobias Doerffel <tobias.doerffel@ed-chemnitz.de> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* | Merge branch 'master' of git://git.denx.de/u-boot-samsungTom Rini2016-07-15-63/+85
|\ \
| * | mmc: exynos_dw_mmc: support the Driver mode for ExynosJaehoon Chung2016-07-12-0/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch support the driver mode for exynos dwmmc controller. To support the legacy model, maintained the existing code. Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
| * | mmc: exynos_dw_mmc: use the 4bit bus-width by defaultJaehoon Chung2016-07-12-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If there is not "samsung,bus-width" property, use the 4bit buswidth by default. Almost all Exnyos SoCs support at least 4bit buswidth. Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
| * | mmc: exynos_dw_mmc: clean the unused and unnecessary codesJaehoon Chung2016-07-12-22/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Clean the unused and unnecessary codse. This patch is one of them for preparing to use DM. Because it's easy to maintain and combine DM after cleaning codes. Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
| * | mmc: exynos_dw_mmc: add the error control for checking indexJaehoon Chung2016-07-12-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PERIPH_ID_SDMMC4(131) is not continous value with PERIPH_ID_SDMMC0(75). If there is no 'index' property in fdt, then dev_index should be assigned to dev_id(Peripheral ID). At this time, dev_index should be "56". It means Exynos SoC has "56" numbers of DWMMC IP. To prevent this behavior, it needs to check the maximum device index. Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
| * | mmc: exynos_dw_mmc: remove #ifdef for OF_CONTROLJaehoon Chung2016-07-12-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | Removed #ifdef for OF_CONTROL. It might use 'OF_CONTROL' by default. Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
| * | mmc: exynos_dw_mmc: remove the unused functionJaehoon Chung2016-07-12-36/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This function have maintained for supporting Non-FDT. Now, Almost all SoC are changed to fdt style. So there are no that this function is called anywhere. Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
* | | rockchip: mmc: Update the driver to support of-platdataSimon Glass2016-07-14-3/+26
| | | | | | | | | | | | | | | | | | | | | | | | Add support for of-platdata with rk3288. This requires decoding the of-platdata struct and setting up the device from that. Also the driver needs to be renamed to match the string that of-platdata will search for. Signed-off-by: Simon Glass <sjg@chromium.org>
* | | rockchip: mmc: Move all DT decoding to ofdata_to_platdata()Simon Glass2016-07-14-15/+17
| |/ |/| | | | | | | | | | | It is more correct to avoid touching the device tree in the probe() method. Update the driver to work this way. Signed-off-by: Simon Glass <sjg@chromium.org>
* | dm: mmc: msmsdhic: Drop old MMC codeSimon Glass2016-07-11-16/+1
| | | | | | | | | | | | Now that we have fully moved to driver model, drop the old code. Signed-off-by: Simon Glass <sjg@chromium.org>
* | dm: mmc: msm_sdhci: Support CONFIG_BLK and CONFIG_DM_MMC_OPSSimon Glass2016-07-11-2/+44
| | | | | | | | | | | | | | Add support for using driver model for block devices and MMC operations in this driver. Signed-off-by: Simon Glass <sjg@chromium.org>
* | dm: mmc: sdhci: Support CONFIG_BLK and CONFIG_DM_MMC_OPSSimon Glass2016-07-11-1/+39
| | | | | | | | | | | | | | Add support for using driver model for block devices and MMC operations in this driver. Signed-off-by: Simon Glass <sjg@chromium.org>
* | dm: mmc: sdhci: Refactor configuration setup to support DMSimon Glass2016-07-11-48/+59
| | | | | | | | | | | | | | Move the configuration setting into a separate function which can be used by the driver-model code. Signed-off-by: Simon Glass <sjg@chromium.org>
* | dm: sandbox: Convert to use CONFIG_CMD_MMC_OPSSimon Glass2016-07-11-11/+6
| | | | | | | | | | | | Update the sandbox MMC emulation to use driver model for MMC operations. Signed-off-by: Simon Glass <sjg@chromium.org>
* | dm: mmc: rockchip: Enable CONFIG_DM_MMC_OPS for all boardsSimon Glass2016-07-11-1/+2
| | | | | | | | | | | | | | Enable this option to move rockchip over to use driver model for MMC operations. Signed-off-by: Simon Glass <sjg@chromium.org>
* | dm: mmc: dwmmc: Support CONFIG_DM_MMC_OPSSimon Glass2016-07-11-0/+33
| | | | | | | | | | | | Add support to dwmmc for using driver model for MMC operations. Signed-off-by: Simon Glass <sjg@chromium.org>
* | dm: mmc: Add a way to use driver model for MMC operationsSimon Glass2016-07-11-3/+93
| | | | | | | | | | | | | | | | | | | | | | | | The driver model conversion for MMC has moved in small steps. The first step was to have an MMC device (CONFIG_DM_MMC). The second was to use a child block device (CONFIG_BLK). The final one is to use driver model for MMC operations (CONFIG_DM_MMC_OP). Add support for this. The immediate priority is to make all boards that use DM_MMC also use those other two options. This will allow them to be removed. Signed-off-by: Simon Glass <sjg@chromium.org>
* | mmc: Move tracing code into separate functionsSimon Glass2016-07-11-15/+45
| | | | | | | | | | | | | | Move this code into separate functions so that it can be used from the uclass also. Add static inline versions for when the option is disabled. Signed-off-by: Simon Glass <sjg@chromium.org>
* | dm: mmc: rockchip: Support only CONFIG_BLKSimon Glass2016-07-11-11/+0
| | | | | | | | | | | | Since all Rockchip boards use CONFIG_BLK, we can remove this old code. Signed-off-by: Simon Glass <sjg@chromium.org>
* | mmc: Move MMC boot code into its own fileSimon Glass2016-07-11-125/+146
| | | | | | | | | | | | | | Rather than having an #ifdef in the main mmc.c file, control this feature from the Makefile by moving the code into its own file. Signed-off-by: Simon Glass <sjg@chromium.org>
* | dm: mmc: Move non-CONFIG_BLK code into mmc_legacy.cSimon Glass2016-07-11-95/+91
| | | | | | | | | | | | Rather than having #ifdef in mmc.c, move this code into the legacy file. Signed-off-by: Simon Glass <sjg@chromium.org>
* | dm: mmc: Move CONFIG_BLK code into the mmc uclassSimon Glass2016-07-11-82/+83
| | | | | | | | | | | | Rather than having #ifdef in mmc.c, move this code into the uclass file. Signed-off-by: Simon Glass <sjg@chromium.org>