ARM: pl01x debug code endian fix
authorBen Dooks <ben.dooks@codethink.co.uk>
Wed, 6 Feb 2013 18:25:36 +0000 (18:25 +0000)
committerVictor Kamensky <victor.kamensky@linaro.org>
Thu, 13 Mar 2014 21:46:07 +0000 (14:46 -0700)
The PL01X debug code needs to take into account which endian mode the
processor is running in. If it is big-endian, ensure the data is swapped
appropriately.

Note, we could do this slightly more efficiently if we have an macro to
do the necessary swap for the bits used by test.

Reviewed-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
(cherry picked from commit 76e3faf156fa95b6465e747d702b94faf67117fc)

Signed-off-by: Victor Kamensky <victor.kamensky@linaro.org>
Conflicts:
arch/arm/include/debug/pl01x.S

arch/arm/include/asm/hardware/debug-pl01x.S

index f9fd083eff630dd29b0710d603c11447919b9d54..6489d1ffe3c82ba5410c01456db92d8f3a0c5819 100644 (file)
 
                .macro  waituart,rd,rx
 1001:          ldr     \rd, [\rx, #UART01x_FR]
+ ARM_BE8(      rev     \rd, \rd )
                tst     \rd, #UART01x_FR_TXFF
                bne     1001b
                .endm
 
                .macro  busyuart,rd,rx
 1001:          ldr     \rd, [\rx, #UART01x_FR]
+ ARM_BE8(      rev     \rd, \rd )
                tst     \rd, #UART01x_FR_BUSY
                bne     1001b
                .endm