aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap1/board-voiceblue.c
diff options
context:
space:
mode:
authorRussell King - ARM Linux <linux@arm.linux.org.uk>2011-01-27 19:39:45 -0500
committerTony Lindgren <tony@atomide.com>2011-01-27 19:39:48 -0500
commitee54dba9c360944b34e06478c05c6f283bf64eda (patch)
tree78b52c057f5adb414582456217836ca14cd0b0d9 /arch/arm/mach-omap1/board-voiceblue.c
parent277a28567fe928bd94e9953a187002f5041c34a4 (diff)
ARM: OMAP: Allow platforms to hook reset cleanly
This adds a clean method to allow platforms to hook into the reset code if they require to. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap1/board-voiceblue.c')
-rw-r--r--arch/arm/mach-omap1/board-voiceblue.c106
1 files changed, 59 insertions, 47 deletions
diff --git a/arch/arm/mach-omap1/board-voiceblue.c b/arch/arm/mach-omap1/board-voiceblue.c
index 815a69ce821d..671281714099 100644
--- a/arch/arm/mach-omap1/board-voiceblue.c
+++ b/arch/arm/mach-omap1/board-voiceblue.c
@@ -26,6 +26,7 @@
26#include <linux/smc91x.h> 26#include <linux/smc91x.h>
27 27
28#include <mach/hardware.h> 28#include <mach/hardware.h>
29#include <mach/system.h>
29#include <asm/mach-types.h> 30#include <asm/mach-types.h>
30#include <asm/mach/arch.h> 31#include <asm/mach/arch.h>
31#include <asm/mach/map.h> 32#include <asm/mach/map.h>
@@ -163,52 +164,6 @@ static void __init voiceblue_init_irq(void)
163 omap_init_irq(); 164 omap_init_irq();
164} 165}
165 166
166static void __init voiceblue_init(void)
167{
168 /* mux pins for uarts */
169 omap_cfg_reg(UART1_TX);
170 omap_cfg_reg(UART1_RTS);
171 omap_cfg_reg(UART2_TX);
172 omap_cfg_reg(UART2_RTS);
173 omap_cfg_reg(UART3_TX);
174 omap_cfg_reg(UART3_RX);
175
176 /* Watchdog */
177 gpio_request(0, "Watchdog");
178 /* smc91x reset */
179 gpio_request(7, "SMC91x reset");
180 gpio_direction_output(7, 1);
181 udelay(2); /* wait at least 100ns */
182 gpio_set_value(7, 0);
183 mdelay(50); /* 50ms until PHY ready */
184 /* smc91x interrupt pin */
185 gpio_request(8, "SMC91x irq");
186 /* 16C554 reset*/
187 gpio_request(6, "16C554 reset");
188 gpio_direction_output(6, 0);
189 /* 16C554 interrupt pins */
190 gpio_request(12, "16C554 irq");
191 gpio_request(13, "16C554 irq");
192 gpio_request(14, "16C554 irq");
193 gpio_request(15, "16C554 irq");
194 set_irq_type(gpio_to_irq(12), IRQ_TYPE_EDGE_RISING);
195 set_irq_type(gpio_to_irq(13), IRQ_TYPE_EDGE_RISING);
196 set_irq_type(gpio_to_irq(14), IRQ_TYPE_EDGE_RISING);
197 set_irq_type(gpio_to_irq(15), IRQ_TYPE_EDGE_RISING);
198
199 platform_add_devices(voiceblue_devices, ARRAY_SIZE(voiceblue_devices));
200 omap_board_config = voiceblue_config;
201 omap_board_config_size = ARRAY_SIZE(voiceblue_config);
202 omap_serial_init();
203 omap1_usb_init(&voiceblue_usb_config);
204 omap_register_i2c_bus(1, 100, NULL, 0);
205
206 /* There is a good chance board is going up, so enable power LED
207 * (it is connected through invertor) */
208 omap_writeb(0x00, OMAP_LPG1_LCR);
209 omap_writeb(0x00, OMAP_LPG1_PMR); /* Disable clock */
210}
211
212static void __init voiceblue_map_io(void) 167static void __init voiceblue_map_io(void)
213{ 168{
214 omap1_map_common_io(); 169 omap1_map_common_io();
@@ -275,8 +230,17 @@ void voiceblue_wdt_ping(void)
275 gpio_set_value(0, wdt_gpio_state); 230 gpio_set_value(0, wdt_gpio_state);
276} 231}
277 232
278void voiceblue_reset(void) 233static void voiceblue_reset(char mode, const char *cmd)
279{ 234{
235 /*
236 * Workaround for 5912/1611b bug mentioned in sprz209d.pdf p. 28
237 * "Global Software Reset Affects Traffic Controller Frequency".
238 */
239 if (cpu_is_omap5912()) {
240 omap_writew(omap_readw(DPLL_CTL) & ~(1 << 4), DPLL_CTL);
241 omap_writew(0x8, ARM_RSTCT1);
242 }
243
280 set_bit(MACHINE_REBOOT, &machine_state); 244 set_bit(MACHINE_REBOOT, &machine_state);
281 voiceblue_wdt_enable(); 245 voiceblue_wdt_enable();
282 while (1) ; 246 while (1) ;
@@ -286,6 +250,54 @@ EXPORT_SYMBOL(voiceblue_wdt_enable);
286EXPORT_SYMBOL(voiceblue_wdt_disable); 250EXPORT_SYMBOL(voiceblue_wdt_disable);
287EXPORT_SYMBOL(voiceblue_wdt_ping); 251EXPORT_SYMBOL(voiceblue_wdt_ping);
288 252
253static void __init voiceblue_init(void)
254{
255 /* mux pins for uarts */
256 omap_cfg_reg(UART1_TX);
257 omap_cfg_reg(UART1_RTS);
258 omap_cfg_reg(UART2_TX);
259 omap_cfg_reg(UART2_RTS);
260 omap_cfg_reg(UART3_TX);
261 omap_cfg_reg(UART3_RX);
262
263 /* Watchdog */
264 gpio_request(0, "Watchdog");
265 /* smc91x reset */
266 gpio_request(7, "SMC91x reset");
267 gpio_direction_output(7, 1);
268 udelay(2); /* wait at least 100ns */
269 gpio_set_value(7, 0);
270 mdelay(50); /* 50ms until PHY ready */
271 /* smc91x interrupt pin */
272 gpio_request(8, "SMC91x irq");
273 /* 16C554 reset*/
274 gpio_request(6, "16C554 reset");
275 gpio_direction_output(6, 0);
276 /* 16C554 interrupt pins */
277 gpio_request(12, "16C554 irq");
278 gpio_request(13, "16C554 irq");
279 gpio_request(14, "16C554 irq");
280 gpio_request(15, "16C554 irq");
281 set_irq_type(gpio_to_irq(12), IRQ_TYPE_EDGE_RISING);
282 set_irq_type(gpio_to_irq(13), IRQ_TYPE_EDGE_RISING);
283 set_irq_type(gpio_to_irq(14), IRQ_TYPE_EDGE_RISING);
284 set_irq_type(gpio_to_irq(15), IRQ_TYPE_EDGE_RISING);
285
286 platform_add_devices(voiceblue_devices, ARRAY_SIZE(voiceblue_devices));
287 omap_board_config = voiceblue_config;
288 omap_board_config_size = ARRAY_SIZE(voiceblue_config);
289 omap_serial_init();
290 omap1_usb_init(&voiceblue_usb_config);
291 omap_register_i2c_bus(1, 100, NULL, 0);
292
293 /* There is a good chance board is going up, so enable power LED
294 * (it is connected through invertor) */
295 omap_writeb(0x00, OMAP_LPG1_LCR);
296 omap_writeb(0x00, OMAP_LPG1_PMR); /* Disable clock */
297
298 arch_reset = voiceblue_reset;
299}
300
289MACHINE_START(VOICEBLUE, "VoiceBlue OMAP5910") 301MACHINE_START(VOICEBLUE, "VoiceBlue OMAP5910")
290 /* Maintainer: Ladislav Michl <michl@2n.cz> */ 302 /* Maintainer: Ladislav Michl <michl@2n.cz> */
291 .boot_params = 0x10000100, 303 .boot_params = 0x10000100,