diff options
author | Mahantesh Kumbar <mkumbar@nvidia.com> | 2017-12-07 11:38:10 -0500 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2018-01-19 02:39:56 -0500 |
commit | a57258e9b18f2f336457165391572bc477371e94 (patch) | |
tree | 1e5bde4c3a6ced447adfe0baeadb6e986ebfe819 /drivers/gpu/nvgpu/include/nvgpu/pmuif | |
parent | badfffe3ef3f5901a5ebd819d25310b3b17c31eb (diff) |
gpu: nvgpu: RPC interface support
- Created nv_pmu_rpc_cmd & nv_pmu_rpc_msg struct, &
added member rpc under pmu_cmd & pmu_msg
- Created RPC header interface
- Created RPC desc struct & added as member to pmu payload
- Defined PMU_RPC_EXECUTE() to convert different RPC
request to make generic RPC call.
- nvgpu_pmu_rpc_execute() function to execute RPC request
by creating required RPC payload & send request to PMU
to execute.
- nvgpu_pmu_rpc_execute() function as default callback handler
for RPC if caller not provided callback
- Modified nvgpu_pmu_rpc_execute() function to include check
of RPC payload parameter.
- Modified nvgpu_pmu_cmd_post() function to handle RPC
payload request.
JIRA GPUT19X-137
Change-Id: Iac140eb6b98d6bae06a089e71c96f15068fe7e7b
Signed-off-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Signed-off-by: seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1613266
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: Deepak Goyal <dgoyal@nvidia.com>
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/include/nvgpu/pmuif')
-rw-r--r-- | drivers/gpu/nvgpu/include/nvgpu/pmuif/gpmuif_cmn.h | 18 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/include/nvgpu/pmuif/nvgpu_gpmu_cmdif.h | 43 |
2 files changed, 61 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/include/nvgpu/pmuif/gpmuif_cmn.h b/drivers/gpu/nvgpu/include/nvgpu/pmuif/gpmuif_cmn.h index f39e7b6c..2284289e 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/pmuif/gpmuif_cmn.h +++ b/drivers/gpu/nvgpu/include/nvgpu/pmuif/gpmuif_cmn.h | |||
@@ -127,4 +127,22 @@ union name##_aligned { \ | |||
127 | (PMU_FB_COPY_RW_ALIGNMENT))]; \ | 127 | (PMU_FB_COPY_RW_ALIGNMENT))]; \ |
128 | } | 128 | } |
129 | 129 | ||
130 | /* RPC (Remote Procedure Call) header structure */ | ||
131 | #define NV_PMU_RPC_FLAGS_TYPE_SYNC 0x00000000 | ||
132 | |||
133 | struct nv_pmu_rpc_header { | ||
134 | /* Identifies the unit servicing requested RPC*/ | ||
135 | u8 unit_id; | ||
136 | /* Identifies the requested RPC (within the unit)*/ | ||
137 | u8 function; | ||
138 | /* RPC call flags (@see PMU_RPC_FLAGS) */ | ||
139 | u8 flags; | ||
140 | /* Falcon's status code to describe failures*/ | ||
141 | u8 flcn_status; | ||
142 | /* RPC's total exec. time (measured on nvgpu driver side)*/ | ||
143 | u32 exec_time_nv_ns; | ||
144 | /* RPC's actual exec. time (measured on PMU side)*/ | ||
145 | u32 exec_time_pmu_ns; | ||
146 | }; | ||
147 | |||
130 | #endif /* _GPMUIFCMN_H_*/ | 148 | #endif /* _GPMUIFCMN_H_*/ |
diff --git a/drivers/gpu/nvgpu/include/nvgpu/pmuif/nvgpu_gpmu_cmdif.h b/drivers/gpu/nvgpu/include/nvgpu/pmuif/nvgpu_gpmu_cmdif.h index fea6326a..208644d7 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/pmuif/nvgpu_gpmu_cmdif.h +++ b/drivers/gpu/nvgpu/include/nvgpu/pmuif/nvgpu_gpmu_cmdif.h | |||
@@ -39,6 +39,47 @@ | |||
39 | #include "gpmuifthermsensor.h" | 39 | #include "gpmuifthermsensor.h" |
40 | #include "gpmuifseq.h" | 40 | #include "gpmuifseq.h" |
41 | 41 | ||
42 | /* | ||
43 | * Command requesting execution of the RPC (Remote Procedure Call) | ||
44 | */ | ||
45 | struct nv_pmu_rpc_cmd { | ||
46 | /* Must be set to @ref NV_PMU_RPC_CMD_ID */ | ||
47 | u8 cmd_type; | ||
48 | /* RPC call flags (@see PMU_RPC_FLAGS) */ | ||
49 | u8 flags; | ||
50 | /* Size of RPC structure allocated | ||
51 | * within NV managed DMEM heap | ||
52 | */ | ||
53 | u16 rpc_dmem_size; | ||
54 | /* | ||
55 | * DMEM pointer of RPC structure allocated | ||
56 | * within RM managed DMEM heap. | ||
57 | */ | ||
58 | u32 rpc_dmem_ptr; | ||
59 | }; | ||
60 | |||
61 | #define NV_PMU_RPC_CMD_ID 0x80 | ||
62 | |||
63 | /* Message carrying the result of the RPC execution */ | ||
64 | struct nv_pmu_rpc_msg { | ||
65 | /* Must be set to @ref NV_PMU_RPC_MSG_ID */ | ||
66 | u8 msg_type; | ||
67 | /* RPC call flags (@see PMU_RPC_FLAGS)*/ | ||
68 | u8 flags; | ||
69 | /* | ||
70 | * Size of RPC structure allocated | ||
71 | * within NV managed DMEM heap. | ||
72 | */ | ||
73 | u16 rpc_dmem_size; | ||
74 | /* | ||
75 | * DMEM pointer of RPC structure allocated | ||
76 | * within NV managed DMEM heap. | ||
77 | */ | ||
78 | u32 rpc_dmem_ptr; | ||
79 | }; | ||
80 | |||
81 | #define NV_PMU_RPC_MSG_ID 0x80 | ||
82 | |||
42 | struct pmu_cmd { | 83 | struct pmu_cmd { |
43 | struct pmu_hdr hdr; | 84 | struct pmu_hdr hdr; |
44 | union { | 85 | union { |
@@ -52,6 +93,7 @@ struct pmu_cmd { | |||
52 | struct nv_pmu_clk_cmd clk; | 93 | struct nv_pmu_clk_cmd clk; |
53 | struct nv_pmu_pmgr_cmd pmgr; | 94 | struct nv_pmu_pmgr_cmd pmgr; |
54 | struct nv_pmu_therm_cmd therm; | 95 | struct nv_pmu_therm_cmd therm; |
96 | struct nv_pmu_rpc_cmd rpc; | ||
55 | } cmd; | 97 | } cmd; |
56 | }; | 98 | }; |
57 | 99 | ||
@@ -69,6 +111,7 @@ struct pmu_msg { | |||
69 | struct nv_pmu_clk_msg clk; | 111 | struct nv_pmu_clk_msg clk; |
70 | struct nv_pmu_pmgr_msg pmgr; | 112 | struct nv_pmu_pmgr_msg pmgr; |
71 | struct nv_pmu_therm_msg therm; | 113 | struct nv_pmu_therm_msg therm; |
114 | struct nv_pmu_rpc_msg rpc; | ||
72 | } msg; | 115 | } msg; |
73 | }; | 116 | }; |
74 | 117 | ||