aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/board-omap3evm.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-omap2/board-omap3evm.c')
-rw-r--r--arch/arm/mach-omap2/board-omap3evm.c78
1 files changed, 77 insertions, 1 deletions
diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c
index 639bd07ea38a..ef230a0eb5eb 100644
--- a/arch/arm/mach-omap2/board-omap3evm.c
+++ b/arch/arm/mach-omap2/board-omap3evm.c
@@ -24,6 +24,10 @@
24#include <linux/leds.h> 24#include <linux/leds.h>
25#include <linux/interrupt.h> 25#include <linux/interrupt.h>
26 26
27#include <linux/mtd/mtd.h>
28#include <linux/mtd/partitions.h>
29#include <linux/mtd/nand.h>
30
27#include <linux/spi/spi.h> 31#include <linux/spi/spi.h>
28#include <linux/spi/ads7846.h> 32#include <linux/spi/ads7846.h>
29#include <linux/i2c/twl.h> 33#include <linux/i2c/twl.h>
@@ -43,6 +47,7 @@
43 47
44#include <plat/board.h> 48#include <plat/board.h>
45#include <plat/usb.h> 49#include <plat/usb.h>
50#include <plat/nand.h>
46#include "common.h" 51#include "common.h"
47#include <plat/mcspi.h> 52#include <plat/mcspi.h>
48#include <video/omapdss.h> 53#include <video/omapdss.h>
@@ -53,7 +58,6 @@
53#include "hsmmc.h" 58#include "hsmmc.h"
54#include "common-board-devices.h" 59#include "common-board-devices.h"
55 60
56#define OMAP3_EVM_TS_GPIO 175
57#define OMAP3_EVM_EHCI_VBUS 22 61#define OMAP3_EVM_EHCI_VBUS 22
58#define OMAP3_EVM_EHCI_SELECT 61 62#define OMAP3_EVM_EHCI_SELECT 61
59 63
@@ -355,6 +359,19 @@ static int omap3evm_twl_gpio_setup(struct device *dev,
355 359
356 platform_device_register(&leds_gpio); 360 platform_device_register(&leds_gpio);
357 361
362 /* Enable VBUS switch by setting TWL4030.GPIO2DIR as output
363 * for starting USB tranceiver
364 */
365#ifdef CONFIG_TWL4030_CORE
366 if (get_omap3_evm_rev() >= OMAP3EVM_BOARD_GEN_2) {
367 u8 val;
368
369 twl_i2c_read_u8(TWL4030_MODULE_GPIO, &val, REG_GPIODATADIR1);
370 val |= 0x04; /* TWL4030.GPIO2DIR BIT at GPIODATADIR1(0x9B) */
371 twl_i2c_write_u8(TWL4030_MODULE_GPIO, val, REG_GPIODATADIR1);
372 }
373#endif
374
358 return 0; 375 return 0;
359} 376}
360 377
@@ -461,6 +478,28 @@ struct wl12xx_platform_data omap3evm_wlan_data __initdata = {
461}; 478};
462#endif 479#endif
463 480
481/* VAUX2 for USB */
482static struct regulator_consumer_supply omap3evm_vaux2_supplies[] = {
483 REGULATOR_SUPPLY("VDD_CSIPHY1", "omap3isp"), /* OMAP ISP */
484 REGULATOR_SUPPLY("VDD_CSIPHY2", "omap3isp"), /* OMAP ISP */
485 REGULATOR_SUPPLY("hsusb1", "ehci-omap.0"),
486 REGULATOR_SUPPLY("vaux2", NULL),
487};
488
489static struct regulator_init_data omap3evm_vaux2 = {
490 .constraints = {
491 .min_uV = 2800000,
492 .max_uV = 2800000,
493 .apply_uV = true,
494 .valid_modes_mask = REGULATOR_MODE_NORMAL
495 | REGULATOR_MODE_STANDBY,
496 .valid_ops_mask = REGULATOR_CHANGE_MODE
497 | REGULATOR_CHANGE_STATUS,
498 },
499 .num_consumer_supplies = ARRAY_SIZE(omap3evm_vaux2_supplies),
500 .consumer_supplies = omap3evm_vaux2_supplies,
501};
502
464static struct twl4030_platform_data omap3evm_twldata = { 503static struct twl4030_platform_data omap3evm_twldata = {
465 /* platform_data for children goes here */ 504 /* platform_data for children goes here */
466 .keypad = &omap3evm_kp_data, 505 .keypad = &omap3evm_kp_data,
@@ -607,6 +646,37 @@ static struct regulator_consumer_supply dummy_supplies[] = {
607 REGULATOR_SUPPLY("vdd33a", "smsc911x.0"), 646 REGULATOR_SUPPLY("vdd33a", "smsc911x.0"),
608}; 647};
609 648
649static struct mtd_partition omap3evm_nand_partitions[] = {
650 /* All the partition sizes are listed in terms of NAND block size */
651 {
652 .name = "X-Loader",
653 .offset = 0,
654 .size = 4*(SZ_128K),
655 .mask_flags = MTD_WRITEABLE
656 },
657 {
658 .name = "U-Boot",
659 .offset = MTDPART_OFS_APPEND,
660 .size = 14*(SZ_128K),
661 .mask_flags = MTD_WRITEABLE
662 },
663 {
664 .name = "U-Boot Env",
665 .offset = MTDPART_OFS_APPEND,
666 .size = 2*(SZ_128K)
667 },
668 {
669 .name = "Kernel",
670 .offset = MTDPART_OFS_APPEND,
671 .size = 40*(SZ_128K)
672 },
673 {
674 .name = "File system",
675 .size = MTDPART_SIZ_FULL,
676 .offset = MTDPART_OFS_APPEND,
677 },
678};
679
610static void __init omap3_evm_init(void) 680static void __init omap3_evm_init(void)
611{ 681{
612 struct omap_board_mux *obm; 682 struct omap_board_mux *obm;
@@ -623,6 +693,9 @@ static void __init omap3_evm_init(void)
623 omap_mux_init_gpio(63, OMAP_PIN_INPUT); 693 omap_mux_init_gpio(63, OMAP_PIN_INPUT);
624 omap_hsmmc_init(mmc); 694 omap_hsmmc_init(mmc);
625 695
696 if (get_omap3_evm_rev() >= OMAP3EVM_BOARD_GEN_2)
697 omap3evm_twldata.vaux2 = &omap3evm_vaux2;
698
626 omap3_evm_i2c_init(); 699 omap3_evm_i2c_init();
627 700
628 omap_display_init(&omap3_evm_dss_data); 701 omap_display_init(&omap3_evm_dss_data);
@@ -656,6 +729,9 @@ static void __init omap3_evm_init(void)
656 } 729 }
657 usb_musb_init(&musb_board_data); 730 usb_musb_init(&musb_board_data);
658 usbhs_init(&usbhs_bdata); 731 usbhs_init(&usbhs_bdata);
732 omap_nand_flash_init(NAND_BUSWIDTH_16, omap3evm_nand_partitions,
733 ARRAY_SIZE(omap3evm_nand_partitions));
734
659 omap_ads7846_init(1, OMAP3_EVM_TS_GPIO, 310, NULL); 735 omap_ads7846_init(1, OMAP3_EVM_TS_GPIO, 310, NULL);
660 omap3evm_init_smsc911x(); 736 omap3evm_init_smsc911x();
661 omap3_evm_display_init(); 737 omap3_evm_display_init();