fd15650648ca4f6fed85bb255efa9f6076b67539
[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 @@ -164,6 +164,91 @@ 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 +       .expected_cpu_id                        = 0x6328,
19 +
20 +       .has_uart0                              = 1,
21 +       .has_pci                                = 1,
22 +       .use_fallback_sprom                     = 1,
23 +       .has_ohci0                              = 1,
24 +       .has_ehci0                              = 1,
25 +       .num_usbh_ports                         = 1,
26 +       .has_enetsw                             = 1,
27 +
28 +       .enetsw = {
29 +               .used_ports = {
30 +                       [0] = {
31 +                               .used           = 1,
32 +                               .phy_id         = 1,
33 +                               .name           = "Port 1",
34 +                       },
35 +                       [1] = {
36 +                               .used           = 1,
37 +                               .phy_id         = 2,
38 +                               .name           = "Port 2",
39 +                       },
40 +                       [2] = {
41 +                               .used           = 1,
42 +                               .phy_id         = 3,
43 +                               .name           = "Port 3",
44 +                       },
45 +                       [3] = {
46 +                               .used           = 1,
47 +                               .phy_id         = 4,
48 +                               .name           = "Port 4",
49 +                       },
50 +               },
51 +       },
52 +
53 +       .leds = {
54 +               {
55 +                       .name                   = "AR-5381u:green:power",
56 +                       .gpio                   = 4,
57 +                       .active_low             = 1,
58 +                       .default_trigger        = "default-on",
59 +               },
60 +               {
61 +                       .name                   = "AR-5381u:red:alarm",
62 +                       .gpio                   = 2,
63 +                       .active_low             = 1,
64 +               },
65 +               {
66 +                       .name                   = "AR-5381u:green:inet",
67 +                       .gpio                   = 3,
68 +                       .active_low             = 1,
69 +               },
70 +       },
71 +
72 +       .buttons = {
73 +               {
74 +                       .desc                   = "reset",
75 +                       .gpio                   = 23,
76 +                       .active_low             = 1,
77 +                       .type                   = EV_KEY,
78 +                       .code                   = KEY_RESTART,
79 +                       .debounce_interval      = BCM963XX_KEYS_DEBOUNCE_INTERVAL,
80 +               },
81 +       },
82 +
83 +       .fallback_sprom = {
84 +               .type                           = SPROM_BCM43225,
85 +               .pci_bus                        = 1,
86 +               .pci_dev                        = 0,
87 +               .board_fixups                   = ar5381u_fixups,
88 +               .num_board_fixups               = ARRAY_SIZE(ar5381u_fixups),
89 +       },
90 +};
91 +
92  static struct sprom_fixup __initdata ar5387un_fixups[] = {
93         { .offset = 2, .value = 0x05bb },
94         { .offset = 65, .value = 0x1204 },
95 @@ -2912,6 +2997,7 @@ static const struct board_info __initcon
96  #endif
97  #ifdef CONFIG_BCM63XX_CPU_6328
98         &board_96328avng,
99 +       &board_AR5381u,
100         &board_AR5387un,
101         &board_963281TAN,
102         &board_A4001N1,
103 @@ -2983,6 +3069,7 @@ static struct of_device_id const bcm963x
104         { .compatible = "adb,a4001n1", .data = &board_A4001N1, },
105         { .compatible = "brcm,bcm963281TAN", .data = &board_963281TAN, },
106         { .compatible = "brcm,bcm96328avng", .data = &board_96328avng, },
107 +       { .compatible = "comtrend,ar-5381u", .data = &board_AR5381u, },
108         { .compatible = "comtrend,ar-5387un", .data = &board_AR5387un, },
109  #endif
110  #ifdef CONFIG_BCM63XX_CPU_6338