summaryrefslogtreecommitdiff
path: root/drivers/mmc/mmc.c
Commit message (Collapse)AuthorAgeLines
* mmc: CMD7:MMC_CMD_SELECT_CARD response fixAjay Bhargav2012-03-29-1/+1
| | | | | | | | | | | | | As per JEDEC document JESD84-A441 (page 105) response for CMD7 (MMC_CMD_SELECT_CARD) response should be R1 instead of R1b. In uboot we never take MMC to disconnected state and on powerup its always ideal state which later goes to stand-by state. from document footnote: R1 while selecting from Stand-By State to Transfer State; R1b while selecting from Disconnected State to Programming State. Signed-off-by: Ajay Bhargav <ajay.bhargav@einfochips.com>
* ENGR00139221 USDHC Add SDXC UHS-I supportAnish Trivedi2011-10-27-15/+210
| | | | | | | Modified MMC library for UHS-I command sequence Added support to USDHC driver for UHS-I Signed-off-by: Anish Trivedi <anish@freescale.com>
* ENGR00156670-2 MMC: Fixed some bugs in common codeAnish Trivedi2011-09-13-1/+1
| | | | | | | | | | | | | Need to send RCA when sending CMD13. Cannot use print_size function when displaying card capacity because it expects a 32 bit integer as input, while mmc->capacity is a 64 bit integer. There is loss of information leading to incorrect capacities being displayed for "mmcinfo" cmd. Changed it to simply print the entire 64 bit integer, which is the number of bytes. Signed-off-by: Tony Lin <tony.lin@freescale.com> Signed-off-by: Anish Trivedi <anish@freescale.com>
* ENGR00156304 eMMC: Need to update partition config after changing boot partitionAnish Trivedi2011-09-08-32/+33
| | | | | | | | | | | | | | | | After enabling boot partition on an eMMC using "mmc bootpart" command, the partition configuration variable that is supposed to track this value on the eMMC is not updated. This leads to stale and possibly inaccurate boot partition number being printed when "mmcinfo" command is used, thereby confusing the user. The fix is to update the part_config variable of mmc struct with the new value that was just written to the eMMC. Also removed condition that restricted boot_bus_width programming (for fastboot) to eMMC with DDR support only. Now, even non-DDR capable eMMCs can be programmed for fastboot (in SDR mode). Signed-off-by: Anish Trivedi <anish@freescale.com>
* ENGR00154666-3: Align u-boot mmc command with communityTerry Lv2011-09-01-309/+540
| | | | | | | | | | | This patch will enhance mmc command. 1. Add erase command. 2. Abandon dev_no in mmc command. User need to switch slot with "mmc dev" command. 3. Add mmc part switch command. Enhance partition switch support. 4. Add mmc bootpart. Boot partition support is more flexible. Signed-off-by: Terry Lv <r65388@freescale.com>
* ENGR00144424 MX6: enable uboot for ARM2(SABREAUTO) CPU boardAnson Huang2011-06-24-2/+2
| | | | | | | | | | | | | Use 528M DDR script Disable L2 cache because rom enable L2 cache when use plug-in Fix usdhc pad settings Remove mac address hardcode Signed-off-by: Anson Huang <b20788@freescale.com> Signed-off-by: Richard Zhu <r65037@freescale.com> Signed-off-by: Terry Lv <r65388@freescale.com> Signed-off-by: Anish Trivedi <anish@freescale.com> Signed-off-by: Jason Liu <r64343@freescale.com>
* ENGR00140873: MMC may wrongly regconize 2GB eMMC as high capacityTerry Lv2011-03-21-2/+4
| | | | | | | | | | | | MMC driver may wrongly regconize some 2GB eMMC as high capacity card. This patch is picked from community. A non-zero value of SEC_COUNT does not indicate that the card is sector addressed. According to the MMC specification, cards with a densitygreater than 2GiB are sector addressed. Signed-off-by: Terry Lv <r65388@freescale.com>
* ENGR00136863-1: Change mmc framework architecture.Terry Lv2010-12-29-200/+134
| | | | | | | | | | Change mmc framework architecture. Mainly for code clean and restructure. Mainly merge our code with community code. Based on commit 17b4c8e9eb30e3eb305baef98eb23325e61db592. Signed-off-by: Terry Lv <r65388@freescale.com>
* ENGR00136038: Remove config CONFIG_EMMC_DDR_MODETerry Lv2010-12-10-20/+6
| | | | | | | | | 1. As we can check DDR dynamically, remove CONFIG_EMMC_DDR_MODE in mmc.c. 2. Add config CONFIG_EMMC_DDR_PORT_DETECT config for some boards that only some board support DDR. Signed-off-by: Terry Lv <r65388@freescale.com>
* ENGR00125036 Uboot Add eMMC 4.4 supportAnish Trivedi2010-07-20-4/+105
| | | | | | | Enable DDR mode on ESDHC controller and mmc library Enable 8-bit support in mmc library Signed-off-by: Anish Trivedi <anish@freescale.com>
* ENGR00123782 Fix boot partition problem for emmcAnish Trivedi2010-06-24-52/+66
| | | | | | Enable boot partition in BOOT_CONFIG byte of EXT_CSD Signed-off-by: Anish Trivedi <anish@freescale.com>
* ENGR00119033: System can not find MMC/SD card in SD slot 1Terry Lv2010-03-30-4/+11
| | | | | | | System can not find MMC/SD card in SD slot 1 when booting from Uboot. Signed-off-by: Terry Lv <r65388@freescale.com>
* ENGR00122050: mmc can't read data whose size exceeds 32MTerry Lv2010-03-26-55/+71
| | | | | | mmc can't read data whose size exceeds 32M. Signed-off-by: Terry Lv <r65388@freescale.com>
* ENGR00120830: Add eMMC and eSD fast boot supportTerry Lv2010-02-08-1/+150
| | | | | | | Add eMMC and eSD fast boot support. Signed-off-by: Terry Lv <r65388@freescale.com> Signed-off-by: Brian Liu <b14843@freescale.com>
* ENGR00118751: Some mmc card can't read and write from right offset.Terry Lv2009-11-27-13/+46
| | | | | | | | Some mmc card can't read and write from right offset. Driver see these card as high capacity and use sector mode for them. This will lead to read and write corrupt. Signed-off-by: Terry Lv <r65388@freescale.com>
* ENGR00118294: Misc changes for v2009.08 upgrade.Terry Lv2009-11-11-0/+19
| | | | | | Misc changes for v2009.08 upgrade. Signed-off-by: Terry Lv <r65388@freescale.com>
* u-boot v2009.08 sd/mmc support.Terry Lv2009-11-03-14/+43
| | | | Signed-off-by: Terry Lv <r65388@freescale.com>
* mmc: set bus width to 1 and clock to minimum early during initializationIlya Yanok2009-07-19-0/+3
| | | | | | | We need to switch back to 1-bit before initialization or SD 2.0 cards will fail to send SCR if we've switched to 4-bit already. Signed-off-by: Ilya Yanok <yanok@emcraft.com>
* mmc: Fix decoding of SCR & function switch data on little-endian machinesYauhen Kharuzhy2009-06-02-5/+5
| | | | | | | | SCR & switch data are read from card as big-endian words and should be converted to CPU byte order. Signed-off-by: Yauhen Kharuzhy <jekhor@gmail.com> Signed-off-by: Andy Fleming <afleming@freescale.com>
* mmc: Remove return from mmc_init for non SD 2.0 compatible cards.Yauhen Kharuzhy2009-06-02-4/+0
| | | | | | | | | Cards which are not compatible with SD 2.0 standard, may return response for CMD8 command, but it will be invalid in terms of SD 2.0. We should accept this case as admissible, just like Linux does. Signed-off-by: Yauhen Kharuzhy <jekhor@gmail.com> Signed-off-by: Andy Fleming <afleming@freescale.com>
* mmc: drop unnecessary castsRabin Vincent2009-06-02-10/+10
| | | | | | Now that response is a uint, we can drop all the casts. Signed-off-by: Rabin Vincent <rabin@rab.in>
* mmc: fix response decoding on little endianRabin Vincent2009-06-02-10/+10
| | | | | | | | | | | | | | | | The mmc code defines the response as an array of chars. However, it access the response bytes both as (i) an array of four uints (with casts) and (ii) as individual chars. The former case is used more often, including by the driver when it assigns the response. The char-wise accesses are broken on little endian systems because they assume that the bytes in the uints are in big endian byte order. This patch fixes this by changing the response to be an array of four uints and replacing the char-wise accesses with equivalent uint-wise accesses. Signed-off-by: Rabin Vincent <rabin@rab.in>
* mmc: use lldiv to fix arm eabi buildRabin Vincent2009-06-02-3/+4
| | | | | | | The generic MMC core uses direct long long divisions, which do not build with ARM EABI toolchains. Use lldiv() instead, which works everywhere. Signed-off-by: Rabin Vincent <rabin@rab.in>
* mmc: check find_mmc_device return valueRabin Vincent2009-06-02-1/+1
| | | | | | | find_mmc_device returns NULL if an invalid device number is specified. Check for this to avoid dereferencing NULL pointers. Signed-off-by: Rabin Vincent <rabin@rab.in>
* Replace __attribute references with __attribute__Peter Tyser2009-04-28-2/+2
| | | | | | | | __attribute__ follows gcc's documented syntax and is generally more common than __attribute. This change is only asthetic and should not affect functionality. Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
* Add MMC FrameworkAndy Fleming2009-02-16-0/+930
Here's a new framework (based roughly off the linux one) for managing MMC controllers. It handles all of the standard SD/MMC transactions, leaving the host drivers to implement only what is necessary to deal with their specific hardware. This also hooks the infrastructure into the PowerPC board code (similar to how the ethernet infrastructure now hooks in) Some of this code was contributed by Dave Liu <daveliu@freescale.com> Signed-off-by: Andy Fleming <afleming@freescale.com>