Merge branch 'hotfixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris...
[pandora-kernel.git] / arch / mips / pmc-sierra / msp71xx / msp_serial.c
index e25bac5..f726162 100644 (file)
 #include <msp_int.h>
 #include <msp_regs.h>
 
-#ifdef CONFIG_KGDB
-/*
- * kgdb uses serial port 1 so the console can remain on port 0.
- * To use port 0 change the definition to read as follows:
- * #define DEBUG_PORT_BASE KSEG1ADDR(MSP_UART0_BASE)
- */
-#define DEBUG_PORT_BASE KSEG1ADDR(MSP_UART1_BASE)
-
-int putDebugChar(char c)
-{
-       volatile uint32_t *uart = (volatile uint32_t *)DEBUG_PORT_BASE;
-       uint32_t val = (uint32_t)c;
-
-       local_irq_disable();
-       while( !(uart[5] & 0x20) ); /* Wait for TXRDY */
-       uart[0] = val;
-       while( !(uart[5] & 0x20) ); /* Wait for TXRDY */
-       local_irq_enable();
-
-       return 1;
-}
-
-char getDebugChar(void)
-{
-       volatile uint32_t *uart = (volatile uint32_t *)DEBUG_PORT_BASE;
-       uint32_t val;
-
-       while( !(uart[5] & 0x01) ); /* Wait for RXRDY */
-       val = uart[0];
-
-       return (char)val;
-}
-
-void initDebugPort(unsigned int uartclk, unsigned int baudrate)
-{
-       unsigned int baud_divisor = (uartclk + 8 * baudrate)/(16 * baudrate);
-
-       /* Enable FIFOs */
-       writeb(UART_FCR_ENABLE_FIFO | UART_FCR_CLEAR_RCVR |
-                       UART_FCR_CLEAR_XMIT | UART_FCR_TRIGGER_4,
-               (char *)DEBUG_PORT_BASE + (UART_FCR * 4));
-
-       /* Select brtc divisor */
-       writeb(UART_LCR_DLAB, (char *)DEBUG_PORT_BASE + (UART_LCR * 4));
-
-       /* Store divisor lsb */
-       writeb(baud_divisor, (char *)DEBUG_PORT_BASE + (UART_TX * 4));
-
-       /* Store divisor msb */
-       writeb(baud_divisor >> 8, (char *)DEBUG_PORT_BASE + (UART_IER * 4));
-
-       /* Set 8N1 mode */
-       writeb(UART_LCR_WLEN8, (char *)DEBUG_PORT_BASE + (UART_LCR * 4));
-
-       /* Disable flow control */
-       writeb(0, (char *)DEBUG_PORT_BASE + (UART_MCR * 4));
-
-       /* Disable receive interrupt(!) */
-       writeb(0, (char *)DEBUG_PORT_BASE + (UART_IER * 4));
-}
-#endif
-
 void __init msp_serial_setup(void)
 {
        char    *s;
@@ -117,12 +55,12 @@ void __init msp_serial_setup(void)
 
        /* Initialize first serial port */
        up.mapbase      = MSP_UART0_BASE;
-       up.membase      = ioremap_nocache(up.mapbase,MSP_UART_REG_LEN);
+       up.membase      = ioremap_nocache(up.mapbase, MSP_UART_REG_LEN);
        up.irq          = MSP_INT_UART0;
        up.uartclk      = uartclk;
        up.regshift     = 2;
        up.iotype       = UPIO_DWAPB; /* UPIO_MEM like */
-       up.flags        = STD_COM_FLAGS;
+       up.flags        = ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST;
        up.type         = PORT_16550A;
        up.line         = 0;
        up.private_data         = (void*)UART0_STATUS_REG;
@@ -139,17 +77,6 @@ void __init msp_serial_setup(void)
                case MACH_MSP7120_FPGA:
                        /* Enable UART1 on MSP4200 and MSP7120 */
                        *GPIO_CFG2_REG = 0x00002299;
-
-#ifdef CONFIG_KGDB
-                       /* Initialize UART1 for kgdb since PMON doesn't */
-                       if( DEBUG_PORT_BASE == KSEG1ADDR(MSP_UART1_BASE) ) {
-                               if( mips_machtype == MACH_MSP4200_FPGA
-                                || mips_machtype == MACH_MSP7120_FPGA )
-                                       initDebugPort(uartclk,19200);
-                               else
-                                       initDebugPort(uartclk,57600);
-                       }
-#endif
                        break;
 
                default:
@@ -157,7 +84,7 @@ void __init msp_serial_setup(void)
        }
 
        up.mapbase      = MSP_UART1_BASE;
-       up.membase      = ioremap_nocache(up.mapbase,MSP_UART_REG_LEN);
+       up.membase      = ioremap_nocache(up.mapbase, MSP_UART_REG_LEN);
        up.irq          = MSP_INT_UART1;
        up.line         = 1;
        up.private_data         = (void*)UART1_STATUS_REG;