hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/include/linux/rockchip/rockchip_sip.h
....@@ -56,6 +56,8 @@
5656 #define SIP_HDCP_CONFIG 0x82000025
5757 #define SIP_WDT_CFG 0x82000026
5858 #define SIP_HDMIRX_CFG 0x82000027
59
+#define SIP_MCU_CFG 0x82000028
60
+#define SIP_PVTPLL_CFG 0x82000029
5961
6062 #define TRUSTED_OS_HDCPKEY_INIT 0xB7000003
6163
....@@ -118,6 +120,28 @@
118120 /* wakeup state */
119121 #define REMOTECTL_PWRKEY_WAKEUP 0xdeadbeaf
120122
123
+/* SIP_MCU_CFG child configs, MCU ID */
124
+enum {
125
+ RK_BUS_MCU,
126
+ RK_PMU_MCU,
127
+ RK_DDR_MCU,
128
+ RK_NPU_MCU,
129
+};
130
+
131
+#define RK_SIP_MCU_ID(type, id) ((type) << 8 | id)
132
+
133
+#define RK_SIP_CFG_BUSMCU_0_ID RK_SIP_MCU_ID(RK_BUS_MCU, 0)
134
+#define RK_SIP_CFG_BUSMCU_1_ID RK_SIP_MCU_ID(RK_BUS_MCU, 1)
135
+#define RK_SIP_CFG_PMUMCU_0_ID RK_SIP_MCU_ID(RK_PMU_MCU, 0)
136
+#define RK_SIP_CFG_DDRMCU_0_ID RK_SIP_MCU_ID(RK_DDR_MCU, 0)
137
+#define RK_SIP_CFG_NPUMCU_0_ID RK_SIP_MCU_ID(RK_NPU_MCU, 0)
138
+
139
+/* SIP_MCU_CFG child configs */
140
+#define CONFIG_MCU_CODE_START_ADDR 0x01
141
+#define CONFIG_MCU_EXPERI_START_ADDR 0x02
142
+#define CONFIG_MCU_SRAM_START_ADDR 0x03
143
+#define CONFIG_MCU_EXSRAM_START_ADDR 0x04
144
+
121145 struct dram_addrmap_info {
122146 u64 ch_mask[2];
123147 u64 bk_mask[4];
....@@ -159,6 +183,7 @@
159183 SHARE_PAGE_TYPE_DDR_ADDRMAP,
160184 SHARE_PAGE_TYPE_LAST_LOG,
161185 SHARE_PAGE_TYPE_HDCP,
186
+ SHARE_PAGE_TYPE_SLEEP,
162187 SHARE_PAGE_TYPE_MAX,
163188 } share_page_type_t;
164189
....@@ -202,6 +227,13 @@
202227 HDMIRX_INFO_NOTIFY = 2,
203228 };
204229
230
+/* SIP_PVTPLL_CFG child configs */
231
+enum {
232
+ PVTPLL_GET_INFO = 0,
233
+ PVTPLL_ADJUST_TABLE = 1,
234
+ PVTPLL_LOW_TEMP = 2,
235
+};
236
+
205237 struct pt_regs;
206238 typedef void (*sip_fiq_debugger_uart_irq_tf_cb_t)(struct pt_regs *_pt_regs, unsigned long cpu);
207239
....@@ -232,6 +264,9 @@
232264 struct dram_addrmap_info *sip_smc_get_dram_map(void);
233265 int sip_smc_amp_config(u32 sub_func_id, u32 arg1, u32 arg2, u32 arg3);
234266 struct arm_smccc_res sip_smc_get_amp_info(u32 sub_func_id, u32 arg1);
267
+struct arm_smccc_res sip_smc_get_pvtpll_info(u32 sub_func_id, u32 arg1);
268
+struct arm_smccc_res sip_smc_pvtpll_config(u32 sub_func_id, u32 arg1, u32 arg2,
269
+ u32 arg3, u32 arg4, u32 arg5, u32 arg6);
235270
236271 void __iomem *sip_hdcp_request_share_memory(int id);
237272 struct arm_smccc_res sip_hdcp_config(u32 arg0, u32 arg1, u32 arg2);
....@@ -251,6 +286,7 @@
251286 int sip_wdt_config(u32 sub_func, u32 arg1, u32 arg2, u32 arg3);
252287 int sip_hdmirx_config(u32 sub_func, u32 arg1, u32 arg2, u32 arg3);
253288 int sip_hdcpkey_init(u32 hdcp_id);
289
+int sip_smc_mcu_config(unsigned long mcu_id, unsigned long func, unsigned long arg2);
254290 #else
255291 static inline struct arm_smccc_res sip_smc_get_atf_version(void)
256292 {
....@@ -340,6 +376,24 @@
340376 return tmp;
341377 }
342378
379
+static inline struct arm_smccc_res sip_smc_get_pvtpll_info(u32 sub_func_id,
380
+ u32 arg1)
381
+{
382
+ struct arm_smccc_res tmp = { .a0 = SIP_RET_NOT_SUPPORTED, };
383
+
384
+ return tmp;
385
+}
386
+
387
+static inline struct arm_smccc_res sip_smc_pvtpll_config(u32 sub_func_id,
388
+ u32 arg1, u32 arg2,
389
+ u32 arg3, u32 arg4,
390
+ u32 arg5, u32 arg6)
391
+{
392
+ struct arm_smccc_res tmp = { .a0 = SIP_RET_NOT_SUPPORTED, };
393
+
394
+ return tmp;
395
+}
396
+
343397 static inline void __iomem *sip_hdcp_request_share_memory(int id)
344398 {
345399 return NULL;
....@@ -407,6 +461,13 @@
407461 {
408462 return 0;
409463 }
464
+
465
+static inline int sip_smc_mcu_config(unsigned long mcu_id,
466
+ unsigned long func,
467
+ unsigned long arg2)
468
+{
469
+ return SIP_RET_NOT_SUPPORTED;
470
+}
410471 #endif
411472
412473 /* 32-bit OP-TEE context, never change order of members! */