sunxi: Add support for SY8106A voltage regulator
[openwrt/openwrt.git] / target / linux / orion / patches-4.9 / 210-wn802t_support.patch
1 --- a/arch/arm/mach-orion5x/Kconfig
2 +++ b/arch/arm/mach-orion5x/Kconfig
3 @@ -159,10 +159,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 __initda
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,10 @@ 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);
42 + if (machine_is_wn802t())
43 + orion5x_eth_switch_init(&wn802t_switch_plat_data);
44 + else
45 + orion5x_eth_switch_init(&wnr854t_switch_plat_data);
46 orion5x_uart0_init();
47
48 mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_BOOT_TARGET,
49 @@ -168,7 +180,7 @@ static struct hw_pci wnr854t_pci __initd
50
51 static int __init wnr854t_pci_init(void)
52 {
53 - if (machine_is_wnr854t())
54 + if (machine_is_wnr854t() || machine_is_wn802t())
55 pci_common_init(&wnr854t_pci);
56
57 return 0;
58 @@ -187,3 +199,15 @@ MACHINE_START(WNR854T, "Netgear WNR854T"
59 .fixup = tag_fixup_mem32,
60 .restart = orion5x_restart,
61 MACHINE_END
62 +
63 +MACHINE_START(WN802T, "Netgear WN802T")
64 + /* Maintainer: Imre Kaloz <kaloz@openwrt.org> */
65 + .atag_offset = 0x100,
66 + .init_machine = wnr854t_init,
67 + .map_io = orion5x_map_io,
68 + .init_early = orion5x_init_early,
69 + .init_irq = orion5x_init_irq,
70 + .init_time = orion5x_timer_init,
71 + .fixup = tag_fixup_mem32,
72 + .restart = orion5x_restart,
73 +MACHINE_END