brcm63xx: use dtb board detection for neufbox 4
[openwrt/svn-archive/archive.git] / target / linux / brcm63xx / patches-3.14 / 520-bcm63xx-add-support-for-96368MVWG-board.patch
1 From eeacc2529942051504bc957726aa178671344421 Mon Sep 17 00:00:00 2001
2 From: Maxime Bizon <mbizon@freebox.fr>
3 Date: Wed, 20 Jan 2010 16:21:30 +0100
4 Subject: [PATCH 32/63] bcm63xx: add support for 96368MVWG board.
5
6 ---
7 arch/mips/bcm63xx/boards/board_bcm963xx.c | 95 ++++++++++++++++++++
8 .../mips/include/asm/mach-bcm63xx/board_bcm963xx.h | 2 +
9 2 files changed, 97 insertions(+), 0 deletions(-)
10
11 --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
12 +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
13 @@ -1931,6 +1931,85 @@ static struct board_info __initdata boar
14 #endif /* CONFIG_BCM63XX_CPU_6358 */
15
16 /*
17 + * known 6368 boards
18 + */
19 +#ifdef CONFIG_BCM63XX_CPU_6368
20 +static struct board_info __initdata board_96368mvwg = {
21 + .name = "96368MVWG",
22 + .expected_cpu_id = 0x6368,
23 +
24 + .has_uart0 = 1,
25 + .has_pci = 1,
26 +
27 + .has_usbd = 1,
28 +
29 + .usbd = {
30 + .use_fullspeed = 0,
31 + .port_no = 0,
32 + },
33 +
34 + .has_enetsw = 1,
35 +
36 + .enetsw = {
37 + .used_ports = {
38 + [1] = {
39 + .used = 1,
40 + .phy_id = 2,
41 + .name = "port1",
42 + },
43 +
44 + [2] = {
45 + .used = 1,
46 + .phy_id = 3,
47 + .name = "port2",
48 + },
49 +
50 + [4] = {
51 + .used = 1,
52 + .phy_id = 0x12,
53 + .name = "port0",
54 + },
55 +
56 + [5] = {
57 + .used = 1,
58 + .phy_id = 0x11,
59 + .name = "port3",
60 + },
61 + },
62 + },
63 +
64 + .leds = {
65 + {
66 + .name = "96368MVWG:green:adsl",
67 + .gpio = 2,
68 + .active_low = 1,
69 + },
70 + {
71 + .name = "96368MVWG:green:ppp",
72 + .gpio = 5,
73 + },
74 + {
75 + .name = "96368MVWG:green:power",
76 + .gpio = 22,
77 + .default_trigger = "default-on",
78 + },
79 + {
80 + .name = "96368MVWG:green:wps",
81 + .gpio = 23,
82 + .active_low = 1,
83 + },
84 + {
85 + .name = "96368MVWG:red:ppp-fail",
86 + .gpio = 31,
87 + },
88 + },
89 +
90 + .has_ohci0 = 1,
91 + .has_ehci0 = 1,
92 +};
93 +#endif /* CONFIG_BCM63XX_CPU_6368 */
94 +
95 +/*
96 * all boards
97 */
98 static const struct board_info __initconst *bcm963xx_boards[] = {
99 @@ -1982,6 +2061,10 @@ static const struct board_info __initcon
100 &board_HW553,
101 &board_spw303v,
102 #endif
103 +
104 +#ifdef CONFIG_BCM63XX_CPU_6368
105 + &board_96368mvwg,
106 +#endif
107 };
108
109 static void __init boardid_fixup(u8 *boot_addr)
110 --- a/arch/mips/bcm63xx/boards/board_common.c
111 +++ b/arch/mips/bcm63xx/boards/board_common.c
112 @@ -88,12 +88,25 @@ void __init board_early_setup(const stru
113 bcm63xx_pci_enabled = 1;
114 if (BCMCPU_IS_6348())
115 val |= GPIO_MODE_6348_G2_PCI;
116 +
117 + if (BCMCPU_IS_6368())
118 + val |= GPIO_MODE_6368_PCI_REQ1 |
119 + GPIO_MODE_6368_PCI_GNT1 |
120 + GPIO_MODE_6368_PCI_INTB |
121 + GPIO_MODE_6368_PCI_REQ0 |
122 + GPIO_MODE_6368_PCI_GNT0;
123 }
124 #endif
125
126 if (board.has_pccard) {
127 if (BCMCPU_IS_6348())
128 val |= GPIO_MODE_6348_G1_MII_PCCARD;
129 +
130 + if (BCMCPU_IS_6368())
131 + val |= GPIO_MODE_6368_PCMCIA_CD1 |
132 + GPIO_MODE_6368_PCMCIA_CD2 |
133 + GPIO_MODE_6368_PCMCIA_VS1 |
134 + GPIO_MODE_6368_PCMCIA_VS2;
135 }
136
137 if (board.has_enet0 && !board.enet0.use_internal_phy) {