bcm63xx: refactor board patches
[openwrt/openwrt.git] / target / linux / bcm63xx / patches-5.4 / 560-board_AR-5315u.patch
1 --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
2 +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
3 @@ -137,6 +137,65 @@ static struct board_info __initdata boar
4 },
5 };
6
7 +static struct sprom_fixup __initdata ar5315u_fixups[] = {
8 + { .offset = 6, .value = 0x1c00 },
9 + { .offset = 65, .value = 0x1255 },
10 + { .offset = 97, .value = 0xfe55 },
11 + { .offset = 98, .value = 0x171d },
12 + { .offset = 99, .value = 0xfa42 },
13 + { .offset = 113, .value = 0xfeb7 },
14 + { .offset = 114, .value = 0x18cd },
15 + { .offset = 115, .value = 0xfa4f },
16 + { .offset = 162, .value = 0x6444 },
17 + { .offset = 170, .value = 0x6444 },
18 + { .offset = 172, .value = 0x6444 },
19 +};
20 +
21 +static struct board_info __initdata board_AR5315u = {
22 + .name = "96318A-1441N1",
23 + .expected_cpu_id = 0x6318,
24 +
25 + .has_pci = 1,
26 + .has_ohci0 = 1,
27 + .has_ehci0 = 1,
28 + .num_usbh_ports = 1,
29 +
30 + .has_enetsw = 1,
31 + .enetsw = {
32 + .used_ports = {
33 + [0] = {
34 + .used = 1,
35 + .phy_id = 1,
36 + .name = "LAN4",
37 + },
38 + [1] = {
39 + .used = 1,
40 + .phy_id = 2,
41 + .name = "LAN3",
42 + },
43 + [2] = {
44 + .used = 1,
45 + .phy_id = 3,
46 + .name = "LAN2",
47 + },
48 + [3] = {
49 + .used = 1,
50 + .phy_id = 4,
51 + .name = "LAN1",
52 + },
53 + },
54 + },
55 +
56 + .use_fallback_sprom = 1,
57 + .fallback_sprom = {
58 + .type = SPROM_BCM43217,
59 + .pci_bus = 1,
60 + .pci_dev = 0,
61 + .board_fixups = ar5315u_fixups,
62 + .num_board_fixups = ARRAY_SIZE(ar5315u_fixups),
63 + },
64 +};
65 +
66 static struct sprom_fixup __initdata dsl2751b_e1_fixups[] = {
67 { .offset = 96, .value = 0x2046 },
68 { .offset = 97, .value = 0xfe9d },
69 @@ -2482,6 +2541,7 @@ static const struct board_info __initcon
70 #ifdef CONFIG_BCM63XX_CPU_6318
71 &board_96318ref,
72 &board_96318ref_p300,
73 + &board_AR5315u,
74 &board_dsl_2751b_d1,
75 &board_FAST2704N,
76 #endif /* CONFIG_BCM63XX_CPU_6318 */
77 @@ -2584,6 +2644,7 @@ static struct of_device_id const bcm963x
78 #ifdef CONFIG_BCM63XX_CPU_6318
79 { .compatible = "brcm,bcm96318ref", .data = &board_96318ref, },
80 { .compatible = "brcm,bcm96318ref-p300", .data = &board_96318ref_p300, },
81 + { .compatible = "comtrend,ar-5315u", .data = &board_AR5315u, },
82 { .compatible = "d-link,dsl-275xb-d1", .data = &board_dsl_2751b_d1, },
83 { .compatible = "sagem,fast-2704n", .data = &board_FAST2704N, },
84 #endif