summaryrefslogtreecommitdiff
path: root/drivers/mmc/bcm2835_sdhci.c
AgeCommit message (Collapse)Author
2017-06-01dm: Rename dev_addr..() functionsSimon Glass
These support the flat device tree. We want to use the dev_read_..() prefix for functions that support both flat tree and live tree. So rename the existing functions to avoid confusion. In the end we will have: 1. dev_read_addr...() - works on devices, supports flat/live tree 2. devfdt_get_addr...() - current functions, flat tree only 3. of_get_address() etc. - new functions, live tree only All drivers will be written to use 1. That function will in turn call either 2 or 3 depending on whether the flat or live tree is in use. Note this involves changing some dead code - the imx_lpi2c.c file. Signed-off-by: Simon Glass <sjg@chromium.org>
2017-05-10dm: mmc: rpi: Convert Raspberry Pi to driver model for MMCSimon Glass
Convert the bcm2835 SDHCI driver over to support CONFIG_DM_MMC and move all boards over. There is no need to keep the old code since there are no other users. Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com> Signed-off-by: Simon Glass <sjg@chromium.org>
2017-04-14mmc: bcm2835_sdhci: Speed up mmc writes.Jocelyn Bohr
The linux kernel driver for this module does not use a delay when writing to the SDHCI_BUFFER register. This patch mimics that behavior in order to speed up the mmc writes on the Raspberry Pi. Signed-off-by: Alex Deymo <deymo@google.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2017-01-23mmc: sdhci: Distinguish between base clock and maximum peripheral frequencyStefan Herbrechtsmeier
The sdhci controller assumes that the base clock frequency is fully supported by the peripheral and doesn't support hardware limitations. The Linux kernel distinguishes between base clock (max_clk) of the host controller and maximum frequency (f_max) of the card interface. Use the same differentiation and allow the platform to constrain the peripheral interface. Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
2016-10-10mmc: sdhci: use the generic error numberJaehoon Chung
Use the generic error number instead of meaningless value. Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2016-10-10mmc: sdhci: use the host version value in sdhci_setup_cfgJaehoon Chung
"host->version" isn't a SoC specific value. It doesn't need to get in each SoC drivers. Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com> Reviewed-by: Minkyu Kang <mk7.kang@samsung.com>
2016-03-27mmc: bcm2835: fix 64-bit build warningStephen Warren
Fixes: drivers/mmc/bcm2835_sdhci.c: In function ‘bcm2835_sdhci_init’: drivers/mmc/bcm2835_sdhci.c:181:17: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
2015-06-25mmc: bcm2835_sdhci: Restore original delay behaviorMarek Vasut
Patch 33fe2fb8df01647f97a7bce96a1c7781a7f6d253 titled "mmc: bcm283x: Remove get_timer_us() from mmc driver" incorrectly replaced ad-hoc get_timer_us() function with a plain get_timer(). The get_timer() operates in mSec units instead of uSec though, which caused very slow operation of the driver. Restore the original behavior of the driver, but avoid get_timer_us() and use timer_get_us() instead. The later is part of the standard API. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Jakub Kiciński <moorray3@wp.pl> Cc: Stephen Warren <swarren@wwwdotorg.org> Tested-by: Jakub Kicinski <kubakici@wp.pl>
2015-05-05ARM: mmc: bcm283x: Remove get_timer_us() from mmc driverMarek Vasut
The get_timer_us() function is something which is no longer existing in case we use generic timer framework, so replace it with get_timer(). Signed-off-by: Marek Vasut <marex@denx.de> Cc: Stephen Warren <swarren@wwwdotorg.org> Cc: Tyler Baker <tyler.baker@linaro.org>
2015-05-05mmc: bcm2835_sdhci: Use calloc to allocate bcm2835_sdhci_hostAlexander Stein
We need to clear the allocated memory explicitly as the included struct sdhci_host has function pointers. Those are compared to NULL to test if this (optional) feature is supported. Leaving them undefined let u-boot jump to arbitrary memory. Signed-off-by: Alexander Stein <alexanders83@web.de>
2015-03-28ARM: bcm283x: move SoC headers to mach-bcm283x/include/machMasahiro Yamada
Move arch/arm/include/asm/arch-bcm283x/* -> arch/arm/mach-bcm283x/include/mach/* Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Acked-by: Stephen Warren <swarren@wwwdotorg.org>
2014-10-25mmc: bcm2835_sdhci: add missing includeJeroen Hofstee
Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
2014-08-01bcm2835_sdhci: Add SDHCI_QUIRK_NO_HISPD_BIT flagLubomir Rintel
Seems like the controller doesn't support the flag. None of the hi-speed cards I've tried could be read, while they successfully worked with the quirk enabled. Signed-off-by: Lubomir Rintel <lkundrak@v3.sk> Tested-by: Stephen Warren <swarren@wwwdotorg.org>
2013-04-04ARM: bcm2835: fix get_timer() to return msStephen Warren
Apparently, CONFIG_SYS_HZ must be 1000. Change this, and fix the timer driver to conform to this. Have the timer implementation export a custom API get_timer_us() for use by the BCM2835 MMC API, which needs us resolution for a HW workaround. Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
2013-03-20mmc: add bcm2835 driverStephen Warren
This adds a simple driver for the BCM2835's SD controller. Workarounds are implemented for: * Register writes can't be too close to each-other in time, or they will be lost. * Register accesses must all be 32-bit, so implement custom accessors. This code was extracted from: git://github.com/gonzoua/u-boot-pi.git master which was created by Oleksandr Tymoshenko. Portions of the code there were obviously based on the Linux kernel at: git://github.com/raspberrypi/linux.git rpi-3.6.y commit f5b930b "Main bcm2708 linux port" signed-off-by Dom Cobley. swarren changed the following for upstream: * Removed hack udelay()s in bcm2835_sdhci_raw_writel(); setting SDHCI_QUIRK_WAIT_SEND_CMD appears to solve the issues. * Remove register logging from read*/write* functions. * Sort out confusion with min/max_freq values passed to add_sdhci(). * Use more descriptive variable names and calculations in IO accessors. * Simplified and commented twoticks_delay calculation. * checkpatch fixes. Cc: Andy Fleming <afleming@gmail.com> Signed-off-by: Oleksandr Tymoshenko <gonzo@bluezbox.com> Signed-off-by: Stephen Warren <swarren@wwwdotorg.org> Acked-by: Andy Fleming <afleming@gmail.com>