Patchwork Arm big endian?

login
register
mail settings
Submitter Rob Landley
Date May 30, 2010, 2:25 a.m.
Message ID <201005292125.26794.rob@landley.net>
Download mbox | patch
Permalink /patch/53993/
State New
Headers show

Comments

Rob Landley - May 30, 2010, 2:25 a.m.
I'm trying to get arm big endian support to work.  I patched the 2.6.33 kernel 
to pretend that good old versatilepb can have a big endian CPU plugged into it 
(attached), and then I built a kernel with the attached .config, and qemu went 
"boing":

$ qemu-system-arm -M versatilepb -nographic -no-reboot -kernel zImage-armv4eb 
-hda image-armv4eb.sqf -append root=/dev/sda rw init=/usr/sbin/init.sh panic=1 
PATH=/usr/bin console=ttyAMA0 HOST=armv4eb  -net nic,model=rtl8139 -net user
qemu: hardware error: pl011_read: Bad offset 6c8

CPU #0:
R00=00000000 R01=00000183 R02=00000100 R03=00000000
R04=101f36ca R05=00000000 R06=00000000 R07=00000000
R08=ffffffe4 R09=00000000 R10=00000000 R11=00000000
R12=00000000 R13=00000000 R14=00010088 R15=00010000
PSR=000001db ---- A und32
Aborted

It does this with both the release version I have on the host and a recent git 
(thursday-ish).

Does this look more like a kernel error, or a qemu error?  Do I need to select 
a different -cpu emulation?

Thanks,

Rob
Paul Brook - June 3, 2010, 7:52 a.m.
> I'm trying to get arm big endian support to work.  I patched the 2.6.33
> kernel to pretend that good old versatilepb can have a big endian CPU
> plugged into it (attached), and then I built a kernel with the attached
> .config, and qemu went "boing":

That's about the result I'd expect. The fact that neither qemu nor linux claim 
to support big-endian mode for this hardware should be your first clue.

> Does this look more like a kernel error, or a qemu error?

Probably both.

Paul
Rob Landley - June 3, 2010, 11:25 p.m.
On Thursday 03 June 2010 02:52:03 Paul Brook wrote:
> > I'm trying to get arm big endian support to work.  I patched the 2.6.33
> > kernel to pretend that good old versatilepb can have a big endian CPU
> > plugged into it (attached), and then I built a kernel with the attached
> > .config, and qemu went "boing":
>
> That's about the result I'd expect. The fact that neither qemu nor linux
> claim to support big-endian mode for this hardware should be your first
> clue.

Understood.  I there a better emulation to try?

When you say "this hardware" do you mean the board, or do you mean big endian 
arm as a CPU?  Because there _is_ a qemu-armeb.  There isn't a qemu-system-
armeb that I'm aware of, but I thought it autodetected endianness at least for 
the CPU...)

If it's the board, I did that because versatilepb has essentially been the 
generic board emulation I've plugged all the other arm variants into.  There 
isn't a -M ip4xx that I'm aware of.  (I can try configuring a kernel with just 
serial console and see if I can get that to boot, and then add back net and 
disk and such one at a time, if that might be a reasonable approach...)

> > Does this look more like a kernel error, or a qemu error?
>
> Probably both.

If I could just get them to agree, I'd be happy.  I just want a setup that can 
run a big endian arm userspace under system emulation (with network, serial 
console, clock, and disk).  Emulating a feasible board would be a nice bonus, 
but not actually a goal.

> Paul

Rob

Patch

--- linux/arch/arm/mach-versatile/Kconfig	2010-05-29 18:44:21.000000000 -0500
+++ linx/arch/arm/mach-versatile/Kconfig	2010-05-29 19:19:38.000000000 -0500
@@ -12,4 +12,12 @@ 
 	help
 	  Include support for the ARM(R) Versatile/AP platform.
 
+if ARCH_VERSATILE_PB || ARCH_VERSATILE_AB
+
+config ARCH_SUPPORTS_BIG_ENDIAN
+        bool
+        default y
+
+endif
+
 endmenu