blob: 6d2372b98e465440cf3f5371f2f7026f14b27f15 [file] [log] [blame]
David Andersb075f582010-08-02 13:18:05 +03001/*
2 * Board support file for OMAP4430 based PandaBoard.
3 *
4 * Copyright (C) 2010 Texas Instruments
5 *
6 * Author: David Anders <x0132446@ti.com>
7 *
8 * Based on mach-omap2/board-4430sdp.c
9 *
10 * Author: Santosh Shilimkar <santosh.shilimkar@ti.com>
11 *
12 * Based on mach-omap2/board-3430sdp.c
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License version 2 as
16 * published by the Free Software Foundation.
17 */
18
19#include <linux/kernel.h>
20#include <linux/init.h>
21#include <linux/platform_device.h>
Anand Gadiyar1740d482011-01-10 14:42:15 +000022#include <linux/clk.h>
David Andersb075f582010-08-02 13:18:05 +030023#include <linux/io.h>
Ricardo Salveti de Araujo3da434a2010-09-23 18:22:49 -070024#include <linux/leds.h>
David Andersb075f582010-08-02 13:18:05 +030025#include <linux/gpio.h>
26#include <linux/usb/otg.h>
27#include <linux/i2c/twl.h>
28#include <linux/regulator/machine.h>
Panduranga Mallireddyedc84062011-02-15 03:40:34 -050029#include <linux/regulator/fixed.h>
Panduranga Mallireddyb17e09792011-02-15 03:40:35 -050030#include <linux/wl12xx.h>
David Andersb075f582010-08-02 13:18:05 +030031
32#include <mach/hardware.h>
33#include <mach/omap4-common.h>
34#include <asm/mach-types.h>
35#include <asm/mach/arch.h>
36#include <asm/mach/map.h>
Tomi Valkeinena0b38cc2011-05-11 14:05:07 +030037#include <video/omapdss.h>
David Andersb075f582010-08-02 13:18:05 +030038
39#include <plat/board.h>
40#include <plat/common.h>
David Andersb075f582010-08-02 13:18:05 +030041#include <plat/usb.h>
42#include <plat/mmc.h>
Tomi Valkeinenf8ae2f02011-05-10 19:48:10 +030043#include <video/omap-panel-generic-dpi.h>
Manjunath Kondaiah G04aeae72010-10-08 09:58:35 -070044#include "timer-gp.h"
David Andersb075f582010-08-02 13:18:05 +030045
Paul Walmsley4814ced2010-10-08 11:40:20 -060046#include "hsmmc.h"
47#include "control.h"
sricharanfc63de822010-11-08 19:26:11 +053048#include "mux.h"
Mike Rapoportfbd80712011-04-25 01:09:06 +030049#include "common-board-devices.h"
David Andersb075f582010-08-02 13:18:05 +030050
David Anders4415beb2010-10-07 19:36:30 +000051#define GPIO_HUB_POWER 1
52#define GPIO_HUB_NRESET 62
Panduranga Mallireddyedc84062011-02-15 03:40:34 -050053#define GPIO_WIFI_PMENA 43
Panduranga Mallireddyb17e09792011-02-15 03:40:35 -050054#define GPIO_WIFI_IRQ 53
K, Mythri P17c84ef2011-03-14 23:57:42 -050055#define HDMI_GPIO_HPD 60 /* Hot plug pin for HDMI */
56#define HDMI_GPIO_LS_OE 41 /* Level shifter for HDMI */
David Anders4415beb2010-10-07 19:36:30 +000057
Guy Eilamec179ea52011-02-25 06:52:35 +000058/* wl127x BT, FM, GPS connectivity chip */
59static int wl1271_gpios[] = {46, -1, -1};
60static struct platform_device wl1271_device = {
61 .name = "kim",
62 .id = -1,
63 .dev = {
64 .platform_data = &wl1271_gpios,
65 },
66};
David Andersb075f582010-08-02 13:18:05 +030067
Ricardo Salveti de Araujo3da434a2010-09-23 18:22:49 -070068static struct gpio_led gpio_leds[] = {
69 {
70 .name = "pandaboard::status1",
71 .default_trigger = "heartbeat",
72 .gpio = 7,
73 },
74 {
75 .name = "pandaboard::status2",
76 .default_trigger = "mmc0",
77 .gpio = 8,
78 },
79};
80
81static struct gpio_led_platform_data gpio_led_info = {
82 .leds = gpio_leds,
83 .num_leds = ARRAY_SIZE(gpio_leds),
84};
85
86static struct platform_device leds_gpio = {
87 .name = "leds-gpio",
88 .id = -1,
89 .dev = {
90 .platform_data = &gpio_led_info,
91 },
92};
93
94static struct platform_device *panda_devices[] __initdata = {
95 &leds_gpio,
Guy Eilamec179ea52011-02-25 06:52:35 +000096 &wl1271_device,
Ricardo Salveti de Araujo3da434a2010-09-23 18:22:49 -070097};
David Andersb075f582010-08-02 13:18:05 +030098
Russell King - ARM Linux3dc3bad2011-02-14 15:40:20 -080099static void __init omap4_panda_init_early(void)
David Andersb075f582010-08-02 13:18:05 +0300100{
Paul Walmsley48057342010-12-21 15:25:10 -0700101 omap2_init_common_infrastructure();
102 omap2_init_common_devices(NULL, NULL);
David Andersb075f582010-08-02 13:18:05 +0300103}
104
Keshava Munegowda181b2502011-03-01 20:08:16 +0530105static const struct usbhs_omap_board_data usbhs_bdata __initconst = {
106 .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
107 .port_mode[1] = OMAP_USBHS_PORT_MODE_UNUSED,
108 .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
David Anders4415beb2010-10-07 19:36:30 +0000109 .phy_reset = false,
110 .reset_gpio_port[0] = -EINVAL,
111 .reset_gpio_port[1] = -EINVAL,
112 .reset_gpio_port[2] = -EINVAL
113};
114
Igor Grinbergbc593f52011-05-03 18:22:09 +0300115static struct gpio panda_ehci_gpios[] __initdata = {
116 { GPIO_HUB_POWER, GPIOF_OUT_INIT_LOW, "hub_power" },
117 { GPIO_HUB_NRESET, GPIOF_OUT_INIT_LOW, "hub_nreset" },
118};
119
David Anders4415beb2010-10-07 19:36:30 +0000120static void __init omap4_ehci_init(void)
121{
122 int ret;
Anand Gadiyar1740d482011-01-10 14:42:15 +0000123 struct clk *phy_ref_clk;
David Anders4415beb2010-10-07 19:36:30 +0000124
Anand Gadiyar1740d482011-01-10 14:42:15 +0000125 /* FREF_CLK3 provides the 19.2 MHz reference clock to the PHY */
126 phy_ref_clk = clk_get(NULL, "auxclk3_ck");
127 if (IS_ERR(phy_ref_clk)) {
128 pr_err("Cannot request auxclk3\n");
Igor Grinbergbc593f52011-05-03 18:22:09 +0300129 return;
Anand Gadiyar1740d482011-01-10 14:42:15 +0000130 }
131 clk_set_rate(phy_ref_clk, 19200000);
132 clk_enable(phy_ref_clk);
David Anders4415beb2010-10-07 19:36:30 +0000133
Igor Grinbergbc593f52011-05-03 18:22:09 +0300134 /* disable the power to the usb hub prior to init and reset phy+hub */
135 ret = gpio_request_array(panda_ehci_gpios,
136 ARRAY_SIZE(panda_ehci_gpios));
David Anders4415beb2010-10-07 19:36:30 +0000137 if (ret) {
Igor Grinbergbc593f52011-05-03 18:22:09 +0300138 pr_err("Unable to initialize EHCI power/reset\n");
139 return;
David Anders4415beb2010-10-07 19:36:30 +0000140 }
David Anders4415beb2010-10-07 19:36:30 +0000141
Igor Grinbergbc593f52011-05-03 18:22:09 +0300142 gpio_export(GPIO_HUB_POWER, 0);
David Anders4415beb2010-10-07 19:36:30 +0000143 gpio_export(GPIO_HUB_NRESET, 0);
David Anders4415beb2010-10-07 19:36:30 +0000144 gpio_set_value(GPIO_HUB_NRESET, 1);
145
Keshava Munegowda9e64bb12011-03-01 20:08:19 +0530146 usbhs_init(&usbhs_bdata);
David Anders4415beb2010-10-07 19:36:30 +0000147
148 /* enable power to hub */
149 gpio_set_value(GPIO_HUB_POWER, 1);
David Anders4415beb2010-10-07 19:36:30 +0000150}
151
David Andersb075f582010-08-02 13:18:05 +0300152static struct omap_musb_board_data musb_board_data = {
153 .interface_type = MUSB_INTERFACE_UTMI,
Hema HK09e72002010-12-10 18:11:42 +0530154 .mode = MUSB_OTG,
David Andersb075f582010-08-02 13:18:05 +0300155 .power = 100,
156};
157
Hema HKe70357e2010-12-10 18:09:52 +0530158static struct twl4030_usb_data omap4_usbphy_data = {
159 .phy_init = omap4430_phy_init,
160 .phy_exit = omap4430_phy_exit,
161 .phy_power = omap4430_phy_power,
162 .phy_set_clock = omap4430_phy_set_clk,
Hema HKee896e32011-02-17 12:06:07 +0530163 .phy_suspend = omap4430_phy_suspend,
Hema HKe70357e2010-12-10 18:09:52 +0530164};
165
David Andersb075f582010-08-02 13:18:05 +0300166static struct omap2_hsmmc_info mmc[] = {
167 {
168 .mmc = 1,
Sukumar Ghorai3a638332010-09-15 14:49:23 +0000169 .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA,
David Andersb075f582010-08-02 13:18:05 +0300170 .gpio_wp = -EINVAL,
Raghuveer Murthy5b59cc22010-12-21 14:14:34 +0000171 .gpio_cd = -EINVAL,
David Andersb075f582010-08-02 13:18:05 +0300172 },
Panduranga Mallireddyb17e09792011-02-15 03:40:35 -0500173 {
174 .name = "wl1271",
175 .mmc = 5,
176 .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_POWER_OFF_CARD,
177 .gpio_wp = -EINVAL,
178 .gpio_cd = -EINVAL,
179 .ocr_mask = MMC_VDD_165_195,
180 .nonremovable = true,
181 },
David Andersb075f582010-08-02 13:18:05 +0300182 {} /* Terminator */
183};
184
185static struct regulator_consumer_supply omap4_panda_vmmc_supply[] = {
Oleg Drokin786b01a2011-06-06 18:57:07 +0000186 REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"),
David Andersb075f582010-08-02 13:18:05 +0300187};
188
Oleg Drokin786b01a2011-06-06 18:57:07 +0000189static struct regulator_consumer_supply omap4_panda_vmmc5_supply[] = {
190 REGULATOR_SUPPLY("vmmc", "omap_hsmmc.4"),
Panduranga Mallireddyedc84062011-02-15 03:40:34 -0500191};
192
193static struct regulator_init_data panda_vmmc5 = {
194 .constraints = {
195 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
196 },
Oleg Drokin786b01a2011-06-06 18:57:07 +0000197 .num_consumer_supplies = ARRAY_SIZE(omap4_panda_vmmc5_supply),
198 .consumer_supplies = omap4_panda_vmmc5_supply,
Panduranga Mallireddyedc84062011-02-15 03:40:34 -0500199};
200
201static struct fixed_voltage_config panda_vwlan = {
202 .supply_name = "vwl1271",
203 .microvolts = 1800000, /* 1.8V */
204 .gpio = GPIO_WIFI_PMENA,
205 .startup_delay = 70000, /* 70msec */
206 .enable_high = 1,
207 .enabled_at_boot = 0,
208 .init_data = &panda_vmmc5,
209};
210
211static struct platform_device omap_vwlan_device = {
212 .name = "reg-fixed-voltage",
213 .id = 1,
214 .dev = {
215 .platform_data = &panda_vwlan,
216 },
217};
218
Panduranga Mallireddyb17e09792011-02-15 03:40:35 -0500219struct wl12xx_platform_data omap_panda_wlan_data __initdata = {
220 .irq = OMAP_GPIO_IRQ(GPIO_WIFI_IRQ),
221 /* PANDA ref clock is 38.4 MHz */
222 .board_ref_clock = 2,
223};
224
David Andersb075f582010-08-02 13:18:05 +0300225static int omap4_twl6030_hsmmc_late_init(struct device *dev)
226{
227 int ret = 0;
228 struct platform_device *pdev = container_of(dev,
229 struct platform_device, dev);
230 struct omap_mmc_platform_data *pdata = dev->platform_data;
231
Menon, Nishanthbf56f0a2010-10-19 09:50:25 -0500232 if (!pdata) {
233 dev_err(dev, "%s: NULL platform data\n", __func__);
234 return -EINVAL;
235 }
David Andersb075f582010-08-02 13:18:05 +0300236 /* Setting MMC1 Card detect Irq */
Menon, Nishanthbf56f0a2010-10-19 09:50:25 -0500237 if (pdev->id == 0) {
238 ret = twl6030_mmc_card_detect_config();
239 if (ret)
240 dev_err(dev, "%s: Error card detect config(%d)\n",
241 __func__, ret);
242 else
243 pdata->slots[0].card_detect = twl6030_mmc_card_detect;
244 }
David Andersb075f582010-08-02 13:18:05 +0300245 return ret;
246}
247
248static __init void omap4_twl6030_hsmmc_set_late_init(struct device *dev)
249{
David Andersb9b52622010-10-07 19:36:29 +0000250 struct omap_mmc_platform_data *pdata;
251
252 /* dev can be null if CONFIG_MMC_OMAP_HS is not set */
253 if (!dev) {
254 pr_err("Failed omap4_twl6030_hsmmc_set_late_init\n");
255 return;
256 }
257 pdata = dev->platform_data;
David Andersb075f582010-08-02 13:18:05 +0300258
259 pdata->init = omap4_twl6030_hsmmc_late_init;
260}
261
262static int __init omap4_twl6030_hsmmc_init(struct omap2_hsmmc_info *controllers)
263{
264 struct omap2_hsmmc_info *c;
265
266 omap2_hsmmc_init(controllers);
267 for (c = controllers; c->mmc; c++)
268 omap4_twl6030_hsmmc_set_late_init(c->dev);
269
270 return 0;
271}
272
David Andersb075f582010-08-02 13:18:05 +0300273static struct regulator_init_data omap4_panda_vaux2 = {
274 .constraints = {
275 .min_uV = 1200000,
276 .max_uV = 2800000,
277 .apply_uV = true,
278 .valid_modes_mask = REGULATOR_MODE_NORMAL
279 | REGULATOR_MODE_STANDBY,
280 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
281 | REGULATOR_CHANGE_MODE
282 | REGULATOR_CHANGE_STATUS,
283 },
284};
285
286static struct regulator_init_data omap4_panda_vaux3 = {
287 .constraints = {
288 .min_uV = 1000000,
289 .max_uV = 3000000,
290 .apply_uV = true,
291 .valid_modes_mask = REGULATOR_MODE_NORMAL
292 | REGULATOR_MODE_STANDBY,
293 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
294 | REGULATOR_CHANGE_MODE
295 | REGULATOR_CHANGE_STATUS,
296 },
297};
298
299/* VMMC1 for MMC1 card */
300static struct regulator_init_data omap4_panda_vmmc = {
301 .constraints = {
302 .min_uV = 1200000,
303 .max_uV = 3000000,
304 .apply_uV = true,
305 .valid_modes_mask = REGULATOR_MODE_NORMAL
306 | REGULATOR_MODE_STANDBY,
307 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
308 | REGULATOR_CHANGE_MODE
309 | REGULATOR_CHANGE_STATUS,
310 },
Oleg Drokin786b01a2011-06-06 18:57:07 +0000311 .num_consumer_supplies = ARRAY_SIZE(omap4_panda_vmmc_supply),
David Andersb075f582010-08-02 13:18:05 +0300312 .consumer_supplies = omap4_panda_vmmc_supply,
313};
314
315static struct regulator_init_data omap4_panda_vpp = {
316 .constraints = {
317 .min_uV = 1800000,
318 .max_uV = 2500000,
319 .apply_uV = true,
320 .valid_modes_mask = REGULATOR_MODE_NORMAL
321 | REGULATOR_MODE_STANDBY,
322 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
323 | REGULATOR_CHANGE_MODE
324 | REGULATOR_CHANGE_STATUS,
325 },
326};
327
David Andersb075f582010-08-02 13:18:05 +0300328static struct regulator_init_data omap4_panda_vana = {
329 .constraints = {
330 .min_uV = 2100000,
331 .max_uV = 2100000,
David Andersb075f582010-08-02 13:18:05 +0300332 .valid_modes_mask = REGULATOR_MODE_NORMAL
333 | REGULATOR_MODE_STANDBY,
334 .valid_ops_mask = REGULATOR_CHANGE_MODE
335 | REGULATOR_CHANGE_STATUS,
336 },
337};
338
339static struct regulator_init_data omap4_panda_vcxio = {
340 .constraints = {
341 .min_uV = 1800000,
342 .max_uV = 1800000,
David Andersb075f582010-08-02 13:18:05 +0300343 .valid_modes_mask = REGULATOR_MODE_NORMAL
344 | REGULATOR_MODE_STANDBY,
345 .valid_ops_mask = REGULATOR_CHANGE_MODE
346 | REGULATOR_CHANGE_STATUS,
347 },
348};
349
350static struct regulator_init_data omap4_panda_vdac = {
351 .constraints = {
352 .min_uV = 1800000,
353 .max_uV = 1800000,
David Andersb075f582010-08-02 13:18:05 +0300354 .valid_modes_mask = REGULATOR_MODE_NORMAL
355 | REGULATOR_MODE_STANDBY,
356 .valid_ops_mask = REGULATOR_CHANGE_MODE
357 | REGULATOR_CHANGE_STATUS,
358 },
359};
360
361static struct regulator_init_data omap4_panda_vusb = {
362 .constraints = {
363 .min_uV = 3300000,
364 .max_uV = 3300000,
365 .apply_uV = true,
366 .valid_modes_mask = REGULATOR_MODE_NORMAL
367 | REGULATOR_MODE_STANDBY,
368 .valid_ops_mask = REGULATOR_CHANGE_MODE
369 | REGULATOR_CHANGE_STATUS,
370 },
371};
372
Balaji T K8af1b0d2011-02-10 18:45:26 +0530373static struct regulator_init_data omap4_panda_clk32kg = {
374 .constraints = {
375 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
376 },
377};
378
David Andersb075f582010-08-02 13:18:05 +0300379static struct twl4030_platform_data omap4_panda_twldata = {
380 .irq_base = TWL6030_IRQ_BASE,
381 .irq_end = TWL6030_IRQ_END,
382
383 /* Regulators */
384 .vmmc = &omap4_panda_vmmc,
385 .vpp = &omap4_panda_vpp,
David Andersb075f582010-08-02 13:18:05 +0300386 .vana = &omap4_panda_vana,
387 .vcxio = &omap4_panda_vcxio,
388 .vdac = &omap4_panda_vdac,
389 .vusb = &omap4_panda_vusb,
David Andersb075f582010-08-02 13:18:05 +0300390 .vaux2 = &omap4_panda_vaux2,
391 .vaux3 = &omap4_panda_vaux3,
Balaji T K8af1b0d2011-02-10 18:45:26 +0530392 .clk32kg = &omap4_panda_clk32kg,
Hema HKe70357e2010-12-10 18:09:52 +0530393 .usb = &omap4_usbphy_data,
David Andersb075f582010-08-02 13:18:05 +0300394};
395
Murthy, Raghuveerb295d6e2011-03-14 07:52:25 -0500396/*
397 * Display monitor features are burnt in their EEPROM as EDID data. The EEPROM
398 * is connected as I2C slave device, and can be accessed at address 0x50
399 */
400static struct i2c_board_info __initdata panda_i2c_eeprom[] = {
401 {
402 I2C_BOARD_INFO("eeprom", 0x50),
403 },
404};
405
David Andersb075f582010-08-02 13:18:05 +0300406static int __init omap4_panda_i2c_init(void)
407{
Mike Rapoportfbd80712011-04-25 01:09:06 +0300408 omap4_pmic_init("twl6030", &omap4_panda_twldata);
David Andersb075f582010-08-02 13:18:05 +0300409 omap_register_i2c_bus(2, 400, NULL, 0);
Murthy, Raghuveerb295d6e2011-03-14 07:52:25 -0500410 /*
411 * Bus 3 is attached to the DVI port where devices like the pico DLP
412 * projector don't work reliably with 400kHz
413 */
414 omap_register_i2c_bus(3, 100, panda_i2c_eeprom,
415 ARRAY_SIZE(panda_i2c_eeprom));
David Andersb075f582010-08-02 13:18:05 +0300416 omap_register_i2c_bus(4, 400, NULL, 0);
417 return 0;
418}
sricharanfc63de822010-11-08 19:26:11 +0530419
420#ifdef CONFIG_OMAP_MUX
421static struct omap_board_mux board_mux[] __initdata = {
Panduranga Mallireddy66e171a2011-02-15 03:40:32 -0500422 /* WLAN IRQ - GPIO 53 */
423 OMAP4_MUX(GPMC_NCS3, OMAP_MUX_MODE3 | OMAP_PIN_INPUT),
424 /* WLAN POWER ENABLE - GPIO 43 */
425 OMAP4_MUX(GPMC_A19, OMAP_MUX_MODE3 | OMAP_PIN_OUTPUT),
426 /* WLAN SDIO: MMC5 CMD */
427 OMAP4_MUX(SDMMC5_CMD, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
428 /* WLAN SDIO: MMC5 CLK */
429 OMAP4_MUX(SDMMC5_CLK, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
430 /* WLAN SDIO: MMC5 DAT[0-3] */
431 OMAP4_MUX(SDMMC5_DAT0, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
432 OMAP4_MUX(SDMMC5_DAT1, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
433 OMAP4_MUX(SDMMC5_DAT2, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
434 OMAP4_MUX(SDMMC5_DAT3, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
Murthy, Raghuveerb295d6e2011-03-14 07:52:25 -0500435 /* gpio 0 - TFP410 PD */
436 OMAP4_MUX(KPD_COL1, OMAP_PIN_OUTPUT | OMAP_MUX_MODE3),
437 /* dispc2_data23 */
438 OMAP4_MUX(USBB2_ULPITLL_STP, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
439 /* dispc2_data22 */
440 OMAP4_MUX(USBB2_ULPITLL_DIR, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
441 /* dispc2_data21 */
442 OMAP4_MUX(USBB2_ULPITLL_NXT, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
443 /* dispc2_data20 */
444 OMAP4_MUX(USBB2_ULPITLL_DAT0, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
445 /* dispc2_data19 */
446 OMAP4_MUX(USBB2_ULPITLL_DAT1, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
447 /* dispc2_data18 */
448 OMAP4_MUX(USBB2_ULPITLL_DAT2, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
449 /* dispc2_data15 */
450 OMAP4_MUX(USBB2_ULPITLL_DAT3, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
451 /* dispc2_data14 */
452 OMAP4_MUX(USBB2_ULPITLL_DAT4, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
453 /* dispc2_data13 */
454 OMAP4_MUX(USBB2_ULPITLL_DAT5, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
455 /* dispc2_data12 */
456 OMAP4_MUX(USBB2_ULPITLL_DAT6, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
457 /* dispc2_data11 */
458 OMAP4_MUX(USBB2_ULPITLL_DAT7, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
459 /* dispc2_data10 */
460 OMAP4_MUX(DPM_EMU3, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
461 /* dispc2_data9 */
462 OMAP4_MUX(DPM_EMU4, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
463 /* dispc2_data16 */
464 OMAP4_MUX(DPM_EMU5, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
465 /* dispc2_data17 */
466 OMAP4_MUX(DPM_EMU6, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
467 /* dispc2_hsync */
468 OMAP4_MUX(DPM_EMU7, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
469 /* dispc2_pclk */
470 OMAP4_MUX(DPM_EMU8, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
471 /* dispc2_vsync */
472 OMAP4_MUX(DPM_EMU9, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
473 /* dispc2_de */
474 OMAP4_MUX(DPM_EMU10, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
475 /* dispc2_data8 */
476 OMAP4_MUX(DPM_EMU11, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
477 /* dispc2_data7 */
478 OMAP4_MUX(DPM_EMU12, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
479 /* dispc2_data6 */
480 OMAP4_MUX(DPM_EMU13, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
481 /* dispc2_data5 */
482 OMAP4_MUX(DPM_EMU14, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
483 /* dispc2_data4 */
484 OMAP4_MUX(DPM_EMU15, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
485 /* dispc2_data3 */
486 OMAP4_MUX(DPM_EMU16, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
487 /* dispc2_data2 */
488 OMAP4_MUX(DPM_EMU17, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
489 /* dispc2_data1 */
490 OMAP4_MUX(DPM_EMU18, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
491 /* dispc2_data0 */
492 OMAP4_MUX(DPM_EMU19, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
sricharanfc63de822010-11-08 19:26:11 +0530493 { .reg_offset = OMAP_MUX_TERMINATOR },
494};
R Sricharan573efc22011-03-11 06:04:46 +0000495
496static struct omap_device_pad serial2_pads[] __initdata = {
497 OMAP_MUX_STATIC("uart2_cts.uart2_cts",
498 OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0),
499 OMAP_MUX_STATIC("uart2_rts.uart2_rts",
500 OMAP_PIN_OUTPUT | OMAP_MUX_MODE0),
501 OMAP_MUX_STATIC("uart2_rx.uart2_rx",
502 OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0),
503 OMAP_MUX_STATIC("uart2_tx.uart2_tx",
504 OMAP_PIN_OUTPUT | OMAP_MUX_MODE0),
505};
506
507static struct omap_device_pad serial3_pads[] __initdata = {
508 OMAP_MUX_STATIC("uart3_cts_rctx.uart3_cts_rctx",
509 OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0),
510 OMAP_MUX_STATIC("uart3_rts_sd.uart3_rts_sd",
511 OMAP_PIN_OUTPUT | OMAP_MUX_MODE0),
512 OMAP_MUX_STATIC("uart3_rx_irrx.uart3_rx_irrx",
513 OMAP_PIN_INPUT | OMAP_MUX_MODE0),
514 OMAP_MUX_STATIC("uart3_tx_irtx.uart3_tx_irtx",
515 OMAP_PIN_OUTPUT | OMAP_MUX_MODE0),
516};
517
518static struct omap_device_pad serial4_pads[] __initdata = {
519 OMAP_MUX_STATIC("uart4_rx.uart4_rx",
520 OMAP_PIN_INPUT | OMAP_MUX_MODE0),
521 OMAP_MUX_STATIC("uart4_tx.uart4_tx",
522 OMAP_PIN_OUTPUT | OMAP_MUX_MODE0),
523};
524
Santosh Shilimkar89c47052011-05-30 00:11:45 -0700525static struct omap_board_data serial2_data __initdata = {
R Sricharan573efc22011-03-11 06:04:46 +0000526 .id = 1,
527 .pads = serial2_pads,
528 .pads_cnt = ARRAY_SIZE(serial2_pads),
529};
530
Santosh Shilimkar89c47052011-05-30 00:11:45 -0700531static struct omap_board_data serial3_data __initdata = {
R Sricharan573efc22011-03-11 06:04:46 +0000532 .id = 2,
533 .pads = serial3_pads,
534 .pads_cnt = ARRAY_SIZE(serial3_pads),
535};
536
Santosh Shilimkar89c47052011-05-30 00:11:45 -0700537static struct omap_board_data serial4_data __initdata = {
R Sricharan573efc22011-03-11 06:04:46 +0000538 .id = 3,
539 .pads = serial4_pads,
540 .pads_cnt = ARRAY_SIZE(serial4_pads),
541};
542
543static inline void board_serial_init(void)
544{
545 struct omap_board_data bdata;
546 bdata.flags = 0;
547 bdata.pads = NULL;
548 bdata.pads_cnt = 0;
549 bdata.id = 0;
550 /* pass dummy data for UART1 */
551 omap_serial_init_port(&bdata);
552
553 omap_serial_init_port(&serial2_data);
554 omap_serial_init_port(&serial3_data);
555 omap_serial_init_port(&serial4_data);
556}
sricharanfc63de822010-11-08 19:26:11 +0530557#else
558#define board_mux NULL
R Sricharan573efc22011-03-11 06:04:46 +0000559
560static inline void board_serial_init(void)
561{
562 omap_serial_init();
563}
sricharanfc63de822010-11-08 19:26:11 +0530564#endif
565
Murthy, Raghuveerb295d6e2011-03-14 07:52:25 -0500566/* Display DVI */
567#define PANDA_DVI_TFP410_POWER_DOWN_GPIO 0
568
569static int omap4_panda_enable_dvi(struct omap_dss_device *dssdev)
570{
571 gpio_set_value(dssdev->reset_gpio, 1);
572 return 0;
573}
574
575static void omap4_panda_disable_dvi(struct omap_dss_device *dssdev)
576{
577 gpio_set_value(dssdev->reset_gpio, 0);
578}
579
580/* Using generic display panel */
581static struct panel_generic_dpi_data omap4_dvi_panel = {
582 .name = "generic",
583 .platform_enable = omap4_panda_enable_dvi,
584 .platform_disable = omap4_panda_disable_dvi,
585};
586
587struct omap_dss_device omap4_panda_dvi_device = {
588 .type = OMAP_DISPLAY_TYPE_DPI,
589 .name = "dvi",
590 .driver_name = "generic_dpi_panel",
591 .data = &omap4_dvi_panel,
592 .phy.dpi.data_lines = 24,
593 .reset_gpio = PANDA_DVI_TFP410_POWER_DOWN_GPIO,
594 .channel = OMAP_DSS_CHANNEL_LCD2,
595};
596
597int __init omap4_panda_dvi_init(void)
598{
599 int r;
600
601 /* Requesting TFP410 DVI GPIO and disabling it, at bootup */
602 r = gpio_request_one(omap4_panda_dvi_device.reset_gpio,
603 GPIOF_OUT_INIT_LOW, "DVI PD");
604 if (r)
605 pr_err("Failed to get DVI powerdown GPIO\n");
606
607 return r;
608}
609
610
K, Mythri P17c84ef2011-03-14 23:57:42 -0500611static void omap4_panda_hdmi_mux_init(void)
612{
613 /* PAD0_HDMI_HPD_PAD1_HDMI_CEC */
614 omap_mux_init_signal("hdmi_hpd",
615 OMAP_PIN_INPUT_PULLUP);
616 omap_mux_init_signal("hdmi_cec",
617 OMAP_PIN_INPUT_PULLUP);
618 /* PAD0_HDMI_DDC_SCL_PAD1_HDMI_DDC_SDA */
619 omap_mux_init_signal("hdmi_ddc_scl",
620 OMAP_PIN_INPUT_PULLUP);
621 omap_mux_init_signal("hdmi_ddc_sda",
622 OMAP_PIN_INPUT_PULLUP);
623}
624
Igor Grinbergbc593f52011-05-03 18:22:09 +0300625static struct gpio panda_hdmi_gpios[] = {
626 { HDMI_GPIO_HPD, GPIOF_OUT_INIT_HIGH, "hdmi_gpio_hpd" },
627 { HDMI_GPIO_LS_OE, GPIOF_OUT_INIT_HIGH, "hdmi_gpio_ls_oe" },
628};
629
K, Mythri P17c84ef2011-03-14 23:57:42 -0500630static int omap4_panda_panel_enable_hdmi(struct omap_dss_device *dssdev)
631{
632 int status;
633
Igor Grinbergbc593f52011-05-03 18:22:09 +0300634 status = gpio_request_array(panda_hdmi_gpios,
635 ARRAY_SIZE(panda_hdmi_gpios));
636 if (status)
637 pr_err("Cannot request HDMI GPIOs\n");
K, Mythri P17c84ef2011-03-14 23:57:42 -0500638
639 return status;
640}
641
642static void omap4_panda_panel_disable_hdmi(struct omap_dss_device *dssdev)
643{
644 gpio_free(HDMI_GPIO_LS_OE);
645 gpio_free(HDMI_GPIO_HPD);
646}
647
648static struct omap_dss_device omap4_panda_hdmi_device = {
649 .name = "hdmi",
650 .driver_name = "hdmi_panel",
651 .type = OMAP_DISPLAY_TYPE_HDMI,
652 .platform_enable = omap4_panda_panel_enable_hdmi,
653 .platform_disable = omap4_panda_panel_disable_hdmi,
654 .channel = OMAP_DSS_CHANNEL_DIGIT,
655};
656
657static struct omap_dss_device *omap4_panda_dss_devices[] = {
Murthy, Raghuveerb295d6e2011-03-14 07:52:25 -0500658 &omap4_panda_dvi_device,
K, Mythri P17c84ef2011-03-14 23:57:42 -0500659 &omap4_panda_hdmi_device,
660};
661
662static struct omap_dss_board_info omap4_panda_dss_data = {
663 .num_devices = ARRAY_SIZE(omap4_panda_dss_devices),
664 .devices = omap4_panda_dss_devices,
Murthy, Raghuveerb295d6e2011-03-14 07:52:25 -0500665 .default_device = &omap4_panda_dvi_device,
K, Mythri P17c84ef2011-03-14 23:57:42 -0500666};
667
668void omap4_panda_display_init(void)
669{
Murthy, Raghuveerb295d6e2011-03-14 07:52:25 -0500670 int r;
671
672 r = omap4_panda_dvi_init();
673 if (r)
674 pr_err("error initializing panda DVI\n");
675
K, Mythri P17c84ef2011-03-14 23:57:42 -0500676 omap4_panda_hdmi_mux_init();
677 omap_display_init(&omap4_panda_dss_data);
678}
679
David Andersb075f582010-08-02 13:18:05 +0300680static void __init omap4_panda_init(void)
681{
sricharanfc63de822010-11-08 19:26:11 +0530682 int package = OMAP_PACKAGE_CBS;
683
684 if (omap_rev() == OMAP4430_REV_ES1_0)
685 package = OMAP_PACKAGE_CBL;
Colin Cross21a42c92011-05-04 14:57:57 -0700686 omap4_mux_init(board_mux, NULL, package);
sricharanfc63de822010-11-08 19:26:11 +0530687
Panduranga Mallireddyb17e09792011-02-15 03:40:35 -0500688 if (wl12xx_set_platform_data(&omap_panda_wlan_data))
689 pr_err("error setting wl12xx data\n");
690
David Andersb075f582010-08-02 13:18:05 +0300691 omap4_panda_i2c_init();
Ricardo Salveti de Araujo3da434a2010-09-23 18:22:49 -0700692 platform_add_devices(panda_devices, ARRAY_SIZE(panda_devices));
Panduranga Mallireddyedc84062011-02-15 03:40:34 -0500693 platform_device_register(&omap_vwlan_device);
R Sricharan573efc22011-03-11 06:04:46 +0000694 board_serial_init();
David Andersb075f582010-08-02 13:18:05 +0300695 omap4_twl6030_hsmmc_init(mmc);
David Anders4415beb2010-10-07 19:36:30 +0000696 omap4_ehci_init();
Felipe Balbi1ea7f352010-12-01 13:48:54 +0200697 usb_musb_init(&musb_board_data);
K, Mythri P17c84ef2011-03-14 23:57:42 -0500698 omap4_panda_display_init();
David Andersb075f582010-08-02 13:18:05 +0300699}
700
701static void __init omap4_panda_map_io(void)
702{
703 omap2_set_globals_443x();
704 omap44xx_map_common_io();
705}
706
707MACHINE_START(OMAP4_PANDA, "OMAP4 Panda board")
708 /* Maintainer: David Anders - Texas Instruments Inc */
David Andersb075f582010-08-02 13:18:05 +0300709 .boot_params = 0x80000100,
Raghuveer Murthyd920e522010-12-17 18:15:07 -0800710 .reserve = omap_reserve,
David Andersb075f582010-08-02 13:18:05 +0300711 .map_io = omap4_panda_map_io,
Russell King - ARM Linux3dc3bad2011-02-14 15:40:20 -0800712 .init_early = omap4_panda_init_early,
713 .init_irq = gic_init_irq,
David Andersb075f582010-08-02 13:18:05 +0300714 .init_machine = omap4_panda_init,
715 .timer = &omap_timer,
716MACHINE_END