diff options
author | Rabin Vincent <rabin@rab.in> | 2009-04-05 13:30:55 +0530 |
---|---|---|
committer | Andy Fleming <afleming@freescale.com> | 2009-06-02 17:18:57 -0500 |
commit | 0b453ffe28bb9227d86ddbe0893bd19c93f04ed7 (patch) | |
tree | 30ca9a03cccd70c552d211512430fa3431b97c35 /include/mmc.h | |
parent | 9b1f942c09dd942e6de3185caa81c111b14de567 (diff) | |
download | u-boot-imx-0b453ffe28bb9227d86ddbe0893bd19c93f04ed7.zip u-boot-imx-0b453ffe28bb9227d86ddbe0893bd19c93f04ed7.tar.gz u-boot-imx-0b453ffe28bb9227d86ddbe0893bd19c93f04ed7.tar.bz2 |
mmc: fix response decoding on little endian
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>
Diffstat (limited to 'include/mmc.h')
-rw-r--r-- | include/mmc.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/include/mmc.h b/include/mmc.h index b9b27ba..229d494 100644 --- a/include/mmc.h +++ b/include/mmc.h @@ -91,7 +91,7 @@ #define MMC_HS_TIMING 0x00000100 #define MMC_HS_52MHZ 0x2 -#define OCR_BUSY 0x80 +#define OCR_BUSY 0x80000000 #define OCR_HCS 0x40000000 #define MMC_VDD_165_195 0x00000080 /* VDD voltage 1.65 - 1.95 */ @@ -223,7 +223,7 @@ struct mmc_cmd { ushort cmdidx; uint resp_type; uint cmdarg; - char response[18]; + uint response[4]; uint flags; }; @@ -253,7 +253,7 @@ struct mmc { uint ocr; uint scr[2]; uint csd[4]; - char cid[16]; + uint cid[4]; ushort rca; uint tran_speed; uint read_bl_len; |