aboutsummaryrefslogtreecommitdiffstats
path: root/include/nvgpu/pmuif/gpmuif_acr.h
diff options
context:
space:
mode:
authorJoshua Bakita <bakitajoshua@gmail.com>2023-06-28 18:24:25 -0400
committerJoshua Bakita <bakitajoshua@gmail.com>2023-06-28 18:24:25 -0400
commit01e6fac4d61fdd7fff5433942ec93fc2ea1e4df1 (patch)
tree4ef34501728a087be24f4ba0af90f91486bf780b /include/nvgpu/pmuif/gpmuif_acr.h
parent306a03d18b305e4e573be3b2931978fa10679eb9 (diff)
Include nvgpu headers
These are needed to build on NVIDIA's Jetson boards for the time being. Only a couple structs are required, so it should be fairly easy to remove this dependency at some point in the future.
Diffstat (limited to 'include/nvgpu/pmuif/gpmuif_acr.h')
-rw-r--r--include/nvgpu/pmuif/gpmuif_acr.h159
1 files changed, 159 insertions, 0 deletions
diff --git a/include/nvgpu/pmuif/gpmuif_acr.h b/include/nvgpu/pmuif/gpmuif_acr.h
new file mode 100644
index 0000000..c305589
--- /dev/null
+++ b/include/nvgpu/pmuif/gpmuif_acr.h
@@ -0,0 +1,159 @@
1/*
2 * Copyright (c) 2017-2018, NVIDIA CORPORATION. All rights reserved.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 * DEALINGS IN THE SOFTWARE.
21 */
22#ifndef NVGPU_PMUIF_GPMUIF_ACR_H
23#define NVGPU_PMUIF_GPMUIF_ACR_H
24
25/* ACR Commands/Message structures */
26
27enum {
28 PMU_ACR_CMD_ID_INIT_WPR_REGION = 0x0,
29 PMU_ACR_CMD_ID_BOOTSTRAP_FALCON,
30 PMU_ACR_CMD_ID_RESERVED,
31 PMU_ACR_CMD_ID_BOOTSTRAP_MULTIPLE_FALCONS,
32};
33
34/*
35 * Initializes the WPR region details
36 */
37struct pmu_acr_cmd_init_wpr_details {
38 u8 cmd_type;
39 u32 regionid;
40 u32 wproffset;
41
42};
43
44/*
45 * falcon ID to bootstrap
46 */
47struct pmu_acr_cmd_bootstrap_falcon {
48 u8 cmd_type;
49 u32 flags;
50 u32 falconid;
51};
52
53/*
54 * falcon ID to bootstrap
55 */
56struct pmu_acr_cmd_bootstrap_multiple_falcons {
57 u8 cmd_type;
58 u32 flags;
59 u32 falconidmask;
60 u32 usevamask;
61 struct falc_u64 wprvirtualbase;
62};
63
64#define PMU_ACR_CMD_BOOTSTRAP_FALCON_FLAGS_RESET_NO 1
65#define PMU_ACR_CMD_BOOTSTRAP_FALCON_FLAGS_RESET_YES 0
66
67
68struct pmu_acr_cmd {
69 union {
70 u8 cmd_type;
71 struct pmu_acr_cmd_bootstrap_falcon bootstrap_falcon;
72 struct pmu_acr_cmd_init_wpr_details init_wpr;
73 struct pmu_acr_cmd_bootstrap_multiple_falcons boot_falcons;
74 };
75};
76
77/* acr messages */
78
79/*
80 * returns the WPR region init information
81 */
82#define PMU_ACR_MSG_ID_INIT_WPR_REGION 0
83
84/*
85 * Returns the Bootstrapped falcon ID to RM
86 */
87#define PMU_ACR_MSG_ID_BOOTSTRAP_FALCON 1
88
89/*
90 * Returns the WPR init status
91 */
92#define PMU_ACR_SUCCESS 0
93#define PMU_ACR_ERROR 1
94
95/*
96 * PMU notifies about bootstrap status of falcon
97 */
98struct pmu_acr_msg_bootstrap_falcon {
99 u8 msg_type;
100 union {
101 u32 errorcode;
102 u32 falconid;
103 };
104};
105
106struct pmu_acr_msg {
107 union {
108 u8 msg_type;
109 struct pmu_acr_msg_bootstrap_falcon acrmsg;
110 };
111};
112
113/* ACR RPC */
114#define NV_PMU_RPC_ID_ACR_INIT_WPR_REGION 0x00
115#define NV_PMU_RPC_ID_ACR_WRITE_CBC_BASE 0x01
116#define NV_PMU_RPC_ID_ACR_BOOTSTRAP_FALCON 0x02
117#define NV_PMU_RPC_ID_ACR_BOOTSTRAP_GR_FALCONS 0x03
118#define NV_PMU_RPC_ID_ACR__COUNT 0x04
119
120/*
121 * structure that holds data used
122 * to execute INIT_WPR_REGION RPC.
123 */
124struct nv_pmu_rpc_struct_acr_init_wpr_region {
125 /*[IN/OUT] Must be first field in RPC structure */
126 struct nv_pmu_rpc_header hdr;
127 /*[IN] ACR region ID of WPR region */
128 u32 wpr_regionId;
129 /* [IN] WPR offset from startAddress */
130 u32 wpr_offset;
131 u32 scratch[1];
132};
133
134/*
135 * structure that holds data used to
136 * execute BOOTSTRAP_GR_FALCONS RPC.
137 */
138struct nv_pmu_rpc_struct_acr_bootstrap_gr_falcons {
139 /*[IN/OUT] Must be first field in RPC structure */
140 struct nv_pmu_rpc_header hdr;
141 /* [IN] Mask of falcon IDs @ref LSF_FALCON_ID_<XYZ> */
142 u32 falcon_id_mask;
143 /*
144 * [IN] Boostrapping flags @ref
145 * PMU_ACR_CMD_BOOTSTRAP_FALCON_FLAGS_<XYZ>
146 */
147 u32 flags;
148 /* [IN] Indicate whether the particular falon uses VA */
149 u32 falcon_va_mask;
150 /*
151 * [IN] WPR Base Address in VA. The Inst Block containing
152 * this VA should be bound to both PMU and GR falcons
153 * during the falcon boot
154 */
155 struct falc_u64 wpr_base_virtual;
156 u32 scratch[1];
157};
158
159#endif /* NVGPU_PMUIF_GPMUIF_ACR_H */