summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gm20b/clk_gm20b.c
diff options
context:
space:
mode:
authorAlex Frid <afrid@nvidia.com>2014-08-29 21:19:54 -0400
committerDan Willemsen <dwillemsen@nvidia.com>2015-03-18 15:11:08 -0400
commit02d0e8d57449ed6a2c60dd2ec9450aafe3b8bc7a (patch)
tree7dd70f9e75db1ab7c3ec42004ec195be5012bfde /drivers/gpu/nvgpu/gm20b/clk_gm20b.c
parent59299f007a224eec81ef1b91648008669649d2c6 (diff)
gpu: nvgpu: Add GM20b pll registers error dump
Change-Id: I67fe2c4cbab1d43670131d95bbea732e932c0910 Signed-off-by: Alex Frid <afrid@nvidia.com> Reviewed-on: http://git-master/r/494164 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Krishna Reddy <vdumpa@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gm20b/clk_gm20b.c')
-rw-r--r--drivers/gpu/nvgpu/gm20b/clk_gm20b.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gm20b/clk_gm20b.c b/drivers/gpu/nvgpu/gm20b/clk_gm20b.c
index c7c2e8af..71e21d58 100644
--- a/drivers/gpu/nvgpu/gm20b/clk_gm20b.c
+++ b/drivers/gpu/nvgpu/gm20b/clk_gm20b.c
@@ -46,6 +46,26 @@ static struct pll_parms gpc_pll_params = {
46static int clk_gm20b_debugfs_init(struct gk20a *g); 46static int clk_gm20b_debugfs_init(struct gk20a *g);
47#endif 47#endif
48 48
49#define DUMP_REG(addr_func) \
50do { \
51 addr = trim_sys_##addr_func##_r(); \
52 data = gk20a_readl(g, addr); \
53 pr_info(#addr_func "[0x%x] = 0x%x\n", addr, data); \
54} while (0)
55
56static void dump_gpc_pll(struct gk20a *g, struct pll *gpll, u32 last_cfg)
57{
58 u32 addr, data;
59
60 pr_info("**** GPCPLL DUMP ****");
61 pr_info("gpcpll s/w M=%u N=%u P=%u\n", gpll->M, gpll->N, gpll->PL);
62 pr_info("gpcpll_cfg_last = 0x%x\n", last_cfg);
63 DUMP_REG(gpcpll_cfg);
64 DUMP_REG(gpcpll_coeff);
65 DUMP_REG(sel_vco);
66 pr_info("\n");
67}
68
49/* 1:1 match between post divider settings and divisor value */ 69/* 1:1 match between post divider settings and divisor value */
50static inline u32 pl_to_div(u32 pl) 70static inline u32 pl_to_div(u32 pl)
51{ 71{
@@ -344,6 +364,7 @@ static int clk_lock_gpc_pll_under_bypass(struct gk20a *g, struct pll *gpll)
344 } while (--timeout > 0); 364 } while (--timeout > 0);
345 365
346 /* PLL is messed up. What can we do here? */ 366 /* PLL is messed up. What can we do here? */
367 dump_gpc_pll(g, gpll, cfg);
347 BUG(); 368 BUG();
348 return -EBUSY; 369 return -EBUSY;
349 370