11 #include <linux/kernel.h>
20 #include <linux/input.h>
47 #define IGEP2_SMSC911X_CS 5
48 #define IGEP2_SMSC911X_GPIO 176
49 #define IGEP2_GPIO_USBH_NRESET 24
50 #define IGEP2_GPIO_LED0_GREEN 26
51 #define IGEP2_GPIO_LED0_RED 27
52 #define IGEP2_GPIO_LED1_RED 28
53 #define IGEP2_GPIO_DVI_PUP 170
55 #define IGEP2_RB_GPIO_WIFI_NPD 94
56 #define IGEP2_RB_GPIO_WIFI_NRESET 95
57 #define IGEP2_RB_GPIO_BT_NRESET 137
58 #define IGEP2_RC_GPIO_WIFI_NPD 138
59 #define IGEP2_RC_GPIO_WIFI_NRESET 139
60 #define IGEP2_RC_GPIO_BT_NRESET 137
62 #define IGEP3_GPIO_LED0_GREEN 54
63 #define IGEP3_GPIO_LED0_RED 53
64 #define IGEP3_GPIO_LED1_RED 16
65 #define IGEP3_GPIO_USBH_NRESET 183
67 #define IGEP_SYSBOOT_MASK 0x1f
68 #define IGEP_SYSBOOT_NAND 0x0f
69 #define IGEP_SYSBOOT_ONENAND 0x10
83 #define IGEP2_BOARD_HWREV_B 0
84 #define IGEP2_BOARD_HWREV_C 1
85 #define IGEP3_BOARD_HWREV 2
89 static void __init igep2_get_revision(
void)
93 if (machine_is_igep0030()) {
101 pr_warning(
"IGEP2: Could not obtain gpio GPIO_HW0_REV\n");
102 pr_err(
"IGEP2: Unknown Hardware Revision\n");
108 pr_info(
"IGEP2: Hardware Revision C (B-NON compatible)\n");
110 }
else if (ret == 1) {
111 pr_info(
"IGEP2: Hardware Revision B/C (B compatible)\n");
114 pr_err(
"IGEP2: Unknown Hardware Revision\n");
121 #if defined(CONFIG_MTD_ONENAND_OMAP2) || \
122 defined(CONFIG_MTD_ONENAND_OMAP2_MODULE) || \
123 defined(CONFIG_MTD_NAND_OMAP2) || \
124 defined(CONFIG_MTD_NAND_OMAP2_MODULE)
126 #define ONENAND_MAP 0x20000000
140 .size = 2 * (64*(2*2048))
145 .size = 6 * (64*(2*2048)),
148 .name =
"Environment",
150 .size = 2 * (64*(2*2048)),
155 .size = 12 * (64*(2*2048)),
158 .name =
"File System",
164 static inline u32 igep_get_sysboot_value(
void)
169 static void __init igep_flash_init(
void)
172 mux = igep_get_sysboot_value();
175 pr_info(
"IGEP: initializing NAND memory device\n");
176 board_nand_init(igep_flash_partitions,
180 pr_info(
"IGEP: initializing OneNAND memory device\n");
181 board_onenand_init(igep_flash_partitions,
184 pr_err(
"IGEP: Flash: unsupported sysboot sequence found\n");
189 static void __init igep_flash_init(
void) {}
192 #if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
204 static inline void __init igep2_init_smsc911x(
void)
210 static inline void __init igep2_init_smsc911x(
void) { }
228 .num_consumer_supplies =
ARRAY_SIZE(igep_vmmc1_supply),
229 .consumer_supplies = igep_vmmc1_supply,
247 .num_consumer_supplies =
ARRAY_SIZE(igep_vio_supply),
248 .consumer_supplies = igep_vio_supply,
260 .num_consumer_supplies =
ARRAY_SIZE(igep_vmmc2_supply),
261 .consumer_supplies = igep_vmmc2_supply,
265 .supply_name =
"vwlan",
266 .microvolts = 3300000,
268 .enabled_at_boot = 1,
269 .init_data = &igep_vmmc2,
273 .name =
"reg-fixed-voltage",
276 .platform_data = &igep_vwlan,
288 #if defined(CONFIG_LIBERTAS_SDIO) || defined(CONFIG_LIBERTAS_SDIO_MODULE)
299 #if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE)
302 static struct gpio_led igep_gpio_leds[] = {
304 .
name =
"gpio-led:red:d0",
305 .default_trigger =
"default-off"
308 .name =
"gpio-led:green:d0",
309 .default_trigger =
"default-off",
312 .name =
"gpio-led:red:d1",
313 .default_trigger =
"default-off",
316 .name =
"gpio-led:green:d1",
317 .default_trigger =
"heartbeat",
324 .
leds = igep_gpio_leds,
332 .platform_data = &igep_led_pdata,
336 static void __init igep_leds_init(
void)
338 if (machine_is_igep0020()) {
358 static inline void igep_leds_init(
void)
362 if (machine_is_igep0020()) {
373 pr_warning(
"IGEP v2: Could not obtain leds gpios\n");
377 for (i = 0; i <
ARRAY_SIZE(igep_gpio_leds); i++)
378 gpio_export(igep_gpio_leds[i].
gpio, 0);
382 static struct gpio igep2_twl_gpios[] = {
387 static int igep_twl_gpio_setup(
struct device *
dev,
388 unsigned gpio,
unsigned ngpio)
394 omap_hsmmc_late_init(mmc);
397 #if !defined(CONFIG_LEDS_GPIO) && !defined(CONFIG_LEDS_GPIO_MODULE)
399 "gpio-led:green:d1");
403 pr_warning(
"IGEP: Could not obtain gpio GPIO_LED1_GREEN\n");
408 if (machine_is_igep0030())
415 igep2_twl_gpios[0].
gpio = gpio + 1;
422 pr_err(
"IGEP2: Could not obtain gpio for USBH_CPEN");
429 .setup = igep_twl_gpio_setup,
440 .driver_name =
"tfp410",
442 .phy.dpi.data_lines = 24,
451 .devices = igep2_dss_devices,
452 .default_device = &igep2_dvi_device,
459 static int igep2_keymap[] = {
479 .keymap = igep2_keymap,
484 .keymap_data = &igep2_keymap_data,
492 .gpio = &igep_twl4030_gpio_pdata,
493 .vmmc1 = &igep_vmmc1,
497 static struct i2c_board_info __initdata igep2_i2c3_boardinfo[] = {
503 static void __init igep_i2c_init(
void)
509 igep_twldata.
vpll2->constraints.apply_uV =
true;
510 igep_twldata.
vpll2->constraints.name =
"VDVI";
512 if (machine_is_igep0020()) {
520 pr_warning(
"IGEP2: Could not register I2C3 bus (%d)\n", ret);
522 igep_twldata.
keypad = &igep2_keypad_pdata;
527 omap3_pmic_init(
"twl4030", &igep_twldata);
537 .reset_gpio_port[1] = -
EINVAL,
538 .reset_gpio_port[2] = -
EINVAL,
547 .reset_gpio_port[0] = -
EINVAL,
549 .reset_gpio_port[2] = -
EINVAL,
552 #ifdef CONFIG_OMAP_MUX
560 #if defined(CONFIG_LIBERTAS_SDIO) || defined(CONFIG_LIBERTAS_SDIO_MODULE)
561 static struct gpio igep_wlan_bt_gpios[] __initdata = {
567 static void __init igep_wlan_bt_init(
void)
591 pr_warning(
"IGEP2: Could not obtain WIFI/BT gpios\n");
595 gpio_export(igep_wlan_bt_gpios[0].gpio, 0);
596 gpio_export(igep_wlan_bt_gpios[1].gpio, 0);
597 gpio_export(igep_wlan_bt_gpios[2].gpio, 0);
605 static inline void __init igep_wlan_bt_init(
void) { }
613 static void __init igep_init(
void)
619 igep2_get_revision();
621 omap_hsmmc_init(mmc);
628 m65kxxxxam_sdrc_params);
641 if (machine_is_igep0020()) {
643 igep2_init_smsc911x();
651 .atag_offset = 0x100,
656 .handle_irq = omap3_intc_handle_irq,
657 .init_machine = igep_init,
664 .atag_offset = 0x100,
669 .handle_irq = omap3_intc_handle_irq,
670 .init_machine = igep_init,