brcm63xx: DVA-G3810BN/TL: Fix the WAN ethernet port
[oweals/openwrt.git] / target / linux / brcm63xx / patches-4.14 / 561-board_WAP-5813n.patch
1 --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
2 +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
3 @@ -13,6 +13,8 @@
4  #include <linux/kernel.h>
5  #include <linux/string.h>
6  #include <linux/pci_ids.h>
7 +#include <linux/platform_data/b53.h>
8 +#include <linux/spi/spi.h>
9  #include <asm/addrspace.h>
10  #include <bcm63xx_board.h>
11  #include <bcm63xx_cpu.h>
12 @@ -1566,6 +1568,47 @@ static struct board_info __initdata boar
13         .has_ohci0 = 1,
14         .has_ehci0 = 1,
15  };
16 +
17 +static struct sprom_fixup __initdata wap5813n_fixups[] = {
18 +       { .offset = 97, .value = 0xfeed },
19 +       { .offset = 98, .value = 0x15d1 },
20 +       { .offset = 99, .value = 0xfb0d },
21 +       { .offset = 113, .value = 0xfef7 },
22 +       { .offset = 114, .value = 0x15f7 },
23 +       { .offset = 115, .value = 0xfb1a },
24 +};
25 +
26 +static struct board_info __initdata board_WAP5813n = {
27 +       .name                           = "96369R-1231N",
28 +       .expected_cpu_id                = 0x6368,
29 +
30 +       .has_pci                        = 1,
31 +       .use_fallback_sprom             = 1,
32 +       .has_ohci0                      = 1,
33 +       .has_ehci0                      = 1,
34 +
35 +       .has_enetsw                     = 1,
36 +       .enetsw = {
37 +               .used_ports = {
38 +                       [4] = {
39 +                               .used = 1,
40 +                               .phy_id = 0xff,
41 +                               .bypass_link = 1,
42 +                               .force_speed = 1000,
43 +                               .force_duplex_full = 1,
44 +                               .name = "RGMII",
45 +                       },
46 +               },
47 +       },
48 +
49 +       .fallback_sprom = {
50 +               .type                           = SPROM_BCM43222,
51 +               .pci_bus                        = 0,
52 +               .pci_dev                        = 1,
53 +               .board_fixups                   = wap5813n_fixups,
54 +               .num_board_fixups               = ARRAY_SIZE(wap5813n_fixups),
55 +       },
56 +};
57  #endif /* CONFIG_BCM63XX_CPU_6368 */
58  
59  /*
60 @@ -1796,6 +1839,7 @@ static const struct board_info __initcon
61  #ifdef CONFIG_BCM63XX_CPU_6368
62         &board_96368mvwg,
63         &board_96368mvngr,
64 +       &board_WAP5813n,
65  #endif
66  #ifdef CONFIG_BCM63XX_CPU_63268
67         &board_963268bu_p300,
68 @@ -1888,6 +1932,7 @@ static struct of_device_id const bcm963x
69  #ifdef CONFIG_BCM63XX_CPU_6368
70         { .compatible = "brcm,bcm96368mvngr", .data = &board_96368mvngr, },
71         { .compatible = "brcm,bcm96368mvwg", .data = &board_96368mvwg, },
72 +       { .compatible = "comtrend,wap-5813n", .data = &board_WAP5813n, },
73  #endif
74  #ifdef CONFIG_BCM63XX_CPU_63268
75         { .compatible = "brcm,bcm963268bu_p300", .data = &board_963268bu_p300, },