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>
21 #include <linux/i2c/twl4030.h>
23 #include <mach/hardware.h>
24 #include <asm/mach-types.h>
25 #include <asm/mach/arch.h>
26 #include <asm/mach/map.h>
28 #include <mach/gpio.h>
29 #include <mach/board.h>
30 #include <mach/common.h>
31 #include <mach/hsmmc.h>
32 #include <mach/keypad.h>
34 static struct resource omap2evm_smc911x_resources[] = {
36 .start = OMAP2EVM_ETHR_START,
37 .end = (OMAP2EVM_ETHR_START + OMAP2EVM_ETHR_SIZE - 1),
38 .flags = IORESOURCE_MEM,
41 .start = OMAP_GPIO_IRQ(OMAP2EVM_ETHR_GPIO_IRQ),
42 .end = OMAP_GPIO_IRQ(OMAP2EVM_ETHR_GPIO_IRQ),
43 .flags = IORESOURCE_IRQ,
47 static struct platform_device omap2evm_smc911x_device = {
50 .num_resources = ARRAY_SIZE(omap2evm_smc911x_resources),
51 .resource = &omap2evm_smc911x_resources [0],
54 static inline void __init omap2evm_init_smc911x(void)
56 int gpio = OMAP2EVM_ETHR_GPIO_IRQ;
59 ret = gpio_request(gpio, "smc911x IRQ");
61 printk(KERN_ERR "Failed to request GPIO %d for smc911x IRQ\n",
65 gpio_direction_input(gpio);
69 static struct platform_device omap2_evm_lcd_device = {
70 .name = "omap2evm_lcd",
74 static struct omap_lcd_config omap2_evm_lcd_config __initdata = {
75 .ctrl_name = "internal",
78 static int omap2evm_keymap[] = {
97 static struct omap_kp_platform_data omap2evm_kp_data = {
100 .keymap = omap2evm_keymap,
101 .keymapsize = ARRAY_SIZE(omap2evm_keymap),
103 .irq = TWL4030_MODIRQ_KEYPAD,
106 static struct platform_device omap2evm_kp_device = {
107 .name = "omap_twl4030keypad",
110 .platform_data = &omap2evm_kp_data,
114 static void __init omap2_evm_init_irq(void)
116 omap2_init_common_hw(NULL);
119 omap2evm_init_smc911x();
122 static struct omap_uart_config omap2_evm_uart_config __initdata = {
123 .enabled_uarts = ((1 << 0) | (1 << 1) | (1 << 2)),
126 static struct omap_mmc_config omap2_evm_mmc_config __initdata = {
133 static struct omap_board_config_kernel omap2_evm_config[] __initdata = {
134 { OMAP_TAG_UART, &omap2_evm_uart_config },
135 { OMAP_TAG_LCD, &omap2_evm_lcd_config },
136 { OMAP_TAG_MMC, &omap2_evm_mmc_config },
139 static int __init omap2_evm_i2c_init(void)
142 * Registering bus 2 first to avoid twl4030 misbehaving as OMAP2EVM
143 * has twl4030 on bus 2
145 omap_register_i2c_bus(2, 2600, NULL, 0);
146 omap_register_i2c_bus(1, 400, NULL, 0);
150 static struct platform_device *omap2_evm_devices[] __initdata = {
151 &omap2_evm_lcd_device,
152 &omap2evm_smc911x_device,
156 static void __init omap2_evm_init(void)
158 platform_add_devices(omap2_evm_devices, ARRAY_SIZE(omap2_evm_devices));
159 omap_board_config = omap2_evm_config;
160 omap_board_config_size = ARRAY_SIZE(omap2_evm_config);
165 static void __init omap2_evm_map_io(void)
167 omap2_set_globals_243x();
168 omap2_map_common_io();
171 arch_initcall(omap2_evm_i2c_init);
173 MACHINE_START(OMAP2EVM, "OMAP2EVM Board")
174 /* Maintainer: Arun KS <arunks@mistralsolutions.com> */
175 .phys_io = 0x48000000,
176 .io_pg_offst = ((0xd8000000) >> 18) & 0xfffc,
177 .boot_params = 0x80000100,
178 .map_io = omap2_evm_map_io,
179 .init_irq = omap2_evm_init_irq,
180 .init_machine = omap2_evm_init,
181 .timer = &omap_timer,