DM320: Fix SDHC response format 2 handling
Return complete R2 response to caller. Due to incorrect bitfield handling only bits [127-96] were ever returned to caller. Change-Id: I83726af35fb24a8051fcca8b8d019ad89d17500e
This commit is contained in:
parent
41ced369f6
commit
7f3d0ce814
1 changed files with 17 additions and 9 deletions
|
@ -71,6 +71,7 @@
|
||||||
#define BLOCKS_PER_BANK 0x7A7800
|
#define BLOCKS_PER_BANK 0x7A7800
|
||||||
|
|
||||||
/* command flags for send_cmd */
|
/* command flags for send_cmd */
|
||||||
|
#define SDHC_RESP_FMT_MASK 0x0600
|
||||||
#define SDHC_RESP_FMT_NONE 0x0000
|
#define SDHC_RESP_FMT_NONE 0x0000
|
||||||
#define SDHC_RESP_FMT_1 0x0200
|
#define SDHC_RESP_FMT_1 0x0200
|
||||||
#define SDHC_RESP_FMT_2 0x0400
|
#define SDHC_RESP_FMT_2 0x0400
|
||||||
|
@ -306,16 +307,23 @@ static int sd_command(int cmd, unsigned long arg,
|
||||||
{
|
{
|
||||||
/* discard response */
|
/* discard response */
|
||||||
}
|
}
|
||||||
else if ((cmdat & SDHC_RESP_FMT_1) || (cmdat & SDHC_RESP_FMT_3))
|
else
|
||||||
{
|
{
|
||||||
response[0] = (IO_MMC_RESPONSE7 << 16) | IO_MMC_RESPONSE6;
|
switch (cmdat & SDHC_RESP_FMT_MASK)
|
||||||
}
|
{
|
||||||
else if (cmdat & SDHC_RESP_FMT_2)
|
case SDHC_RESP_FMT_1:
|
||||||
{
|
case SDHC_RESP_FMT_3:
|
||||||
response[0] = (IO_MMC_RESPONSE7 << 16) | IO_MMC_RESPONSE6;
|
response[0] = (IO_MMC_RESPONSE7 << 16) | IO_MMC_RESPONSE6;
|
||||||
response[1] = (IO_MMC_RESPONSE5 << 16) | IO_MMC_RESPONSE4;
|
break;
|
||||||
response[2] = (IO_MMC_RESPONSE3 << 16) | IO_MMC_RESPONSE2;
|
case SDHC_RESP_FMT_2:
|
||||||
response[3] = (IO_MMC_RESPONSE1 << 16) | IO_MMC_RESPONSE0;
|
response[0] = (IO_MMC_RESPONSE7 << 16) | IO_MMC_RESPONSE6;
|
||||||
|
response[1] = (IO_MMC_RESPONSE5 << 16) | IO_MMC_RESPONSE4;
|
||||||
|
response[2] = (IO_MMC_RESPONSE3 << 16) | IO_MMC_RESPONSE2;
|
||||||
|
response[3] = (IO_MMC_RESPONSE1 << 16) | IO_MMC_RESPONSE0;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in a new issue