blob: 9e74aced8d4bf714e40d9b1eb8a9f636949d0424 [file] [log] [blame]
Edward-JW Yang1c7fd0b2021-06-28 11:29:51 +08001/*
2 * Copyright (c) 2021, MediaTek Inc. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#ifndef MT_SPM_RC_INTERNAL_H
8#define MT_SPM_RC_INTERNAL_H
9
10#include <stdbool.h>
11
12#define SPM_FLAG_SRAM_SLEEP_CTRL \
13 (SPM_FLAG_DISABLE_SSPM_SRAM_SLEEP | \
14 SPM_FLAG_DISABLE_DRAMC_MCU_SRAM_SLEEP | \
15 SPM_FLAG_DISABLE_SYSRAM_SLEEP)
16
17/* cpu buck/ldo constraint function */
18bool spm_is_valid_rc_cpu_buck_ldo(unsigned int cpu, int state_id);
19unsigned int spm_allow_rc_cpu_buck_ldo(int state_id);
20int spm_run_rc_cpu_buck_ldo(unsigned int cpu, int state_id);
21int spm_reset_rc_cpu_buck_ldo(unsigned int cpu, int state_id);
22
23/* spm resource dram constraint function */
24bool spm_is_valid_rc_dram(unsigned int cpu, int state_id);
25int spm_update_rc_dram(int state_id, int type, const void *val);
26unsigned int spm_allow_rc_dram(int state_id);
27int spm_run_rc_dram(unsigned int cpu, int state_id);
28int spm_reset_rc_dram(unsigned int cpu, int state_id);
29
30/* spm resource syspll constraint function */
31bool spm_is_valid_rc_syspll(unsigned int cpu, int state_id);
32int spm_update_rc_syspll(int state_id, int type, const void *val);
33unsigned int spm_allow_rc_syspll(int state_id);
34int spm_run_rc_syspll(unsigned int cpu, int state_id);
35int spm_reset_rc_syspll(unsigned int cpu, int state_id);
36
37/* spm resource bus26m constraint function */
38bool spm_is_valid_rc_bus26m(unsigned int cpu, int state_id);
39int spm_update_rc_bus26m(int state_id, int type, const void *val);
40unsigned int spm_allow_rc_bus26m(int state_id);
41int spm_run_rc_bus26m(unsigned int cpu, int state_id);
42int spm_reset_rc_bus26m(unsigned int cpu, int state_id);
43#endif /* MT_SPM_RC_INTERNAL_H */