2 * arch/arm/mach-kirkwood/iconnect-setup.c
4 * Iomega iConnect Wireless
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
11 #include <linux/kernel.h>
12 #include <linux/init.h>
13 #include <linux/platform_device.h>
14 #include <linux/irq.h>
15 #include <linux/mtd/partitions.h>
16 #include <linux/mv643xx_eth.h>
17 #include <linux/ethtool.h>
18 #include <linux/gpio.h>
19 #include <linux/gpio_keys.h>
20 #include <linux/input.h>
21 #include <linux/leds.h>
22 #include <asm/mach-types.h>
23 #include <asm/mach/arch.h>
24 #include <mach/kirkwood.h>
28 static struct mtd_partition iconnect_nand_parts
[] = {
35 .offset
= MTDPART_OFS_NXTBLK
,
39 .offset
= MTDPART_OFS_NXTBLK
,
43 .offset
= MTDPART_OFS_NXTBLK
,
44 .size
= MTDPART_SIZ_FULL
48 static struct mv643xx_eth_platform_data iconnect_ge00_data
= {
49 .phy_addr
= MV643XX_ETH_PHY_ADDR(11),
52 static struct gpio_led iconnect_led_pins
[] = {
54 .name
= "iconnect:blue:power",
55 .default_trigger
= "default-on",
59 .name
= "iconnect:red:power",
63 .name
= "iconnect:blue:usb1",
67 .name
= "iconnect:blue:usb2",
71 .name
= "iconnect:blue:usb3",
75 .name
= "iconnect:blue:usb4",
79 .name
= "iconnect:blue:otb",
84 static struct gpio_led_platform_data iconnect_led_data
= {
85 .leds
= iconnect_led_pins
,
86 .num_leds
= ARRAY_SIZE(iconnect_led_pins
),
89 static struct platform_device iconnect_leds
= {
93 .platform_data
= &iconnect_led_data
,
97 #define ICONNECT_GPIO_KEY_RESET 12
98 #define ICONNECT_GPIO_KEY_OTB 35
100 #define ICONNECT_SW_RESET 0x00
101 #define ICONNECT_SW_OTB 0x01
103 static struct gpio_keys_button iconnect_buttons
[] = {
106 .code
= ICONNECT_SW_RESET
,
107 .gpio
= ICONNECT_GPIO_KEY_RESET
,
108 .desc
= "Reset Button",
110 .debounce_interval
= 100,
114 .code
= ICONNECT_SW_OTB
,
115 .gpio
= ICONNECT_GPIO_KEY_OTB
,
116 .desc
= "OTB Button",
118 .debounce_interval
= 100,
122 static struct gpio_keys_platform_data iconnect_button_data
= {
123 .buttons
= iconnect_buttons
,
124 .nbuttons
= ARRAY_SIZE(iconnect_buttons
),
127 static struct platform_device iconnect_button_device
= {
132 .platform_data
= &iconnect_button_data
,
136 static unsigned int iconnect_mpp_config
[] __initdata
= {
137 MPP12_GPIO
, /*Input for reset button*/
138 MPP35_GPIO
, /*Input for OTB button*/
149 static void __init
iconnect_init(void)
154 * Basic setup. Needs to be called early.
157 kirkwood_mpp_conf(iconnect_mpp_config
);
159 kirkwood_nand_init(ARRAY_AND_SIZE(iconnect_nand_parts
), 25);
160 kirkwood_ehci_init();
162 kirkwood_ge00_init(&iconnect_ge00_data
);
163 kirkwood_pcie_id(&dev
, &rev
);
165 kirkwood_uart0_init();
168 platform_device_register(&iconnect_leds
);
169 platform_device_register(&iconnect_button_device
);
172 static int __init
iconnect_pci_init(void)
174 if (machine_is_iconnect())
175 kirkwood_pcie_init(KW_PCIE0
);
179 subsys_initcall(iconnect_pci_init
);
182 MACHINE_START(ICONNECT
, "Iomega iConnect Wireless")
183 .atag_offset
= 0x100,
184 .init_machine
= iconnect_init
,
185 .map_io
= kirkwood_map_io
,
186 .init_early
= kirkwood_init_early
,
187 .init_irq
= kirkwood_init_irq
,
188 .timer
= &kirkwood_timer
,
189 .restart
= kirkwood_restart
,