blob: 1e2c75eee9123403f82c4a8f8294047e06345170 [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>
Peter Ujfalusi8eaeb932012-04-03 11:56:51 +030028#include <linux/mfd/twl6040.h>
David Andersb075f582010-08-02 13:18:05 +030029#include <linux/regulator/machine.h>
Panduranga Mallireddyedc84062011-02-15 03:40:34 -050030#include <linux/regulator/fixed.h>
Mircea Gherzan9624f612012-05-09 14:19:13 -070031#include <linux/ti_wilink_st.h>
Felipe Balbie8c4a7a2012-10-24 14:26:19 -070032#include <linux/usb/musb.h>
Kishon Vijay Abraham I51482be2013-02-06 18:58:50 +053033#include <linux/usb/phy.h>
Roger Quadros84337b62013-03-20 17:44:42 +020034#include <linux/usb/nop-usb-xceiv.h>
Panduranga Mallireddyb17e09792011-02-15 03:40:35 -050035#include <linux/wl12xx.h>
Rob Herring520f7bd2012-12-27 13:10:24 -060036#include <linux/irqchip/arm-gic.h>
Peter Ujfalusi3c90c982011-12-08 11:15:45 +020037#include <linux/platform_data/omap-abe-twl6040.h>
David Andersb075f582010-08-02 13:18:05 +030038
David Andersb075f582010-08-02 13:18:05 +030039#include <asm/mach-types.h>
40#include <asm/mach/arch.h>
41#include <asm/mach/map.h>
David Andersb075f582010-08-02 13:18:05 +030042
Tony Lindgren6d026432012-10-24 15:05:45 -070043#include "common.h"
Tony Lindgrendbc04162012-08-31 10:59:07 -070044#include "soc.h"
Tony Lindgren68f39e72012-10-15 12:09:43 -070045#include "mmc.h"
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"
Tomi Valkeinen0191bf32012-11-05 15:14:17 +020050#include "dss-common.h"
David Andersb075f582010-08-02 13:18:05 +030051
David Anders4415beb2010-10-07 19:36:30 +000052#define GPIO_HUB_POWER 1
53#define GPIO_HUB_NRESET 62
Panduranga Mallireddyedc84062011-02-15 03:40:34 -050054#define GPIO_WIFI_PMENA 43
Panduranga Mallireddyb17e09792011-02-15 03:40:35 -050055#define GPIO_WIFI_IRQ 53
David Anders4415beb2010-10-07 19:36:30 +000056
Guy Eilamec179ea52011-02-25 06:52:35 +000057/* wl127x BT, FM, GPS connectivity chip */
Mircea Gherzan9624f612012-05-09 14:19:13 -070058static struct ti_st_plat_data wilink_platform_data = {
59 .nshutdown_gpio = 46,
60 .dev_name = "/dev/ttyO1",
61 .flow_cntrl = 1,
62 .baud_rate = 3000000,
63 .chip_enable = NULL,
64 .suspend = NULL,
65 .resume = NULL,
66};
67
Guy Eilamec179ea52011-02-25 06:52:35 +000068static struct platform_device wl1271_device = {
69 .name = "kim",
70 .id = -1,
71 .dev = {
Mircea Gherzan9624f612012-05-09 14:19:13 -070072 .platform_data = &wilink_platform_data,
Guy Eilamec179ea52011-02-25 06:52:35 +000073 },
74};
David Andersb075f582010-08-02 13:18:05 +030075
Ricardo Salveti de Araujo3da434a2010-09-23 18:22:49 -070076static struct gpio_led gpio_leds[] = {
77 {
78 .name = "pandaboard::status1",
79 .default_trigger = "heartbeat",
80 .gpio = 7,
81 },
82 {
83 .name = "pandaboard::status2",
84 .default_trigger = "mmc0",
85 .gpio = 8,
86 },
87};
88
89static struct gpio_led_platform_data gpio_led_info = {
90 .leds = gpio_leds,
91 .num_leds = ARRAY_SIZE(gpio_leds),
92};
93
94static struct platform_device leds_gpio = {
95 .name = "leds-gpio",
96 .id = -1,
97 .dev = {
98 .platform_data = &gpio_led_info,
99 },
100};
101
Peter Ujfalusi3c90c982011-12-08 11:15:45 +0200102static struct omap_abe_twl6040_data panda_abe_audio_data = {
103 /* Audio out */
104 .has_hs = ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
Masanari Iida260db902012-07-12 00:56:57 +0900105 /* HandsFree through expansion connector */
Peter Ujfalusi3c90c982011-12-08 11:15:45 +0200106 .has_hf = ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
107 /* PandaBoard: FM TX, PandaBoardES: can be connected to audio out */
108 .has_aux = ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
109 /* PandaBoard: FM RX, PandaBoardES: audio in */
110 .has_afm = ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
111 /* No jack detection. */
112 .jack_detection = 0,
113 /* MCLK input is 38.4MHz */
114 .mclk_freq = 38400000,
115
116};
117
118static struct platform_device panda_abe_audio = {
119 .name = "omap-abe-twl6040",
120 .id = -1,
121 .dev = {
122 .platform_data = &panda_abe_audio_data,
123 },
124};
125
Ricardo Nerice7962f2012-05-09 14:19:14 -0700126static struct platform_device panda_hdmi_audio_codec = {
127 .name = "hdmi-audio-codec",
128 .id = -1,
129};
130
Mircea Gherzan65f19152012-03-05 11:08:37 -0800131static struct platform_device btwilink_device = {
132 .name = "btwilink",
133 .id = -1,
134};
135
Roger Quadros84337b62013-03-20 17:44:42 +0200136/* PHY device on HS USB Port 1 i.e. nop_usb_xceiv.1 */
137static struct nop_usb_xceiv_platform_data hsusb1_phy_data = {
138 /* FREF_CLK3 provides the 19.2 MHz reference clock to the PHY */
139 .clk_rate = 19200000,
140};
141
142static struct usbhs_phy_data phy_data[] __initdata = {
143 {
144 .port = 1,
145 .reset_gpio = GPIO_HUB_NRESET,
146 .vcc_gpio = GPIO_HUB_POWER,
147 .vcc_polarity = 1,
148 .platform_data = &hsusb1_phy_data,
149 },
150};
151
Ricardo Salveti de Araujo3da434a2010-09-23 18:22:49 -0700152static struct platform_device *panda_devices[] __initdata = {
153 &leds_gpio,
Guy Eilamec179ea52011-02-25 06:52:35 +0000154 &wl1271_device,
Peter Ujfalusi3c90c982011-12-08 11:15:45 +0200155 &panda_abe_audio,
Ricardo Nerice7962f2012-05-09 14:19:14 -0700156 &panda_hdmi_audio_codec,
Mircea Gherzan65f19152012-03-05 11:08:37 -0800157 &btwilink_device,
Ricardo Salveti de Araujo3da434a2010-09-23 18:22:49 -0700158};
David Andersb075f582010-08-02 13:18:05 +0300159
Roger Quadros42973152013-02-14 10:13:48 +0200160static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
Keshava Munegowda181b2502011-03-01 20:08:16 +0530161 .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
Igor Grinbergbc593f52011-05-03 18:22:09 +0300162};
163
David Anders4415beb2010-10-07 19:36:30 +0000164static void __init omap4_ehci_init(void)
165{
166 int ret;
167
Anand Gadiyar1740d482011-01-10 14:42:15 +0000168 /* FREF_CLK3 provides the 19.2 MHz reference clock to the PHY */
Roger Quadros84337b62013-03-20 17:44:42 +0200169 ret = clk_add_alias("main_clk", "nop_usb_xceiv.1", "auxclk3_ck", NULL);
170 if (ret)
171 pr_err("Failed to add main_clk alias to auxclk3_ck\n");
David Anders4415beb2010-10-07 19:36:30 +0000172
Roger Quadros84337b62013-03-20 17:44:42 +0200173 usbhs_init_phys(phy_data, ARRAY_SIZE(phy_data));
Keshava Munegowda9e64bb12011-03-01 20:08:19 +0530174 usbhs_init(&usbhs_bdata);
David Anders4415beb2010-10-07 19:36:30 +0000175}
176
David Andersb075f582010-08-02 13:18:05 +0300177static struct omap_musb_board_data musb_board_data = {
178 .interface_type = MUSB_INTERFACE_UTMI,
Hema HK09e72002010-12-10 18:11:42 +0530179 .mode = MUSB_OTG,
David Andersb075f582010-08-02 13:18:05 +0300180 .power = 100,
181};
182
183static struct omap2_hsmmc_info mmc[] = {
184 {
185 .mmc = 1,
Sukumar Ghorai3a638332010-09-15 14:49:23 +0000186 .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA,
David Andersb075f582010-08-02 13:18:05 +0300187 .gpio_wp = -EINVAL,
Raghuveer Murthy5b59cc22010-12-21 14:14:34 +0000188 .gpio_cd = -EINVAL,
David Andersb075f582010-08-02 13:18:05 +0300189 },
Panduranga Mallireddyb17e09792011-02-15 03:40:35 -0500190 {
191 .name = "wl1271",
192 .mmc = 5,
193 .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_POWER_OFF_CARD,
194 .gpio_wp = -EINVAL,
195 .gpio_cd = -EINVAL,
196 .ocr_mask = MMC_VDD_165_195,
197 .nonremovable = true,
198 },
David Andersb075f582010-08-02 13:18:05 +0300199 {} /* Terminator */
200};
201
Oleg Drokin786b01a2011-06-06 18:57:07 +0000202static struct regulator_consumer_supply omap4_panda_vmmc5_supply[] = {
203 REGULATOR_SUPPLY("vmmc", "omap_hsmmc.4"),
Panduranga Mallireddyedc84062011-02-15 03:40:34 -0500204};
205
206static struct regulator_init_data panda_vmmc5 = {
207 .constraints = {
208 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
209 },
Oleg Drokin786b01a2011-06-06 18:57:07 +0000210 .num_consumer_supplies = ARRAY_SIZE(omap4_panda_vmmc5_supply),
211 .consumer_supplies = omap4_panda_vmmc5_supply,
Panduranga Mallireddyedc84062011-02-15 03:40:34 -0500212};
213
214static struct fixed_voltage_config panda_vwlan = {
215 .supply_name = "vwl1271",
216 .microvolts = 1800000, /* 1.8V */
217 .gpio = GPIO_WIFI_PMENA,
218 .startup_delay = 70000, /* 70msec */
219 .enable_high = 1,
220 .enabled_at_boot = 0,
221 .init_data = &panda_vmmc5,
222};
223
224static struct platform_device omap_vwlan_device = {
225 .name = "reg-fixed-voltage",
226 .id = 1,
227 .dev = {
228 .platform_data = &panda_vwlan,
229 },
230};
231
Paul Walmsley8c3d4532012-04-13 06:34:26 -0600232static struct wl12xx_platform_data omap_panda_wlan_data __initdata = {
Vikram Narayanan224cd712012-09-26 22:12:22 +0530233 .board_ref_clock = WL12XX_REFCLOCK_38, /* 38.4 MHz */
Panduranga Mallireddyb17e09792011-02-15 03:40:35 -0500234};
235
Peter Ujfalusi8eaeb932012-04-03 11:56:51 +0300236static struct twl6040_codec_data twl6040_codec = {
Peter Ujfalusi3c90c982011-12-08 11:15:45 +0200237 /* single-step ramp for headset and handsfree */
238 .hs_left_step = 0x0f,
239 .hs_right_step = 0x0f,
240 .hf_left_step = 0x1d,
241 .hf_right_step = 0x1d,
242};
243
Peter Ujfalusi8eaeb932012-04-03 11:56:51 +0300244static struct twl6040_platform_data twl6040_data = {
Peter Ujfalusi3c90c982011-12-08 11:15:45 +0200245 .codec = &twl6040_codec,
246 .audpwron_gpio = 127,
Peter Ujfalusi3c90c982011-12-08 11:15:45 +0200247};
248
Peter Ujfalusi9495d1e2012-09-24 12:24:48 +0300249static struct i2c_board_info __initdata panda_i2c_1_boardinfo[] = {
250 {
251 I2C_BOARD_INFO("twl6040", 0x4b),
252 .irq = 119 + OMAP44XX_IRQ_GIC_START,
253 .platform_data = &twl6040_data,
254 },
255};
256
Peter Ujfalusib22f9542011-06-07 10:26:46 +0300257/* Panda board uses the common PMIC configuration */
Peter Ujfalusi8eaeb932012-04-03 11:56:51 +0300258static struct twl4030_platform_data omap4_panda_twldata;
David Andersb075f582010-08-02 13:18:05 +0300259
Murthy, Raghuveerb295d6e2011-03-14 07:52:25 -0500260/*
261 * Display monitor features are burnt in their EEPROM as EDID data. The EEPROM
262 * is connected as I2C slave device, and can be accessed at address 0x50
263 */
264static struct i2c_board_info __initdata panda_i2c_eeprom[] = {
265 {
266 I2C_BOARD_INFO("eeprom", 0x50),
267 },
268};
269
David Andersb075f582010-08-02 13:18:05 +0300270static int __init omap4_panda_i2c_init(void)
271{
Peter Ujfalusib22f9542011-06-07 10:26:46 +0300272 omap4_pmic_get_config(&omap4_panda_twldata, TWL_COMMON_PDATA_USB,
273 TWL_COMMON_REGULATOR_VDAC |
274 TWL_COMMON_REGULATOR_VAUX2 |
275 TWL_COMMON_REGULATOR_VAUX3 |
276 TWL_COMMON_REGULATOR_VMMC |
277 TWL_COMMON_REGULATOR_VPP |
278 TWL_COMMON_REGULATOR_VANA |
279 TWL_COMMON_REGULATOR_VCXIO |
280 TWL_COMMON_REGULATOR_VUSB |
Peter Ujfalusi85007462012-05-09 10:33:34 +0300281 TWL_COMMON_REGULATOR_CLK32KG |
282 TWL_COMMON_REGULATOR_V1V8 |
283 TWL_COMMON_REGULATOR_V2V1);
Peter Ujfalusi9495d1e2012-09-24 12:24:48 +0300284 omap4_pmic_init("twl6030", &omap4_panda_twldata, panda_i2c_1_boardinfo,
285 ARRAY_SIZE(panda_i2c_1_boardinfo));
David Andersb075f582010-08-02 13:18:05 +0300286 omap_register_i2c_bus(2, 400, NULL, 0);
Murthy, Raghuveerb295d6e2011-03-14 07:52:25 -0500287 /*
288 * Bus 3 is attached to the DVI port where devices like the pico DLP
289 * projector don't work reliably with 400kHz
290 */
291 omap_register_i2c_bus(3, 100, panda_i2c_eeprom,
292 ARRAY_SIZE(panda_i2c_eeprom));
David Andersb075f582010-08-02 13:18:05 +0300293 omap_register_i2c_bus(4, 400, NULL, 0);
294 return 0;
295}
sricharanfc63de822010-11-08 19:26:11 +0530296
297#ifdef CONFIG_OMAP_MUX
298static struct omap_board_mux board_mux[] __initdata = {
Panduranga Mallireddy66e171a2011-02-15 03:40:32 -0500299 /* WLAN IRQ - GPIO 53 */
300 OMAP4_MUX(GPMC_NCS3, OMAP_MUX_MODE3 | OMAP_PIN_INPUT),
301 /* WLAN POWER ENABLE - GPIO 43 */
302 OMAP4_MUX(GPMC_A19, OMAP_MUX_MODE3 | OMAP_PIN_OUTPUT),
303 /* WLAN SDIO: MMC5 CMD */
304 OMAP4_MUX(SDMMC5_CMD, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
305 /* WLAN SDIO: MMC5 CLK */
306 OMAP4_MUX(SDMMC5_CLK, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
307 /* WLAN SDIO: MMC5 DAT[0-3] */
308 OMAP4_MUX(SDMMC5_DAT0, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
309 OMAP4_MUX(SDMMC5_DAT1, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
310 OMAP4_MUX(SDMMC5_DAT2, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
311 OMAP4_MUX(SDMMC5_DAT3, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
Murthy, Raghuveerb295d6e2011-03-14 07:52:25 -0500312 /* gpio 0 - TFP410 PD */
313 OMAP4_MUX(KPD_COL1, OMAP_PIN_OUTPUT | OMAP_MUX_MODE3),
314 /* dispc2_data23 */
315 OMAP4_MUX(USBB2_ULPITLL_STP, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
316 /* dispc2_data22 */
317 OMAP4_MUX(USBB2_ULPITLL_DIR, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
318 /* dispc2_data21 */
319 OMAP4_MUX(USBB2_ULPITLL_NXT, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
320 /* dispc2_data20 */
321 OMAP4_MUX(USBB2_ULPITLL_DAT0, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
322 /* dispc2_data19 */
323 OMAP4_MUX(USBB2_ULPITLL_DAT1, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
324 /* dispc2_data18 */
325 OMAP4_MUX(USBB2_ULPITLL_DAT2, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
326 /* dispc2_data15 */
327 OMAP4_MUX(USBB2_ULPITLL_DAT3, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
328 /* dispc2_data14 */
329 OMAP4_MUX(USBB2_ULPITLL_DAT4, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
330 /* dispc2_data13 */
331 OMAP4_MUX(USBB2_ULPITLL_DAT5, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
332 /* dispc2_data12 */
333 OMAP4_MUX(USBB2_ULPITLL_DAT6, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
334 /* dispc2_data11 */
335 OMAP4_MUX(USBB2_ULPITLL_DAT7, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
336 /* dispc2_data10 */
337 OMAP4_MUX(DPM_EMU3, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
338 /* dispc2_data9 */
339 OMAP4_MUX(DPM_EMU4, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
340 /* dispc2_data16 */
341 OMAP4_MUX(DPM_EMU5, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
342 /* dispc2_data17 */
343 OMAP4_MUX(DPM_EMU6, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
344 /* dispc2_hsync */
345 OMAP4_MUX(DPM_EMU7, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
346 /* dispc2_pclk */
347 OMAP4_MUX(DPM_EMU8, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
348 /* dispc2_vsync */
349 OMAP4_MUX(DPM_EMU9, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
350 /* dispc2_de */
351 OMAP4_MUX(DPM_EMU10, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
352 /* dispc2_data8 */
353 OMAP4_MUX(DPM_EMU11, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
354 /* dispc2_data7 */
355 OMAP4_MUX(DPM_EMU12, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
356 /* dispc2_data6 */
357 OMAP4_MUX(DPM_EMU13, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
358 /* dispc2_data5 */
359 OMAP4_MUX(DPM_EMU14, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
360 /* dispc2_data4 */
361 OMAP4_MUX(DPM_EMU15, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
362 /* dispc2_data3 */
363 OMAP4_MUX(DPM_EMU16, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
364 /* dispc2_data2 */
365 OMAP4_MUX(DPM_EMU17, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
366 /* dispc2_data1 */
367 OMAP4_MUX(DPM_EMU18, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
368 /* dispc2_data0 */
369 OMAP4_MUX(DPM_EMU19, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
Peter Ujfalusi6d2b6c92012-07-06 15:19:12 +0200370 /* NIRQ2 for twl6040 */
371 OMAP4_MUX(SYS_NIRQ2, OMAP_MUX_MODE0 |
372 OMAP_PIN_INPUT_PULLUP | OMAP_PIN_OFF_WAKEUPENABLE),
Peter Ujfalusie13214d2012-10-04 14:57:21 +0300373 /* GPIO_127 for twl6040 */
374 OMAP4_MUX(HDQ_SIO, OMAP_MUX_MODE3 | OMAP_PIN_OUTPUT),
375 /* McPDM */
376 OMAP4_MUX(ABE_PDM_UL_DATA, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLDOWN),
377 OMAP4_MUX(ABE_PDM_DL_DATA, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLDOWN),
378 OMAP4_MUX(ABE_PDM_FRAME, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
379 OMAP4_MUX(ABE_PDM_LB_CLK, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLDOWN),
380 OMAP4_MUX(ABE_CLKS, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLDOWN),
381 /* McBSP1 */
382 OMAP4_MUX(ABE_MCBSP1_CLKX, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
383 OMAP4_MUX(ABE_MCBSP1_DR, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLDOWN),
384 OMAP4_MUX(ABE_MCBSP1_DX, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT |
385 OMAP_PULL_ENA),
386 OMAP4_MUX(ABE_MCBSP1_FSX, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
387
Luciano Coelho7662a9c2013-01-21 13:14:12 +0200388 /* UART2 - BT/FM/GPS shared transport */
389 OMAP4_MUX(UART2_CTS, OMAP_PIN_INPUT | OMAP_MUX_MODE0),
390 OMAP4_MUX(UART2_RTS, OMAP_PIN_OUTPUT | OMAP_MUX_MODE0),
391 OMAP4_MUX(UART2_RX, OMAP_PIN_INPUT | OMAP_MUX_MODE0),
392 OMAP4_MUX(UART2_TX, OMAP_PIN_OUTPUT | OMAP_MUX_MODE0),
393
sricharanfc63de822010-11-08 19:26:11 +0530394 { .reg_offset = OMAP_MUX_TERMINATOR },
395};
R Sricharan573efc22011-03-11 06:04:46 +0000396
sricharanfc63de822010-11-08 19:26:11 +0530397#else
398#define board_mux NULL
399#endif
400
K, Mythri P17c84ef2011-03-14 23:57:42 -0500401
Peter Ujfalusi3c90c982011-12-08 11:15:45 +0200402static void omap4_panda_init_rev(void)
403{
Peter Ujfalusi0324e022012-02-17 11:12:08 +0200404 if (cpu_is_omap443x()) {
Peter Ujfalusi3c90c982011-12-08 11:15:45 +0200405 /* PandaBoard 4430 */
406 /* ASoC audio configuration */
407 panda_abe_audio_data.card_name = "PandaBoard";
408 panda_abe_audio_data.has_hsmic = 1;
409 } else {
410 /* PandaBoard ES */
411 /* ASoC audio configuration */
412 panda_abe_audio_data.card_name = "PandaBoardES";
413 }
414}
415
David Andersb075f582010-08-02 13:18:05 +0300416static void __init omap4_panda_init(void)
417{
sricharanfc63de822010-11-08 19:26:11 +0530418 int package = OMAP_PACKAGE_CBS;
Russell King70d669d2012-02-07 11:03:23 +0000419 int ret;
sricharanfc63de822010-11-08 19:26:11 +0530420
421 if (omap_rev() == OMAP4430_REV_ES1_0)
422 package = OMAP_PACKAGE_CBL;
Colin Cross21a42c92011-05-04 14:57:57 -0700423 omap4_mux_init(board_mux, NULL, package);
sricharanfc63de822010-11-08 19:26:11 +0530424
Tarun Kanti DebBarma46a0a542012-03-29 08:41:01 -0700425 omap_panda_wlan_data.irq = gpio_to_irq(GPIO_WIFI_IRQ);
Russell King70d669d2012-02-07 11:03:23 +0000426 ret = wl12xx_set_platform_data(&omap_panda_wlan_data);
427 if (ret)
428 pr_err("error setting wl12xx data: %d\n", ret);
Panduranga Mallireddyb17e09792011-02-15 03:40:35 -0500429
Peter Ujfalusi3c90c982011-12-08 11:15:45 +0200430 omap4_panda_init_rev();
David Andersb075f582010-08-02 13:18:05 +0300431 omap4_panda_i2c_init();
Ricardo Salveti de Araujo3da434a2010-09-23 18:22:49 -0700432 platform_add_devices(panda_devices, ARRAY_SIZE(panda_devices));
Panduranga Mallireddyedc84062011-02-15 03:40:34 -0500433 platform_device_register(&omap_vwlan_device);
Govindraj.R7496ba32011-11-07 18:55:05 +0530434 omap_serial_init();
Tony Lindgrena4ca9db2011-08-22 23:57:23 -0700435 omap_sdrc_init(NULL, NULL);
David Andersb075f582010-08-02 13:18:05 +0300436 omap4_twl6030_hsmmc_init(mmc);
David Anders4415beb2010-10-07 19:36:30 +0000437 omap4_ehci_init();
Kishon Vijay Abraham I08a48be2013-05-06 16:39:16 -0700438 usb_bind_phy("musb-hdrc.2.auto", 0, "omap-usb2.3.auto");
Felipe Balbi1ea7f352010-12-01 13:48:54 +0200439 usb_musb_init(&musb_board_data);
K, Mythri P17c84ef2011-03-14 23:57:42 -0500440 omap4_panda_display_init();
David Andersb075f582010-08-02 13:18:05 +0300441}
442
David Andersb075f582010-08-02 13:18:05 +0300443MACHINE_START(OMAP4_PANDA, "OMAP4 Panda board")
444 /* Maintainer: David Anders - Texas Instruments Inc */
Nicolas Pitre5e52b432011-07-05 22:38:15 -0400445 .atag_offset = 0x100,
Marc Zyngier06915322011-09-08 13:15:22 +0100446 .smp = smp_ops(omap4_smp_ops),
Raghuveer Murthyd920e522010-12-17 18:15:07 -0800447 .reserve = omap_reserve,
Tony Lindgrene990a402011-09-26 14:52:55 -0700448 .map_io = omap4_map_io,
Tony Lindgren8f5b5a42011-08-22 23:57:24 -0700449 .init_early = omap4430_init_early,
Russell King - ARM Linux3dc3bad2011-02-14 15:40:20 -0800450 .init_irq = gic_init_irq,
David Andersb075f582010-08-02 13:18:05 +0300451 .init_machine = omap4_panda_init,
Shawn Guobbd707a2012-04-26 16:06:50 +0800452 .init_late = omap4430_init_late,
Stephen Warren6bb27d72012-11-08 12:40:59 -0700453 .init_time = omap4_local_timer_init,
Paul Walmsley187e3e02012-10-29 20:56:12 -0600454 .restart = omap44xx_restart,
David Andersb075f582010-08-02 13:18:05 +0300455MACHINE_END