drivers: emmc: dw_mmc: Add response flag into response ID definition

Add response flag into ID definition so that driver does not
need to handle it again.

Signed-off-by: Jun Nie <jun.nie@linaro.org>
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
This commit is contained in:
Jun Nie 2018-06-28 16:38:00 +08:00 committed by Bryan O'Donoghue
parent e67606cf8e
commit 2a82a9c95f
2 changed files with 19 additions and 2 deletions

View File

@ -259,11 +259,14 @@ static int dw_send_cmd(struct mmc_cmd *cmd)
switch (cmd->resp_type) {
case 0:
break;
case MMC_RESPONSE_R(2):
case MMC_RESPONSE_R2:
op |= CMD_RESP_EXPECT | CMD_CHECK_RESP_CRC |
CMD_RESP_LEN;
break;
case MMC_RESPONSE_R(3):
case MMC_RESPONSE_R1:
case MMC_RESPONSE_R1B:
case MMC_RESPONSE_R3:
case MMC_RESPONSE_R5:
op |= CMD_RESP_EXPECT;
break;
default:

View File

@ -36,6 +36,20 @@
#define OCR_VDD_MIN_2V0 GENMASK(14, 8)
#define OCR_VDD_MIN_1V7 BIT(7)
#define MMC_RSP_48 BIT(0)
#define MMC_RSP_136 BIT(1) /* 136 bit response */
#define MMC_RSP_CRC BIT(2) /* expect valid crc */
#define MMC_RSP_CMD_IDX BIT(3) /* response contains cmd idx */
#define MMC_RSP_BUSY BIT(4) /* device may be busy */
/* JEDEC 4.51 chapter 6.12 */
#define MMC_RESPONSE_R1 (MMC_RSP_48 | MMC_RSP_CMD_IDX | MMC_RSP_CRC)
#define MMC_RESPONSE_R1B (MMC_RESPONSE_R1 | MMC_RSP_BUSY)
#define MMC_RESPONSE_R2 (MMC_RSP_136 | MMC_RSP_CRC)
#define MMC_RESPONSE_R3 (MMC_RSP_48)
#define MMC_RESPONSE_R4 (MMC_RSP_48)
#define MMC_RESPONSE_R5 (MMC_RSP_48 | MMC_RSP_CRC)
#define MMC_RESPONSE_R(_x) U(_x)
/* Value randomly chosen for eMMC RCA, it should be > 1 */