xtensa: xtfpga: fix ethernet controller endianness
authorMax Filippov <jcmvbkbc@gmail.com>
Tue, 25 Aug 2015 06:04:12 +0000 (09:04 +0300)
committerChris Zankel <chris@zankel.net>
Fri, 11 Mar 2016 08:53:31 +0000 (08:53 +0000)
Ethernet controller is attached to XTFPGA boards as native endian device,
mark it as such in DTS and pass correct endianness in platform data.
This makes network functional on big-endian CPUs.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
arch/xtensa/boot/dts/xtfpga.dtsi
arch/xtensa/platforms/xtfpga/setup.c

index be3fd769677aab0e4f156a4d7f834bf2b79dc559..de133badcdc99d7851c60685dc71b03b3a34343e 100644 (file)
@@ -69,6 +69,7 @@
                enet0: ethoc@0d030000 {
                        compatible = "opencores,ethoc";
                        reg = <0x0d030000 0x4000 0x0d800000 0x4000>;
+                       native-endian;
                        interrupts = <1 1>; /* external irq 1 */
                        local-mac-address = [00 50 c2 13 6f 00];
                        clocks = <&osc>;
index b7f468a6a557229d9d6ecce10b39f30bc1dfdf2e..b509d1f55ed5c2445f1bb4930b48a84c9d34edce 100644 (file)
@@ -223,6 +223,7 @@ static struct ethoc_platform_data ethoc_pdata = {
         */
        .hwaddr = { 0x00, 0x50, 0xc2, 0x13, 0x6f, 0 },
        .phy_id = -1,
+       .big_endian = XCHAL_HAVE_BE,
 };
 
 static struct platform_device ethoc_device = {