kernel: handle Cavium Octeon Kconfig rename
[openwrt.git] / target / linux / octeon / patches-3.10 / 0002-MIPS-Octeon-Enable-interfaces-on-EdgeRouter-Lite.patch
1 From a135a9b5d9683ace787c7d86f1e642d9acfacdde Mon Sep 17 00:00:00 2001
2 From: Aaro Koskinen <aaro.koskinen@iki.fi>
3 Date: Sun, 23 Jun 2013 20:38:44 +0000
4 Subject: [PATCH] MIPS: Octeon: Enable interfaces on EdgeRouter Lite
5
6 Enable interfaces on EdgeRouter Lite. Tested with cavium_octeon_defconfig
7 and busybox shell. DHCP & ping works with eth0, eth1 and eth2.
8
9 The board type "UBNT_E100" is taken from the sources of the vendor kernel
10 shipped with the product.
11
12 Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
13 Acked-by: David Daney <david.daney@cavium.com>
14 Cc: linux-mips@linux-mips.org
15 Patchwork: https://patchwork.linux-mips.org/patch/5546/
16 Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
17 ---
18  arch/mips/cavium-octeon/executive/cvmx-helper-board.c |   13 +++++++++++++
19  arch/mips/include/asm/octeon/cvmx-bootinfo.h          |    2 ++
20  2 files changed, 15 insertions(+)
21
22 --- a/arch/mips/cavium-octeon/executive/cvmx-helper-board.c
23 +++ b/arch/mips/cavium-octeon/executive/cvmx-helper-board.c
24 @@ -181,6 +181,11 @@ int cvmx_helper_board_get_mii_address(in
25                         return ipd_port - 16 + 4;
26                 else
27                         return -1;
28 +       case CVMX_BOARD_TYPE_UBNT_E100:
29 +               if (ipd_port >= 0 && ipd_port <= 2)
30 +                       return 7 - ipd_port;
31 +               else
32 +                       return -1;
33         }
34  
35         /* Some unknown board. Somebody forgot to update this function... */
36 @@ -706,6 +711,14 @@ int __cvmx_helper_board_hardware_enable(
37                                 }
38                         }
39                 }
40 +       } else if (cvmx_sysinfo_get()->board_type ==
41 +                       CVMX_BOARD_TYPE_UBNT_E100) {
42 +               cvmx_write_csr(CVMX_ASXX_RX_CLK_SETX(0, interface), 0);
43 +               cvmx_write_csr(CVMX_ASXX_TX_CLK_SETX(0, interface), 0x10);
44 +               cvmx_write_csr(CVMX_ASXX_RX_CLK_SETX(1, interface), 0);
45 +               cvmx_write_csr(CVMX_ASXX_TX_CLK_SETX(1, interface), 0x10);
46 +               cvmx_write_csr(CVMX_ASXX_RX_CLK_SETX(2, interface), 0);
47 +               cvmx_write_csr(CVMX_ASXX_TX_CLK_SETX(2, interface), 0x10);
48         }
49         return 0;
50  }
51 --- a/arch/mips/include/asm/octeon/cvmx-bootinfo.h
52 +++ b/arch/mips/include/asm/octeon/cvmx-bootinfo.h
53 @@ -227,6 +227,7 @@ enum cvmx_board_types_enum {
54          * use any numbers in this range.
55          */
56         CVMX_BOARD_TYPE_CUST_PRIVATE_MIN = 20001,
57 +       CVMX_BOARD_TYPE_UBNT_E100 = 20002,
58         CVMX_BOARD_TYPE_CUST_PRIVATE_MAX = 30000,
59  
60         /* The remaining range is reserved for future use. */
61 @@ -325,6 +326,7 @@ static inline const char *cvmx_board_typ
62  
63                     /* Customer private range */
64                 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_PRIVATE_MIN)
65 +               ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_UBNT_E100)
66                 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_PRIVATE_MAX)
67         }
68         return "Unsupported Board";