From 17391dd0a372e6df23061e7622144f911e12f048 Mon Sep 17 00:00:00 2001 From: Jun Nie Date: Tue, 28 Aug 2018 15:26:06 +0800 Subject: warp7: serial: protect r4 register with fifo protect r4 register with fifo so that the data in r4 is not corrupted after console function call. Signed-off-by: Jun Nie --- drivers/nxp/uart/nxp_console.S | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/nxp/uart/nxp_console.S b/drivers/nxp/uart/nxp_console.S index 995c0bc..77149ae 100644 --- a/drivers/nxp/uart/nxp_console.S +++ b/drivers/nxp/uart/nxp_console.S @@ -84,6 +84,7 @@ endfunc console_init * ----------------------------------------------- */ func console_core_init + push {r4} /* Check the input base address */ cmp r0, #0 beq core_init_fail @@ -155,8 +156,10 @@ __wait_cr2_reset: /* Indicate success */ movs r0, #1 + pop {r4} bx lr core_init_fail: + pop {r4} mov r0, #0 bx lr endfunc console_core_init -- cgit v1.2.3