Siva Durga Prasad Paladugu | fe4af66 | 2018-09-25 18:44:58 +0530 | [diff] [blame] | 1 | /* |
Michal Simek | 2a47faa | 2023-04-14 08:43:51 +0200 | [diff] [blame] | 2 | * Copyright (c) 2018-2021, Arm Limited and Contributors. All rights reserved. |
Prasad Kummari | 7d0623a | 2023-06-09 14:32:00 +0530 | [diff] [blame] | 3 | * Copyright (c) 2022-2023, Advanced Micro Devices, Inc. All rights reserved. |
Siva Durga Prasad Paladugu | fe4af66 | 2018-09-25 18:44:58 +0530 | [diff] [blame] | 4 | * |
| 5 | * SPDX-License-Identifier: BSD-3-Clause |
| 6 | */ |
| 7 | |
Tejas Patel | 54d1319 | 2019-02-27 18:44:55 +0530 | [diff] [blame] | 8 | #include <assert.h> |
Prasad Kummari | 536e110 | 2023-06-22 10:50:02 +0530 | [diff] [blame] | 9 | |
Antonio Nino Diaz | e0f9063 | 2018-12-14 00:18:21 +0000 | [diff] [blame] | 10 | #include <common/debug.h> |
| 11 | #include <lib/mmio.h> |
| 12 | #include <lib/psci/psci.h> |
Saeed Nowshadi | c5a1bda | 2019-12-08 23:35:35 -0800 | [diff] [blame] | 13 | #include <plat/arm/common/plat_arm.h> |
Prasad Kummari | 536e110 | 2023-06-22 10:50:02 +0530 | [diff] [blame] | 14 | #include <plat/common/platform.h> |
| 15 | #include <plat_arm.h> |
Antonio Nino Diaz | e0f9063 | 2018-12-14 00:18:21 +0000 | [diff] [blame] | 16 | |
Jay Buddhabhatti | 10e71e4 | 2023-06-19 05:08:54 -0700 | [diff] [blame] | 17 | #include "drivers/delay_timer.h" |
Prasad Kummari | 536e110 | 2023-06-22 10:50:02 +0530 | [diff] [blame] | 18 | #include <plat_private.h> |
Tejas Patel | 6171711 | 2019-02-27 18:44:57 +0530 | [diff] [blame] | 19 | #include "pm_api_sys.h" |
| 20 | #include "pm_client.h" |
Prasad Kummari | 536e110 | 2023-06-22 10:50:02 +0530 | [diff] [blame] | 21 | #include <pm_common.h> |
Jay Buddhabhatti | 10e71e4 | 2023-06-19 05:08:54 -0700 | [diff] [blame] | 22 | #include "pm_ipi.h" |
| 23 | #include "pm_svc_main.h" |
Tejas Patel | 6171711 | 2019-02-27 18:44:57 +0530 | [diff] [blame] | 24 | |
Siva Durga Prasad Paladugu | fe4af66 | 2018-09-25 18:44:58 +0530 | [diff] [blame] | 25 | static uintptr_t versal_sec_entry; |
| 26 | |
Venkatesh Yadav Abbarapu | bde8759 | 2022-05-24 11:11:12 +0530 | [diff] [blame] | 27 | static int32_t versal_pwr_domain_on(u_register_t mpidr) |
Siva Durga Prasad Paladugu | fe4af66 | 2018-09-25 18:44:58 +0530 | [diff] [blame] | 28 | { |
Venkatesh Yadav Abbarapu | bde8759 | 2022-05-24 11:11:12 +0530 | [diff] [blame] | 29 | int32_t cpu_id = plat_core_pos_by_mpidr(mpidr); |
Tejas Patel | 6171711 | 2019-02-27 18:44:57 +0530 | [diff] [blame] | 30 | const struct pm_proc *proc; |
Siva Durga Prasad Paladugu | fe4af66 | 2018-09-25 18:44:58 +0530 | [diff] [blame] | 31 | |
| 32 | VERBOSE("%s: mpidr: 0x%lx\n", __func__, mpidr); |
| 33 | |
Abhyuday Godhasara | f55a5cd | 2021-08-09 08:15:13 -0700 | [diff] [blame] | 34 | if (cpu_id == -1) { |
Siva Durga Prasad Paladugu | fe4af66 | 2018-09-25 18:44:58 +0530 | [diff] [blame] | 35 | return PSCI_E_INTERN_FAIL; |
Abhyuday Godhasara | f55a5cd | 2021-08-09 08:15:13 -0700 | [diff] [blame] | 36 | } |
Siva Durga Prasad Paladugu | fe4af66 | 2018-09-25 18:44:58 +0530 | [diff] [blame] | 37 | |
Venkatesh Yadav Abbarapu | bde8759 | 2022-05-24 11:11:12 +0530 | [diff] [blame] | 38 | proc = pm_get_proc((uint32_t)cpu_id); |
Siva Durga Prasad Paladugu | fe4af66 | 2018-09-25 18:44:58 +0530 | [diff] [blame] | 39 | |
Tejas Patel | 6171711 | 2019-02-27 18:44:57 +0530 | [diff] [blame] | 40 | /* Send request to PMC to wake up selected ACPU core */ |
Abhyuday Godhasara | f435a14 | 2021-08-20 00:04:33 -0700 | [diff] [blame] | 41 | (void)pm_req_wakeup(proc->node_id, (versal_sec_entry & 0xFFFFFFFFU) | 0x1U, |
| 42 | versal_sec_entry >> 32, 0, SECURE_FLAG); |
Siva Durga Prasad Paladugu | fe4af66 | 2018-09-25 18:44:58 +0530 | [diff] [blame] | 43 | |
Tejas Patel | 6171711 | 2019-02-27 18:44:57 +0530 | [diff] [blame] | 44 | /* Clear power down request */ |
| 45 | pm_client_wakeup(proc); |
Siva Durga Prasad Paladugu | fe4af66 | 2018-09-25 18:44:58 +0530 | [diff] [blame] | 46 | |
| 47 | return PSCI_E_SUCCESS; |
| 48 | } |
| 49 | |
Tejas Patel | 54d1319 | 2019-02-27 18:44:55 +0530 | [diff] [blame] | 50 | /** |
| 51 | * versal_pwr_domain_suspend() - This function sends request to PMC to suspend |
Prasad Kummari | 7d0623a | 2023-06-09 14:32:00 +0530 | [diff] [blame] | 52 | * core. |
| 53 | * @target_state: Targated state. |
Tejas Patel | 54d1319 | 2019-02-27 18:44:55 +0530 | [diff] [blame] | 54 | * |
Tejas Patel | 54d1319 | 2019-02-27 18:44:55 +0530 | [diff] [blame] | 55 | */ |
| 56 | static void versal_pwr_domain_suspend(const psci_power_state_t *target_state) |
| 57 | { |
Venkatesh Yadav Abbarapu | bde8759 | 2022-05-24 11:11:12 +0530 | [diff] [blame] | 58 | uint32_t state; |
| 59 | uint32_t cpu_id = plat_my_core_pos(); |
Tejas Patel | 54d1319 | 2019-02-27 18:44:55 +0530 | [diff] [blame] | 60 | const struct pm_proc *proc = pm_get_proc(cpu_id); |
| 61 | |
Abhyuday Godhasara | 589afa5 | 2021-08-11 06:15:13 -0700 | [diff] [blame] | 62 | for (size_t i = 0U; i <= PLAT_MAX_PWR_LVL; i++) { |
Tejas Patel | 54d1319 | 2019-02-27 18:44:55 +0530 | [diff] [blame] | 63 | VERBOSE("%s: target_state->pwr_domain_state[%lu]=%x\n", |
| 64 | __func__, i, target_state->pwr_domain_state[i]); |
Abhyuday Godhasara | f55a5cd | 2021-08-09 08:15:13 -0700 | [diff] [blame] | 65 | } |
Tejas Patel | 54d1319 | 2019-02-27 18:44:55 +0530 | [diff] [blame] | 66 | |
| 67 | plat_versal_gic_cpuif_disable(); |
| 68 | |
Ravi Patel | eafc878 | 2019-06-21 05:00:49 -0700 | [diff] [blame] | 69 | if (target_state->pwr_domain_state[1] > PLAT_MAX_RET_STATE) { |
| 70 | plat_versal_gic_save(); |
| 71 | } |
Tejas Patel | 54d1319 | 2019-02-27 18:44:55 +0530 | [diff] [blame] | 72 | |
| 73 | state = target_state->pwr_domain_state[1] > PLAT_MAX_RET_STATE ? |
| 74 | PM_STATE_SUSPEND_TO_RAM : PM_STATE_CPU_IDLE; |
| 75 | |
| 76 | /* Send request to PMC to suspend this core */ |
Abhyuday Godhasara | f435a14 | 2021-08-20 00:04:33 -0700 | [diff] [blame] | 77 | (void)pm_self_suspend(proc->node_id, MAX_LATENCY, state, versal_sec_entry, |
| 78 | SECURE_FLAG); |
Tejas Patel | 54d1319 | 2019-02-27 18:44:55 +0530 | [diff] [blame] | 79 | |
| 80 | /* APU is to be turned off */ |
| 81 | if (target_state->pwr_domain_state[1] > PLAT_MAX_RET_STATE) { |
| 82 | /* disable coherency */ |
| 83 | plat_arm_interconnect_exit_coherency(); |
| 84 | } |
| 85 | } |
| 86 | |
| 87 | /** |
| 88 | * versal_pwr_domain_suspend_finish() - This function performs actions to finish |
Prasad Kummari | 7d0623a | 2023-06-09 14:32:00 +0530 | [diff] [blame] | 89 | * suspend procedure. |
| 90 | * @target_state: Targated state. |
Tejas Patel | 54d1319 | 2019-02-27 18:44:55 +0530 | [diff] [blame] | 91 | * |
Tejas Patel | 54d1319 | 2019-02-27 18:44:55 +0530 | [diff] [blame] | 92 | */ |
| 93 | static void versal_pwr_domain_suspend_finish( |
| 94 | const psci_power_state_t *target_state) |
| 95 | { |
Venkatesh Yadav Abbarapu | bde8759 | 2022-05-24 11:11:12 +0530 | [diff] [blame] | 96 | uint32_t cpu_id = plat_my_core_pos(); |
Tejas Patel | 54d1319 | 2019-02-27 18:44:55 +0530 | [diff] [blame] | 97 | const struct pm_proc *proc = pm_get_proc(cpu_id); |
| 98 | |
Abhyuday Godhasara | 589afa5 | 2021-08-11 06:15:13 -0700 | [diff] [blame] | 99 | for (size_t i = 0U; i <= PLAT_MAX_PWR_LVL; i++) { |
Tejas Patel | 54d1319 | 2019-02-27 18:44:55 +0530 | [diff] [blame] | 100 | VERBOSE("%s: target_state->pwr_domain_state[%lu]=%x\n", |
| 101 | __func__, i, target_state->pwr_domain_state[i]); |
Abhyuday Godhasara | f55a5cd | 2021-08-09 08:15:13 -0700 | [diff] [blame] | 102 | } |
Tejas Patel | 54d1319 | 2019-02-27 18:44:55 +0530 | [diff] [blame] | 103 | |
| 104 | /* Clear the APU power control register for this cpu */ |
| 105 | pm_client_wakeup(proc); |
| 106 | |
| 107 | /* enable coherency */ |
| 108 | plat_arm_interconnect_enter_coherency(); |
| 109 | |
| 110 | /* APU was turned off, so restore GIC context */ |
| 111 | if (target_state->pwr_domain_state[1] > PLAT_MAX_RET_STATE) { |
| 112 | plat_versal_gic_resume(); |
Tejas Patel | 54d1319 | 2019-02-27 18:44:55 +0530 | [diff] [blame] | 113 | } |
Ravi Patel | eafc878 | 2019-06-21 05:00:49 -0700 | [diff] [blame] | 114 | |
| 115 | plat_versal_gic_cpuif_enable(); |
Tejas Patel | 54d1319 | 2019-02-27 18:44:55 +0530 | [diff] [blame] | 116 | } |
| 117 | |
Siva Durga Prasad Paladugu | fe4af66 | 2018-09-25 18:44:58 +0530 | [diff] [blame] | 118 | void versal_pwr_domain_on_finish(const psci_power_state_t *target_state) |
| 119 | { |
| 120 | /* Enable the gic cpu interface */ |
| 121 | plat_versal_gic_pcpu_init(); |
| 122 | |
| 123 | /* Program the gic per-cpu distributor or re-distributor interface */ |
| 124 | plat_versal_gic_cpuif_enable(); |
| 125 | } |
| 126 | |
Tejas Patel | 54d1319 | 2019-02-27 18:44:55 +0530 | [diff] [blame] | 127 | /** |
Prasad Kummari | 7d0623a | 2023-06-09 14:32:00 +0530 | [diff] [blame] | 128 | * versal_system_off() - This function sends the system off request to firmware. |
| 129 | * This function does not return. |
| 130 | * |
Saeed Nowshadi | c5a1bda | 2019-12-08 23:35:35 -0800 | [diff] [blame] | 131 | */ |
| 132 | static void __dead2 versal_system_off(void) |
| 133 | { |
| 134 | /* Send the power down request to the PMC */ |
Abhyuday Godhasara | f435a14 | 2021-08-20 00:04:33 -0700 | [diff] [blame] | 135 | (void)pm_system_shutdown(XPM_SHUTDOWN_TYPE_SHUTDOWN, |
| 136 | pm_get_shutdown_scope(), SECURE_FLAG); |
Saeed Nowshadi | c5a1bda | 2019-12-08 23:35:35 -0800 | [diff] [blame] | 137 | |
Abhyuday Godhasara | f55a5cd | 2021-08-09 08:15:13 -0700 | [diff] [blame] | 138 | while (1) { |
Saeed Nowshadi | c5a1bda | 2019-12-08 23:35:35 -0800 | [diff] [blame] | 139 | wfi(); |
Abhyuday Godhasara | f55a5cd | 2021-08-09 08:15:13 -0700 | [diff] [blame] | 140 | } |
Saeed Nowshadi | c5a1bda | 2019-12-08 23:35:35 -0800 | [diff] [blame] | 141 | } |
| 142 | |
| 143 | /** |
Prasad Kummari | 7d0623a | 2023-06-09 14:32:00 +0530 | [diff] [blame] | 144 | * versal_system_reset() - This function sends the reset request to firmware |
| 145 | * for the system to reset. This function does not |
| 146 | * return. |
| 147 | * |
Saeed Nowshadi | c5a1bda | 2019-12-08 23:35:35 -0800 | [diff] [blame] | 148 | */ |
| 149 | static void __dead2 versal_system_reset(void) |
| 150 | { |
Jay Buddhabhatti | 10e71e4 | 2023-06-19 05:08:54 -0700 | [diff] [blame] | 151 | uint32_t ret, timeout = 10000U; |
| 152 | |
| 153 | request_cpu_pwrdwn(); |
| 154 | |
| 155 | /* |
| 156 | * Send the system reset request to the firmware if power down request |
| 157 | * is not received from firmware. |
| 158 | */ |
| 159 | if (!pwrdwn_req_received) { |
| 160 | (void)pm_system_shutdown(XPM_SHUTDOWN_TYPE_RESET, |
| 161 | pm_get_shutdown_scope(), SECURE_FLAG); |
| 162 | |
| 163 | /* |
| 164 | * Wait for system shutdown request completed and idle callback |
| 165 | * not received. |
| 166 | */ |
| 167 | do { |
| 168 | ret = ipi_mb_enquire_status(primary_proc->ipi->local_ipi_id, |
| 169 | primary_proc->ipi->remote_ipi_id); |
| 170 | udelay(100); |
| 171 | timeout--; |
| 172 | } while ((ret != IPI_MB_STATUS_RECV_PENDING) && (timeout > 0U)); |
| 173 | } |
| 174 | |
| 175 | (void)psci_cpu_off(); |
Saeed Nowshadi | c5a1bda | 2019-12-08 23:35:35 -0800 | [diff] [blame] | 176 | |
Abhyuday Godhasara | f55a5cd | 2021-08-09 08:15:13 -0700 | [diff] [blame] | 177 | while (1) { |
Saeed Nowshadi | c5a1bda | 2019-12-08 23:35:35 -0800 | [diff] [blame] | 178 | wfi(); |
Abhyuday Godhasara | f55a5cd | 2021-08-09 08:15:13 -0700 | [diff] [blame] | 179 | } |
Saeed Nowshadi | c5a1bda | 2019-12-08 23:35:35 -0800 | [diff] [blame] | 180 | } |
| 181 | |
| 182 | /** |
Prasad Kummari | 7d0623a | 2023-06-09 14:32:00 +0530 | [diff] [blame] | 183 | * versal_pwr_domain_off() - This function performs actions to turn off core. |
| 184 | * @target_state: Targated state. |
Tejas Patel | 54d1319 | 2019-02-27 18:44:55 +0530 | [diff] [blame] | 185 | * |
Tejas Patel | 54d1319 | 2019-02-27 18:44:55 +0530 | [diff] [blame] | 186 | */ |
| 187 | static void versal_pwr_domain_off(const psci_power_state_t *target_state) |
| 188 | { |
Jay Buddhabhatti | 31488a3 | 2023-09-11 23:50:06 -0700 | [diff] [blame] | 189 | uint32_t ret, fw_api_version, version[PAYLOAD_ARG_CNT] = {0U}; |
Venkatesh Yadav Abbarapu | bde8759 | 2022-05-24 11:11:12 +0530 | [diff] [blame] | 190 | uint32_t cpu_id = plat_my_core_pos(); |
Tejas Patel | 54d1319 | 2019-02-27 18:44:55 +0530 | [diff] [blame] | 191 | const struct pm_proc *proc = pm_get_proc(cpu_id); |
| 192 | |
Abhyuday Godhasara | 589afa5 | 2021-08-11 06:15:13 -0700 | [diff] [blame] | 193 | for (size_t i = 0U; i <= PLAT_MAX_PWR_LVL; i++) { |
Tejas Patel | 54d1319 | 2019-02-27 18:44:55 +0530 | [diff] [blame] | 194 | VERBOSE("%s: target_state->pwr_domain_state[%lu]=%x\n", |
| 195 | __func__, i, target_state->pwr_domain_state[i]); |
Abhyuday Godhasara | f55a5cd | 2021-08-09 08:15:13 -0700 | [diff] [blame] | 196 | } |
Tejas Patel | 54d1319 | 2019-02-27 18:44:55 +0530 | [diff] [blame] | 197 | |
| 198 | /* Prevent interrupts from spuriously waking up this cpu */ |
| 199 | plat_versal_gic_cpuif_disable(); |
| 200 | |
| 201 | /* |
| 202 | * Send request to PMC to power down the appropriate APU CPU |
| 203 | * core. |
| 204 | * According to PSCI specification, CPU_off function does not |
| 205 | * have resume address and CPU core can only be woken up |
| 206 | * invoking CPU_on function, during which resume address will |
| 207 | * be set. |
| 208 | */ |
Jay Buddhabhatti | 31488a3 | 2023-09-11 23:50:06 -0700 | [diff] [blame] | 209 | ret = pm_feature_check((uint32_t)PM_SELF_SUSPEND, &version[0], SECURE_FLAG); |
| 210 | if (ret == PM_RET_SUCCESS) { |
| 211 | fw_api_version = version[0] & 0xFFFFU; |
| 212 | if (fw_api_version >= 3U) { |
| 213 | (void)pm_self_suspend(proc->node_id, MAX_LATENCY, PM_STATE_CPU_OFF, 0, |
| 214 | SECURE_FLAG); |
| 215 | } else { |
| 216 | (void)pm_self_suspend(proc->node_id, MAX_LATENCY, PM_STATE_CPU_IDLE, 0, |
| 217 | SECURE_FLAG); |
| 218 | } |
| 219 | } |
Tejas Patel | 54d1319 | 2019-02-27 18:44:55 +0530 | [diff] [blame] | 220 | } |
| 221 | |
| 222 | /** |
| 223 | * versal_validate_power_state() - This function ensures that the power state |
Prasad Kummari | 7d0623a | 2023-06-09 14:32:00 +0530 | [diff] [blame] | 224 | * parameter in request is valid. |
| 225 | * @power_state: Power state of core. |
| 226 | * @req_state: Requested state. |
Tejas Patel | 54d1319 | 2019-02-27 18:44:55 +0530 | [diff] [blame] | 227 | * |
Prasad Kummari | 7d0623a | 2023-06-09 14:32:00 +0530 | [diff] [blame] | 228 | * Return: Returns status, either success or reason. |
Tejas Patel | 54d1319 | 2019-02-27 18:44:55 +0530 | [diff] [blame] | 229 | * |
Tejas Patel | 54d1319 | 2019-02-27 18:44:55 +0530 | [diff] [blame] | 230 | */ |
Venkatesh Yadav Abbarapu | bde8759 | 2022-05-24 11:11:12 +0530 | [diff] [blame] | 231 | static int32_t versal_validate_power_state(uint32_t power_state, |
Tejas Patel | 54d1319 | 2019-02-27 18:44:55 +0530 | [diff] [blame] | 232 | psci_power_state_t *req_state) |
| 233 | { |
| 234 | VERBOSE("%s: power_state: 0x%x\n", __func__, power_state); |
| 235 | |
Venkatesh Yadav Abbarapu | bde8759 | 2022-05-24 11:11:12 +0530 | [diff] [blame] | 236 | uint32_t pstate = psci_get_pstate_type(power_state); |
Tejas Patel | 54d1319 | 2019-02-27 18:44:55 +0530 | [diff] [blame] | 237 | |
| 238 | assert(req_state); |
| 239 | |
| 240 | /* Sanity check the requested state */ |
Abhyuday Godhasara | f55a5cd | 2021-08-09 08:15:13 -0700 | [diff] [blame] | 241 | if (pstate == PSTATE_TYPE_STANDBY) { |
Tejas Patel | 54d1319 | 2019-02-27 18:44:55 +0530 | [diff] [blame] | 242 | req_state->pwr_domain_state[MPIDR_AFFLVL0] = PLAT_MAX_RET_STATE; |
Abhyuday Godhasara | f55a5cd | 2021-08-09 08:15:13 -0700 | [diff] [blame] | 243 | } else { |
Tejas Patel | 54d1319 | 2019-02-27 18:44:55 +0530 | [diff] [blame] | 244 | req_state->pwr_domain_state[MPIDR_AFFLVL0] = PLAT_MAX_OFF_STATE; |
Abhyuday Godhasara | f55a5cd | 2021-08-09 08:15:13 -0700 | [diff] [blame] | 245 | } |
Tejas Patel | 54d1319 | 2019-02-27 18:44:55 +0530 | [diff] [blame] | 246 | |
| 247 | /* We expect the 'state id' to be zero */ |
Abhyuday Godhasara | bacbdee | 2021-08-20 00:27:03 -0700 | [diff] [blame] | 248 | if (psci_get_pstate_id(power_state) != 0U) { |
Tejas Patel | 54d1319 | 2019-02-27 18:44:55 +0530 | [diff] [blame] | 249 | return PSCI_E_INVALID_PARAMS; |
Abhyuday Godhasara | f55a5cd | 2021-08-09 08:15:13 -0700 | [diff] [blame] | 250 | } |
Tejas Patel | 54d1319 | 2019-02-27 18:44:55 +0530 | [diff] [blame] | 251 | |
| 252 | return PSCI_E_SUCCESS; |
| 253 | } |
| 254 | |
| 255 | /** |
Prasad Kummari | 7d0623a | 2023-06-09 14:32:00 +0530 | [diff] [blame] | 256 | * versal_get_sys_suspend_power_state() - Get power state for system suspend. |
| 257 | * @req_state: Requested state. |
Tejas Patel | 54d1319 | 2019-02-27 18:44:55 +0530 | [diff] [blame] | 258 | * |
Tejas Patel | 54d1319 | 2019-02-27 18:44:55 +0530 | [diff] [blame] | 259 | */ |
| 260 | static void versal_get_sys_suspend_power_state(psci_power_state_t *req_state) |
| 261 | { |
| 262 | req_state->pwr_domain_state[PSCI_CPU_PWR_LVL] = PLAT_MAX_OFF_STATE; |
| 263 | req_state->pwr_domain_state[1] = PLAT_MAX_OFF_STATE; |
| 264 | } |
| 265 | |
Siva Durga Prasad Paladugu | fe4af66 | 2018-09-25 18:44:58 +0530 | [diff] [blame] | 266 | static const struct plat_psci_ops versal_nopmc_psci_ops = { |
Tejas Patel | 6171711 | 2019-02-27 18:44:57 +0530 | [diff] [blame] | 267 | .pwr_domain_on = versal_pwr_domain_on, |
Tejas Patel | 54d1319 | 2019-02-27 18:44:55 +0530 | [diff] [blame] | 268 | .pwr_domain_off = versal_pwr_domain_off, |
Siva Durga Prasad Paladugu | fe4af66 | 2018-09-25 18:44:58 +0530 | [diff] [blame] | 269 | .pwr_domain_on_finish = versal_pwr_domain_on_finish, |
Tejas Patel | 54d1319 | 2019-02-27 18:44:55 +0530 | [diff] [blame] | 270 | .pwr_domain_suspend = versal_pwr_domain_suspend, |
| 271 | .pwr_domain_suspend_finish = versal_pwr_domain_suspend_finish, |
Saeed Nowshadi | c5a1bda | 2019-12-08 23:35:35 -0800 | [diff] [blame] | 272 | .system_off = versal_system_off, |
| 273 | .system_reset = versal_system_reset, |
Tejas Patel | 54d1319 | 2019-02-27 18:44:55 +0530 | [diff] [blame] | 274 | .validate_power_state = versal_validate_power_state, |
| 275 | .get_sys_suspend_power_state = versal_get_sys_suspend_power_state, |
Siva Durga Prasad Paladugu | fe4af66 | 2018-09-25 18:44:58 +0530 | [diff] [blame] | 276 | }; |
| 277 | |
| 278 | /******************************************************************************* |
| 279 | * Export the platform specific power ops. |
| 280 | ******************************************************************************/ |
Venkatesh Yadav Abbarapu | 2cefbcd | 2022-07-31 14:05:40 +0530 | [diff] [blame] | 281 | int32_t plat_setup_psci_ops(uintptr_t sec_entrypoint, |
Siva Durga Prasad Paladugu | fe4af66 | 2018-09-25 18:44:58 +0530 | [diff] [blame] | 282 | const struct plat_psci_ops **psci_ops) |
| 283 | { |
| 284 | versal_sec_entry = sec_entrypoint; |
| 285 | |
| 286 | *psci_ops = &versal_nopmc_psci_ops; |
| 287 | |
| 288 | return 0; |
| 289 | } |