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>
23 #include <linux/gpio.h>
24 #include <linux/usb/otg.h>
25 #include <linux/i2c/twl.h>
26 #include <linux/regulator/machine.h>
28 #include <mach/hardware.h>
29 #include <mach/omap4-common.h>
30 #include <asm/mach-types.h>
31 #include <asm/mach/arch.h>
32 #include <asm/mach/map.h>
34 #include <plat/board.h>
35 #include <plat/common.h>
36 #include <plat/control.h>
37 #include <plat/timer-gp.h>
43 static void __init
omap4_panda_init_irq(void)
45 omap2_init_common_hw(NULL
, NULL
);
50 static struct omap_musb_board_data musb_board_data
= {
51 .interface_type
= MUSB_INTERFACE_UTMI
,
52 .mode
= MUSB_PERIPHERAL
,
56 static struct omap2_hsmmc_info mmc
[] = {
65 static struct regulator_consumer_supply omap4_panda_vmmc_supply
[] = {
68 .dev_name
= "mmci-omap-hs.0",
72 .dev_name
= "mmci-omap-hs.1",
76 static int omap4_twl6030_hsmmc_late_init(struct device
*dev
)
79 struct platform_device
*pdev
= container_of(dev
,
80 struct platform_device
, dev
);
81 struct omap_mmc_platform_data
*pdata
= dev
->platform_data
;
83 /* Setting MMC1 Card detect Irq */
85 pdata
->slots
[0].card_detect_irq
= TWL6030_IRQ_BASE
+
86 MMCDETECT_INTR_OFFSET
;
90 static __init
void omap4_twl6030_hsmmc_set_late_init(struct device
*dev
)
92 struct omap_mmc_platform_data
*pdata
= dev
->platform_data
;
94 pdata
->init
= omap4_twl6030_hsmmc_late_init
;
97 static int __init
omap4_twl6030_hsmmc_init(struct omap2_hsmmc_info
*controllers
)
99 struct omap2_hsmmc_info
*c
;
101 omap2_hsmmc_init(controllers
);
102 for (c
= controllers
; c
->mmc
; c
++)
103 omap4_twl6030_hsmmc_set_late_init(c
->dev
);
108 static struct regulator_init_data omap4_panda_vaux1
= {
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
,
121 static struct regulator_init_data omap4_panda_vaux2
= {
126 .valid_modes_mask
= REGULATOR_MODE_NORMAL
127 | REGULATOR_MODE_STANDBY
,
128 .valid_ops_mask
= REGULATOR_CHANGE_VOLTAGE
129 | REGULATOR_CHANGE_MODE
130 | REGULATOR_CHANGE_STATUS
,
134 static struct regulator_init_data omap4_panda_vaux3
= {
139 .valid_modes_mask
= REGULATOR_MODE_NORMAL
140 | REGULATOR_MODE_STANDBY
,
141 .valid_ops_mask
= REGULATOR_CHANGE_VOLTAGE
142 | REGULATOR_CHANGE_MODE
143 | REGULATOR_CHANGE_STATUS
,
147 /* VMMC1 for MMC1 card */
148 static struct regulator_init_data omap4_panda_vmmc
= {
153 .valid_modes_mask
= REGULATOR_MODE_NORMAL
154 | REGULATOR_MODE_STANDBY
,
155 .valid_ops_mask
= REGULATOR_CHANGE_VOLTAGE
156 | REGULATOR_CHANGE_MODE
157 | REGULATOR_CHANGE_STATUS
,
159 .num_consumer_supplies
= 2,
160 .consumer_supplies
= omap4_panda_vmmc_supply
,
163 static struct regulator_init_data omap4_panda_vpp
= {
168 .valid_modes_mask
= REGULATOR_MODE_NORMAL
169 | REGULATOR_MODE_STANDBY
,
170 .valid_ops_mask
= REGULATOR_CHANGE_VOLTAGE
171 | REGULATOR_CHANGE_MODE
172 | REGULATOR_CHANGE_STATUS
,
176 static struct regulator_init_data omap4_panda_vusim
= {
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
,
189 static struct regulator_init_data omap4_panda_vana
= {
194 .valid_modes_mask
= REGULATOR_MODE_NORMAL
195 | REGULATOR_MODE_STANDBY
,
196 .valid_ops_mask
= REGULATOR_CHANGE_MODE
197 | REGULATOR_CHANGE_STATUS
,
201 static struct regulator_init_data omap4_panda_vcxio
= {
206 .valid_modes_mask
= REGULATOR_MODE_NORMAL
207 | REGULATOR_MODE_STANDBY
,
208 .valid_ops_mask
= REGULATOR_CHANGE_MODE
209 | REGULATOR_CHANGE_STATUS
,
213 static struct regulator_init_data omap4_panda_vdac
= {
218 .valid_modes_mask
= REGULATOR_MODE_NORMAL
219 | REGULATOR_MODE_STANDBY
,
220 .valid_ops_mask
= REGULATOR_CHANGE_MODE
221 | REGULATOR_CHANGE_STATUS
,
225 static struct regulator_init_data omap4_panda_vusb
= {
230 .valid_modes_mask
= REGULATOR_MODE_NORMAL
231 | REGULATOR_MODE_STANDBY
,
232 .valid_ops_mask
= REGULATOR_CHANGE_MODE
233 | REGULATOR_CHANGE_STATUS
,
237 static struct twl4030_platform_data omap4_panda_twldata
= {
238 .irq_base
= TWL6030_IRQ_BASE
,
239 .irq_end
= TWL6030_IRQ_END
,
242 .vmmc
= &omap4_panda_vmmc
,
243 .vpp
= &omap4_panda_vpp
,
244 .vusim
= &omap4_panda_vusim
,
245 .vana
= &omap4_panda_vana
,
246 .vcxio
= &omap4_panda_vcxio
,
247 .vdac
= &omap4_panda_vdac
,
248 .vusb
= &omap4_panda_vusb
,
249 .vaux1
= &omap4_panda_vaux1
,
250 .vaux2
= &omap4_panda_vaux2
,
251 .vaux3
= &omap4_panda_vaux3
,
254 static struct i2c_board_info __initdata omap4_panda_i2c_boardinfo
[] = {
256 I2C_BOARD_INFO("twl6030", 0x48),
257 .flags
= I2C_CLIENT_WAKE
,
258 .irq
= OMAP44XX_IRQ_SYS_1N
,
259 .platform_data
= &omap4_panda_twldata
,
262 static int __init
omap4_panda_i2c_init(void)
265 * Phoenix Audio IC needs I2C1 to
266 * start with 400 KHz or less
268 omap_register_i2c_bus(1, 400, omap4_panda_i2c_boardinfo
,
269 ARRAY_SIZE(omap4_panda_i2c_boardinfo
));
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);
275 static void __init
omap4_panda_init(void)
279 omap4_panda_i2c_init();
281 omap4_twl6030_hsmmc_init(mmc
);
282 /* OMAP4 Panda uses internal transceiver so register nop transceiver */
283 usb_nop_xceiv_register();
284 if (!cpu_is_omap44xx())
285 usb_musb_init(&musb_board_data
);
288 static void __init
omap4_panda_map_io(void)
290 omap2_set_globals_443x();
291 omap44xx_map_common_io();
294 MACHINE_START(OMAP4_PANDA
, "OMAP4 Panda board")
295 /* Maintainer: David Anders - Texas Instruments Inc */
296 .phys_io
= 0x48000000,
297 .io_pg_offst
= ((0xfa000000) >> 18) & 0xfffc,
298 .boot_params
= 0x80000100,
299 .map_io
= omap4_panda_map_io
,
300 .init_irq
= omap4_panda_init_irq
,
301 .init_machine
= omap4_panda_init
,
302 .timer
= &omap_timer
,