1 --- a/arch/arm/mach-orion5x/Kconfig
2 +++ b/arch/arm/mach-orion5x/Kconfig
3 @@ -74,6 +74,12 @@ config MACH_MSS2
4 Say 'Y' here if you want your kernel to support the
5 Maxtor Shared Storage II platform.
8 + bool "Netgear WNR854T"
10 + Say 'Y' here if you want your kernel to support the
11 + Netgear WNR854T platform.
16 --- a/arch/arm/mach-orion5x/Makefile
17 +++ b/arch/arm/mach-orion5x/Makefile
18 @@ -10,3 +10,4 @@ obj-$(CONFIG_MACH_WRT350N_V2) += wrt350n
19 obj-$(CONFIG_MACH_TS78XX) += ts78xx-setup.o
20 obj-$(CONFIG_MACH_MV2120) += mv2120-setup.o
21 obj-$(CONFIG_MACH_MSS2) += mss2-setup.o
22 +obj-$(CONFIG_MACH_WNR854T) += wnr854t-setup.o
24 +++ b/arch/arm/mach-orion5x/wnr854t-setup.c
27 + * arch/arm/mach-orion5x/wnr854t-setup.c
29 + * This file is licensed under the terms of the GNU General Public
30 + * License version 2. This program is licensed "as is" without any
31 + * warranty of any kind, whether express or implied.
34 +#include <linux/kernel.h>
35 +#include <linux/init.h>
36 +#include <linux/platform_device.h>
37 +#include <linux/pci.h>
38 +#include <linux/irq.h>
39 +#include <linux/delay.h>
40 +#include <linux/mtd/physmap.h>
41 +#include <linux/mv643xx_eth.h>
42 +#include <asm/mach-types.h>
43 +#include <asm/gpio.h>
44 +#include <asm/mach/arch.h>
45 +#include <asm/mach/pci.h>
46 +#include <asm/arch/orion5x.h>
50 +static struct orion5x_mpp_mode wnr854t_mpp_modes[] __initdata = {
51 + { 0, MPP_GPIO }, /* Power LED green (0=on) */
52 + { 1, MPP_GPIO }, /* Reset Button (0=off) */
53 + { 2, MPP_GPIO }, /* Power LED blink (0=off) */
54 + { 3, MPP_GPIO }, /* WAN Status LED amber (0=off) */
55 + { 4, MPP_GPIO }, /* PCI int */
56 + { 5, MPP_GPIO }, /* ??? */
57 + { 6, MPP_GPIO }, /* ??? */
58 + { 7, MPP_GPIO }, /* ??? */
59 + { 8, MPP_UNUSED }, /* ??? */
60 + { 9, MPP_GIGE }, /* GE_RXERR */
61 + { 10, MPP_UNUSED }, /* ??? */
62 + { 11, MPP_UNUSED }, /* ??? */
63 + { 12, MPP_GIGE }, /* GE_TXD[4] */
64 + { 13, MPP_GIGE }, /* GE_TXD[5] */
65 + { 14, MPP_GIGE }, /* GE_TXD[6] */
66 + { 15, MPP_GIGE }, /* GE_TXD[7] */
67 + { 16, MPP_GIGE }, /* GE_RXD[4] */
68 + { 17, MPP_GIGE }, /* GE_RXD[5] */
69 + { 18, MPP_GIGE }, /* GE_RXD[6] */
70 + { 19, MPP_GIGE }, /* GE_RXD[7] */
75 + * 8M NOR flash Device bus boot chip select
77 +#define WNR854T_NOR_BOOT_BASE 0xf4000000
78 +#define WNR854T_NOR_BOOT_SIZE SZ_8M
80 +static struct mtd_partition wnr854t_nor_flash_partitions[] = {
83 + .offset = 0x00000000,
87 + .offset = 0x00100000,
91 + .offset = 0x00760000,
96 +static struct physmap_flash_data wnr854t_nor_flash_data = {
98 + .parts = wnr854t_nor_flash_partitions,
99 + .nr_parts = ARRAY_SIZE(wnr854t_nor_flash_partitions),
102 +static struct resource wnr854t_nor_flash_resource = {
103 + .flags = IORESOURCE_MEM,
104 + .start = WNR854T_NOR_BOOT_BASE,
105 + .end = WNR854T_NOR_BOOT_BASE + WNR854T_NOR_BOOT_SIZE - 1,
108 +static struct platform_device wnr854t_nor_flash = {
109 + .name = "physmap-flash",
112 + .platform_data = &wnr854t_nor_flash_data,
114 + .num_resources = 1,
115 + .resource = &wnr854t_nor_flash_resource,
118 +static struct mv643xx_eth_platform_data wnr854t_eth_data = {
122 +static void __init wnr854t_init(void)
125 + * Setup basic Orion functions. Need to be called early.
129 + orion5x_mpp_conf(wnr854t_mpp_modes);
132 + * Configure peripherals.
134 + orion5x_eth_init(&wnr854t_eth_data);
135 + orion5x_uart0_init();
137 + orion5x_setup_dev_boot_win(WNR854T_NOR_BOOT_BASE,
138 + WNR854T_NOR_BOOT_SIZE);
139 + platform_device_register(&wnr854t_nor_flash);
142 +static int __init wnr854t_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
147 + * Check for devices with hard-wired IRQs.
149 + irq = orion5x_pci_map_irq(dev, slot, pin);
157 + return gpio_to_irq(4);
162 +static struct hw_pci wnr854t_pci __initdata = {
163 + .nr_controllers = 2,
164 + .swizzle = pci_std_swizzle,
165 + .setup = orion5x_pci_sys_setup,
166 + .scan = orion5x_pci_sys_scan_bus,
167 + .map_irq = wnr854t_pci_map_irq,
170 +static int __init wnr854t_pci_init(void)
172 + if (machine_is_wnr854t())
173 + pci_common_init(&wnr854t_pci);
177 +subsys_initcall(wnr854t_pci_init);
179 +MACHINE_START(WNR854T, "Netgear WNR854T")
180 + /* Maintainer: Imre Kaloz <kaloz@openwrt.org> */
181 + .phys_io = ORION5X_REGS_PHYS_BASE,
182 + .io_pg_offst = ((ORION5X_REGS_VIRT_BASE) >> 18) & 0xFFFC,
183 + .boot_params = 0x00000100,
184 + .init_machine = wnr854t_init,
185 + .map_io = orion5x_map_io,
186 + .init_irq = orion5x_init_irq,
187 + .timer = &orion5x_timer,
188 + .fixup = tag_fixup_mem32,
190 --- a/arch/arm/configs/orion5x_defconfig
191 +++ b/arch/arm/configs/orion5x_defconfig
192 @@ -166,6 +166,7 @@ CONFIG_MACH_KUROBOX_PRO=y
195 CONFIG_MACH_LINKSTATION_PRO=y
196 +CONFIG_MACH_WNR854T=y