967c4bec16f0e48859c21c223c65461efde6722f
[openwrt/staging/yousong.git] / target / linux / brcm63xx / patches-4.4 / 528-board_nb6.patch
1 --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
2 +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
3 @@ -12,6 +12,8 @@
4 #include <linux/init.h>
5 #include <linux/kernel.h>
6 #include <linux/string.h>
7 +#include <linux/platform_device.h>
8 +#include <linux/rtl8367.h>
9 #include <asm/addrspace.h>
10 #include <bcm63xx_board.h>
11 #include <bcm63xx_cpu.h>
12 @@ -27,6 +29,9 @@
13
14 #define HCS_OFFSET_128K 0x20000
15
16 +#define NB6_GPIO_RTL8367_SDA 18
17 +#define NB6_GPIO_RTL8367_SCK 20
18 +
19 /*
20 * known 3368 boards
21 */
22 @@ -1314,6 +1319,69 @@ static struct board_info __initdata boar
23 };
24 #endif /* CONFIG_BCM63XX_CPU_6358 */
25
26 +#ifdef CONFIG_BCM63XX_CPU_6362
27 +static struct rtl8367_extif_config nb6_rtl8367_extif0_cfg = {
28 + .mode = RTL8367_EXTIF_MODE_RGMII,
29 + .txdelay = 1,
30 + .rxdelay = 5,
31 + .ability = {
32 + .force_mode = 1,
33 + .txpause = 1,
34 + .rxpause = 1,
35 + .link = 1,
36 + .duplex = 1,
37 + .speed = RTL8367_PORT_SPEED_1000,
38 + },
39 +};
40 +
41 +static struct rtl8367_platform_data nb6_rtl8367_data = {
42 + .gpio_sda = NB6_GPIO_RTL8367_SDA,
43 + .gpio_sck = NB6_GPIO_RTL8367_SCK,
44 + .extif0_cfg = &nb6_rtl8367_extif0_cfg,
45 +};
46 +
47 +static struct platform_device nb6_rtl8367_device = {
48 + .name = RTL8367_DRIVER_NAME,
49 + .id = -1,
50 + .dev = {
51 + .platform_data = &nb6_rtl8367_data,
52 + }
53 +};
54 +
55 +static struct platform_device * __initdata nb6_devices[] = {
56 + &nb6_rtl8367_device,
57 +};
58 +
59 +static struct board_info __initdata board_nb6 = {
60 + .name = "NB6",
61 + .expected_cpu_id = 0x6362,
62 +
63 + .has_uart0 = 1,
64 +
65 + .has_ohci0 = 1,
66 + .has_ehci0 = 1,
67 + .num_usbh_ports = 2,
68 +
69 + .has_enetsw = 1,
70 +
71 + .enetsw = {
72 + .used_ports = {
73 + [4] = {
74 + .used = 1,
75 + .phy_id = 0xff,
76 + .bypass_link = 1,
77 + .force_speed = 1000,
78 + .force_duplex_full = 1,
79 + .name = "RGMII",
80 + },
81 + },
82 + },
83 +
84 + .devs = nb6_devices,
85 + .num_devs = ARRAY_SIZE(nb6_devices),
86 +};
87 +#endif /* CONFIG_BCM63XX_CPU_6362 */
88 +
89 /*
90 * known 6368 boards
91 */
92 @@ -1465,6 +1533,10 @@ static const struct board_info __initcon
93 &board_DVAG3810BN,
94 #endif
95
96 +#ifdef CONFIG_BCM63XX_CPU_6362
97 + &board_nb6,
98 +#endif
99 +
100 #ifdef CONFIG_BCM63XX_CPU_6368
101 &board_96368mvwg,
102 &board_96368mvngr,
103 @@ -1533,6 +1605,9 @@ static struct of_device_id const bcm963x
104 { .compatible = "t-com,spw303v", .data = &board_spw303v, },
105 { .compatible = "telsey,cpva642", .data = &board_CPVA642, },
106 #endif
107 +#ifdef CONFIG_BCM63XX_CPU_6362
108 + { .compatible = "sfr,nb6-ser-r0", .data = &board_nb6, },
109 +#endif
110 #ifdef CONFIG_BCM63XX_CPU_6368
111 { .compatible = "brcm,bcm96368mvngr", .data = &board_96368mvngr, },
112 { .compatible = "brcm,bcm96368mvwg", .data = &board_96368mvwg, },