e7827edd29eb737176bbb2a0ee7b42dda5c4fc21
[openwrt/openwrt.git] / target / linux / orion / patches-4.4 / 210-wn802t_support.patch
1 --- a/arch/arm/mach-orion5x/Kconfig
2 +++ b/arch/arm/mach-orion5x/Kconfig
3 @@ -147,10 +147,13 @@ config MACH_MSS2_DT
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 mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_BOOT_TARGET,
51 @@ -168,7 +182,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 @@ -186,3 +200,15 @@ MACHINE_START(WNR854T, "Netgear WNR854T"
61 .fixup = tag_fixup_mem32,
62 .restart = orion5x_restart,
63 MACHINE_END
64 +
65 +MACHINE_START(WN802T, "Netgear WN802T")
66 + /* Maintainer: Imre Kaloz <kaloz@openwrt.org> */
67 + .atag_offset = 0x100,
68 + .init_machine = wnr854t_init,
69 + .map_io = orion5x_map_io,
70 + .init_early = orion5x_init_early,
71 + .init_irq = orion5x_init_irq,
72 + .init_time = orion5x_timer_init,
73 + .fixup = tag_fixup_mem32,
74 + .restart = orion5x_restart,
75 +MACHINE_END