From 10ebd8556b7990499c896a550e3d416b444211e6 Mon Sep 17 00:00:00 2001
From: hc <hc@nodka.com>
Date: Fri, 10 May 2024 02:23:07 +0000
Subject: [PATCH] add led
---
kernel/include/linux/rockchip/rockchip_sip.h | 61 ++++++++++++++++++++++++++++++
1 files changed, 61 insertions(+), 0 deletions(-)
diff --git a/kernel/include/linux/rockchip/rockchip_sip.h b/kernel/include/linux/rockchip/rockchip_sip.h
index a0ff5c7..70b1493 100644
--- a/kernel/include/linux/rockchip/rockchip_sip.h
+++ b/kernel/include/linux/rockchip/rockchip_sip.h
@@ -56,6 +56,8 @@
#define SIP_HDCP_CONFIG 0x82000025
#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
@@ -118,6 +120,28 @@
/* wakeup state */
#define REMOTECTL_PWRKEY_WAKEUP 0xdeadbeaf
+/* SIP_MCU_CFG child configs, MCU ID */
+enum {
+ RK_BUS_MCU,
+ RK_PMU_MCU,
+ RK_DDR_MCU,
+ RK_NPU_MCU,
+};
+
+#define RK_SIP_MCU_ID(type, id) ((type) << 8 | id)
+
+#define RK_SIP_CFG_BUSMCU_0_ID RK_SIP_MCU_ID(RK_BUS_MCU, 0)
+#define RK_SIP_CFG_BUSMCU_1_ID RK_SIP_MCU_ID(RK_BUS_MCU, 1)
+#define RK_SIP_CFG_PMUMCU_0_ID RK_SIP_MCU_ID(RK_PMU_MCU, 0)
+#define RK_SIP_CFG_DDRMCU_0_ID RK_SIP_MCU_ID(RK_DDR_MCU, 0)
+#define RK_SIP_CFG_NPUMCU_0_ID RK_SIP_MCU_ID(RK_NPU_MCU, 0)
+
+/* SIP_MCU_CFG child configs */
+#define CONFIG_MCU_CODE_START_ADDR 0x01
+#define CONFIG_MCU_EXPERI_START_ADDR 0x02
+#define CONFIG_MCU_SRAM_START_ADDR 0x03
+#define CONFIG_MCU_EXSRAM_START_ADDR 0x04
+
struct dram_addrmap_info {
u64 ch_mask[2];
u64 bk_mask[4];
@@ -159,6 +183,7 @@
SHARE_PAGE_TYPE_DDR_ADDRMAP,
SHARE_PAGE_TYPE_LAST_LOG,
SHARE_PAGE_TYPE_HDCP,
+ SHARE_PAGE_TYPE_SLEEP,
SHARE_PAGE_TYPE_MAX,
} share_page_type_t;
@@ -202,6 +227,13 @@
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);
@@ -232,6 +264,9 @@
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);
@@ -251,6 +286,7 @@
int sip_wdt_config(u32 sub_func, u32 arg1, u32 arg2, u32 arg3);
int sip_hdmirx_config(u32 sub_func, u32 arg1, u32 arg2, u32 arg3);
int sip_hdcpkey_init(u32 hdcp_id);
+int sip_smc_mcu_config(unsigned long mcu_id, unsigned long func, unsigned long arg2);
#else
static inline struct arm_smccc_res sip_smc_get_atf_version(void)
{
@@ -340,6 +376,24 @@
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;
@@ -407,6 +461,13 @@
{
return 0;
}
+
+static inline int sip_smc_mcu_config(unsigned long mcu_id,
+ unsigned long func,
+ unsigned long arg2)
+{
+ return SIP_RET_NOT_SUPPORTED;
+}
#endif
/* 32-bit OP-TEE context, never change order of members! */
--
Gitblit v1.6.2