Soby Mathew | b4c6df4 | 2022-11-09 11:13:29 +0000 | [diff] [blame] | 1 | /* |
| 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 A | 6280815 | 2022-10-31 10:35:42 +0000 | [diff] [blame] | 9 | #include <smc-rmi.h> |
AlexeiFedorov | 63614ea | 2023-07-14 17:07:20 +0100 | [diff] [blame] | 10 | #include <smc-rsi.h> |
Soby Mathew | b4c6df4 | 2022-11-09 11:13:29 +0000 | [diff] [blame] | 11 | |
| 12 | /* |
AlexeiFedorov | c53b1f7 | 2023-07-04 15:37:03 +0100 | [diff] [blame] | 13 | * The RmmRipas enumeration represents realm IPA state. |
Soby Mathew | b4c6df4 | 2022-11-09 11:13:29 +0000 | [diff] [blame] | 14 | * |
| 15 | * Map RmmRipas to RmiRipas to simplify code/decode operations. |
| 16 | */ |
| 17 | enum ripas { |
Yousuf A | 6280815 | 2022-10-31 10:35:42 +0000 | [diff] [blame] | 18 | RIPAS_EMPTY = RMI_EMPTY, /* Unused IPA for Realm */ |
AlexeiFedorov | 20afb5c | 2023-04-18 11:44:19 +0100 | [diff] [blame] | 19 | RIPAS_RAM = RMI_RAM, /* IPA used for Code/Data by Realm */ |
AlexeiFedorov | d402d5d | 2024-08-05 13:50:33 +0100 | [diff] [blame] | 20 | 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 Mathew | b4c6df4 | 2022-11-09 11:13:29 +0000 | [diff] [blame] | 23 | }; |
| 24 | |
AlexeiFedorov | 63614ea | 2023-07-14 17:07:20 +0100 | [diff] [blame] | 25 | /* |
| 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 | */ |
| 32 | enum 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 | |
AlexeiFedorov | 9b29c6b | 2023-09-12 17:09:50 +0100 | [diff] [blame] | 40 | /* |
| 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 | */ |
| 46 | enum ripas_response { |
| 47 | ACCEPT = RMI_ACCEPT, /* Host accepted Realm request */ |
| 48 | REJECT = RMI_REJECT /* Host rejected Realm request */ |
| 49 | }; |
| 50 | |
Soby Mathew | b4c6df4 | 2022-11-09 11:13:29 +0000 | [diff] [blame] | 51 | #endif /* RIPAS_H */ |