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 SMC_HANDLER_H |
| 7 | #define SMC_HANDLER_H |
| 8 | |
| 9 | #include <smc.h> |
| 10 | |
Soby Mathew | c13b230 | 2023-09-19 16:14:52 +0100 | [diff] [blame] | 11 | void smc_version(unsigned long rmi_version, |
| 12 | struct smc_result *res); |
Soby Mathew | b4c6df4 | 2022-11-09 11:13:29 +0000 | [diff] [blame] | 13 | |
| 14 | void smc_read_feature_register(unsigned long index, |
AlexeiFedorov | ccce3ad | 2023-04-28 18:29:47 +0100 | [diff] [blame] | 15 | struct smc_result *res); |
Soby Mathew | b4c6df4 | 2022-11-09 11:13:29 +0000 | [diff] [blame] | 16 | |
AlexeiFedorov | ac923c8 | 2023-04-06 15:12:04 +0100 | [diff] [blame] | 17 | unsigned long smc_data_create(unsigned long rd_addr, |
| 18 | unsigned long data_addr, |
Soby Mathew | b4c6df4 | 2022-11-09 11:13:29 +0000 | [diff] [blame] | 19 | unsigned long map_addr, |
| 20 | unsigned long src_addr, |
| 21 | unsigned long flags); |
| 22 | |
AlexeiFedorov | ac923c8 | 2023-04-06 15:12:04 +0100 | [diff] [blame] | 23 | unsigned long smc_data_create_unknown(unsigned long rd_addr, |
| 24 | unsigned long data_addr, |
Soby Mathew | b4c6df4 | 2022-11-09 11:13:29 +0000 | [diff] [blame] | 25 | unsigned long map_addr); |
| 26 | |
AlexeiFedorov | e2002be | 2023-04-19 17:20:12 +0100 | [diff] [blame] | 27 | void smc_data_destroy(unsigned long rd_addr, |
| 28 | unsigned long map_addr, |
AlexeiFedorov | ccce3ad | 2023-04-28 18:29:47 +0100 | [diff] [blame] | 29 | struct smc_result *res); |
Soby Mathew | b4c6df4 | 2022-11-09 11:13:29 +0000 | [diff] [blame] | 30 | |
| 31 | unsigned long smc_granule_delegate(unsigned long addr); |
| 32 | |
| 33 | unsigned long smc_granule_undelegate(unsigned long addr); |
| 34 | |
| 35 | unsigned long smc_realm_activate(unsigned long rd_addr); |
| 36 | |
| 37 | unsigned long smc_realm_create(unsigned long rd_addr, |
AlexeiFedorov | e2002be | 2023-04-19 17:20:12 +0100 | [diff] [blame] | 38 | unsigned long realm_params_addr); |
Soby Mathew | b4c6df4 | 2022-11-09 11:13:29 +0000 | [diff] [blame] | 39 | |
| 40 | unsigned long smc_realm_destroy(unsigned long rd_addr); |
| 41 | |
AlexeiFedorov | ac923c8 | 2023-04-06 15:12:04 +0100 | [diff] [blame] | 42 | unsigned long smc_rec_create(unsigned long rd_addr, |
| 43 | unsigned long rec_addr, |
Soby Mathew | b4c6df4 | 2022-11-09 11:13:29 +0000 | [diff] [blame] | 44 | unsigned long rec_params_addr); |
| 45 | |
| 46 | unsigned long smc_rec_destroy(unsigned long rec_addr); |
| 47 | |
| 48 | unsigned long smc_rec_enter(unsigned long rec_addr, |
| 49 | unsigned long rec_run_addr); |
| 50 | |
| 51 | void smc_rec_aux_count(unsigned long rd_addr, |
AlexeiFedorov | ccce3ad | 2023-04-28 18:29:47 +0100 | [diff] [blame] | 52 | struct smc_result *res); |
Soby Mathew | b4c6df4 | 2022-11-09 11:13:29 +0000 | [diff] [blame] | 53 | |
AlexeiFedorov | ac923c8 | 2023-04-06 15:12:04 +0100 | [diff] [blame] | 54 | unsigned long smc_rtt_create(unsigned long rd_addr, |
| 55 | unsigned long rtt_addr, |
Soby Mathew | b4c6df4 | 2022-11-09 11:13:29 +0000 | [diff] [blame] | 56 | unsigned long map_addr, |
| 57 | unsigned long ulevel); |
| 58 | |
AlexeiFedorov | e2002be | 2023-04-19 17:20:12 +0100 | [diff] [blame] | 59 | void smc_rtt_destroy(unsigned long rd_addr, |
| 60 | unsigned long map_addr, |
| 61 | unsigned long ulevel, |
AlexeiFedorov | ccce3ad | 2023-04-28 18:29:47 +0100 | [diff] [blame] | 62 | struct smc_result *res); |
Soby Mathew | b4c6df4 | 2022-11-09 11:13:29 +0000 | [diff] [blame] | 63 | |
AlexeiFedorov | e2002be | 2023-04-19 17:20:12 +0100 | [diff] [blame] | 64 | void smc_rtt_fold(unsigned long rd_addr, |
| 65 | unsigned long map_addr, |
| 66 | unsigned long ulevel, |
AlexeiFedorov | ccce3ad | 2023-04-28 18:29:47 +0100 | [diff] [blame] | 67 | struct smc_result *res); |
Soby Mathew | b4c6df4 | 2022-11-09 11:13:29 +0000 | [diff] [blame] | 68 | |
| 69 | unsigned long smc_rtt_map_unprotected(unsigned long rd_addr, |
| 70 | unsigned long map_addr, |
| 71 | unsigned long ulevel, |
| 72 | unsigned long s2tte); |
| 73 | |
AlexeiFedorov | 917eabf | 2023-04-24 12:20:41 +0100 | [diff] [blame] | 74 | void smc_rtt_unmap_unprotected(unsigned long rd_addr, |
| 75 | unsigned long map_addr, |
| 76 | unsigned long ulevel, |
| 77 | struct smc_result *res); |
Soby Mathew | b4c6df4 | 2022-11-09 11:13:29 +0000 | [diff] [blame] | 78 | |
| 79 | void smc_rtt_read_entry(unsigned long rd_addr, |
| 80 | unsigned long map_addr, |
| 81 | unsigned long ulevel, |
AlexeiFedorov | ccce3ad | 2023-04-28 18:29:47 +0100 | [diff] [blame] | 82 | struct smc_result *res); |
Soby Mathew | b4c6df4 | 2022-11-09 11:13:29 +0000 | [diff] [blame] | 83 | |
| 84 | unsigned long smc_psci_complete(unsigned long calling_rec_addr, |
AlexeiFedorov | 120d7d0 | 2023-08-02 16:51:48 +0100 | [diff] [blame] | 85 | unsigned long target_rec_addr, |
| 86 | unsigned long status); |
Soby Mathew | b4c6df4 | 2022-11-09 11:13:29 +0000 | [diff] [blame] | 87 | |
AlexeiFedorov | 960d161 | 2023-04-25 13:23:39 +0100 | [diff] [blame] | 88 | void smc_rtt_init_ripas(unsigned long rd_addr, |
| 89 | unsigned long base, |
| 90 | unsigned long top, |
| 91 | struct smc_result *res); |
Soby Mathew | b4c6df4 | 2022-11-09 11:13:29 +0000 | [diff] [blame] | 92 | |
AlexeiFedorov | 5cf35ba | 2023-04-25 10:02:20 +0100 | [diff] [blame] | 93 | void smc_rtt_set_ripas(unsigned long rd_addr, |
| 94 | unsigned long rec_addr, |
| 95 | unsigned long base, |
| 96 | unsigned long top, |
AlexeiFedorov | ccce3ad | 2023-04-28 18:29:47 +0100 | [diff] [blame] | 97 | struct smc_result *res); |
Soby Mathew | b4c6df4 | 2022-11-09 11:13:29 +0000 | [diff] [blame] | 98 | |
AlexeiFedorov | d2e9393 | 2025-01-13 17:24:37 +0000 | [diff] [blame] | 99 | unsigned long smc_dev_mem_map(unsigned long rd_addr, |
| 100 | unsigned long map_addr, |
| 101 | unsigned long ulevel, |
| 102 | unsigned long dev_mem_addr); |
| 103 | |
| 104 | void smc_dev_mem_unmap(unsigned long rd_addr, |
| 105 | unsigned long map_addr, |
| 106 | unsigned long ulevel, |
| 107 | struct smc_result *res); |
| 108 | |
Soby Mathew | e7cf182 | 2025-04-24 07:51:33 +0100 | [diff] [blame] | 109 | unsigned long smc_pdev_create(unsigned long pdev_ptr, |
| 110 | unsigned long pdev_params_ptr); |
| 111 | |
Arunachalam Ganapathy | 8f6f626 | 2024-10-10 11:42:00 +0100 | [diff] [blame] | 112 | void smc_pdev_aux_count(unsigned long flags, struct smc_result *res); |
| 113 | |
Soby Mathew | f2b1644 | 2025-04-24 12:00:25 +0100 | [diff] [blame] | 114 | unsigned long smc_pdev_communicate(unsigned long pdev_ptr, |
| 115 | unsigned long dev_comm_data_ptr); |
| 116 | |
Arunachalam Ganapathy | 294d102 | 2024-07-17 12:31:26 +0100 | [diff] [blame] | 117 | void smc_pdev_get_state(unsigned long pdev_ptr, struct smc_result *res); |
Arunachalam Ganapathy | db98da6 | 2024-10-09 12:06:57 +0100 | [diff] [blame] | 118 | |
| 119 | unsigned long smc_pdev_destroy(unsigned long pdev_ptr); |
| 120 | |
Soby Mathew | b4c6df4 | 2022-11-09 11:13:29 +0000 | [diff] [blame] | 121 | #endif /* SMC_HANDLER_H */ |