blob: 623188480bddee72b8e9eb09342bc328dda9981a [file] [log] [blame]
Soby Mathewb4c6df42022-11-09 11:13:29 +00001/*
2 * SPDX-License-Identifier: BSD-3-Clause
3 *
4 * SPDX-FileCopyrightText: Copyright TF-RMM Contributors.
5 */
6
7#ifndef SMC_RMI_H
8#define SMC_RMI_H
9
Soby Mathewb4c6df42022-11-09 11:13:29 +000010#include <smc.h>
11
12/*
13 * This file describes the Realm Management Interface (RMI) Application Binary
14 * Interface (ABI) for SMC calls made from Non-secure state to the RMM and
15 * serviced by the RMM.
Soby Mathewb4c6df42022-11-09 11:13:29 +000016 */
17
18/*
19 * The major version number of the RMI implementation. Increase this whenever
20 * the binary format or semantics of the SMC calls change.
21 */
Soby Mathewc9b6ecd2023-01-17 03:40:44 +000022#define RMI_ABI_VERSION_MAJOR U(56)
Soby Mathewb4c6df42022-11-09 11:13:29 +000023
24/*
25 * The minor version number of the RMI implementation. Increase this when
26 * a bug is fixed, or a feature is added without breaking binary compatibility.
27 */
Soby Mathewc9b6ecd2023-01-17 03:40:44 +000028#define RMI_ABI_VERSION_MINOR U(0)
Soby Mathewb4c6df42022-11-09 11:13:29 +000029
Soby Mathewc9b6ecd2023-01-17 03:40:44 +000030#define RMI_ABI_VERSION ((RMI_ABI_VERSION_MAJOR << U(16)) | \
Soby Mathewb4c6df42022-11-09 11:13:29 +000031 RMI_ABI_VERSION_MINOR)
32
Soby Mathewc9b6ecd2023-01-17 03:40:44 +000033#define RMI_ABI_VERSION_GET_MAJOR(_version) ((_version) >> U(16))
34#define RMI_ABI_VERSION_GET_MINOR(_version) ((_version) & U(0xFFFF))
Soby Mathewb4c6df42022-11-09 11:13:29 +000035
36#define SMC64_RMI_FID(_offset) SMC64_STD_FID(RMI, _offset)
37
38#define IS_SMC64_RMI_FID(_fid) IS_SMC64_STD_FAST_IN_RANGE(RMI, _fid)
39
Yousuf A0ec040d2022-10-31 12:30:57 +000040/* Command completed successfully. index is zero. */
41#define RMI_SUCCESS U(0)
42
43/*
44 * The value of a command input value caused the command to fail.
45 * Index is zero.
46 */
47#define RMI_ERROR_INPUT U(1)
48
49/*
50 * An attribute of a Realm does not match the expected value.
51 * index varies between usages.
52 */
53#define RMI_ERROR_REALM U(2)
54
55/*
56 * An attribute of a REC does not match the expected value.
57 * Index is zero.
58 */
59#define RMI_ERROR_REC U(3)
60
61/*
62 * An RTT walk terminated before reaching the target RTT level, or reached
63 * an RTTE with an unexpected value. index: RTT level at which the walk
64 * terminated
65 */
66#define RMI_ERROR_RTT U(4)
67
68/*
Yousuf A0ec040d2022-10-31 12:30:57 +000069 * Number of RMI Status Errors.
70 */
AlexeiFedorov892abce2023-04-06 16:32:12 +010071#define RMI_ERROR_COUNT U(5)
Yousuf A0ec040d2022-10-31 12:30:57 +000072
Soby Mathewb4c6df42022-11-09 11:13:29 +000073/*
74 * The number of GPRs (starting from X0) that are
75 * configured by the host when a REC is created.
76 */
Soby Mathewc9b6ecd2023-01-17 03:40:44 +000077#define REC_CREATE_NR_GPRS U(8)
Soby Mathewb4c6df42022-11-09 11:13:29 +000078
Soby Mathewc9b6ecd2023-01-17 03:40:44 +000079#define REC_PARAMS_FLAG_RUNNABLE (UL(1) << 0)
Soby Mathewb4c6df42022-11-09 11:13:29 +000080
81/*
82 * The number of GPRs (starting from X0) per voluntary exit context.
83 * Per SMCCC.
84 */
Soby Mathewc9b6ecd2023-01-17 03:40:44 +000085#define REC_EXIT_NR_GPRS U(31)
Soby Mathewb4c6df42022-11-09 11:13:29 +000086
87/* RmiHashAlgorithm type */
Soby Mathew3f56a4c2023-01-17 02:35:10 +000088#define RMI_HASH_ALGO_SHA256 0
89#define RMI_HASH_ALGO_SHA512 1
Soby Mathewb4c6df42022-11-09 11:13:29 +000090
91/* Maximum number of Interrupt Controller List Registers */
Soby Mathewc9b6ecd2023-01-17 03:40:44 +000092#define REC_GIC_NUM_LRS U(16)
Soby Mathewb4c6df42022-11-09 11:13:29 +000093
94/* Maximum number of auxiliary granules required for a REC */
Soby Mathewc9b6ecd2023-01-17 03:40:44 +000095#define MAX_REC_AUX_GRANULES U(16)
Soby Mathewb4c6df42022-11-09 11:13:29 +000096
Soby Mathewc9b6ecd2023-01-17 03:40:44 +000097#define REC_ENTRY_FLAG_EMUL_MMIO (UL(1) << 0)
98#define REC_ENTRY_FLAG_INJECT_SEA (UL(1) << 1)
Soby Mathewb4c6df42022-11-09 11:13:29 +000099
100/* Flags to specify if WFI/WFE should be trapped to host */
Soby Mathewc9b6ecd2023-01-17 03:40:44 +0000101#define REC_ENTRY_FLAG_TRAP_WFI (UL(1) << 2)
102#define REC_ENTRY_FLAG_TRAP_WFE (UL(1) << 3)
Soby Mathewb4c6df42022-11-09 11:13:29 +0000103
104/*
105 * RmiRecExitReason represents the reason for a REC exit.
106 * This is returned to NS hosts via RMI_REC_ENTER::run_ptr.
107 */
Soby Mathewc9b6ecd2023-01-17 03:40:44 +0000108#define RMI_EXIT_SYNC U(0)
109#define RMI_EXIT_IRQ U(1)
110#define RMI_EXIT_FIQ U(2)
111#define RMI_EXIT_PSCI U(3)
112#define RMI_EXIT_RIPAS_CHANGE U(4)
113#define RMI_EXIT_HOST_CALL U(5)
114#define RMI_EXIT_SERROR U(6)
Soby Mathewb4c6df42022-11-09 11:13:29 +0000115
116/* RmiRttEntryState represents the state of an RTTE */
Soby Mathewc9b6ecd2023-01-17 03:40:44 +0000117#define RMI_UNASSIGNED U(0)
118#define RMI_DESTROYED U(1)
119#define RMI_ASSIGNED U(2)
120#define RMI_TABLE U(3)
121#define RMI_VALID_NS U(4)
Soby Mathewb4c6df42022-11-09 11:13:29 +0000122
AlexeiFedorov7bb7a702023-01-17 17:04:14 +0000123/* RmiFeature enumerations */
AlexeiFedorovc09b1652023-04-04 15:41:37 +0100124#define RMI_FEATURE_FALSE UL(0)
125#define RMI_FEATURE_TRUE UL(1)
AlexeiFedorov7bb7a702023-01-17 17:04:14 +0000126
Yousuf Aa297b9b2022-10-13 13:54:21 +0100127/* RmiFeatureRegister0 format */
128#define RMM_FEATURE_REGISTER_0_INDEX UL(0)
129
130#define RMM_FEATURE_REGISTER_0_S2SZ_SHIFT UL(0)
131#define RMM_FEATURE_REGISTER_0_S2SZ_WIDTH UL(8)
132
133#define RMM_FEATURE_REGISTER_0_LPA2_SHIFT UL(8)
134#define RMM_FEATURE_REGISTER_0_LPA2_WIDTH UL(1)
Yousuf Aa297b9b2022-10-13 13:54:21 +0100135
AlexeiFedorov18002922023-04-06 10:19:51 +0100136#define RMM_FEATURE_REGISTER_0_SVE_EN_SHIFT UL(9)
137#define RMM_FEATURE_REGISTER_0_SVE_EN_WIDTH UL(1)
Yousuf Aa297b9b2022-10-13 13:54:21 +0100138
AlexeiFedorov18002922023-04-06 10:19:51 +0100139#define RMM_FEATURE_REGISTER_0_SVE_VL_SHIFT UL(10)
140#define RMM_FEATURE_REGISTER_0_SVE_VL_WIDTH UL(4)
Yousuf Aa297b9b2022-10-13 13:54:21 +0100141
AlexeiFedorov18002922023-04-06 10:19:51 +0100142#define RMM_FEATURE_REGISTER_0_NUM_BPS_SHIFT UL(14)
143#define RMM_FEATURE_REGISTER_0_NUM_BPS_WIDTH UL(4)
144
145#define RMM_FEATURE_REGISTER_0_NUM_WPS_SHIFT UL(18)
146#define RMM_FEATURE_REGISTER_0_NUM_WPS_WIDTH UL(4)
147
148#define RMM_FEATURE_REGISTER_0_PMU_EN_SHIFT UL(22)
149#define RMM_FEATURE_REGISTER_0_PMU_EN_WIDTH UL(1)
AlexeiFedorov7bb7a702023-01-17 17:04:14 +0000150
151#define RMM_FEATURE_REGISTER_0_PMU_NUM_CTRS_SHIFT UL(23)
152#define RMM_FEATURE_REGISTER_0_PMU_NUM_CTRS_WIDTH UL(5)
153
AlexeiFedorov18002922023-04-06 10:19:51 +0100154#define RMM_FEATURE_REGISTER_0_HASH_SHA_256_SHIFT UL(28)
155#define RMM_FEATURE_REGISTER_0_HASH_SHA_256_WIDTH UL(1)
156
157#define RMM_FEATURE_REGISTER_0_HASH_SHA_512_SHIFT UL(29)
158#define RMM_FEATURE_REGISTER_0_HASH_SHA_512_WIDTH UL(1)
Arunachalam Ganapathyf6491212023-02-23 16:04:34 +0000159
Yousuf A62808152022-10-31 10:35:42 +0000160/* The RmmRipas enumeration representing realm IPA state */
161#define RMI_EMPTY (0)
162#define RMI_RAM (1)
163
Soby Mathewb4c6df42022-11-09 11:13:29 +0000164/* no parameters */
165#define SMC_RMM_VERSION SMC64_RMI_FID(U(0x0))
166
167/*
168 * arg0 == target granule address
169 */
170#define SMC_RMM_GRANULE_DELEGATE SMC64_RMI_FID(U(0x1))
171
172/*
173 * arg0 == target granule address
174 */
175#define SMC_RMM_GRANULE_UNDELEGATE SMC64_RMI_FID(U(0x2))
176
177/* RmiDataMeasureContent type */
178#define RMI_NO_MEASURE_CONTENT 0
179#define RMI_MEASURE_CONTENT 1
180
181/*
AlexeiFedorovac923c82023-04-06 15:12:04 +0100182 * arg0 == RD address
183 * arg1 == data address
Soby Mathewb4c6df42022-11-09 11:13:29 +0000184 * arg2 == map address
185 * arg3 == SRC address
186 * arg4 == flags
187 */
188#define SMC_RMM_DATA_CREATE SMC64_RMI_FID(U(0x3))
189
190/*
AlexeiFedorovac923c82023-04-06 15:12:04 +0100191 * arg0 == RD address
192 * arg1 == data address
Soby Mathewb4c6df42022-11-09 11:13:29 +0000193 * arg2 == map address
194 */
195#define SMC_RMM_DATA_CREATE_UNKNOWN SMC64_RMI_FID(U(0x4))
196
197/*
198 * arg0 == RD address
199 * arg1 == map address
200 */
201#define SMC_RMM_DATA_DESTROY SMC64_RMI_FID(U(0x5))
202
203/*
204 * arg0 == RD address
205 */
206#define SMC_RMM_REALM_ACTIVATE SMC64_RMI_FID(U(0x7))
207
208/*
209 * arg0 == RD address
AlexeiFedorovac923c82023-04-06 15:12:04 +0100210 * arg1 == struct rmi_realm_params address
Soby Mathewb4c6df42022-11-09 11:13:29 +0000211 */
212#define SMC_RMM_REALM_CREATE SMC64_RMI_FID(U(0x8))
213
214/*
215 * arg0 == RD address
216 */
217#define SMC_RMM_REALM_DESTROY SMC64_RMI_FID(U(0x9))
218
219/*
AlexeiFedorovac923c82023-04-06 15:12:04 +0100220 * arg0 == RD address
221 * arg1 == REC address
Soby Mathewb4c6df42022-11-09 11:13:29 +0000222 * arg2 == struct rmm_rec address
223 */
224#define SMC_RMM_REC_CREATE SMC64_RMI_FID(U(0xA))
225
226/*
227 * arg0 == REC address
228 */
229#define SMC_RMM_REC_DESTROY SMC64_RMI_FID(U(0xB))
230
231/*
232 * arg0 == rec address
AlexeiFedorovac923c82023-04-06 15:12:04 +0100233 * arg1 == struct rec_run address
Soby Mathewb4c6df42022-11-09 11:13:29 +0000234 */
235#define SMC_RMM_REC_ENTER SMC64_RMI_FID(U(0xC))
236
237/*
AlexeiFedorovac923c82023-04-06 15:12:04 +0100238 * arg0 == RD address
239 * arg1 == RTT address
Soby Mathewb4c6df42022-11-09 11:13:29 +0000240 * arg2 == map address
241 * arg3 == level
242 */
243#define SMC_RMM_RTT_CREATE SMC64_RMI_FID(U(0xD))
244
245/*
246 * arg0 == RTT address
247 * arg1 == RD address
248 * arg2 == map address
249 * arg3 == level
250 */
251#define SMC_RMM_RTT_DESTROY SMC64_RMI_FID(U(0xE))
252
253/*
254 * arg0 == RD address
255 * arg1 == map address
256 * arg2 == level
257 * arg3 == s2tte
258 */
259#define SMC_RMM_RTT_MAP_UNPROTECTED SMC64_RMI_FID(U(0xF))
260
261/*
262 * arg0 == RD address
263 * arg1 == map address
264 * arg2 == level
265 * ret1 == level
266 * ret2 == s2tte type
267 * ret3 == s2tte
268 * ret4 == ripas
269 */
270#define SMC_RMM_RTT_READ_ENTRY SMC64_RMI_FID(U(0x11))
271
272/*
273 * arg0 == RD address
274 * arg1 == map address
275 * arg2 == level
276 */
277#define SMC_RMM_RTT_UNMAP_UNPROTECTED SMC64_RMI_FID(U(0x12))
278
279/*
280 * arg0 == calling rec address
281 * arg1 == target rec address
282 */
283#define SMC_RMM_PSCI_COMPLETE SMC64_RMI_FID(U(0x14))
284
285/*
286 * arg0 == Feature register index
287 */
288#define SMC_RMM_FEATURES SMC64_RMI_FID(U(0x15))
289
290/*
291 * arg0 == RTT address
292 * arg1 == RD address
293 * arg2 == map address
294 * arg3 == level
295 */
296#define SMC_RMM_RTT_FOLD SMC64_RMI_FID(U(0x16))
297
298/*
299 * arg0 == RD address
300 */
301#define SMC_RMM_REC_AUX_COUNT SMC64_RMI_FID(U(0x17))
302
303/*
AlexeiFedorovac923c82023-04-06 15:12:04 +0100304 * arg0 == RD address
305 * arg1 == map address
306 * arg2 == level
Soby Mathewb4c6df42022-11-09 11:13:29 +0000307 */
308#define SMC_RMM_RTT_INIT_RIPAS SMC64_RMI_FID(U(0x18))
309
310/*
311 * arg0 == RD address
312 * arg1 == REC address
313 * arg2 == map address
314 * arg3 == level
315 * arg4 == ripas
316 */
317#define SMC_RMM_RTT_SET_RIPAS SMC64_RMI_FID(U(0x19))
318
319/* Size of Realm Personalization Value */
320#define RPV_SIZE 64
321
AlexeiFedorov18002922023-04-06 10:19:51 +0100322/* RmiRealmFlags format */
323#define RMI_REALM_FLAGS_LPA2_SHIFT UL(0)
324#define RMI_REALM_FLAGS_LPA2_WIDTH UL(1)
325
326#define RMI_REALM_FLAGS_SVE_SHIFT UL(1)
327#define RMI_REALM_FLAGS_SVE_WIDTH UL(1)
328
329#define RMI_REALM_FLAGS_PMU_SHIFT UL(2)
330#define RMI_REALM_FLAGS_PMU_WIDTH UL(1)
331
Soby Mathewc9b6ecd2023-01-17 03:40:44 +0000332#ifndef __ASSEMBLER__
Soby Mathewb4c6df42022-11-09 11:13:29 +0000333/*
Soby Mathewc414f2a2023-01-17 02:50:17 +0000334 * Defines member of structure and reserves space
335 * for the next member with specified offset.
336 */
337#define SET_MEMBER_RMI SET_MEMBER
338
339/*
Soby Mathewb4c6df42022-11-09 11:13:29 +0000340 * The Realm attribute parameters are shared by the Host via
341 * RMI_REALM_CREATE::params_ptr. The values can be observed or modified
342 * either by the Host or by the Realm.
343 */
344struct rmi_realm_params {
AlexeiFedorov18002922023-04-06 10:19:51 +0100345 /* Flags */
346 SET_MEMBER_RMI(unsigned long flags, 0, 0x8); /* Offset 0 */
347 /* Requested IPA width */
348 SET_MEMBER_RMI(unsigned int s2sz, 0x8, 0x10); /* 0x8 */
349 /* Requested SVE vector length */
350 SET_MEMBER_RMI(unsigned int sve_vl, 0x10, 0x18); /* 0x10 */
351 /* Requested number of breakpoints */
352 SET_MEMBER_RMI(unsigned int num_bps, 0x18, 0x20); /* 0x18 */
353 /* Requested number of watchpoints */
354 SET_MEMBER_RMI(unsigned int num_wps, 0x20, 0x28); /* 0x20 */
355 /* Requested number of PMU counters */
356 SET_MEMBER_RMI(unsigned int pmu_num_ctrs, 0x28, 0x30); /* 0x28 */
Soby Mathewb4c6df42022-11-09 11:13:29 +0000357 /* Measurement algorithm */
AlexeiFedorov18002922023-04-06 10:19:51 +0100358 SET_MEMBER_RMI(unsigned char hash_algo, 0x30, 0x400); /* 0x30 */
Soby Mathewb4c6df42022-11-09 11:13:29 +0000359 /* Realm Personalization Value */
AlexeiFedorov18002922023-04-06 10:19:51 +0100360 SET_MEMBER_RMI(unsigned char rpv[RPV_SIZE], 0x400, 0x800); /* 0x400 */
Soby Mathewc414f2a2023-01-17 02:50:17 +0000361 SET_MEMBER_RMI(struct {
Soby Mathewb4c6df42022-11-09 11:13:29 +0000362 /* Virtual Machine Identifier */
363 unsigned short vmid; /* 0x800 */
364 /* Realm Translation Table base */
365 unsigned long rtt_base; /* 0x808 */
366 /* RTT starting level */
367 long rtt_level_start; /* 0x810 */
368 /* Number of starting level RTTs */
369 unsigned int rtt_num_start; /* 0x818 */
370 }, 0x800, 0x1000);
371};
372
Soby Mathewb4c6df42022-11-09 11:13:29 +0000373/*
374 * The REC attribute parameters are shared by the Host via
375 * MI_REC_CREATE::params_ptr. The values can be observed or modified
376 * either by the Host or by the Realm which owns the REC.
377 */
378struct rmi_rec_params {
379 /* Flags */
Soby Mathewc414f2a2023-01-17 02:50:17 +0000380 SET_MEMBER_RMI(unsigned long flags, 0, 0x100); /* Offset 0 */
Soby Mathewb4c6df42022-11-09 11:13:29 +0000381 /* MPIDR of the REC */
Soby Mathewc414f2a2023-01-17 02:50:17 +0000382 SET_MEMBER_RMI(unsigned long mpidr, 0x100, 0x200); /* 0x100 */
Soby Mathewb4c6df42022-11-09 11:13:29 +0000383 /* Program counter */
Soby Mathewc414f2a2023-01-17 02:50:17 +0000384 SET_MEMBER_RMI(unsigned long pc, 0x200, 0x300); /* 0x200 */
Soby Mathewb4c6df42022-11-09 11:13:29 +0000385 /* General-purpose registers */
Soby Mathewc414f2a2023-01-17 02:50:17 +0000386 SET_MEMBER_RMI(unsigned long gprs[REC_CREATE_NR_GPRS], 0x300, 0x800); /* 0x300 */
387 SET_MEMBER_RMI(struct {
Soby Mathewb4c6df42022-11-09 11:13:29 +0000388 /* Number of auxiliary Granules */
389 unsigned long num_aux; /* 0x800 */
390 /* Addresses of auxiliary Granules */
391 unsigned long aux[MAX_REC_AUX_GRANULES];/* 0x808 */
392 }, 0x800, 0x1000);
393};
394
Soby Mathewb4c6df42022-11-09 11:13:29 +0000395/*
396 * Structure contains data passed from the Host to the RMM on REC entry
397 */
398struct rmi_rec_entry {
399 /* Flags */
Soby Mathewc414f2a2023-01-17 02:50:17 +0000400 SET_MEMBER_RMI(unsigned long flags, 0, 0x200); /* Offset 0 */
Soby Mathewb4c6df42022-11-09 11:13:29 +0000401 /* General-purpose registers */
Soby Mathewc414f2a2023-01-17 02:50:17 +0000402 SET_MEMBER_RMI(unsigned long gprs[REC_EXIT_NR_GPRS], 0x200, 0x300); /* 0x200 */
403 SET_MEMBER_RMI(struct {
Soby Mathewb4c6df42022-11-09 11:13:29 +0000404 /* GICv3 Hypervisor Control Register */
405 unsigned long gicv3_hcr; /* 0x300 */
406 /* GICv3 List Registers */
407 unsigned long gicv3_lrs[REC_GIC_NUM_LRS]; /* 0x308 */
408 }, 0x300, 0x800);
409};
410
Soby Mathewb4c6df42022-11-09 11:13:29 +0000411/*
412 * Structure contains data passed from the RMM to the Host on REC exit
413 */
414struct rmi_rec_exit {
415 /* Exit reason */
Soby Mathewc414f2a2023-01-17 02:50:17 +0000416 SET_MEMBER_RMI(unsigned long exit_reason, 0, 0x100);/* Offset 0 */
417 SET_MEMBER_RMI(struct {
Soby Mathewb4c6df42022-11-09 11:13:29 +0000418 /* Exception Syndrome Register */
419 unsigned long esr; /* 0x100 */
420 /* Fault Address Register */
421 unsigned long far; /* 0x108 */
422 /* Hypervisor IPA Fault Address register */
423 unsigned long hpfar; /* 0x110 */
424 }, 0x100, 0x200);
425 /* General-purpose registers */
Soby Mathewc414f2a2023-01-17 02:50:17 +0000426 SET_MEMBER_RMI(unsigned long gprs[REC_EXIT_NR_GPRS], 0x200, 0x300); /* 0x200 */
427 SET_MEMBER_RMI(struct {
Soby Mathewb4c6df42022-11-09 11:13:29 +0000428 /* GICv3 Hypervisor Control Register */
429 unsigned long gicv3_hcr; /* 0x300 */
430 /* GICv3 List Registers */
431 unsigned long gicv3_lrs[REC_GIC_NUM_LRS]; /* 0x308 */
432 /* GICv3 Maintenance Interrupt State Register */
433 unsigned long gicv3_misr; /* 0x388 */
434 /* GICv3 Virtual Machine Control Register */
435 unsigned long gicv3_vmcr; /* 0x390 */
436 }, 0x300, 0x400);
Soby Mathewc414f2a2023-01-17 02:50:17 +0000437 SET_MEMBER_RMI(struct {
Soby Mathewb4c6df42022-11-09 11:13:29 +0000438 /* Counter-timer Physical Timer Control Register */
439 unsigned long cntp_ctl; /* 0x400 */
440 /* Counter-timer Physical Timer CompareValue Register */
441 unsigned long cntp_cval; /* 0x408 */
442 /* Counter-timer Virtual Timer Control Register */
443 unsigned long cntv_ctl; /* 0x410 */
444 /* Counter-timer Virtual Timer CompareValue Register */
445 unsigned long cntv_cval; /* 0x418 */
446 }, 0x400, 0x500);
Soby Mathewc414f2a2023-01-17 02:50:17 +0000447 SET_MEMBER_RMI(struct {
Soby Mathewb4c6df42022-11-09 11:13:29 +0000448 /* Base address of pending RIPAS change */
449 unsigned long ripas_base; /* 0x500 */
450 /* Size of pending RIPAS change */
451 unsigned long ripas_size; /* 0x508 */
452 /* RIPAS value of pending RIPAS change */
453 unsigned char ripas_value; /* 0x510 */
454 }, 0x500, 0x600);
455 /* Host call immediate value */
AlexeiFedoroveaec0c42023-02-01 18:13:32 +0000456 SET_MEMBER_RMI(unsigned int imm, 0x600, 0x700); /* 0x600 */
457
458 /* PMU overflow */
459 SET_MEMBER_RMI(unsigned long pmu_ovf, 0x700, 0x708); /* 0x700 */
460
461 /* PMU interrupt enable */
462 SET_MEMBER_RMI(unsigned long pmu_intr_en, 0x708, 0x710); /* 0x708 */
463
464 /* PMU counter enable */
465 SET_MEMBER_RMI(unsigned long pmu_cntr_en, 0x710, 0x800); /* 0x710 */
Soby Mathewb4c6df42022-11-09 11:13:29 +0000466};
467
Soby Mathewb4c6df42022-11-09 11:13:29 +0000468/*
469 * Structure contains shared information between RMM and Host
470 * during REC entry and REC exit.
471 */
472struct rmi_rec_run {
473 /* Entry information */
Soby Mathewc414f2a2023-01-17 02:50:17 +0000474 SET_MEMBER_RMI(struct rmi_rec_entry entry, 0, 0x800); /* Offset 0 */
Soby Mathewb4c6df42022-11-09 11:13:29 +0000475 /* Exit information */
AlexeiFedoroveaec0c42023-02-01 18:13:32 +0000476 SET_MEMBER_RMI(struct rmi_rec_exit exit, 0x800, 0x1000);/* 0x800 */
Soby Mathewb4c6df42022-11-09 11:13:29 +0000477};
478
Soby Mathewc9b6ecd2023-01-17 03:40:44 +0000479#endif /* __ASSEMBLER__ */
480
Soby Mathewb4c6df42022-11-09 11:13:29 +0000481#endif /* SMC_RMI_H */