1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-10-19 02:29:40 +00:00

Improve error/debug messages in sdhci.c

When starting a command also print the opcode and flags.
More consitently print flags as hex.
Use slot_printf rather than printf in one case.

MFC after:		6 weeks
Reviewed by:		marius, kibab, imp
Sponsored by:		The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D19748
This commit is contained in:
Bjoern A. Zeeb 2019-06-01 14:39:12 +00:00
parent ebb8639822
commit 8adf420203
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=348493

View File

@ -1762,7 +1762,9 @@ sdhci_start_command(struct sdhci_slot *slot, struct mmc_command *cmd)
/* Set data transfer mode. */ /* Set data transfer mode. */
sdhci_set_transfer_mode(slot, cmd->data); sdhci_set_transfer_mode(slot, cmd->data);
if (__predict_false(sdhci_debug > 1)) if (__predict_false(sdhci_debug > 1))
slot_printf(slot, "Starting command!\n"); slot_printf(slot, "Starting command opcode %#04x flags %#04x\n",
cmd->opcode, flags);
/* Start command. */ /* Start command. */
WR2(slot, SDHCI_COMMAND_FLAGS, (cmd->opcode << 8) | (flags & 0xff)); WR2(slot, SDHCI_COMMAND_FLAGS, (cmd->opcode << 8) | (flags & 0xff));
/* Start timeout callout. */ /* Start timeout callout. */
@ -1778,7 +1780,7 @@ sdhci_finish_command(struct sdhci_slot *slot)
uint8_t extra; uint8_t extra;
if (__predict_false(sdhci_debug > 1)) if (__predict_false(sdhci_debug > 1))
slot_printf(slot, "%s: called, err %d flags %d\n", slot_printf(slot, "%s: called, err %d flags %#04x\n",
__func__, slot->curcmd->error, slot->curcmd->flags); __func__, slot->curcmd->error, slot->curcmd->flags);
slot->cmd_done = 1; slot->cmd_done = 1;
/* /*
@ -1819,7 +1821,7 @@ sdhci_finish_command(struct sdhci_slot *slot)
slot->curcmd->resp[0] = RD4(slot, SDHCI_RESPONSE); slot->curcmd->resp[0] = RD4(slot, SDHCI_RESPONSE);
} }
if (__predict_false(sdhci_debug > 1)) if (__predict_false(sdhci_debug > 1))
printf("Resp: %02x %02x %02x %02x\n", slot_printf(slot, "Resp: %#04x %#04x %#04x %#04x\n",
slot->curcmd->resp[0], slot->curcmd->resp[1], slot->curcmd->resp[0], slot->curcmd->resp[1],
slot->curcmd->resp[2], slot->curcmd->resp[3]); slot->curcmd->resp[2], slot->curcmd->resp[3]);