aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/kernel/head.S
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2013-10-27 20:43:41 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2013-10-30 18:20:26 -0400
commit2098990e7c558c175b96213d41058983e00a7919 (patch)
tree361449d9c852d07544b16dd0daec5a72541e8bda /arch/arm/kernel/head.S
parent5e4432d3bd6b5b19e10bb263e7dbe8e74d7cf1c2 (diff)
parentfdb07aee0b2b9d7d1893c97f5ce79ec355caaf1f (diff)
Merge branch 'baserock/bjdooks/312-rc4/be/core-v3' of git://git.baserock.org/delta/linux into devel-stable
Conflicts: arch/arm/kernel/head.S This series has been well tested and it would be great to get this merged now. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/kernel/head.S')
-rw-r--r--arch/arm/kernel/head.S26
1 files changed, 22 insertions, 4 deletions
diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S
index 32402ba6710a..e46330f4506a 100644
--- a/arch/arm/kernel/head.S
+++ b/arch/arm/kernel/head.S
@@ -77,6 +77,7 @@
77 77
78 __HEAD 78 __HEAD
79ENTRY(stext) 79ENTRY(stext)
80 ARM_BE8(setend be ) @ ensure we are in BE8 mode
80 81
81 THUMB( adr r9, BSYM(1f) ) @ Kernel is always entered in ARM. 82 THUMB( adr r9, BSYM(1f) ) @ Kernel is always entered in ARM.
82 THUMB( bx r9 ) @ If this is a Thumb-2 kernel, 83 THUMB( bx r9 ) @ If this is a Thumb-2 kernel,
@@ -352,6 +353,9 @@ ENTRY(secondary_startup)
352 * the processor type - there is no need to check the machine type 353 * the processor type - there is no need to check the machine type
353 * as it has already been validated by the primary processor. 354 * as it has already been validated by the primary processor.
354 */ 355 */
356
357 ARM_BE8(setend be) @ ensure we are in BE8 mode
358
355#ifdef CONFIG_ARM_VIRT_EXT 359#ifdef CONFIG_ARM_VIRT_EXT
356 bl __hyp_stub_install_secondary 360 bl __hyp_stub_install_secondary
357#endif 361#endif
@@ -602,15 +606,20 @@ __fixup_a_pv_table:
602 b 2f 606 b 2f
6031: add r7, r3 6071: add r7, r3
604 ldrh ip, [r7, #2] 608 ldrh ip, [r7, #2]
609ARM_BE8(rev16 ip, ip)
605 tst ip, #0x4000 610 tst ip, #0x4000
606 and ip, #0x8f00 611 and ip, #0x8f00
607 orrne ip, r6 @ mask in offset bits 31-24 612 orrne ip, r6 @ mask in offset bits 31-24
608 orreq ip, r0 @ mask in offset bits 7-0 613 orreq ip, r0 @ mask in offset bits 7-0
614ARM_BE8(rev16 ip, ip)
609 strh ip, [r7, #2] 615 strh ip, [r7, #2]
610 ldrheq ip, [r7] 616 bne 2f
611 biceq ip, #0x20 617 ldrh ip, [r7]
612 orreq ip, ip, r0, lsr #16 618ARM_BE8(rev16 ip, ip)
613 strheq ip, [r7] 619 bic ip, #0x20
620 orr ip, ip, r0, lsr #16
621ARM_BE8(rev16 ip, ip)
622 strh ip, [r7]
6142: cmp r4, r5 6232: cmp r4, r5
615 ldrcc r7, [r4], #4 @ use branch for delay slot 624 ldrcc r7, [r4], #4 @ use branch for delay slot
616 bcc 1b 625 bcc 1b
@@ -619,11 +628,20 @@ __fixup_a_pv_table:
619 moveq r0, #0x400000 @ set bit 22, mov to mvn instruction 628 moveq r0, #0x400000 @ set bit 22, mov to mvn instruction
620 b 2f 629 b 2f
6211: ldr ip, [r7, r3] 6301: ldr ip, [r7, r3]
631#ifdef CONFIG_CPU_ENDIAN_BE8
632 @ in BE8, we load data in BE, but instructions still in LE
633 bic ip, ip, #0xff000000
634 tst ip, #0x000f0000 @ check the rotation field
635 orrne ip, ip, r6, lsl #24 @ mask in offset bits 31-24
636 biceq ip, ip, #0x00004000 @ clear bit 22
637 orreq ip, ip, r0, lsl #24 @ mask in offset bits 7-0
638#else
622 bic ip, ip, #0x000000ff 639 bic ip, ip, #0x000000ff
623 tst ip, #0xf00 @ check the rotation field 640 tst ip, #0xf00 @ check the rotation field
624 orrne ip, ip, r6 @ mask in offset bits 31-24 641 orrne ip, ip, r6 @ mask in offset bits 31-24
625 biceq ip, ip, #0x400000 @ clear bit 22 642 biceq ip, ip, #0x400000 @ clear bit 22
626 orreq ip, ip, r0 @ mask in offset bits 7-0 643 orreq ip, ip, r0 @ mask in offset bits 7-0
644#endif
627 str ip, [r7, r3] 645 str ip, [r7, r3]
6282: cmp r4, r5 6462: cmp r4, r5
629 ldrcc r7, [r4], #4 @ use branch for delay slot 647 ldrcc r7, [r4], #4 @ use branch for delay slot