blob: 0f4d8a762a7093e6e244b33693af40cc6c25a38f [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>
37
38#include <plat/board.h>
39#include <plat/common.h>
David Andersb075f582010-08-02 13:18:05 +030040#include <plat/usb.h>
41#include <plat/mmc.h>
Manjunath Kondaiah G04aeae72010-10-08 09:58:35 -070042#include "timer-gp.h"
David Andersb075f582010-08-02 13:18:05 +030043
Paul Walmsley4814ced2010-10-08 11:40:20 -060044#include "hsmmc.h"
45#include "control.h"
sricharanfc63de822010-11-08 19:26:11 +053046#include "mux.h"
David Andersb075f582010-08-02 13:18:05 +030047
David Anders4415beb2010-10-07 19:36:30 +000048#define GPIO_HUB_POWER 1
49#define GPIO_HUB_NRESET 62
Panduranga Mallireddyedc84062011-02-15 03:40:34 -050050#define GPIO_WIFI_PMENA 43
Panduranga Mallireddyb17e09792011-02-15 03:40:35 -050051#define GPIO_WIFI_IRQ 53
David Anders4415beb2010-10-07 19:36:30 +000052
Guy Eilamec179ea52011-02-25 06:52:35 +000053/* wl127x BT, FM, GPS connectivity chip */
54static int wl1271_gpios[] = {46, -1, -1};
55static struct platform_device wl1271_device = {
56 .name = "kim",
57 .id = -1,
58 .dev = {
59 .platform_data = &wl1271_gpios,
60 },
61};
David Andersb075f582010-08-02 13:18:05 +030062
Ricardo Salveti de Araujo3da434a2010-09-23 18:22:49 -070063static struct gpio_led gpio_leds[] = {
64 {
65 .name = "pandaboard::status1",
66 .default_trigger = "heartbeat",
67 .gpio = 7,
68 },
69 {
70 .name = "pandaboard::status2",
71 .default_trigger = "mmc0",
72 .gpio = 8,
73 },
74};
75
76static struct gpio_led_platform_data gpio_led_info = {
77 .leds = gpio_leds,
78 .num_leds = ARRAY_SIZE(gpio_leds),
79};
80
81static struct platform_device leds_gpio = {
82 .name = "leds-gpio",
83 .id = -1,
84 .dev = {
85 .platform_data = &gpio_led_info,
86 },
87};
88
89static struct platform_device *panda_devices[] __initdata = {
90 &leds_gpio,
Guy Eilamec179ea52011-02-25 06:52:35 +000091 &wl1271_device,
Ricardo Salveti de Araujo3da434a2010-09-23 18:22:49 -070092};
David Andersb075f582010-08-02 13:18:05 +030093
Russell King - ARM Linux3dc3bad2011-02-14 15:40:20 -080094static void __init omap4_panda_init_early(void)
David Andersb075f582010-08-02 13:18:05 +030095{
Paul Walmsley48057342010-12-21 15:25:10 -070096 omap2_init_common_infrastructure();
97 omap2_init_common_devices(NULL, NULL);
David Andersb075f582010-08-02 13:18:05 +030098}
99
Keshava Munegowda181b2502011-03-01 20:08:16 +0530100static const struct usbhs_omap_board_data usbhs_bdata __initconst = {
101 .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
102 .port_mode[1] = OMAP_USBHS_PORT_MODE_UNUSED,
103 .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
David Anders4415beb2010-10-07 19:36:30 +0000104 .phy_reset = false,
105 .reset_gpio_port[0] = -EINVAL,
106 .reset_gpio_port[1] = -EINVAL,
107 .reset_gpio_port[2] = -EINVAL
108};
109
110static void __init omap4_ehci_init(void)
111{
112 int ret;
Anand Gadiyar1740d482011-01-10 14:42:15 +0000113 struct clk *phy_ref_clk;
David Anders4415beb2010-10-07 19:36:30 +0000114
Anand Gadiyar1740d482011-01-10 14:42:15 +0000115 /* FREF_CLK3 provides the 19.2 MHz reference clock to the PHY */
116 phy_ref_clk = clk_get(NULL, "auxclk3_ck");
117 if (IS_ERR(phy_ref_clk)) {
118 pr_err("Cannot request auxclk3\n");
119 goto error1;
120 }
121 clk_set_rate(phy_ref_clk, 19200000);
122 clk_enable(phy_ref_clk);
David Anders4415beb2010-10-07 19:36:30 +0000123
124 /* disable the power to the usb hub prior to init */
125 ret = gpio_request(GPIO_HUB_POWER, "hub_power");
126 if (ret) {
127 pr_err("Cannot request GPIO %d\n", GPIO_HUB_POWER);
128 goto error1;
129 }
130 gpio_export(GPIO_HUB_POWER, 0);
131 gpio_direction_output(GPIO_HUB_POWER, 0);
132 gpio_set_value(GPIO_HUB_POWER, 0);
133
134 /* reset phy+hub */
135 ret = gpio_request(GPIO_HUB_NRESET, "hub_nreset");
136 if (ret) {
137 pr_err("Cannot request GPIO %d\n", GPIO_HUB_NRESET);
138 goto error2;
139 }
140 gpio_export(GPIO_HUB_NRESET, 0);
141 gpio_direction_output(GPIO_HUB_NRESET, 0);
142 gpio_set_value(GPIO_HUB_NRESET, 0);
143 gpio_set_value(GPIO_HUB_NRESET, 1);
144
Keshava Munegowda9e64bb12011-03-01 20:08:19 +0530145 usbhs_init(&usbhs_bdata);
David Anders4415beb2010-10-07 19:36:30 +0000146
147 /* enable power to hub */
148 gpio_set_value(GPIO_HUB_POWER, 1);
149 return;
150
151error2:
152 gpio_free(GPIO_HUB_POWER);
153error1:
154 pr_err("Unable to initialize EHCI power/reset\n");
155 return;
156
157}
158
David Andersb075f582010-08-02 13:18:05 +0300159static struct omap_musb_board_data musb_board_data = {
160 .interface_type = MUSB_INTERFACE_UTMI,
Hema HK09e72002010-12-10 18:11:42 +0530161 .mode = MUSB_OTG,
David Andersb075f582010-08-02 13:18:05 +0300162 .power = 100,
163};
164
Hema HKe70357e2010-12-10 18:09:52 +0530165static struct twl4030_usb_data omap4_usbphy_data = {
166 .phy_init = omap4430_phy_init,
167 .phy_exit = omap4430_phy_exit,
168 .phy_power = omap4430_phy_power,
169 .phy_set_clock = omap4430_phy_set_clk,
Hema HKee896e32011-02-17 12:06:07 +0530170 .phy_suspend = omap4430_phy_suspend,
Hema HKe70357e2010-12-10 18:09:52 +0530171};
172
David Andersb075f582010-08-02 13:18:05 +0300173static struct omap2_hsmmc_info mmc[] = {
174 {
175 .mmc = 1,
Sukumar Ghorai3a638332010-09-15 14:49:23 +0000176 .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA,
David Andersb075f582010-08-02 13:18:05 +0300177 .gpio_wp = -EINVAL,
Raghuveer Murthy5b59cc22010-12-21 14:14:34 +0000178 .gpio_cd = -EINVAL,
David Andersb075f582010-08-02 13:18:05 +0300179 },
Panduranga Mallireddyb17e09792011-02-15 03:40:35 -0500180 {
181 .name = "wl1271",
182 .mmc = 5,
183 .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_POWER_OFF_CARD,
184 .gpio_wp = -EINVAL,
185 .gpio_cd = -EINVAL,
186 .ocr_mask = MMC_VDD_165_195,
187 .nonremovable = true,
188 },
David Andersb075f582010-08-02 13:18:05 +0300189 {} /* Terminator */
190};
191
192static struct regulator_consumer_supply omap4_panda_vmmc_supply[] = {
193 {
194 .supply = "vmmc",
Kishore Kadiyala0005ae72011-02-28 20:48:05 +0530195 .dev_name = "omap_hsmmc.0",
David Andersb075f582010-08-02 13:18:05 +0300196 },
David Andersb075f582010-08-02 13:18:05 +0300197};
198
Panduranga Mallireddyedc84062011-02-15 03:40:34 -0500199static struct regulator_consumer_supply omap4_panda_vmmc5_supply = {
200 .supply = "vmmc",
Kishore Kadiyala0005ae72011-02-28 20:48:05 +0530201 .dev_name = "omap_hsmmc.4",
Panduranga Mallireddyedc84062011-02-15 03:40:34 -0500202};
203
204static struct regulator_init_data panda_vmmc5 = {
205 .constraints = {
206 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
207 },
208 .num_consumer_supplies = 1,
209 .consumer_supplies = &omap4_panda_vmmc5_supply,
210};
211
212static struct fixed_voltage_config panda_vwlan = {
213 .supply_name = "vwl1271",
214 .microvolts = 1800000, /* 1.8V */
215 .gpio = GPIO_WIFI_PMENA,
216 .startup_delay = 70000, /* 70msec */
217 .enable_high = 1,
218 .enabled_at_boot = 0,
219 .init_data = &panda_vmmc5,
220};
221
222static struct platform_device omap_vwlan_device = {
223 .name = "reg-fixed-voltage",
224 .id = 1,
225 .dev = {
226 .platform_data = &panda_vwlan,
227 },
228};
229
Panduranga Mallireddyb17e09792011-02-15 03:40:35 -0500230struct wl12xx_platform_data omap_panda_wlan_data __initdata = {
231 .irq = OMAP_GPIO_IRQ(GPIO_WIFI_IRQ),
232 /* PANDA ref clock is 38.4 MHz */
233 .board_ref_clock = 2,
234};
235
David Andersb075f582010-08-02 13:18:05 +0300236static int omap4_twl6030_hsmmc_late_init(struct device *dev)
237{
238 int ret = 0;
239 struct platform_device *pdev = container_of(dev,
240 struct platform_device, dev);
241 struct omap_mmc_platform_data *pdata = dev->platform_data;
242
Menon, Nishanthbf56f0a2010-10-19 09:50:25 -0500243 if (!pdata) {
244 dev_err(dev, "%s: NULL platform data\n", __func__);
245 return -EINVAL;
246 }
David Andersb075f582010-08-02 13:18:05 +0300247 /* Setting MMC1 Card detect Irq */
Menon, Nishanthbf56f0a2010-10-19 09:50:25 -0500248 if (pdev->id == 0) {
249 ret = twl6030_mmc_card_detect_config();
250 if (ret)
251 dev_err(dev, "%s: Error card detect config(%d)\n",
252 __func__, ret);
253 else
254 pdata->slots[0].card_detect = twl6030_mmc_card_detect;
255 }
David Andersb075f582010-08-02 13:18:05 +0300256 return ret;
257}
258
259static __init void omap4_twl6030_hsmmc_set_late_init(struct device *dev)
260{
David Andersb9b52622010-10-07 19:36:29 +0000261 struct omap_mmc_platform_data *pdata;
262
263 /* dev can be null if CONFIG_MMC_OMAP_HS is not set */
264 if (!dev) {
265 pr_err("Failed omap4_twl6030_hsmmc_set_late_init\n");
266 return;
267 }
268 pdata = dev->platform_data;
David Andersb075f582010-08-02 13:18:05 +0300269
270 pdata->init = omap4_twl6030_hsmmc_late_init;
271}
272
273static int __init omap4_twl6030_hsmmc_init(struct omap2_hsmmc_info *controllers)
274{
275 struct omap2_hsmmc_info *c;
276
277 omap2_hsmmc_init(controllers);
278 for (c = controllers; c->mmc; c++)
279 omap4_twl6030_hsmmc_set_late_init(c->dev);
280
281 return 0;
282}
283
284static struct regulator_init_data omap4_panda_vaux1 = {
285 .constraints = {
286 .min_uV = 1000000,
287 .max_uV = 3000000,
288 .apply_uV = true,
289 .valid_modes_mask = REGULATOR_MODE_NORMAL
290 | REGULATOR_MODE_STANDBY,
291 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
292 | REGULATOR_CHANGE_MODE
293 | REGULATOR_CHANGE_STATUS,
294 },
295};
296
297static struct regulator_init_data omap4_panda_vaux2 = {
298 .constraints = {
299 .min_uV = 1200000,
300 .max_uV = 2800000,
301 .apply_uV = true,
302 .valid_modes_mask = REGULATOR_MODE_NORMAL
303 | REGULATOR_MODE_STANDBY,
304 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
305 | REGULATOR_CHANGE_MODE
306 | REGULATOR_CHANGE_STATUS,
307 },
308};
309
310static struct regulator_init_data omap4_panda_vaux3 = {
311 .constraints = {
312 .min_uV = 1000000,
313 .max_uV = 3000000,
314 .apply_uV = true,
315 .valid_modes_mask = REGULATOR_MODE_NORMAL
316 | REGULATOR_MODE_STANDBY,
317 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
318 | REGULATOR_CHANGE_MODE
319 | REGULATOR_CHANGE_STATUS,
320 },
321};
322
323/* VMMC1 for MMC1 card */
324static struct regulator_init_data omap4_panda_vmmc = {
325 .constraints = {
326 .min_uV = 1200000,
327 .max_uV = 3000000,
328 .apply_uV = true,
329 .valid_modes_mask = REGULATOR_MODE_NORMAL
330 | REGULATOR_MODE_STANDBY,
331 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
332 | REGULATOR_CHANGE_MODE
333 | REGULATOR_CHANGE_STATUS,
334 },
David Anders191183b2010-10-07 19:36:28 +0000335 .num_consumer_supplies = 1,
David Andersb075f582010-08-02 13:18:05 +0300336 .consumer_supplies = omap4_panda_vmmc_supply,
337};
338
339static struct regulator_init_data omap4_panda_vpp = {
340 .constraints = {
341 .min_uV = 1800000,
342 .max_uV = 2500000,
343 .apply_uV = true,
344 .valid_modes_mask = REGULATOR_MODE_NORMAL
345 | REGULATOR_MODE_STANDBY,
346 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
347 | REGULATOR_CHANGE_MODE
348 | REGULATOR_CHANGE_STATUS,
349 },
350};
351
352static struct regulator_init_data omap4_panda_vusim = {
353 .constraints = {
354 .min_uV = 1200000,
355 .max_uV = 2900000,
356 .apply_uV = true,
357 .valid_modes_mask = REGULATOR_MODE_NORMAL
358 | REGULATOR_MODE_STANDBY,
359 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
360 | REGULATOR_CHANGE_MODE
361 | REGULATOR_CHANGE_STATUS,
362 },
363};
364
365static struct regulator_init_data omap4_panda_vana = {
366 .constraints = {
367 .min_uV = 2100000,
368 .max_uV = 2100000,
David Andersb075f582010-08-02 13:18:05 +0300369 .valid_modes_mask = REGULATOR_MODE_NORMAL
370 | REGULATOR_MODE_STANDBY,
371 .valid_ops_mask = REGULATOR_CHANGE_MODE
372 | REGULATOR_CHANGE_STATUS,
373 },
374};
375
376static struct regulator_init_data omap4_panda_vcxio = {
377 .constraints = {
378 .min_uV = 1800000,
379 .max_uV = 1800000,
David Andersb075f582010-08-02 13:18:05 +0300380 .valid_modes_mask = REGULATOR_MODE_NORMAL
381 | REGULATOR_MODE_STANDBY,
382 .valid_ops_mask = REGULATOR_CHANGE_MODE
383 | REGULATOR_CHANGE_STATUS,
384 },
385};
386
387static struct regulator_init_data omap4_panda_vdac = {
388 .constraints = {
389 .min_uV = 1800000,
390 .max_uV = 1800000,
David Andersb075f582010-08-02 13:18:05 +0300391 .valid_modes_mask = REGULATOR_MODE_NORMAL
392 | REGULATOR_MODE_STANDBY,
393 .valid_ops_mask = REGULATOR_CHANGE_MODE
394 | REGULATOR_CHANGE_STATUS,
395 },
396};
397
398static struct regulator_init_data omap4_panda_vusb = {
399 .constraints = {
400 .min_uV = 3300000,
401 .max_uV = 3300000,
402 .apply_uV = true,
403 .valid_modes_mask = REGULATOR_MODE_NORMAL
404 | REGULATOR_MODE_STANDBY,
405 .valid_ops_mask = REGULATOR_CHANGE_MODE
406 | REGULATOR_CHANGE_STATUS,
407 },
408};
409
410static struct twl4030_platform_data omap4_panda_twldata = {
411 .irq_base = TWL6030_IRQ_BASE,
412 .irq_end = TWL6030_IRQ_END,
413
414 /* Regulators */
415 .vmmc = &omap4_panda_vmmc,
416 .vpp = &omap4_panda_vpp,
417 .vusim = &omap4_panda_vusim,
418 .vana = &omap4_panda_vana,
419 .vcxio = &omap4_panda_vcxio,
420 .vdac = &omap4_panda_vdac,
421 .vusb = &omap4_panda_vusb,
422 .vaux1 = &omap4_panda_vaux1,
423 .vaux2 = &omap4_panda_vaux2,
424 .vaux3 = &omap4_panda_vaux3,
Hema HKe70357e2010-12-10 18:09:52 +0530425 .usb = &omap4_usbphy_data,
David Andersb075f582010-08-02 13:18:05 +0300426};
427
428static struct i2c_board_info __initdata omap4_panda_i2c_boardinfo[] = {
429 {
430 I2C_BOARD_INFO("twl6030", 0x48),
431 .flags = I2C_CLIENT_WAKE,
432 .irq = OMAP44XX_IRQ_SYS_1N,
433 .platform_data = &omap4_panda_twldata,
434 },
435};
436static int __init omap4_panda_i2c_init(void)
437{
438 /*
439 * Phoenix Audio IC needs I2C1 to
440 * start with 400 KHz or less
441 */
442 omap_register_i2c_bus(1, 400, omap4_panda_i2c_boardinfo,
443 ARRAY_SIZE(omap4_panda_i2c_boardinfo));
444 omap_register_i2c_bus(2, 400, NULL, 0);
445 omap_register_i2c_bus(3, 400, NULL, 0);
446 omap_register_i2c_bus(4, 400, NULL, 0);
447 return 0;
448}
sricharanfc63de822010-11-08 19:26:11 +0530449
450#ifdef CONFIG_OMAP_MUX
451static struct omap_board_mux board_mux[] __initdata = {
Panduranga Mallireddy66e171a2011-02-15 03:40:32 -0500452 /* WLAN IRQ - GPIO 53 */
453 OMAP4_MUX(GPMC_NCS3, OMAP_MUX_MODE3 | OMAP_PIN_INPUT),
454 /* WLAN POWER ENABLE - GPIO 43 */
455 OMAP4_MUX(GPMC_A19, OMAP_MUX_MODE3 | OMAP_PIN_OUTPUT),
456 /* WLAN SDIO: MMC5 CMD */
457 OMAP4_MUX(SDMMC5_CMD, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
458 /* WLAN SDIO: MMC5 CLK */
459 OMAP4_MUX(SDMMC5_CLK, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
460 /* WLAN SDIO: MMC5 DAT[0-3] */
461 OMAP4_MUX(SDMMC5_DAT0, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
462 OMAP4_MUX(SDMMC5_DAT1, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
463 OMAP4_MUX(SDMMC5_DAT2, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
464 OMAP4_MUX(SDMMC5_DAT3, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
sricharanfc63de822010-11-08 19:26:11 +0530465 { .reg_offset = OMAP_MUX_TERMINATOR },
466};
R Sricharan573efc22011-03-11 06:04:46 +0000467
468static struct omap_device_pad serial2_pads[] __initdata = {
469 OMAP_MUX_STATIC("uart2_cts.uart2_cts",
470 OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0),
471 OMAP_MUX_STATIC("uart2_rts.uart2_rts",
472 OMAP_PIN_OUTPUT | OMAP_MUX_MODE0),
473 OMAP_MUX_STATIC("uart2_rx.uart2_rx",
474 OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0),
475 OMAP_MUX_STATIC("uart2_tx.uart2_tx",
476 OMAP_PIN_OUTPUT | OMAP_MUX_MODE0),
477};
478
479static struct omap_device_pad serial3_pads[] __initdata = {
480 OMAP_MUX_STATIC("uart3_cts_rctx.uart3_cts_rctx",
481 OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0),
482 OMAP_MUX_STATIC("uart3_rts_sd.uart3_rts_sd",
483 OMAP_PIN_OUTPUT | OMAP_MUX_MODE0),
484 OMAP_MUX_STATIC("uart3_rx_irrx.uart3_rx_irrx",
485 OMAP_PIN_INPUT | OMAP_MUX_MODE0),
486 OMAP_MUX_STATIC("uart3_tx_irtx.uart3_tx_irtx",
487 OMAP_PIN_OUTPUT | OMAP_MUX_MODE0),
488};
489
490static struct omap_device_pad serial4_pads[] __initdata = {
491 OMAP_MUX_STATIC("uart4_rx.uart4_rx",
492 OMAP_PIN_INPUT | OMAP_MUX_MODE0),
493 OMAP_MUX_STATIC("uart4_tx.uart4_tx",
494 OMAP_PIN_OUTPUT | OMAP_MUX_MODE0),
495};
496
497static struct omap_board_data serial2_data = {
498 .id = 1,
499 .pads = serial2_pads,
500 .pads_cnt = ARRAY_SIZE(serial2_pads),
501};
502
503static struct omap_board_data serial3_data = {
504 .id = 2,
505 .pads = serial3_pads,
506 .pads_cnt = ARRAY_SIZE(serial3_pads),
507};
508
509static struct omap_board_data serial4_data = {
510 .id = 3,
511 .pads = serial4_pads,
512 .pads_cnt = ARRAY_SIZE(serial4_pads),
513};
514
515static inline void board_serial_init(void)
516{
517 struct omap_board_data bdata;
518 bdata.flags = 0;
519 bdata.pads = NULL;
520 bdata.pads_cnt = 0;
521 bdata.id = 0;
522 /* pass dummy data for UART1 */
523 omap_serial_init_port(&bdata);
524
525 omap_serial_init_port(&serial2_data);
526 omap_serial_init_port(&serial3_data);
527 omap_serial_init_port(&serial4_data);
528}
sricharanfc63de822010-11-08 19:26:11 +0530529#else
530#define board_mux NULL
R Sricharan573efc22011-03-11 06:04:46 +0000531
532static inline void board_serial_init(void)
533{
534 omap_serial_init();
535}
sricharanfc63de822010-11-08 19:26:11 +0530536#endif
537
David Andersb075f582010-08-02 13:18:05 +0300538static void __init omap4_panda_init(void)
539{
sricharanfc63de822010-11-08 19:26:11 +0530540 int package = OMAP_PACKAGE_CBS;
541
542 if (omap_rev() == OMAP4430_REV_ES1_0)
543 package = OMAP_PACKAGE_CBL;
544 omap4_mux_init(board_mux, package);
545
Panduranga Mallireddyb17e09792011-02-15 03:40:35 -0500546 if (wl12xx_set_platform_data(&omap_panda_wlan_data))
547 pr_err("error setting wl12xx data\n");
548
David Andersb075f582010-08-02 13:18:05 +0300549 omap4_panda_i2c_init();
Ricardo Salveti de Araujo3da434a2010-09-23 18:22:49 -0700550 platform_add_devices(panda_devices, ARRAY_SIZE(panda_devices));
Panduranga Mallireddyedc84062011-02-15 03:40:34 -0500551 platform_device_register(&omap_vwlan_device);
R Sricharan573efc22011-03-11 06:04:46 +0000552 board_serial_init();
David Andersb075f582010-08-02 13:18:05 +0300553 omap4_twl6030_hsmmc_init(mmc);
David Anders4415beb2010-10-07 19:36:30 +0000554 omap4_ehci_init();
Felipe Balbi1ea7f352010-12-01 13:48:54 +0200555 usb_musb_init(&musb_board_data);
David Andersb075f582010-08-02 13:18:05 +0300556}
557
558static void __init omap4_panda_map_io(void)
559{
560 omap2_set_globals_443x();
561 omap44xx_map_common_io();
562}
563
564MACHINE_START(OMAP4_PANDA, "OMAP4 Panda board")
565 /* Maintainer: David Anders - Texas Instruments Inc */
David Andersb075f582010-08-02 13:18:05 +0300566 .boot_params = 0x80000100,
Raghuveer Murthyd920e522010-12-17 18:15:07 -0800567 .reserve = omap_reserve,
David Andersb075f582010-08-02 13:18:05 +0300568 .map_io = omap4_panda_map_io,
Russell King - ARM Linux3dc3bad2011-02-14 15:40:20 -0800569 .init_early = omap4_panda_init_early,
570 .init_irq = gic_init_irq,
David Andersb075f582010-08-02 13:18:05 +0300571 .init_machine = omap4_panda_init,
572 .timer = &omap_timer,
573MACHINE_END