firmware: rockchip: add last log request interface

Change-Id: I26e37b25d75ac07928f1964f5165e1a2a568ac69
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
This commit is contained in:
Joseph Chen 2018-06-25 10:27:10 +08:00 committed by Tao Huang
parent d55e688a4f
commit 6ccd9a7567
2 changed files with 36 additions and 0 deletions

View File

@ -152,6 +152,34 @@ struct arm_smccc_res sip_smc_soc_bus_div(u32 arg0, u32 arg1, u32 arg2)
return res;
}
struct arm_smccc_res sip_smc_lastlog_request(void)
{
struct arm_smccc_res res;
void __iomem *addr1, *addr2;
res = __invoke_sip_fn_smc(SIP_LAST_LOG, local_clock(), 0, 0);
if (IS_SIP_ERROR(res.a0))
return res;
addr1 = ioremap(res.a1, res.a3);
if (!addr1) {
pr_err("%s: share memory buffer0 ioremap failed\n", __func__);
res.a0 = SIP_RET_INVALID_ADDRESS;
return res;
}
addr2 = ioremap(res.a2, res.a3);
if (!addr2) {
pr_err("%s: share memory buffer1 ioremap failed\n", __func__);
res.a0 = SIP_RET_INVALID_ADDRESS;
return res;
}
res.a1 = (unsigned long)addr1;
res.a2 = (unsigned long)addr2;
return res;
}
/************************** fiq debugger **************************************/
/*
* AArch32 is not allowed to call SMC64(ATF framework does not support), so we

View File

@ -32,6 +32,7 @@
#define SIP_REMOTECTL_CFG 0x8200000b
#define PSCI_SIP_VPU_RESET 0x8200000c
#define RK_SIP_SOC_BUS_DIV 0x8200000d
#define SIP_LAST_LOG 0x8200000e
/* Rockchip Sip version */
#define SIP_IMPLEMENT_V1 (1)
@ -120,6 +121,7 @@ struct arm_smccc_res sip_smc_request_share_mem(u32 page_num,
struct arm_smccc_res sip_smc_mcu_el3fiq(u32 arg0, u32 arg1, u32 arg2);
struct arm_smccc_res sip_smc_vpu_reset(u32 arg0, u32 arg1, u32 arg2);
struct arm_smccc_res sip_smc_get_suspend_info(u32 info);
struct arm_smccc_res sip_smc_lastlog_request(void);
int sip_smc_set_suspend_mode(u32 ctrl, u32 config1, u32 config2);
int sip_smc_virtual_poweroff(void);
@ -178,6 +180,12 @@ sip_smc_vpu_reset(u32 arg0, u32 arg1, u32 arg2)
return tmp;
}
struct arm_smccc_res sip_smc_lastlog_request(void)
{
struct arm_smccc_res tmp = {0};
return tmp;
}
static inline int sip_smc_set_suspend_mode(u32 ctrl, u32 config1, u32 config2)
{
return 0;