]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blob - arch/arm/mach-omap2/board-omap2evm.c
Renaming files to reflect name change from 2430OSK to OMAP2EVM
[linux-2.6-omap-h63xx.git] / arch / arm / mach-omap2 / board-omap2evm.c
1 /*
2  * linux/arch/arm/mach-omap2/board-2430osk.c
3  *
4  * Copyright (C) 2007 Mistral Software Pvt Ltd
5  *
6  * Modified from mach-omap2/board-generic.c
7  *
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.
11  */
12
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>
19
20 #include <asm/hardware.h>
21 #include <asm/mach-types.h>
22 #include <asm/mach/arch.h>
23 #include <asm/mach/map.h>
24
25 #include <asm/arch/gpio.h>
26 #include <asm/arch/board.h>
27 #include <asm/arch/common.h>
28
29 #include <asm/io.h>
30
31 static void __init omap_2430osk_init_irq(void)
32 {
33         omap2_init_common_hw();
34         omap_init_irq();
35         omap_gpio_init();
36 }
37
38 static struct omap_uart_config osk2430_uart_config __initdata = {
39         .enabled_uarts  = ((1 << 0) | (1 << 1) | (1 << 2)),
40 };
41
42 static struct omap_board_config_kernel osk2430_config[] __initdata = {
43
44         {OMAP_TAG_UART, &osk2430_uart_config},
45 };
46
47 #if     defined(CONFIG_I2C_OMAP) || defined(CONFIG_I2C_OMAP_MODULE)
48
49 #define OMAP2_I2C_BASE1         0x48070000
50 #define OMAP2_I2C_BASE2         0x48072000
51 #define OMAP2_I2C_INT1          56
52 #define OMAP2_I2C_INT2          57
53
54 static u32 omap2_i2c1_clkrate   = 400;
55 static u32 omap2_i2c2_clkrate   = 2600;
56
57 static struct resource i2c_resources1[] = {
58         {
59                 .start  = OMAP2_I2C_BASE1,
60                 .end    = OMAP2_I2C_BASE1 + 0x3f,
61                 .flags  = IORESOURCE_MEM,
62         },
63         {
64                 .start  = OMAP2_I2C_INT1,
65                 .flags  = IORESOURCE_IRQ,
66         },
67 };
68
69 static struct resource i2c_resources2[] = {
70         {
71                 .start  = OMAP2_I2C_BASE2,
72                 .end    = OMAP2_I2C_BASE2 + 0x3f,
73                 .flags  = IORESOURCE_MEM,
74         },
75         {
76                 .start  = OMAP2_I2C_INT2,
77                 .flags  = IORESOURCE_IRQ,
78         },
79 };
80
81 static struct platform_device omap_i2c_device1 = {
82         .name           = "i2c_omap",
83         .id             = 1,
84         .num_resources  = ARRAY_SIZE(i2c_resources1),
85         .resource       = i2c_resources1,
86         .dev            = {
87                 .platform_data  = &omap2_i2c1_clkrate,
88         },
89 };
90
91 static struct platform_device omap_i2c_device2 = {
92         .name           = "i2c_omap",
93         .id             = 2,
94         .num_resources  = ARRAY_SIZE(i2c_resources2),
95         .resource       = i2c_resources2,
96         .dev            = {
97                 .platform_data  = &omap2_i2c2_clkrate,
98         },
99 };
100
101 static void omap_init_i2c(void)
102 {
103         (void) platform_device_register(&omap_i2c_device2);
104         (void) platform_device_register(&omap_i2c_device1);
105 }
106
107 #else
108
109 static void omap_init_i2c(void) {}
110
111 #endif
112
113 static int __init omap2430_i2c_init(void)
114 {
115         omap_init_i2c();
116         return 0;
117 }
118
119 static void __init omap_2430osk_init(void)
120 {
121         omap_board_config = osk2430_config;
122         omap_board_config_size = ARRAY_SIZE(osk2430_config);
123         omap_serial_init();
124 }
125
126 static void __init omap_2430osk_map_io(void)
127 {
128         omap2_set_globals_243x();
129         omap2_map_common_io();
130 }
131
132 arch_initcall(omap2430_i2c_init);
133
134 MACHINE_START(OMAP_2430OSK, "OMAP2430 2430OSK board")
135         /* Maintainer: Syed Khasim */
136         .phys_io        = 0x48000000,
137         .io_pg_offst    = ((0xd8000000) >> 18) & 0xfffc,
138         .boot_params    = 0x80000100,
139         .map_io         = omap_2430osk_map_io,
140         .init_irq       = omap_2430osk_init_irq,
141         .init_machine   = omap_2430osk_init,
142         .timer          = &omap_timer,
143 MACHINE_END