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>
23 #include <mach/hardware.h>
24 #include <mach/omap4-common.h>
25 #include <asm/mach-types.h>
26 #include <asm/mach/arch.h>
27 #include <asm/mach/map.h>
29 #include <plat/board.h>
30 #include <plat/common.h>
31 #include <plat/control.h>
32 #include <plat/timer-gp.h>
35 #define ETH_KS8851_IRQ 34
36 #define ETH_KS8851_POWER_ON 48
37 #define ETH_KS8851_QUART 138
39 static struct spi_board_info sdp4430_spi_board_info[] __initdata = {
44 .max_speed_hz = 24000000,
45 .irq = ETH_KS8851_IRQ,
49 static int omap_ethernet_init(void)
53 /* Request of GPIO lines */
55 status = gpio_request(ETH_KS8851_POWER_ON, "eth_power");
57 pr_err("Cannot request GPIO %d\n", ETH_KS8851_POWER_ON);
61 status = gpio_request(ETH_KS8851_QUART, "quart");
63 pr_err("Cannot request GPIO %d\n", ETH_KS8851_QUART);
67 status = gpio_request(ETH_KS8851_IRQ, "eth_irq");
69 pr_err("Cannot request GPIO %d\n", ETH_KS8851_IRQ);
73 /* Configuration of requested GPIO lines */
75 status = gpio_direction_output(ETH_KS8851_POWER_ON, 1);
77 pr_err("Cannot set output GPIO %d\n", ETH_KS8851_IRQ);
81 status = gpio_direction_output(ETH_KS8851_QUART, 1);
83 pr_err("Cannot set output GPIO %d\n", ETH_KS8851_QUART);
87 status = gpio_direction_input(ETH_KS8851_IRQ);
89 pr_err("Cannot set input GPIO %d\n", ETH_KS8851_IRQ);
96 gpio_free(ETH_KS8851_IRQ);
98 gpio_free(ETH_KS8851_QUART);
100 gpio_free(ETH_KS8851_POWER_ON);
104 static struct platform_device sdp4430_lcd_device = {
105 .name = "sdp4430_lcd",
109 static struct platform_device *sdp4430_devices[] __initdata = {
113 static struct omap_lcd_config sdp4430_lcd_config __initdata = {
114 .ctrl_name = "internal",
117 static struct omap_board_config_kernel sdp4430_config[] __initdata = {
118 { OMAP_TAG_LCD, &sdp4430_lcd_config },
121 static void __init omap_4430sdp_init_irq(void)
123 omap_board_config = sdp4430_config;
124 omap_board_config_size = ARRAY_SIZE(sdp4430_config);
125 omap2_init_common_hw(NULL, NULL);
126 #ifdef CONFIG_OMAP_32K_TIMER
127 omap2_gp_clockevent_set_gptimer(1);
133 static struct omap_musb_board_data musb_board_data = {
134 .interface_type = MUSB_INTERFACE_UTMI,
135 .mode = MUSB_PERIPHERAL,
139 static void __init omap_4430sdp_init(void)
143 platform_add_devices(sdp4430_devices, ARRAY_SIZE(sdp4430_devices));
145 /* OMAP4 SDP uses internal transceiver so register nop transceiver */
146 usb_nop_xceiv_register();
147 /* FIXME: allow multi-omap to boot until musb is updated for omap4 */
148 if (!cpu_is_omap44xx())
149 usb_musb_init(&musb_board_data);
151 status = omap_ethernet_init();
153 pr_err("Ethernet initialization failed: %d\n", status);
155 sdp4430_spi_board_info[0].irq = gpio_to_irq(ETH_KS8851_IRQ);
156 spi_register_board_info(sdp4430_spi_board_info,
157 ARRAY_SIZE(sdp4430_spi_board_info));
161 static void __init omap_4430sdp_map_io(void)
163 omap2_set_globals_443x();
164 omap44xx_map_common_io();
167 MACHINE_START(OMAP_4430SDP, "OMAP4430 4430SDP board")
168 /* Maintainer: Santosh Shilimkar - Texas Instruments Inc */
169 .phys_io = 0x48000000,
170 .io_pg_offst = ((0xfa000000) >> 18) & 0xfffc,
171 .boot_params = 0x80000100,
172 .map_io = omap_4430sdp_map_io,
173 .init_irq = omap_4430sdp_init_irq,
174 .init_machine = omap_4430sdp_init,
175 .timer = &omap_timer,