Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c1496352 authored by Florian Fainelli's avatar Florian Fainelli
Browse files

ARM: brcmstb: Add appropriate ARM_BE8() macros for swapping



Building a big-endian kernel for ARCH_BRCMSTB revealed that we would not
be correctly polling for the right bit in the busyuart macro, turns out
there are a few transformations needed to work with big-endian kernels.
First we need to swap the value we read from SUN_TOP_CTRL to properly
compare it against our local tables. Then, just like 8250.S we need to
swap the value before storing it, and conversely swap it after a load.

Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
parent ea023be7
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -58,6 +58,7 @@
		/* Check SUN_TOP_CTRL base */
		/* Check SUN_TOP_CTRL base */
		ldr	\rp, =SUN_TOP_CTRL_BASE	@ load SUN_TOP_CTRL PA
		ldr	\rp, =SUN_TOP_CTRL_BASE	@ load SUN_TOP_CTRL PA
		ldr	\rv, [\rp, #0]		@ get register contents
		ldr	\rv, [\rp, #0]		@ get register contents
ARM_BE8(	rev	\rv, \rv )
		and	\rv, \rv, #0xffffff00	@ strip revision bits [7:0]
		and	\rv, \rv, #0xffffff00	@ strip revision bits [7:0]


		/* Chip specific detection starts here */
		/* Chip specific detection starts here */
@@ -98,11 +99,13 @@
		.endm
		.endm


		.macro	store, rd, rx:vararg
		.macro	store, rd, rx:vararg
ARM_BE8(	rev	\rd, \rd )
		str	\rd, \rx
		str	\rd, \rx
		.endm
		.endm


		.macro	load, rd, rx:vararg
		.macro	load, rd, rx:vararg
		ldr	\rd, \rx
		ldr	\rd, \rx
ARM_BE8(	rev	\rd, \rd )
		.endm
		.endm


		.macro	senduart,rd,rx
		.macro	senduart,rd,rx