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>
9 * Copyright (C) 2006 George Kashperko <george@chas.com.ua>
11 * EDB9302A, EDB9315, EDB9315A
12 * Copyright (C) 2006 Lennert Buytenhek <buytenh@wantstofly.org>
15 * Copyright (C) 2007 Herbert Valerio Riedel <hvr@gnu.org>
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
);
46 ep93xx_register_flash(2, EP93XX_CS6_PHYS_BASE
, SZ_16M
);
50 static struct ep93xx_eth_data __initdata edb93xx_eth_data
= {
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 /*************************************************************************
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);
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 .boot_params
= EP93XX_SDCE3_PHYS_BASE_SYNC
+ 0x100,
128 .map_io
= ep93xx_map_io
,
129 .init_irq
= ep93xx_init_irq
,
130 .timer
= &ep93xx_timer
,
131 .init_machine
= edb93xx_init_machine
,
135 #ifdef CONFIG_MACH_EDB9302
136 MACHINE_START(EDB9302
, "Cirrus Logic EDB9302 Evaluation Board")
137 /* Maintainer: George Kashperko <george@chas.com.ua> */
138 .boot_params
= EP93XX_SDCE3_PHYS_BASE_SYNC
+ 0x100,
139 .map_io
= ep93xx_map_io
,
140 .init_irq
= ep93xx_init_irq
,
141 .timer
= &ep93xx_timer
,
142 .init_machine
= edb93xx_init_machine
,
146 #ifdef CONFIG_MACH_EDB9302A
147 MACHINE_START(EDB9302A
, "Cirrus Logic EDB9302A Evaluation Board")
148 /* Maintainer: Lennert Buytenhek <buytenh@wantstofly.org> */
149 .boot_params
= EP93XX_SDCE0_PHYS_BASE
+ 0x100,
150 .map_io
= ep93xx_map_io
,
151 .init_irq
= ep93xx_init_irq
,
152 .timer
= &ep93xx_timer
,
153 .init_machine
= edb93xx_init_machine
,
157 #ifdef CONFIG_MACH_EDB9307
158 MACHINE_START(EDB9307
, "Cirrus Logic EDB9307 Evaluation Board")
159 /* Maintainer: Herbert Valerio Riedel <hvr@gnu.org> */
160 .boot_params
= EP93XX_SDCE3_PHYS_BASE_SYNC
+ 0x100,
161 .map_io
= ep93xx_map_io
,
162 .init_irq
= ep93xx_init_irq
,
163 .timer
= &ep93xx_timer
,
164 .init_machine
= edb93xx_init_machine
,
168 #ifdef CONFIG_MACH_EDB9307A
169 MACHINE_START(EDB9307A
, "Cirrus Logic EDB9307A Evaluation Board")
170 /* Maintainer: H Hartley Sweeten <hsweeten@visionengravers.com> */
171 .boot_params
= EP93XX_SDCE0_PHYS_BASE
+ 0x100,
172 .map_io
= ep93xx_map_io
,
173 .init_irq
= ep93xx_init_irq
,
174 .timer
= &ep93xx_timer
,
175 .init_machine
= edb93xx_init_machine
,
179 #ifdef CONFIG_MACH_EDB9312
180 MACHINE_START(EDB9312
, "Cirrus Logic EDB9312 Evaluation Board")
181 /* Maintainer: Toufeeq Hussain <toufeeq_hussain@infosys.com> */
182 .boot_params
= EP93XX_SDCE3_PHYS_BASE_SYNC
+ 0x100,
183 .map_io
= ep93xx_map_io
,
184 .init_irq
= ep93xx_init_irq
,
185 .timer
= &ep93xx_timer
,
186 .init_machine
= edb93xx_init_machine
,
190 #ifdef CONFIG_MACH_EDB9315
191 MACHINE_START(EDB9315
, "Cirrus Logic EDB9315 Evaluation Board")
192 /* Maintainer: Lennert Buytenhek <buytenh@wantstofly.org> */
193 .boot_params
= EP93XX_SDCE3_PHYS_BASE_SYNC
+ 0x100,
194 .map_io
= ep93xx_map_io
,
195 .init_irq
= ep93xx_init_irq
,
196 .timer
= &ep93xx_timer
,
197 .init_machine
= edb93xx_init_machine
,
201 #ifdef CONFIG_MACH_EDB9315A
202 MACHINE_START(EDB9315A
, "Cirrus Logic EDB9315A Evaluation Board")
203 /* Maintainer: Lennert Buytenhek <buytenh@wantstofly.org> */
204 .boot_params
= EP93XX_SDCE0_PHYS_BASE
+ 0x100,
205 .map_io
= ep93xx_map_io
,
206 .init_irq
= ep93xx_init_irq
,
207 .timer
= &ep93xx_timer
,
208 .init_machine
= edb93xx_init_machine
,