developer | 2a56b2c | 2020-06-16 13:28:28 +0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2020, MediaTek Inc. All rights reserved. |
| 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
| 6 | |
| 7 | #ifndef MTSPMC_H |
| 8 | #define MTSPMC_H |
| 9 | |
| 10 | #include <stdint.h> |
| 11 | |
| 12 | int spmc_init(void); |
| 13 | |
developer | 1c2a210 | 2020-06-16 11:48:36 +0800 | [diff] [blame] | 14 | void spm_poweron_cpu(unsigned int cluster, unsigned int cpu); |
| 15 | void spm_poweroff_cpu(unsigned int cluster, unsigned int cpu); |
developer | 2a56b2c | 2020-06-16 13:28:28 +0800 | [diff] [blame] | 16 | |
developer | 1c2a210 | 2020-06-16 11:48:36 +0800 | [diff] [blame] | 17 | void spm_poweroff_cluster(unsigned int cluster); |
| 18 | void spm_poweron_cluster(unsigned int cluster); |
developer | 2a56b2c | 2020-06-16 13:28:28 +0800 | [diff] [blame] | 19 | |
developer | 1c2a210 | 2020-06-16 11:48:36 +0800 | [diff] [blame] | 20 | bool spm_get_cpu_powerstate(unsigned int cluster, unsigned int cpu); |
| 21 | bool spm_get_cluster_powerstate(unsigned int cluster); |
developer | 2a56b2c | 2020-06-16 13:28:28 +0800 | [diff] [blame] | 22 | bool spm_get_powerstate(uint32_t mask); |
| 23 | |
developer | 1c2a210 | 2020-06-16 11:48:36 +0800 | [diff] [blame] | 24 | void mcucfg_init_archstate(unsigned int cluster, unsigned int cpu, bool arm64); |
| 25 | void mcucfg_set_bootaddr(unsigned int cluster, unsigned int cpu, uintptr_t bootaddr); |
| 26 | uintptr_t mcucfg_get_bootaddr(unsigned int cluster, unsigned int cpu); |
developer | 2a56b2c | 2020-06-16 13:28:28 +0800 | [diff] [blame] | 27 | |
developer | 1c2a210 | 2020-06-16 11:48:36 +0800 | [diff] [blame] | 28 | void mcucfg_disable_gic_wakeup(unsigned int cluster, unsigned int cpu); |
| 29 | void mcucfg_enable_gic_wakeup(unsigned int cluster, unsigned int cpu); |
developer | 2a56b2c | 2020-06-16 13:28:28 +0800 | [diff] [blame] | 30 | |
| 31 | #endif /* MTSPMC_H */ |