summaryrefslogtreecommitdiff
path: root/drivers/mmc
Commit message (Collapse)AuthorAgeLines
* mmc: dw_mmc: Use active DDR mode flagAndrew Gabbasov2014-12-12-1/+1
| | | | | | | The card_caps bit should denote the card capability to use DDR mode, but we need the flag indicating that the DDR mode is active. Signed-off-by: Andrew Gabbasov <andrew_gabbasov@mentor.com>
* mmc: Fix block length for DDR modeAndrew Gabbasov2014-12-12-0/+6
| | | | | | | | | Block length for write and read commands is fixed to 512 bytes when the card is in Dual Data Rate mode. If block length read from CSD is different, make sure the driver will use correct length in all further calculations and settings. Signed-off-by: Andrew Gabbasov <andrew_gabbasov@mentor.com>
* mmc: Fix Dual Data Rate capability recognitionAndrew Gabbasov2014-12-12-1/+1
| | | | | | | | | Since the driver doesn't work in 1.2V or 1.8V signaling level modes, Dual Data Rate mode can be supported by the driver only if it is supported by the card in regular 3.3V mode. So, check for a particular single bit in card type field. Signed-off-by: Andrew Gabbasov <andrew_gabbasov@mentor.com>
* mmc: Fix handling of bus widths and DDR card capabilitiesAndrew Gabbasov2014-12-12-21/+31
| | | | | | | | | | | | | | | | | | | | | | | If the MMC_MODE_DDR_52MHz flag is set in card capabilities bitmask, it is never cleared, even if switching to DDR mode fails, and if the controller driver uses this flag to check the DDR mode, it can take incorrect actions. Also, DDR related checks in mmc_startup() incorrectly handle the case when the host controller does not support some bus widths (e.g. can't support 8 bits), since the host_caps is checked for DDR bit, but not bus width bits. This fix clearly separates using of card_caps bitmask, having there the flags for the capabilities, that the card can support, and actual operation mode, described outside of card_caps (i.e. bus_width and ddr_mode fields in mmc structure). Separate host controller drivers may need to be updated to use the actual flags. Respectively, the capabilities checks in mmc_startup are made more correct and clear. Also, some clean up is made with errors handling and code syntax layout. Signed-off-by: Andrew Gabbasov <andrew_gabbasov@mentor.com>
* mmc: exynos_dw-mmc: change debug messageJaehoon Chung2014-12-12-10/+12
| | | | | | To debug more exactly, add the index for device. Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
* MMC: add MMC_VERSION_5_0Markus Niebel2014-12-12-0/+3
| | | | | Signed-off-by: Markus Niebel <Markus.Niebel@tq-group.com> Acked-by: Jaehoon Chung <jh80.chung@samsung.com>
* MMC: fix user capacity for partitioned eMMC cardMarkus Niebel2014-12-12-0/+15
| | | | | | | | | | if the card claims to be high capacity and the card is partitioned the capacity shall still be read from ext_csd SEC_COUNT even if the resulting capacity is smaller than 2 GiB Signed-off-by: Markus Niebel <Markus.Niebel@tq-group.com> Acked-by: Jaehoon Chung <jh80.chung@samsung.com>
* mmc: Cosmetic fix for nicer, aligned device list printoutLubomir Popov2014-12-12-2/+5
| | | | | | | | If print_mmc_devices() was called with a '\n' separator (as done for example by the "mmc list" command), it offset the 2-nd and all subsequent lines by one space. Fixing this. Signed-off-by: Lubomir Popov <l-popov@ti.com>
* Merge branch 'master' of git://git.denx.de/u-boot-tiTom Rini2014-12-08-8/+11
|\
| * omap_hsmmc: Board-specific TWL4030 MMC power initializationsPaul Kocialkowski2014-12-04-6/+1
| | | | | | | | | | | | | | | | | | | | | | | | Boards using the TWL4030 regulator may not all use the LDOs the same way (e.g. MMC2 power can be controlled by another LDO than VMMC2). This delegates TWL4030 MMC power initializations to board-specific functions, that may still call twl4030_power_mmc_init for the default behavior. Signed-off-by: Paul Kocialkowski <contact@paulk.fr> Reviewed-by: Tom Rini <trini@ti.com> [trini: Fix omap3_evm warning, add twl4030.h] Signed-off-by: Tom Rini <trini@ti.com>
| * twl4030: device-index-specific MMC power initializations, common ramp-up delayPaul Kocialkowski2014-12-04-2/+2
| | | | | | | | | | | | | | | | | | Not every device has multiple MMC slots available, so it makes sense to enable only the required LDOs for the available slots. Generic code in omap_hsmmc will enable both VMMC1 and VMMC2, in doubt. Signed-off-by: Paul Kocialkowski <contact@paulk.fr> Reviewed-by: Tom Rini <trini@ti.com>
| * mmc: Board-specific MMC power initializationsPaul Kocialkowski2014-12-04-0/+7
| | | | | | | | | | | | | | | | | | Some devices may use non-standard combinations of regulators to power MMC: this allows these devices to provide a board-specific MMC power init function to set everything up in their own way. Signed-off-by: Paul Kocialkowski <contact@paulk.fr> Reviewed-by: Tom Rini <trini@ti.com>
| * arm: omap: add support for am57xx devicesFelipe Balbi2014-12-04-2/+3
| | | | | | | | | | | | | | | | just add a few ifdefs around because this device is very similar to dra7xxx. Signed-off-by: Felipe Balbi <balbi@ti.com> Reviewed-by: Tom Rini <trini@ti.com>
* | mmc: sh_mmcif: Add support rmobileNobuhiro Iwamatsu2014-12-05-2/+7
| | | | | | | | | | | | | | | | | | Renesas R-Mobile/R-Car ARM SoC of MMC has the same IP that are supported by sh_mmcif. This adds support R-Mobile/R-Car ARM SoC with the setting of the clock support. Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com> Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
* | mmc: sh_mmcif: Change maximum and minimum value of MMC clockNobuhiro Iwamatsu2014-12-05-3/+5
| | | | | | | | | | | | | | | | | | Maximum value and the minimum value of clock for sh_mmcif instead by base of MMC clock. This removes fixed clock, make the changes to be calculated according to environment. Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com> Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
* | mmc: sh_mmcif: Use DIV_ROUND_UP and fls instead of calculation loopNobuhiro Iwamatsu2014-12-05-8/+6
|/ | | | | | | Use DIV_ROUND_UP and fls to simplify the code. Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com> Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
* Merge branch 'master' of git://git.denx.de/u-boot-mpc85xxTom Rini2014-11-26-1/+1
|\ | | | | | | | | | | | | Conflicts: drivers/mmc/fsl_esdhc.c Signed-off-by: Tom Rini <trini@ti.com>
| * mmc: fsl_esdhc: fix f_max retrieval during initMarkus Niebel2014-11-19-1/+1
| | | | | | | | | | | | | | | | | | | | | | for multi instance API we use struct fsl_esdhc_cfg to pass the clock rate. Do not set f_max from global data, since this is wrong for multi instance case. Signed-off-by: Markus Niebel <Markus.Niebel@tq-group.com> Acked-by: Stefano Babic <sbabic@denx.de> Tested-by: Eric Nelson <eric.nelson@boundarydevices.com> Reviewed-by: York Sun <yorksun@freescale.com>
* | Merge branch 'master' of git://www.denx.de/git/u-boot-imxTom Rini2014-11-24-0/+8
|\ \
| * | mmc: fsl_esdhc: Update esdhc driver for iMX6SXYe.Li2014-11-20-0/+8
| |/ | | | | | | | | | | | | | | The reset value of "uSDHCx_INT_STATUS_EN" register is changed to 0 on iMX6SX. So the fsl_esdhc driver must update to set the register, otherwise no state can be detected. Signed-off-by: Ye.Li <B37916@freescale.com>
* | linux/kernel.h: sync min, max, min3, max3 macros with LinuxMasahiro Yamada2014-11-23-4/+4
|/ | | | | | | | | | | | | | | | | | | | U-Boot has never cared about the type when we get max/min of two values, but Linux Kernel does. This commit gets min, max, min3, max3 macros synced with the kernel introducing type checks. Many of references of those macros must be fixed to suppress warnings. We have two options: - Use min, max, min3, max3 only when the arguments have the same type (or add casts to the arguments) - Use min_t/max_t instead with the appropriate type for the first argument Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: Pavel Machek <pavel@denx.de> Acked-by: Lukasz Majewski <l.majewski@samsung.com> Tested-by: Lukasz Majewski <l.majewski@samsung.com> [trini: Fixup arch/blackfin/lib/string.c] Signed-off-by: Tom Rini <trini@ti.com>
* sort drivers/mmc/MakefilePavel Machek2014-11-07-10/+12
| | | | | | | Sort drivers/mmc makefile, as requested by wd. Signed-off-by: Pavel Machek <pavel@denx.de> Acked-by: Chin Liang See <clsee@altera.com>
* omap: hsmmc: assume cd gpio is active lowIgor Grinberg2014-11-06-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | Switch the default CD GPIO polarity to active low. The current hsmmc driver assumption that the CD GPIO is active high, but in the real hardware, usually the opposite holds. The usual SD card socket has a mechanical switch which is grounded as soon as a card is inserted. Of course there might be some board logic which inverts the signal, but as far as current users are concerned, there is no such logic. Current U-Boot users either not using the CD functionality, or have a different way (e.g. external to SoC GPIO controller) for checking the card presence. This patch also brings the polarity assumption in line with the Linux kernel and adds appropriate comments. This patch also might spare issues once the TWL GPIO driver will be converted to the DM. Signed-off-by: Igor Grinberg <grinberg@compulab.co.il> Cc: Pantelis Antoniou <panto@antoniou-consulting.com> Cc: Dmitry Lifshitz <lifshitz@compulab.co.il> Reviewed-by: Tom Rini <trini@ti.com>
* dm: sunxi: Request card detect gpioHans de Goede2014-11-05-10/+22
| | | | | | | This is necessary for the device-model enabled builds to work properly. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Simon Glass <sjg@chromium.org>
* sunxi: Use CONFIG_MACH_SUN?I from Kconfig instead of CONFIG_SUN?IIan Campbell2014-11-05-2/+2
| | | | | | | | | | | Mostly automatic with: sed -i -e 's/CONFIG_\(SUN[45678]I\)/CONFIG_MACH_\1/g' $(git grep -l CONFIG_SUN[45678]I) followed by removing the relevant #defines from include/configs/sun?i.h by hand. Signed-off-by: Ian Campbell <ijc@hellion.org.uk> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* mmc: s5p: set SD detection pin as inputPrzemyslaw Marczak2014-10-27-1/+1
| | | | | | | The SD Card slot detection pin should be configured as input. Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com> Acked-by: Simon Glass <sjg@chromium.org>
* Merge http://git.denx.de/u-boot-sunxiTom Rini2014-10-26-9/+33
|\
| * mmc: sunxi: Add support for sun8i (A23)Chen-Yu Tsai2014-10-24-1/+1
| | | | | | | | | | | | | | | | | | | | The Allwinner A23 SoC has reset controls like the A31 (sun6i). The FIFO address is also the same as sun6i. Re-use code added for sun6i. Signed-off-by: Chen-Yu Tsai <wens@csie.org> Acked-by: Ian Campbell <ijc@hellion.org.uk>
| * sunxi: When we've both mmc0 and mmc2, detect from which one we're bootingHans de Goede2014-10-24-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | sunxi SOCs can boot from both mmc0 and mmc2, detect from which one we're booting, and make that one "mmc dev 0" so that a single u-boot binary can be used for both the onboard eMMC and for external sdcards. When we're booting from mmc2, we make it dev 0 because that is where the SPL will load the tertiary payload (the actual u-boot binary in our case) from, see: common/spl/spl_mmc.c, which has dev 0 hardcoded everywhere. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Ian Campbell <ijc@hellion.org.uk>
| * sunxi: Add mmc card-detect functionalityHans de Goede2014-10-24-0/+21
| | | | | | | | | | Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Ian Campbell <ijc@hellion.org.uk>
| * ARM: sunxi-mmc: Add mmc support for sun6i / A31Hans de Goede2014-10-24-4/+7
| | | | | | | | | | | | | | | | | | | | | | The mmc hardware on sun6i has an extra reset control that needs to be de-asserted prior to usage. Also the FIFO address is different. Signed-off-by: Hans de Goede <hdegoede@redhat.com> [wens@csie.org: use setbits_le32 for reset control, drop obsolete changes, rewrite different FIFO address handling, add commit message] Signed-off-by: Chen-Yu Tsai <wens@csie.org> Acked-by: Ian Campbell <ijc@hellion.org.uk>
| * mmc: sunxi: add SDHC support for sun6i/sun7i/sun8iWills Wang2014-10-24-0/+3
| | | | | | | | | | | | | | Allwinner A20/A23/A31's SD/MMC host support SDHC High Capacity feature. Signed-off-by: Wills Wang <wills.wang.open@gmail.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* | Merge git://git.denx.de/u-boot-dmTom Rini2014-10-26-5/+10
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | Fix a trivial conflict over adding <dm.h> Conflicts: arch/arm/cpu/armv7/omap3/board.c Signed-off-by: Tom Rini <trini@ti.com>
| * | dm: omap: gpio: Support driver modelSimon Glass2014-10-23-5/+10
| |/ | | | | | | | | | | | | | | | | | | | | | | Add driver model support to this driver, while retaining support for the legacy system. Driver model GPIO support is enabled with CONFIG_DM_GPIO as usual. Since gpio_is_valid() no longer exists, we can use the -EINVAL error returned from gpio_request(). Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@ti.com>
* | mmc: bcm2835_sdhci: add missing includeJeroen Hofstee2014-10-25-0/+1
| | | | | | | | Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
* | tegra: make local functions staticJeroen Hofstee2014-10-25-1/+2
| | | | | | | | Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
* | sdhci: make local functions staticJeroen Hofstee2014-10-25-3/+3
|/ | | | Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
* Merge branch 'master' of git://git.denx.de/u-boot-tegraTom Rini2014-10-23-1/+1
|\
| * mmc: Tegra: Fix timeout issue seen on certain eMMC partsMarcel Ziswiler2014-10-22-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | During rigorous testing of our latest update infrastructure I came across quite consistent timeouts on certain eMMC parts (e.g. Hynix H26M21001ECR) when writing big (e.g. in excess of 400 MB) file system images: MMC write: dev # 0, block # 40960, count 944128 ... mmc_send_cmd_bounced: MMC Timeout Interrupt status 0x00000001 Interrupt status enable 0xdfff003b Interrupt signal enable 0xdfff0002 Present status 0x01870106 mmc write failed Comparing the various data sheets I came across the following timeout specification: Secure Erase/TRIM Timeout=300ms*2*10=6000ms Unfortunately empirical testing still failed albeit much more rarely. Increasing the timeout to 8000ms made it finally disappear entirely. This patch allows us writing various eMMC parts without seeing any further issues. Signed-off-by: Marcel Ziswiler <marcel@ziswiler.com> Signed-off-by: Tom Warren <twarren@nvidia.com>
* | arm: marvell: Move arch/kirkwood.h to arch/soc.hStefan Roese2014-10-23-1/+1
| | | | | | | | | | | | | | | | | | This move makes is possible to use this header not only from kirkwood platforms but from all Marvell mvebu platforms. Signed-off-by: Stefan Roese <sr@denx.de> Tested-by: Luka Perkov <luka@openwrt.org> Acked-by: Prafulla Wadaskar <prafulla@marvell.com>
* | dm: exynos: Make sure that GPIOs are requestedSimon Glass2014-10-22-1/+6
|/ | | | | | | | | | With driver model GPIOs must be requested before use. Make sure this is done correctly. (Note that the soft SPI part of universal is omitted, since this driver is about to be replaced with a driver-model-aware version) Signed-off-by: Simon Glass <sjg@chromium.org>
* Merge branch 'u-boot/master' into 'u-boot-arm/master'Albert ARIBAUD2014-10-11-25/+111
|\
| * Merge branch 'topic/arm/socfpga-20141006' of git://git.denx.de/u-boot-socfpgaTom Rini2014-10-06-12/+27
| |\ | | | | | | | | | | | | | | | | | | | | | | | | Fix a trivial conflict in dw_mmc.c after talking with Marek. Conflicts: drivers/mmc/dw_mmc.c Signed-off-by: Tom Rini <trini@ti.com>
| | * arm: socfpga: mmc: Pick the clock from clock managerPavel Machek2014-10-06-4/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make the SoCFPGA MMC stub pick clock via the clock manager frequency accessors instead of hard-coding the frequency. Also fix calloc() misuse. Signed-off-by: Pavel Machek <pavel@denx.de> Signed-off-by: Marek Vasut <marex@denx.de> Cc: Chin Liang See <clsee@altera.com> Cc: Dinh Nguyen <dinguyen@altera.com> Cc: Albert Aribaud <albert.u.boot@aribaud.net> Cc: Tom Rini <trini@ti.com> Cc: Wolfgang Denk <wd@denx.de> Cc: Pavel Machek <pavel@denx.de> Acked-by: Dinh Nguyen <dinguyen@opensource.altera.com>
| | * mmc: dw_mmc: cleanupsPavel Machek2014-10-06-12/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The dw_mmc driver was responding to errors with debug(). Change that to prinf()/puts() respectively so that any errors are immediately obvious. Also adjust english in comments. Signed-off-by: Pavel Machek <pavel@denx.de> Signed-off-by: Marek Vasut <marex@denx.de> Cc: Chin Liang See <clsee@altera.com> Cc: Dinh Nguyen <dinguyen@altera.com> Cc: Albert Aribaud <albert.u.boot@aribaud.net> Cc: Tom Rini <trini@ti.com> Cc: Wolfgang Denk <wd@denx.de> Cc: Pavel Machek <pavel@denx.de> Cc: Pantelis Antoniou <panto@antoniou-consulting.com> Acked-by: Chin Liang See <clsee@altera.com>
| * | dw_mmc: cleanupsPavel Machek2014-10-03-11/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | dw_mmc driver was responding to errors with debug(). Change that to prinf so that any errors are immediately obvious. Also adjust english in comments. Signed-off-by: Pavel Machek <pavel@denx.de> Acked-by: Pantelis Antoniou <panto@antoniou-consulting.com>
| * | mmc: Fix mmc bus widthMario Schuknecht2014-10-03-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After setting the bus width, the extended CSD register is read. Some selected fields are compared with previously read extended CSD register fields. In this comparison the EXT_CSD_ERASE_GROUP_DEF field is compared. But this field is previously written under certain circumstances. And then the comparison fails. Only compare read-only fields. Therefore compare field EXT_CSD_HC_WP_GRP_SIZE instead of field EXT_CSD_ERASE_GROUP_DEF. Signed-off-by: Mario Schuknecht <mario.schuknecht@dresearch-fe.de> Acked-by: Pantelis Antoniou <panto@antoniou-consulting.com>
| * | mvebu_mmc: Driver additionMario Schuknecht2014-10-03-1/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In function mvebu_mmc_write notice command timeout. It is possible that a command is done, but a timeout occurred. Enable timeout in set bus function. Set window registers. Without that I could not use the driver on a Kirkwood 88F6282 SoC. Set high capacity and 52MHz driver feature. Signed-off-by: Mario Schuknecht <mario.schuknecht@dresearch-fe.de> Reviewed-by: Stefan Roese <sr@denx.de> Acked-by: Pantelis Antoniou <panto@antoniou-consulting.com>
| * | mmc: restore capacity when switching to partition 0Peter Bigot2014-10-03-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The capacity and lba for an MMC device with part_num 0 reflects the whole device. When mmc_switch_part() successfully switches to a partition, the capacity is changed to that partition. As partition 0 does not physically exist, attempts to switch back to the whole device will indicate an error, but the capacity setting for the whole device must still be restored to match the partition. Signed-off-by: Peter A. Bigot <pab@pabigot.com> Tested-by: Tom Rini <trini@ti.com> Acked-by: Pantelis Antoniou <panto@antoniou-consulting.com>
| * | mmc: fix ERASE_GRP_DEF handlingHannes Petermaier2014-10-03-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | if we set manually this bit on the eMMC card using mmc_switch(...), we also have to set it within our (before read) internal structure 'ext_csd'. Otherwise following checks on this will fail. Acked-by: Pantelis Antoniou <panto@antoniou-consulting.com> Signed-off-by: Hannes Petermaier <oe5hpm@oevsv.at>