Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ARM: imx: enable big endian mode

Enable ARM big-endian mode on mach-imx. This requires adding some
byte swapping in the debug functions (which otherwise hang forever)
and of course the secondary core bringup.

Tested (on top of 4.4) on i.MX6 HummingBoard quad-core (IMX6Q).

The patch is pretty much as suggested by Arnd Bergmann, thanks!

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>

authored by

Johannes Berg and committed by
Shawn Guo
26e30c64 c553138f

+6
+3
arch/arm/include/debug/imx.S
··· 11 11 * 12 12 */ 13 13 14 + #include <asm/assembler.h> 14 15 #include "imx-uart.h" 15 16 16 17 /* ··· 35 34 .endm 36 35 37 36 .macro senduart,rd,rx 37 + ARM_BE8(rev \rd, \rd) 38 38 str \rd, [\rx, #0x40] @ TXDATA 39 39 .endm 40 40 ··· 44 42 45 43 .macro busyuart,rd,rx 46 44 1002: ldr \rd, [\rx, #0x98] @ SR2 45 + ARM_BE8(rev \rd, \rd) 47 46 tst \rd, #1 << 3 @ TXDC 48 47 beq 1002b @ wait until transmit done 49 48 .endm
+1
arch/arm/mach-imx/Kconfig
··· 2 2 bool "Freescale i.MX family" 3 3 depends on ARCH_MULTI_V4_V5 || ARCH_MULTI_V6_V7 || ARM_SINGLE_ARMV7M 4 4 select ARCH_REQUIRE_GPIOLIB 5 + select ARCH_SUPPORTS_BIG_ENDIAN 5 6 select ARM_CPU_SUSPEND if PM 6 7 select CLKSRC_IMX_GPT 7 8 select GENERIC_IRQ_CHIP
+2
arch/arm/mach-imx/headsmp.S
··· 12 12 13 13 #include <linux/linkage.h> 14 14 #include <linux/init.h> 15 + #include <asm/assembler.h> 15 16 16 17 diag_reg_offset: 17 18 .word g_diag_reg - . ··· 26 25 .endm 27 26 28 27 ENTRY(v7_secondary_startup) 28 + ARM_BE8(setend be) @ go BE8 if entered LE 29 29 set_diag_reg 30 30 b secondary_startup 31 31 ENDPROC(v7_secondary_startup)