tech-toolchain archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[2/2 ABI and toolchain part] Support Raspberry Pi [0-3] in big-endian mode



(CC to tech-toolchain@)

I've managed Raspberry Pi [0-3] to work in big-endian mode.
For MD parts, see my post to port-arm@:

http://mail-index.netbsd.org/port-arm/2020/11/15/msg007054.html

Raspberry Pi Zero and 1 are our first earmv6{,hf}eb machines, and this
requires fixes related to ABI.

ARMv6 supports BE32 (dropped in ARMv7 and later) and BE8 (added to ARMv6
and later) formats for big-endian binary. We choose BE32 for ARMv6, but
no kernel supports for ARMv6 yet. This means userland for earmv6{,hf}eb
has never worked before (because of lack of ARMv6 instructions for ARMv5
and prior, and lack of BE32 support for ARMv7 and later).

Our toolchain is configured to generate BE32 binary for earmv6{,hf}eb,
however, there still be problem. ARMv6 and later support unaligned
memory access for little-endian and BE8 big-endian modes. But it is
*not* supported in BE32 big-endian mode:

https://developer.arm.com/documentation/ddi0301/h/unaligned-and-mixed-endian-data-access-support/mixed-endian-access-support/armv6-support-for-mixed-endian-data

Therefore,
(1) configure GCC not to emit unaligned access for earmv6{,hf}eb.

http://www.netbsd.org/~rin/rpi_eb_gcc_20201115.patch

Also,
(2) fix some confusion b/w BE32 and BE8 in kernel.

http://www.netbsd.org/~rin/rpi_eb_arm_20201115.patch

And,
(3) RPI kernel and rpi.img are added to earmv6{,hf}eb distribution.

http://www.netbsd.org/~rin/rpi_eb_distrib_20201115.patch

Note that RPI2 kernel is not supported because ARMv7 cannot support
BE32 userland binaries for ARMv6.

Thanks,
rin


Home | Main Index | Thread Index | Old Index