Print the symbolic bit names for the status when we get a timeout.

This commit is contained in:
Warner Losh 2014-08-14 23:17:33 +00:00
parent 9109536752
commit 6e8f9f5113
2 changed files with 26 additions and 2 deletions

View File

@ -1210,8 +1210,8 @@ at91_mci_intr(void *arg)
*/
if (cmd->opcode != 8) {
device_printf(sc->dev,
"IO error; status MCI_SR = 0x%x cmd opcode = %d%s\n",
sr, cmd->opcode,
"IO error; status MCI_SR = 0x%b cmd opcode = %d%s\n",
sr, MCI_SR_BITSTRING, cmd->opcode,
(cmd->opcode != 12) ? "" :
(sc->flags & CMD_MULTIREAD) ? " after read" : " after write");
at91_mci_reset(sc);

View File

@ -118,6 +118,30 @@
#define MCI_SR_OVRE (0x1u << 30) /* (MCI) Overrun flag */
#define MCI_SR_UNRE (0x1u << 31) /* (MCI) Underrun flag */
/* TXRDY,DTIP,ENDTX,TXBUFE,RTOE */
#define MCI_SR_BITSTRING \
"\020" \
"\001CMDRDY" \
"\002RXRDY" \
"\003TXRDY" \
"\004BLKE" \
"\005DTIP" \
"\006NOTBUSY" \
"\007ENDRX" \
"\010ENDTX" \
"\017RXBUFF" \
"\020TXBUFE" \
"\021RINDE" \
"\022RDIRE" \
"\023RCRCE" \
"\024RENDE" \
"\025RTOE" \
"\026DCRCE" \
"\027DTOE" \
"\037OVRE" \
"\040UNRE"
/* -------- MCI_IER : (MCI Offset: 0x44) MCI Interrupt Enable Register -------- */
/* -------- MCI_IDR : (MCI Offset: 0x48) MCI Interrupt Disable Register -------- */
/* -------- MCI_IMR : (MCI Offset: 0x4c) MCI Interrupt Mask Register -------- */