Skip to content

Commit 6ccd9a7

Browse files
JosephChen2017rkhuangtao
authored andcommitted
firmware: rockchip: add last log request interface
Change-Id: I26e37b25d75ac07928f1964f5165e1a2a568ac69 Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
1 parent d55e688 commit 6ccd9a7

2 files changed

Lines changed: 36 additions & 0 deletions

File tree

drivers/firmware/rockchip_sip.c

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,34 @@ struct arm_smccc_res sip_smc_soc_bus_div(u32 arg0, u32 arg1, u32 arg2)
152152
return res;
153153
}
154154

155+
struct arm_smccc_res sip_smc_lastlog_request(void)
156+
{
157+
struct arm_smccc_res res;
158+
void __iomem *addr1, *addr2;
159+
160+
res = __invoke_sip_fn_smc(SIP_LAST_LOG, local_clock(), 0, 0);
161+
if (IS_SIP_ERROR(res.a0))
162+
return res;
163+
164+
addr1 = ioremap(res.a1, res.a3);
165+
if (!addr1) {
166+
pr_err("%s: share memory buffer0 ioremap failed\n", __func__);
167+
res.a0 = SIP_RET_INVALID_ADDRESS;
168+
return res;
169+
}
170+
addr2 = ioremap(res.a2, res.a3);
171+
if (!addr2) {
172+
pr_err("%s: share memory buffer1 ioremap failed\n", __func__);
173+
res.a0 = SIP_RET_INVALID_ADDRESS;
174+
return res;
175+
}
176+
177+
res.a1 = (unsigned long)addr1;
178+
res.a2 = (unsigned long)addr2;
179+
180+
return res;
181+
}
182+
155183
/************************** fiq debugger **************************************/
156184
/*
157185
* AArch32 is not allowed to call SMC64(ATF framework does not support), so we

include/linux/rockchip/rockchip_sip.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
#define SIP_REMOTECTL_CFG 0x8200000b
3333
#define PSCI_SIP_VPU_RESET 0x8200000c
3434
#define RK_SIP_SOC_BUS_DIV 0x8200000d
35+
#define SIP_LAST_LOG 0x8200000e
3536

3637
/* Rockchip Sip version */
3738
#define SIP_IMPLEMENT_V1 (1)
@@ -120,6 +121,7 @@ struct arm_smccc_res sip_smc_request_share_mem(u32 page_num,
120121
struct arm_smccc_res sip_smc_mcu_el3fiq(u32 arg0, u32 arg1, u32 arg2);
121122
struct arm_smccc_res sip_smc_vpu_reset(u32 arg0, u32 arg1, u32 arg2);
122123
struct arm_smccc_res sip_smc_get_suspend_info(u32 info);
124+
struct arm_smccc_res sip_smc_lastlog_request(void);
123125

124126
int sip_smc_set_suspend_mode(u32 ctrl, u32 config1, u32 config2);
125127
int sip_smc_virtual_poweroff(void);
@@ -178,6 +180,12 @@ sip_smc_vpu_reset(u32 arg0, u32 arg1, u32 arg2)
178180
return tmp;
179181
}
180182

183+
struct arm_smccc_res sip_smc_lastlog_request(void)
184+
{
185+
struct arm_smccc_res tmp = {0};
186+
return tmp;
187+
}
188+
181189
static inline int sip_smc_set_suspend_mode(u32 ctrl, u32 config1, u32 config2)
182190
{
183191
return 0;

0 commit comments

Comments
 (0)