2 * Board support file for OMAP4430 SDP.
4 * Copyright (C) 2009 Texas Instruments
6 * Author: Santosh Shilimkar <santosh.shilimkar@ti.com>
8 * Based on mach-omap2/board-3430sdp.c
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
15 #include <linux/kernel.h>
16 #include <linux/init.h>
17 #include <linux/platform_device.h>
19 #include <linux/gpio.h>
20 #include <linux/usb/otg.h>
21 #include <linux/spi/spi.h>
22 #include <linux/i2c/twl.h>
23 #include <linux/regulator/machine.h>
25 #include <mach/hardware.h>
26 #include <mach/omap4-common.h>
27 #include <asm/mach-types.h>
28 #include <asm/mach/arch.h>
29 #include <asm/mach/map.h>
31 #include <plat/board.h>
32 #include <plat/common.h>
33 #include <plat/control.h>
34 #include <plat/timer-gp.h>
39 #define ETH_KS8851_IRQ 34
40 #define ETH_KS8851_POWER_ON 48
41 #define ETH_KS8851_QUART 138
43 static struct spi_board_info sdp4430_spi_board_info[] __initdata = {
48 .max_speed_hz = 24000000,
49 .irq = ETH_KS8851_IRQ,
53 static int omap_ethernet_init(void)
57 /* Request of GPIO lines */
59 status = gpio_request(ETH_KS8851_POWER_ON, "eth_power");
61 pr_err("Cannot request GPIO %d\n", ETH_KS8851_POWER_ON);
65 status = gpio_request(ETH_KS8851_QUART, "quart");
67 pr_err("Cannot request GPIO %d\n", ETH_KS8851_QUART);
71 status = gpio_request(ETH_KS8851_IRQ, "eth_irq");
73 pr_err("Cannot request GPIO %d\n", ETH_KS8851_IRQ);
77 /* Configuration of requested GPIO lines */
79 status = gpio_direction_output(ETH_KS8851_POWER_ON, 1);
81 pr_err("Cannot set output GPIO %d\n", ETH_KS8851_IRQ);
85 status = gpio_direction_output(ETH_KS8851_QUART, 1);
87 pr_err("Cannot set output GPIO %d\n", ETH_KS8851_QUART);
91 status = gpio_direction_input(ETH_KS8851_IRQ);
93 pr_err("Cannot set input GPIO %d\n", ETH_KS8851_IRQ);
100 gpio_free(ETH_KS8851_IRQ);
102 gpio_free(ETH_KS8851_QUART);
104 gpio_free(ETH_KS8851_POWER_ON);
108 static struct platform_device sdp4430_lcd_device = {
109 .name = "sdp4430_lcd",
113 static struct platform_device *sdp4430_devices[] __initdata = {
117 static struct omap_lcd_config sdp4430_lcd_config __initdata = {
118 .ctrl_name = "internal",
121 static struct omap_board_config_kernel sdp4430_config[] __initdata = {
122 { OMAP_TAG_LCD, &sdp4430_lcd_config },
125 static void __init omap_4430sdp_init_irq(void)
127 omap_board_config = sdp4430_config;
128 omap_board_config_size = ARRAY_SIZE(sdp4430_config);
129 omap2_init_common_hw(NULL, NULL);
130 #ifdef CONFIG_OMAP_32K_TIMER
131 omap2_gp_clockevent_set_gptimer(1);
137 static struct omap_musb_board_data musb_board_data = {
138 .interface_type = MUSB_INTERFACE_UTMI,
139 .mode = MUSB_PERIPHERAL,
143 static struct omap2_hsmmc_info mmc[] = {
154 .nonremovable = true,
159 static struct regulator_consumer_supply sdp4430_vaux_supply[] = {
162 .dev_name = "mmci-omap-hs.1",
165 static struct regulator_consumer_supply sdp4430_vmmc_supply[] = {
168 .dev_name = "mmci-omap-hs.0",
172 static int omap4_twl6030_hsmmc_late_init(struct device *dev)
175 struct platform_device *pdev = container_of(dev,
176 struct platform_device, dev);
177 struct omap_mmc_platform_data *pdata = dev->platform_data;
179 /* Setting MMC1 Card detect Irq */
181 pdata->slots[0].card_detect_irq = TWL6030_IRQ_BASE +
182 MMCDETECT_INTR_OFFSET;
186 static __init void omap4_twl6030_hsmmc_set_late_init(struct device *dev)
188 struct omap_mmc_platform_data *pdata = dev->platform_data;
190 pdata->init = omap4_twl6030_hsmmc_late_init;
193 static int __init omap4_twl6030_hsmmc_init(struct omap2_hsmmc_info *controllers)
195 struct omap2_hsmmc_info *c;
197 omap2_hsmmc_init(controllers);
198 for (c = controllers; c->mmc; c++)
199 omap4_twl6030_hsmmc_set_late_init(c->dev);
204 static struct regulator_init_data sdp4430_vaux1 = {
209 .valid_modes_mask = REGULATOR_MODE_NORMAL
210 | REGULATOR_MODE_STANDBY,
211 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
212 | REGULATOR_CHANGE_MODE
213 | REGULATOR_CHANGE_STATUS,
215 .num_consumer_supplies = 1,
216 .consumer_supplies = sdp4430_vaux_supply,
219 static struct regulator_init_data sdp4430_vaux2 = {
224 .valid_modes_mask = REGULATOR_MODE_NORMAL
225 | REGULATOR_MODE_STANDBY,
226 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
227 | REGULATOR_CHANGE_MODE
228 | REGULATOR_CHANGE_STATUS,
232 static struct regulator_init_data sdp4430_vaux3 = {
237 .valid_modes_mask = REGULATOR_MODE_NORMAL
238 | REGULATOR_MODE_STANDBY,
239 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
240 | REGULATOR_CHANGE_MODE
241 | REGULATOR_CHANGE_STATUS,
245 /* VMMC1 for MMC1 card */
246 static struct regulator_init_data sdp4430_vmmc = {
251 .valid_modes_mask = REGULATOR_MODE_NORMAL
252 | REGULATOR_MODE_STANDBY,
253 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
254 | REGULATOR_CHANGE_MODE
255 | REGULATOR_CHANGE_STATUS,
257 .num_consumer_supplies = 1,
258 .consumer_supplies = sdp4430_vmmc_supply,
261 static struct regulator_init_data sdp4430_vpp = {
266 .valid_modes_mask = REGULATOR_MODE_NORMAL
267 | REGULATOR_MODE_STANDBY,
268 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
269 | REGULATOR_CHANGE_MODE
270 | REGULATOR_CHANGE_STATUS,
274 static struct regulator_init_data sdp4430_vusim = {
279 .valid_modes_mask = REGULATOR_MODE_NORMAL
280 | REGULATOR_MODE_STANDBY,
281 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
282 | REGULATOR_CHANGE_MODE
283 | REGULATOR_CHANGE_STATUS,
287 static struct regulator_init_data sdp4430_vana = {
292 .valid_modes_mask = REGULATOR_MODE_NORMAL
293 | REGULATOR_MODE_STANDBY,
294 .valid_ops_mask = REGULATOR_CHANGE_MODE
295 | REGULATOR_CHANGE_STATUS,
299 static struct regulator_init_data sdp4430_vcxio = {
304 .valid_modes_mask = REGULATOR_MODE_NORMAL
305 | REGULATOR_MODE_STANDBY,
306 .valid_ops_mask = REGULATOR_CHANGE_MODE
307 | REGULATOR_CHANGE_STATUS,
311 static struct regulator_init_data sdp4430_vdac = {
316 .valid_modes_mask = REGULATOR_MODE_NORMAL
317 | REGULATOR_MODE_STANDBY,
318 .valid_ops_mask = REGULATOR_CHANGE_MODE
319 | REGULATOR_CHANGE_STATUS,
323 static struct regulator_init_data sdp4430_vusb = {
328 .valid_modes_mask = REGULATOR_MODE_NORMAL
329 | REGULATOR_MODE_STANDBY,
330 .valid_ops_mask = REGULATOR_CHANGE_MODE
331 | REGULATOR_CHANGE_STATUS,
335 static struct twl4030_platform_data sdp4430_twldata = {
336 .irq_base = TWL6030_IRQ_BASE,
337 .irq_end = TWL6030_IRQ_END,
340 .vmmc = &sdp4430_vmmc,
342 .vusim = &sdp4430_vusim,
343 .vana = &sdp4430_vana,
344 .vcxio = &sdp4430_vcxio,
345 .vdac = &sdp4430_vdac,
346 .vusb = &sdp4430_vusb,
347 .vaux1 = &sdp4430_vaux1,
348 .vaux2 = &sdp4430_vaux2,
349 .vaux3 = &sdp4430_vaux3,
352 static struct i2c_board_info __initdata sdp4430_i2c_boardinfo[] = {
354 I2C_BOARD_INFO("twl6030", 0x48),
355 .flags = I2C_CLIENT_WAKE,
356 .irq = OMAP44XX_IRQ_SYS_1N,
357 .platform_data = &sdp4430_twldata,
360 static int __init omap4_i2c_init(void)
363 * Phoenix Audio IC needs I2C1 to
364 * start with 400 KHz or less
366 omap_register_i2c_bus(1, 400, sdp4430_i2c_boardinfo,
367 ARRAY_SIZE(sdp4430_i2c_boardinfo));
368 omap_register_i2c_bus(2, 400, NULL, 0);
369 omap_register_i2c_bus(3, 400, NULL, 0);
370 omap_register_i2c_bus(4, 400, NULL, 0);
373 static void __init omap_4430sdp_init(void)
378 platform_add_devices(sdp4430_devices, ARRAY_SIZE(sdp4430_devices));
380 omap4_twl6030_hsmmc_init(mmc);
381 /* OMAP4 SDP uses internal transceiver so register nop transceiver */
382 usb_nop_xceiv_register();
383 /* FIXME: allow multi-omap to boot until musb is updated for omap4 */
384 if (!cpu_is_omap44xx())
385 usb_musb_init(&musb_board_data);
387 status = omap_ethernet_init();
389 pr_err("Ethernet initialization failed: %d\n", status);
391 sdp4430_spi_board_info[0].irq = gpio_to_irq(ETH_KS8851_IRQ);
392 spi_register_board_info(sdp4430_spi_board_info,
393 ARRAY_SIZE(sdp4430_spi_board_info));
397 static void __init omap_4430sdp_map_io(void)
399 omap2_set_globals_443x();
400 omap44xx_map_common_io();
403 MACHINE_START(OMAP_4430SDP, "OMAP4430 4430SDP board")
404 /* Maintainer: Santosh Shilimkar - Texas Instruments Inc */
405 .phys_io = 0x48000000,
406 .io_pg_offst = ((0xfa000000) >> 18) & 0xfffc,
407 .boot_params = 0x80000100,
408 .map_io = omap_4430sdp_map_io,
409 .init_irq = omap_4430sdp_init_irq,
410 .init_machine = omap_4430sdp_init,
411 .timer = &omap_timer,