diff options
author | Vijayakumar Subbu <vsubbu@nvidia.com> | 2016-07-28 01:30:37 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2016-09-08 23:06:06 -0400 |
commit | 589179ad00b78485a071131b5f08c874e8b3ef84 (patch) | |
tree | 58288ecae1d2492b5916840ccdd6844a6e3049f8 /drivers/gpu/nvgpu/gk20a/pmu_common.h | |
parent | 7d44a8d8d8884e92f02dfdc6efe8e3a59b69c28f (diff) |
gpu: nvgpu: refactor pmu include
split pmu include files to add lot more APIs
pmu_api.h - all the current APIs used in igpu
pmu_common.h - common defines for all APIs
pmu_gk20a.h - SW defines specific needed for nvgpu
like PMU version, PMU SW structure definition etc.
Splitting APIs to separate files allows us to use auto
generated PMU task headers from RM
We have script which generates pmu interface herader files
in linux format. It replaces RM with NV. Adding typedef in existing pmu
code make auto generated files easy to compile/add
JIRA DNVGPU-85
Change-Id: I851b88769fe8d60561a44754ddb7dde45b45959e
Signed-off-by: Vijayakumar Subbu <vsubbu@nvidia.com>
Reviewed-on: http://git-master/r/1192702
Reviewed-on: http://git-master/r/1203124
(cherry picked from commit 0fe5f020c3f934cf2cc5336f1b6c3bafaf9e0c2a)
Reviewed-on: http://git-master/r/1217301
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/pmu_common.h')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/pmu_common.h | 145 |
1 files changed, 145 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/pmu_common.h b/drivers/gpu/nvgpu/gk20a/pmu_common.h new file mode 100644 index 00000000..76b37cf7 --- /dev/null +++ b/drivers/gpu/nvgpu/gk20a/pmu_common.h | |||
@@ -0,0 +1,145 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2011-2016, NVIDIA CORPORATION. All rights reserved. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify it | ||
5 | * under the terms and conditions of the GNU General Public License, | ||
6 | * version 2, as published by the Free Software Foundation. | ||
7 | * | ||
8 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
9 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
10 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
11 | * more details. | ||
12 | */ | ||
13 | |||
14 | #ifndef __PMU_COMMON_H__ | ||
15 | #define __PMU_COMMON_H__ | ||
16 | |||
17 | #define PMU_CMD_SUBMIT_PAYLOAD_PARAMS_FB_SIZE_UNUSED 0 | ||
18 | |||
19 | struct falc_u64 { | ||
20 | u32 lo; | ||
21 | u32 hi; | ||
22 | }; | ||
23 | |||
24 | struct falc_dma_addr { | ||
25 | u32 dma_base; | ||
26 | /* | ||
27 | * dma_base1 is 9-bit MSB for FB Base | ||
28 | * address for the transfer in FB after | ||
29 | * address using 49b FB address | ||
30 | */ | ||
31 | u16 dma_base1; | ||
32 | u8 dma_offset; | ||
33 | }; | ||
34 | |||
35 | struct pmu_mem_v0 { | ||
36 | u32 dma_base; | ||
37 | u8 dma_offset; | ||
38 | u8 dma_idx; | ||
39 | }; | ||
40 | |||
41 | struct pmu_mem_v1 { | ||
42 | u32 dma_base; | ||
43 | u8 dma_offset; | ||
44 | u8 dma_idx; | ||
45 | u16 fb_size; | ||
46 | }; | ||
47 | |||
48 | struct pmu_mem_v2 { | ||
49 | struct falc_dma_addr dma_addr; | ||
50 | u8 dma_idx; | ||
51 | u16 fb_size; | ||
52 | }; | ||
53 | |||
54 | struct pmu_mem_desc_v0 { | ||
55 | /*! | ||
56 | * Start address of memory surface that is being communicated to the falcon. | ||
57 | */ | ||
58 | struct falc_u64 dma_addr; | ||
59 | /*! | ||
60 | * Max allowed DMA transfer size (size of the memory surface). Accesses past | ||
61 | * this point may result in page faults and/or memory corruptions. | ||
62 | */ | ||
63 | u16 dma_sizemax; | ||
64 | /*! | ||
65 | * DMA channel index to be used when accessing this surface. | ||
66 | */ | ||
67 | u8 dma_idx; | ||
68 | }; | ||
69 | |||
70 | struct pmu_dmem { | ||
71 | u16 size; | ||
72 | u32 offset; | ||
73 | }; | ||
74 | |||
75 | /* Make sure size of this structure is a multiple of 4 bytes */ | ||
76 | struct pmu_cmdline_args_v0 { | ||
77 | u32 cpu_freq_hz; /* Frequency of the clock driving PMU */ | ||
78 | u32 falc_trace_size; /* falctrace buffer size (bytes) */ | ||
79 | u32 falc_trace_dma_base; /* 256-byte block address */ | ||
80 | u32 falc_trace_dma_idx; /* dmaIdx for DMA operations */ | ||
81 | struct pmu_mem_v0 gc6_ctx; /* dmem offset of gc6 context */ | ||
82 | }; | ||
83 | |||
84 | struct pmu_cmdline_args_v1 { | ||
85 | u32 cpu_freq_hz; /* Frequency of the clock driving PMU */ | ||
86 | u32 falc_trace_size; /* falctrace buffer size (bytes) */ | ||
87 | u32 falc_trace_dma_base; /* 256-byte block address */ | ||
88 | u32 falc_trace_dma_idx; /* dmaIdx for DMA operations */ | ||
89 | u8 secure_mode; | ||
90 | struct pmu_mem_v1 gc6_ctx; /* dmem offset of gc6 context */ | ||
91 | }; | ||
92 | |||
93 | struct flcn_u64 { | ||
94 | u32 lo; | ||
95 | u32 hi; | ||
96 | }; | ||
97 | |||
98 | struct flcn_mem_desc_v0 { | ||
99 | struct flcn_u64 address; | ||
100 | u32 params; | ||
101 | }; | ||
102 | |||
103 | #define nv_flcn_mem_desc flcn_mem_desc_v0 | ||
104 | |||
105 | struct pmu_allocation_v0 { | ||
106 | u8 pad[3]; | ||
107 | u8 fb_mem_use; | ||
108 | struct { | ||
109 | struct pmu_dmem dmem; | ||
110 | struct pmu_mem_v0 fb; | ||
111 | } alloc; | ||
112 | }; | ||
113 | |||
114 | struct pmu_allocation_v1 { | ||
115 | struct { | ||
116 | struct pmu_dmem dmem; | ||
117 | struct pmu_mem_v1 fb; | ||
118 | } alloc; | ||
119 | }; | ||
120 | |||
121 | struct pmu_allocation_v2 { | ||
122 | struct { | ||
123 | struct pmu_dmem dmem; | ||
124 | struct pmu_mem_desc_v0 fb; | ||
125 | } alloc; | ||
126 | }; | ||
127 | |||
128 | struct pmu_allocation_v3 { | ||
129 | struct { | ||
130 | struct pmu_dmem dmem; | ||
131 | struct flcn_mem_desc_v0 fb; | ||
132 | } alloc; | ||
133 | }; | ||
134 | |||
135 | struct pmu_hdr { | ||
136 | u8 unit_id; | ||
137 | u8 size; | ||
138 | u8 ctrl_flags; | ||
139 | u8 seq_id; | ||
140 | }; | ||
141 | |||
142 | #define nv_pmu_hdr pmu_hdr | ||
143 | typedef u8 flcn_status; | ||
144 | |||
145 | #endif /*__PMU_COMMON_H__*/ | ||