aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/board-omap4panda.c
diff options
context:
space:
mode:
authorGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
committerGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
commitc71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch)
treeecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /arch/arm/mach-omap2/board-omap4panda.c
parentea53c912f8a86a8567697115b6a0d8152beee5c8 (diff)
parent6a00f206debf8a5c8899055726ad127dbeeed098 (diff)
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts: litmus/sched_cedf.c
Diffstat (limited to 'arch/arm/mach-omap2/board-omap4panda.c')
-rw-r--r--arch/arm/mach-omap2/board-omap4panda.c554
1 files changed, 485 insertions, 69 deletions
diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c
index c03d1d56db56..0cfe2005cb50 100644
--- a/arch/arm/mach-omap2/board-omap4panda.c
+++ b/arch/arm/mach-omap2/board-omap4panda.c
@@ -19,45 +19,165 @@
19#include <linux/kernel.h> 19#include <linux/kernel.h>
20#include <linux/init.h> 20#include <linux/init.h>
21#include <linux/platform_device.h> 21#include <linux/platform_device.h>
22#include <linux/clk.h>
22#include <linux/io.h> 23#include <linux/io.h>
24#include <linux/leds.h>
23#include <linux/gpio.h> 25#include <linux/gpio.h>
24#include <linux/usb/otg.h> 26#include <linux/usb/otg.h>
25#include <linux/i2c/twl.h> 27#include <linux/i2c/twl.h>
26#include <linux/regulator/machine.h> 28#include <linux/regulator/machine.h>
29#include <linux/regulator/fixed.h>
30#include <linux/wl12xx.h>
27 31
28#include <mach/hardware.h> 32#include <mach/hardware.h>
29#include <mach/omap4-common.h> 33#include <mach/omap4-common.h>
30#include <asm/mach-types.h> 34#include <asm/mach-types.h>
31#include <asm/mach/arch.h> 35#include <asm/mach/arch.h>
32#include <asm/mach/map.h> 36#include <asm/mach/map.h>
37#include <video/omapdss.h>
33 38
34#include <plat/board.h> 39#include <plat/board.h>
35#include <plat/common.h> 40#include <plat/common.h>
36#include <plat/control.h>
37#include <plat/timer-gp.h>
38#include <plat/usb.h> 41#include <plat/usb.h>
39#include <plat/mmc.h> 42#include <plat/mmc.h>
43#include <video/omap-panel-generic-dpi.h>
44#include "timer-gp.h"
45
40#include "hsmmc.h" 46#include "hsmmc.h"
47#include "control.h"
48#include "mux.h"
49#include "common-board-devices.h"
50
51#define GPIO_HUB_POWER 1
52#define GPIO_HUB_NRESET 62
53#define GPIO_WIFI_PMENA 43
54#define GPIO_WIFI_IRQ 53
55#define HDMI_GPIO_HPD 60 /* Hot plug pin for HDMI */
56#define HDMI_GPIO_LS_OE 41 /* Level shifter for HDMI */
57
58/* 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};
67
68static 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};
41 93
94static struct platform_device *panda_devices[] __initdata = {
95 &leds_gpio,
96 &wl1271_device,
97};
42 98
43static void __init omap4_panda_init_irq(void) 99static void __init omap4_panda_init_early(void)
44{ 100{
45 omap2_init_common_hw(NULL, NULL); 101 omap2_init_common_infrastructure();
46 gic_init_irq(); 102 omap2_init_common_devices(NULL, NULL);
47 omap_gpio_init(); 103}
104
105static 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,
109 .phy_reset = false,
110 .reset_gpio_port[0] = -EINVAL,
111 .reset_gpio_port[1] = -EINVAL,
112 .reset_gpio_port[2] = -EINVAL
113};
114
115static 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
120static void __init omap4_ehci_init(void)
121{
122 int ret;
123 struct clk *phy_ref_clk;
124
125 /* 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");
129 return;
130 }
131 clk_set_rate(phy_ref_clk, 19200000);
132 clk_enable(phy_ref_clk);
133
134 /* 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));
137 if (ret) {
138 pr_err("Unable to initialize EHCI power/reset\n");
139 return;
140 }
141
142 gpio_export(GPIO_HUB_POWER, 0);
143 gpio_export(GPIO_HUB_NRESET, 0);
144 gpio_set_value(GPIO_HUB_NRESET, 1);
145
146 usbhs_init(&usbhs_bdata);
147
148 /* enable power to hub */
149 gpio_set_value(GPIO_HUB_POWER, 1);
48} 150}
49 151
50static struct omap_musb_board_data musb_board_data = { 152static struct omap_musb_board_data musb_board_data = {
51 .interface_type = MUSB_INTERFACE_UTMI, 153 .interface_type = MUSB_INTERFACE_UTMI,
52 .mode = MUSB_PERIPHERAL, 154 .mode = MUSB_OTG,
53 .power = 100, 155 .power = 100,
54}; 156};
55 157
158static 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,
163 .phy_suspend = omap4430_phy_suspend,
164};
165
56static struct omap2_hsmmc_info mmc[] = { 166static struct omap2_hsmmc_info mmc[] = {
57 { 167 {
58 .mmc = 1, 168 .mmc = 1,
59 .wires = 8, 169 .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA,
60 .gpio_wp = -EINVAL, 170 .gpio_wp = -EINVAL,
171 .gpio_cd = -EINVAL,
172 },
173 {
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,
61 }, 181 },
62 {} /* Terminator */ 182 {} /* Terminator */
63}; 183};
@@ -65,14 +185,47 @@ static struct omap2_hsmmc_info mmc[] = {
65static struct regulator_consumer_supply omap4_panda_vmmc_supply[] = { 185static struct regulator_consumer_supply omap4_panda_vmmc_supply[] = {
66 { 186 {
67 .supply = "vmmc", 187 .supply = "vmmc",
68 .dev_name = "mmci-omap-hs.0", 188 .dev_name = "omap_hsmmc.0",
69 }, 189 },
70 { 190};
71 .supply = "vmmc", 191
72 .dev_name = "mmci-omap-hs.1", 192static struct regulator_consumer_supply omap4_panda_vmmc5_supply = {
193 .supply = "vmmc",
194 .dev_name = "omap_hsmmc.4",
195};
196
197static struct regulator_init_data panda_vmmc5 = {
198 .constraints = {
199 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
200 },
201 .num_consumer_supplies = 1,
202 .consumer_supplies = &omap4_panda_vmmc5_supply,
203};
204
205static struct fixed_voltage_config panda_vwlan = {
206 .supply_name = "vwl1271",
207 .microvolts = 1800000, /* 1.8V */
208 .gpio = GPIO_WIFI_PMENA,
209 .startup_delay = 70000, /* 70msec */
210 .enable_high = 1,
211 .enabled_at_boot = 0,
212 .init_data = &panda_vmmc5,
213};
214
215static struct platform_device omap_vwlan_device = {
216 .name = "reg-fixed-voltage",
217 .id = 1,
218 .dev = {
219 .platform_data = &panda_vwlan,
73 }, 220 },
74}; 221};
75 222
223struct wl12xx_platform_data omap_panda_wlan_data __initdata = {
224 .irq = OMAP_GPIO_IRQ(GPIO_WIFI_IRQ),
225 /* PANDA ref clock is 38.4 MHz */
226 .board_ref_clock = 2,
227};
228
76static int omap4_twl6030_hsmmc_late_init(struct device *dev) 229static int omap4_twl6030_hsmmc_late_init(struct device *dev)
77{ 230{
78 int ret = 0; 231 int ret = 0;
@@ -80,16 +233,32 @@ static int omap4_twl6030_hsmmc_late_init(struct device *dev)
80 struct platform_device, dev); 233 struct platform_device, dev);
81 struct omap_mmc_platform_data *pdata = dev->platform_data; 234 struct omap_mmc_platform_data *pdata = dev->platform_data;
82 235
236 if (!pdata) {
237 dev_err(dev, "%s: NULL platform data\n", __func__);
238 return -EINVAL;
239 }
83 /* Setting MMC1 Card detect Irq */ 240 /* Setting MMC1 Card detect Irq */
84 if (pdev->id == 0) 241 if (pdev->id == 0) {
85 pdata->slots[0].card_detect_irq = TWL6030_IRQ_BASE + 242 ret = twl6030_mmc_card_detect_config();
86 MMCDETECT_INTR_OFFSET; 243 if (ret)
244 dev_err(dev, "%s: Error card detect config(%d)\n",
245 __func__, ret);
246 else
247 pdata->slots[0].card_detect = twl6030_mmc_card_detect;
248 }
87 return ret; 249 return ret;
88} 250}
89 251
90static __init void omap4_twl6030_hsmmc_set_late_init(struct device *dev) 252static __init void omap4_twl6030_hsmmc_set_late_init(struct device *dev)
91{ 253{
92 struct omap_mmc_platform_data *pdata = dev->platform_data; 254 struct omap_mmc_platform_data *pdata;
255
256 /* dev can be null if CONFIG_MMC_OMAP_HS is not set */
257 if (!dev) {
258 pr_err("Failed omap4_twl6030_hsmmc_set_late_init\n");
259 return;
260 }
261 pdata = dev->platform_data;
93 262
94 pdata->init = omap4_twl6030_hsmmc_late_init; 263 pdata->init = omap4_twl6030_hsmmc_late_init;
95} 264}
@@ -105,19 +274,6 @@ static int __init omap4_twl6030_hsmmc_init(struct omap2_hsmmc_info *controllers)
105 return 0; 274 return 0;
106} 275}
107 276
108static struct regulator_init_data omap4_panda_vaux1 = {
109 .constraints = {
110 .min_uV = 1000000,
111 .max_uV = 3000000,
112 .apply_uV = true,
113 .valid_modes_mask = REGULATOR_MODE_NORMAL
114 | REGULATOR_MODE_STANDBY,
115 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
116 | REGULATOR_CHANGE_MODE
117 | REGULATOR_CHANGE_STATUS,
118 },
119};
120
121static struct regulator_init_data omap4_panda_vaux2 = { 277static struct regulator_init_data omap4_panda_vaux2 = {
122 .constraints = { 278 .constraints = {
123 .min_uV = 1200000, 279 .min_uV = 1200000,
@@ -156,7 +312,7 @@ static struct regulator_init_data omap4_panda_vmmc = {
156 | REGULATOR_CHANGE_MODE 312 | REGULATOR_CHANGE_MODE
157 | REGULATOR_CHANGE_STATUS, 313 | REGULATOR_CHANGE_STATUS,
158 }, 314 },
159 .num_consumer_supplies = 2, 315 .num_consumer_supplies = 1,
160 .consumer_supplies = omap4_panda_vmmc_supply, 316 .consumer_supplies = omap4_panda_vmmc_supply,
161}; 317};
162 318
@@ -173,24 +329,10 @@ static struct regulator_init_data omap4_panda_vpp = {
173 }, 329 },
174}; 330};
175 331
176static struct regulator_init_data omap4_panda_vusim = {
177 .constraints = {
178 .min_uV = 1200000,
179 .max_uV = 2900000,
180 .apply_uV = true,
181 .valid_modes_mask = REGULATOR_MODE_NORMAL
182 | REGULATOR_MODE_STANDBY,
183 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
184 | REGULATOR_CHANGE_MODE
185 | REGULATOR_CHANGE_STATUS,
186 },
187};
188
189static struct regulator_init_data omap4_panda_vana = { 332static struct regulator_init_data omap4_panda_vana = {
190 .constraints = { 333 .constraints = {
191 .min_uV = 2100000, 334 .min_uV = 2100000,
192 .max_uV = 2100000, 335 .max_uV = 2100000,
193 .apply_uV = true,
194 .valid_modes_mask = REGULATOR_MODE_NORMAL 336 .valid_modes_mask = REGULATOR_MODE_NORMAL
195 | REGULATOR_MODE_STANDBY, 337 | REGULATOR_MODE_STANDBY,
196 .valid_ops_mask = REGULATOR_CHANGE_MODE 338 .valid_ops_mask = REGULATOR_CHANGE_MODE
@@ -202,7 +344,6 @@ static struct regulator_init_data omap4_panda_vcxio = {
202 .constraints = { 344 .constraints = {
203 .min_uV = 1800000, 345 .min_uV = 1800000,
204 .max_uV = 1800000, 346 .max_uV = 1800000,
205 .apply_uV = true,
206 .valid_modes_mask = REGULATOR_MODE_NORMAL 347 .valid_modes_mask = REGULATOR_MODE_NORMAL
207 | REGULATOR_MODE_STANDBY, 348 | REGULATOR_MODE_STANDBY,
208 .valid_ops_mask = REGULATOR_CHANGE_MODE 349 .valid_ops_mask = REGULATOR_CHANGE_MODE
@@ -214,7 +355,6 @@ static struct regulator_init_data omap4_panda_vdac = {
214 .constraints = { 355 .constraints = {
215 .min_uV = 1800000, 356 .min_uV = 1800000,
216 .max_uV = 1800000, 357 .max_uV = 1800000,
217 .apply_uV = true,
218 .valid_modes_mask = REGULATOR_MODE_NORMAL 358 .valid_modes_mask = REGULATOR_MODE_NORMAL
219 | REGULATOR_MODE_STANDBY, 359 | REGULATOR_MODE_STANDBY,
220 .valid_ops_mask = REGULATOR_CHANGE_MODE 360 .valid_ops_mask = REGULATOR_CHANGE_MODE
@@ -234,6 +374,12 @@ static struct regulator_init_data omap4_panda_vusb = {
234 }, 374 },
235}; 375};
236 376
377static struct regulator_init_data omap4_panda_clk32kg = {
378 .constraints = {
379 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
380 },
381};
382
237static struct twl4030_platform_data omap4_panda_twldata = { 383static struct twl4030_platform_data omap4_panda_twldata = {
238 .irq_base = TWL6030_IRQ_BASE, 384 .irq_base = TWL6030_IRQ_BASE,
239 .irq_end = TWL6030_IRQ_END, 385 .irq_end = TWL6030_IRQ_END,
@@ -241,49 +387,319 @@ static struct twl4030_platform_data omap4_panda_twldata = {
241 /* Regulators */ 387 /* Regulators */
242 .vmmc = &omap4_panda_vmmc, 388 .vmmc = &omap4_panda_vmmc,
243 .vpp = &omap4_panda_vpp, 389 .vpp = &omap4_panda_vpp,
244 .vusim = &omap4_panda_vusim,
245 .vana = &omap4_panda_vana, 390 .vana = &omap4_panda_vana,
246 .vcxio = &omap4_panda_vcxio, 391 .vcxio = &omap4_panda_vcxio,
247 .vdac = &omap4_panda_vdac, 392 .vdac = &omap4_panda_vdac,
248 .vusb = &omap4_panda_vusb, 393 .vusb = &omap4_panda_vusb,
249 .vaux1 = &omap4_panda_vaux1,
250 .vaux2 = &omap4_panda_vaux2, 394 .vaux2 = &omap4_panda_vaux2,
251 .vaux3 = &omap4_panda_vaux3, 395 .vaux3 = &omap4_panda_vaux3,
396 .clk32kg = &omap4_panda_clk32kg,
397 .usb = &omap4_usbphy_data,
252}; 398};
253 399
254static struct i2c_board_info __initdata omap4_panda_i2c_boardinfo[] = { 400/*
401 * Display monitor features are burnt in their EEPROM as EDID data. The EEPROM
402 * is connected as I2C slave device, and can be accessed at address 0x50
403 */
404static struct i2c_board_info __initdata panda_i2c_eeprom[] = {
255 { 405 {
256 I2C_BOARD_INFO("twl6030", 0x48), 406 I2C_BOARD_INFO("eeprom", 0x50),
257 .flags = I2C_CLIENT_WAKE,
258 .irq = OMAP44XX_IRQ_SYS_1N,
259 .platform_data = &omap4_panda_twldata,
260 }, 407 },
261}; 408};
409
262static int __init omap4_panda_i2c_init(void) 410static int __init omap4_panda_i2c_init(void)
263{ 411{
412 omap4_pmic_init("twl6030", &omap4_panda_twldata);
413 omap_register_i2c_bus(2, 400, NULL, 0);
264 /* 414 /*
265 * Phoenix Audio IC needs I2C1 to 415 * Bus 3 is attached to the DVI port where devices like the pico DLP
266 * start with 400 KHz or less 416 * projector don't work reliably with 400kHz
267 */ 417 */
268 omap_register_i2c_bus(1, 400, omap4_panda_i2c_boardinfo, 418 omap_register_i2c_bus(3, 100, panda_i2c_eeprom,
269 ARRAY_SIZE(omap4_panda_i2c_boardinfo)); 419 ARRAY_SIZE(panda_i2c_eeprom));
270 omap_register_i2c_bus(2, 400, NULL, 0);
271 omap_register_i2c_bus(3, 400, NULL, 0);
272 omap_register_i2c_bus(4, 400, NULL, 0); 420 omap_register_i2c_bus(4, 400, NULL, 0);
273 return 0; 421 return 0;
274} 422}
275static void __init omap4_panda_init(void) 423
424#ifdef CONFIG_OMAP_MUX
425static struct omap_board_mux board_mux[] __initdata = {
426 /* WLAN IRQ - GPIO 53 */
427 OMAP4_MUX(GPMC_NCS3, OMAP_MUX_MODE3 | OMAP_PIN_INPUT),
428 /* WLAN POWER ENABLE - GPIO 43 */
429 OMAP4_MUX(GPMC_A19, OMAP_MUX_MODE3 | OMAP_PIN_OUTPUT),
430 /* WLAN SDIO: MMC5 CMD */
431 OMAP4_MUX(SDMMC5_CMD, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
432 /* WLAN SDIO: MMC5 CLK */
433 OMAP4_MUX(SDMMC5_CLK, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
434 /* WLAN SDIO: MMC5 DAT[0-3] */
435 OMAP4_MUX(SDMMC5_DAT0, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
436 OMAP4_MUX(SDMMC5_DAT1, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
437 OMAP4_MUX(SDMMC5_DAT2, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
438 OMAP4_MUX(SDMMC5_DAT3, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
439 /* gpio 0 - TFP410 PD */
440 OMAP4_MUX(KPD_COL1, OMAP_PIN_OUTPUT | OMAP_MUX_MODE3),
441 /* dispc2_data23 */
442 OMAP4_MUX(USBB2_ULPITLL_STP, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
443 /* dispc2_data22 */
444 OMAP4_MUX(USBB2_ULPITLL_DIR, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
445 /* dispc2_data21 */
446 OMAP4_MUX(USBB2_ULPITLL_NXT, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
447 /* dispc2_data20 */
448 OMAP4_MUX(USBB2_ULPITLL_DAT0, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
449 /* dispc2_data19 */
450 OMAP4_MUX(USBB2_ULPITLL_DAT1, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
451 /* dispc2_data18 */
452 OMAP4_MUX(USBB2_ULPITLL_DAT2, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
453 /* dispc2_data15 */
454 OMAP4_MUX(USBB2_ULPITLL_DAT3, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
455 /* dispc2_data14 */
456 OMAP4_MUX(USBB2_ULPITLL_DAT4, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
457 /* dispc2_data13 */
458 OMAP4_MUX(USBB2_ULPITLL_DAT5, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
459 /* dispc2_data12 */
460 OMAP4_MUX(USBB2_ULPITLL_DAT6, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
461 /* dispc2_data11 */
462 OMAP4_MUX(USBB2_ULPITLL_DAT7, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
463 /* dispc2_data10 */
464 OMAP4_MUX(DPM_EMU3, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
465 /* dispc2_data9 */
466 OMAP4_MUX(DPM_EMU4, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
467 /* dispc2_data16 */
468 OMAP4_MUX(DPM_EMU5, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
469 /* dispc2_data17 */
470 OMAP4_MUX(DPM_EMU6, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
471 /* dispc2_hsync */
472 OMAP4_MUX(DPM_EMU7, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
473 /* dispc2_pclk */
474 OMAP4_MUX(DPM_EMU8, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
475 /* dispc2_vsync */
476 OMAP4_MUX(DPM_EMU9, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
477 /* dispc2_de */
478 OMAP4_MUX(DPM_EMU10, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
479 /* dispc2_data8 */
480 OMAP4_MUX(DPM_EMU11, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
481 /* dispc2_data7 */
482 OMAP4_MUX(DPM_EMU12, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
483 /* dispc2_data6 */
484 OMAP4_MUX(DPM_EMU13, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
485 /* dispc2_data5 */
486 OMAP4_MUX(DPM_EMU14, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
487 /* dispc2_data4 */
488 OMAP4_MUX(DPM_EMU15, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
489 /* dispc2_data3 */
490 OMAP4_MUX(DPM_EMU16, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
491 /* dispc2_data2 */
492 OMAP4_MUX(DPM_EMU17, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
493 /* dispc2_data1 */
494 OMAP4_MUX(DPM_EMU18, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
495 /* dispc2_data0 */
496 OMAP4_MUX(DPM_EMU19, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
497 { .reg_offset = OMAP_MUX_TERMINATOR },
498};
499
500static struct omap_device_pad serial2_pads[] __initdata = {
501 OMAP_MUX_STATIC("uart2_cts.uart2_cts",
502 OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0),
503 OMAP_MUX_STATIC("uart2_rts.uart2_rts",
504 OMAP_PIN_OUTPUT | OMAP_MUX_MODE0),
505 OMAP_MUX_STATIC("uart2_rx.uart2_rx",
506 OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0),
507 OMAP_MUX_STATIC("uart2_tx.uart2_tx",
508 OMAP_PIN_OUTPUT | OMAP_MUX_MODE0),
509};
510
511static struct omap_device_pad serial3_pads[] __initdata = {
512 OMAP_MUX_STATIC("uart3_cts_rctx.uart3_cts_rctx",
513 OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0),
514 OMAP_MUX_STATIC("uart3_rts_sd.uart3_rts_sd",
515 OMAP_PIN_OUTPUT | OMAP_MUX_MODE0),
516 OMAP_MUX_STATIC("uart3_rx_irrx.uart3_rx_irrx",
517 OMAP_PIN_INPUT | OMAP_MUX_MODE0),
518 OMAP_MUX_STATIC("uart3_tx_irtx.uart3_tx_irtx",
519 OMAP_PIN_OUTPUT | OMAP_MUX_MODE0),
520};
521
522static struct omap_device_pad serial4_pads[] __initdata = {
523 OMAP_MUX_STATIC("uart4_rx.uart4_rx",
524 OMAP_PIN_INPUT | OMAP_MUX_MODE0),
525 OMAP_MUX_STATIC("uart4_tx.uart4_tx",
526 OMAP_PIN_OUTPUT | OMAP_MUX_MODE0),
527};
528
529static struct omap_board_data serial2_data __initdata = {
530 .id = 1,
531 .pads = serial2_pads,
532 .pads_cnt = ARRAY_SIZE(serial2_pads),
533};
534
535static struct omap_board_data serial3_data __initdata = {
536 .id = 2,
537 .pads = serial3_pads,
538 .pads_cnt = ARRAY_SIZE(serial3_pads),
539};
540
541static struct omap_board_data serial4_data __initdata = {
542 .id = 3,
543 .pads = serial4_pads,
544 .pads_cnt = ARRAY_SIZE(serial4_pads),
545};
546
547static inline void board_serial_init(void)
548{
549 struct omap_board_data bdata;
550 bdata.flags = 0;
551 bdata.pads = NULL;
552 bdata.pads_cnt = 0;
553 bdata.id = 0;
554 /* pass dummy data for UART1 */
555 omap_serial_init_port(&bdata);
556
557 omap_serial_init_port(&serial2_data);
558 omap_serial_init_port(&serial3_data);
559 omap_serial_init_port(&serial4_data);
560}
561#else
562#define board_mux NULL
563
564static inline void board_serial_init(void)
565{
566 omap_serial_init();
567}
568#endif
569
570/* Display DVI */
571#define PANDA_DVI_TFP410_POWER_DOWN_GPIO 0
572
573static int omap4_panda_enable_dvi(struct omap_dss_device *dssdev)
574{
575 gpio_set_value(dssdev->reset_gpio, 1);
576 return 0;
577}
578
579static void omap4_panda_disable_dvi(struct omap_dss_device *dssdev)
580{
581 gpio_set_value(dssdev->reset_gpio, 0);
582}
583
584/* Using generic display panel */
585static struct panel_generic_dpi_data omap4_dvi_panel = {
586 .name = "generic",
587 .platform_enable = omap4_panda_enable_dvi,
588 .platform_disable = omap4_panda_disable_dvi,
589};
590
591struct omap_dss_device omap4_panda_dvi_device = {
592 .type = OMAP_DISPLAY_TYPE_DPI,
593 .name = "dvi",
594 .driver_name = "generic_dpi_panel",
595 .data = &omap4_dvi_panel,
596 .phy.dpi.data_lines = 24,
597 .reset_gpio = PANDA_DVI_TFP410_POWER_DOWN_GPIO,
598 .channel = OMAP_DSS_CHANNEL_LCD2,
599};
600
601int __init omap4_panda_dvi_init(void)
602{
603 int r;
604
605 /* Requesting TFP410 DVI GPIO and disabling it, at bootup */
606 r = gpio_request_one(omap4_panda_dvi_device.reset_gpio,
607 GPIOF_OUT_INIT_LOW, "DVI PD");
608 if (r)
609 pr_err("Failed to get DVI powerdown GPIO\n");
610
611 return r;
612}
613
614
615static void omap4_panda_hdmi_mux_init(void)
616{
617 /* PAD0_HDMI_HPD_PAD1_HDMI_CEC */
618 omap_mux_init_signal("hdmi_hpd",
619 OMAP_PIN_INPUT_PULLUP);
620 omap_mux_init_signal("hdmi_cec",
621 OMAP_PIN_INPUT_PULLUP);
622 /* PAD0_HDMI_DDC_SCL_PAD1_HDMI_DDC_SDA */
623 omap_mux_init_signal("hdmi_ddc_scl",
624 OMAP_PIN_INPUT_PULLUP);
625 omap_mux_init_signal("hdmi_ddc_sda",
626 OMAP_PIN_INPUT_PULLUP);
627}
628
629static struct gpio panda_hdmi_gpios[] = {
630 { HDMI_GPIO_HPD, GPIOF_OUT_INIT_HIGH, "hdmi_gpio_hpd" },
631 { HDMI_GPIO_LS_OE, GPIOF_OUT_INIT_HIGH, "hdmi_gpio_ls_oe" },
632};
633
634static int omap4_panda_panel_enable_hdmi(struct omap_dss_device *dssdev)
276{ 635{
277 int status; 636 int status;
278 637
638 status = gpio_request_array(panda_hdmi_gpios,
639 ARRAY_SIZE(panda_hdmi_gpios));
640 if (status)
641 pr_err("Cannot request HDMI GPIOs\n");
642
643 return status;
644}
645
646static void omap4_panda_panel_disable_hdmi(struct omap_dss_device *dssdev)
647{
648 gpio_free(HDMI_GPIO_LS_OE);
649 gpio_free(HDMI_GPIO_HPD);
650}
651
652static struct omap_dss_device omap4_panda_hdmi_device = {
653 .name = "hdmi",
654 .driver_name = "hdmi_panel",
655 .type = OMAP_DISPLAY_TYPE_HDMI,
656 .platform_enable = omap4_panda_panel_enable_hdmi,
657 .platform_disable = omap4_panda_panel_disable_hdmi,
658 .channel = OMAP_DSS_CHANNEL_DIGIT,
659};
660
661static struct omap_dss_device *omap4_panda_dss_devices[] = {
662 &omap4_panda_dvi_device,
663 &omap4_panda_hdmi_device,
664};
665
666static struct omap_dss_board_info omap4_panda_dss_data = {
667 .num_devices = ARRAY_SIZE(omap4_panda_dss_devices),
668 .devices = omap4_panda_dss_devices,
669 .default_device = &omap4_panda_dvi_device,
670};
671
672void omap4_panda_display_init(void)
673{
674 int r;
675
676 r = omap4_panda_dvi_init();
677 if (r)
678 pr_err("error initializing panda DVI\n");
679
680 omap4_panda_hdmi_mux_init();
681 omap_display_init(&omap4_panda_dss_data);
682}
683
684static void __init omap4_panda_init(void)
685{
686 int package = OMAP_PACKAGE_CBS;
687
688 if (omap_rev() == OMAP4430_REV_ES1_0)
689 package = OMAP_PACKAGE_CBL;
690 omap4_mux_init(board_mux, NULL, package);
691
692 if (wl12xx_set_platform_data(&omap_panda_wlan_data))
693 pr_err("error setting wl12xx data\n");
694
279 omap4_panda_i2c_init(); 695 omap4_panda_i2c_init();
280 omap_serial_init(); 696 platform_add_devices(panda_devices, ARRAY_SIZE(panda_devices));
697 platform_device_register(&omap_vwlan_device);
698 board_serial_init();
281 omap4_twl6030_hsmmc_init(mmc); 699 omap4_twl6030_hsmmc_init(mmc);
282 /* OMAP4 Panda uses internal transceiver so register nop transceiver */ 700 omap4_ehci_init();
283 usb_nop_xceiv_register(); 701 usb_musb_init(&musb_board_data);
284 /* FIXME: allow multi-omap to boot until musb is updated for omap4 */ 702 omap4_panda_display_init();
285 if (!cpu_is_omap44xx())
286 usb_musb_init(&musb_board_data);
287} 703}
288 704
289static void __init omap4_panda_map_io(void) 705static void __init omap4_panda_map_io(void)
@@ -294,11 +710,11 @@ static void __init omap4_panda_map_io(void)
294 710
295MACHINE_START(OMAP4_PANDA, "OMAP4 Panda board") 711MACHINE_START(OMAP4_PANDA, "OMAP4 Panda board")
296 /* Maintainer: David Anders - Texas Instruments Inc */ 712 /* Maintainer: David Anders - Texas Instruments Inc */
297 .phys_io = 0x48000000,
298 .io_pg_offst = ((0xfa000000) >> 18) & 0xfffc,
299 .boot_params = 0x80000100, 713 .boot_params = 0x80000100,
714 .reserve = omap_reserve,
300 .map_io = omap4_panda_map_io, 715 .map_io = omap4_panda_map_io,
301 .init_irq = omap4_panda_init_irq, 716 .init_early = omap4_panda_init_early,
717 .init_irq = gic_init_irq,
302 .init_machine = omap4_panda_init, 718 .init_machine = omap4_panda_init,
303 .timer = &omap_timer, 719 .timer = &omap_timer,
304MACHINE_END 720MACHINE_END