aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorJonathan Cameron <jic23@cam.ac.uk>2010-06-06 09:55:02 -0400
committerEric Miao <eric.y.miao@gmail.com>2010-08-05 02:32:16 -0400
commitdcd925f95194da42e42cea7e5f901f9746cf441c (patch)
tree05ccace4c48f04a8a0aa48bfc6123c73412b70c2 /arch
parent5aa9a2cbc037b2ec34b76619d233852d2d17b502 (diff)
[ARM] pxa: merge stargate2 and imote2 board files
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Acked-by: Stefan Schmidt <stefan@datenfreihafen.org> Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-pxa/Makefile2
-rw-r--r--arch/arm/mach-pxa/imote2.c590
-rw-r--r--arch/arm/mach-pxa/stargate2.c679
3 files changed, 454 insertions, 817 deletions
diff --git a/arch/arm/mach-pxa/Makefile b/arch/arm/mach-pxa/Makefile
index 66e8989b8ef2..3f72218462a8 100644
--- a/arch/arm/mach-pxa/Makefile
+++ b/arch/arm/mach-pxa/Makefile
@@ -51,7 +51,7 @@ obj-$(CONFIG_MACH_CAPC7117) += capc7117.o mxm8x10.o
51obj-$(CONFIG_ARCH_GUMSTIX) += gumstix.o 51obj-$(CONFIG_ARCH_GUMSTIX) += gumstix.o
52obj-$(CONFIG_GUMSTIX_AM200EPD) += am200epd.o 52obj-$(CONFIG_GUMSTIX_AM200EPD) += am200epd.o
53obj-$(CONFIG_GUMSTIX_AM300EPD) += am300epd.o 53obj-$(CONFIG_GUMSTIX_AM300EPD) += am300epd.o
54obj-$(CONFIG_MACH_INTELMOTE2) += imote2.o 54obj-$(CONFIG_MACH_INTELMOTE2) += stargate2.o
55obj-$(CONFIG_MACH_STARGATE2) += stargate2.o 55obj-$(CONFIG_MACH_STARGATE2) += stargate2.o
56obj-$(CONFIG_MACH_XCEP) += xcep.o 56obj-$(CONFIG_MACH_XCEP) += xcep.o
57obj-$(CONFIG_MACH_TRIZEPS4) += trizeps4.o 57obj-$(CONFIG_MACH_TRIZEPS4) += trizeps4.o
diff --git a/arch/arm/mach-pxa/imote2.c b/arch/arm/mach-pxa/imote2.c
deleted file mode 100644
index 5161dca8ccc0..000000000000
--- a/arch/arm/mach-pxa/imote2.c
+++ /dev/null
@@ -1,590 +0,0 @@
1/*
2 * linux/arch/arm/mach-pxa/imote2.c
3 *
4 * Author: Ed C. Epp
5 * Created: Nov 05, 2002
6 * Copyright: Intel Corp.
7 *
8 * Modified 2008: Jonathan Cameron
9 *
10 * The Imote2 is a wireless sensor node platform sold
11 * by Crossbow (www.xbow.com).
12 */
13
14#include <linux/init.h>
15#include <linux/device.h>
16#include <linux/mtd/mtd.h>
17#include <linux/mtd/partitions.h>
18#include <linux/platform_device.h>
19#include <linux/regulator/machine.h>
20#include <linux/gpio.h>
21#include <linux/leds.h>
22#include <linux/spi/spi.h>
23#include <linux/i2c.h>
24#include <linux/mfd/da903x.h>
25#include <linux/sht15.h>
26
27#include <asm/mach-types.h>
28#include <asm/mach/arch.h>
29#include <asm/mach/map.h>
30#include <asm/mach/flash.h>
31
32#include <mach/pxa27x.h>
33#include <plat/i2c.h>
34#include <mach/udc.h>
35#include <mach/mmc.h>
36#include <mach/pxa2xx_spi.h>
37#include <mach/pxa27x-udc.h>
38
39#include "devices.h"
40#include "generic.h"
41
42static unsigned long imote2_pin_config[] __initdata = {
43
44 /* Device Identification for wakeup*/
45 GPIO102_GPIO,
46
47 /* Button */
48 GPIO91_GPIO,
49
50 /* DA9030 */
51 GPIO1_GPIO,
52
53 /* MMC */
54 GPIO32_MMC_CLK,
55 GPIO112_MMC_CMD,
56 GPIO92_MMC_DAT_0,
57 GPIO109_MMC_DAT_1,
58 GPIO110_MMC_DAT_2,
59 GPIO111_MMC_DAT_3,
60
61 /* 802.15.4 radio - driver out of mainline */
62 GPIO22_GPIO, /* CC_RSTN */
63 GPIO114_GPIO, /* CC_FIFO */
64 GPIO116_GPIO, /* CC_CCA */
65 GPIO0_GPIO, /* CC_FIFOP */
66 GPIO16_GPIO, /* CCSFD */
67 GPIO115_GPIO, /* Power enable */
68
69 /* I2C */
70 GPIO117_I2C_SCL,
71 GPIO118_I2C_SDA,
72
73 /* SSP 3 - 802.15.4 radio */
74 GPIO39_GPIO, /* Chip Select */
75 GPIO34_SSP3_SCLK,
76 GPIO35_SSP3_TXD,
77 GPIO41_SSP3_RXD,
78
79 /* SSP 2 - to daughter boards */
80 GPIO37_GPIO, /* Chip Select */
81 GPIO36_SSP2_SCLK,
82 GPIO38_SSP2_TXD,
83 GPIO11_SSP2_RXD,
84
85 /* SSP 1 - to daughter boards */
86 GPIO24_GPIO, /* Chip Select */
87 GPIO23_SSP1_SCLK,
88 GPIO25_SSP1_TXD,
89 GPIO26_SSP1_RXD,
90
91 /* BTUART Basic Connector*/
92 GPIO42_BTUART_RXD,
93 GPIO43_BTUART_TXD,
94 GPIO44_BTUART_CTS,
95 GPIO45_BTUART_RTS,
96
97 /* STUART Serial console via debug board*/
98 GPIO46_STUART_RXD,
99 GPIO47_STUART_TXD,
100
101 /* Basic sensor board */
102 GPIO96_GPIO, /* accelerometer interrupt */
103 GPIO99_GPIO, /* ADC interrupt */
104
105 /* SHT15 */
106 GPIO100_GPIO,
107 GPIO98_GPIO,
108
109 /* Connector pins specified as gpios */
110 GPIO94_GPIO, /* large basic connector pin 14 */
111 GPIO10_GPIO, /* large basic connector pin 23 */
112
113 /* LEDS */
114 GPIO103_GPIO, /* red led */
115 GPIO104_GPIO, /* green led */
116 GPIO105_GPIO, /* blue led */
117};
118
119static struct sht15_platform_data platform_data_sht15 = {
120 .gpio_data = 100,
121 .gpio_sck = 98,
122};
123
124static struct platform_device sht15 = {
125 .name = "sht15",
126 .id = -1,
127 .dev = {
128 .platform_data = &platform_data_sht15,
129 },
130};
131
132static struct regulator_consumer_supply imote2_sensor_3_con[] = {
133 {
134 .dev = &sht15.dev,
135 .supply = "vcc",
136 },
137};
138
139static struct gpio_led imote2_led_pins[] = {
140 {
141 .name = "imote2:red",
142 .gpio = 103,
143 .active_low = 1,
144 }, {
145 .name = "imote2:green",
146 .gpio = 104,
147 .active_low = 1,
148 }, {
149 .name = "imote2:blue",
150 .gpio = 105,
151 .active_low = 1,
152 },
153};
154
155static struct gpio_led_platform_data imote2_led_data = {
156 .num_leds = ARRAY_SIZE(imote2_led_pins),
157 .leds = imote2_led_pins,
158};
159
160static struct platform_device imote2_leds = {
161 .name = "leds-gpio",
162 .id = -1,
163 .dev = {
164 .platform_data = &imote2_led_data,
165 },
166};
167
168/* Reverse engineered partly from Platformx drivers */
169enum imote2_ldos{
170 vcc_vref,
171 vcc_cc2420,
172 vcc_mica,
173 vcc_bt,
174 /* The two voltages available to sensor boards */
175 vcc_sensor_1_8,
176 vcc_sensor_3,
177
178 vcc_sram_ext, /* directly connected to the pxa271 */
179 vcc_pxa_pll,
180 vcc_pxa_usim, /* Reference voltage for certain gpios */
181 vcc_pxa_mem,
182 vcc_pxa_flash,
183 vcc_pxa_core, /*Dc-Dc buck not yet supported */
184 vcc_lcd,
185 vcc_bb,
186 vcc_bbio,
187 vcc_io, /* cc2420 802.15.4 radio and pxa vcc_io ?*/
188};
189
190/* The values of the various regulator constraints are obviously dependent
191 * on exactly what is wired to each ldo. Unfortunately this information is
192 * not generally available. More information has been requested from Xbow
193 * but as of yet they haven't been forthcoming.
194 *
195 * Some of these are clearly Stargate 2 related (no way of plugging
196 * in an lcd on the IM2 for example!).
197 */
198static struct regulator_init_data imote2_ldo_init_data[] = {
199 [vcc_bbio] = {
200 .constraints = { /* board default 1.8V */
201 .name = "vcc_bbio",
202 .min_uV = 1800000,
203 .max_uV = 1800000,
204 },
205 },
206 [vcc_bb] = {
207 .constraints = { /* board default 2.8V */
208 .name = "vcc_bb",
209 .min_uV = 2700000,
210 .max_uV = 3000000,
211 },
212 },
213 [vcc_pxa_flash] = {
214 .constraints = {/* default is 1.8V */
215 .name = "vcc_pxa_flash",
216 .min_uV = 1800000,
217 .max_uV = 1800000,
218 },
219 },
220 [vcc_cc2420] = { /* also vcc_io */
221 .constraints = {
222 /* board default is 2.8V */
223 .name = "vcc_cc2420",
224 .min_uV = 2700000,
225 .max_uV = 3300000,
226 },
227 },
228 [vcc_vref] = { /* Reference for what? */
229 .constraints = { /* default 1.8V */
230 .name = "vcc_vref",
231 .min_uV = 1800000,
232 .max_uV = 1800000,
233 },
234 },
235 [vcc_sram_ext] = {
236 .constraints = { /* default 2.8V */
237 .name = "vcc_sram_ext",
238 .min_uV = 2800000,
239 .max_uV = 2800000,
240 },
241 },
242 [vcc_mica] = {
243 .constraints = { /* default 2.8V */
244 .name = "vcc_mica",
245 .min_uV = 2800000,
246 .max_uV = 2800000,
247 },
248 },
249 [vcc_bt] = {
250 .constraints = { /* default 2.8V */
251 .name = "vcc_bt",
252 .min_uV = 2800000,
253 .max_uV = 2800000,
254 },
255 },
256 [vcc_lcd] = {
257 .constraints = { /* default 2.8V */
258 .name = "vcc_lcd",
259 .min_uV = 2700000,
260 .max_uV = 3300000,
261 },
262 },
263 [vcc_io] = { /* Same or higher than everything
264 * bar vccbat and vccusb */
265 .constraints = { /* default 2.8V */
266 .name = "vcc_io",
267 .min_uV = 2692000,
268 .max_uV = 3300000,
269 },
270 },
271 [vcc_sensor_1_8] = {
272 .constraints = { /* default 1.8V */
273 .name = "vcc_sensor_1_8",
274 .min_uV = 1800000,
275 .max_uV = 1800000,
276 },
277 },
278 [vcc_sensor_3] = { /* curiously default 2.8V */
279 .constraints = {
280 .name = "vcc_sensor_3",
281 .min_uV = 2800000,
282 .max_uV = 3000000,
283 },
284 .num_consumer_supplies = ARRAY_SIZE(imote2_sensor_3_con),
285 .consumer_supplies = imote2_sensor_3_con,
286 },
287 [vcc_pxa_pll] = { /* 1.17V - 1.43V, default 1.3V*/
288 .constraints = {
289 .name = "vcc_pxa_pll",
290 .min_uV = 1170000,
291 .max_uV = 1430000,
292 },
293 },
294 [vcc_pxa_usim] = {
295 .constraints = { /* default 1.8V */
296 .name = "vcc_pxa_usim",
297 .min_uV = 1710000,
298 .max_uV = 2160000,
299 },
300 },
301 [vcc_pxa_mem] = {
302 .constraints = { /* default 1.8V */
303 .name = "vcc_pxa_mem",
304 .min_uV = 1800000,
305 .max_uV = 1800000,
306 },
307 },
308};
309
310static struct da903x_subdev_info imote2_da9030_subdevs[] = {
311 {
312 .name = "da903x-regulator",
313 .id = DA9030_ID_LDO2,
314 .platform_data = &imote2_ldo_init_data[vcc_bbio],
315 }, {
316 .name = "da903x-regulator",
317 .id = DA9030_ID_LDO3,
318 .platform_data = &imote2_ldo_init_data[vcc_bb],
319 }, {
320 .name = "da903x-regulator",
321 .id = DA9030_ID_LDO4,
322 .platform_data = &imote2_ldo_init_data[vcc_pxa_flash],
323 }, {
324 .name = "da903x-regulator",
325 .id = DA9030_ID_LDO5,
326 .platform_data = &imote2_ldo_init_data[vcc_cc2420],
327 }, {
328 .name = "da903x-regulator",
329 .id = DA9030_ID_LDO6,
330 .platform_data = &imote2_ldo_init_data[vcc_vref],
331 }, {
332 .name = "da903x-regulator",
333 .id = DA9030_ID_LDO7,
334 .platform_data = &imote2_ldo_init_data[vcc_sram_ext],
335 }, {
336 .name = "da903x-regulator",
337 .id = DA9030_ID_LDO8,
338 .platform_data = &imote2_ldo_init_data[vcc_mica],
339 }, {
340 .name = "da903x-regulator",
341 .id = DA9030_ID_LDO9,
342 .platform_data = &imote2_ldo_init_data[vcc_bt],
343 }, {
344 .name = "da903x-regulator",
345 .id = DA9030_ID_LDO10,
346 .platform_data = &imote2_ldo_init_data[vcc_sensor_1_8],
347 }, {
348 .name = "da903x-regulator",
349 .id = DA9030_ID_LDO11,
350 .platform_data = &imote2_ldo_init_data[vcc_sensor_3],
351 }, {
352 .name = "da903x-regulator",
353 .id = DA9030_ID_LDO12,
354 .platform_data = &imote2_ldo_init_data[vcc_lcd],
355 }, {
356 .name = "da903x-regulator",
357 .id = DA9030_ID_LDO15,
358 .platform_data = &imote2_ldo_init_data[vcc_pxa_pll],
359 }, {
360 .name = "da903x-regulator",
361 .id = DA9030_ID_LDO17,
362 .platform_data = &imote2_ldo_init_data[vcc_pxa_usim],
363 }, {
364 .name = "da903x-regulator",
365 .id = DA9030_ID_LDO18,
366 .platform_data = &imote2_ldo_init_data[vcc_io],
367 }, {
368 .name = "da903x-regulator",
369 .id = DA9030_ID_LDO19,
370 .platform_data = &imote2_ldo_init_data[vcc_pxa_mem],
371 },
372};
373
374static struct da903x_platform_data imote2_da9030_pdata = {
375 .num_subdevs = ARRAY_SIZE(imote2_da9030_subdevs),
376 .subdevs = imote2_da9030_subdevs,
377};
378
379/* As the the imote2 doesn't currently have a conventional SD slot
380 * there is no option to hotplug cards, making all this rather simple
381 */
382static int imote2_mci_get_ro(struct device *dev)
383{
384 return 0;
385}
386
387/* Rather simple case as hotplugging not possible */
388static struct pxamci_platform_data imote2_mci_platform_data = {
389 .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, /* default anyway */
390 .get_ro = imote2_mci_get_ro,
391 .gpio_card_detect = -1,
392 .gpio_card_ro = -1,
393 .gpio_power = -1,
394};
395
396static struct mtd_partition imote2flash_partitions[] = {
397 {
398 .name = "Bootloader",
399 .size = 0x00040000,
400 .offset = 0,
401 .mask_flags = MTD_WRITEABLE,
402 }, {
403 .name = "Kernel",
404 .size = 0x00200000,
405 .offset = 0x00040000,
406 .mask_flags = 0,
407 }, {
408 .name = "Filesystem",
409 .size = 0x01DC0000,
410 .offset = 0x00240000,
411 .mask_flags = 0,
412 },
413};
414
415static struct resource flash_resources = {
416 .start = PXA_CS0_PHYS,
417 .end = PXA_CS0_PHYS + SZ_32M - 1,
418 .flags = IORESOURCE_MEM,
419};
420
421static struct flash_platform_data imote2_flash_data = {
422 .map_name = "cfi_probe",
423 .parts = imote2flash_partitions,
424 .nr_parts = ARRAY_SIZE(imote2flash_partitions),
425 .name = "PXA27xOnChipROM",
426 .width = 2,
427};
428
429static struct platform_device imote2_flash_device = {
430 .name = "pxa2xx-flash",
431 .id = 0,
432 .dev = {
433 .platform_data = &imote2_flash_data,
434 },
435 .resource = &flash_resources,
436 .num_resources = 1,
437};
438
439/* Some of the drivers here are out of kernel at the moment (parts of IIO)
440 * and it may be a while before they are in the mainline.
441 */
442static struct i2c_board_info __initdata imote2_i2c_board_info[] = {
443 { /* UCAM sensor board */
444 .type = "max1239",
445 .addr = 0x35,
446 }, { /* ITS400 Sensor board only */
447 .type = "max1363",
448 .addr = 0x34,
449 /* Through a nand gate - Also beware, on V2 sensor board the
450 * pull up resistors are missing.
451 */
452 .irq = IRQ_GPIO(99),
453 }, { /* ITS400 Sensor board only */
454 .type = "tsl2561",
455 .addr = 0x49,
456 /* Through a nand gate - Also beware, on V2 sensor board the
457 * pull up resistors are missing.
458 */
459 .irq = IRQ_GPIO(99),
460 }, { /* ITS400 Sensor board only */
461 .type = "tmp175",
462 .addr = 0x4A,
463 .irq = IRQ_GPIO(96),
464 }, { /* IMB400 Multimedia board */
465 .type = "wm8940",
466 .addr = 0x1A,
467 },
468};
469
470static struct i2c_board_info __initdata imote2_pwr_i2c_board_info[] = {
471 {
472 .type = "da9030",
473 .addr = 0x49,
474 .platform_data = &imote2_da9030_pdata,
475 .irq = gpio_to_irq(1),
476 },
477};
478
479static struct pxa2xx_spi_master pxa_ssp_master_0_info = {
480 .num_chipselect = 1,
481};
482
483static struct pxa2xx_spi_master pxa_ssp_master_1_info = {
484 .num_chipselect = 1,
485};
486
487static struct pxa2xx_spi_master pxa_ssp_master_2_info = {
488 .num_chipselect = 1,
489};
490
491static struct pxa2xx_spi_chip staccel_chip_info = {
492 .tx_threshold = 8,
493 .rx_threshold = 8,
494 .dma_burst_size = 8,
495 .timeout = 235,
496 .gpio_cs = 24,
497};
498
499static struct pxa2xx_spi_chip cc2420_info = {
500 .tx_threshold = 8,
501 .rx_threshold = 8,
502 .dma_burst_size = 8,
503 .timeout = 235,
504 .gpio_cs = 39,
505};
506
507static struct spi_board_info spi_board_info[] __initdata = {
508 { /* Driver in IIO */
509 .modalias = "lis3l02dq",
510 .max_speed_hz = 8000000,/* 8MHz max spi frequency at 3V */
511 .bus_num = 1,
512 .chip_select = 0,
513 .controller_data = &staccel_chip_info,
514 .irq = IRQ_GPIO(96),
515 }, { /* Driver out of kernel as it needs considerable rewriting */
516 .modalias = "cc2420",
517 .max_speed_hz = 6500000,
518 .bus_num = 3,
519 .chip_select = 0,
520 .controller_data = &cc2420_info,
521 },
522};
523
524static void im2_udc_command(int cmd)
525{
526 switch (cmd) {
527 case PXA2XX_UDC_CMD_CONNECT:
528 UP2OCR |= UP2OCR_HXOE | UP2OCR_DPPUE | UP2OCR_DPPUBE;
529 break;
530 case PXA2XX_UDC_CMD_DISCONNECT:
531 UP2OCR &= ~(UP2OCR_HXOE | UP2OCR_DPPUE | UP2OCR_DPPUBE);
532 break;
533 }
534}
535
536static struct pxa2xx_udc_mach_info imote2_udc_info __initdata = {
537 .udc_command = im2_udc_command,
538};
539
540static struct platform_device *imote2_devices[] = {
541 &imote2_flash_device,
542 &imote2_leds,
543 &sht15,
544};
545
546static struct i2c_pxa_platform_data i2c_pwr_pdata = {
547 .fast_mode = 1,
548};
549
550static struct i2c_pxa_platform_data i2c_pdata = {
551 .fast_mode = 1,
552};
553
554static void __init imote2_init(void)
555{
556 pxa2xx_mfp_config(ARRAY_AND_SIZE(imote2_pin_config));
557
558 pxa_set_ffuart_info(NULL);
559 pxa_set_btuart_info(NULL);
560 pxa_set_stuart_info(NULL);
561
562 platform_add_devices(imote2_devices, ARRAY_SIZE(imote2_devices));
563
564 pxa2xx_set_spi_info(1, &pxa_ssp_master_0_info);
565 pxa2xx_set_spi_info(2, &pxa_ssp_master_1_info);
566 pxa2xx_set_spi_info(3, &pxa_ssp_master_2_info);
567
568 spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
569
570 i2c_register_board_info(0, imote2_i2c_board_info,
571 ARRAY_SIZE(imote2_i2c_board_info));
572 i2c_register_board_info(1, imote2_pwr_i2c_board_info,
573 ARRAY_SIZE(imote2_pwr_i2c_board_info));
574
575 pxa27x_set_i2c_power_info(&i2c_pwr_pdata);
576 pxa_set_i2c_info(&i2c_pdata);
577
578 pxa_set_mci_info(&imote2_mci_platform_data);
579 pxa_set_udc_info(&imote2_udc_info);
580}
581
582MACHINE_START(INTELMOTE2, "IMOTE 2")
583 .phys_io = 0x40000000,
584 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
585 .map_io = pxa_map_io,
586 .init_irq = pxa27x_init_irq,
587 .timer = &pxa_timer,
588 .init_machine = imote2_init,
589 .boot_params = 0xA0000100,
590MACHINE_END
diff --git a/arch/arm/mach-pxa/stargate2.c b/arch/arm/mach-pxa/stargate2.c
index af40d2a12d37..a654d1e6b38a 100644
--- a/arch/arm/mach-pxa/stargate2.c
+++ b/arch/arm/mach-pxa/stargate2.c
@@ -29,6 +29,7 @@
29#include <linux/i2c/at24.h> 29#include <linux/i2c/at24.h>
30#include <linux/smc91x.h> 30#include <linux/smc91x.h>
31#include <linux/gpio.h> 31#include <linux/gpio.h>
32#include <linux/leds.h>
32 33
33#include <asm/types.h> 34#include <asm/types.h>
34#include <asm/setup.h> 35#include <asm/setup.h>
@@ -62,37 +63,12 @@
62#define SG2_GPIO_nSD_DETECT 90 63#define SG2_GPIO_nSD_DETECT 90
63#define SG2_SD_POWER_ENABLE 89 64#define SG2_SD_POWER_ENABLE 89
64 65
65static unsigned long stargate2_pin_config[] __initdata = { 66static unsigned long sg2_im2_unified_pin_config[] __initdata = {
66
67 GPIO15_nCS_1, /* SRAM */
68 /* SMC91x */
69 GPIO80_nCS_4,
70 GPIO40_GPIO, /*cable detect?*/
71 /* Device Identification for wakeup*/ 67 /* Device Identification for wakeup*/
72 GPIO102_GPIO, 68 GPIO102_GPIO,
73
74 /* Button */
75 GPIO91_GPIO | WAKEUP_ON_LEVEL_HIGH,
76
77 /* DA9030 */ 69 /* DA9030 */
78 GPIO1_GPIO, 70 GPIO1_GPIO,
79 71
80 /* Compact Flash */
81 GPIO79_PSKTSEL,
82 GPIO48_nPOE,
83 GPIO49_nPWE,
84 GPIO50_nPIOR,
85 GPIO51_nPIOW,
86 GPIO85_nPCE_1,
87 GPIO54_nPCE_2,
88 GPIO55_nPREG,
89 GPIO56_nPWAIT,
90 GPIO57_nIOIS16,
91 GPIO120_GPIO, /* Buff ctrl */
92 GPIO108_GPIO, /* Power ctrl */
93 GPIO82_GPIO, /* Reset */
94 GPIO53_GPIO, /* SG2_S0_GPIO_DETECT */
95
96 /* MMC */ 72 /* MMC */
97 GPIO32_MMC_CLK, 73 GPIO32_MMC_CLK,
98 GPIO112_MMC_CMD, 74 GPIO112_MMC_CMD,
@@ -100,49 +76,44 @@ static unsigned long stargate2_pin_config[] __initdata = {
100 GPIO109_MMC_DAT_1, 76 GPIO109_MMC_DAT_1,
101 GPIO110_MMC_DAT_2, 77 GPIO110_MMC_DAT_2,
102 GPIO111_MMC_DAT_3, 78 GPIO111_MMC_DAT_3,
103 GPIO90_GPIO, /* nSD detect */
104 GPIO89_GPIO, /* SD_POWER_ENABLE */
105 79
106 /* Bluetooth */ 80 /* 802.15.4 radio - driver out of mainline */
107 GPIO81_GPIO, /* reset */ 81 GPIO22_GPIO, /* CC_RSTN */
108 82 GPIO114_GPIO, /* CC_FIFO */
109 /* cc2420 802.15.4 radio */ 83 GPIO116_GPIO, /* CC_CCA */
110 GPIO22_GPIO, /* CC_RSTN (out)*/ 84 GPIO0_GPIO, /* CC_FIFOP */
111 GPIO114_GPIO, /* CC_FIFO (in) */ 85 GPIO16_GPIO, /* CCSFD */
112 GPIO116_GPIO, /* CC_CCA (in) */ 86 GPIO115_GPIO, /* Power enable */
113 GPIO0_GPIO, /* CC_FIFOP (in) */
114 GPIO16_GPIO, /* CCSFD (in) */
115 GPIO39_GPIO, /* CSn (out) */
116 87
117 /* I2C */ 88 /* I2C */
118 GPIO117_I2C_SCL, 89 GPIO117_I2C_SCL,
119 GPIO118_I2C_SDA, 90 GPIO118_I2C_SDA,
120 91
121 /* SSP 3 - 802.15.4 radio */ 92 /* SSP 3 - 802.15.4 radio */
122 GPIO39_GPIO, /* chip select */ 93 GPIO39_GPIO, /* Chip Select */
123 GPIO34_SSP3_SCLK, 94 GPIO34_SSP3_SCLK,
124 GPIO35_SSP3_TXD, 95 GPIO35_SSP3_TXD,
125 GPIO41_SSP3_RXD, 96 GPIO41_SSP3_RXD,
126 97
127 /* SSP 2 */ 98 /* SSP 2 to daughter boards */
128 GPIO11_SSP2_RXD, 99 GPIO11_SSP2_RXD,
129 GPIO38_SSP2_TXD, 100 GPIO38_SSP2_TXD,
130 GPIO36_SSP2_SCLK, 101 GPIO36_SSP2_SCLK,
131 GPIO37_GPIO, /* chip select */ 102 GPIO37_GPIO, /* chip select */
132 103
133 /* SSP 1 */ 104 /* SSP 1 - to daughter boards */
134 GPIO26_SSP1_RXD, 105 GPIO24_GPIO, /* Chip Select */
135 GPIO25_SSP1_TXD,
136 GPIO23_SSP1_SCLK, 106 GPIO23_SSP1_SCLK,
137 GPIO24_GPIO, /* chip select */ 107 GPIO25_SSP1_TXD,
108 GPIO26_SSP1_RXD,
138 109
139 /* BTUART */ 110 /* BTUART Basic Connector*/
140 GPIO42_BTUART_RXD, 111 GPIO42_BTUART_RXD,
141 GPIO43_BTUART_TXD, 112 GPIO43_BTUART_TXD,
142 GPIO44_BTUART_CTS, 113 GPIO44_BTUART_CTS,
143 GPIO45_BTUART_RTS, 114 GPIO45_BTUART_RTS,
144 115
145 /* STUART */ 116 /* STUART - IM2 via debug board not sure on SG2*/
146 GPIO46_STUART_RXD, 117 GPIO46_STUART_RXD,
147 GPIO47_STUART_TXD, 118 GPIO47_STUART_TXD,
148 119
@@ -150,47 +121,17 @@ static unsigned long stargate2_pin_config[] __initdata = {
150 GPIO96_GPIO, /* accelerometer interrupt */ 121 GPIO96_GPIO, /* accelerometer interrupt */
151 GPIO99_GPIO, /* ADC interrupt */ 122 GPIO99_GPIO, /* ADC interrupt */
152 123
153 /* Connector pins specified as gpios */
154 GPIO94_GPIO, /* large basic connector pin 14 */
155 GPIO10_GPIO, /* large basic connector pin 23 */
156
157 /* SHT15 */ 124 /* SHT15 */
158 GPIO100_GPIO, 125 GPIO100_GPIO,
159 GPIO98_GPIO, 126 GPIO98_GPIO,
160};
161 127
162/** 128 /* Basic sensor board */
163 * stargate2_reset_bluetooth() reset the bluecore to ensure consistent state 129 GPIO96_GPIO, /* accelerometer interrupt */
164 **/ 130 GPIO99_GPIO, /* ADC interrupt */
165static int stargate2_reset_bluetooth(void)
166{
167 int err;
168 err = gpio_request(SG2_BT_RESET, "SG2_BT_RESET");
169 if (err) {
170 printk(KERN_ERR "Could not get gpio for bluetooth reset \n");
171 return err;
172 }
173 gpio_direction_output(SG2_BT_RESET, 1);
174 mdelay(5);
175 /* now reset it - 5 msec minimum */
176 gpio_set_value(SG2_BT_RESET, 0);
177 mdelay(10);
178 gpio_set_value(SG2_BT_RESET, 1);
179 gpio_free(SG2_BT_RESET);
180 return 0;
181}
182 131
183static struct led_info stargate2_leds[] = { 132 /* Connector pins specified as gpios */
184 { 133 GPIO94_GPIO, /* large basic connector pin 14 */
185 .name = "sg2:red", 134 GPIO10_GPIO, /* large basic connector pin 23 */
186 .flags = DA9030_LED_RATE_ON,
187 }, {
188 .name = "sg2:blue",
189 .flags = DA9030_LED_RATE_ON,
190 }, {
191 .name = "sg2:green",
192 .flags = DA9030_LED_RATE_ON,
193 },
194}; 135};
195 136
196static struct sht15_platform_data platform_data_sht15 = { 137static struct sht15_platform_data platform_data_sht15 = {
@@ -352,20 +293,184 @@ static struct regulator_init_data stargate2_ldo_init_data[] = {
352 }, 293 },
353}; 294};
354 295
355static struct da903x_subdev_info stargate2_da9030_subdevs[] = { 296static struct mtd_partition stargate2flash_partitions[] = {
356 { 297 {
357 .name = "da903x-led", 298 .name = "Bootloader",
358 .id = DA9030_ID_LED_2, 299 .size = 0x00040000,
359 .platform_data = &stargate2_leds[0], 300 .offset = 0,
301 .mask_flags = 0,
360 }, { 302 }, {
361 .name = "da903x-led", 303 .name = "Kernel",
362 .id = DA9030_ID_LED_3, 304 .size = 0x00200000,
363 .platform_data = &stargate2_leds[2], 305 .offset = 0x00040000,
306 .mask_flags = 0
364 }, { 307 }, {
365 .name = "da903x-led", 308 .name = "Filesystem",
366 .id = DA9030_ID_LED_4, 309 .size = 0x01DC0000,
367 .platform_data = &stargate2_leds[1], 310 .offset = 0x00240000,
311 .mask_flags = 0
312 },
313};
314
315static struct resource flash_resources = {
316 .start = PXA_CS0_PHYS,
317 .end = PXA_CS0_PHYS + SZ_32M - 1,
318 .flags = IORESOURCE_MEM,
319};
320
321static struct flash_platform_data stargate2_flash_data = {
322 .map_name = "cfi_probe",
323 .parts = stargate2flash_partitions,
324 .nr_parts = ARRAY_SIZE(stargate2flash_partitions),
325 .name = "PXA27xOnChipROM",
326 .width = 2,
327};
328
329static struct platform_device stargate2_flash_device = {
330 .name = "pxa2xx-flash",
331 .id = 0,
332 .dev = {
333 .platform_data = &stargate2_flash_data,
334 },
335 .resource = &flash_resources,
336 .num_resources = 1,
337};
338
339static struct pxa2xx_spi_master pxa_ssp_master_0_info = {
340 .num_chipselect = 1,
341};
342
343static struct pxa2xx_spi_master pxa_ssp_master_1_info = {
344 .num_chipselect = 1,
345};
346
347static struct pxa2xx_spi_master pxa_ssp_master_2_info = {
348 .num_chipselect = 1,
349};
350
351/* An upcoming kernel change will scrap SFRM usage so these
352 * drivers have been moved to use gpio's via cs_control */
353static struct pxa2xx_spi_chip staccel_chip_info = {
354 .tx_threshold = 8,
355 .rx_threshold = 8,
356 .dma_burst_size = 8,
357 .timeout = 235,
358 .gpio_cs = 24,
359};
360
361static struct pxa2xx_spi_chip cc2420_info = {
362 .tx_threshold = 8,
363 .rx_threshold = 8,
364 .dma_burst_size = 8,
365 .timeout = 235,
366 .gpio_cs = 39,
367};
368
369static struct spi_board_info spi_board_info[] __initdata = {
370 {
371 .modalias = "lis3l02dq",
372 .max_speed_hz = 8000000,/* 8MHz max spi frequency at 3V */
373 .bus_num = 1,
374 .chip_select = 0,
375 .controller_data = &staccel_chip_info,
376 .irq = IRQ_GPIO(96),
368 }, { 377 }, {
378 .modalias = "cc2420",
379 .max_speed_hz = 6500000,
380 .bus_num = 3,
381 .chip_select = 0,
382 .controller_data = &cc2420_info,
383 },
384};
385
386static void sg2_udc_command(int cmd)
387{
388 switch (cmd) {
389 case PXA2XX_UDC_CMD_CONNECT:
390 UP2OCR |= UP2OCR_HXOE | UP2OCR_DPPUE | UP2OCR_DPPUBE;
391 break;
392 case PXA2XX_UDC_CMD_DISCONNECT:
393 UP2OCR &= ~(UP2OCR_HXOE | UP2OCR_DPPUE | UP2OCR_DPPUBE);
394 break;
395 }
396}
397
398static struct i2c_pxa_platform_data i2c_pwr_pdata = {
399 .fast_mode = 1,
400};
401
402static struct i2c_pxa_platform_data i2c_pdata = {
403 .fast_mode = 1,
404};
405
406static void __init imote2_stargate2_init(void)
407{
408
409 pxa2xx_mfp_config(ARRAY_AND_SIZE(sg2_im2_unified_pin_config));
410
411 pxa_set_ffuart_info(NULL);
412 pxa_set_btuart_info(NULL);
413 pxa_set_stuart_info(NULL);
414
415 pxa2xx_set_spi_info(1, &pxa_ssp_master_0_info);
416 pxa2xx_set_spi_info(2, &pxa_ssp_master_1_info);
417 pxa2xx_set_spi_info(3, &pxa_ssp_master_2_info);
418 spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
419
420
421 pxa27x_set_i2c_power_info(&i2c_pwr_pdata);
422 pxa_set_i2c_info(&i2c_pdata);
423}
424
425#ifdef CONFIG_MACH_INTELMOTE2
426/* As the the imote2 doesn't currently have a conventional SD slot
427 * there is no option to hotplug cards, making all this rather simple
428 */
429static int imote2_mci_get_ro(struct device *dev)
430{
431 return 0;
432}
433
434/* Rather simple case as hotplugging not possible */
435static struct pxamci_platform_data imote2_mci_platform_data = {
436 .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, /* default anyway */
437 .get_ro = imote2_mci_get_ro,
438 .gpio_card_detect = -1,
439 .gpio_card_ro = -1,
440 .gpio_power = -1,
441};
442
443static struct gpio_led imote2_led_pins[] = {
444 {
445 .name = "imote2:red",
446 .gpio = 103,
447 .active_low = 1,
448 }, {
449 .name = "imote2:green",
450 .gpio = 104,
451 .active_low = 1,
452 }, {
453 .name = "imote2:blue",
454 .gpio = 105,
455 .active_low = 1,
456 },
457};
458
459static struct gpio_led_platform_data imote2_led_data = {
460 .num_leds = ARRAY_SIZE(imote2_led_pins),
461 .leds = imote2_led_pins,
462};
463
464static struct platform_device imote2_leds = {
465 .name = "leds-gpio",
466 .id = -1,
467 .dev = {
468 .platform_data = &imote2_led_data,
469 },
470};
471
472static struct da903x_subdev_info imote2_da9030_subdevs[] = {
473 {
369 .name = "da903x-regulator", 474 .name = "da903x-regulator",
370 .id = DA9030_ID_LDO2, 475 .id = DA9030_ID_LDO2,
371 .platform_data = &stargate2_ldo_init_data[vcc_bbio], 476 .platform_data = &stargate2_ldo_init_data[vcc_bbio],
@@ -428,9 +533,121 @@ static struct da903x_subdev_info stargate2_da9030_subdevs[] = {
428 }, 533 },
429}; 534};
430 535
431static struct da903x_platform_data stargate2_da9030_pdata = { 536static struct da903x_platform_data imote2_da9030_pdata = {
432 .num_subdevs = ARRAY_SIZE(stargate2_da9030_subdevs), 537 .num_subdevs = ARRAY_SIZE(imote2_da9030_subdevs),
433 .subdevs = stargate2_da9030_subdevs, 538 .subdevs = imote2_da9030_subdevs,
539};
540
541static struct i2c_board_info __initdata imote2_pwr_i2c_board_info[] = {
542 {
543 .type = "da9030",
544 .addr = 0x49,
545 .platform_data = &imote2_da9030_pdata,
546 .irq = gpio_to_irq(1),
547 },
548};
549
550static struct i2c_board_info __initdata imote2_i2c_board_info[] = {
551 { /* UCAM sensor board */
552 .type = "max1239",
553 .addr = 0x35,
554 }, { /* ITS400 Sensor board only */
555 .type = "max1363",
556 .addr = 0x34,
557 /* Through a nand gate - Also beware, on V2 sensor board the
558 * pull up resistors are missing.
559 */
560 .irq = IRQ_GPIO(99),
561 }, { /* ITS400 Sensor board only */
562 .type = "tsl2561",
563 .addr = 0x49,
564 /* Through a nand gate - Also beware, on V2 sensor board the
565 * pull up resistors are missing.
566 */
567 .irq = IRQ_GPIO(99),
568 }, { /* ITS400 Sensor board only */
569 .type = "tmp175",
570 .addr = 0x4A,
571 .irq = IRQ_GPIO(96),
572 }, { /* IMB400 Multimedia board */
573 .type = "wm8940",
574 .addr = 0x1A,
575 },
576};
577
578static unsigned long imote2_pin_config[] __initdata = {
579
580 /* Button */
581 GPIO91_GPIO,
582
583 /* LEDS */
584 GPIO103_GPIO, /* red led */
585 GPIO104_GPIO, /* green led */
586 GPIO105_GPIO, /* blue led */
587};
588
589static struct pxa2xx_udc_mach_info imote2_udc_info __initdata = {
590 .udc_command = sg2_udc_command,
591};
592
593static struct platform_device *imote2_devices[] = {
594 &stargate2_flash_device,
595 &imote2_leds,
596 &sht15,
597};
598
599static void __init imote2_init(void)
600{
601 pxa2xx_mfp_config(ARRAY_AND_SIZE(imote2_pin_config));
602
603 imote2_stargate2_init();
604
605 platform_add_devices(imote2_devices, ARRAY_SIZE(imote2_devices));
606
607 i2c_register_board_info(0, imote2_i2c_board_info,
608 ARRAY_SIZE(imote2_i2c_board_info));
609 i2c_register_board_info(1, imote2_pwr_i2c_board_info,
610 ARRAY_SIZE(imote2_pwr_i2c_board_info));
611
612 pxa_set_mci_info(&imote2_mci_platform_data);
613 pxa_set_udc_info(&imote2_udc_info);
614}
615#endif
616
617#ifdef CONFIG_MACH_STARGATE2
618
619static unsigned long stargate2_pin_config[] __initdata = {
620
621 GPIO15_nCS_1, /* SRAM */
622 /* SMC91x */
623 GPIO80_nCS_4,
624 GPIO40_GPIO, /*cable detect?*/
625
626 /* Button */
627 GPIO91_GPIO | WAKEUP_ON_LEVEL_HIGH,
628
629 /* Compact Flash */
630 GPIO79_PSKTSEL,
631 GPIO48_nPOE,
632 GPIO49_nPWE,
633 GPIO50_nPIOR,
634 GPIO51_nPIOW,
635 GPIO85_nPCE_1,
636 GPIO54_nPCE_2,
637 GPIO55_nPREG,
638 GPIO56_nPWAIT,
639 GPIO57_nIOIS16,
640 GPIO120_GPIO, /* Buff ctrl */
641 GPIO108_GPIO, /* Power ctrl */
642 GPIO82_GPIO, /* Reset */
643 GPIO53_GPIO, /* SG2_S0_GPIO_DETECT */
644
645 /* MMC not shared with imote2 */
646 GPIO90_GPIO, /* nSD detect */
647 GPIO89_GPIO, /* SD_POWER_ENABLE */
648
649 /* Bluetooth */
650 GPIO81_GPIO, /* reset */
434}; 651};
435 652
436static struct resource smc91x_resources[] = { 653static struct resource smc91x_resources[] = {
@@ -463,7 +680,6 @@ static struct platform_device smc91x_device = {
463}; 680};
464 681
465 682
466
467/* 683/*
468 * The card detect interrupt isn't debounced so we delay it by 250ms 684 * The card detect interrupt isn't debounced so we delay it by 250ms
469 * to give the card a chance to fully insert / eject. 685 * to give the card a chance to fully insert / eject.
@@ -532,48 +748,6 @@ static struct pxamci_platform_data stargate2_mci_platform_data = {
532 .exit = stargate2_mci_exit, 748 .exit = stargate2_mci_exit,
533}; 749};
534 750
535static struct mtd_partition stargate2flash_partitions[] = {
536 {
537 .name = "Bootloader",
538 .size = 0x00040000,
539 .offset = 0,
540 .mask_flags = 0,
541 }, {
542 .name = "Kernel",
543 .size = 0x00200000,
544 .offset = 0x00040000,
545 .mask_flags = 0
546 }, {
547 .name = "Filesystem",
548 .size = 0x01DC0000,
549 .offset = 0x00240000,
550 .mask_flags = 0
551 },
552};
553
554static struct resource flash_resources = {
555 .start = PXA_CS0_PHYS,
556 .end = PXA_CS0_PHYS + SZ_32M - 1,
557 .flags = IORESOURCE_MEM,
558};
559
560static struct flash_platform_data stargate2_flash_data = {
561 .map_name = "cfi_probe",
562 .parts = stargate2flash_partitions,
563 .nr_parts = ARRAY_SIZE(stargate2flash_partitions),
564 .name = "PXA27xOnChipROM",
565 .width = 2,
566};
567
568static struct platform_device stargate2_flash_device = {
569 .name = "pxa2xx-flash",
570 .id = 0,
571 .dev = {
572 .platform_data = &stargate2_flash_data,
573 },
574 .resource = &flash_resources,
575 .num_resources = 1,
576};
577 751
578/* 752/*
579 * SRAM - The Stargate 2 has 32MB of SRAM. 753 * SRAM - The Stargate 2 has 32MB of SRAM.
@@ -616,6 +790,129 @@ static struct at24_platform_data pca9500_eeprom_pdata = {
616 .page_size = 4, 790 .page_size = 4,
617}; 791};
618 792
793/**
794 * stargate2_reset_bluetooth() reset the bluecore to ensure consistent state
795 **/
796static int stargate2_reset_bluetooth(void)
797{
798 int err;
799 err = gpio_request(SG2_BT_RESET, "SG2_BT_RESET");
800 if (err) {
801 printk(KERN_ERR "Could not get gpio for bluetooth reset\n");
802 return err;
803 }
804 gpio_direction_output(SG2_BT_RESET, 1);
805 mdelay(5);
806 /* now reset it - 5 msec minimum */
807 gpio_set_value(SG2_BT_RESET, 0);
808 mdelay(10);
809 gpio_set_value(SG2_BT_RESET, 1);
810 gpio_free(SG2_BT_RESET);
811 return 0;
812}
813
814static struct led_info stargate2_leds[] = {
815 {
816 .name = "sg2:red",
817 .flags = DA9030_LED_RATE_ON,
818 }, {
819 .name = "sg2:blue",
820 .flags = DA9030_LED_RATE_ON,
821 }, {
822 .name = "sg2:green",
823 .flags = DA9030_LED_RATE_ON,
824 },
825};
826
827static struct da903x_subdev_info stargate2_da9030_subdevs[] = {
828 {
829 .name = "da903x-led",
830 .id = DA9030_ID_LED_2,
831 .platform_data = &stargate2_leds[0],
832 }, {
833 .name = "da903x-led",
834 .id = DA9030_ID_LED_3,
835 .platform_data = &stargate2_leds[2],
836 }, {
837 .name = "da903x-led",
838 .id = DA9030_ID_LED_4,
839 .platform_data = &stargate2_leds[1],
840 }, {
841 .name = "da903x-regulator",
842 .id = DA9030_ID_LDO2,
843 .platform_data = &stargate2_ldo_init_data[vcc_bbio],
844 }, {
845 .name = "da903x-regulator",
846 .id = DA9030_ID_LDO3,
847 .platform_data = &stargate2_ldo_init_data[vcc_bb],
848 }, {
849 .name = "da903x-regulator",
850 .id = DA9030_ID_LDO4,
851 .platform_data = &stargate2_ldo_init_data[vcc_pxa_flash],
852 }, {
853 .name = "da903x-regulator",
854 .id = DA9030_ID_LDO5,
855 .platform_data = &stargate2_ldo_init_data[vcc_cc2420],
856 }, {
857 .name = "da903x-regulator",
858 .id = DA9030_ID_LDO6,
859 .platform_data = &stargate2_ldo_init_data[vcc_vref],
860 }, {
861 .name = "da903x-regulator",
862 .id = DA9030_ID_LDO7,
863 .platform_data = &stargate2_ldo_init_data[vcc_sram_ext],
864 }, {
865 .name = "da903x-regulator",
866 .id = DA9030_ID_LDO8,
867 .platform_data = &stargate2_ldo_init_data[vcc_mica],
868 }, {
869 .name = "da903x-regulator",
870 .id = DA9030_ID_LDO9,
871 .platform_data = &stargate2_ldo_init_data[vcc_bt],
872 }, {
873 .name = "da903x-regulator",
874 .id = DA9030_ID_LDO10,
875 .platform_data = &stargate2_ldo_init_data[vcc_sensor_1_8],
876 }, {
877 .name = "da903x-regulator",
878 .id = DA9030_ID_LDO11,
879 .platform_data = &stargate2_ldo_init_data[vcc_sensor_3],
880 }, {
881 .name = "da903x-regulator",
882 .id = DA9030_ID_LDO12,
883 .platform_data = &stargate2_ldo_init_data[vcc_lcd],
884 }, {
885 .name = "da903x-regulator",
886 .id = DA9030_ID_LDO15,
887 .platform_data = &stargate2_ldo_init_data[vcc_pxa_pll],
888 }, {
889 .name = "da903x-regulator",
890 .id = DA9030_ID_LDO17,
891 .platform_data = &stargate2_ldo_init_data[vcc_pxa_usim],
892 }, {
893 .name = "da903x-regulator", /*pxa vcc i/o and cc2420 vcc i/o */
894 .id = DA9030_ID_LDO18,
895 .platform_data = &stargate2_ldo_init_data[vcc_io],
896 }, {
897 .name = "da903x-regulator",
898 .id = DA9030_ID_LDO19,
899 .platform_data = &stargate2_ldo_init_data[vcc_pxa_mem],
900 },
901};
902
903static struct da903x_platform_data stargate2_da9030_pdata = {
904 .num_subdevs = ARRAY_SIZE(stargate2_da9030_subdevs),
905 .subdevs = stargate2_da9030_subdevs,
906};
907
908static struct i2c_board_info __initdata stargate2_pwr_i2c_board_info[] = {
909 {
910 .type = "da9030",
911 .addr = 0x49,
912 .platform_data = &stargate2_da9030_pdata,
913 .irq = gpio_to_irq(1),
914 },
915};
619 916
620static struct i2c_board_info __initdata stargate2_i2c_board_info[] = { 917static struct i2c_board_info __initdata stargate2_i2c_board_info[] = {
621 /* Techically this a pca9500 - but it's compatible with the 8574 918 /* Techically this a pca9500 - but it's compatible with the 8574
@@ -653,74 +950,6 @@ static struct i2c_board_info __initdata stargate2_i2c_board_info[] = {
653 }, 950 },
654}; 951};
655 952
656static struct i2c_board_info __initdata stargate2_pwr_i2c_board_info[] = {
657 {
658 .type = "da9030",
659 .addr = 0x49,
660 .platform_data = &stargate2_da9030_pdata,
661 .irq = gpio_to_irq(1),
662 },
663};
664
665static struct pxa2xx_spi_master pxa_ssp_master_0_info = {
666 .num_chipselect = 1,
667};
668
669static struct pxa2xx_spi_master pxa_ssp_master_1_info = {
670 .num_chipselect = 1,
671};
672
673static struct pxa2xx_spi_master pxa_ssp_master_2_info = {
674 .num_chipselect = 1,
675};
676
677/* An upcoming kernel change will scrap SFRM usage so these
678 * drivers have been moved to use gpio's via cs_control */
679static struct pxa2xx_spi_chip staccel_chip_info = {
680 .tx_threshold = 8,
681 .rx_threshold = 8,
682 .dma_burst_size = 8,
683 .timeout = 235,
684 .gpio_cs = 24,
685};
686
687static struct pxa2xx_spi_chip cc2420_info = {
688 .tx_threshold = 8,
689 .rx_threshold = 8,
690 .dma_burst_size = 8,
691 .timeout = 235,
692 .gpio_cs = 39,
693};
694
695static struct spi_board_info spi_board_info[] __initdata = {
696 {
697 .modalias = "lis3l02dq",
698 .max_speed_hz = 8000000,/* 8MHz max spi frequency at 3V */
699 .bus_num = 1,
700 .chip_select = 0,
701 .controller_data = &staccel_chip_info,
702 .irq = IRQ_GPIO(96),
703 }, {
704 .modalias = "cc2420",
705 .max_speed_hz = 6500000,
706 .bus_num = 3,
707 .chip_select = 0,
708 .controller_data = &cc2420_info,
709 },
710};
711
712static void sg2_udc_command(int cmd)
713{
714 switch (cmd) {
715 case PXA2XX_UDC_CMD_CONNECT:
716 UP2OCR |= UP2OCR_HXOE | UP2OCR_DPPUE | UP2OCR_DPPUBE;
717 break;
718 case PXA2XX_UDC_CMD_DISCONNECT:
719 UP2OCR &= ~(UP2OCR_HXOE | UP2OCR_DPPUE | UP2OCR_DPPUBE);
720 break;
721 }
722}
723
724/* Board doesn't support cable detection - so always lie and say 953/* Board doesn't support cable detection - so always lie and say
725 * something is there. 954 * something is there.
726 */ 955 */
@@ -741,14 +970,6 @@ static struct platform_device *stargate2_devices[] = {
741 &sht15, 970 &sht15,
742}; 971};
743 972
744static struct i2c_pxa_platform_data i2c_pwr_pdata = {
745 .fast_mode = 1,
746};
747
748static struct i2c_pxa_platform_data i2c_pdata = {
749 .fast_mode = 1,
750};
751
752static void __init stargate2_init(void) 973static void __init stargate2_init(void)
753{ 974{
754 /* This is probably a board specific hack as this must be set 975 /* This is probably a board specific hack as this must be set
@@ -757,22 +978,13 @@ static void __init stargate2_init(void)
757 978
758 pxa2xx_mfp_config(ARRAY_AND_SIZE(stargate2_pin_config)); 979 pxa2xx_mfp_config(ARRAY_AND_SIZE(stargate2_pin_config));
759 980
760 pxa_set_ffuart_info(NULL); 981 imote2_stargate2_init();
761 pxa_set_btuart_info(NULL);
762 pxa_set_stuart_info(NULL);
763 982
764 platform_add_devices(ARRAY_AND_SIZE(stargate2_devices)); 983 platform_add_devices(ARRAY_AND_SIZE(stargate2_devices));
765 984
766 pxa2xx_set_spi_info(1, &pxa_ssp_master_0_info);
767 pxa2xx_set_spi_info(2, &pxa_ssp_master_1_info);
768 pxa2xx_set_spi_info(3, &pxa_ssp_master_2_info);
769 spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
770
771 i2c_register_board_info(0, ARRAY_AND_SIZE(stargate2_i2c_board_info)); 985 i2c_register_board_info(0, ARRAY_AND_SIZE(stargate2_i2c_board_info));
772 i2c_register_board_info(1, 986 i2c_register_board_info(1, stargate2_pwr_i2c_board_info,
773 ARRAY_AND_SIZE(stargate2_pwr_i2c_board_info)); 987 ARRAY_SIZE(stargate2_pwr_i2c_board_info));
774 pxa27x_set_i2c_power_info(&i2c_pwr_pdata);
775 pxa_set_i2c_info(&i2c_pdata);
776 988
777 pxa_set_mci_info(&stargate2_mci_platform_data); 989 pxa_set_mci_info(&stargate2_mci_platform_data);
778 990
@@ -780,7 +992,21 @@ static void __init stargate2_init(void)
780 992
781 stargate2_reset_bluetooth(); 993 stargate2_reset_bluetooth();
782} 994}
995#endif
996
997#ifdef CONFIG_MACH_INTELMOTE2
998MACHINE_START(INTELMOTE2, "IMOTE 2")
999 .phys_io = 0x40000000,
1000 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
1001 .map_io = pxa_map_io,
1002 .init_irq = pxa27x_init_irq,
1003 .timer = &pxa_timer,
1004 .init_machine = imote2_init,
1005 .boot_params = 0xA0000100,
1006MACHINE_END
1007#endif
783 1008
1009#ifdef CONFIG_MACH_STARGATE2
784MACHINE_START(STARGATE2, "Stargate 2") 1010MACHINE_START(STARGATE2, "Stargate 2")
785 .phys_io = 0x40000000, 1011 .phys_io = 0x40000000,
786 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, 1012 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
@@ -790,3 +1016,4 @@ MACHINE_START(STARGATE2, "Stargate 2")
790 .init_machine = stargate2_init, 1016 .init_machine = stargate2_init,
791 .boot_params = 0xA0000100, 1017 .boot_params = 0xA0000100,
792MACHINE_END 1018MACHINE_END
1019#endif