diff options
Diffstat (limited to 'arch/arm/mach-omap1/board-h2.c')
-rw-r--r-- | arch/arm/mach-omap1/board-h2.c | 103 |
1 files changed, 33 insertions, 70 deletions
diff --git a/arch/arm/mach-omap1/board-h2.c b/arch/arm/mach-omap1/board-h2.c index bfa04fa25524..070345ee39a5 100644 --- a/arch/arm/mach-omap1/board-h2.c +++ b/arch/arm/mach-omap1/board-h2.c | |||
@@ -37,8 +37,10 @@ | |||
37 | #include <asm/mach/flash.h> | 37 | #include <asm/mach/flash.h> |
38 | #include <asm/mach/map.h> | 38 | #include <asm/mach/map.h> |
39 | 39 | ||
40 | #include <asm/arch/gpio-switch.h> | ||
40 | #include <asm/arch/mux.h> | 41 | #include <asm/arch/mux.h> |
41 | #include <asm/arch/tc.h> | 42 | #include <asm/arch/tc.h> |
43 | #include <asm/arch/nand.h> | ||
42 | #include <asm/arch/irda.h> | 44 | #include <asm/arch/irda.h> |
43 | #include <asm/arch/usb.h> | 45 | #include <asm/arch/usb.h> |
44 | #include <asm/arch/keypad.h> | 46 | #include <asm/arch/keypad.h> |
@@ -46,8 +48,6 @@ | |||
46 | #include <asm/arch/mcbsp.h> | 48 | #include <asm/arch/mcbsp.h> |
47 | #include <asm/arch/omap-alsa.h> | 49 | #include <asm/arch/omap-alsa.h> |
48 | 50 | ||
49 | extern int omap_gpio_init(void); | ||
50 | |||
51 | static int h2_keymap[] = { | 51 | static int h2_keymap[] = { |
52 | KEY(0, 0, KEY_LEFT), | 52 | KEY(0, 0, KEY_LEFT), |
53 | KEY(0, 1, KEY_RIGHT), | 53 | KEY(0, 1, KEY_RIGHT), |
@@ -140,8 +140,6 @@ static struct platform_device h2_nor_device = { | |||
140 | .resource = &h2_nor_resource, | 140 | .resource = &h2_nor_resource, |
141 | }; | 141 | }; |
142 | 142 | ||
143 | #if 0 /* REVISIT: Enable when nand_platform_data is applied */ | ||
144 | |||
145 | static struct mtd_partition h2_nand_partitions[] = { | 143 | static struct mtd_partition h2_nand_partitions[] = { |
146 | #if 0 | 144 | #if 0 |
147 | /* REVISIT: enable these partitions if you make NAND BOOT | 145 | /* REVISIT: enable these partitions if you make NAND BOOT |
@@ -179,7 +177,7 @@ static struct mtd_partition h2_nand_partitions[] = { | |||
179 | }; | 177 | }; |
180 | 178 | ||
181 | /* dip switches control NAND chip access: 8 bit, 16 bit, or neither */ | 179 | /* dip switches control NAND chip access: 8 bit, 16 bit, or neither */ |
182 | static struct nand_platform_data h2_nand_data = { | 180 | static struct omap_nand_platform_data h2_nand_data = { |
183 | .options = NAND_SAMSUNG_LP_OPTIONS, | 181 | .options = NAND_SAMSUNG_LP_OPTIONS, |
184 | .parts = h2_nand_partitions, | 182 | .parts = h2_nand_partitions, |
185 | .nr_parts = ARRAY_SIZE(h2_nand_partitions), | 183 | .nr_parts = ARRAY_SIZE(h2_nand_partitions), |
@@ -198,7 +196,6 @@ static struct platform_device h2_nand_device = { | |||
198 | .num_resources = 1, | 196 | .num_resources = 1, |
199 | .resource = &h2_nand_resource, | 197 | .resource = &h2_nand_resource, |
200 | }; | 198 | }; |
201 | #endif | ||
202 | 199 | ||
203 | static struct resource h2_smc91x_resources[] = { | 200 | static struct resource h2_smc91x_resources[] = { |
204 | [0] = { | 201 | [0] = { |
@@ -311,18 +308,18 @@ static struct omap_mcbsp_reg_cfg mcbsp_regs = { | |||
311 | .srgr2 = GSYNC | CLKSP | FSGM | FPER(31), | 308 | .srgr2 = GSYNC | CLKSP | FSGM | FPER(31), |
312 | 309 | ||
313 | .pcr0 = CLKXM | CLKRM | FSXP | FSRP | CLKXP | CLKRP, | 310 | .pcr0 = CLKXM | CLKRM | FSXP | FSRP | CLKXP | CLKRP, |
314 | //.pcr0 = CLKXP | CLKRP, /* mcbsp: slave */ | 311 | /*.pcr0 = CLKXP | CLKRP,*/ /* mcbsp: slave */ |
315 | }; | 312 | }; |
316 | 313 | ||
317 | static struct omap_alsa_codec_config alsa_config = { | 314 | static struct omap_alsa_codec_config alsa_config = { |
318 | .name = "H2 TSC2101", | 315 | .name = "H2 TSC2101", |
319 | .mcbsp_regs_alsa = &mcbsp_regs, | 316 | .mcbsp_regs_alsa = &mcbsp_regs, |
320 | .codec_configure_dev = NULL, // tsc2101_configure, | 317 | .codec_configure_dev = NULL, /* tsc2101_configure, */ |
321 | .codec_set_samplerate = NULL, // tsc2101_set_samplerate, | 318 | .codec_set_samplerate = NULL, /* tsc2101_set_samplerate, */ |
322 | .codec_clock_setup = NULL, // tsc2101_clock_setup, | 319 | .codec_clock_setup = NULL, /* tsc2101_clock_setup, */ |
323 | .codec_clock_on = NULL, // tsc2101_clock_on, | 320 | .codec_clock_on = NULL, /* tsc2101_clock_on, */ |
324 | .codec_clock_off = NULL, // tsc2101_clock_off, | 321 | .codec_clock_off = NULL, /* tsc2101_clock_off, */ |
325 | .get_default_samplerate = NULL, // tsc2101_get_default_samplerate, | 322 | .get_default_samplerate = NULL, /* tsc2101_get_default_samplerate, */ |
326 | }; | 323 | }; |
327 | 324 | ||
328 | static struct platform_device h2_mcbsp1_device = { | 325 | static struct platform_device h2_mcbsp1_device = { |
@@ -335,7 +332,7 @@ static struct platform_device h2_mcbsp1_device = { | |||
335 | 332 | ||
336 | static struct platform_device *h2_devices[] __initdata = { | 333 | static struct platform_device *h2_devices[] __initdata = { |
337 | &h2_nor_device, | 334 | &h2_nor_device, |
338 | //&h2_nand_device, | 335 | &h2_nand_device, |
339 | &h2_smc91x_device, | 336 | &h2_smc91x_device, |
340 | &h2_irda_device, | 337 | &h2_irda_device, |
341 | &h2_kp_device, | 338 | &h2_kp_device, |
@@ -343,22 +340,6 @@ static struct platform_device *h2_devices[] __initdata = { | |||
343 | &h2_mcbsp1_device, | 340 | &h2_mcbsp1_device, |
344 | }; | 341 | }; |
345 | 342 | ||
346 | #ifdef CONFIG_I2C_BOARDINFO | ||
347 | static struct i2c_board_info __initdata h2_i2c_board_info[] = { | ||
348 | { | ||
349 | I2C_BOARD_INFO("tps65010", 0x48), | ||
350 | .type = "tps65010", | ||
351 | .irq = OMAP_GPIO_IRQ(58), | ||
352 | }, | ||
353 | /* TODO when driver support is ready: | ||
354 | * - isp1301 OTG transceiver | ||
355 | * - optional ov9640 camera sensor at 0x30 | ||
356 | * - pcf9754 for aGPS control | ||
357 | * - ... etc | ||
358 | */ | ||
359 | }; | ||
360 | #endif | ||
361 | |||
362 | static void __init h2_init_smc91x(void) | 343 | static void __init h2_init_smc91x(void) |
363 | { | 344 | { |
364 | if ((omap_request_gpio(0)) < 0) { | 345 | if ((omap_request_gpio(0)) < 0) { |
@@ -367,6 +348,14 @@ static void __init h2_init_smc91x(void) | |||
367 | } | 348 | } |
368 | } | 349 | } |
369 | 350 | ||
351 | static struct i2c_board_info __initdata h2_i2c_board_info[] = { | ||
352 | { | ||
353 | I2C_BOARD_INFO("isp1301_omap", 0x2d), | ||
354 | .type = "isp1301_omap", | ||
355 | .irq = OMAP_GPIO_IRQ(2), | ||
356 | }, | ||
357 | }; | ||
358 | |||
370 | static void __init h2_init_irq(void) | 359 | static void __init h2_init_irq(void) |
371 | { | 360 | { |
372 | omap1_init_common_hw(); | 361 | omap1_init_common_hw(); |
@@ -380,26 +369,25 @@ static struct omap_usb_config h2_usb_config __initdata = { | |||
380 | .otg = 2, | 369 | .otg = 2, |
381 | 370 | ||
382 | #ifdef CONFIG_USB_GADGET_OMAP | 371 | #ifdef CONFIG_USB_GADGET_OMAP |
383 | .hmc_mode = 19, // 0:host(off) 1:dev|otg 2:disabled | 372 | .hmc_mode = 19, /* 0:host(off) 1:dev|otg 2:disabled */ |
384 | // .hmc_mode = 21, // 0:host(off) 1:dev(loopback) 2:host(loopback) | 373 | /* .hmc_mode = 21,*/ /* 0:host(off) 1:dev(loopback) 2:host(loopback) */ |
385 | #elif defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) | 374 | #elif defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) |
386 | /* needs OTG cable, or NONSTANDARD (B-to-MiniB) */ | 375 | /* needs OTG cable, or NONSTANDARD (B-to-MiniB) */ |
387 | .hmc_mode = 20, // 1:dev|otg(off) 1:host 2:disabled | 376 | .hmc_mode = 20, /* 1:dev|otg(off) 1:host 2:disabled */ |
388 | #endif | 377 | #endif |
389 | 378 | ||
390 | .pins[1] = 3, | 379 | .pins[1] = 3, |
391 | }; | 380 | }; |
392 | 381 | ||
393 | static struct omap_mmc_config h2_mmc_config __initdata = { | 382 | static struct omap_mmc_config h2_mmc_config __initdata = { |
394 | .mmc [0] = { | 383 | .mmc[0] = { |
395 | .enabled = 1, | 384 | .enabled = 1, |
396 | .wire4 = 1, | 385 | .wire4 = 1, |
397 | .wp_pin = OMAP_MPUIO(3), | ||
398 | .power_pin = -1, /* tps65010 gpio3 */ | ||
399 | .switch_pin = OMAP_MPUIO(1), | ||
400 | }, | 386 | }, |
401 | }; | 387 | }; |
402 | 388 | ||
389 | extern struct omap_mmc_platform_data h2_mmc_data; | ||
390 | |||
403 | static struct omap_uart_config h2_uart_config __initdata = { | 391 | static struct omap_uart_config h2_uart_config __initdata = { |
404 | .enabled_uarts = ((1 << 0) | (1 << 1) | (1 << 2)), | 392 | .enabled_uarts = ((1 << 0) | (1 << 1) | (1 << 2)), |
405 | }; | 393 | }; |
@@ -409,15 +397,15 @@ static struct omap_lcd_config h2_lcd_config __initdata = { | |||
409 | }; | 397 | }; |
410 | 398 | ||
411 | static struct omap_board_config_kernel h2_config[] __initdata = { | 399 | static struct omap_board_config_kernel h2_config[] __initdata = { |
412 | { OMAP_TAG_USB, &h2_usb_config }, | 400 | { OMAP_TAG_USB, &h2_usb_config }, |
413 | { OMAP_TAG_MMC, &h2_mmc_config }, | 401 | { OMAP_TAG_MMC, &h2_mmc_config }, |
414 | { OMAP_TAG_UART, &h2_uart_config }, | 402 | { OMAP_TAG_UART, &h2_uart_config }, |
415 | { OMAP_TAG_LCD, &h2_lcd_config }, | 403 | { OMAP_TAG_LCD, &h2_lcd_config }, |
416 | }; | 404 | }; |
417 | 405 | ||
418 | #define H2_NAND_RB_GPIO_PIN 62 | 406 | #define H2_NAND_RB_GPIO_PIN 62 |
419 | 407 | ||
420 | static int h2_nand_dev_ready(struct nand_platform_data *data) | 408 | static int h2_nand_dev_ready(struct omap_nand_platform_data *data) |
421 | { | 409 | { |
422 | return omap_get_gpio_datain(H2_NAND_RB_GPIO_PIN); | 410 | return omap_get_gpio_datain(H2_NAND_RB_GPIO_PIN); |
423 | } | 411 | } |
@@ -436,18 +424,16 @@ static void __init h2_init(void) | |||
436 | h2_nor_resource.end = h2_nor_resource.start = omap_cs3_phys(); | 424 | h2_nor_resource.end = h2_nor_resource.start = omap_cs3_phys(); |
437 | h2_nor_resource.end += SZ_32M - 1; | 425 | h2_nor_resource.end += SZ_32M - 1; |
438 | 426 | ||
439 | #if 0 /* REVISIT: Enable when nand_platform_data is applied */ | ||
440 | h2_nand_resource.end = h2_nand_resource.start = OMAP_CS2B_PHYS; | 427 | h2_nand_resource.end = h2_nand_resource.start = OMAP_CS2B_PHYS; |
441 | h2_nand_resource.end += SZ_4K - 1; | 428 | h2_nand_resource.end += SZ_4K - 1; |
442 | if (!(omap_request_gpio(H2_NAND_RB_GPIO_PIN))) | 429 | if (!(omap_request_gpio(H2_NAND_RB_GPIO_PIN))) |
443 | h2_nand_data.dev_ready = h2_nand_dev_ready; | 430 | h2_nand_data.dev_ready = h2_nand_dev_ready; |
444 | #endif | ||
445 | 431 | ||
446 | omap_cfg_reg(L3_1610_FLASH_CS2B_OE); | 432 | omap_cfg_reg(L3_1610_FLASH_CS2B_OE); |
447 | omap_cfg_reg(M8_1610_FLASH_CS2B_WE); | 433 | omap_cfg_reg(M8_1610_FLASH_CS2B_WE); |
448 | 434 | ||
449 | /* MMC: card detect and WP */ | 435 | /* MMC: card detect and WP */ |
450 | // omap_cfg_reg(U19_ARMIO1); /* CD */ | 436 | /* omap_cfg_reg(U19_ARMIO1); */ /* CD */ |
451 | omap_cfg_reg(BALLOUT_V8_ARMIO3); /* WP */ | 437 | omap_cfg_reg(BALLOUT_V8_ARMIO3); /* WP */ |
452 | 438 | ||
453 | /* Irda */ | 439 | /* Irda */ |
@@ -463,16 +449,9 @@ static void __init h2_init(void) | |||
463 | omap_board_config = h2_config; | 449 | omap_board_config = h2_config; |
464 | omap_board_config_size = ARRAY_SIZE(h2_config); | 450 | omap_board_config_size = ARRAY_SIZE(h2_config); |
465 | omap_serial_init(); | 451 | omap_serial_init(); |
466 | 452 | omap_register_i2c_bus(1, 100, h2_i2c_board_info, | |
467 | /* irq for tps65010 chip */ | 453 | ARRAY_SIZE(h2_i2c_board_info)); |
468 | omap_cfg_reg(W4_GPIO58); | 454 | h2_mmc_init(); |
469 | if (gpio_request(58, "tps65010") == 0) | ||
470 | gpio_direction_input(58); | ||
471 | |||
472 | #ifdef CONFIG_I2C_BOARDINFO | ||
473 | i2c_register_board_info(1, h2_i2c_board_info, | ||
474 | ARRAY_SIZE(h2_i2c_board_info)); | ||
475 | #endif | ||
476 | } | 455 | } |
477 | 456 | ||
478 | static void __init h2_map_io(void) | 457 | static void __init h2_map_io(void) |
@@ -480,22 +459,6 @@ static void __init h2_map_io(void) | |||
480 | omap1_map_common_io(); | 459 | omap1_map_common_io(); |
481 | } | 460 | } |
482 | 461 | ||
483 | #ifdef CONFIG_TPS65010 | ||
484 | static int __init h2_tps_init(void) | ||
485 | { | ||
486 | if (!machine_is_omap_h2()) | ||
487 | return 0; | ||
488 | |||
489 | /* gpio3 for SD, gpio4 for VDD_DSP */ | ||
490 | /* FIXME send power to DSP iff it's configured */ | ||
491 | |||
492 | /* Enable LOW_PWR */ | ||
493 | tps65010_set_low_pwr(ON); | ||
494 | return 0; | ||
495 | } | ||
496 | fs_initcall(h2_tps_init); | ||
497 | #endif | ||
498 | |||
499 | MACHINE_START(OMAP_H2, "TI-H2") | 462 | MACHINE_START(OMAP_H2, "TI-H2") |
500 | /* Maintainer: Imre Deak <imre.deak@nokia.com> */ | 463 | /* Maintainer: Imre Deak <imre.deak@nokia.com> */ |
501 | .phys_io = 0xfff00000, | 464 | .phys_io = 0xfff00000, |