blob: b0c0ae879736bc02d7ffe47c38afbce5d35bd36e [file] [log] [blame]
Haojian Zhuang3846f142017-05-24 08:49:26 +08001/*
2 * Copyright (c) 2017, ARM Limited and Contributors. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
Antonio Nino Diaz5eb88372018-11-08 10:20:19 +00007#ifndef HISI_IPC_H
8#define HISI_IPC_H
Haojian Zhuang3846f142017-05-24 08:49:26 +08009
10#define HISI_IPC_CORE_ACPU 0x0
11
12#define HISI_IPC_MCU_INT_SRC_ACPU0_PD 10
13#define HISI_IPC_MCU_INT_SRC_ACPU1_PD 11
14#define HISI_IPC_MCU_INT_SRC_ACPU2_PD 12
15#define HISI_IPC_MCU_INT_SRC_ACPU3_PD 13
16#define HISI_IPC_MCU_INT_SRC_ACPU_PD 16
17#define HISI_IPC_MCU_INT_SRC_ACPU4_PD 26
18#define HISI_IPC_MCU_INT_SRC_ACPU5_PD 27
19#define HISI_IPC_MCU_INT_SRC_ACPU6_PD 28
20#define HISI_IPC_MCU_INT_SRC_ACPU7_PD 29
21
22#define HISI_IPC_SEM_CPUIDLE 27
23#define HISI_IPC_INT_SRC_NUM 32
24
25#define HISI_IPC_PM_ON 0
26#define HISI_IPC_PM_OFF 1
27
28#define HISI_IPC_OK (0)
29#define HISI_IPC_ERROR (-1)
30
31#define HISI_IPC_BASE_ADDR (0xF7510000)
32#define HISI_IPC_CPU_RAW_INT_ADDR (0xF7510420)
33#define HISI_IPC_ACPU_CTRL(i) (0xF7510800 + (i << 3))
34
35void hisi_ipc_spin_lock(unsigned int signal);
36void hisi_ipc_spin_unlock(unsigned int signal);
37void hisi_ipc_cpu_on(unsigned int cpu, unsigned int cluster);
38void hisi_ipc_cpu_off(unsigned int cpu, unsigned int cluster);
39void hisi_ipc_cpu_suspend(unsigned int cpu, unsigned int cluster);
40void hisi_ipc_cluster_on(unsigned int cpu, unsigned int cluster);
41void hisi_ipc_cluster_off(unsigned int cpu, unsigned int cluster);
42void hisi_ipc_cluster_suspend(unsigned int cpu, unsigned int cluster);
43void hisi_ipc_psci_system_off(void);
44int hisi_ipc_init(void);
45
Antonio Nino Diaz5eb88372018-11-08 10:20:19 +000046#endif /* HISI_IPC_H */