linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [V2][PATCH 0/6]ARM: fix BE8 mode support
@ 2011-12-08 10:07 Junxiao Bi
  2011-12-08 10:07 ` [PATCH 1/6] ARM: fix be8 support for phys/virt address conversion Junxiao Bi
                   ` (5 more replies)
  0 siblings, 6 replies; 10+ messages in thread
From: Junxiao Bi @ 2011-12-08 10:07 UTC (permalink / raw)
  To: linux-arm-kernel


This is V2 for this series. See V1 at
http://comments.gmane.org/gmane.linux.ports.arm.kernel/140189

Changes since V1:
1. Drop the patch "ARM: gic: fix big endian support" since gic
implementation has been changed and it works well in BE mode.

2. remove "read/write_instr*" from the patch 
"ARM: support kernel modules in BE8 mode", and use new helper 
__opcode_to_mem_* and __mem_to_opcode_* to implement it. These 
new helpers come from Dave Martin's patch 
"ARM: Add generic instruction opcode manipulation helpers"

3. split the big endian fix for MTD from the original patch
"ARM: add big endian support for peripheral access" 

^ permalink raw reply	[flat|nested] 10+ messages in thread
* [PATCH 1/6] ARM: fix be8 support for phys/virt address conversion
@ 2011-11-15  2:06 Junxiao Bi
  2011-11-21  5:44 ` Bi Junxiao
  2011-11-21 18:32 ` Nicolas Pitre
  0 siblings, 2 replies; 10+ messages in thread
From: Junxiao Bi @ 2011-11-15  2:06 UTC (permalink / raw)
  To: linux-arm-kernel

phys_to_virt() and virt_to_phys() is implemented by one assembler instruction,
add/sub an offset between the physical and virtual address. For some arm machines
with CONFIG_ARM_PATCH_PHYS_VIRT defined, this offset is unknown at compile time,
it is calculated dynamically at run time and then patched to the add/sub instruction.
To support BE8 mode, firstly we need to convert the instruntion to big-endian after
loading it from the memory, and then modify its offset field, at last convert it to
little-endian and write it back to the memory.

Signed-off-by: Junxiao Bi <junxiao.bi@windriver.com>
---
 arch/arm/kernel/head.S |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S
index 566c54c..838fb0c 100644
--- a/arch/arm/kernel/head.S
+++ b/arch/arm/kernel/head.S
@@ -522,8 +522,14 @@ __fixup_a_pv_table:
 	b	2f
 1:	add     r7, r3
 	ldrh	ip, [r7, #2]
+#ifdef CONFIG_CPU_ENDIAN_BE8
+	rev16	ip, ip
+#endif
 	and	ip, 0x8f00
 	orr	ip, r6	@ mask in offset bits 31-24
+#ifdef CONFIG_CPU_ENDIAN_BE8
+	rev16	ip, ip
+#endif
 	strh	ip, [r7, #2]
 2:	cmp	r4, r5
 	ldrcc	r7, [r4], #4	@ use branch for delay slot
@@ -532,8 +538,14 @@ __fixup_a_pv_table:
 #else
 	b	2f
 1:	ldr	ip, [r7, r3]
+#ifdef CONFIG_CPU_ENDIAN_BE8
+	rev	ip, ip
+#endif
 	bic	ip, ip, #0x000000ff
 	orr	ip, ip, r6	@ mask in offset bits 31-24
+#ifdef CONFIG_CPU_ENDIAN_BE8
+	rev	ip, ip
+#endif
 	str	ip, [r7, r3]
 2:	cmp	r4, r5
 	ldrcc	r7, [r4], #4	@ use branch for delay slot
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2011-12-08 10:07 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-08 10:07 [V2][PATCH 0/6]ARM: fix BE8 mode support Junxiao Bi
2011-12-08 10:07 ` [PATCH 1/6] ARM: fix be8 support for phys/virt address conversion Junxiao Bi
2011-12-08 10:07 ` [PATCH 2/6] ARM: Atomic64: fix 64bit ops in BE mode Junxiao Bi
2011-12-08 10:07 ` [PATCH 3/6] ARM: early_printk: pl01x: fix big endian support Junxiao Bi
2011-12-08 10:07 ` [PATCH 4/6] ARM: SMP: " Junxiao Bi
2011-12-08 10:07 ` [PATCH 5/6] MTD: map: " Junxiao Bi
2011-12-08 10:07 ` [PATCH 6/6] ARM: support kernel modules in BE8 mode Junxiao Bi
  -- strict thread matches above, loose matches on Subject: below --
2011-11-15  2:06 [PATCH 1/6] ARM: fix be8 support for phys/virt address conversion Junxiao Bi
2011-11-21  5:44 ` Bi Junxiao
2011-11-21 18:32 ` Nicolas Pitre

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).