2 * arch/arm/mach-orion/dns323-setup.c
4 * Copyright (C) 2007 Herbert Valerio Riedel <hvr@gnu.org>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU Lesser General Public License as
8 * published by the Free Software Foundation; either version 2 of the
9 * License, or (at your option) any later version.
13 #include <linux/kernel.h>
14 #include <linux/init.h>
15 #include <linux/platform_device.h>
16 #include <linux/pci.h>
17 #include <linux/irq.h>
18 #include <linux/mtd/physmap.h>
19 #include <linux/mv643xx_eth.h>
20 #include <linux/leds.h>
21 #include <linux/gpio_keys.h>
22 #include <linux/input.h>
23 #include <linux/i2c.h>
24 #include <asm/mach-types.h>
26 #include <asm/mach/arch.h>
27 #include <asm/mach/pci.h>
28 #include <asm/arch/orion.h>
29 #include <asm/arch/platform.h>
33 /****************************************************************************
37 static struct mv643xx_eth_platform_data wrt350n_v2_eth_data
= {
41 /****************************************************************************
44 * Layout as used by Linksys:
45 * 0x00000000-0x00760000 : "kernel"
46 * 0x001a0000-0x00760000 : "rootfs"
47 * 0x00760000-0x007a0000 : "lang"
48 * 0x007a0000-0x007c0000 : "nvram"
49 * 0x007c0000-0x00800000 : "u-boot"
52 #define WRT350N_V2_NOR_BOOT_BASE 0xf4000000
53 #define WRT350N_V2_NOR_BOOT_SIZE SZ_8M
55 static struct mtd_partition wrt350n_v2_partitions
[] = {
79 static struct physmap_flash_data wrt350n_v2_nor_flash_data
= {
81 .parts
= wrt350n_v2_partitions
,
82 .nr_parts
= ARRAY_SIZE(wrt350n_v2_partitions
)
85 static struct resource wrt350n_v2_nor_flash_resource
= {
86 .flags
= IORESOURCE_MEM
,
87 .start
= WRT350N_V2_NOR_BOOT_BASE
,
88 .end
= WRT350N_V2_NOR_BOOT_BASE
+ WRT350N_V2_NOR_BOOT_SIZE
- 1,
91 static struct platform_device wrt350n_v2_nor_flash
= {
92 .name
= "physmap-flash",
94 .dev
= { .platform_data
= &wrt350n_v2_nor_flash_data
, },
95 .resource
= &wrt350n_v2_nor_flash_resource
,
101 /**************************************************************************
105 static struct platform_device
*wrt350n_v2_plat_devices
[] __initdata
= {
106 &wrt350n_v2_nor_flash
,
109 static void __init
wrt350n_v2_init(void)
111 /* Setup basic Orion functions. Need to be called early. */
114 /* setup flash mapping
116 orion_setup_cpu_win(ORION_DEV_BOOT
, WRT350N_V2_NOR_BOOT_BASE
,
117 WRT350N_V2_NOR_BOOT_SIZE
, -1);
120 /* set MPP as Linksys's kernel did */
121 orion_write(MPP_0_7_CTRL
, 0x00000003);
122 orion_write(MPP_8_15_CTRL
, 0x00000101);
123 orion_write(MPP_16_19_CTRL
, 0);
124 orion_write(MPP_DEV_CTRL
, 0);
126 /* register flash and other platform devices */
127 platform_add_devices(wrt350n_v2_plat_devices
,
128 ARRAY_SIZE(wrt350n_v2_plat_devices
));
129 orion_eth_init(&wrt350n_v2_eth_data
);
133 MACHINE_START(WRT350N_V2
, "Linksys WRT350N v2")
134 /* Maintainer: No-one yet*/
135 .phys_io
= ORION_REGS_PHYS_BASE
,
136 .io_pg_offst
= ((ORION_REGS_VIRT_BASE
) >> 18) & 0xFFFC,
137 .boot_params
= 0x00000100,
138 .init_machine
= wrt350n_v2_init
,
139 .map_io
= orion_map_io
,
140 .init_irq
= orion_init_irq
,
141 .timer
= &orion_timer
,