diff options
author | Richard Zhu <r65037@freescale.com> | 2014-07-09 05:11:34 -0400 |
---|---|---|
committer | Richard Zhu <r65037@freescale.com> | 2014-07-09 05:21:56 -0400 |
commit | bf43cf9c6c56da8862a2b2cdd461f78cd80632b8 (patch) | |
tree | 06e440d1ea4784b65cba5bc0b45ea3eee7ecab81 | |
parent | 6e5694927530b4ea5de0c79860f6231351413234 (diff) |
ENGR00320021-3 pcie:add the pcie reg dump
add the pcie related gpr/anatop reg dump
into pcie driver
Signed-off-by: Richard Zhu <r65037@freescale.com>
-rw-r--r-- | drivers/pci/host/pci-imx6.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/drivers/pci/host/pci-imx6.c b/drivers/pci/host/pci-imx6.c index bfc34993e257..ed991a22020b 100644 --- a/drivers/pci/host/pci-imx6.c +++ b/drivers/pci/host/pci-imx6.c | |||
@@ -104,6 +104,35 @@ static inline bool is_imx6sx_pcie(struct imx6_pcie *imx6_pcie) | |||
104 | return imx6_pcie->data == &imx6sx_pcie_data; | 104 | return imx6_pcie->data == &imx6sx_pcie_data; |
105 | } | 105 | } |
106 | 106 | ||
107 | #ifdef DEBUG | ||
108 | static int pcie_reg_dump(struct imx6_pcie *imx6_pcie) | ||
109 | { | ||
110 | u32 val; | ||
111 | struct regmap *anatop_g; | ||
112 | |||
113 | /* GPRs registers */ | ||
114 | regmap_read(imx6_pcie->iomuxc_gpr, IOMUXC_GPR1, &val); | ||
115 | pr_info("<F> %s <L> %d gpr1 0x%08x.\n", __func__, __LINE__, val); | ||
116 | regmap_read(imx6_pcie->iomuxc_gpr, IOMUXC_GPR5, &val); | ||
117 | pr_info("<F> %s <L> %d gpr5 0x%08x.\n", __func__, __LINE__, val); | ||
118 | regmap_read(imx6_pcie->iomuxc_gpr, IOMUXC_GPR8, &val); | ||
119 | pr_info("<F> %s <L> %d gpr8 0x%08x.\n", __func__, __LINE__, val); | ||
120 | regmap_read(imx6_pcie->iomuxc_gpr, IOMUXC_GPR12, &val); | ||
121 | pr_info("<F> %s <L> %d gpr12 0x%08x.\n", __func__, __LINE__, val); | ||
122 | regmap_read(imx6_pcie->iomuxc_gpr, IOMUXC_GPR13, &val); | ||
123 | pr_info("<F> %s <L> %d gpr13 0x%08x.\n", __func__, __LINE__, val); | ||
124 | |||
125 | /* anatop registers: pll6_enet, misc1 */ | ||
126 | anatop_g = syscon_regmap_lookup_by_compatible("fsl,imx6q-anatop"); | ||
127 | if (IS_ERR(anatop_g)) | ||
128 | pr_err("failed to find fsl,imx6sx-anatop regmap\n"); | ||
129 | regmap_read(anatop_g, 0xe0, &val); | ||
130 | pr_info("<F> %s <L> %d pll6_enet 0x%08x.\n", __func__, __LINE__, val); | ||
131 | regmap_read(anatop_g, 0x160, &val); | ||
132 | pr_info("<F> %s <L> %d misc1 0x%08x.\n", __func__, __LINE__, val); | ||
133 | } | ||
134 | #endif | ||
135 | |||
107 | static int pcie_phy_poll_ack(void __iomem *dbi_base, int exp_val) | 136 | static int pcie_phy_poll_ack(void __iomem *dbi_base, int exp_val) |
108 | { | 137 | { |
109 | u32 val; | 138 | u32 val; |
@@ -408,6 +437,9 @@ static void imx6_pcie_host_init(struct pcie_port *pp) | |||
408 | 437 | ||
409 | dw_pcie_setup_rc(pp); | 438 | dw_pcie_setup_rc(pp); |
410 | 439 | ||
440 | #ifdef DEBUG | ||
441 | pcie_reg_dump(imx6_pcie); | ||
442 | #endif | ||
411 | regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR12, | 443 | regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR12, |
412 | IMX6Q_GPR12_PCIE_CTL_2, 1 << 10); | 444 | IMX6Q_GPR12_PCIE_CTL_2, 1 << 10); |
413 | 445 | ||