Add core support for ARMv6/v7 big-endian
Starting with ARMv6, the CPUs support the BE-8 variant of big-endian (byte-invariant). This patch adds the core support: - setting of the BE-8 mode via the CPSR.E register for both kernel and user threads - big-endian page table walking - REV used to rotate instructions read from memory during fault processing as they are still little-endian format - Kconfig and Makefile support for BE-8. The --be8 option must be passed to the final linking stage to convert the instructions to little-endian Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
This commit is contained in:
@@ -639,6 +639,20 @@ config CPU_BIG_ENDIAN
|
||||
port must properly enable any big-endian related features
|
||||
of your chipset/board/processor.
|
||||
|
||||
config CPU_ENDIAN_BE8
|
||||
bool
|
||||
depends on CPU_BIG_ENDIAN
|
||||
default CPU_V6 || CPU_V7
|
||||
help
|
||||
Support for the BE-8 (big-endian) mode on ARMv6 and ARMv7 processors.
|
||||
|
||||
config CPU_ENDIAN_BE32
|
||||
bool
|
||||
depends on CPU_BIG_ENDIAN
|
||||
default !CPU_ENDIAN_BE8
|
||||
help
|
||||
Support for the BE-32 (big-endian) mode on pre-ARMv6 processors.
|
||||
|
||||
config CPU_HIGH_VECTOR
|
||||
depends on !MMU && CPU_CP15 && !CPU_ARM740T
|
||||
bool "Select the High exception vector"
|
||||
|
@@ -37,6 +37,9 @@ ENTRY(v6_early_abort)
|
||||
movne pc, lr
|
||||
do_thumb_abort
|
||||
ldreq r3, [r2] @ read aborted ARM instruction
|
||||
#ifdef CONFIG_CPU_ENDIAN_BE8
|
||||
reveq r3, r3
|
||||
#endif
|
||||
do_ldrd_abort
|
||||
tst r3, #1 << 20 @ L = 0 -> write
|
||||
orreq r1, r1, #1 << 11 @ yes.
|
||||
|
@@ -170,6 +170,9 @@ __v6_setup:
|
||||
#endif /* CONFIG_MMU */
|
||||
adr r5, v6_crval
|
||||
ldmia r5, {r5, r6}
|
||||
#ifdef CONFIG_CPU_ENDIAN_BE8
|
||||
orr r6, r6, #1 << 25 @ big-endian page tables
|
||||
#endif
|
||||
mrc p15, 0, r0, c1, c0, 0 @ read control register
|
||||
bic r0, r0, r5 @ clear bits them
|
||||
orr r0, r0, r6 @ set them
|
||||
|
@@ -253,6 +253,9 @@ __v7_setup:
|
||||
mcr p15, 0, r6, c10, c2, 1 @ write NMRR
|
||||
adr r5, v7_crval
|
||||
ldmia r5, {r5, r6}
|
||||
#ifdef CONFIG_CPU_ENDIAN_BE8
|
||||
orr r6, r6, #1 << 25 @ big-endian page tables
|
||||
#endif
|
||||
mrc p15, 0, r0, c1, c0, 0 @ read control register
|
||||
bic r0, r0, r5 @ clear bits them
|
||||
orr r0, r0, r6 @ set them
|
||||
|
Reference in New Issue
Block a user