diff options
author | Mahantesh Kumbar <mkumbar@nvidia.com> | 2017-02-01 04:58:05 -0500 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-02-09 16:44:31 -0500 |
commit | 2caa3a9361bb0c9e08a7bb788387a379c73bc848 (patch) | |
tree | 48569086420cbe0aa7029faee15eff2338cbdcfa /drivers/gpu/nvgpu/gk20a/pmu_gk20a.h | |
parent | e4a17d6379009adcd0ada768be6b0420f7f0f137 (diff) |
gpu: nvgpu: PMU PG interface headers reorg
Moved Power Gating (PG) interface from
pmu_api.h & pmu_gk20a.h to gpmuif_ap/pg
header files.
gpmuif_pg.h - PMU Command/Message Interfaces
for power gating (PG)
gpmuif_ap.h - PMU Command/Message Interfaces
for Adaptive Power
Jira NVGPU-19
Change-Id: I1eeee78bdf89d894f9a4731435cdb121f73b1e0f
Signed-off-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-on: http://git-master/r/1297203
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/pmu_gk20a.h')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/pmu_gk20a.h | 81 |
1 files changed, 14 insertions, 67 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.h b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.h index dc23005e..b4a69720 100644 --- a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.h | |||
@@ -261,6 +261,7 @@ struct pmu_sequence { | |||
261 | void* cb_params; | 261 | void* cb_params; |
262 | }; | 262 | }; |
263 | 263 | ||
264 | /*PG defines used by nvpgu-pmu*/ | ||
264 | struct pmu_pg_stats_data { | 265 | struct pmu_pg_stats_data { |
265 | u32 gating_cnt; | 266 | u32 gating_cnt; |
266 | u32 ingating_time; | 267 | u32 ingating_time; |
@@ -269,79 +270,12 @@ struct pmu_pg_stats_data { | |||
269 | u32 avg_exit_latency_us; | 270 | u32 avg_exit_latency_us; |
270 | }; | 271 | }; |
271 | 272 | ||
272 | struct pmu_pg_stats_v2 { | ||
273 | u32 entry_count; | ||
274 | u32 exit_count; | ||
275 | u32 abort_count; | ||
276 | u32 detection_count; | ||
277 | u32 prevention_activate_count; | ||
278 | u32 prevention_deactivate_count; | ||
279 | u32 powered_up_time_us; | ||
280 | u32 entry_latency_us; | ||
281 | u32 exit_latency_us; | ||
282 | u32 resident_time_us; | ||
283 | u32 entry_latency_avg_us; | ||
284 | u32 exit_latency_avg_us; | ||
285 | u32 entry_latency_max_us; | ||
286 | u32 exit_latency_max_us; | ||
287 | u32 total_sleep_time_us; | ||
288 | u32 total_non_sleep_time_us; | ||
289 | }; | ||
290 | |||
291 | struct pmu_pg_stats_v1 { | ||
292 | /* Number of time PMU successfully engaged sleep state */ | ||
293 | u32 entry_count; | ||
294 | /* Number of time PMU exit sleep state */ | ||
295 | u32 exit_count; | ||
296 | /* Number of time PMU aborted in entry sequence */ | ||
297 | u32 abort_count; | ||
298 | /* | ||
299 | * Time for which GPU was neither in Sleep state not | ||
300 | * executing sleep sequence. | ||
301 | * */ | ||
302 | u32 poweredup_timeus; | ||
303 | /* Entry and exit latency of current sleep cycle */ | ||
304 | u32 entry_latency_us; | ||
305 | u32 exitlatencyus; | ||
306 | /* Resident time for current sleep cycle. */ | ||
307 | u32 resident_timeus; | ||
308 | /* Rolling average entry and exit latencies */ | ||
309 | u32 entrylatency_avgus; | ||
310 | u32 exitlatency_avgus; | ||
311 | /* Max entry and exit latencies */ | ||
312 | u32 entrylatency_maxus; | ||
313 | u32 exitlatency_maxus; | ||
314 | /* Total time spent in sleep and non-sleep state */ | ||
315 | u32 total_sleep_timeus; | ||
316 | u32 total_nonsleep_timeus; | ||
317 | }; | ||
318 | |||
319 | struct pmu_pg_stats { | ||
320 | u64 pg_entry_start_timestamp; | ||
321 | u64 pg_ingating_start_timestamp; | ||
322 | u64 pg_exit_start_timestamp; | ||
323 | u64 pg_ungating_start_timestamp; | ||
324 | u32 pg_avg_entry_time_us; | ||
325 | u32 pg_ingating_cnt; | ||
326 | u32 pg_ingating_time_us; | ||
327 | u32 pg_avg_exit_time_us; | ||
328 | u32 pg_ungating_count; | ||
329 | u32 pg_ungating_time_us; | ||
330 | u32 pg_gating_cnt; | ||
331 | u32 pg_gating_deny_cnt; | ||
332 | }; | ||
333 | |||
334 | #define PMU_PG_IDLE_THRESHOLD_SIM 1000 | 273 | #define PMU_PG_IDLE_THRESHOLD_SIM 1000 |
335 | #define PMU_PG_POST_POWERUP_IDLE_THRESHOLD_SIM 4000000 | 274 | #define PMU_PG_POST_POWERUP_IDLE_THRESHOLD_SIM 4000000 |
336 | /* TBD: QT or else ? */ | 275 | /* TBD: QT or else ? */ |
337 | #define PMU_PG_IDLE_THRESHOLD 15000 | 276 | #define PMU_PG_IDLE_THRESHOLD 15000 |
338 | #define PMU_PG_POST_POWERUP_IDLE_THRESHOLD 1000000 | 277 | #define PMU_PG_POST_POWERUP_IDLE_THRESHOLD 1000000 |
339 | 278 | ||
340 | #define PMU_PG_ELPG_ENGINE_ID_GRAPHICS (0x00000000) | ||
341 | #define PMU_PG_ELPG_ENGINE_ID_MS (0x00000004) | ||
342 | #define PMU_PG_ELPG_ENGINE_ID_INVALID_ENGINE (0x00000005) | ||
343 | #define PMU_PG_ELPG_ENGINE_MAX PMU_PG_ELPG_ENGINE_ID_INVALID_ENGINE | ||
344 | |||
345 | #define PMU_PG_LPWR_FEATURE_RPPG 0x0 | 279 | #define PMU_PG_LPWR_FEATURE_RPPG 0x0 |
346 | #define PMU_PG_LPWR_FEATURE_MSCG 0x1 | 280 | #define PMU_PG_LPWR_FEATURE_MSCG 0x1 |
347 | 281 | ||
@@ -355,9 +289,22 @@ struct pmu_pg_stats { | |||
355 | #define PMU_ELPG_STAT_OFF_ON_PENDING 4 /* elpg is off, caller has requested on, but ALLOW | 289 | #define PMU_ELPG_STAT_OFF_ON_PENDING 4 /* elpg is off, caller has requested on, but ALLOW |
356 | cmd hasn't been sent due to ENABLE_ALLOW delay */ | 290 | cmd hasn't been sent due to ENABLE_ALLOW delay */ |
357 | 291 | ||
292 | #define PG_REQUEST_TYPE_GLOBAL 0x0 | ||
293 | #define PG_REQUEST_TYPE_PSTATE 0x1 | ||
294 | |||
358 | #define PMU_MSCG_DISABLED 0 | 295 | #define PMU_MSCG_DISABLED 0 |
359 | #define PMU_MSCG_ENABLED 1 | 296 | #define PMU_MSCG_ENABLED 1 |
360 | 297 | ||
298 | /* Default Sampling Period of AELPG */ | ||
299 | #define APCTRL_SAMPLING_PERIOD_PG_DEFAULT_US (1000000) | ||
300 | |||
301 | /* Default values of APCTRL parameters */ | ||
302 | #define APCTRL_MINIMUM_IDLE_FILTER_DEFAULT_US (100) | ||
303 | #define APCTRL_MINIMUM_TARGET_SAVING_DEFAULT_US (10000) | ||
304 | #define APCTRL_POWER_BREAKEVEN_DEFAULT_US (2000) | ||
305 | #define APCTRL_CYCLES_PER_SAMPLE_MAX_DEFAULT (200) | ||
306 | /*PG defines used by nvpgu-pmu*/ | ||
307 | |||
361 | /* Falcon Register index */ | 308 | /* Falcon Register index */ |
362 | #define PMU_FALCON_REG_R0 (0) | 309 | #define PMU_FALCON_REG_R0 (0) |
363 | #define PMU_FALCON_REG_R1 (1) | 310 | #define PMU_FALCON_REG_R1 (1) |