On 03/16/2015 11:18 AM, Paul Martin wrote:
Octeon II CPUs can switch from Big Endian to Little Endian freely even in kernel/supervisor mode.
There are many caveats for dynamic endian switching. "Freely" doesn't really describe it.
These patches allow an EdgeRouterPro to boot in LE mode with no hardware modifications. They have not been subjected to extensive testing yet and should be considered experimental. (I have seen some strange memory corruption in libstdc++ which I haven't yet been able to trace.) Parts of this patchset are based on the "GPL" sources released by Ubiquiti.
Aleksey (On the To: list here) also has a patch set for this that he is readying.
Some of your patches are even incorrect. I will respond to those individually.
v2: * Remove unneeded assembler code in kernel-entry-init.h * Add patch to octeon-md5 code * Re-order patches * Sign the patches Paul Martin (7): MIPS: OCTEON: Ensure CPUs come up little endian MIPS: OCTEON: Turn hardware bitfields and structures inside out MIPS: OCTEON: Set appropriate endianness in L2C registers MIPS: OCTEON: Reverse the order of register accesses to the FAU MIPS: OCTEON: Set up ethernet hardware for little endian MIPS: OCTEON: Make octeon-md5 driver endian-agnostic MIPS: OCTEON: Tell the kernel build system we can do Little Endian arch/mips/Kconfig | 1 + arch/mips/cavium-octeon/crypto/octeon-crypto.h | 8 +- arch/mips/cavium-octeon/executive/cvmx-l2c.c | 45 ++++ arch/mips/cavium-octeon/octeon-platform.c | 12 + .../asm/mach-cavium-octeon/kernel-entry-init.h | 68 ++++++ arch/mips/include/asm/octeon/cvmx-address.h | 67 ++++++ arch/mips/include/asm/octeon/cvmx-bootinfo.h | 55 +++++ arch/mips/include/asm/octeon/cvmx-bootmem.h | 14 ++ arch/mips/include/asm/octeon/cvmx-fau.h | 22 ++ arch/mips/include/asm/octeon/cvmx-fpa.h | 7 + arch/mips/include/asm/octeon/cvmx-l2c.h | 9 + arch/mips/include/asm/octeon/cvmx-packet.h | 8 + arch/mips/include/asm/octeon/cvmx-pko.h | 31 +++ arch/mips/include/asm/octeon/cvmx-pow.h | 247 +++++++++++++++++++++ arch/mips/include/asm/octeon/cvmx-wqe.h | 71 ++++++ drivers/staging/octeon/ethernet-tx.c | 3 + drivers/staging/octeon/ethernet.c | 10 + 17 files changed, 674 insertions(+), 4 deletions(-)