mmc: sdhci: Improve register dump print format
Ensure all prints start with the mmc host name, and the text all lines up. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Tested-by: Ludovic Desroches <ludovic.desroches@microchip.com>
This commit is contained in:
parent
c71024de98
commit
85ad90e2f8
|
@ -40,6 +40,9 @@
|
||||||
#define DBG(f, x...) \
|
#define DBG(f, x...) \
|
||||||
pr_debug("%s: " DRIVER_NAME ": " f, mmc_hostname(host->mmc), ## x)
|
pr_debug("%s: " DRIVER_NAME ": " f, mmc_hostname(host->mmc), ## x)
|
||||||
|
|
||||||
|
#define SDHCI_DUMP(f, x...) \
|
||||||
|
pr_err("%s: " DRIVER_NAME ": " f, mmc_hostname(host->mmc), ## x)
|
||||||
|
|
||||||
#define MAX_TUNING_LOOP 40
|
#define MAX_TUNING_LOOP 40
|
||||||
|
|
||||||
static unsigned int debug_quirks = 0;
|
static unsigned int debug_quirks = 0;
|
||||||
|
@ -51,65 +54,64 @@ static void sdhci_enable_preset_value(struct sdhci_host *host, bool enable);
|
||||||
|
|
||||||
static void sdhci_dumpregs(struct sdhci_host *host)
|
static void sdhci_dumpregs(struct sdhci_host *host)
|
||||||
{
|
{
|
||||||
pr_err(DRIVER_NAME ": =========== REGISTER DUMP (%s)===========\n",
|
SDHCI_DUMP("============ SDHCI REGISTER DUMP ===========\n");
|
||||||
mmc_hostname(host->mmc));
|
|
||||||
|
|
||||||
pr_err(DRIVER_NAME ": Sys addr: 0x%08x | Version: 0x%08x\n",
|
SDHCI_DUMP("Sys addr: 0x%08x | Version: 0x%08x\n",
|
||||||
sdhci_readl(host, SDHCI_DMA_ADDRESS),
|
sdhci_readl(host, SDHCI_DMA_ADDRESS),
|
||||||
sdhci_readw(host, SDHCI_HOST_VERSION));
|
sdhci_readw(host, SDHCI_HOST_VERSION));
|
||||||
pr_err(DRIVER_NAME ": Blk size: 0x%08x | Blk cnt: 0x%08x\n",
|
SDHCI_DUMP("Blk size: 0x%08x | Blk cnt: 0x%08x\n",
|
||||||
sdhci_readw(host, SDHCI_BLOCK_SIZE),
|
sdhci_readw(host, SDHCI_BLOCK_SIZE),
|
||||||
sdhci_readw(host, SDHCI_BLOCK_COUNT));
|
sdhci_readw(host, SDHCI_BLOCK_COUNT));
|
||||||
pr_err(DRIVER_NAME ": Argument: 0x%08x | Trn mode: 0x%08x\n",
|
SDHCI_DUMP("Argument: 0x%08x | Trn mode: 0x%08x\n",
|
||||||
sdhci_readl(host, SDHCI_ARGUMENT),
|
sdhci_readl(host, SDHCI_ARGUMENT),
|
||||||
sdhci_readw(host, SDHCI_TRANSFER_MODE));
|
sdhci_readw(host, SDHCI_TRANSFER_MODE));
|
||||||
pr_err(DRIVER_NAME ": Present: 0x%08x | Host ctl: 0x%08x\n",
|
SDHCI_DUMP("Present: 0x%08x | Host ctl: 0x%08x\n",
|
||||||
sdhci_readl(host, SDHCI_PRESENT_STATE),
|
sdhci_readl(host, SDHCI_PRESENT_STATE),
|
||||||
sdhci_readb(host, SDHCI_HOST_CONTROL));
|
sdhci_readb(host, SDHCI_HOST_CONTROL));
|
||||||
pr_err(DRIVER_NAME ": Power: 0x%08x | Blk gap: 0x%08x\n",
|
SDHCI_DUMP("Power: 0x%08x | Blk gap: 0x%08x\n",
|
||||||
sdhci_readb(host, SDHCI_POWER_CONTROL),
|
sdhci_readb(host, SDHCI_POWER_CONTROL),
|
||||||
sdhci_readb(host, SDHCI_BLOCK_GAP_CONTROL));
|
sdhci_readb(host, SDHCI_BLOCK_GAP_CONTROL));
|
||||||
pr_err(DRIVER_NAME ": Wake-up: 0x%08x | Clock: 0x%08x\n",
|
SDHCI_DUMP("Wake-up: 0x%08x | Clock: 0x%08x\n",
|
||||||
sdhci_readb(host, SDHCI_WAKE_UP_CONTROL),
|
sdhci_readb(host, SDHCI_WAKE_UP_CONTROL),
|
||||||
sdhci_readw(host, SDHCI_CLOCK_CONTROL));
|
sdhci_readw(host, SDHCI_CLOCK_CONTROL));
|
||||||
pr_err(DRIVER_NAME ": Timeout: 0x%08x | Int stat: 0x%08x\n",
|
SDHCI_DUMP("Timeout: 0x%08x | Int stat: 0x%08x\n",
|
||||||
sdhci_readb(host, SDHCI_TIMEOUT_CONTROL),
|
sdhci_readb(host, SDHCI_TIMEOUT_CONTROL),
|
||||||
sdhci_readl(host, SDHCI_INT_STATUS));
|
sdhci_readl(host, SDHCI_INT_STATUS));
|
||||||
pr_err(DRIVER_NAME ": Int enab: 0x%08x | Sig enab: 0x%08x\n",
|
SDHCI_DUMP("Int enab: 0x%08x | Sig enab: 0x%08x\n",
|
||||||
sdhci_readl(host, SDHCI_INT_ENABLE),
|
sdhci_readl(host, SDHCI_INT_ENABLE),
|
||||||
sdhci_readl(host, SDHCI_SIGNAL_ENABLE));
|
sdhci_readl(host, SDHCI_SIGNAL_ENABLE));
|
||||||
pr_err(DRIVER_NAME ": AC12 err: 0x%08x | Slot int: 0x%08x\n",
|
SDHCI_DUMP("AC12 err: 0x%08x | Slot int: 0x%08x\n",
|
||||||
sdhci_readw(host, SDHCI_ACMD12_ERR),
|
sdhci_readw(host, SDHCI_ACMD12_ERR),
|
||||||
sdhci_readw(host, SDHCI_SLOT_INT_STATUS));
|
sdhci_readw(host, SDHCI_SLOT_INT_STATUS));
|
||||||
pr_err(DRIVER_NAME ": Caps: 0x%08x | Caps_1: 0x%08x\n",
|
SDHCI_DUMP("Caps: 0x%08x | Caps_1: 0x%08x\n",
|
||||||
sdhci_readl(host, SDHCI_CAPABILITIES),
|
sdhci_readl(host, SDHCI_CAPABILITIES),
|
||||||
sdhci_readl(host, SDHCI_CAPABILITIES_1));
|
sdhci_readl(host, SDHCI_CAPABILITIES_1));
|
||||||
pr_err(DRIVER_NAME ": Cmd: 0x%08x | Max curr: 0x%08x\n",
|
SDHCI_DUMP("Cmd: 0x%08x | Max curr: 0x%08x\n",
|
||||||
sdhci_readw(host, SDHCI_COMMAND),
|
sdhci_readw(host, SDHCI_COMMAND),
|
||||||
sdhci_readl(host, SDHCI_MAX_CURRENT));
|
sdhci_readl(host, SDHCI_MAX_CURRENT));
|
||||||
pr_err(DRIVER_NAME ": Resp[0]: 0x%08x | Resp[1]: 0x%08x\n",
|
SDHCI_DUMP("Resp[0]: 0x%08x | Resp[1]: 0x%08x\n",
|
||||||
sdhci_readl(host, SDHCI_RESPONSE),
|
sdhci_readl(host, SDHCI_RESPONSE),
|
||||||
sdhci_readl(host, SDHCI_RESPONSE + 4));
|
sdhci_readl(host, SDHCI_RESPONSE + 4));
|
||||||
pr_err(DRIVER_NAME ": Resp[2]: 0x%08x | Resp[3]: 0x%08x\n",
|
SDHCI_DUMP("Resp[2]: 0x%08x | Resp[3]: 0x%08x\n",
|
||||||
sdhci_readl(host, SDHCI_RESPONSE + 8),
|
sdhci_readl(host, SDHCI_RESPONSE + 8),
|
||||||
sdhci_readl(host, SDHCI_RESPONSE + 12));
|
sdhci_readl(host, SDHCI_RESPONSE + 12));
|
||||||
|
SDHCI_DUMP("Host ctl2: 0x%08x\n",
|
||||||
pr_err(DRIVER_NAME ": Host ctl2: 0x%08x\n",
|
sdhci_readw(host, SDHCI_HOST_CONTROL2));
|
||||||
sdhci_readw(host, SDHCI_HOST_CONTROL2));
|
|
||||||
|
|
||||||
if (host->flags & SDHCI_USE_ADMA) {
|
if (host->flags & SDHCI_USE_ADMA) {
|
||||||
if (host->flags & SDHCI_USE_64_BIT_DMA)
|
if (host->flags & SDHCI_USE_64_BIT_DMA) {
|
||||||
pr_err(DRIVER_NAME ": ADMA Err: 0x%08x | ADMA Ptr: 0x%08x%08x\n",
|
SDHCI_DUMP("ADMA Err: 0x%08x | ADMA Ptr: 0x%08x%08x\n",
|
||||||
sdhci_readl(host, SDHCI_ADMA_ERROR),
|
sdhci_readl(host, SDHCI_ADMA_ERROR),
|
||||||
sdhci_readl(host, SDHCI_ADMA_ADDRESS_HI),
|
sdhci_readl(host, SDHCI_ADMA_ADDRESS_HI),
|
||||||
sdhci_readl(host, SDHCI_ADMA_ADDRESS));
|
sdhci_readl(host, SDHCI_ADMA_ADDRESS));
|
||||||
else
|
} else {
|
||||||
pr_err(DRIVER_NAME ": ADMA Err: 0x%08x | ADMA Ptr: 0x%08x\n",
|
SDHCI_DUMP("ADMA Err: 0x%08x | ADMA Ptr: 0x%08x\n",
|
||||||
sdhci_readl(host, SDHCI_ADMA_ERROR),
|
sdhci_readl(host, SDHCI_ADMA_ERROR),
|
||||||
sdhci_readl(host, SDHCI_ADMA_ADDRESS));
|
sdhci_readl(host, SDHCI_ADMA_ADDRESS));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pr_err(DRIVER_NAME ": ===========================================\n");
|
SDHCI_DUMP("============================================\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************\
|
/*****************************************************************************\
|
||||||
|
|
Loading…
Reference in New Issue