Hadi Asyrafi | 616da77 | 2019-06-27 11:34:03 +0800 | [diff] [blame] | 1 | /* |
Jit Loon Lim | 86f6fb3 | 2023-05-17 12:26:11 +0800 | [diff] [blame] | 2 | * Copyright (c) 2019-2023, ARM Limited and Contributors. All rights reserved. |
Jit Loon Lim | b24dddf | 2023-05-17 12:26:11 +0800 | [diff] [blame] | 3 | * Copyright (c) 2019-2023, Intel Corporation. All rights reserved. |
Sieu Mun Tang | ebca515 | 2024-08-26 07:59:10 +0800 | [diff] [blame] | 4 | * Copyright (c) 2024, Altera Corporation. All rights reserved. |
Hadi Asyrafi | 616da77 | 2019-06-27 11:34:03 +0800 | [diff] [blame] | 5 | * |
| 6 | * SPDX-License-Identifier: BSD-3-Clause |
| 7 | */ |
| 8 | |
| 9 | #include <arch_helpers.h> |
| 10 | #include <common/debug.h> |
Jit Loon Lim | b24dddf | 2023-05-17 12:26:11 +0800 | [diff] [blame] | 11 | |
| 12 | #ifndef GICV3_SUPPORT_GIC600 |
Hadi Asyrafi | 616da77 | 2019-06-27 11:34:03 +0800 | [diff] [blame] | 13 | #include <drivers/arm/gicv2.h> |
Jit Loon Lim | 86f6fb3 | 2023-05-17 12:26:11 +0800 | [diff] [blame] | 14 | #else |
| 15 | #include <drivers/arm/gicv3.h> |
| 16 | #endif |
Hadi Asyrafi | 616da77 | 2019-06-27 11:34:03 +0800 | [diff] [blame] | 17 | #include <lib/mmio.h> |
| 18 | #include <lib/psci/psci.h> |
| 19 | #include <plat/common/platform.h> |
Sieu Mun Tang | 82254ee | 2024-10-22 00:52:09 +0800 | [diff] [blame] | 20 | #if PLATFORM_MODEL == PLAT_SOCFPGA_AGILEX5 |
| 21 | #include "agilex5_cache.h" |
| 22 | #endif |
Sieu Mun Tang | 9dd2c18 | 2024-10-22 01:00:45 +0800 | [diff] [blame] | 23 | #include "ccu/ncore_ccu.h" |
Hadi Asyrafi | 6f8a2b2 | 2019-10-23 18:34:14 +0800 | [diff] [blame] | 24 | #include "socfpga_mailbox.h" |
Hadi Asyrafi | 4d9f395 | 2019-10-23 17:35:32 +0800 | [diff] [blame] | 25 | #include "socfpga_plat_def.h" |
Sieu Mun Tang | 9dd2c18 | 2024-10-22 01:00:45 +0800 | [diff] [blame] | 26 | #include "socfpga_private.h" |
Hadi Asyrafi | 5fae68f | 2019-10-22 14:23:57 +0800 | [diff] [blame] | 27 | #include "socfpga_reset_manager.h" |
Sieu Mun Tang | dbcc2cf | 2022-03-07 12:13:04 +0800 | [diff] [blame] | 28 | #include "socfpga_sip_svc.h" |
Jit Loon Lim | 86f6fb3 | 2023-05-17 12:26:11 +0800 | [diff] [blame] | 29 | #include "socfpga_system_manager.h" |
Hadi Asyrafi | 616da77 | 2019-06-27 11:34:03 +0800 | [diff] [blame] | 30 | |
Jit Loon Lim | b24dddf | 2023-05-17 12:26:11 +0800 | [diff] [blame] | 31 | #if PLATFORM_MODEL == PLAT_SOCFPGA_AGILEX5 |
| 32 | void socfpga_wakeup_secondary_cpu(unsigned int cpu_id); |
| 33 | extern void plat_secondary_cold_boot_setup(void); |
| 34 | #endif |
Hadi Asyrafi | 616da77 | 2019-06-27 11:34:03 +0800 | [diff] [blame] | 35 | |
Hadi Asyrafi | 616da77 | 2019-06-27 11:34:03 +0800 | [diff] [blame] | 36 | /******************************************************************************* |
| 37 | * plat handler called when a CPU is about to enter standby. |
| 38 | ******************************************************************************/ |
| 39 | void socfpga_cpu_standby(plat_local_state_t cpu_state) |
| 40 | { |
| 41 | /* |
| 42 | * Enter standby state |
| 43 | * dsb is good practice before using wfi to enter low power states |
| 44 | */ |
| 45 | VERBOSE("%s: cpu_state: 0x%x\n", __func__, cpu_state); |
| 46 | dsb(); |
| 47 | wfi(); |
| 48 | } |
| 49 | |
| 50 | /******************************************************************************* |
| 51 | * plat handler called when a power domain is about to be turned on. The |
| 52 | * mpidr determines the CPU to be turned on. |
| 53 | ******************************************************************************/ |
| 54 | int socfpga_pwr_domain_on(u_register_t mpidr) |
| 55 | { |
| 56 | unsigned int cpu_id = plat_core_pos_by_mpidr(mpidr); |
Jit Loon Lim | b24dddf | 2023-05-17 12:26:11 +0800 | [diff] [blame] | 57 | #if PLATFORM_MODEL == PLAT_SOCFPGA_AGILEX5 |
| 58 | /* TODO: Add in CPU FUSE from SDM */ |
| 59 | #else |
Jit Loon Lim | 44c61fc | 2023-03-02 13:38:53 +0800 | [diff] [blame] | 60 | uint32_t psci_boot = 0x00; |
Hadi Asyrafi | 616da77 | 2019-06-27 11:34:03 +0800 | [diff] [blame] | 61 | |
| 62 | VERBOSE("%s: mpidr: 0x%lx\n", __func__, mpidr); |
Jit Loon Lim | b24dddf | 2023-05-17 12:26:11 +0800 | [diff] [blame] | 63 | #endif |
Hadi Asyrafi | 616da77 | 2019-06-27 11:34:03 +0800 | [diff] [blame] | 64 | |
| 65 | if (cpu_id == -1) |
| 66 | return PSCI_E_INTERN_FAIL; |
| 67 | |
Jit Loon Lim | b24dddf | 2023-05-17 12:26:11 +0800 | [diff] [blame] | 68 | #if PLATFORM_MODEL != PLAT_SOCFPGA_AGILEX5 |
Jit Loon Lim | 44c61fc | 2023-03-02 13:38:53 +0800 | [diff] [blame] | 69 | if (cpu_id == 0x00) { |
| 70 | psci_boot = mmio_read_32(SOCFPGA_SYSMGR(BOOT_SCRATCH_COLD_8)); |
Jit Loon Lim | 9da7620 | 2023-06-10 00:04:49 +0800 | [diff] [blame] | 71 | psci_boot |= 0x80000; /* bit 19 */ |
Jit Loon Lim | 44c61fc | 2023-03-02 13:38:53 +0800 | [diff] [blame] | 72 | mmio_write_32(SOCFPGA_SYSMGR(BOOT_SCRATCH_COLD_8), psci_boot); |
| 73 | } |
| 74 | |
Hadi Asyrafi | a2edf0e | 2019-10-22 13:39:14 +0800 | [diff] [blame] | 75 | mmio_write_64(PLAT_CPUID_RELEASE, cpu_id); |
Jit Loon Lim | b24dddf | 2023-05-17 12:26:11 +0800 | [diff] [blame] | 76 | #endif |
Hadi Asyrafi | 616da77 | 2019-06-27 11:34:03 +0800 | [diff] [blame] | 77 | |
| 78 | /* release core reset */ |
Jit Loon Lim | b24dddf | 2023-05-17 12:26:11 +0800 | [diff] [blame] | 79 | #if PLATFORM_MODEL == PLAT_SOCFPGA_AGILEX5 |
| 80 | bl31_plat_set_secondary_cpu_entrypoint(cpu_id); |
| 81 | #else |
Hadi Asyrafi | 67cb0ea | 2019-12-23 13:25:33 +0800 | [diff] [blame] | 82 | mmio_setbits_32(SOCFPGA_RSTMGR(MPUMODRST), 1 << cpu_id); |
Jit Loon Lim | b24dddf | 2023-05-17 12:26:11 +0800 | [diff] [blame] | 83 | mmio_write_64(PLAT_CPUID_RELEASE, cpu_id); |
| 84 | #endif |
| 85 | |
Hadi Asyrafi | 616da77 | 2019-06-27 11:34:03 +0800 | [diff] [blame] | 86 | return PSCI_E_SUCCESS; |
| 87 | } |
| 88 | |
| 89 | /******************************************************************************* |
| 90 | * plat handler called when a power domain is about to be turned off. The |
| 91 | * target_state encodes the power state that each level should transition to. |
| 92 | ******************************************************************************/ |
| 93 | void socfpga_pwr_domain_off(const psci_power_state_t *target_state) |
| 94 | { |
Hadi Asyrafi | 616da77 | 2019-06-27 11:34:03 +0800 | [diff] [blame] | 95 | for (size_t i = 0; i <= PLAT_MAX_PWR_LVL; i++) |
| 96 | VERBOSE("%s: target_state->pwr_domain_state[%lu]=%x\n", |
| 97 | __func__, i, target_state->pwr_domain_state[i]); |
| 98 | |
Hadi Asyrafi | 91071fc | 2019-09-12 15:14:01 +0800 | [diff] [blame] | 99 | /* Prevent interrupts from spuriously waking up this cpu */ |
Jit Loon Lim | b24dddf | 2023-05-17 12:26:11 +0800 | [diff] [blame] | 100 | #ifdef GICV3_SUPPORT_GIC600 |
| 101 | gicv3_cpuif_disable(plat_my_core_pos()); |
| 102 | #else |
Hadi Asyrafi | 91071fc | 2019-09-12 15:14:01 +0800 | [diff] [blame] | 103 | gicv2_cpuif_disable(); |
Jit Loon Lim | b24dddf | 2023-05-17 12:26:11 +0800 | [diff] [blame] | 104 | #endif |
| 105 | |
Hadi Asyrafi | 616da77 | 2019-06-27 11:34:03 +0800 | [diff] [blame] | 106 | } |
| 107 | |
| 108 | /******************************************************************************* |
| 109 | * plat handler called when a power domain is about to be suspended. The |
| 110 | * target_state encodes the power state that each level should transition to. |
| 111 | ******************************************************************************/ |
| 112 | void socfpga_pwr_domain_suspend(const psci_power_state_t *target_state) |
| 113 | { |
Jit Loon Lim | b24dddf | 2023-05-17 12:26:11 +0800 | [diff] [blame] | 114 | #if PLATFORM_MODEL != PLAT_SOCFPGA_AGILEX5 |
Hadi Asyrafi | 616da77 | 2019-06-27 11:34:03 +0800 | [diff] [blame] | 115 | unsigned int cpu_id = plat_my_core_pos(); |
Jit Loon Lim | b24dddf | 2023-05-17 12:26:11 +0800 | [diff] [blame] | 116 | #endif |
Hadi Asyrafi | 616da77 | 2019-06-27 11:34:03 +0800 | [diff] [blame] | 117 | |
| 118 | for (size_t i = 0; i <= PLAT_MAX_PWR_LVL; i++) |
| 119 | VERBOSE("%s: target_state->pwr_domain_state[%lu]=%x\n", |
| 120 | __func__, i, target_state->pwr_domain_state[i]); |
Hadi Asyrafi | 5fae68f | 2019-10-22 14:23:57 +0800 | [diff] [blame] | 121 | |
Jit Loon Lim | b24dddf | 2023-05-17 12:26:11 +0800 | [diff] [blame] | 122 | #if PLATFORM_MODEL != PLAT_SOCFPGA_AGILEX5 |
Hadi Asyrafi | 616da77 | 2019-06-27 11:34:03 +0800 | [diff] [blame] | 123 | /* assert core reset */ |
Hadi Asyrafi | 67cb0ea | 2019-12-23 13:25:33 +0800 | [diff] [blame] | 124 | mmio_setbits_32(SOCFPGA_RSTMGR(MPUMODRST), 1 << cpu_id); |
Jit Loon Lim | b24dddf | 2023-05-17 12:26:11 +0800 | [diff] [blame] | 125 | #endif |
Hadi Asyrafi | 616da77 | 2019-06-27 11:34:03 +0800 | [diff] [blame] | 126 | } |
| 127 | |
| 128 | /******************************************************************************* |
| 129 | * plat handler called when a power domain has just been powered on after |
| 130 | * being turned off earlier. The target_state encodes the low power state that |
| 131 | * each level has woken up from. |
| 132 | ******************************************************************************/ |
| 133 | void socfpga_pwr_domain_on_finish(const psci_power_state_t *target_state) |
| 134 | { |
| 135 | for (size_t i = 0; i <= PLAT_MAX_PWR_LVL; i++) |
| 136 | VERBOSE("%s: target_state->pwr_domain_state[%lu]=%x\n", |
| 137 | __func__, i, target_state->pwr_domain_state[i]); |
| 138 | |
Jit Loon Lim | b24dddf | 2023-05-17 12:26:11 +0800 | [diff] [blame] | 139 | /* Enable the gic cpu interface */ |
| 140 | #ifdef GICV3_SUPPORT_GIC600 |
| 141 | gicv3_rdistif_init(plat_my_core_pos()); |
| 142 | gicv3_cpuif_enable(plat_my_core_pos()); |
| 143 | #else |
Hadi Asyrafi | 616da77 | 2019-06-27 11:34:03 +0800 | [diff] [blame] | 144 | /* Program the gic per-cpu distributor or re-distributor interface */ |
| 145 | gicv2_pcpu_distif_init(); |
| 146 | gicv2_set_pe_target_mask(plat_my_core_pos()); |
| 147 | |
| 148 | /* Enable the gic cpu interface */ |
| 149 | gicv2_cpuif_enable(); |
Jit Loon Lim | b24dddf | 2023-05-17 12:26:11 +0800 | [diff] [blame] | 150 | #endif |
Hadi Asyrafi | 616da77 | 2019-06-27 11:34:03 +0800 | [diff] [blame] | 151 | } |
| 152 | |
| 153 | /******************************************************************************* |
| 154 | * plat handler called when a power domain has just been powered on after |
| 155 | * having been suspended earlier. The target_state encodes the low power state |
| 156 | * that each level has woken up from. |
| 157 | * TODO: At the moment we reuse the on finisher and reinitialize the secure |
| 158 | * context. Need to implement a separate suspend finisher. |
| 159 | ******************************************************************************/ |
| 160 | void socfpga_pwr_domain_suspend_finish(const psci_power_state_t *target_state) |
| 161 | { |
Jit Loon Lim | b24dddf | 2023-05-17 12:26:11 +0800 | [diff] [blame] | 162 | #if PLATFORM_MODEL != PLAT_SOCFPGA_AGILEX5 |
Hadi Asyrafi | 616da77 | 2019-06-27 11:34:03 +0800 | [diff] [blame] | 163 | unsigned int cpu_id = plat_my_core_pos(); |
Jit Loon Lim | b24dddf | 2023-05-17 12:26:11 +0800 | [diff] [blame] | 164 | #endif |
Hadi Asyrafi | 616da77 | 2019-06-27 11:34:03 +0800 | [diff] [blame] | 165 | |
| 166 | for (size_t i = 0; i <= PLAT_MAX_PWR_LVL; i++) |
| 167 | VERBOSE("%s: target_state->pwr_domain_state[%lu]=%x\n", |
| 168 | __func__, i, target_state->pwr_domain_state[i]); |
| 169 | |
Jit Loon Lim | b24dddf | 2023-05-17 12:26:11 +0800 | [diff] [blame] | 170 | #if PLATFORM_MODEL != PLAT_SOCFPGA_AGILEX5 |
Hadi Asyrafi | 616da77 | 2019-06-27 11:34:03 +0800 | [diff] [blame] | 171 | /* release core reset */ |
Hadi Asyrafi | 67cb0ea | 2019-12-23 13:25:33 +0800 | [diff] [blame] | 172 | mmio_clrbits_32(SOCFPGA_RSTMGR(MPUMODRST), 1 << cpu_id); |
Jit Loon Lim | b24dddf | 2023-05-17 12:26:11 +0800 | [diff] [blame] | 173 | #endif |
Hadi Asyrafi | 616da77 | 2019-06-27 11:34:03 +0800 | [diff] [blame] | 174 | } |
| 175 | |
| 176 | /******************************************************************************* |
| 177 | * plat handlers to shutdown/reboot the system |
| 178 | ******************************************************************************/ |
| 179 | static void __dead2 socfpga_system_off(void) |
| 180 | { |
| 181 | wfi(); |
| 182 | ERROR("System Off: operation not handled.\n"); |
| 183 | panic(); |
| 184 | } |
| 185 | |
Hadi Asyrafi | 593c4c5 | 2019-12-17 19:22:17 +0800 | [diff] [blame] | 186 | extern uint64_t intel_rsu_update_address; |
| 187 | |
Hadi Asyrafi | 616da77 | 2019-06-27 11:34:03 +0800 | [diff] [blame] | 188 | static void __dead2 socfpga_system_reset(void) |
| 189 | { |
Abdul Halim, Muhammad Hadi Asyrafi | d84bfef | 2020-02-25 16:28:10 +0800 | [diff] [blame] | 190 | uint32_t addr_buf[2]; |
| 191 | |
Sieu Mun Tang | ebca515 | 2024-08-26 07:59:10 +0800 | [diff] [blame] | 192 | memcpy_s(addr_buf, sizeof(intel_rsu_update_address), |
| 193 | &intel_rsu_update_address, sizeof(intel_rsu_update_address)); |
| 194 | |
Jit Loon Lim | 86f6fb3 | 2023-05-17 12:26:11 +0800 | [diff] [blame] | 195 | if (intel_rsu_update_address) { |
Abdul Halim, Muhammad Hadi Asyrafi | d84bfef | 2020-02-25 16:28:10 +0800 | [diff] [blame] | 196 | mailbox_rsu_update(addr_buf); |
Jit Loon Lim | 86f6fb3 | 2023-05-17 12:26:11 +0800 | [diff] [blame] | 197 | } else { |
Sieu Mun Tang | 9dd2c18 | 2024-10-22 01:00:45 +0800 | [diff] [blame] | 198 | #if CACHE_FLUSH |
| 199 | /* ATF Flush and Invalidate Cache */ |
| 200 | dcsw_op_all(DCCISW); |
| 201 | invalidate_cache_low_el(); |
| 202 | #if PLATFORM_MODEL == PLAT_SOCFPGA_AGILEX5 |
| 203 | flush_l3_dcache(); |
| 204 | #endif |
| 205 | #endif |
Hadi Asyrafi | 593c4c5 | 2019-12-17 19:22:17 +0800 | [diff] [blame] | 206 | mailbox_reset_cold(); |
Jit Loon Lim | 86f6fb3 | 2023-05-17 12:26:11 +0800 | [diff] [blame] | 207 | } |
Hadi Asyrafi | 616da77 | 2019-06-27 11:34:03 +0800 | [diff] [blame] | 208 | |
| 209 | while (1) |
| 210 | wfi(); |
| 211 | } |
| 212 | |
Hadi Asyrafi | 5fae68f | 2019-10-22 14:23:57 +0800 | [diff] [blame] | 213 | static int socfpga_system_reset2(int is_vendor, int reset_type, |
| 214 | u_register_t cookie) |
| 215 | { |
Jit Loon Lim | b24dddf | 2023-05-17 12:26:11 +0800 | [diff] [blame] | 216 | #if PLATFORM_MODEL == PLAT_SOCFPGA_AGILEX5 |
| 217 | mailbox_reset_warm(reset_type); |
| 218 | #else |
Sieu Mun Tang | dbcc2cf | 2022-03-07 12:13:04 +0800 | [diff] [blame] | 219 | if (cold_reset_for_ecc_dbe()) { |
| 220 | mailbox_reset_cold(); |
| 221 | } |
Jit Loon Lim | b24dddf | 2023-05-17 12:26:11 +0800 | [diff] [blame] | 222 | #endif |
| 223 | |
Hadi Asyrafi | 5fae68f | 2019-10-22 14:23:57 +0800 | [diff] [blame] | 224 | /* disable cpuif */ |
Jit Loon Lim | b24dddf | 2023-05-17 12:26:11 +0800 | [diff] [blame] | 225 | #ifdef GICV3_SUPPORT_GIC600 |
| 226 | gicv3_cpuif_disable(plat_my_core_pos()); |
| 227 | #else |
Hadi Asyrafi | 5fae68f | 2019-10-22 14:23:57 +0800 | [diff] [blame] | 228 | gicv2_cpuif_disable(); |
Jit Loon Lim | b24dddf | 2023-05-17 12:26:11 +0800 | [diff] [blame] | 229 | #endif |
Hadi Asyrafi | 5fae68f | 2019-10-22 14:23:57 +0800 | [diff] [blame] | 230 | |
| 231 | /* Store magic number */ |
| 232 | mmio_write_32(L2_RESET_DONE_REG, L2_RESET_DONE_STATUS); |
| 233 | |
| 234 | /* Increase timeout */ |
Hadi Asyrafi | 67cb0ea | 2019-12-23 13:25:33 +0800 | [diff] [blame] | 235 | mmio_write_32(SOCFPGA_RSTMGR(HDSKTIMEOUT), 0xffffff); |
Hadi Asyrafi | 5fae68f | 2019-10-22 14:23:57 +0800 | [diff] [blame] | 236 | |
| 237 | /* Enable handshakes */ |
Hadi Asyrafi | 67cb0ea | 2019-12-23 13:25:33 +0800 | [diff] [blame] | 238 | mmio_setbits_32(SOCFPGA_RSTMGR(HDSKEN), RSTMGR_HDSKEN_SET); |
Hadi Asyrafi | 5fae68f | 2019-10-22 14:23:57 +0800 | [diff] [blame] | 239 | |
Jit Loon Lim | b24dddf | 2023-05-17 12:26:11 +0800 | [diff] [blame] | 240 | #if PLATFORM_MODEL != PLAT_SOCFPGA_AGILEX5 |
Hadi Asyrafi | 5fae68f | 2019-10-22 14:23:57 +0800 | [diff] [blame] | 241 | /* Reset L2 module */ |
Hadi Asyrafi | 67cb0ea | 2019-12-23 13:25:33 +0800 | [diff] [blame] | 242 | mmio_setbits_32(SOCFPGA_RSTMGR(COLDMODRST), 0x100); |
Jit Loon Lim | b24dddf | 2023-05-17 12:26:11 +0800 | [diff] [blame] | 243 | #endif |
Hadi Asyrafi | 5fae68f | 2019-10-22 14:23:57 +0800 | [diff] [blame] | 244 | |
| 245 | while (1) |
| 246 | wfi(); |
| 247 | |
| 248 | /* Should not reach here */ |
| 249 | return 0; |
| 250 | } |
| 251 | |
Hadi Asyrafi | 616da77 | 2019-06-27 11:34:03 +0800 | [diff] [blame] | 252 | int socfpga_validate_power_state(unsigned int power_state, |
| 253 | psci_power_state_t *req_state) |
| 254 | { |
| 255 | VERBOSE("%s: power_state: 0x%x\n", __func__, power_state); |
| 256 | |
| 257 | return PSCI_E_SUCCESS; |
| 258 | } |
| 259 | |
| 260 | int socfpga_validate_ns_entrypoint(unsigned long ns_entrypoint) |
| 261 | { |
| 262 | VERBOSE("%s: ns_entrypoint: 0x%lx\n", __func__, ns_entrypoint); |
| 263 | return PSCI_E_SUCCESS; |
| 264 | } |
| 265 | |
| 266 | void socfpga_get_sys_suspend_power_state(psci_power_state_t *req_state) |
| 267 | { |
| 268 | req_state->pwr_domain_state[PSCI_CPU_PWR_LVL] = PLAT_MAX_OFF_STATE; |
| 269 | req_state->pwr_domain_state[1] = PLAT_MAX_OFF_STATE; |
| 270 | } |
| 271 | |
| 272 | /******************************************************************************* |
| 273 | * Export the platform handlers via plat_arm_psci_pm_ops. The ARM Standard |
| 274 | * platform layer will take care of registering the handlers with PSCI. |
| 275 | ******************************************************************************/ |
| 276 | const plat_psci_ops_t socfpga_psci_pm_ops = { |
| 277 | .cpu_standby = socfpga_cpu_standby, |
| 278 | .pwr_domain_on = socfpga_pwr_domain_on, |
| 279 | .pwr_domain_off = socfpga_pwr_domain_off, |
| 280 | .pwr_domain_suspend = socfpga_pwr_domain_suspend, |
| 281 | .pwr_domain_on_finish = socfpga_pwr_domain_on_finish, |
| 282 | .pwr_domain_suspend_finish = socfpga_pwr_domain_suspend_finish, |
| 283 | .system_off = socfpga_system_off, |
| 284 | .system_reset = socfpga_system_reset, |
Hadi Asyrafi | 5fae68f | 2019-10-22 14:23:57 +0800 | [diff] [blame] | 285 | .system_reset2 = socfpga_system_reset2, |
Hadi Asyrafi | 616da77 | 2019-06-27 11:34:03 +0800 | [diff] [blame] | 286 | .validate_power_state = socfpga_validate_power_state, |
| 287 | .validate_ns_entrypoint = socfpga_validate_ns_entrypoint, |
| 288 | .get_sys_suspend_power_state = socfpga_get_sys_suspend_power_state |
| 289 | }; |
| 290 | |
| 291 | /******************************************************************************* |
| 292 | * Export the platform specific power ops. |
| 293 | ******************************************************************************/ |
| 294 | int plat_setup_psci_ops(uintptr_t sec_entrypoint, |
| 295 | const struct plat_psci_ops **psci_ops) |
| 296 | { |
| 297 | /* Save warm boot entrypoint.*/ |
Hadi Asyrafi | a2edf0e | 2019-10-22 13:39:14 +0800 | [diff] [blame] | 298 | mmio_write_64(PLAT_SEC_ENTRY, sec_entrypoint); |
Hadi Asyrafi | 616da77 | 2019-06-27 11:34:03 +0800 | [diff] [blame] | 299 | *psci_ops = &socfpga_psci_pm_ops; |
Hadi Asyrafi | a2edf0e | 2019-10-22 13:39:14 +0800 | [diff] [blame] | 300 | |
Hadi Asyrafi | 616da77 | 2019-06-27 11:34:03 +0800 | [diff] [blame] | 301 | return 0; |
| 302 | } |