[orion]: add support for Netgear WN802T
[openwrt/svn-archive/archive.git] / target / linux / orion / patches-3.3 / 210-wn802t_support.patch
1 --- a/arch/arm/mach-orion5x/Kconfig
2 +++ b/arch/arm/mach-orion5x/Kconfig
3 @@ -139,10 +139,13 @@ config MACH_MSS2
4 Maxtor Shared Storage II platform.
5
6 config MACH_WNR854T
7 - bool "Netgear WNR854T"
8 + bool "Netgear WNR854T / WN802T"
9 help
10 Say 'Y' here if you want your kernel to support the
11 - Netgear WNR854T platform.
12 + Netgear WNR854T or WN802T platform.
13 +
14 +config MACH_WN802T
15 + def_bool MACH_WNR854T
16
17 config MACH_RD88F5181L_GE
18 bool "Marvell Orion-VoIP GE Reference Design"
19 --- a/arch/arm/mach-orion5x/wnr854t-setup.c
20 +++ b/arch/arm/mach-orion5x/wnr854t-setup.c
21 @@ -115,6 +115,15 @@ static struct dsa_platform_data wnr854t_
22 .chip = &wnr854t_switch_chip_data,
23 };
24
25 +static struct dsa_chip_data wn802t_switch_chip_data = {
26 + .port_names[2] = "wan",
27 + .port_names[3] = "cpu",
28 +};
29 +
30 +static struct dsa_platform_data wn802t_switch_plat_data = {
31 + .nr_chips = 1,
32 + .chip = &wn802t_switch_chip_data,
33 +};
34 static void __init wnr854t_init(void)
35 {
36 /*
37 @@ -128,7 +137,12 @@ static void __init wnr854t_init(void)
38 * Configure peripherals.
39 */
40 orion5x_eth_init(&wnr854t_eth_data);
41 - orion5x_eth_switch_init(&wnr854t_switch_plat_data, NO_IRQ);
42 +
43 + if (machine_is_wn802t())
44 + orion5x_eth_switch_init(&wn802t_switch_plat_data, NO_IRQ);
45 + else
46 + orion5x_eth_switch_init(&wnr854t_switch_plat_data, NO_IRQ);
47 +
48 orion5x_uart0_init();
49
50 orion5x_setup_dev_boot_win(WNR854T_NOR_BOOT_BASE,
51 @@ -167,7 +181,7 @@ static struct hw_pci wnr854t_pci __initd
52
53 static int __init wnr854t_pci_init(void)
54 {
55 - if (machine_is_wnr854t())
56 + if (machine_is_wnr854t() || machine_is_wn802t())
57 pci_common_init(&wnr854t_pci);
58
59 return 0;
60 @@ -178,6 +192,18 @@ MACHINE_START(WNR854T, "Netgear WNR854T"
61 /* Maintainer: Imre Kaloz <kaloz@openwrt.org> */
62 .atag_offset = 0x100,
63 .init_machine = wnr854t_init,
64 + .map_io = orion5x_map_io,
65 + .init_early = orion5x_init_early,
66 + .init_irq = orion5x_init_irq,
67 + .timer = &orion5x_timer,
68 + .fixup = tag_fixup_mem32,
69 + .restart = orion5x_restart,
70 +MACHINE_END
71 +
72 +MACHINE_START(WN802T, "Netgear WN802T")
73 + /* Maintainer: Imre Kaloz <kaloz@openwrt.org> */
74 + .atag_offset = 0x100,
75 + .init_machine = wnr854t_init,
76 .map_io = orion5x_map_io,
77 .init_early = orion5x_init_early,
78 .init_irq = orion5x_init_irq,