return res.a0;
}
+u32 sip_smc_secure_reg_read(u32 addr_phy)
+{
+ struct arm_smccc_res res;
+
+ res = __invoke_sip_fn_smc(SIP_ACCESS_REG, 0, addr_phy, SECURE_REG_RD);
+ if (res.a0)
+ pr_err("%s error: %d, addr phy: 0x%x\n",
+ __func__, (int)res.a0, addr_phy);
+
+ return res.a1;
+}
+
+int sip_smc_secure_reg_write(u32 addr_phy, u32 val)
+{
+ struct arm_smccc_res res;
+
+ res = __invoke_sip_fn_smc(SIP_ACCESS_REG, val, addr_phy, SECURE_REG_WR);
+ if (res.a0)
+ pr_err("%s error: %d, addr phy: 0x%x\n",
+ __func__, (int)res.a0, addr_phy);
+
+ return res.a0;
+}
+
+/************************** fiq debugger **************************************/
static u64 ft_fiq_mem_phy;
static void __iomem *ft_fiq_mem_base;
static void (*psci_fiq_debugger_uart_irq_tf)(void *reg_base, u64 sp_el1);
#define SIP_SVC_VERSION 0x8200ff03
#define SIP_ATF_VERSION32 0x82000001
+#define SIP_ACCESS_REG 0x82000002
#define SIP_SUSPEND_MODE32 0x82000003
#define SIP_DDR_CFG32 0x82000008
#define SIP_SHARE_MEM32 0x82000009
#define SIP_SIP_VERSION32 0x8200000a
+/* SIP_ACCESS_REG read/write */
+#define SECURE_REG_RD 0x0
+#define SECURE_REG_WR 0x1
+
/* Share mem page types */
typedef enum {
SHARE_PAGE_TYPE_INVALID = 0,
u32 arg2);
struct arm_smccc_res sip_smc_get_share_mem_page(u32 page_num,
share_page_type_t page_type);
+u32 sip_smc_secure_reg_read(u32 addr_phy);
+int sip_smc_secure_reg_write(u32 addr_phy, u32 val);
void psci_enable_fiq(void);
u32 rockchip_psci_smc_get_tf_ver(void);