diff options
Diffstat (limited to 'arch/arm/mach-omap1/board-h2.c')
-rw-r--r-- | arch/arm/mach-omap1/board-h2.c | 124 |
1 files changed, 121 insertions, 3 deletions
diff --git a/arch/arm/mach-omap1/board-h2.c b/arch/arm/mach-omap1/board-h2.c index 48c8c9195dc3..b0921622566f 100644 --- a/arch/arm/mach-omap1/board-h2.c +++ b/arch/arm/mach-omap1/board-h2.c | |||
@@ -20,22 +20,23 @@ | |||
20 | */ | 20 | */ |
21 | 21 | ||
22 | #include <linux/kernel.h> | 22 | #include <linux/kernel.h> |
23 | #include <linux/init.h> | ||
24 | #include <linux/platform_device.h> | 23 | #include <linux/platform_device.h> |
25 | #include <linux/delay.h> | 24 | #include <linux/delay.h> |
25 | #include <linux/i2c.h> | ||
26 | #include <linux/mtd/mtd.h> | 26 | #include <linux/mtd/mtd.h> |
27 | #include <linux/mtd/nand.h> | 27 | #include <linux/mtd/nand.h> |
28 | #include <linux/mtd/partitions.h> | 28 | #include <linux/mtd/partitions.h> |
29 | #include <linux/input.h> | 29 | #include <linux/input.h> |
30 | #include <linux/workqueue.h> | ||
31 | 30 | ||
32 | #include <asm/hardware.h> | 31 | #include <asm/hardware.h> |
32 | #include <asm/gpio.h> | ||
33 | |||
33 | #include <asm/mach-types.h> | 34 | #include <asm/mach-types.h> |
34 | #include <asm/mach/arch.h> | 35 | #include <asm/mach/arch.h> |
35 | #include <asm/mach/flash.h> | 36 | #include <asm/mach/flash.h> |
36 | #include <asm/mach/map.h> | 37 | #include <asm/mach/map.h> |
37 | 38 | ||
38 | #include <asm/arch/gpio.h> | 39 | #include <asm/arch/tps65010.h> |
39 | #include <asm/arch/mux.h> | 40 | #include <asm/arch/mux.h> |
40 | #include <asm/arch/tc.h> | 41 | #include <asm/arch/tc.h> |
41 | #include <asm/arch/irda.h> | 42 | #include <asm/arch/irda.h> |
@@ -139,6 +140,66 @@ static struct platform_device h2_nor_device = { | |||
139 | .resource = &h2_nor_resource, | 140 | .resource = &h2_nor_resource, |
140 | }; | 141 | }; |
141 | 142 | ||
143 | #if 0 /* REVISIT: Enable when nand_platform_data is applied */ | ||
144 | |||
145 | static struct mtd_partition h2_nand_partitions[] = { | ||
146 | #if 0 | ||
147 | /* REVISIT: enable these partitions if you make NAND BOOT | ||
148 | * work on your H2 (rev C or newer); published versions of | ||
149 | * x-load only support P2 and H3. | ||
150 | */ | ||
151 | { | ||
152 | .name = "xloader", | ||
153 | .offset = 0, | ||
154 | .size = 64 * 1024, | ||
155 | .mask_flags = MTD_WRITEABLE, /* force read-only */ | ||
156 | }, | ||
157 | { | ||
158 | .name = "bootloader", | ||
159 | .offset = MTDPART_OFS_APPEND, | ||
160 | .size = 256 * 1024, | ||
161 | .mask_flags = MTD_WRITEABLE, /* force read-only */ | ||
162 | }, | ||
163 | { | ||
164 | .name = "params", | ||
165 | .offset = MTDPART_OFS_APPEND, | ||
166 | .size = 192 * 1024, | ||
167 | }, | ||
168 | { | ||
169 | .name = "kernel", | ||
170 | .offset = MTDPART_OFS_APPEND, | ||
171 | .size = 2 * SZ_1M, | ||
172 | }, | ||
173 | #endif | ||
174 | { | ||
175 | .name = "filesystem", | ||
176 | .size = MTDPART_SIZ_FULL, | ||
177 | .offset = MTDPART_OFS_APPEND, | ||
178 | }, | ||
179 | }; | ||
180 | |||
181 | /* dip switches control NAND chip access: 8 bit, 16 bit, or neither */ | ||
182 | static struct nand_platform_data h2_nand_data = { | ||
183 | .options = NAND_SAMSUNG_LP_OPTIONS, | ||
184 | .parts = h2_nand_partitions, | ||
185 | .nr_parts = ARRAY_SIZE(h2_nand_partitions), | ||
186 | }; | ||
187 | |||
188 | static struct resource h2_nand_resource = { | ||
189 | .flags = IORESOURCE_MEM, | ||
190 | }; | ||
191 | |||
192 | static struct platform_device h2_nand_device = { | ||
193 | .name = "omapnand", | ||
194 | .id = 0, | ||
195 | .dev = { | ||
196 | .platform_data = &h2_nand_data, | ||
197 | }, | ||
198 | .num_resources = 1, | ||
199 | .resource = &h2_nand_resource, | ||
200 | }; | ||
201 | #endif | ||
202 | |||
142 | static struct resource h2_smc91x_resources[] = { | 203 | static struct resource h2_smc91x_resources[] = { |
143 | [0] = { | 204 | [0] = { |
144 | .start = OMAP1610_ETHR_START, /* Physical */ | 205 | .start = OMAP1610_ETHR_START, /* Physical */ |
@@ -218,11 +279,15 @@ static struct resource h2_irda_resources[] = { | |||
218 | .flags = IORESOURCE_IRQ, | 279 | .flags = IORESOURCE_IRQ, |
219 | }, | 280 | }, |
220 | }; | 281 | }; |
282 | |||
283 | static u64 irda_dmamask = 0xffffffff; | ||
284 | |||
221 | static struct platform_device h2_irda_device = { | 285 | static struct platform_device h2_irda_device = { |
222 | .name = "omapirda", | 286 | .name = "omapirda", |
223 | .id = 0, | 287 | .id = 0, |
224 | .dev = { | 288 | .dev = { |
225 | .platform_data = &h2_irda_data, | 289 | .platform_data = &h2_irda_data, |
290 | .dma_mask = &irda_dmamask, | ||
226 | }, | 291 | }, |
227 | .num_resources = ARRAY_SIZE(h2_irda_resources), | 292 | .num_resources = ARRAY_SIZE(h2_irda_resources), |
228 | .resource = h2_irda_resources, | 293 | .resource = h2_irda_resources, |
@@ -270,6 +335,7 @@ static struct platform_device h2_mcbsp1_device = { | |||
270 | 335 | ||
271 | static struct platform_device *h2_devices[] __initdata = { | 336 | static struct platform_device *h2_devices[] __initdata = { |
272 | &h2_nor_device, | 337 | &h2_nor_device, |
338 | //&h2_nand_device, | ||
273 | &h2_smc91x_device, | 339 | &h2_smc91x_device, |
274 | &h2_irda_device, | 340 | &h2_irda_device, |
275 | &h2_kp_device, | 341 | &h2_kp_device, |
@@ -277,6 +343,20 @@ static struct platform_device *h2_devices[] __initdata = { | |||
277 | &h2_mcbsp1_device, | 343 | &h2_mcbsp1_device, |
278 | }; | 344 | }; |
279 | 345 | ||
346 | static struct i2c_board_info __initdata h2_i2c_board_info[] = { | ||
347 | { | ||
348 | I2C_BOARD_INFO("tps65010", 0x48), | ||
349 | .type = "tps65010", | ||
350 | .irq = OMAP_GPIO_IRQ(58), | ||
351 | }, | ||
352 | /* TODO when driver support is ready: | ||
353 | * - isp1301 OTG transceiver | ||
354 | * - optional ov9640 camera sensor at 0x30 | ||
355 | * - pcf9754 for aGPS control | ||
356 | * - ... etc | ||
357 | */ | ||
358 | }; | ||
359 | |||
280 | static void __init h2_init_smc91x(void) | 360 | static void __init h2_init_smc91x(void) |
281 | { | 361 | { |
282 | if ((omap_request_gpio(0)) < 0) { | 362 | if ((omap_request_gpio(0)) < 0) { |
@@ -333,6 +413,13 @@ static struct omap_board_config_kernel h2_config[] __initdata = { | |||
333 | { OMAP_TAG_LCD, &h2_lcd_config }, | 413 | { OMAP_TAG_LCD, &h2_lcd_config }, |
334 | }; | 414 | }; |
335 | 415 | ||
416 | #define H2_NAND_RB_GPIO_PIN 62 | ||
417 | |||
418 | static int h2_nand_dev_ready(struct nand_platform_data *data) | ||
419 | { | ||
420 | return omap_get_gpio_datain(H2_NAND_RB_GPIO_PIN); | ||
421 | } | ||
422 | |||
336 | static void __init h2_init(void) | 423 | static void __init h2_init(void) |
337 | { | 424 | { |
338 | /* Here we assume the NOR boot config: NOR on CS3 (possibly swapped | 425 | /* Here we assume the NOR boot config: NOR on CS3 (possibly swapped |
@@ -347,6 +434,13 @@ static void __init h2_init(void) | |||
347 | h2_nor_resource.end = h2_nor_resource.start = omap_cs3_phys(); | 434 | h2_nor_resource.end = h2_nor_resource.start = omap_cs3_phys(); |
348 | h2_nor_resource.end += SZ_32M - 1; | 435 | h2_nor_resource.end += SZ_32M - 1; |
349 | 436 | ||
437 | #if 0 /* REVISIT: Enable when nand_platform_data is applied */ | ||
438 | h2_nand_resource.end = h2_nand_resource.start = OMAP_CS2B_PHYS; | ||
439 | h2_nand_resource.end += SZ_4K - 1; | ||
440 | if (!(omap_request_gpio(H2_NAND_RB_GPIO_PIN))) | ||
441 | h2_nand_data.dev_ready = h2_nand_dev_ready; | ||
442 | #endif | ||
443 | |||
350 | omap_cfg_reg(L3_1610_FLASH_CS2B_OE); | 444 | omap_cfg_reg(L3_1610_FLASH_CS2B_OE); |
351 | omap_cfg_reg(M8_1610_FLASH_CS2B_WE); | 445 | omap_cfg_reg(M8_1610_FLASH_CS2B_WE); |
352 | 446 | ||
@@ -367,6 +461,14 @@ static void __init h2_init(void) | |||
367 | omap_board_config = h2_config; | 461 | omap_board_config = h2_config; |
368 | omap_board_config_size = ARRAY_SIZE(h2_config); | 462 | omap_board_config_size = ARRAY_SIZE(h2_config); |
369 | omap_serial_init(); | 463 | omap_serial_init(); |
464 | |||
465 | /* irq for tps65010 chip */ | ||
466 | omap_cfg_reg(W4_GPIO58); | ||
467 | if (gpio_request(58, "tps65010") == 0) | ||
468 | gpio_direction_input(58); | ||
469 | |||
470 | i2c_register_board_info(1, h2_i2c_board_info, | ||
471 | ARRAY_SIZE(h2_i2c_board_info)); | ||
370 | } | 472 | } |
371 | 473 | ||
372 | static void __init h2_map_io(void) | 474 | static void __init h2_map_io(void) |
@@ -374,6 +476,22 @@ static void __init h2_map_io(void) | |||
374 | omap1_map_common_io(); | 476 | omap1_map_common_io(); |
375 | } | 477 | } |
376 | 478 | ||
479 | #ifdef CONFIG_TPS65010 | ||
480 | static int __init h2_tps_init(void) | ||
481 | { | ||
482 | if (!machine_is_omap_h2()) | ||
483 | return 0; | ||
484 | |||
485 | /* gpio3 for SD, gpio4 for VDD_DSP */ | ||
486 | /* FIXME send power to DSP iff it's configured */ | ||
487 | |||
488 | /* Enable LOW_PWR */ | ||
489 | tps65010_set_low_pwr(ON); | ||
490 | return 0; | ||
491 | } | ||
492 | fs_initcall(h2_tps_init); | ||
493 | #endif | ||
494 | |||
377 | MACHINE_START(OMAP_H2, "TI-H2") | 495 | MACHINE_START(OMAP_H2, "TI-H2") |
378 | /* Maintainer: Imre Deak <imre.deak@nokia.com> */ | 496 | /* Maintainer: Imre Deak <imre.deak@nokia.com> */ |
379 | .phys_io = 0xfff00000, | 497 | .phys_io = 0xfff00000, |