83xx: Replace CONFIG_MPC83XX with CONFIG_MPC83xx
[oweals/u-boot.git] / cpu / i386 / serial.c
index db13008ba5b4adf5220576dfde94ee6e97ede36f..8b5f8fa1176097fa36e68ac9a61e873e5e543ce5 100644 (file)
@@ -55,6 +55,8 @@
 #include <malloc.h>
 #endif
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #define UART_RBR    0x00
 #define UART_THR    0x00
 #define UART_IER    0x01
@@ -126,13 +128,9 @@ static int serial_div(int baudrate)
 
 int serial_init(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        volatile char val;
-
        int bdiv = serial_div(gd->baudrate);
 
-
        outb(0x80, UART0_BASE + UART_LCR);      /* set DLAB bit */
        outb(bdiv, UART0_BASE + UART_DLL);      /* set baudrate divisor */
        outb(bdiv >> 8, UART0_BASE + UART_DLM);/* set baudrate divisor */
@@ -150,8 +148,6 @@ int serial_init(void)
 
 void serial_setbrg(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        unsigned short bdiv;
 
        bdiv = serial_div(gd->baudrate);
@@ -398,7 +394,7 @@ int serial_buffered_tstc(void)
 #endif /* CONFIG_SERIAL_SOFTWARE_FIFO */
 
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 /*
   AS HARNOIS : according to CONFIG_KGDB_SER_INDEX kgdb uses serial port
   number 0 or number 1
@@ -410,8 +406,6 @@ int serial_buffered_tstc(void)
 #if (CONFIG_KGDB_SER_INDEX & 2)
 void kgdb_serial_init(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        volatile char val;
        bdiv = serial_div (CONFIG_KGDB_BAUDRATE);
 
@@ -419,8 +413,8 @@ void kgdb_serial_init(void)
         * Init onboard 16550 UART
         */
        outb(0x80, UART1_BASE + UART_LCR);      /* set DLAB bit */
-       outb(bdiv & 0xff), UART1_BASE + UART_DLL);      /* set divisor for 9600 baud */
-       outb(bdiv >> 8), UART1_BASE + UART_DLM);        /* set divisor for 9600 baud */
+       outb((bdiv & 0xff), UART1_BASE + UART_DLL);     /* set divisor for 9600 baud */
+       outb((bdiv >> 8  ), UART1_BASE + UART_DLM);     /* set divisor for 9600 baud */
        outb(0x03, UART1_BASE + UART_LCR);      /* line control 8 bits no parity */
        outb(0x00, UART1_BASE + UART_FCR);      /* disable FIFO */
        outb(0x00, UART1_BASE + UART_MCR);      /* no modem control DTR RTS */
@@ -506,4 +500,4 @@ void kgdb_interruptible(int yes)
        return;
 }
 #endif /* (CONFIG_KGDB_SER_INDEX & 2) */
-#endif /* CFG_CMD_KGDB */
+#endif