diff --git a/drivers/firmware/rockchip_sip.c b/drivers/firmware/rockchip_sip.c index 99f3d2c182d7..e483899d79fe 100644 --- a/drivers/firmware/rockchip_sip.c +++ b/drivers/firmware/rockchip_sip.c @@ -283,6 +283,33 @@ struct arm_smccc_res sip_smc_get_amp_info(u32 sub_func_id, u32 arg1) } EXPORT_SYMBOL_GPL(sip_smc_get_amp_info); +struct arm_smccc_res sip_smc_get_pvtpll_info(u32 sub_func_id, u32 arg1) +{ + struct arm_smccc_res res; + + /* + * res.a0: error code(0: success, !0: error). + * res.a1: low temp config flag(0: support, !0: don't support). + */ + arm_smccc_smc(SIP_PVTPLL_CFG, sub_func_id, arg1, 0, 0, 0, 0, 0, &res); + return res; +} +EXPORT_SYMBOL_GPL(sip_smc_get_pvtpll_info); + +struct arm_smccc_res sip_smc_pvtpll_config(u32 sub_func_id, u32 arg1, u32 arg2, + u32 arg3, u32 arg4, u32 arg5, u32 arg6) +{ + struct arm_smccc_res res; + + /* + * res.a0: error code(0: success, !0: error). + */ + arm_smccc_smc(SIP_PVTPLL_CFG, sub_func_id, arg1, arg2, arg3, arg4, arg5, + arg6, &res); + return res; +} +EXPORT_SYMBOL_GPL(sip_smc_pvtpll_config); + void __iomem *sip_hdcp_request_share_memory(int id) { static void __iomem *base; diff --git a/include/linux/rockchip/rockchip_sip.h b/include/linux/rockchip/rockchip_sip.h index 717f0e80fcce..70b1493ef697 100644 --- a/include/linux/rockchip/rockchip_sip.h +++ b/include/linux/rockchip/rockchip_sip.h @@ -57,6 +57,7 @@ #define SIP_WDT_CFG 0x82000026 #define SIP_HDMIRX_CFG 0x82000027 #define SIP_MCU_CFG 0x82000028 +#define SIP_PVTPLL_CFG 0x82000029 #define TRUSTED_OS_HDCPKEY_INIT 0xB7000003 @@ -226,6 +227,13 @@ enum { HDMIRX_INFO_NOTIFY = 2, }; +/* SIP_PVTPLL_CFG child configs */ +enum { + PVTPLL_GET_INFO = 0, + PVTPLL_ADJUST_TABLE = 1, + PVTPLL_LOW_TEMP = 2, +}; + struct pt_regs; typedef void (*sip_fiq_debugger_uart_irq_tf_cb_t)(struct pt_regs *_pt_regs, unsigned long cpu); @@ -256,6 +264,9 @@ 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); +struct arm_smccc_res sip_smc_get_pvtpll_info(u32 sub_func_id, u32 arg1); +struct arm_smccc_res sip_smc_pvtpll_config(u32 sub_func_id, u32 arg1, u32 arg2, + u32 arg3, u32 arg4, u32 arg5, u32 arg6); void __iomem *sip_hdcp_request_share_memory(int id); struct arm_smccc_res sip_hdcp_config(u32 arg0, u32 arg1, u32 arg2); @@ -365,6 +376,24 @@ static inline struct arm_smccc_res sip_smc_get_amp_info(u32 sub_func_id, return tmp; } +static inline struct arm_smccc_res sip_smc_get_pvtpll_info(u32 sub_func_id, + u32 arg1) +{ + struct arm_smccc_res tmp = { .a0 = SIP_RET_NOT_SUPPORTED, }; + + return tmp; +} + +static inline struct arm_smccc_res sip_smc_pvtpll_config(u32 sub_func_id, + u32 arg1, u32 arg2, + u32 arg3, u32 arg4, + u32 arg5, u32 arg6) +{ + struct arm_smccc_res tmp = { .a0 = SIP_RET_NOT_SUPPORTED, }; + + return tmp; +} + static inline void __iomem *sip_hdcp_request_share_memory(int id) { return NULL;