From c3e08fa050aa3e8eb31fbd76f4d1e28c00ffe0b4 Mon Sep 17 00:00:00 2001 From: Joseph Chen Date: Wed, 3 Feb 2021 18:36:20 +0800 Subject: [PATCH] rockchip: smccc: add sip_smc_amp_cfg() Signed-off-by: Joseph Chen Change-Id: Ida367c95f72e910f6dbb9919888479250512f3b4 --- arch/arm/include/asm/arch-rockchip/rockchip_smccc.h | 9 +++++++++ arch/arm/mach-rockchip/rockchip_smccc.c | 8 ++++++++ 2 files changed, 17 insertions(+) diff --git a/arch/arm/include/asm/arch-rockchip/rockchip_smccc.h b/arch/arm/include/asm/arch-rockchip/rockchip_smccc.h index c290553615..85d0bce943 100644 --- a/arch/arm/include/asm/arch-rockchip/rockchip_smccc.h +++ b/arch/arm/include/asm/arch-rockchip/rockchip_smccc.h @@ -27,6 +27,7 @@ #define SIP_VPU_RESET 0x8200000c #define SIP_SOC_BUS_DIV 0x8200000d #define SIP_LAST_LOG 0x8200000e +#define SIP_AMP_CFG 0x82000022 #define ROCKCHIP_SIP_CONFIG_DRAM_INIT 0x00 #define ROCKCHIP_SIP_CONFIG_DRAM_SET_RATE 0x01 @@ -56,6 +57,9 @@ #define SECURE_REG_RD 0x0 #define SECURE_REG_WR 0x1 +/* SIP_AMP_CFG */ +#define AMP_PE_STATE 0x0 + /* Share mem page types */ typedef enum { SHARE_PAGE_TYPE_INVALID = 0, @@ -73,6 +77,11 @@ int sip_smc_set_suspend_mode(unsigned long ctrl, unsigned long config1, unsigned long config2); +/* + * sip_smc_amp_cfg() - config AMP + */ +int sip_smc_amp_cfg(unsigned long func, unsigned long arg0, unsigned long arg1); + /* * sip_smc_dram() - Set dram configure for trust. * diff --git a/arch/arm/mach-rockchip/rockchip_smccc.c b/arch/arm/mach-rockchip/rockchip_smccc.c index 8ec9bad8f4..0caa642294 100644 --- a/arch/arm/mach-rockchip/rockchip_smccc.c +++ b/arch/arm/mach-rockchip/rockchip_smccc.c @@ -61,6 +61,14 @@ int sip_smc_set_suspend_mode(unsigned long ctrl, return res.a0; } +int sip_smc_amp_cfg(unsigned long func, unsigned long arg0, unsigned long arg1) +{ + struct arm_smccc_res res; + + res = __invoke_sip_fn_smc(SIP_AMP_CFG, func, arg0, arg1); + return res.a0; +} + struct arm_smccc_res sip_smc_dram(unsigned long arg0, unsigned long arg1, unsigned long arg2)