Skip to content

Commit 16d18d8

Browse files
Sarthak Gargstorulf
authored andcommitted
mmc: sdhci-msm: dump vendor specific registers during error
Implement dump_vendor_registers host operation to print the vendor specific registers in addition to standard SDHC register during error conditions. Signed-off-by: Sahitya Tummala <[email protected]> Signed-off-by: Sarthak Garg <[email protected]> Acked-by: Adrian Hunter <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Ulf Hansson <[email protected]>
1 parent d1fe076 commit 16d18d8

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

drivers/mmc/host/sdhci-msm.c

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1874,6 +1874,36 @@ static void sdhci_msm_reset(struct sdhci_host *host, u8 mask)
18741874
sdhci_reset(host, mask);
18751875
}
18761876

1877+
#define DRIVER_NAME "sdhci_msm"
1878+
#define SDHCI_MSM_DUMP(f, x...) \
1879+
pr_err("%s: " DRIVER_NAME ": " f, mmc_hostname(host->mmc), ## x)
1880+
1881+
void sdhci_msm_dump_vendor_regs(struct sdhci_host *host)
1882+
{
1883+
struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
1884+
struct sdhci_msm_host *msm_host = sdhci_pltfm_priv(pltfm_host);
1885+
const struct sdhci_msm_offset *msm_offset = msm_host->offset;
1886+
1887+
SDHCI_MSM_DUMP("----------- VENDOR REGISTER DUMP -----------\n");
1888+
1889+
SDHCI_MSM_DUMP(
1890+
"DLL sts: 0x%08x | DLL cfg: 0x%08x | DLL cfg2: 0x%08x\n",
1891+
readl_relaxed(host->ioaddr + msm_offset->core_dll_status),
1892+
readl_relaxed(host->ioaddr + msm_offset->core_dll_config),
1893+
readl_relaxed(host->ioaddr + msm_offset->core_dll_config_2));
1894+
SDHCI_MSM_DUMP(
1895+
"DLL cfg3: 0x%08x | DLL usr ctl: 0x%08x | DDR cfg: 0x%08x\n",
1896+
readl_relaxed(host->ioaddr + msm_offset->core_dll_config_3),
1897+
readl_relaxed(host->ioaddr + msm_offset->core_dll_usr_ctl),
1898+
readl_relaxed(host->ioaddr + msm_offset->core_ddr_config));
1899+
SDHCI_MSM_DUMP(
1900+
"Vndr func: 0x%08x | Vndr func2 : 0x%08x Vndr func3: 0x%08x\n",
1901+
readl_relaxed(host->ioaddr + msm_offset->core_vendor_spec),
1902+
readl_relaxed(host->ioaddr +
1903+
msm_offset->core_vendor_spec_func2),
1904+
readl_relaxed(host->ioaddr + msm_offset->core_vendor_spec3));
1905+
}
1906+
18771907
static const struct sdhci_msm_variant_ops mci_var_ops = {
18781908
.msm_readl_relaxed = sdhci_msm_mci_variant_readl_relaxed,
18791909
.msm_writel_relaxed = sdhci_msm_mci_variant_writel_relaxed,
@@ -1929,6 +1959,7 @@ static const struct sdhci_ops sdhci_msm_ops = {
19291959
.write_w = sdhci_msm_writew,
19301960
.write_b = sdhci_msm_writeb,
19311961
.irq = sdhci_msm_cqe_irq,
1962+
.dump_vendor_regs = sdhci_msm_dump_vendor_regs,
19321963
};
19331964

19341965
static const struct sdhci_pltfm_data sdhci_msm_pdata = {

0 commit comments

Comments
 (0)