GUI: Fix Tomato RAF theme for all builds. Compilation typo.
[tomato.git] / release / src-rt-6.x.4708 / linux / linux-2.6.36 / arch / arm / mach-ep93xx / edb93xx.c
blobc2ce9034ba87f5b856cb6e1cae89fb69060b8ffe
1 /*
2 * arch/arm/mach-ep93xx/edb93xx.c
3 * Cirrus Logic EDB93xx Development Board support.
5 * EDB93XX, EDB9301, EDB9307A
6 * Copyright (C) 2008-2009 H Hartley Sweeten <hsweeten@visionengravers.com>
8 * EDB9302
9 * Copyright (C) 2006 George Kashperko <george@chas.com.ua>
11 * EDB9302A, EDB9315, EDB9315A
12 * Copyright (C) 2006 Lennert Buytenhek <buytenh@wantstofly.org>
14 * EDB9307
15 * Copyright (C) 2007 Herbert Valerio Riedel <hvr@gnu.org>
17 * EDB9312
18 * Copyright (C) 2006 Infosys Technologies Limited
19 * Toufeeq Hussain <toufeeq_hussain@infosys.com>
21 * This program is free software; you can redistribute it and/or modify
22 * it under the terms of the GNU General Public License as published by
23 * the Free Software Foundation; either version 2 of the License, or (at
24 * your option) any later version.
27 #include <linux/kernel.h>
28 #include <linux/init.h>
29 #include <linux/platform_device.h>
30 #include <linux/gpio.h>
31 #include <linux/i2c.h>
32 #include <linux/i2c-gpio.h>
34 #include <mach/hardware.h>
36 #include <asm/mach-types.h>
37 #include <asm/mach/arch.h>
40 static void __init edb93xx_register_flash(void)
42 if (machine_is_edb9307() || machine_is_edb9312() ||
43 machine_is_edb9315()) {
44 ep93xx_register_flash(4, EP93XX_CS6_PHYS_BASE, SZ_32M);
45 } else {
46 ep93xx_register_flash(2, EP93XX_CS6_PHYS_BASE, SZ_16M);
50 static struct ep93xx_eth_data __initdata edb93xx_eth_data = {
51 .phy_id = 1,
55 /*************************************************************************
56 * EDB93xx i2c peripheral handling
57 *************************************************************************/
58 static struct i2c_gpio_platform_data __initdata edb93xx_i2c_gpio_data = {
59 .sda_pin = EP93XX_GPIO_LINE_EEDAT,
60 .sda_is_open_drain = 0,
61 .scl_pin = EP93XX_GPIO_LINE_EECLK,
62 .scl_is_open_drain = 0,
63 .udelay = 0, /* default to 100 kHz */
64 .timeout = 0, /* default to 100 ms */
67 static struct i2c_board_info __initdata edb93xxa_i2c_board_info[] = {
69 I2C_BOARD_INFO("isl1208", 0x6f),
73 static struct i2c_board_info __initdata edb93xx_i2c_board_info[] = {
75 I2C_BOARD_INFO("ds1337", 0x68),
79 static void __init edb93xx_register_i2c(void)
81 if (machine_is_edb9302a() || machine_is_edb9307a() ||
82 machine_is_edb9315a()) {
83 ep93xx_register_i2c(&edb93xx_i2c_gpio_data,
84 edb93xxa_i2c_board_info,
85 ARRAY_SIZE(edb93xxa_i2c_board_info));
86 } else if (machine_is_edb9307() || machine_is_edb9312() ||
87 machine_is_edb9315()) {
88 ep93xx_register_i2c(&edb93xx_i2c_gpio_data,
89 edb93xx_i2c_board_info,
90 ARRAY_SIZE(edb93xx_i2c_board_info));
95 /*************************************************************************
96 * EDB93xx pwm
97 *************************************************************************/
98 static void __init edb93xx_register_pwm(void)
100 if (machine_is_edb9301() ||
101 machine_is_edb9302() || machine_is_edb9302a()) {
102 /* EP9301 and EP9302 only have pwm.1 (EGPIO14) */
103 ep93xx_register_pwm(0, 1);
104 } else if (machine_is_edb9307() || machine_is_edb9307a()) {
105 /* EP9307 only has pwm.0 (PWMOUT) */
106 ep93xx_register_pwm(1, 0);
107 } else {
108 /* EP9312 and EP9315 have both */
109 ep93xx_register_pwm(1, 1);
114 static void __init edb93xx_init_machine(void)
116 ep93xx_init_devices();
117 edb93xx_register_flash();
118 ep93xx_register_eth(&edb93xx_eth_data, 1);
119 edb93xx_register_i2c();
120 edb93xx_register_pwm();
124 #ifdef CONFIG_MACH_EDB9301
125 MACHINE_START(EDB9301, "Cirrus Logic EDB9301 Evaluation Board")
126 /* Maintainer: H Hartley Sweeten <hsweeten@visionengravers.com> */
127 .phys_io = EP93XX_APB_PHYS_BASE,
128 .io_pg_offst = ((EP93XX_APB_VIRT_BASE) >> 18) & 0xfffc,
129 .boot_params = EP93XX_SDCE3_PHYS_BASE_SYNC + 0x100,
130 .map_io = ep93xx_map_io,
131 .init_irq = ep93xx_init_irq,
132 .timer = &ep93xx_timer,
133 .init_machine = edb93xx_init_machine,
134 MACHINE_END
135 #endif
137 #ifdef CONFIG_MACH_EDB9302
138 MACHINE_START(EDB9302, "Cirrus Logic EDB9302 Evaluation Board")
139 /* Maintainer: George Kashperko <george@chas.com.ua> */
140 .phys_io = EP93XX_APB_PHYS_BASE,
141 .io_pg_offst = ((EP93XX_APB_VIRT_BASE) >> 18) & 0xfffc,
142 .boot_params = EP93XX_SDCE3_PHYS_BASE_SYNC + 0x100,
143 .map_io = ep93xx_map_io,
144 .init_irq = ep93xx_init_irq,
145 .timer = &ep93xx_timer,
146 .init_machine = edb93xx_init_machine,
147 MACHINE_END
148 #endif
150 #ifdef CONFIG_MACH_EDB9302A
151 MACHINE_START(EDB9302A, "Cirrus Logic EDB9302A Evaluation Board")
152 /* Maintainer: Lennert Buytenhek <buytenh@wantstofly.org> */
153 .phys_io = EP93XX_APB_PHYS_BASE,
154 .io_pg_offst = ((EP93XX_APB_VIRT_BASE) >> 18) & 0xfffc,
155 .boot_params = EP93XX_SDCE0_PHYS_BASE + 0x100,
156 .map_io = ep93xx_map_io,
157 .init_irq = ep93xx_init_irq,
158 .timer = &ep93xx_timer,
159 .init_machine = edb93xx_init_machine,
160 MACHINE_END
161 #endif
163 #ifdef CONFIG_MACH_EDB9307
164 MACHINE_START(EDB9307, "Cirrus Logic EDB9307 Evaluation Board")
165 /* Maintainer: Herbert Valerio Riedel <hvr@gnu.org> */
166 .phys_io = EP93XX_APB_PHYS_BASE,
167 .io_pg_offst = ((EP93XX_APB_VIRT_BASE) >> 18) & 0xfffc,
168 .boot_params = EP93XX_SDCE3_PHYS_BASE_SYNC + 0x100,
169 .map_io = ep93xx_map_io,
170 .init_irq = ep93xx_init_irq,
171 .timer = &ep93xx_timer,
172 .init_machine = edb93xx_init_machine,
173 MACHINE_END
174 #endif
176 #ifdef CONFIG_MACH_EDB9307A
177 MACHINE_START(EDB9307A, "Cirrus Logic EDB9307A Evaluation Board")
178 /* Maintainer: H Hartley Sweeten <hsweeten@visionengravers.com> */
179 .phys_io = EP93XX_APB_PHYS_BASE,
180 .io_pg_offst = ((EP93XX_APB_VIRT_BASE) >> 18) & 0xfffc,
181 .boot_params = EP93XX_SDCE0_PHYS_BASE + 0x100,
182 .map_io = ep93xx_map_io,
183 .init_irq = ep93xx_init_irq,
184 .timer = &ep93xx_timer,
185 .init_machine = edb93xx_init_machine,
186 MACHINE_END
187 #endif
189 #ifdef CONFIG_MACH_EDB9312
190 MACHINE_START(EDB9312, "Cirrus Logic EDB9312 Evaluation Board")
191 /* Maintainer: Toufeeq Hussain <toufeeq_hussain@infosys.com> */
192 .phys_io = EP93XX_APB_PHYS_BASE,
193 .io_pg_offst = ((EP93XX_APB_VIRT_BASE) >> 18) & 0xfffc,
194 .boot_params = EP93XX_SDCE3_PHYS_BASE_SYNC + 0x100,
195 .map_io = ep93xx_map_io,
196 .init_irq = ep93xx_init_irq,
197 .timer = &ep93xx_timer,
198 .init_machine = edb93xx_init_machine,
199 MACHINE_END
200 #endif
202 #ifdef CONFIG_MACH_EDB9315
203 MACHINE_START(EDB9315, "Cirrus Logic EDB9315 Evaluation Board")
204 /* Maintainer: Lennert Buytenhek <buytenh@wantstofly.org> */
205 .phys_io = EP93XX_APB_PHYS_BASE,
206 .io_pg_offst = ((EP93XX_APB_VIRT_BASE) >> 18) & 0xfffc,
207 .boot_params = EP93XX_SDCE3_PHYS_BASE_SYNC + 0x100,
208 .map_io = ep93xx_map_io,
209 .init_irq = ep93xx_init_irq,
210 .timer = &ep93xx_timer,
211 .init_machine = edb93xx_init_machine,
212 MACHINE_END
213 #endif
215 #ifdef CONFIG_MACH_EDB9315A
216 MACHINE_START(EDB9315A, "Cirrus Logic EDB9315A Evaluation Board")
217 /* Maintainer: Lennert Buytenhek <buytenh@wantstofly.org> */
218 .phys_io = EP93XX_APB_PHYS_BASE,
219 .io_pg_offst = ((EP93XX_APB_VIRT_BASE) >> 18) & 0xfffc,
220 .boot_params = EP93XX_SDCE0_PHYS_BASE + 0x100,
221 .map_io = ep93xx_map_io,
222 .init_irq = ep93xx_init_irq,
223 .timer = &ep93xx_timer,
224 .init_machine = edb93xx_init_machine,
225 MACHINE_END
226 #endif