diff options
author | Vijayakumar Subbu <vsubbu@nvidia.com> | 2016-07-28 01:29:15 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2016-09-29 16:17:46 -0400 |
commit | b17d9708c9e9930778de43de1edf1385acb13ebd (patch) | |
tree | fc485e96cc19575d463c61c8b80a09dd89745f3f /drivers/gpu/nvgpu/pmuif/gpmuifperf.h | |
parent | 27b47b1969d7d9cdd3de9fd6f0131ad357f4b0fa (diff) |
gpu: nvgpu: Add dGPU clocks support
JIRA DNVGPU-45
Change-Id: I237ce81e31b036c05c82d46eea8694ffe1c2e3df
Signed-off-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Signed-off-by: Vijayakumar Subbu <vsubbu@nvidia.com>
Reviewed-on: http://git-master/r/1205849
(cherry picked from commit 9a4006f76b75a8ad525e7aa5ad1f609aaae49126)
Reviewed-on: http://git-master/r/1227256
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/pmuif/gpmuifperf.h')
-rw-r--r-- | drivers/gpu/nvgpu/pmuif/gpmuifperf.h | 116 |
1 files changed, 116 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/pmuif/gpmuifperf.h b/drivers/gpu/nvgpu/pmuif/gpmuifperf.h new file mode 100644 index 00000000..b1d2f3fd --- /dev/null +++ b/drivers/gpu/nvgpu/pmuif/gpmuifperf.h | |||
@@ -0,0 +1,116 @@ | |||
1 | /* | ||
2 | * Copyright (c) 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 | #ifndef _GPMUIFPERF_H_ | ||
14 | #define _GPMUIFPERF_H_ | ||
15 | |||
16 | #include "gpmuifvolt.h" | ||
17 | #include "gpmuifperfvfe.h" | ||
18 | |||
19 | /* | ||
20 | * Enumeration of BOARDOBJGRP class IDs within OBJPERF. Used as "classId" | ||
21 | * argument for communications between Kernel and PMU via the various generic | ||
22 | * BOARDOBJGRP interfaces. | ||
23 | */ | ||
24 | #define NV_PMU_PERF_BOARDOBJGRP_CLASS_ID_VFE_VAR 0x00 | ||
25 | #define NV_PMU_PERF_BOARDOBJGRP_CLASS_ID_VFE_EQU 0x01 | ||
26 | |||
27 | #define NV_PMU_PERF_CMD_ID_RPC (0x00000002) | ||
28 | #define NV_PMU_PERF_CMD_ID_BOARDOBJ_GRP_SET (0x00000003) | ||
29 | #define NV_PMU_PERF_CMD_ID_BOARDOBJ_GRP_GET_STATUS (0x00000004) | ||
30 | |||
31 | struct nv_pmu_perf_cmd_set_object { | ||
32 | u8 cmd_type; | ||
33 | u8 pad[2]; | ||
34 | u8 object_type; | ||
35 | struct nv_pmu_allocation object; | ||
36 | }; | ||
37 | |||
38 | #define NV_PMU_PERF_SET_OBJECT_ALLOC_OFFSET \ | ||
39 | (offsetof(struct nv_pmu_perf_cmd_set_object, object)) | ||
40 | |||
41 | /* RPC IDs */ | ||
42 | #define NV_PMU_PERF_RPC_ID_VFE_LOAD (0x00000001) | ||
43 | |||
44 | /*! | ||
45 | * Command requesting execution of the perf RPC. | ||
46 | */ | ||
47 | struct nv_pmu_perf_cmd_rpc { | ||
48 | u8 cmd_type; | ||
49 | u8 pad[3]; | ||
50 | struct nv_pmu_allocation request; | ||
51 | }; | ||
52 | |||
53 | #define NV_PMU_PERF_CMD_RPC_ALLOC_OFFSET \ | ||
54 | offsetof(struct nv_pmu_perf_cmd_rpc, request) | ||
55 | |||
56 | /*! | ||
57 | * Simply a union of all specific PERF commands. Forms the general packet | ||
58 | * exchanged between the Kernel and PMU when sending and receiving PERF commands | ||
59 | * (respectively). | ||
60 | */ | ||
61 | struct nv_pmu_perf_cmd { | ||
62 | union { | ||
63 | u8 cmd_type; | ||
64 | struct nv_pmu_perf_cmd_set_object set_object; | ||
65 | struct nv_pmu_boardobj_cmd_grp grp_set; | ||
66 | struct nv_pmu_boardobj_cmd_grp grp_get_status; | ||
67 | }; | ||
68 | }; | ||
69 | |||
70 | /*! | ||
71 | * Defines the data structure used to invoke PMU perf RPCs. Same structure is | ||
72 | * used to return the result of the RPC execution. | ||
73 | */ | ||
74 | struct nv_pmu_perf_rpc { | ||
75 | u8 function; | ||
76 | bool b_supported; | ||
77 | bool b_success; | ||
78 | flcn_status flcn_status; | ||
79 | union { | ||
80 | struct nv_pmu_perf_rpc_vfe_equ_eval vfe_equ_eval; | ||
81 | struct nv_pmu_perf_rpc_vfe_load vfe_load; | ||
82 | } params; | ||
83 | }; | ||
84 | |||
85 | |||
86 | /* PERF Message-type Definitions */ | ||
87 | #define NV_PMU_PERF_MSG_ID_RPC (0x00000003) | ||
88 | #define NV_PMU_PERF_MSG_ID_BOARDOBJ_GRP_SET (0x00000004) | ||
89 | #define NV_PMU_PERF_MSG_ID_BOARDOBJ_GRP_GET_STATUS (0x00000006) | ||
90 | |||
91 | /*! | ||
92 | * Message carrying the result of the perf RPC execution. | ||
93 | */ | ||
94 | struct nv_pmu_perf_msg_rpc { | ||
95 | u8 msg_type; | ||
96 | u8 rsvd[3]; | ||
97 | struct nv_pmu_allocation response; | ||
98 | }; | ||
99 | |||
100 | #define NV_PMU_PERF_MSG_RPC_ALLOC_OFFSET \ | ||
101 | (offsetof(struct nv_pmu_perf_msg_rpc, response)) | ||
102 | |||
103 | /*! | ||
104 | * Simply a union of all specific PERF messages. Forms the general packet | ||
105 | * exchanged between the Kernel and PMU when sending and receiving PERF messages | ||
106 | * (respectively). | ||
107 | */ | ||
108 | struct nv_pmu_perf_msg { | ||
109 | union { | ||
110 | u8 msg_type; | ||
111 | struct nv_pmu_perf_msg_rpc rpc; | ||
112 | struct nv_pmu_boardobj_msg_grp grp_set; | ||
113 | }; | ||
114 | }; | ||
115 | |||
116 | #endif /* _GPMUIFPERF_H_*/ | ||