diff options
Diffstat (limited to 'drivers/gpu/nvgpu/gm20b/pmu_gm20b.c')
-rw-r--r-- | drivers/gpu/nvgpu/gm20b/pmu_gm20b.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/drivers/gpu/nvgpu/gm20b/pmu_gm20b.c b/drivers/gpu/nvgpu/gm20b/pmu_gm20b.c index 1c5fdce0..aa992c37 100644 --- a/drivers/gpu/nvgpu/gm20b/pmu_gm20b.c +++ b/drivers/gpu/nvgpu/gm20b/pmu_gm20b.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * GM20B PMU | 2 | * GM20B PMU |
3 | * | 3 | * |
4 | * Copyright (c) 2015-2017, NVIDIA CORPORATION. All rights reserved. | 4 | * Copyright (c) 2015-2018, NVIDIA CORPORATION. All rights reserved. |
5 | * | 5 | * |
6 | * Permission is hereby granted, free of charge, to any person obtaining a | 6 | * Permission is hereby granted, free of charge, to any person obtaining a |
7 | * copy of this software and associated documentation files (the "Software"), | 7 | * copy of this software and associated documentation files (the "Software"), |
@@ -37,8 +37,8 @@ | |||
37 | #include <nvgpu/hw/gm20b/hw_pwr_gm20b.h> | 37 | #include <nvgpu/hw/gm20b/hw_pwr_gm20b.h> |
38 | #include <nvgpu/hw/gm20b/hw_fuse_gm20b.h> | 38 | #include <nvgpu/hw/gm20b/hw_fuse_gm20b.h> |
39 | 39 | ||
40 | #define gm20b_dbg_pmu(fmt, arg...) \ | 40 | #define gm20b_dbg_pmu(g, fmt, arg...) \ |
41 | gk20a_dbg(gpu_dbg_pmu, fmt, ##arg) | 41 | nvgpu_log(g, gpu_dbg_pmu, fmt, ##arg) |
42 | 42 | ||
43 | 43 | ||
44 | /* PROD settings for ELPG sequencing registers*/ | 44 | /* PROD settings for ELPG sequencing registers*/ |
@@ -108,7 +108,7 @@ int gm20b_pmu_setup_elpg(struct gk20a *g) | |||
108 | u32 reg_writes; | 108 | u32 reg_writes; |
109 | u32 index; | 109 | u32 index; |
110 | 110 | ||
111 | gk20a_dbg_fn(""); | 111 | nvgpu_log_fn(g, " "); |
112 | 112 | ||
113 | if (g->elpg_enabled) { | 113 | if (g->elpg_enabled) { |
114 | reg_writes = ((sizeof(_pginitseq_gm20b) / | 114 | reg_writes = ((sizeof(_pginitseq_gm20b) / |
@@ -120,20 +120,20 @@ int gm20b_pmu_setup_elpg(struct gk20a *g) | |||
120 | } | 120 | } |
121 | } | 121 | } |
122 | 122 | ||
123 | gk20a_dbg_fn("done"); | 123 | nvgpu_log_fn(g, "done"); |
124 | return ret; | 124 | return ret; |
125 | } | 125 | } |
126 | 126 | ||
127 | static void pmu_handle_acr_init_wpr_msg(struct gk20a *g, struct pmu_msg *msg, | 127 | static void pmu_handle_acr_init_wpr_msg(struct gk20a *g, struct pmu_msg *msg, |
128 | void *param, u32 handle, u32 status) | 128 | void *param, u32 handle, u32 status) |
129 | { | 129 | { |
130 | gk20a_dbg_fn(""); | 130 | nvgpu_log_fn(g, " "); |
131 | 131 | ||
132 | gm20b_dbg_pmu("reply PMU_ACR_CMD_ID_INIT_WPR_REGION"); | 132 | gm20b_dbg_pmu(g, "reply PMU_ACR_CMD_ID_INIT_WPR_REGION"); |
133 | 133 | ||
134 | if (msg->msg.acr.acrmsg.errorcode == PMU_ACR_SUCCESS) | 134 | if (msg->msg.acr.acrmsg.errorcode == PMU_ACR_SUCCESS) |
135 | g->pmu_lsf_pmu_wpr_init_done = 1; | 135 | g->pmu_lsf_pmu_wpr_init_done = 1; |
136 | gk20a_dbg_fn("done"); | 136 | nvgpu_log_fn(g, "done"); |
137 | } | 137 | } |
138 | 138 | ||
139 | 139 | ||
@@ -143,7 +143,7 @@ int gm20b_pmu_init_acr(struct gk20a *g) | |||
143 | struct pmu_cmd cmd; | 143 | struct pmu_cmd cmd; |
144 | u32 seq; | 144 | u32 seq; |
145 | 145 | ||
146 | gk20a_dbg_fn(""); | 146 | nvgpu_log_fn(g, " "); |
147 | 147 | ||
148 | /* init ACR */ | 148 | /* init ACR */ |
149 | memset(&cmd, 0, sizeof(struct pmu_cmd)); | 149 | memset(&cmd, 0, sizeof(struct pmu_cmd)); |
@@ -153,11 +153,11 @@ int gm20b_pmu_init_acr(struct gk20a *g) | |||
153 | cmd.cmd.acr.init_wpr.cmd_type = PMU_ACR_CMD_ID_INIT_WPR_REGION; | 153 | cmd.cmd.acr.init_wpr.cmd_type = PMU_ACR_CMD_ID_INIT_WPR_REGION; |
154 | cmd.cmd.acr.init_wpr.regionid = 0x01; | 154 | cmd.cmd.acr.init_wpr.regionid = 0x01; |
155 | cmd.cmd.acr.init_wpr.wproffset = 0x00; | 155 | cmd.cmd.acr.init_wpr.wproffset = 0x00; |
156 | gm20b_dbg_pmu("cmd post PMU_ACR_CMD_ID_INIT_WPR_REGION"); | 156 | gm20b_dbg_pmu(g, "cmd post PMU_ACR_CMD_ID_INIT_WPR_REGION"); |
157 | nvgpu_pmu_cmd_post(g, &cmd, NULL, NULL, PMU_COMMAND_QUEUE_HPQ, | 157 | nvgpu_pmu_cmd_post(g, &cmd, NULL, NULL, PMU_COMMAND_QUEUE_HPQ, |
158 | pmu_handle_acr_init_wpr_msg, pmu, &seq, ~0); | 158 | pmu_handle_acr_init_wpr_msg, pmu, &seq, ~0); |
159 | 159 | ||
160 | gk20a_dbg_fn("done"); | 160 | nvgpu_log_fn(g, "done"); |
161 | return 0; | 161 | return 0; |
162 | } | 162 | } |
163 | 163 | ||
@@ -165,14 +165,14 @@ void pmu_handle_fecs_boot_acr_msg(struct gk20a *g, struct pmu_msg *msg, | |||
165 | void *param, u32 handle, u32 status) | 165 | void *param, u32 handle, u32 status) |
166 | { | 166 | { |
167 | 167 | ||
168 | gk20a_dbg_fn(""); | 168 | nvgpu_log_fn(g, " "); |
169 | 169 | ||
170 | 170 | ||
171 | gm20b_dbg_pmu("reply PMU_ACR_CMD_ID_BOOTSTRAP_FALCON"); | 171 | gm20b_dbg_pmu(g, "reply PMU_ACR_CMD_ID_BOOTSTRAP_FALCON"); |
172 | 172 | ||
173 | gm20b_dbg_pmu("response code = %x\n", msg->msg.acr.acrmsg.falconid); | 173 | gm20b_dbg_pmu(g, "response code = %x\n", msg->msg.acr.acrmsg.falconid); |
174 | g->pmu_lsf_loaded_falcon_id = msg->msg.acr.acrmsg.falconid; | 174 | g->pmu_lsf_loaded_falcon_id = msg->msg.acr.acrmsg.falconid; |
175 | gk20a_dbg_fn("done"); | 175 | nvgpu_log_fn(g, "done"); |
176 | } | 176 | } |
177 | 177 | ||
178 | static int pmu_gm20b_ctx_wait_lsf_ready(struct gk20a *g, u32 timeout_ms, | 178 | static int pmu_gm20b_ctx_wait_lsf_ready(struct gk20a *g, u32 timeout_ms, |
@@ -182,7 +182,7 @@ static int pmu_gm20b_ctx_wait_lsf_ready(struct gk20a *g, u32 timeout_ms, | |||
182 | u32 reg; | 182 | u32 reg; |
183 | struct nvgpu_timeout timeout; | 183 | struct nvgpu_timeout timeout; |
184 | 184 | ||
185 | gk20a_dbg_fn(""); | 185 | nvgpu_log_fn(g, " "); |
186 | reg = gk20a_readl(g, gr_fecs_ctxsw_mailbox_r(0)); | 186 | reg = gk20a_readl(g, gr_fecs_ctxsw_mailbox_r(0)); |
187 | 187 | ||
188 | nvgpu_timeout_init(g, &timeout, timeout_ms, NVGPU_TIMER_CPU_TIMER); | 188 | nvgpu_timeout_init(g, &timeout, timeout_ms, NVGPU_TIMER_CPU_TIMER); |
@@ -203,9 +203,9 @@ void gm20b_pmu_load_lsf(struct gk20a *g, u32 falcon_id, u32 flags) | |||
203 | struct pmu_cmd cmd; | 203 | struct pmu_cmd cmd; |
204 | u32 seq; | 204 | u32 seq; |
205 | 205 | ||
206 | gk20a_dbg_fn(""); | 206 | nvgpu_log_fn(g, " "); |
207 | 207 | ||
208 | gm20b_dbg_pmu("wprinit status = %x\n", g->pmu_lsf_pmu_wpr_init_done); | 208 | gm20b_dbg_pmu(g, "wprinit status = %x\n", g->pmu_lsf_pmu_wpr_init_done); |
209 | if (g->pmu_lsf_pmu_wpr_init_done) { | 209 | if (g->pmu_lsf_pmu_wpr_init_done) { |
210 | /* send message to load FECS falcon */ | 210 | /* send message to load FECS falcon */ |
211 | memset(&cmd, 0, sizeof(struct pmu_cmd)); | 211 | memset(&cmd, 0, sizeof(struct pmu_cmd)); |
@@ -216,13 +216,13 @@ void gm20b_pmu_load_lsf(struct gk20a *g, u32 falcon_id, u32 flags) | |||
216 | PMU_ACR_CMD_ID_BOOTSTRAP_FALCON; | 216 | PMU_ACR_CMD_ID_BOOTSTRAP_FALCON; |
217 | cmd.cmd.acr.bootstrap_falcon.flags = flags; | 217 | cmd.cmd.acr.bootstrap_falcon.flags = flags; |
218 | cmd.cmd.acr.bootstrap_falcon.falconid = falcon_id; | 218 | cmd.cmd.acr.bootstrap_falcon.falconid = falcon_id; |
219 | gm20b_dbg_pmu("cmd post PMU_ACR_CMD_ID_BOOTSTRAP_FALCON: %x\n", | 219 | gm20b_dbg_pmu(g, "cmd post PMU_ACR_CMD_ID_BOOTSTRAP_FALCON: %x\n", |
220 | falcon_id); | 220 | falcon_id); |
221 | nvgpu_pmu_cmd_post(g, &cmd, NULL, NULL, PMU_COMMAND_QUEUE_HPQ, | 221 | nvgpu_pmu_cmd_post(g, &cmd, NULL, NULL, PMU_COMMAND_QUEUE_HPQ, |
222 | pmu_handle_fecs_boot_acr_msg, pmu, &seq, ~0); | 222 | pmu_handle_fecs_boot_acr_msg, pmu, &seq, ~0); |
223 | } | 223 | } |
224 | 224 | ||
225 | gk20a_dbg_fn("done"); | 225 | nvgpu_log_fn(g, "done"); |
226 | return; | 226 | return; |
227 | } | 227 | } |
228 | 228 | ||