uboot-envtools: forgot to remove uboot-envtools.init file
[openwrt.git] / target / linux / kirkwood / patches-3.3 / 200-iconnect.patch
1 --- a/arch/arm/mach-kirkwood/Makefile
2 +++ b/arch/arm/mach-kirkwood/Makefile
3 @@ -8,6 +8,7 @@ obj-$(CONFIG_MACH_SHEEVAPLUG)           += sheeva
4  obj-$(CONFIG_MACH_ESATA_SHEEVAPLUG)    += sheevaplug-setup.o
5  obj-$(CONFIG_MACH_GURUPLUG)            += guruplug-setup.o
6  obj-$(CONFIG_MACH_DOCKSTAR)            += dockstar-setup.o
7 +obj-$(CONFIG_MACH_ICONNECT)            += iconnect-setup.o
8  obj-$(CONFIG_MACH_TS219)               += ts219-setup.o tsx1x-common.o
9  obj-$(CONFIG_MACH_TS41X)               += ts41x-setup.o tsx1x-common.o
10  obj-$(CONFIG_MACH_OPENRD)              += openrd-setup.o
11 --- a/arch/arm/mach-kirkwood/Kconfig
12 +++ b/arch/arm/mach-kirkwood/Kconfig
13 @@ -130,6 +130,12 @@ config MACH_T5325
14           Say 'Y' here if you want your kernel to support the
15           HP t5325 Thin Client.
16  
17 +config MACH_ICONNECT
18 +       bool "Iomega iConnect Wireless"
19 +       help
20 +         Say 'Y' here if you want your kernel to support the
21 +         Iomega iConnect Wireless.
22 +
23  endmenu
24  
25  endif
26 --- /dev/null
27 +++ b/arch/arm/mach-kirkwood/iconnect-setup.c
28 @@ -0,0 +1,190 @@
29 +/*
30 + * arch/arm/mach-kirkwood/iconnect-setup.c
31 + *
32 + * Iomega iConnect Wireless
33 + *
34 + * This file is licensed under the terms of the GNU General Public
35 + * License version 2.  This program is licensed "as is" without any
36 + * warranty of any kind, whether express or implied.
37 + */
38 +
39 +#include <linux/kernel.h>
40 +#include <linux/init.h>
41 +#include <linux/platform_device.h>
42 +#include <linux/irq.h>
43 +#include <linux/mtd/partitions.h>
44 +#include <linux/mv643xx_eth.h>
45 +#include <linux/ethtool.h>
46 +#include <linux/gpio.h>
47 +#include <linux/gpio_keys.h>
48 +#include <linux/input.h>
49 +#include <linux/leds.h>
50 +#include <asm/mach-types.h>
51 +#include <asm/mach/arch.h>
52 +#include <mach/kirkwood.h>
53 +#include "common.h"
54 +#include "mpp.h"
55 +
56 +static struct mtd_partition iconnect_nand_parts[] = {
57 +       {
58 +               .name = "u-boot",
59 +               .offset = 0,
60 +               .size = SZ_1M
61 +       }, {
62 +               .name = "uImage",
63 +               .offset = MTDPART_OFS_NXTBLK,
64 +               .size = SZ_1M + SZ_2M
65 +       }, {
66 +               .name = "rootfs",
67 +               .offset = MTDPART_OFS_NXTBLK,
68 +               .size = SZ_32M,
69 +       }, {
70 +               .name = "data",
71 +               .offset = MTDPART_OFS_NXTBLK,
72 +               .size = MTDPART_SIZ_FULL
73 +       },
74 +};
75 +
76 +static struct mv643xx_eth_platform_data iconnect_ge00_data = {
77 +       .phy_addr       = MV643XX_ETH_PHY_ADDR(11),
78 +};
79 +
80 +static struct gpio_led iconnect_led_pins[] = {
81 +       {
82 +               .name                   = "iconnect:blue:power",
83 +               .default_trigger        = "default-on",
84 +               .gpio                   = 42,
85 +       },
86 +       {
87 +               .name                   = "iconnect:red:power",
88 +               .gpio                   = 43,
89 +       },
90 +       {
91 +               .name                   = "iconnect:blue:usb1",
92 +               .gpio                   = 44,
93 +       },
94 +       {
95 +               .name                   = "iconnect:blue:usb2",
96 +               .gpio                   = 45,
97 +       },
98 +       {
99 +               .name                   = "iconnect:blue:usb3",
100 +               .gpio                   = 46,
101 +       },
102 +       {
103 +               .name                   = "iconnect:blue:usb4",
104 +               .gpio                   = 47,
105 +       },
106 +       {
107 +               .name                   = "iconnect:blue:otb",
108 +               .gpio                   = 48,
109 +       },
110 +};
111 +
112 +static struct gpio_led_platform_data iconnect_led_data = {
113 +       .leds           = iconnect_led_pins,
114 +       .num_leds       = ARRAY_SIZE(iconnect_led_pins),
115 +};
116 +
117 +static struct platform_device iconnect_leds = {
118 +       .name   = "leds-gpio",
119 +       .id     = -1,
120 +       .dev    = {
121 +               .platform_data  = &iconnect_led_data,
122 +       }
123 +};
124 +
125 +#define ICONNECT_GPIO_KEY_RESET                12
126 +#define ICONNECT_GPIO_KEY_OTB          35
127 +
128 +#define ICONNECT_SW_RESET              0x00
129 +#define ICONNECT_SW_OTB                        0x01
130 +
131 +static struct gpio_keys_button iconnect_buttons[] = {
132 +       {
133 +               .type           = EV_SW,
134 +               .code           = ICONNECT_SW_RESET,
135 +               .gpio           = ICONNECT_GPIO_KEY_RESET,
136 +               .desc           = "Reset Button",
137 +               .active_low     = 1,
138 +               .debounce_interval = 100,
139 +       },
140 +       {
141 +               .type           = EV_SW,
142 +               .code           = ICONNECT_SW_OTB,
143 +               .gpio           = ICONNECT_GPIO_KEY_OTB,
144 +               .desc           = "OTB Button",
145 +               .active_low     = 1,
146 +               .debounce_interval = 100,
147 +       },
148 +};
149 +
150 +static struct gpio_keys_platform_data iconnect_button_data = {
151 +       .buttons        = iconnect_buttons,
152 +       .nbuttons       = ARRAY_SIZE(iconnect_buttons),
153 +};
154 +
155 +static struct platform_device iconnect_button_device = {
156 +       .name           = "gpio-keys",
157 +       .id             = -1,
158 +       .num_resources  = 0,
159 +       .dev = {
160 +               .platform_data = &iconnect_button_data,
161 +       },
162 +};
163 +
164 +static unsigned int iconnect_mpp_config[] __initdata = {
165 +       MPP12_GPIO, /*Input for reset button*/
166 +       MPP35_GPIO, /*Input for OTB button*/
167 +       MPP42_GPIO,
168 +       MPP43_GPIO,
169 +       MPP44_GPIO,
170 +       MPP45_GPIO,
171 +       MPP46_GPIO,
172 +       MPP47_GPIO,
173 +       MPP48_GPIO,
174 +       0
175 +};
176 +
177 +static void __init iconnect_init(void)
178 +{
179 +       u32 dev, rev;
180 +
181 +       /*
182 +        * Basic setup. Needs to be called early.
183 +        */
184 +       kirkwood_init();
185 +       kirkwood_mpp_conf(iconnect_mpp_config);
186 +
187 +       kirkwood_nand_init(ARRAY_AND_SIZE(iconnect_nand_parts), 25);
188 +       kirkwood_ehci_init();
189 +
190 +       kirkwood_ge00_init(&iconnect_ge00_data);
191 +       kirkwood_pcie_id(&dev, &rev);
192 +
193 +       kirkwood_uart0_init();
194 +       kirkwood_i2c_init();
195 +
196 +       platform_device_register(&iconnect_leds);
197 +       platform_device_register(&iconnect_button_device);
198 +}
199 +
200 +static int __init iconnect_pci_init(void)
201 +{
202 +       if (machine_is_iconnect())
203 +               kirkwood_pcie_init(KW_PCIE0);
204 +
205 +       return 0;
206 +}
207 +subsys_initcall(iconnect_pci_init);
208 +
209 +
210 +MACHINE_START(ICONNECT, "Iomega iConnect Wireless")
211 +       .atag_offset    = 0x100,
212 +       .init_machine   = iconnect_init,
213 +       .map_io         = kirkwood_map_io,
214 +       .init_early     = kirkwood_init_early,
215 +       .init_irq       = kirkwood_init_irq,
216 +       .timer          = &kirkwood_timer,
217 +       .restart        = kirkwood_restart,
218 +MACHINE_END