diff options
Diffstat (limited to 'arch/arm/mach-omap2/board-igep0020.c')
-rw-r--r-- | arch/arm/mach-omap2/board-igep0020.c | 118 |
1 files changed, 42 insertions, 76 deletions
diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c index 930c0d380435..7a274098f67b 100644 --- a/arch/arm/mach-omap2/board-igep0020.c +++ b/arch/arm/mach-omap2/board-igep0020.c | |||
@@ -24,6 +24,8 @@ | |||
24 | #include <linux/i2c/twl.h> | 24 | #include <linux/i2c/twl.h> |
25 | #include <linux/mmc/host.h> | 25 | #include <linux/mmc/host.h> |
26 | 26 | ||
27 | #include <linux/mtd/nand.h> | ||
28 | |||
27 | #include <asm/mach-types.h> | 29 | #include <asm/mach-types.h> |
28 | #include <asm/mach/arch.h> | 30 | #include <asm/mach/arch.h> |
29 | 31 | ||
@@ -32,13 +34,15 @@ | |||
32 | #include <plat/gpmc.h> | 34 | #include <plat/gpmc.h> |
33 | #include <plat/usb.h> | 35 | #include <plat/usb.h> |
34 | #include <video/omapdss.h> | 36 | #include <video/omapdss.h> |
35 | #include <video/omap-panel-dvi.h> | 37 | #include <video/omap-panel-tfp410.h> |
36 | #include <plat/onenand.h> | 38 | #include <plat/onenand.h> |
37 | 39 | ||
38 | #include "mux.h" | 40 | #include "mux.h" |
39 | #include "hsmmc.h" | 41 | #include "hsmmc.h" |
40 | #include "sdram-numonyx-m65kxxxxam.h" | 42 | #include "sdram-numonyx-m65kxxxxam.h" |
41 | #include "common-board-devices.h" | 43 | #include "common-board-devices.h" |
44 | #include "board-flash.h" | ||
45 | #include "control.h" | ||
42 | 46 | ||
43 | #define IGEP2_SMSC911X_CS 5 | 47 | #define IGEP2_SMSC911X_CS 5 |
44 | #define IGEP2_SMSC911X_GPIO 176 | 48 | #define IGEP2_SMSC911X_GPIO 176 |
@@ -60,6 +64,10 @@ | |||
60 | #define IGEP3_GPIO_LED1_RED 16 | 64 | #define IGEP3_GPIO_LED1_RED 16 |
61 | #define IGEP3_GPIO_USBH_NRESET 183 | 65 | #define IGEP3_GPIO_USBH_NRESET 183 |
62 | 66 | ||
67 | #define IGEP_SYSBOOT_MASK 0x1f | ||
68 | #define IGEP_SYSBOOT_NAND 0x0f | ||
69 | #define IGEP_SYSBOOT_ONENAND 0x10 | ||
70 | |||
63 | /* | 71 | /* |
64 | * IGEP2 Hardware Revision Table | 72 | * IGEP2 Hardware Revision Table |
65 | * | 73 | * |
@@ -110,8 +118,10 @@ static void __init igep2_get_revision(void) | |||
110 | gpio_free(IGEP2_GPIO_LED1_RED); | 118 | gpio_free(IGEP2_GPIO_LED1_RED); |
111 | } | 119 | } |
112 | 120 | ||
113 | #if defined(CONFIG_MTD_ONENAND_OMAP2) || \ | 121 | #if defined(CONFIG_MTD_ONENAND_OMAP2) || \ |
114 | defined(CONFIG_MTD_ONENAND_OMAP2_MODULE) | 122 | defined(CONFIG_MTD_ONENAND_OMAP2_MODULE) || \ |
123 | defined(CONFIG_MTD_NAND_OMAP2) || \ | ||
124 | defined(CONFIG_MTD_NAND_OMAP2_MODULE) | ||
115 | 125 | ||
116 | #define ONENAND_MAP 0x20000000 | 126 | #define ONENAND_MAP 0x20000000 |
117 | 127 | ||
@@ -123,7 +133,7 @@ static void __init igep2_get_revision(void) | |||
123 | * So MTD regards it as 4KiB page size and 256KiB block size 64*(2*2048) | 133 | * So MTD regards it as 4KiB page size and 256KiB block size 64*(2*2048) |
124 | */ | 134 | */ |
125 | 135 | ||
126 | static struct mtd_partition igep_onenand_partitions[] = { | 136 | static struct mtd_partition igep_flash_partitions[] = { |
127 | { | 137 | { |
128 | .name = "X-Loader", | 138 | .name = "X-Loader", |
129 | .offset = 0, | 139 | .offset = 0, |
@@ -151,50 +161,28 @@ static struct mtd_partition igep_onenand_partitions[] = { | |||
151 | }, | 161 | }, |
152 | }; | 162 | }; |
153 | 163 | ||
154 | static struct omap_onenand_platform_data igep_onenand_data = { | 164 | static inline u32 igep_get_sysboot_value(void) |
155 | .parts = igep_onenand_partitions, | 165 | { |
156 | .nr_parts = ARRAY_SIZE(igep_onenand_partitions), | 166 | return omap_ctrl_readl(OMAP343X_CONTROL_STATUS) & IGEP_SYSBOOT_MASK; |
157 | .dma_channel = -1, /* disable DMA in OMAP OneNAND driver */ | 167 | } |
158 | }; | ||
159 | |||
160 | static struct platform_device igep_onenand_device = { | ||
161 | .name = "omap2-onenand", | ||
162 | .id = -1, | ||
163 | .dev = { | ||
164 | .platform_data = &igep_onenand_data, | ||
165 | }, | ||
166 | }; | ||
167 | 168 | ||
168 | static void __init igep_flash_init(void) | 169 | static void __init igep_flash_init(void) |
169 | { | 170 | { |
170 | u8 cs = 0; | 171 | u32 mux; |
171 | u8 onenandcs = GPMC_CS_NUM + 1; | 172 | mux = igep_get_sysboot_value(); |
172 | 173 | ||
173 | for (cs = 0; cs < GPMC_CS_NUM; cs++) { | 174 | if (mux == IGEP_SYSBOOT_NAND) { |
174 | u32 ret; | 175 | pr_info("IGEP: initializing NAND memory device\n"); |
175 | ret = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1); | 176 | board_nand_init(igep_flash_partitions, |
176 | 177 | ARRAY_SIZE(igep_flash_partitions), | |
177 | /* Check if NAND/oneNAND is configured */ | 178 | 0, NAND_BUSWIDTH_16); |
178 | if ((ret & 0xC00) == 0x800) | 179 | } else if (mux == IGEP_SYSBOOT_ONENAND) { |
179 | /* NAND found */ | 180 | pr_info("IGEP: initializing OneNAND memory device\n"); |
180 | pr_err("IGEP: Unsupported NAND found\n"); | 181 | board_onenand_init(igep_flash_partitions, |
181 | else { | 182 | ARRAY_SIZE(igep_flash_partitions), 0); |
182 | ret = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG7); | 183 | } else { |
183 | if ((ret & 0x3F) == (ONENAND_MAP >> 24)) | 184 | pr_err("IGEP: Flash: unsupported sysboot sequence found\n"); |
184 | /* ONENAND found */ | ||
185 | onenandcs = cs; | ||
186 | } | ||
187 | } | ||
188 | |||
189 | if (onenandcs > GPMC_CS_NUM) { | ||
190 | pr_err("IGEP: Unable to find configuration in GPMC\n"); | ||
191 | return; | ||
192 | } | 185 | } |
193 | |||
194 | igep_onenand_data.cs = onenandcs; | ||
195 | |||
196 | if (platform_device_register(&igep_onenand_device) < 0) | ||
197 | pr_err("IGEP: Unable to register OneNAND device\n"); | ||
198 | } | 186 | } |
199 | 187 | ||
200 | #else | 188 | #else |
@@ -444,28 +432,15 @@ static struct twl4030_gpio_platform_data igep_twl4030_gpio_pdata = { | |||
444 | .setup = igep_twl_gpio_setup, | 432 | .setup = igep_twl_gpio_setup, |
445 | }; | 433 | }; |
446 | 434 | ||
447 | static int igep2_enable_dvi(struct omap_dss_device *dssdev) | 435 | static struct tfp410_platform_data dvi_panel = { |
448 | { | 436 | .i2c_bus_num = 3, |
449 | gpio_direction_output(IGEP2_GPIO_DVI_PUP, 1); | 437 | .power_down_gpio = IGEP2_GPIO_DVI_PUP, |
450 | |||
451 | return 0; | ||
452 | } | ||
453 | |||
454 | static void igep2_disable_dvi(struct omap_dss_device *dssdev) | ||
455 | { | ||
456 | gpio_direction_output(IGEP2_GPIO_DVI_PUP, 0); | ||
457 | } | ||
458 | |||
459 | static struct panel_dvi_platform_data dvi_panel = { | ||
460 | .platform_enable = igep2_enable_dvi, | ||
461 | .platform_disable = igep2_disable_dvi, | ||
462 | .i2c_bus_num = 3, | ||
463 | }; | 438 | }; |
464 | 439 | ||
465 | static struct omap_dss_device igep2_dvi_device = { | 440 | static struct omap_dss_device igep2_dvi_device = { |
466 | .type = OMAP_DISPLAY_TYPE_DPI, | 441 | .type = OMAP_DISPLAY_TYPE_DPI, |
467 | .name = "dvi", | 442 | .name = "dvi", |
468 | .driver_name = "dvi", | 443 | .driver_name = "tfp410", |
469 | .data = &dvi_panel, | 444 | .data = &dvi_panel, |
470 | .phy.dpi.data_lines = 24, | 445 | .phy.dpi.data_lines = 24, |
471 | }; | 446 | }; |
@@ -480,14 +455,6 @@ static struct omap_dss_board_info igep2_dss_data = { | |||
480 | .default_device = &igep2_dvi_device, | 455 | .default_device = &igep2_dvi_device, |
481 | }; | 456 | }; |
482 | 457 | ||
483 | static void __init igep2_display_init(void) | ||
484 | { | ||
485 | int err = gpio_request_one(IGEP2_GPIO_DVI_PUP, GPIOF_OUT_INIT_HIGH, | ||
486 | "GPIO_DVI_PUP"); | ||
487 | if (err) | ||
488 | pr_err("IGEP v2: Could not obtain gpio GPIO_DVI_PUP\n"); | ||
489 | } | ||
490 | |||
491 | static struct platform_device *igep_devices[] __initdata = { | 458 | static struct platform_device *igep_devices[] __initdata = { |
492 | &igep_vwlan_device, | 459 | &igep_vwlan_device, |
493 | }; | 460 | }; |
@@ -540,7 +507,10 @@ static void __init igep_i2c_init(void) | |||
540 | { | 507 | { |
541 | int ret; | 508 | int ret; |
542 | 509 | ||
543 | omap3_pmic_get_config(&igep_twldata, TWL_COMMON_PDATA_USB, 0); | 510 | omap3_pmic_get_config(&igep_twldata, TWL_COMMON_PDATA_USB, |
511 | TWL_COMMON_REGULATOR_VPLL2); | ||
512 | igep_twldata.vpll2->constraints.apply_uV = true; | ||
513 | igep_twldata.vpll2->constraints.name = "VDVI"; | ||
544 | 514 | ||
545 | if (machine_is_igep0020()) { | 515 | if (machine_is_igep0020()) { |
546 | /* | 516 | /* |
@@ -554,10 +524,7 @@ static void __init igep_i2c_init(void) | |||
554 | 524 | ||
555 | igep_twldata.keypad = &igep2_keypad_pdata; | 525 | igep_twldata.keypad = &igep2_keypad_pdata; |
556 | /* Get common pmic data */ | 526 | /* Get common pmic data */ |
557 | omap3_pmic_get_config(&igep_twldata, TWL_COMMON_PDATA_AUDIO, | 527 | omap3_pmic_get_config(&igep_twldata, TWL_COMMON_PDATA_AUDIO, 0); |
558 | TWL_COMMON_REGULATOR_VPLL2); | ||
559 | igep_twldata.vpll2->constraints.apply_uV = true; | ||
560 | igep_twldata.vpll2->constraints.name = "VDVI"; | ||
561 | } | 528 | } |
562 | 529 | ||
563 | omap3_pmic_init("twl4030", &igep_twldata); | 530 | omap3_pmic_init("twl4030", &igep_twldata); |
@@ -641,7 +608,7 @@ static struct regulator_consumer_supply dummy_supplies[] = { | |||
641 | 608 | ||
642 | static void __init igep_init(void) | 609 | static void __init igep_init(void) |
643 | { | 610 | { |
644 | regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies)); | 611 | regulator_register_fixed(1, dummy_supplies, ARRAY_SIZE(dummy_supplies)); |
645 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); | 612 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); |
646 | 613 | ||
647 | /* Get IGEP2 hardware revision */ | 614 | /* Get IGEP2 hardware revision */ |
@@ -668,7 +635,6 @@ static void __init igep_init(void) | |||
668 | 635 | ||
669 | if (machine_is_igep0020()) { | 636 | if (machine_is_igep0020()) { |
670 | omap_display_init(&igep2_dss_data); | 637 | omap_display_init(&igep2_dss_data); |
671 | igep2_display_init(); | ||
672 | igep2_init_smsc911x(); | 638 | igep2_init_smsc911x(); |
673 | usbhs_init(&igep2_usbhs_bdata); | 639 | usbhs_init(&igep2_usbhs_bdata); |
674 | } else { | 640 | } else { |