summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/pmu_gk20a.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/pmu_gk20a.h')
-rw-r--r--drivers/gpu/nvgpu/gk20a/pmu_gk20a.h79
1 files changed, 79 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.h b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.h
index 7d91b111..8bf642d1 100644
--- a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.h
@@ -51,6 +51,7 @@
51 51
52#define APP_VERSION_NC_1 20313802 52#define APP_VERSION_NC_1 20313802
53#define APP_VERSION_NC_0 20360931 53#define APP_VERSION_NC_0 20360931
54#define APP_VERSION_GM206 20652057
54#define APP_VERSION_GM20B_5 20490253 55#define APP_VERSION_GM20B_5 20490253
55#define APP_VERSION_GM20B_4 19008461 56#define APP_VERSION_GM20B_4 19008461
56#define APP_VERSION_GM20B_3 18935575 57#define APP_VERSION_GM20B_3 18935575
@@ -383,6 +384,16 @@ struct pmu_cmdline_args_v1 {
383 struct pmu_mem_v1 gc6_ctx; /* dmem offset of gc6 context */ 384 struct pmu_mem_v1 gc6_ctx; /* dmem offset of gc6 context */
384}; 385};
385 386
387struct flcn_u64 {
388 u32 lo;
389 u32 hi;
390};
391
392struct flcn_mem_desc_v0 {
393 struct flcn_u64 address;
394 u32 params;
395};
396
386struct pmu_cmdline_args_v2 { 397struct pmu_cmdline_args_v2 {
387 u32 cpu_freq_hz; /* Frequency of the clock driving PMU */ 398 u32 cpu_freq_hz; /* Frequency of the clock driving PMU */
388 u32 falc_trace_size; /* falctrace buffer size (bytes) */ 399 u32 falc_trace_size; /* falctrace buffer size (bytes) */
@@ -419,6 +430,16 @@ struct pmu_cmdline_args_v4 {
419 u8 pad; 430 u8 pad;
420}; 431};
421 432
433struct pmu_cmdline_args_v5 {
434 u32 cpu_freq_hz; /* Frequency of the clock driving PMU */
435 struct flcn_mem_desc_v0 trace_buf;
436 u8 secure_mode;
437 u8 raise_priv_sec;
438 struct flcn_mem_desc_v0 gc6_ctx;
439 struct flcn_mem_desc_v0 init_data_dma_info;
440 u32 dummy;
441};
442
422 443
423#define GK20A_PMU_TRACE_BUFSIZE 0x4000 /* 4K */ 444#define GK20A_PMU_TRACE_BUFSIZE 0x4000 /* 4K */
424#define GK20A_PMU_DMEM_BLKSIZE2 8 445#define GK20A_PMU_DMEM_BLKSIZE2 8
@@ -537,6 +558,13 @@ struct pmu_allocation_v2 {
537 } alloc; 558 } alloc;
538}; 559};
539 560
561struct pmu_allocation_v3 {
562 struct {
563 struct pmu_dmem dmem;
564 struct flcn_mem_desc_v0 fb;
565 } alloc;
566};
567
540enum { 568enum {
541 PMU_INIT_MSG_TYPE_PMU_INIT = 0, 569 PMU_INIT_MSG_TYPE_PMU_INIT = 0,
542}; 570};
@@ -571,10 +599,27 @@ struct pmu_init_msg_pmu_v1 {
571 u16 sw_managed_area_offset; 599 u16 sw_managed_area_offset;
572 u16 sw_managed_area_size; 600 u16 sw_managed_area_size;
573}; 601};
602struct pmu_init_msg_pmu_v2 {
603 u8 msg_type;
604 u8 pad;
605 u16 os_debug_entry_point;
606
607 struct {
608 u16 size;
609 u16 offset;
610 u8 index;
611 u8 pad;
612 } queue_info[PMU_QUEUE_COUNT];
613
614 u16 sw_managed_area_offset;
615 u16 sw_managed_area_size;
616 u8 dummy[18];
617};
574 618
575union pmu_init_msg_pmu { 619union pmu_init_msg_pmu {
576 struct pmu_init_msg_pmu_v0 v0; 620 struct pmu_init_msg_pmu_v0 v0;
577 struct pmu_init_msg_pmu_v1 v1; 621 struct pmu_init_msg_pmu_v1 v1;
622 struct pmu_init_msg_pmu_v2 v2;
578}; 623};
579 624
580struct pmu_init_msg { 625struct pmu_init_msg {
@@ -582,6 +627,7 @@ struct pmu_init_msg {
582 u8 msg_type; 627 u8 msg_type;
583 struct pmu_init_msg_pmu_v1 pmu_init_v1; 628 struct pmu_init_msg_pmu_v1 pmu_init_v1;
584 struct pmu_init_msg_pmu_v0 pmu_init_v0; 629 struct pmu_init_msg_pmu_v0 pmu_init_v0;
630 struct pmu_init_msg_pmu_v2 pmu_init_v2;
585 }; 631 };
586}; 632};
587 633
@@ -709,6 +755,14 @@ struct pmu_pg_cmd_eng_buf_load_v1 {
709 } dma_desc; 755 } dma_desc;
710}; 756};
711 757
758struct pmu_pg_cmd_eng_buf_load_v2 {
759 u8 cmd_type;
760 u8 engine_id;
761 u8 buf_idx;
762 u8 pad;
763 struct flcn_mem_desc_v0 dma_desc;
764};
765
712enum { 766enum {
713 PMU_PG_STAT_CMD_ALLOC_DMEM = 0, 767 PMU_PG_STAT_CMD_ALLOC_DMEM = 0,
714}; 768};
@@ -737,6 +791,7 @@ struct pmu_pg_cmd {
737 struct pmu_pg_cmd_elpg_cmd elpg_cmd; 791 struct pmu_pg_cmd_elpg_cmd elpg_cmd;
738 struct pmu_pg_cmd_eng_buf_load_v0 eng_buf_load_v0; 792 struct pmu_pg_cmd_eng_buf_load_v0 eng_buf_load_v0;
739 struct pmu_pg_cmd_eng_buf_load_v1 eng_buf_load_v1; 793 struct pmu_pg_cmd_eng_buf_load_v1 eng_buf_load_v1;
794 struct pmu_pg_cmd_eng_buf_load_v2 eng_buf_load_v2;
740 struct pmu_pg_cmd_stat stat; 795 struct pmu_pg_cmd_stat stat;
741 struct pmu_pg_cmd_gr_init_param gr_init_param; 796 struct pmu_pg_cmd_gr_init_param gr_init_param;
742 /* TBD: other pg commands */ 797 /* TBD: other pg commands */
@@ -922,6 +977,14 @@ enum {
922 PMU_PERFMON_CMD_ID_INIT = 2 977 PMU_PERFMON_CMD_ID_INIT = 2
923}; 978};
924 979
980struct pmu_perfmon_cmd_start_v3 {
981 u8 cmd_type;
982 u8 group_id;
983 u8 state_id;
984 u8 flags;
985 struct pmu_allocation_v3 counter_alloc;
986};
987
925struct pmu_perfmon_cmd_start_v2 { 988struct pmu_perfmon_cmd_start_v2 {
926 u8 cmd_type; 989 u8 cmd_type;
927 u8 group_id; 990 u8 group_id;
@@ -950,6 +1013,17 @@ struct pmu_perfmon_cmd_stop {
950 u8 cmd_type; 1013 u8 cmd_type;
951}; 1014};
952 1015
1016struct pmu_perfmon_cmd_init_v3 {
1017 u8 cmd_type;
1018 u8 to_decrease_count;
1019 u8 base_counter_id;
1020 u32 sample_period_us;
1021 struct pmu_allocation_v3 counter_alloc;
1022 u8 num_counters;
1023 u8 samples_in_moving_avg;
1024 u16 sample_buffer;
1025};
1026
953struct pmu_perfmon_cmd_init_v2 { 1027struct pmu_perfmon_cmd_init_v2 {
954 u8 cmd_type; 1028 u8 cmd_type;
955 u8 to_decrease_count; 1029 u8 to_decrease_count;
@@ -989,10 +1063,12 @@ struct pmu_perfmon_cmd {
989 struct pmu_perfmon_cmd_start_v0 start_v0; 1063 struct pmu_perfmon_cmd_start_v0 start_v0;
990 struct pmu_perfmon_cmd_start_v1 start_v1; 1064 struct pmu_perfmon_cmd_start_v1 start_v1;
991 struct pmu_perfmon_cmd_start_v2 start_v2; 1065 struct pmu_perfmon_cmd_start_v2 start_v2;
1066 struct pmu_perfmon_cmd_start_v3 start_v3;
992 struct pmu_perfmon_cmd_stop stop; 1067 struct pmu_perfmon_cmd_stop stop;
993 struct pmu_perfmon_cmd_init_v0 init_v0; 1068 struct pmu_perfmon_cmd_init_v0 init_v0;
994 struct pmu_perfmon_cmd_init_v1 init_v1; 1069 struct pmu_perfmon_cmd_init_v1 init_v1;
995 struct pmu_perfmon_cmd_init_v2 init_v2; 1070 struct pmu_perfmon_cmd_init_v2 init_v2;
1071 struct pmu_perfmon_cmd_init_v3 init_v3;
996 }; 1072 };
997}; 1073};
998 1074
@@ -1201,11 +1277,13 @@ struct pmu_sequence {
1201 struct pmu_allocation_v0 in_v0; 1277 struct pmu_allocation_v0 in_v0;
1202 struct pmu_allocation_v1 in_v1; 1278 struct pmu_allocation_v1 in_v1;
1203 struct pmu_allocation_v2 in_v2; 1279 struct pmu_allocation_v2 in_v2;
1280 struct pmu_allocation_v3 in_v3;
1204 }; 1281 };
1205 union { 1282 union {
1206 struct pmu_allocation_v0 out_v0; 1283 struct pmu_allocation_v0 out_v0;
1207 struct pmu_allocation_v1 out_v1; 1284 struct pmu_allocation_v1 out_v1;
1208 struct pmu_allocation_v2 out_v2; 1285 struct pmu_allocation_v2 out_v2;
1286 struct pmu_allocation_v3 out_v3;
1209 }; 1287 };
1210 u8 *out_payload; 1288 u8 *out_payload;
1211 pmu_callback callback; 1289 pmu_callback callback;
@@ -1391,6 +1469,7 @@ struct pmu_gk20a {
1391 struct pmu_cmdline_args_v2 args_v2; 1469 struct pmu_cmdline_args_v2 args_v2;
1392 struct pmu_cmdline_args_v3 args_v3; 1470 struct pmu_cmdline_args_v3 args_v3;
1393 struct pmu_cmdline_args_v4 args_v4; 1471 struct pmu_cmdline_args_v4 args_v4;
1472 struct pmu_cmdline_args_v5 args_v5;
1394 }; 1473 };
1395 unsigned long perfmon_events_cnt; 1474 unsigned long perfmon_events_cnt;
1396 bool perfmon_sampling_enabled; 1475 bool perfmon_sampling_enabled;