Commit 9edb4b13 authored by Stephen Boyd's avatar Stephen Boyd Committed by Kumar Gala

ARM: debug: msm: Support big-endian CPUs

If the CPU is in big-endian mode these macros will access the
hardware incorrectly. Reverse thins as necessary to fix this.
Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
Signed-off-by: default avatarKumar Gala <galak@codeaurora.org>
parent 30cd6552
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
.endm .endm
.macro senduart, rd, rx .macro senduart, rd, rx
ARM_BE8(rev \rd, \rd )
#ifdef CONFIG_DEBUG_QCOM_UARTDM #ifdef CONFIG_DEBUG_QCOM_UARTDM
@ Write the 1 character to UARTDM_TF @ Write the 1 character to UARTDM_TF
str \rd, [\rx, #0x70] str \rd, [\rx, #0x70]
...@@ -35,24 +36,29 @@ ...@@ -35,24 +36,29 @@
#ifdef CONFIG_DEBUG_QCOM_UARTDM #ifdef CONFIG_DEBUG_QCOM_UARTDM
@ check for TX_EMT in UARTDM_SR @ check for TX_EMT in UARTDM_SR
ldr \rd, [\rx, #0x08] ldr \rd, [\rx, #0x08]
ARM_BE8(rev \rd, \rd )
tst \rd, #0x08 tst \rd, #0x08
bne 1002f bne 1002f
@ wait for TXREADY in UARTDM_ISR @ wait for TXREADY in UARTDM_ISR
1001: ldr \rd, [\rx, #0x14] 1001: ldr \rd, [\rx, #0x14]
ARM_BE8(rev \rd, \rd )
tst \rd, #0x80 tst \rd, #0x80
beq 1001b beq 1001b
1002: 1002:
@ Clear TX_READY by writing to the UARTDM_CR register @ Clear TX_READY by writing to the UARTDM_CR register
mov \rd, #0x300 mov \rd, #0x300
ARM_BE8(rev \rd, \rd )
str \rd, [\rx, #0x10] str \rd, [\rx, #0x10]
@ Write 0x1 to NCF register @ Write 0x1 to NCF register
mov \rd, #0x1 mov \rd, #0x1
ARM_BE8(rev \rd, \rd )
str \rd, [\rx, #0x40] str \rd, [\rx, #0x40]
@ UARTDM reg. Read to induce delay @ UARTDM reg. Read to induce delay
ldr \rd, [\rx, #0x08] ldr \rd, [\rx, #0x08]
#else #else
@ wait for TX_READY @ wait for TX_READY
1001: ldr \rd, [\rx, #0x08] 1001: ldr \rd, [\rx, #0x08]
ARM_BE8(rev \rd, \rd )
tst \rd, #0x04 tst \rd, #0x04
beq 1001b beq 1001b
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment