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>
21 #include <asm/hardware.h>
22 #include <asm/mach-types.h>
23 #include <asm/mach/arch.h>
24 #include <asm/mach/map.h>
26 #include <asm/arch/gpio.h>
27 #include <asm/arch/board.h>
28 #include <asm/arch/common.h>
30 static struct resource omap2evm_smc911x_resources[] = {
32 .start = OMAP2EVM_ETHR_START,
33 .end = (OMAP2EVM_ETHR_START + OMAP2EVM_ETHR_SIZE - 1),
34 .flags = IORESOURCE_MEM,
37 .start = OMAP_GPIO_IRQ(OMAP2EVM_ETHR_GPIO_IRQ),
38 .end = OMAP_GPIO_IRQ(OMAP2EVM_ETHR_GPIO_IRQ),
39 .flags = IORESOURCE_IRQ,
43 static struct platform_device omap2evm_smc911x_device = {
46 .num_resources = ARRAY_SIZE(omap2evm_smc911x_resources),
47 .resource = &omap2evm_smc911x_resources [0],
50 static inline void __init omap2evm_init_smc911x(void)
52 int gpio = OMAP2EVM_ETHR_GPIO_IRQ;
55 ret = gpio_request(gpio, "smc911x IRQ");
57 printk(KERN_ERR "Failed to request GPIO %d for smc911x IRQ\n",
61 gpio_direction_input(gpio);
65 static struct platform_device omap2_evm_lcd_device = {
66 .name = "omap2evm_lcd",
70 static struct omap_lcd_config omap2_evm_lcd_config __initdata = {
71 .ctrl_name = "internal",
74 static void __init omap2_evm_init_irq(void)
76 omap2_init_common_hw(NULL);
79 omap2evm_init_smc911x();
82 static struct omap_uart_config omap2_evm_uart_config __initdata = {
83 .enabled_uarts = ((1 << 0) | (1 << 1) | (1 << 2)),
86 static struct omap_board_config_kernel omap2_evm_config[] __initdata = {
87 { OMAP_TAG_UART, &omap2_evm_uart_config },
88 { OMAP_TAG_LCD, &omap2_evm_lcd_config },
91 static int __init omap2_evm_i2c_init(void)
94 * Registering bus 2 first to avoid twl4030 misbehaving as OMAP2EVM
95 * has twl4030 on bus 2
97 omap_register_i2c_bus(2, 2600, NULL, 0);
98 omap_register_i2c_bus(1, 400, NULL, 0);
102 static struct platform_device *omap2_evm_devices[] __initdata = {
103 &omap2_evm_lcd_device,
104 &omap2evm_smc911x_device,
107 static void __init omap2_evm_init(void)
109 platform_add_devices(omap2_evm_devices, ARRAY_SIZE(omap2_evm_devices));
110 omap_board_config = omap2_evm_config;
111 omap_board_config_size = ARRAY_SIZE(omap2_evm_config);
115 static void __init omap2_evm_map_io(void)
117 omap2_set_globals_243x();
118 omap2_map_common_io();
121 arch_initcall(omap2_evm_i2c_init);
123 MACHINE_START(OMAP2EVM, "OMAP2EVM Board")
124 /* Maintainer: Arun KS <arunks@mistralsolutions.com> */
125 .phys_io = 0x48000000,
126 .io_pg_offst = ((0xd8000000) >> 18) & 0xfffc,
127 .boot_params = 0x80000100,
128 .map_io = omap2_evm_map_io,
129 .init_irq = omap2_evm_init_irq,
130 .init_machine = omap2_evm_init,
131 .timer = &omap_timer,