bcm63xx: remove bcm_tag usage in kernel
[openwrt.git] / target / linux / brcm63xx / patches-3.3 / 528-board_nb6.patch
1 --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
2 +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
3 @@ -17,6 +17,7 @@
4  #include <linux/spi/spi.h>
5  #include <linux/spi/spi_gpio.h>
6  #include <linux/spi/74x164.h>
7 +#include <linux/rtl8367.h>
8  #include <asm/addrspace.h>
9  #include <bcm63xx_board.h>
10  #include <bcm63xx_cpu.h>
11 @@ -50,6 +51,8 @@
12  #define NB4_SPI_GPIO_MOSI      7
13  #define NB4_SPI_GPIO_CLK       6
14  #define NB4_74HC64_GPIO(X)     (NB4_74X164_GPIO_BASE + (X))
15 +#define NB6_GPIO_RTL8367_SDA   18
16 +#define NB6_GPIO_RTL8367_SCK   20
17  
18  #define CT6373_PID_OFFSET              0xff80
19  #define CT6373_74X164_GPIO_BASE        64
20 @@ -2579,6 +2582,103 @@ static struct board_info __initdata boar
21  };
22  #endif
23  
24 +#ifdef CONFIG_BCM63XX_CPU_6362
25 +static struct rtl8367_extif_config nb6_rtl8367_extif0_cfg = {
26 +       .mode = RTL8367_EXTIF_MODE_RGMII,
27 +       .txdelay = 1,
28 +       .rxdelay = 5,
29 +       .ability = {
30 +               .force_mode = 1,
31 +               .txpause = 1,
32 +               .rxpause = 1,
33 +               .link = 1,
34 +               .duplex = 1,
35 +               .speed = RTL8367_PORT_SPEED_1000,
36 +       },
37 +};
38 +
39 +static struct rtl8367_platform_data nb6_rtl8367_data = {
40 +       .gpio_sda       = NB6_GPIO_RTL8367_SDA,
41 +       .gpio_sck       = NB6_GPIO_RTL8367_SCK,
42 +       .extif0_cfg     = &nb6_rtl8367_extif0_cfg,
43 +};
44 +
45 +static struct platform_device nb6_rtl8367_device = {
46 +       .name           = RTL8367_DRIVER_NAME,
47 +       .id             = -1,
48 +       .dev = {
49 +               .platform_data  = &nb6_rtl8367_data,
50 +       }
51 +};
52 +
53 +static struct platform_device * __initdata nb6_devices[] = {
54 +       &nb6_rtl8367_device,
55 +};
56 +
57 +static struct board_info __initdata board_nb6 = {
58 +       .name                           = "NB6",
59 +       .expected_cpu_id                = 0x6362,
60 +
61 +       .has_uart0                      = 1,
62 +
63 +       .has_ohci0                      = 1,
64 +       .has_ehci0                      = 1,
65 +
66 +       .has_enetsw                     = 1,
67 +
68 +       .enetsw = {
69 +               .used_ports = {
70 +                       [4] = {
71 +                               .used   = 1,
72 +                               .phy_id = 0xff,
73 +                               .bypass_link = 1,
74 +                               .force_speed = 1000,
75 +                               .force_duplex_full = 1,
76 +                               .name   = "RGMII",
77 +                       },
78 +               },
79 +       },
80 +
81 +       .buttons = {
82 +               {
83 +                       .desc           = "reset",
84 +                       .gpio           = 24,
85 +                       .type           = EV_KEY,
86 +                       .code           = KEY_RESTART,
87 +                       .debounce_interval = BCM963XX_KEYS_DEBOUNCE_INTERVAL,
88 +                       .active_low     = 1,
89 +               },
90 +               {
91 +                       .desc           = "wps",
92 +                       .gpio           = 25,
93 +                       .type           = EV_KEY,
94 +                       .code           = KEY_WPS_BUTTON,
95 +                       .debounce_interval = BCM963XX_KEYS_DEBOUNCE_INTERVAL,
96 +                       .active_low     = 1,
97 +               },
98 +               {
99 +                       .desc           = "wlan",
100 +                       .gpio           = 12,
101 +                       .type           = EV_KEY,
102 +                       .code           = KEY_WLAN,
103 +                       .debounce_interval = BCM963XX_KEYS_DEBOUNCE_INTERVAL,
104 +                       .active_low     = 1,
105 +               },
106 +               {
107 +                       .desc           = "service",
108 +                       .gpio           = 10,
109 +                       .type           = EV_KEY,
110 +                       .code           = BTN_0,
111 +                       .debounce_interval = BCM963XX_KEYS_DEBOUNCE_INTERVAL,
112 +                       .active_low     = 1,
113 +               },
114 +       },
115 +
116 +       .devs = nb6_devices,
117 +       .num_devs = ARRAY_SIZE(nb6_devices),
118 +};
119 +#endif
120 +
121  /*
122   * known 6368 boards
123   */
124 @@ -2775,6 +2875,10 @@ static const struct board_info __initdat
125         &board_DVAG3810BN,
126  #endif
127  
128 +#ifdef CONFIG_BCM63XX_CPU_6362
129 +       &board_nb6,
130 +#endif
131 +
132  #ifdef CONFIG_BCM63XX_CPU_6368
133         &board_96368mvwg,
134         &board_96368mvngr,
135 @@ -2842,6 +2946,11 @@ static void __init boardid_fixup(u8 *boo
136                 }
137         }
138  
139 +       if (BCMCPU_IS_6362() && (!strncmp(board_name, "NB6-", sizeof("NB6-") - 1))) {
140 +               board_name[sizeof("NB6") - 1] = '\0';
141 +               return ;
142 +       }
143 +
144         /* check if bcm_tag is at 64k offset */
145         if (strncmp(board_name, tag->board_id, BOARDID_LEN) != 0) {
146                 /* else try 128k */