firmware: rockchip_sip: support cpu on/off for amp os.

Signed-off-by: Tony Xie <tony.xie@rock-chips.com>
Change-Id: I723e20cb088063e8f9525b3d64e37090e0a10adf
This commit is contained in:
Tony Xie 2022-01-11 15:30:33 +08:00 committed by Tao Huang
parent 53d05c0005
commit 909476ac67
2 changed files with 51 additions and 0 deletions

View File

@ -264,6 +264,25 @@ struct arm_smccc_res sip_smc_lastlog_request(void)
}
EXPORT_SYMBOL_GPL(sip_smc_lastlog_request);
int sip_smc_amp_config(u32 sub_func_id, u32 arg1, u32 arg2, u32 arg3)
{
struct arm_smccc_res res;
arm_smccc_smc(RK_SIP_AMP_CFG, sub_func_id, arg1, arg2, arg3,
0, 0, 0, &res);
return res.a0;
}
EXPORT_SYMBOL_GPL(sip_smc_amp_config);
struct arm_smccc_res sip_smc_get_amp_info(u32 sub_func_id, u32 arg1)
{
struct arm_smccc_res res;
arm_smccc_smc(RK_SIP_AMP_CFG, sub_func_id, arg1, 0, 0, 0, 0, 0, &res);
return res;
}
EXPORT_SYMBOL_GPL(sip_smc_get_amp_info);
void __iomem *sip_hdcp_request_share_memory(int id)
{
static void __iomem *base;

View File

@ -51,6 +51,7 @@
#define SIP_SCMI_AGENT15 0x8200001f
#define SIP_SDEI_FIQ_DBG_SWITCH_CPU 0x82000020
#define SIP_SDEI_FIQ_DBG_GET_EVENT_ID 0x82000021
#define RK_SIP_AMP_CFG 0x82000022
#define RK_SIP_FIQ_CTRL 0x82000024
#define SIP_HDCP_CONFIG 0x82000025
@ -121,6 +122,18 @@ struct dram_addrmap_info {
u32 bank_bit_mask;
};
/* AMP Ctrl */
enum {
RK_AMP_SUB_FUNC_CFG_MODE = 0,
RK_AMP_SUB_FUNC_BOOT_ARG01,
RK_AMP_SUB_FUNC_BOOT_ARG23,
RK_AMP_SUB_FUNC_REQ_CPU_OFF,
RK_AMP_SUB_FUNC_GET_CPU_STATUS,
RK_AMP_SUB_FUNC_RSV, /* for RTOS */
RK_AMP_SUB_FUNC_CPU_ON,
RK_AMP_SUB_FUNC_END,
};
enum {
FIRMWARE_NONE,
FIRMWARE_TEE_32BIT,
@ -194,6 +207,8 @@ int sip_smc_secure_reg_write(u32 addr_phy, u32 val);
u32 sip_smc_secure_reg_read(u32 addr_phy);
struct arm_smccc_res sip_smc_bus_config(u32 arg0, u32 arg1, u32 arg2);
struct dram_addrmap_info *sip_smc_get_dram_map(void);
int sip_smc_amp_config(u32 sub_func_id, u32 arg1, u32 arg2, u32 arg3);
struct arm_smccc_res sip_smc_get_amp_info(u32 sub_func_id, u32 arg1);
void __iomem *sip_hdcp_request_share_memory(int id);
struct arm_smccc_res sip_hdcp_config(u32 arg0, u32 arg1, u32 arg2);
@ -286,6 +301,23 @@ static inline void __iomem *sip_hdcp_request_share_memory(int id)
static inline struct arm_smccc_res sip_hdcp_config(u32 arg0, u32 arg1, u32 arg2)
{
struct arm_smccc_res tmp = {0};
return tmp;
}
static inline int sip_smc_amp_config(u32 sub_func_id,
u32 arg1,
u32 arg2,
u32 arg3)
{
return 0;
}
static inline struct arm_smccc_res sip_smc_get_amp_info(u32 sub_func_id,
u32 arg1)
{
struct arm_smccc_res tmp = { .a0 = SIP_RET_NOT_SUPPORTED, };
return tmp;
}