2 * linux/arch/arm/mach-omap2/board-omap2evm.c
4 * Copyright (C) 2008 Mistral Solutions Pvt Ltd
6 * Modified from mach-omap2/board-generic.c
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
13 #include <linux/kernel.h>
14 #include <linux/init.h>
15 #include <linux/platform_device.h>
16 #include <linux/delay.h>
17 #include <linux/err.h>
18 #include <linux/clk.h>
20 #include <linux/input.h>
22 #include <mach/hardware.h>
23 #include <asm/mach-types.h>
24 #include <asm/mach/arch.h>
25 #include <asm/mach/map.h>
27 #include <mach/gpio.h>
28 #include <mach/board.h>
29 #include <mach/common.h>
30 #include <mach/hsmmc.h>
31 #include <mach/keypad.h>
33 static struct resource omap2evm_smc911x_resources[] = {
35 .start = OMAP2EVM_ETHR_START,
36 .end = (OMAP2EVM_ETHR_START + OMAP2EVM_ETHR_SIZE - 1),
37 .flags = IORESOURCE_MEM,
40 .start = OMAP_GPIO_IRQ(OMAP2EVM_ETHR_GPIO_IRQ),
41 .end = OMAP_GPIO_IRQ(OMAP2EVM_ETHR_GPIO_IRQ),
42 .flags = IORESOURCE_IRQ,
46 static struct platform_device omap2evm_smc911x_device = {
49 .num_resources = ARRAY_SIZE(omap2evm_smc911x_resources),
50 .resource = &omap2evm_smc911x_resources [0],
53 static inline void __init omap2evm_init_smc911x(void)
55 int gpio = OMAP2EVM_ETHR_GPIO_IRQ;
58 ret = gpio_request(gpio, "smc911x IRQ");
60 printk(KERN_ERR "Failed to request GPIO %d for smc911x IRQ\n",
64 gpio_direction_input(gpio);
68 static struct platform_device omap2_evm_lcd_device = {
69 .name = "omap2evm_lcd",
73 static struct omap_lcd_config omap2_evm_lcd_config __initdata = {
74 .ctrl_name = "internal",
77 static int omap2evm_keymap[] = {
96 static struct omap_kp_platform_data omap2evm_kp_data = {
99 .keymap = omap2evm_keymap,
100 .keymapsize = ARRAY_SIZE(omap2evm_keymap),
104 static struct platform_device omap2evm_kp_device = {
105 .name = "omap_twl4030keypad",
108 .platform_data = &omap2evm_kp_data,
112 static void __init omap2_evm_init_irq(void)
114 omap2_init_common_hw(NULL);
117 omap2evm_init_smc911x();
120 static struct omap_uart_config omap2_evm_uart_config __initdata = {
121 .enabled_uarts = ((1 << 0) | (1 << 1) | (1 << 2)),
124 static struct omap_mmc_config omap2_evm_mmc_config __initdata = {
131 static struct omap_board_config_kernel omap2_evm_config[] __initdata = {
132 { OMAP_TAG_UART, &omap2_evm_uart_config },
133 { OMAP_TAG_LCD, &omap2_evm_lcd_config },
134 { OMAP_TAG_MMC, &omap2_evm_mmc_config },
137 static int __init omap2_evm_i2c_init(void)
140 * Registering bus 2 first to avoid twl4030 misbehaving as OMAP2EVM
141 * has twl4030 on bus 2
143 omap_register_i2c_bus(2, 2600, NULL, 0);
144 omap_register_i2c_bus(1, 400, NULL, 0);
148 static struct platform_device *omap2_evm_devices[] __initdata = {
149 &omap2_evm_lcd_device,
150 &omap2evm_smc911x_device,
154 static void __init omap2_evm_init(void)
156 platform_add_devices(omap2_evm_devices, ARRAY_SIZE(omap2_evm_devices));
157 omap_board_config = omap2_evm_config;
158 omap_board_config_size = ARRAY_SIZE(omap2_evm_config);
163 static void __init omap2_evm_map_io(void)
165 omap2_set_globals_243x();
166 omap2_map_common_io();
169 arch_initcall(omap2_evm_i2c_init);
171 MACHINE_START(OMAP2EVM, "OMAP2EVM Board")
172 /* Maintainer: Arun KS <arunks@mistralsolutions.com> */
173 .phys_io = 0x48000000,
174 .io_pg_offst = ((0xd8000000) >> 18) & 0xfffc,
175 .boot_params = 0x80000100,
176 .map_io = omap2_evm_map_io,
177 .init_irq = omap2_evm_init_irq,
178 .init_machine = omap2_evm_init,
179 .timer = &omap_timer,