summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJun Nie <jun.nie@linaro.org>2018-08-28 15:26:06 +0800
committerJun Nie <jun.nie@linaro.org>2018-08-28 15:26:06 +0800
commit17391dd0a372e6df23061e7622144f911e12f048 (patch)
tree442a63d340d5ea6fad513c9da9811f37542e113d
parentc07f7633816d76d46d66ba3c31c0cc9f9914d8d9 (diff)
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 <jun.nie@linaro.org>
-rw-r--r--drivers/nxp/uart/nxp_console.S3
1 files changed, 3 insertions, 0 deletions
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