brcm63xx: Add DT support for AR-5387un
[openwrt.git] / target / linux / brcm63xx / patches-3.14 / 532-board_AR-5381u.patch
1 --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
2 +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
3 @@ -166,6 +166,92 @@ static struct board_info __initdata boar
4         },
5  };
6  
7 +static struct sprom_fixup __initdata ar5381u_fixups[] = {
8 +       { .offset = 97, .value = 0xfee5 },
9 +       { .offset = 98, .value = 0x157c },
10 +       { .offset = 99, .value = 0xfae7 },
11 +       { .offset = 113, .value = 0xfefa },
12 +       { .offset = 114, .value = 0x15d6 },
13 +       { .offset = 115, .value = 0xfaf8 },
14 +};
15 +
16 +static struct board_info __initdata board_AR5381u = {
17 +       .name                                   = "96328A-1241N",
18 +       .of_board_id                            = "comtrend,ar-5381u",
19 +       .expected_cpu_id                        = 0x6328,
20 +
21 +       .has_uart0                              = 1,
22 +       .has_pci                                = 1,
23 +       .use_fallback_sprom                     = 1,
24 +       .has_ohci0                              = 1,
25 +       .has_ehci0                              = 1,
26 +       .num_usbh_ports                         = 1,
27 +       .has_enetsw                             = 1,
28 +
29 +       .enetsw = {
30 +               .used_ports = {
31 +                       [0] = {
32 +                               .used           = 1,
33 +                               .phy_id         = 1,
34 +                               .name           = "Port 1",
35 +                       },
36 +                       [1] = {
37 +                               .used           = 1,
38 +                               .phy_id         = 2,
39 +                               .name           = "Port 2",
40 +                       },
41 +                       [2] = {
42 +                               .used           = 1,
43 +                               .phy_id         = 3,
44 +                               .name           = "Port 3",
45 +                       },
46 +                       [3] = {
47 +                               .used           = 1,
48 +                               .phy_id         = 4,
49 +                               .name           = "Port 4",
50 +                       },
51 +               },
52 +       },
53 +
54 +       .leds = {
55 +               {
56 +                       .name                   = "AR-5381u:green:power",
57 +                       .gpio                   = 4,
58 +                       .active_low             = 1,
59 +                       .default_trigger        = "default-on",
60 +               },
61 +               {
62 +                       .name                   = "AR-5381u:red:alarm",
63 +                       .gpio                   = 2,
64 +                       .active_low             = 1,
65 +               },
66 +               {
67 +                       .name                   = "AR-5381u:green:inet",
68 +                       .gpio                   = 3,
69 +                       .active_low             = 1,
70 +               },
71 +       },
72 +
73 +       .buttons = {
74 +               {
75 +                       .desc                   = "reset",
76 +                       .gpio                   = 23,
77 +                       .active_low             = 1,
78 +                       .type                   = EV_KEY,
79 +                       .code                   = KEY_RESTART,
80 +                       .debounce_interval      = BCM963XX_KEYS_DEBOUNCE_INTERVAL,
81 +               },
82 +       },
83 +
84 +       .fallback_sprom = {
85 +               .type                           = SPROM_BCM43225,
86 +               .pci_bus                        = 1,
87 +               .pci_dev                        = 0,
88 +               .board_fixups                   = ar5381u_fixups,
89 +               .num_board_fixups               = ARRAY_SIZE(ar5381u_fixups),
90 +       },
91 +};
92 +
93  static struct sprom_fixup __initdata ar5387un_fixups[] = {
94         { .offset = 2, .value = 0x05bb },
95         { .offset = 65, .value = 0x1204 },
96 @@ -2931,6 +3017,7 @@ static const struct board_info __initcon
97  #endif
98  #ifdef CONFIG_BCM63XX_CPU_6328
99         &board_96328avng,
100 +       &board_AR5381u,
101         &board_AR5387un,
102         &board_963281TAN,
103         &board_A4001N1,