OpenWrt – Diff between revs 2 and 3
?pathlinks?
Rev 2 | Rev 3 | |||
---|---|---|---|---|
Line 22... | Line 22... | |||
22 | @@ -1 +1,2 @@ |
22 | @@ -1 +1,2 @@ |
|
23 | +obj-y += board_common.o |
23 | +obj-y += board_common.o |
|
24 | obj-$(CONFIG_BOARD_BCM963XX) += board_bcm963xx.o |
24 | obj-$(CONFIG_BOARD_BCM963XX) += board_bcm963xx.o |
|
25 | --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c |
25 | --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c |
|
26 | +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c |
26 | +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c |
|
27 | @@ -12,33 +12,21 @@ |
27 | @@ -12,34 +12,21 @@ |
|
28 | #include <linux/init.h> |
28 | #include <linux/init.h> |
|
29 | #include <linux/kernel.h> |
29 | #include <linux/kernel.h> |
|
30 | #include <linux/string.h> |
30 | #include <linux/string.h> |
|
31 | -#include <linux/platform_device.h> |
31 | -#include <linux/platform_device.h> |
|
32 | -#include <linux/ssb/ssb.h> |
32 | -#include <linux/ssb/ssb.h> |
|
Line 37... | Line 37... | |||
37 | #include <bcm63xx_regs.h> |
37 | #include <bcm63xx_regs.h> |
|
38 | #include <bcm63xx_io.h> |
38 | #include <bcm63xx_io.h> |
|
39 | #include <bcm63xx_nvram.h> |
39 | #include <bcm63xx_nvram.h> |
|
40 | -#include <bcm63xx_dev_pci.h> |
40 | -#include <bcm63xx_dev_pci.h> |
|
41 | -#include <bcm63xx_dev_enet.h> |
41 | -#include <bcm63xx_dev_enet.h> |
|
- | 42 | -#include <bcm63xx_dev_dsp.h> |
||
42 | -#include <bcm63xx_dev_flash.h> |
43 | -#include <bcm63xx_dev_flash.h> |
|
43 | -#include <bcm63xx_dev_hsspi.h> |
44 | -#include <bcm63xx_dev_hsspi.h> |
|
44 | -#include <bcm63xx_dev_pcmcia.h> |
45 | -#include <bcm63xx_dev_pcmcia.h> |
|
45 | -#include <bcm63xx_dev_spi.h> |
46 | -#include <bcm63xx_dev_spi.h> |
|
46 | -#include <bcm63xx_dev_usb_ehci.h> |
47 | -#include <bcm63xx_dev_usb_ehci.h> |
|
Line 58... | Line 59... | |||
58 | -static struct board_info board; |
59 | -static struct board_info board; |
|
59 | - |
60 | - |
|
60 | /* |
61 | /* |
|
61 | * known 3368 boards |
62 | * known 3368 boards |
|
62 | */ |
63 | */ |
|
63 | @@ -695,52 +683,6 @@ static const struct board_info __initcon |
64 | @@ -712,52 +699,6 @@ static const struct board_info __initcon |
|
64 | }; |
65 | }; |
|
Line 65... | Line 66... | |||
65 | |
66 | |
|
66 | /* |
67 | /* |
|
67 | - * Register a sane SPROMv2 to make the on-board |
68 | - * Register a sane SPROMv2 to make the on-board |
|
Line 111... | Line 112... | |||
111 | - |
112 | - |
|
112 | -/* |
113 | -/* |
|
113 | * early init callback, read nvram data from flash and checksum it |
114 | * early init callback, read nvram data from flash and checksum it |
|
114 | */ |
115 | */ |
|
115 | void __init board_prom_init(void) |
116 | void __init board_prom_init(void) |
|
116 | @@ -785,137 +727,15 @@ void __init board_prom_init(void) |
117 | @@ -802,140 +743,15 @@ void __init board_prom_init(void) |
|
117 | if (strncmp(board_name, bcm963xx_boards[i]->name, 16)) |
118 | if (strncmp(board_name, bcm963xx_boards[i]->name, 16)) |
|
118 | continue; |
119 | continue; |
|
119 | /* copy, board desc array is marked initdata */ |
120 | /* copy, board desc array is marked initdata */ |
|
120 | - memcpy(&board, bcm963xx_boards[i], sizeof(board)); |
121 | - memcpy(&board, bcm963xx_boards[i], sizeof(board)); |
|
121 | + board_early_setup(bcm963xx_boards[i]); |
122 | + board_early_setup(bcm963xx_boards[i]); |
|
Line 141... | Line 142... | |||
141 | -#ifdef CONFIG_PCI |
142 | -#ifdef CONFIG_PCI |
|
142 | - if (board.has_pci) { |
143 | - if (board.has_pci) { |
|
143 | - bcm63xx_pci_enabled = 1; |
144 | - bcm63xx_pci_enabled = 1; |
|
144 | - if (BCMCPU_IS_6348()) |
145 | - if (BCMCPU_IS_6348()) |
|
145 | - val |= GPIO_MODE_6348_G2_PCI; |
146 | - val |= GPIO_MODE_6348_G2_PCI; |
|
146 | } |
147 | - } |
|
147 | -#endif |
148 | -#endif |
|
148 | - |
149 | - |
|
149 | - if (board.has_pccard) { |
150 | - if (board.has_pccard) { |
|
150 | - if (BCMCPU_IS_6348()) |
151 | - if (BCMCPU_IS_6348()) |
|
151 | - val |= GPIO_MODE_6348_G1_MII_PCCARD; |
152 | - val |= GPIO_MODE_6348_G1_MII_PCCARD; |
|
Line 222... | Line 223... | |||
222 | - bcm63xx_ehci_register(); |
223 | - bcm63xx_ehci_register(); |
|
223 | - |
224 | - |
|
224 | - if (board.has_ohci0) |
225 | - if (board.has_ohci0) |
|
225 | - bcm63xx_ohci_register(); |
226 | - bcm63xx_ohci_register(); |
|
226 | - |
227 | - |
|
- | 228 | - if (board.has_dsp) |
||
- | 229 | - bcm63xx_dsp_register(&board.dsp); |
||
- | 230 | - |
||
227 | - /* Generate MAC address for WLAN and register our SPROM, |
231 | - /* Generate MAC address for WLAN and register our SPROM, |
|
228 | - * do this after registering enet devices |
232 | - * do this after registering enet devices |
|
229 | - */ |
233 | - */ |
|
230 | -#ifdef CONFIG_SSB_PCIHOST |
234 | -#ifdef CONFIG_SSB_PCIHOST |
|
231 | - if (!bcm63xx_nvram_get_mac_address(bcm63xx_sprom.il0mac)) { |
235 | - if (!bcm63xx_nvram_get_mac_address(bcm63xx_sprom.il0mac)) { |
|
232 | - memcpy(bcm63xx_sprom.et0mac, bcm63xx_sprom.il0mac, ETH_ALEN); |
236 | - memcpy(bcm63xx_sprom.et0mac, bcm63xx_sprom.il0mac, ETH_ALEN); |
|
233 | - memcpy(bcm63xx_sprom.et1mac, bcm63xx_sprom.il0mac, ETH_ALEN); |
237 | - memcpy(bcm63xx_sprom.et1mac, bcm63xx_sprom.il0mac, ETH_ALEN); |
|
234 | - if (ssb_arch_register_fallback_sprom( |
238 | - if (ssb_arch_register_fallback_sprom( |
|
235 | - &bcm63xx_get_fallback_sprom) < 0) |
239 | - &bcm63xx_get_fallback_sprom) < 0) |
|
236 | - pr_err("failed to register fallback SPROM\n"); |
240 | - pr_err("failed to register fallback SPROM\n"); |
|
237 | - } |
241 | } |
|
238 | -#endif |
242 | -#endif |
|
239 | - |
243 | - |
|
240 | - bcm63xx_spi_register(); |
244 | - bcm63xx_spi_register(); |
|
241 | - |
245 | - |
|
242 | - bcm63xx_hsspi_register(); |
246 | - bcm63xx_hsspi_register(); |
|
Line 254... | Line 258... | |||
254 | - |
258 | - |
|
255 | - return 0; |
259 | - return 0; |
|
256 | } |
260 | } |
|
257 | --- /dev/null |
261 | --- /dev/null |
|
258 | +++ b/arch/mips/bcm63xx/boards/board_common.c |
262 | +++ b/arch/mips/bcm63xx/boards/board_common.c |
|
259 | @@ -0,0 +1,214 @@ |
263 | @@ -0,0 +1,218 @@ |
|
260 | +/* |
264 | +/* |
|
261 | + * This file is subject to the terms and conditions of the GNU General Public |
265 | + * This file is subject to the terms and conditions of the GNU General Public |
|
262 | + * License. See the file "COPYING" in the main directory of this archive |
266 | + * License. See the file "COPYING" in the main directory of this archive |
|
263 | + * for more details. |
267 | + * for more details. |
|
264 | + * |
268 | + * |
|
Line 279... | Line 283... | |||
279 | +#include <bcm63xx_io.h> |
283 | +#include <bcm63xx_io.h> |
|
280 | +#include <bcm63xx_nvram.h> |
284 | +#include <bcm63xx_nvram.h> |
|
281 | +#include <bcm63xx_gpio.h> |
285 | +#include <bcm63xx_gpio.h> |
|
282 | +#include <bcm63xx_dev_pci.h> |
286 | +#include <bcm63xx_dev_pci.h> |
|
283 | +#include <bcm63xx_dev_enet.h> |
287 | +#include <bcm63xx_dev_enet.h> |
|
- | 288 | +#include <bcm63xx_dev_dsp.h> |
||
284 | +#include <bcm63xx_dev_flash.h> |
289 | +#include <bcm63xx_dev_flash.h> |
|
285 | +#include <bcm63xx_dev_hsspi.h> |
290 | +#include <bcm63xx_dev_hsspi.h> |
|
286 | +#include <bcm63xx_dev_pcmcia.h> |
291 | +#include <bcm63xx_dev_pcmcia.h> |
|
287 | +#include <bcm63xx_dev_spi.h> |
292 | +#include <bcm63xx_dev_spi.h> |
|
288 | +#include <bcm63xx_dev_usb_ehci.h> |
293 | +#include <bcm63xx_dev_usb_ehci.h> |
|
Line 439... | Line 444... | |||
439 | + bcm63xx_ehci_register(); |
444 | + bcm63xx_ehci_register(); |
|
440 | + |
445 | + |
|
441 | + if (board.has_ohci0) |
446 | + if (board.has_ohci0) |
|
442 | + bcm63xx_ohci_register(); |
447 | + bcm63xx_ohci_register(); |
|
443 | + |
448 | + |
|
- | 449 | + if (board.has_dsp) |
||
- | 450 | + bcm63xx_dsp_register(&board.dsp); |
||
- | 451 | + |
||
444 | + /* Generate MAC address for WLAN and register our SPROM, |
452 | + /* Generate MAC address for WLAN and register our SPROM, |
|
445 | + * do this after registering enet devices |
453 | + * do this after registering enet devices |
|
446 | + */ |
454 | + */ |
|
447 | +#ifdef CONFIG_SSB_PCIHOST |
455 | +#ifdef CONFIG_SSB_PCIHOST |
|
448 | + if (!bcm63xx_nvram_get_mac_address(bcm63xx_sprom.il0mac)) { |
456 | + if (!bcm63xx_nvram_get_mac_address(bcm63xx_sprom.il0mac)) { |