summaryrefslogtreecommitdiff
path: root/drivers/mmc/mmc.c
Commit message (Collapse)AuthorAgeLines
* 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>