TQM85xx: fix typo introduce by commit ffbb5cb9
[oweals/u-boot.git] / cpu / arm720t / serial_netarm.c
index 56cdb0a7518fe0039b2190625ec6f01ad983f574..a593cbc32f0db872c7590085e99753c555e206c9 100644 (file)
 
 #include <asm/hardware.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #define PORTA  (*(volatile unsigned int *)(NETARM_GEN_MODULE_BASE + NETARM_GEN_PORTA))
+#if !defined(CONFIG_NETARM_NS7520)
 #define PORTB  (*(volatile unsigned int *)(NETARM_GEN_MODULE_BASE + NETARM_GEN_PORTB))
+#else
+#define PORTC  (*(volatile unsigned int *)(NETARM_GEN_MODULE_BASE + NETARM_GEN_PORTC))
+#endif
 
 /* wait until transmitter is ready for another character */
-#define TXWAITRDY(registers)                                                   \
+#define TXWAITRDY(registers)                                                   \
 {                                                                              \
        ulong tmo = get_timer(0) + 1 * CFG_HZ;                                  \
        while (((registers)->status_a & NETARM_SER_STATA_TX_RDY) == 0 ) {       \
 }
 
 
+#ifndef CONFIG_UART1_CONSOLE
 volatile netarm_serial_channel_t *serial_reg_ch1 = get_serial_channel(0);
 volatile netarm_serial_channel_t *serial_reg_ch2 = get_serial_channel(1);
+#else
+volatile netarm_serial_channel_t *serial_reg_ch1 = get_serial_channel(1);
+volatile netarm_serial_channel_t *serial_reg_ch2 = get_serial_channel(0);
+#endif
 
 extern void _netarm_led_FAIL1(void);
 
@@ -58,12 +69,14 @@ extern void _netarm_led_FAIL1(void);
  */
 void serial_setbrg (void)
 {
-       /* get the gd pointer */
-       DECLARE_GLOBAL_DATA_PTR;
-
        /* set 0 ... make sure pins are configured for serial */
+#if !defined(CONFIG_NETARM_NS7520)
        PORTA = PORTB =
                NETARM_GEN_PORT_MODE (0xef) | NETARM_GEN_PORT_DIR (0xe0);
+#else
+       PORTA = NETARM_GEN_PORT_MODE (0xef) | NETARM_GEN_PORT_DIR (0xe0);
+       PORTC = NETARM_GEN_PORT_CSF (0xef) | NETARM_GEN_PORT_MODE (0xef) | NETARM_GEN_PORT_DIR (0xe0);
+#endif
 
        /* first turn em off */
        serial_reg_ch1->ctrl_a = serial_reg_ch2->ctrl_a = 0;
@@ -169,6 +182,7 @@ int serial_getc (void)
                break;
        default:
                /* panic, be never here */
+               break;
        }
 
        serial_reg_ch1->status_a |= NETARM_SER_STATA_RX_CLOSED;