From 29e959968ff2b7cca782fe80dd00883fa0b71e66 Mon Sep 17 00:00:00 2001 From: chenjh Date: Mon, 15 May 2017 10:02:31 +0800 Subject: [PATCH] firmware: rockchip: use 'nsec_ctx->und_lr' to deliver fiq break point's PC 'nsec_ctx->mon_lr' is not the fiq break point's PC, because it will be override as 'sip_fiq_debugger_uart_irq_tf_cb' for optee-os to jump to fiq_debugger handler. As 'nsec_ctx->und_lr' is not used for kernel, optee-os uses it to deliver fiq break point's PC. Change-Id: I5a831638e8228766d03d92674e3e29facdd116f8 Signed-off-by: chenjh --- drivers/firmware/rockchip_sip.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/firmware/rockchip_sip.c b/drivers/firmware/rockchip_sip.c index fc0ca1d79a9e..f813dc7048f2 100644 --- a/drivers/firmware/rockchip_sip.c +++ b/drivers/firmware/rockchip_sip.c @@ -172,8 +172,18 @@ static struct pt_regs sip_fiq_debugger_get_pt_regs(void *reg_base, fiq_pt_regs.ARM_ip = nsec_ctx->r12; fiq_pt_regs.ARM_sp = nsec_ctx->svc_sp; fiq_pt_regs.ARM_lr = nsec_ctx->svc_lr; - fiq_pt_regs.ARM_pc = nsec_ctx->mon_lr; fiq_pt_regs.ARM_cpsr = nsec_ctx->mon_spsr; + + /* + * 'nsec_ctx->mon_lr' is not the fiq break point's PC, because it will + * be override as 'psci_fiq_debugger_uart_irq_tf_cb' for optee-os to + * jump to fiq_debugger handler. + * + * As 'nsec_ctx->und_lr' is not used for kernel, so optee-os uses it to + * deliver fiq break point's PC. + * + */ + fiq_pt_regs.ARM_pc = nsec_ctx->und_lr; #endif return fiq_pt_regs; -- 2.34.1