]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
at91rm9200: move serial shutdown code to serial drivers
authorJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Fri, 27 Mar 2009 22:26:43 +0000 (23:26 +0100)
committerJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Sat, 4 Apr 2009 18:42:20 +0000 (20:42 +0200)
introduce serial_exit for this purpose. Use it only when the rm9200
serial driver is active

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
cpu/arm920t/at91rm9200/interrupts.c
drivers/serial/at91rm9200_usart.c
include/common.h

index 5f0703c2de28676d9fe67b6dacb220ed45506d65..15e22bf6cf483405d44d4a7b43db0bdd3bbdcc3f 100644 (file)
@@ -166,21 +166,14 @@ ulong get_tbclk (void)
 void reset_cpu (ulong ignored)
 {
 
-#ifdef CONFIG_DBGU
-       AT91PS_USART us = (AT91PS_USART) AT91C_BASE_DBGU;
-#endif
-#ifdef CONFIG_USART0
-       AT91PS_USART us = AT91C_BASE_US0;
-#endif
-#ifdef CONFIG_USART1
-       AT91PS_USART us = AT91C_BASE_US1;
-#endif
 #ifdef CONFIG_AT91RM9200DK
        AT91PS_PIO pio = AT91C_BASE_PIOA;
 #endif
 
+#if defined(CONFIG_AT91RM9200_USART)
        /*shutdown the console to avoid strange chars during reset */
-       us->US_CR = (AT91C_US_RSTRX | AT91C_US_RSTTX);
+       serial_exit();
+#endif
 
 #ifdef CONFIG_AT91RM9200DK
        /* Clear PA19 to trigger the hard reset */
index d5634454927591eb4b3e52a4d9499b8988fff7ec..858bde97c113f10b27067fd811bac326f950f21d 100644 (file)
@@ -86,6 +86,11 @@ int serial_init (void)
        return (0);
 }
 
+void serial_exit (void)
+{
+       us->US_CR = (AT91C_US_RSTRX | AT91C_US_RSTTX);
+}
+
 void serial_putc (const char c)
 {
        if (c == '\n')
index 20c058a81dce1477ba2ae5632ff66dd1a0af3d84..30fff7d65ee29d4bb723c51a583c72ad5b89ec50 100644 (file)
@@ -453,6 +453,7 @@ void ft_pci_setup(void *blob, bd_t *bd);
 
 /* $(CPU)/serial.c */
 int    serial_init   (void);
+void   serial_exit   (void);
 void   serial_addr   (unsigned int);
 void   serial_setbrg (void);
 void   serial_putc   (const char);