2 * Board support file for OMAP4430 based PandaBoard.
4 * Copyright (C) 2010 Texas Instruments
6 * Author: David Anders <x0132446@ti.com>
8 * Based on mach-omap2/board-4430sdp.c
10 * Author: Santosh Shilimkar <santosh.shilimkar@ti.com>
12 * Based on mach-omap2/board-3430sdp.c
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.
19 #include <linux/kernel.h>
20 #include <linux/init.h>
21 #include <linux/platform_device.h>
22 #include <linux/clk.h>
24 #include <linux/leds.h>
25 #include <linux/gpio.h>
26 #include <linux/usb/otg.h>
27 #include <linux/i2c/twl.h>
28 #include <linux/mfd/twl6040.h>
29 #include <linux/regulator/machine.h>
30 #include <linux/regulator/fixed.h>
31 #include <linux/ti_wilink_st.h>
32 #include <linux/usb/musb.h>
33 #include <linux/usb/phy.h>
34 #include <linux/usb/nop-usb-xceiv.h>
35 #include <linux/wl12xx.h>
36 #include <linux/irqchip/arm-gic.h>
37 #include <linux/platform_data/omap-abe-twl6040.h>
39 #include <asm/mach-types.h>
40 #include <asm/mach/arch.h>
41 #include <asm/mach/map.h>
49 #include "common-board-devices.h"
50 #include "dss-common.h"
52 #define GPIO_HUB_POWER 1
53 #define GPIO_HUB_NRESET 62
54 #define GPIO_WIFI_PMENA 43
55 #define GPIO_WIFI_IRQ 53
57 /* wl127x BT, FM, GPS connectivity chip */
58 static struct ti_st_plat_data wilink_platform_data
= {
60 .dev_name
= "/dev/ttyO1",
68 static struct platform_device wl1271_device
= {
72 .platform_data
= &wilink_platform_data
,
76 static struct gpio_led gpio_leds
[] = {
78 .name
= "pandaboard::status1",
79 .default_trigger
= "heartbeat",
83 .name
= "pandaboard::status2",
84 .default_trigger
= "mmc0",
89 static struct gpio_led_platform_data gpio_led_info
= {
91 .num_leds
= ARRAY_SIZE(gpio_leds
),
94 static struct platform_device leds_gpio
= {
98 .platform_data
= &gpio_led_info
,
102 static struct omap_abe_twl6040_data panda_abe_audio_data
= {
104 .has_hs
= ABE_TWL6040_LEFT
| ABE_TWL6040_RIGHT
,
105 /* HandsFree through expansion connector */
106 .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. */
113 /* MCLK input is 38.4MHz */
114 .mclk_freq
= 38400000,
118 static struct platform_device panda_abe_audio
= {
119 .name
= "omap-abe-twl6040",
122 .platform_data
= &panda_abe_audio_data
,
126 static struct platform_device panda_hdmi_audio_codec
= {
127 .name
= "hdmi-audio-codec",
131 static struct platform_device btwilink_device
= {
136 /* PHY device on HS USB Port 1 i.e. nop_usb_xceiv.1 */
137 static 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,
142 static struct usbhs_phy_data phy_data
[] __initdata
= {
145 .reset_gpio
= GPIO_HUB_NRESET
,
146 .vcc_gpio
= GPIO_HUB_POWER
,
148 .platform_data
= &hsusb1_phy_data
,
152 static struct platform_device
*panda_devices
[] __initdata
= {
156 &panda_hdmi_audio_codec
,
160 static struct usbhs_omap_platform_data usbhs_bdata __initdata
= {
161 .port_mode
[0] = OMAP_EHCI_PORT_MODE_PHY
,
164 static void __init
omap4_ehci_init(void)
168 /* FREF_CLK3 provides the 19.2 MHz reference clock to the PHY */
169 ret
= clk_add_alias("main_clk", "nop_usb_xceiv.1", "auxclk3_ck", NULL
);
171 pr_err("Failed to add main_clk alias to auxclk3_ck\n");
173 usbhs_init_phys(phy_data
, ARRAY_SIZE(phy_data
));
174 usbhs_init(&usbhs_bdata
);
177 static struct omap_musb_board_data musb_board_data
= {
178 .interface_type
= MUSB_INTERFACE_UTMI
,
183 static struct omap2_hsmmc_info mmc
[] = {
186 .caps
= MMC_CAP_4_BIT_DATA
| MMC_CAP_8_BIT_DATA
,
193 .caps
= MMC_CAP_4_BIT_DATA
| MMC_CAP_POWER_OFF_CARD
,
196 .ocr_mask
= MMC_VDD_165_195
,
197 .nonremovable
= true,
202 static struct regulator_consumer_supply omap4_panda_vmmc5_supply
[] = {
203 REGULATOR_SUPPLY("vmmc", "omap_hsmmc.4"),
206 static struct regulator_init_data panda_vmmc5
= {
208 .valid_ops_mask
= REGULATOR_CHANGE_STATUS
,
210 .num_consumer_supplies
= ARRAY_SIZE(omap4_panda_vmmc5_supply
),
211 .consumer_supplies
= omap4_panda_vmmc5_supply
,
214 static 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 */
220 .enabled_at_boot
= 0,
221 .init_data
= &panda_vmmc5
,
224 static struct platform_device omap_vwlan_device
= {
225 .name
= "reg-fixed-voltage",
228 .platform_data
= &panda_vwlan
,
232 static struct wl12xx_platform_data omap_panda_wlan_data __initdata
= {
233 .board_ref_clock
= WL12XX_REFCLOCK_38
, /* 38.4 MHz */
236 static struct twl6040_codec_data twl6040_codec
= {
237 /* 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,
244 static struct twl6040_platform_data twl6040_data
= {
245 .codec
= &twl6040_codec
,
246 .audpwron_gpio
= 127,
249 static struct i2c_board_info __initdata panda_i2c_1_boardinfo
[] = {
251 I2C_BOARD_INFO("twl6040", 0x4b),
252 .irq
= 119 + OMAP44XX_IRQ_GIC_START
,
253 .platform_data
= &twl6040_data
,
257 /* Panda board uses the common PMIC configuration */
258 static struct twl4030_platform_data omap4_panda_twldata
;
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
264 static struct i2c_board_info __initdata panda_i2c_eeprom
[] = {
266 I2C_BOARD_INFO("eeprom", 0x50),
270 static int __init
omap4_panda_i2c_init(void)
272 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
|
281 TWL_COMMON_REGULATOR_CLK32KG
|
282 TWL_COMMON_REGULATOR_V1V8
|
283 TWL_COMMON_REGULATOR_V2V1
);
284 omap4_pmic_init("twl6030", &omap4_panda_twldata
, panda_i2c_1_boardinfo
,
285 ARRAY_SIZE(panda_i2c_1_boardinfo
));
286 omap_register_i2c_bus(2, 400, NULL
, 0);
288 * Bus 3 is attached to the DVI port where devices like the pico DLP
289 * projector don't work reliably with 400kHz
291 omap_register_i2c_bus(3, 100, panda_i2c_eeprom
,
292 ARRAY_SIZE(panda_i2c_eeprom
));
293 omap_register_i2c_bus(4, 400, NULL
, 0);
297 #ifdef CONFIG_OMAP_MUX
298 static struct omap_board_mux board_mux
[] __initdata
= {
299 /* 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
),
312 /* gpio 0 - TFP410 PD */
313 OMAP4_MUX(KPD_COL1
, OMAP_PIN_OUTPUT
| OMAP_MUX_MODE3
),
315 OMAP4_MUX(USBB2_ULPITLL_STP
, OMAP_PIN_OUTPUT
| OMAP_MUX_MODE5
),
317 OMAP4_MUX(USBB2_ULPITLL_DIR
, OMAP_PIN_OUTPUT
| OMAP_MUX_MODE5
),
319 OMAP4_MUX(USBB2_ULPITLL_NXT
, OMAP_PIN_OUTPUT
| OMAP_MUX_MODE5
),
321 OMAP4_MUX(USBB2_ULPITLL_DAT0
, OMAP_PIN_OUTPUT
| OMAP_MUX_MODE5
),
323 OMAP4_MUX(USBB2_ULPITLL_DAT1
, OMAP_PIN_OUTPUT
| OMAP_MUX_MODE5
),
325 OMAP4_MUX(USBB2_ULPITLL_DAT2
, OMAP_PIN_OUTPUT
| OMAP_MUX_MODE5
),
327 OMAP4_MUX(USBB2_ULPITLL_DAT3
, OMAP_PIN_OUTPUT
| OMAP_MUX_MODE5
),
329 OMAP4_MUX(USBB2_ULPITLL_DAT4
, OMAP_PIN_OUTPUT
| OMAP_MUX_MODE5
),
331 OMAP4_MUX(USBB2_ULPITLL_DAT5
, OMAP_PIN_OUTPUT
| OMAP_MUX_MODE5
),
333 OMAP4_MUX(USBB2_ULPITLL_DAT6
, OMAP_PIN_OUTPUT
| OMAP_MUX_MODE5
),
335 OMAP4_MUX(USBB2_ULPITLL_DAT7
, OMAP_PIN_OUTPUT
| OMAP_MUX_MODE5
),
337 OMAP4_MUX(DPM_EMU3
, OMAP_PIN_OUTPUT
| OMAP_MUX_MODE5
),
339 OMAP4_MUX(DPM_EMU4
, OMAP_PIN_OUTPUT
| OMAP_MUX_MODE5
),
341 OMAP4_MUX(DPM_EMU5
, OMAP_PIN_OUTPUT
| OMAP_MUX_MODE5
),
343 OMAP4_MUX(DPM_EMU6
, OMAP_PIN_OUTPUT
| OMAP_MUX_MODE5
),
345 OMAP4_MUX(DPM_EMU7
, OMAP_PIN_OUTPUT
| OMAP_MUX_MODE5
),
347 OMAP4_MUX(DPM_EMU8
, OMAP_PIN_OUTPUT
| OMAP_MUX_MODE5
),
349 OMAP4_MUX(DPM_EMU9
, OMAP_PIN_OUTPUT
| OMAP_MUX_MODE5
),
351 OMAP4_MUX(DPM_EMU10
, OMAP_PIN_OUTPUT
| OMAP_MUX_MODE5
),
353 OMAP4_MUX(DPM_EMU11
, OMAP_PIN_OUTPUT
| OMAP_MUX_MODE5
),
355 OMAP4_MUX(DPM_EMU12
, OMAP_PIN_OUTPUT
| OMAP_MUX_MODE5
),
357 OMAP4_MUX(DPM_EMU13
, OMAP_PIN_OUTPUT
| OMAP_MUX_MODE5
),
359 OMAP4_MUX(DPM_EMU14
, OMAP_PIN_OUTPUT
| OMAP_MUX_MODE5
),
361 OMAP4_MUX(DPM_EMU15
, OMAP_PIN_OUTPUT
| OMAP_MUX_MODE5
),
363 OMAP4_MUX(DPM_EMU16
, OMAP_PIN_OUTPUT
| OMAP_MUX_MODE5
),
365 OMAP4_MUX(DPM_EMU17
, OMAP_PIN_OUTPUT
| OMAP_MUX_MODE5
),
367 OMAP4_MUX(DPM_EMU18
, OMAP_PIN_OUTPUT
| OMAP_MUX_MODE5
),
369 OMAP4_MUX(DPM_EMU19
, OMAP_PIN_OUTPUT
| OMAP_MUX_MODE5
),
370 /* NIRQ2 for twl6040 */
371 OMAP4_MUX(SYS_NIRQ2
, OMAP_MUX_MODE0
|
372 OMAP_PIN_INPUT_PULLUP
| OMAP_PIN_OFF_WAKEUPENABLE
),
373 /* GPIO_127 for twl6040 */
374 OMAP4_MUX(HDQ_SIO
, OMAP_MUX_MODE3
| OMAP_PIN_OUTPUT
),
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
),
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
|
386 OMAP4_MUX(ABE_MCBSP1_FSX
, OMAP_MUX_MODE0
| OMAP_PIN_INPUT
),
388 /* 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
),
394 { .reg_offset
= OMAP_MUX_TERMINATOR
},
398 #define board_mux NULL
402 static void omap4_panda_init_rev(void)
404 if (cpu_is_omap443x()) {
405 /* PandaBoard 4430 */
406 /* ASoC audio configuration */
407 panda_abe_audio_data
.card_name
= "PandaBoard";
408 panda_abe_audio_data
.has_hsmic
= 1;
411 /* ASoC audio configuration */
412 panda_abe_audio_data
.card_name
= "PandaBoardES";
416 static void __init
omap4_panda_init(void)
418 int package
= OMAP_PACKAGE_CBS
;
421 if (omap_rev() == OMAP4430_REV_ES1_0
)
422 package
= OMAP_PACKAGE_CBL
;
423 omap4_mux_init(board_mux
, NULL
, package
);
425 omap_panda_wlan_data
.irq
= gpio_to_irq(GPIO_WIFI_IRQ
);
426 ret
= wl12xx_set_platform_data(&omap_panda_wlan_data
);
428 pr_err("error setting wl12xx data: %d\n", ret
);
430 omap4_panda_init_rev();
431 omap4_panda_i2c_init();
432 platform_add_devices(panda_devices
, ARRAY_SIZE(panda_devices
));
433 platform_device_register(&omap_vwlan_device
);
435 omap_sdrc_init(NULL
, NULL
);
436 omap4_twl6030_hsmmc_init(mmc
);
438 usb_bind_phy("musb-hdrc.2.auto", 0, "omap-usb2.3.auto");
439 usb_musb_init(&musb_board_data
);
440 omap4_panda_display_init();
443 MACHINE_START(OMAP4_PANDA
, "OMAP4 Panda board")
444 /* Maintainer: David Anders - Texas Instruments Inc */
445 .atag_offset
= 0x100,
446 .smp
= smp_ops(omap4_smp_ops
),
447 .reserve
= omap_reserve
,
448 .map_io
= omap4_map_io
,
449 .init_early
= omap4430_init_early
,
450 .init_irq
= gic_init_irq
,
451 .init_machine
= omap4_panda_init
,
452 .init_late
= omap4430_init_late
,
453 .init_time
= omap4_local_timer_init
,
454 .restart
= omap44xx_restart
,