summaryrefslogtreecommitdiff
path: root/drivers/mmc
AgeCommit message (Collapse)Author
2011-01-14fsl_esdhc: Fix esdhc disabled problem on some platformsChenhui Zhao
Some new platform's esdhc pins don't share with other function. The eSDHC shouldn't be disabled, even if "esdhc" isn't defined in hwconfig env variable. Use CONFIG_FSL_ESDHC_PIN_MUX to fix this problem. Signed-off-by: Chenhui Zhao <b26998@freescale.com> Signed-off-by: Li Yang <leoli@freescale.com> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2010-12-18fsl_esdhc: Fix the voltage validation processLi Yang
The current code use all the voltage range support by the host controller to do the validation. This will cause problem when the host supports Low Voltage Range. Change the validation voltage to be based on board setup. Signed-off-by: Li Yang <leoli@freescale.com> Tested-by: Stefano Babic <sbabic@denx.de> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2010-12-18fsl_esdhc: Fix max clock frequencyJerry Huang
The max clock of MMC is 52MHz Signed-off-by: Jerry Huang <Changm-Ming.Huang@freescale.com> Tested-by: Stefano Babic <sbabic@denx.de> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2010-12-18fsl_esdhc: Use mmc_set_clock to set initial speedJerry Huang
After booting the u-boot, and first using some SD card (such as Sandisk 2G SD card), because the field 'clock' of struct mmc is zero, this will cause the read transfer is always active and SDHC DATA line is always active, therefore, driver can't handle the next command. Therefore, we use mmc_set_clock to setup both the data structure and HW to the initial clock speed of 400000Hz. Signed-off-by: Jerry Huang <Chang-Ming.Huang@freescale.com> Tested-by: Stefano Babic <sbabic@denx.de> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2010-12-13fsl_esdhc: Set the eSHDC DMACTL[SNOOP] bit after resetting the controllerP.V.Suresh
eSDHC host controller reset results in clearing of snoop bit also. This patch sets the SNOOP bit after the completion of host controller reset. Without this patch mmc reads are not consistent. Signed-off-by: P.V.Suresh <pala@freescale.com> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2010-12-07AT91: gen_atmel_mci.c: fix bug when Slot B is usedReinhard Meyer
Signed-off-by: Reinhard Meyer <u-boot@emk-elektronik.de>
2010-11-19mmc: omap: timeout counter fixNishanth Menon
Having a loop with a counter is no timing guarentee for timing accuracy or compiler optimizations. For e.g. the same loop counter which runs when the MPU is running at 600MHz will timeout in around half the time when running at 1GHz. or the example where GCC 4.5 compiles with different optimization compared to GCC 4.4. use timer to keep track of time elapse and we use an emperical number - 1sec for a worst case timeout. This should never happen, and is adequate imaginary condition for us to fail with timeout. Signed-off-by: Nishanth Menon <nm@ti.com> Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
2010-11-17Switch from archive libraries to partial linkingSebastien Carlier
Before this commit, weak symbols were not overridden by non-weak symbols found in archive libraries when linking with recent versions of binutils. As stated in the System V ABI, "the link editor does not extract archive members to resolve undefined weak symbols". This commit changes all Makefiles to use partial linking (ld -r) instead of creating library archives, which forces all symbols to participate in linking, allowing non-weak symbols to override weak symbols as intended. This approach is also used by Linux, from which the gmake function cmd_link_o_target (defined in config.mk and used in all Makefiles) is inspired. The name of each former library archive is preserved except for extensions which change from ".a" to ".o". This commit updates references accordingly where needed, in particular in some linker scripts. This commit reveals board configurations that exclude some features but include source files that depend these disabled features in the build, resulting in undefined symbols. Known such cases include: - disabling CMD_NET but not CMD_NFS; - enabling CONFIG_OF_LIBFDT but not CONFIG_QE. Signed-off-by: Sebastien Carlier <sebastien.carlier@gmail.com>
2010-11-04mmc: Add multi-block read support to the generic mmc driverAlagu Sankar
This patch adds multi-block read support for the generic MMC driver. Large reads are broken into chunks of 65535 blocks to ensure that the code works with controllers having a 16 bit block counter. This patch results in a significant performance improvement. Time to read a 45 MB file went from 36 seconds to 9 seconds on Overo Signed-off-by: Steve Sakoman <steve.sakoman@linaro.org> Tested-by: Steve Sakoman <steve.sakoman@linaro.org> Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
2010-11-04mmc: Clean up generic mmc driver multi-block write functionsSteve Sakoman
The current mmc write implementation is type ulong, but returns int values. Some of the printf's are terminated with /n/r, one has none. This patch fixes these issues and also removes some unnecessary local variables. Signed-off-by: Steve Sakoman <steve.sakoman@linaro.org> Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
2010-10-29Merge branch 'master' of git://git.denx.de/u-boot-samsungWolfgang Denk
2010-10-27Coding Style cleanupWolfgang Denk
Signed-off-by: Wolfgang Denk <wd@denx.de>
2010-10-27mmc: seperate block number into small parts for multi-write cmdLei Wen
Constraint the mmc framework to only send no more than 65535 blocks in one go during the multi-write command. This constraint comes due to the limitation of 16bit width block counter register at some hardware. Signed-off-by: Lei Wen <leiwen@marvell.com> Cc: Reinhard Meyer <u-boot@emk-elektronik.de>
2010-10-19PXA: pxa-regs.h cleanupMarek Vasut
Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
2010-10-19s5p_mmc: support 8-bit bus widthJaehoon Chung
This Patch do support 8-bit bus width for s5p So we add parameter for bus_width (in s5p_mmc_init(), s5p_mmc_initialize()) If want to use 8-bit bus width, only change (0, 8) instead of (0, 4). Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com> Signed-off-by: Minkyu Kang <mk7.kang@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2010-10-17ARMV7: OMAP: Add new mmc driver compatible with CONFIG_GENERIC_MMCSukumar Ghorai
OMAP boards currently use a legacy mmc driver. This patch adds a new mmc driver which will work with the generic mmc driver in u-boot. This new driver will work with both OMAP3 and OMAP4 boards. This patch does not remove the old driver. It should remain in the tree until all boards that use it switch to the new driver. Signed-off-by: Sukumar Ghorai <s-ghorai@ti.com> Tested-by: Steve Sakoman <steve@sakoman.com>
2010-10-17MMC: Fix for capacity calculation on eMMCSukumar Ghorai
The current mmc driver returns erroneous capacity information for eMMC. The capacity of eMMC devices is available only in the ext-CSD register. This patch add code to read the ext-CDSD register and correctly calculate eMMC capacity. Signed-off-by: Sukumar Ghorai <s-ghorai@ti.com> Acked-by: Steve Sakoman <steve@sakoman.com>
2010-10-02Blackfin: bfin_sdh: clean up send_cmdMike Frysinger
Simplify the command setup and status checking steps, and add a proper timeout to the status polling code to avoid possible infinite hangs. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-09-19mmc: fix compiler warningsWolfgang Denk
Commit d2bf29e3 caused a number of compiler warnings: mmc.c: In function 'mmc_bwrite': mmc.c:97: warning: format '%x' expects type 'unsigned int', but argument 2 has type 'long unsigned int' mmc.c:97: warning: format '%x' expects type 'unsigned int', but argument 3 has type 'lbaint_t' mmc.c: In function 'mmc_bread': mmc.c:229: warning: format '%x' expects type 'unsigned int', but argument 2 has type 'long unsigned int' mmc.c:229: warning: format '%x' expects type 'unsigned int', but argument 3 has type 'lbaint_t' Fix these. Signed-off-by: Wolfgang Denk <wd@denx.de> Cc: Lei Wen <leiwen@marvell.com>
2010-09-18mmc: add boundary check for mmc operationLei Wen
Signed-off-by: Lei Wen <leiwen@marvell.com>
2010-09-07Merge branch 'at91' of git://git.denx.de/u-boot-atmelWolfgang Denk
2010-09-07Merge branch 'master' of git://git.denx.de/u-boot-samsungWolfgang Denk
2010-09-03AT91: MCI: add SD/MMC driver using mmc frameworkReinhard Meyer
Signed-off-by: Reinhard Meyer <u-boot@emk-elektronik.de>
2010-08-17S5P: Use accessor functions instead of SoC specific defines to access the ↵Minkyu Kang
base address This patch is intended to prepare the other S5P SoC. (s5pc210) If use SoC specific defines then can't share with other SoC. So, make the accessor functions for access the base address by common way. Signed-off-by: Minkyu Kang <mk7.kang@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2010-08-12mmc: omap3: fix block read functionGrazvydas Ignotas
The OMAP3 block read function is not following API and always returning 1 instead of read block count, fix it. Also to simplify code, merge it with with a helper function, which was only called from the block read function. After this patch ext2 filesystem can be used properly. Signed-off-by: Grazvydas Ignotas <notasas@gmail.com> Tested-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
2010-08-12mmc: omap3: make local symbols staticGrazvydas Ignotas
Make driver local variables and functions static and remove them from the arch header. Signed-off-by: Grazvydas Ignotas <notasas@gmail.com> Tested-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
2010-08-10S5P: mmc: use the standard debug macroMinkyu Kang
Use the standard debug macro instead of the costom macro Signed-off-by: Minkyu Kang <mk7.kang@samsung.com> Cc: Wolfgang Denk <wd@denx.de>
2010-08-03Merge branch 'master' of git://git.denx.de/u-boot-samsungWolfgang Denk
2010-08-03S5P: support mmc driverMinkyu Kang
This patch adds support mmc driver for s5p SoC Signed-off-by: Minkyu Kang <mk7.kang@samsung.com> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2010-07-15Merge branch 'master' of ../masterWolfgang Denk
2010-07-13Blackfin: bfin_sdh: convert to portmux frameworkMike Frysinger
Rather than bang MMRs directly, use the new portmux framework to handle the details. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-07-06mmc: add function prototype for mmc_set_dev in mmc.hSteve Sakoman
this eliminates compiler warnings when cmd_mmc.c is built with CONFIG_SYS_MMC_SET_DEV the mmc_set_dev implementation in omap3_mmc.c is also tweaked to match the new prototype in parameter naming and type Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
2010-07-06ARMV7: Restructure OMAP mmc driver to allow code sharing between OMAP3 and OMAP4Steve Sakoman
The architecture independent header is moved to drivers/mmc, and the architecture dependent headers reside in asm/arch-omap3 and asm/arch-omap4 Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
2010-07-05OMAP: mmc: add support for second and third mmc channelsSteve Sakoman
This patch adds support for the second and third mmc channels on OMAP3 processors Boards wishing to use this feature should define CONFIG_SYS_MMC_SET_DEV in the board config Tested on Overo Signed-off-by: Steve Sakoman <steve@sakoman.com> Tested-by: Philip Balister <philip@opensdr.com> Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
2010-06-13PXA: PXAMMC: Add Monahans supportMarek Vasut
This patch enables PXAMCI support on PXA3xx CPUs. This patch only enables MMC1 though, MMC2 and PXA31x MMC3 will need further patch to be operational. Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
2010-06-13PXA: PXAMMC: Drop different delays for PXA27XMarek Vasut
In case the delays were set to 10000, the MMC card on PXA27X boards (and PXA3xx boards) didn't initialize on first try. Increasing the delays and leaving just those for PXA25x and 26x (that is 200000) fixes this problem. Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
2010-05-15drivers/mmc/fsl_esdhc.c: fix compiler warningsWolfgang Denk
Commit 77c1458d caused the following compiler warnings: fsl_esdhc.c: In function 'esdhc_pio_read_write': fsl_esdhc.c:142: warning: assignment discards qualifiers from pointer target type fsl_esdhc.c: In function 'esdhc_setup_data': fsl_esdhc.c:169: warning: unused variable 'wml_value' fsl_esdhc.c: In function 'esdhc_pio_read_write': fsl_esdhc.c:164: warning: control reaches end of non-void function Fix these. Signed-off-by: Wolfgang Denk <wd@denx.de> Cc: Dipen Dudhat <dipen.dudhat@freescale.com> Cc: Andy Fleming <afleming@freescale.com>
2010-04-24ppc/85xx: PIO Support for FSL eSDHC Controller DriverDipen Dudhat
On some Freescale SoC Internal DMA of eSDHC controller has bug. So PIO Mode has been introduced to do data transfer using CPU. Signed-off-by: Dipen Dudhat <dipen.dudhat@freescale.com>
2010-04-07fsl_esdhc: Only modify the field we are changing in WMLRoy Zang
When we set the read or write watermark in WML we should maintain the rest of the register as is, rather than using some hard coded value. Signed-off-by: Roy Zang <tie-fei.zang@freescale.com> Acked-by: Stefano Babic <sbabic@denx.de> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2010-04-07fsl_esdhc: Add function to reset the eSDHC controllerJerry Huang
To support multiple block read command we must set abort or use auto CMD12. If we booted from eSDHC controller neither of these are used and thus we need to reset the controller to allow multiple block read to function. Signed-off-by: Jerry Huang <Chang-Ming.Huang@freescale.com> Signed-off-by: Roy Zang <tie-fei.zang@freescale.com> Acked-by: Stefano Babic <sbabic@denx.de> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2010-04-07fsl_esdhc: Always stop clock before changing frequencyKumar Gala
We need to stop the clocks on 83xx/85xx as well as imx. No need to make this code conditional to just imx. Signed-off-by: Kumar Gala <galak@kernel.crashing.org> Acked-by: Stefano Babic <sbabic@denx.de>
2010-03-21mxcmmc: fix warnings due to access 32 bit registers with 16 bit accessorsStefano Babic
Some registers of the mxcmmc driver were accessed using 16 bit accessor functions, because only the LSB is significant. This is not needed and generates warnings. Signed-off-by: Stefano Babic <sbabic@denx.de>
2010-03-11Fix memory leak in mmc_read()Wolfgang Denk
There is be a path through mmc_read in drivers/mmc/mmc.c where malloc'd memory is not freed before exiting mmc_read: it occurs if mmc_set_blocklen() returns a non-zero value. Reported-by: Quentin Armitage <Quentin@Armitage.org.uk> Signed-off-by: Wolfgang Denk <wd@denx.de>
2010-03-07fsl_esdhc: add support for mx51 processorStefano Babic
The esdhc controller in the mx51 processor is quite the same as the one in some powerpc processors (MPC83xx, MPC85xx). This patches adapts the driver to support the arm mx51. Signed-off-by: Stefano Babic <sbabic@denx.de>
2010-03-07MMC: add weak function to detect MMC/SD cardStefano Babic
Most controllers can check if there is a card in the slot. However, they require pins that could be not available because required by other functions and the detection of a card must be performed in another way. This patch adds a weak function that a board can implement to add its internal custom way to check the presence of a MMC/SD card. Signed-off-by: Stefano Babic <sbabic@denx.de>
2010-03-07mmc: check correctness of the voltage mask in ocrStefano Babic
Most cards do not answer if some reserved bits in the ocr are set. However, some controllers can set bit 7 (reserved for low voltages), but how to manage low voltages SD card is not yet specified. Signed-off-by: Stefano Babic <sbabic@denx.de>
2010-01-17Blackfin: convert bfin_sdh to generic mmcCliff Cai
Signed-off-by: Cliff Cai <cliff.cai@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-11-27omap3_mmc: Encapsulate twl4030 under option CONFIG_TWL4030_POWERVaibhav Hiremath
Fixes the build/compilation error if we try to re-use the omap3_mmc code without TWL4030_POWER. Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
2009-10-13OMAP3 MMC: Fix warning dereferencing type-punned pointerDirk Behme
Fix warning Dereferencing type-punned pointer will break strict-aliasing rules Signed-off-by: Dirk Behme <dirk.behme@googlemail.com> CC: Steve Sakoman <sakoman@gmail.com> Acked-by: Tom Rix <Tom.Rix@windriver.com>
2009-08-10Minor coding style cleanup.Wolfgang Denk
Signed-off-by: Wolfgang Denk <wd@denx.de>