summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>2009-03-27 23:26:43 +0100
committerJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>2009-04-04 20:42:20 +0200
commit3524049cd053746298e4cfab2449882e75c146fc (patch)
tree71a34c88087e6ee4c5404b191d082a3f5c0e796d
parentbeebd851cdbc9dd070bcdfec1fd8f17e3cc91bc0 (diff)
downloadu-boot-imx-3524049cd053746298e4cfab2449882e75c146fc.zip
u-boot-imx-3524049cd053746298e4cfab2449882e75c146fc.tar.gz
u-boot-imx-3524049cd053746298e4cfab2449882e75c146fc.tar.bz2
at91rm9200: move serial shutdown code to serial drivers
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>
-rw-r--r--cpu/arm920t/at91rm9200/interrupts.c13
-rw-r--r--drivers/serial/at91rm9200_usart.c5
-rw-r--r--include/common.h1
3 files changed, 9 insertions, 10 deletions
diff --git a/cpu/arm920t/at91rm9200/interrupts.c b/cpu/arm920t/at91rm9200/interrupts.c
index 5f0703c..15e22bf 100644
--- a/cpu/arm920t/at91rm9200/interrupts.c
+++ b/cpu/arm920t/at91rm9200/interrupts.c
@@ -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 */
diff --git a/drivers/serial/at91rm9200_usart.c b/drivers/serial/at91rm9200_usart.c
index d563445..858bde9 100644
--- a/drivers/serial/at91rm9200_usart.c
+++ b/drivers/serial/at91rm9200_usart.c
@@ -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')
diff --git a/include/common.h b/include/common.h
index 20c058a..30fff7d 100644
--- a/include/common.h
+++ b/include/common.h
@@ -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);