]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
MIPS: Octeon: Enable interfaces on EdgeRouter Lite
authorAaro Koskinen <aaro.koskinen@iki.fi>
Sun, 23 Jun 2013 20:38:44 +0000 (20:38 +0000)
committerRalf Baechle <ralf@linux-mips.org>
Thu, 27 Jun 2013 06:33:43 +0000 (08:33 +0200)
Enable interfaces on EdgeRouter Lite. Tested with cavium_octeon_defconfig
and busybox shell. DHCP & ping works with eth0, eth1 and eth2.

The board type "UBNT_E100" is taken from the sources of the vendor kernel
shipped with the product.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Acked-by: David Daney <david.daney@cavium.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/5546/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/cavium-octeon/executive/cvmx-helper-board.c
arch/mips/include/asm/octeon/cvmx-bootinfo.h

index 7c6497781895a040af22a8911c01afd81272b619..0a1283ce47f549d2fa8be1df16d42a83c8bc3ffd 100644 (file)
@@ -181,6 +181,11 @@ int cvmx_helper_board_get_mii_address(int ipd_port)
                        return ipd_port - 16 + 4;
                else
                        return -1;
+       case CVMX_BOARD_TYPE_UBNT_E100:
+               if (ipd_port >= 0 && ipd_port <= 2)
+                       return 7 - ipd_port;
+               else
+                       return -1;
        }
 
        /* Some unknown board. Somebody forgot to update this function... */
@@ -706,6 +711,14 @@ int __cvmx_helper_board_hardware_enable(int interface)
                                }
                        }
                }
+       } else if (cvmx_sysinfo_get()->board_type ==
+                       CVMX_BOARD_TYPE_UBNT_E100) {
+               cvmx_write_csr(CVMX_ASXX_RX_CLK_SETX(0, interface), 0);
+               cvmx_write_csr(CVMX_ASXX_TX_CLK_SETX(0, interface), 0x10);
+               cvmx_write_csr(CVMX_ASXX_RX_CLK_SETX(1, interface), 0);
+               cvmx_write_csr(CVMX_ASXX_TX_CLK_SETX(1, interface), 0x10);
+               cvmx_write_csr(CVMX_ASXX_RX_CLK_SETX(2, interface), 0);
+               cvmx_write_csr(CVMX_ASXX_TX_CLK_SETX(2, interface), 0x10);
        }
        return 0;
 }
index 284fa8d773ba0774126b2387c15805110c961b82..7b7818d1e4d56686c76af4fa46552bc8fefb2ea7 100644 (file)
@@ -227,6 +227,7 @@ enum cvmx_board_types_enum {
         * use any numbers in this range.
         */
        CVMX_BOARD_TYPE_CUST_PRIVATE_MIN = 20001,
+       CVMX_BOARD_TYPE_UBNT_E100 = 20002,
        CVMX_BOARD_TYPE_CUST_PRIVATE_MAX = 30000,
 
        /* The remaining range is reserved for future use. */
@@ -325,6 +326,7 @@ static inline const char *cvmx_board_type_to_string(enum
 
                    /* Customer private range */
                ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_PRIVATE_MIN)
+               ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_UBNT_E100)
                ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_PRIVATE_MAX)
        }
        return "Unsupported Board";