blob: a445672a0cdac93ebd65ae3abbb097faf4e4e9f3 [file] [log] [blame]
Soby Mathewb4c6df42022-11-09 11:13:29 +00001/*
2 * SPDX-License-Identifier: BSD-3-Clause
3 * SPDX-FileCopyrightText: Copyright TF-RMM Contributors.
4 */
5
6#ifndef RIPAS_H
7#define RIPAS_H
8
Yousuf A62808152022-10-31 10:35:42 +00009#include <smc-rmi.h>
AlexeiFedorov63614ea2023-07-14 17:07:20 +010010#include <smc-rsi.h>
Soby Mathewb4c6df42022-11-09 11:13:29 +000011
12/*
AlexeiFedorovc53b1f72023-07-04 15:37:03 +010013 * The RmmRipas enumeration represents realm IPA state.
Soby Mathewb4c6df42022-11-09 11:13:29 +000014 *
15 * Map RmmRipas to RmiRipas to simplify code/decode operations.
16 */
17enum ripas {
Yousuf A62808152022-10-31 10:35:42 +000018 RIPAS_EMPTY = RMI_EMPTY, /* Unused IPA for Realm */
AlexeiFedorov20afb5c2023-04-18 11:44:19 +010019 RIPAS_RAM = RMI_RAM, /* IPA used for Code/Data by Realm */
AlexeiFedorovd402d5d2024-08-05 13:50:33 +010020 RIPAS_DESTROYED = RMI_DESTROYED,/* IPA is inaccessible to the Realm */
21 RIPAS_DEV /* Address where memory of an assigned
22 Realm device is mapped */
Soby Mathewb4c6df42022-11-09 11:13:29 +000023};
24
AlexeiFedorov63614ea2023-07-14 17:07:20 +010025/*
26 * The RmmRipasChangeDestroyed enumeration represents whether a RIPAS change
27 * from DESTROYED should be permitted.
28 *
29 * Map RmmRipasChangeDestroyed to RsiRipasChangeDestroyed to simplify check
30 * operation.
31 */
32enum ripas_change_destroyed {
33 /* A RIPAS change from DESTROYED should not be permitted */
34 NO_CHANGE_DESTROYED = RSI_NO_CHANGE_DESTROYED,
35
36 /* A RIPAS change from DESTROYED should be permitted */
37 CHANGE_DESTROYED = RSI_CHANGE_DESTROYED
38};
39
AlexeiFedorov9b29c6b2023-09-12 17:09:50 +010040/*
41 * The RmmRecResponse enumeration represents whether the Host accepted
42 * or rejected a Realm request.
43 *
44 * Map RmmRecResponse to RmiResponse to simplify check operation.
45 */
46enum ripas_response {
47 ACCEPT = RMI_ACCEPT, /* Host accepted Realm request */
48 REJECT = RMI_REJECT /* Host rejected Realm request */
49};
50
Soby Mathewb4c6df42022-11-09 11:13:29 +000051#endif /* RIPAS_H */