Jacky Bai | 07ed02c | 2020-06-03 14:28:45 +0800 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright 2020 NXP |
| 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
| 6 | |
| 7 | #include <stdbool.h> |
| 8 | |
| 9 | #include <arch.h> |
| 10 | #include <arch_helpers.h> |
| 11 | #include <common/debug.h> |
| 12 | #include <lib/mmio.h> |
| 13 | #include <lib/psci/psci.h> |
| 14 | |
| 15 | #include <gpc.h> |
| 16 | #include <imx8m_psci.h> |
| 17 | #include <plat_imx8.h> |
| 18 | |
| 19 | static const plat_psci_ops_t imx_plat_psci_ops = { |
| 20 | .pwr_domain_on = imx_pwr_domain_on, |
| 21 | .pwr_domain_on_finish = imx_pwr_domain_on_finish, |
| 22 | .pwr_domain_off = imx_pwr_domain_off, |
| 23 | .validate_ns_entrypoint = imx_validate_ns_entrypoint, |
| 24 | .validate_power_state = imx_validate_power_state, |
| 25 | .cpu_standby = imx_cpu_standby, |
| 26 | .pwr_domain_suspend = imx_domain_suspend, |
| 27 | .pwr_domain_suspend_finish = imx_domain_suspend_finish, |
| 28 | .pwr_domain_pwr_down_wfi = imx_pwr_domain_pwr_down_wfi, |
| 29 | .get_sys_suspend_power_state = imx_get_sys_suspend_power_state, |
| 30 | .system_reset = imx_system_reset, |
| 31 | .system_off = imx_system_off, |
| 32 | }; |
| 33 | |
| 34 | /* export the platform specific psci ops */ |
| 35 | int plat_setup_psci_ops(uintptr_t sec_entrypoint, |
| 36 | const plat_psci_ops_t **psci_ops) |
| 37 | { |
| 38 | /* sec_entrypoint is used for warm reset */ |
| 39 | imx_mailbox_init(sec_entrypoint); |
| 40 | |
| 41 | *psci_ops = &imx_plat_psci_ops; |
| 42 | |
| 43 | return 0; |
| 44 | } |