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>
37 #define ETH_KS8851_IRQ 34
38 #define ETH_KS8851_POWER_ON 48
39 #define ETH_KS8851_QUART 138
41 static struct spi_board_info sdp4430_spi_board_info[] __initdata = {
46 .max_speed_hz = 24000000,
47 .irq = ETH_KS8851_IRQ,
51 static int omap_ethernet_init(void)
55 /* Request of GPIO lines */
57 status = gpio_request(ETH_KS8851_POWER_ON, "eth_power");
59 pr_err("Cannot request GPIO %d\n", ETH_KS8851_POWER_ON);
63 status = gpio_request(ETH_KS8851_QUART, "quart");
65 pr_err("Cannot request GPIO %d\n", ETH_KS8851_QUART);
69 status = gpio_request(ETH_KS8851_IRQ, "eth_irq");
71 pr_err("Cannot request GPIO %d\n", ETH_KS8851_IRQ);
75 /* Configuration of requested GPIO lines */
77 status = gpio_direction_output(ETH_KS8851_POWER_ON, 1);
79 pr_err("Cannot set output GPIO %d\n", ETH_KS8851_IRQ);
83 status = gpio_direction_output(ETH_KS8851_QUART, 1);
85 pr_err("Cannot set output GPIO %d\n", ETH_KS8851_QUART);
89 status = gpio_direction_input(ETH_KS8851_IRQ);
91 pr_err("Cannot set input GPIO %d\n", ETH_KS8851_IRQ);
98 gpio_free(ETH_KS8851_IRQ);
100 gpio_free(ETH_KS8851_QUART);
102 gpio_free(ETH_KS8851_POWER_ON);
106 static struct platform_device sdp4430_lcd_device = {
107 .name = "sdp4430_lcd",
111 static struct platform_device *sdp4430_devices[] __initdata = {
115 static struct omap_lcd_config sdp4430_lcd_config __initdata = {
116 .ctrl_name = "internal",
119 static struct omap_board_config_kernel sdp4430_config[] __initdata = {
120 { OMAP_TAG_LCD, &sdp4430_lcd_config },
123 static void __init omap_4430sdp_init_irq(void)
125 omap_board_config = sdp4430_config;
126 omap_board_config_size = ARRAY_SIZE(sdp4430_config);
127 omap2_init_common_hw(NULL, NULL);
128 #ifdef CONFIG_OMAP_32K_TIMER
129 omap2_gp_clockevent_set_gptimer(1);
135 static struct omap_musb_board_data musb_board_data = {
136 .interface_type = MUSB_INTERFACE_UTMI,
137 .mode = MUSB_PERIPHERAL,
140 static struct regulator_consumer_supply sdp4430_vmmc_supply[] = {
158 static struct regulator_init_data sdp4430_vaux1 = {
163 .valid_modes_mask = REGULATOR_MODE_NORMAL
164 | REGULATOR_MODE_STANDBY,
165 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
166 | REGULATOR_CHANGE_MODE
167 | REGULATOR_CHANGE_STATUS,
171 static struct regulator_init_data sdp4430_vaux2 = {
176 .valid_modes_mask = REGULATOR_MODE_NORMAL
177 | REGULATOR_MODE_STANDBY,
178 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
179 | REGULATOR_CHANGE_MODE
180 | REGULATOR_CHANGE_STATUS,
184 static struct regulator_init_data sdp4430_vaux3 = {
189 .valid_modes_mask = REGULATOR_MODE_NORMAL
190 | REGULATOR_MODE_STANDBY,
191 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
192 | REGULATOR_CHANGE_MODE
193 | REGULATOR_CHANGE_STATUS,
197 /* VMMC1 for MMC1 card */
198 static struct regulator_init_data sdp4430_vmmc = {
203 .valid_modes_mask = REGULATOR_MODE_NORMAL
204 | REGULATOR_MODE_STANDBY,
205 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
206 | REGULATOR_CHANGE_MODE
207 | REGULATOR_CHANGE_STATUS,
209 .num_consumer_supplies = 5,
210 .consumer_supplies = sdp4430_vmmc_supply,
213 static struct regulator_init_data sdp4430_vpp = {
218 .valid_modes_mask = REGULATOR_MODE_NORMAL
219 | REGULATOR_MODE_STANDBY,
220 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
221 | REGULATOR_CHANGE_MODE
222 | REGULATOR_CHANGE_STATUS,
226 static struct regulator_init_data sdp4430_vusim = {
231 .valid_modes_mask = REGULATOR_MODE_NORMAL
232 | REGULATOR_MODE_STANDBY,
233 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
234 | REGULATOR_CHANGE_MODE
235 | REGULATOR_CHANGE_STATUS,
239 static struct regulator_init_data sdp4430_vana = {
244 .valid_modes_mask = REGULATOR_MODE_NORMAL
245 | REGULATOR_MODE_STANDBY,
246 .valid_ops_mask = REGULATOR_CHANGE_MODE
247 | REGULATOR_CHANGE_STATUS,
251 static struct regulator_init_data sdp4430_vcxio = {
256 .valid_modes_mask = REGULATOR_MODE_NORMAL
257 | REGULATOR_MODE_STANDBY,
258 .valid_ops_mask = REGULATOR_CHANGE_MODE
259 | REGULATOR_CHANGE_STATUS,
263 static struct regulator_init_data sdp4430_vdac = {
268 .valid_modes_mask = REGULATOR_MODE_NORMAL
269 | REGULATOR_MODE_STANDBY,
270 .valid_ops_mask = REGULATOR_CHANGE_MODE
271 | REGULATOR_CHANGE_STATUS,
275 static struct regulator_init_data sdp4430_vusb = {
280 .valid_modes_mask = REGULATOR_MODE_NORMAL
281 | REGULATOR_MODE_STANDBY,
282 .valid_ops_mask = REGULATOR_CHANGE_MODE
283 | REGULATOR_CHANGE_STATUS,
287 static struct twl4030_platform_data sdp4430_twldata = {
288 .irq_base = TWL6030_IRQ_BASE,
289 .irq_end = TWL6030_IRQ_END,
292 .vmmc = &sdp4430_vmmc,
294 .vusim = &sdp4430_vusim,
295 .vana = &sdp4430_vana,
296 .vcxio = &sdp4430_vcxio,
297 .vdac = &sdp4430_vdac,
298 .vusb = &sdp4430_vusb,
299 .vaux1 = &sdp4430_vaux1,
300 .vaux2 = &sdp4430_vaux2,
301 .vaux3 = &sdp4430_vaux3,
304 static struct i2c_board_info __initdata sdp4430_i2c_boardinfo[] = {
306 I2C_BOARD_INFO("twl6030", 0x48),
307 .flags = I2C_CLIENT_WAKE,
308 .irq = OMAP44XX_IRQ_SYS_1N,
309 .platform_data = &sdp4430_twldata,
312 static int __init omap4_i2c_init(void)
315 * Phoenix Audio IC needs I2C1 to
316 * start with 400 KHz or less
318 omap_register_i2c_bus(1, 400, sdp4430_i2c_boardinfo,
319 ARRAY_SIZE(sdp4430_i2c_boardinfo));
320 omap_register_i2c_bus(2, 400, NULL, 0);
321 omap_register_i2c_bus(3, 400, NULL, 0);
322 omap_register_i2c_bus(4, 400, NULL, 0);
325 static void __init omap_4430sdp_init(void)
330 platform_add_devices(sdp4430_devices, ARRAY_SIZE(sdp4430_devices));
332 /* OMAP4 SDP uses internal transceiver so register nop transceiver */
333 usb_nop_xceiv_register();
334 /* FIXME: allow multi-omap to boot until musb is updated for omap4 */
335 if (!cpu_is_omap44xx())
336 usb_musb_init(&musb_board_data);
338 status = omap_ethernet_init();
340 pr_err("Ethernet initialization failed: %d\n", status);
342 sdp4430_spi_board_info[0].irq = gpio_to_irq(ETH_KS8851_IRQ);
343 spi_register_board_info(sdp4430_spi_board_info,
344 ARRAY_SIZE(sdp4430_spi_board_info));
348 static void __init omap_4430sdp_map_io(void)
350 omap2_set_globals_443x();
351 omap44xx_map_common_io();
354 MACHINE_START(OMAP_4430SDP, "OMAP4430 4430SDP board")
355 /* Maintainer: Santosh Shilimkar - Texas Instruments Inc */
356 .phys_io = 0x48000000,
357 .io_pg_offst = ((0xfa000000) >> 18) & 0xfffc,
358 .boot_params = 0x80000100,
359 .map_io = omap_4430sdp_map_io,
360 .init_irq = omap_4430sdp_init_irq,
361 .init_machine = omap_4430sdp_init,
362 .timer = &omap_timer,