]> err.no Git - linux-2.6/commitdiff
Blackfin arch: update kgdb patch
authorSonic Zhang <sonic.zhang@analog.com>
Wed, 10 Oct 2007 08:47:58 +0000 (16:47 +0800)
committerBryan Wu <bryan.wu@analog.com>
Wed, 10 Oct 2007 08:47:58 +0000 (16:47 +0800)
Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
drivers/serial/bfin_5xx.c
include/asm-blackfin/kgdb.h

index 5039e2675abc70467ab52ff4847b51b760aa048d..3f39e1814693f64e583b14ad44c056be2fe784c9 100644 (file)
@@ -86,10 +86,8 @@ static void bfin_serial_stop_tx(struct uart_port *port)
 {
        struct bfin_serial_port *uart = (struct bfin_serial_port *)port;
 
-#ifdef CONFIG_BF54x
        while (!(UART_GET_LSR(uart) & TEMT))
                continue;
-#endif
 
 #ifdef CONFIG_SERIAL_BFIN_DMA
        disable_dma(uart->tx_dma_channel);
@@ -128,8 +126,8 @@ static void bfin_serial_start_tx(struct uart_port *port)
        ier = UART_GET_IER(uart);
        ier |= ETBEI;
        UART_PUT_IER(uart, ier);
-       bfin_serial_tx_chars(uart);
 #endif
+       bfin_serial_tx_chars(uart);
 #endif
 }
 
@@ -139,18 +137,21 @@ static void bfin_serial_start_tx(struct uart_port *port)
 static void bfin_serial_stop_rx(struct uart_port *port)
 {
        struct bfin_serial_port *uart = (struct bfin_serial_port *)port;
+#ifdef CONFIG_KGDB_UART
+       if (uart->port.line != CONFIG_KGDB_UART_PORT) {
+#endif
 #ifdef CONFIG_BF54x
        UART_CLEAR_IER(uart, ERBFI);
 #else
        unsigned short ier;
 
        ier = UART_GET_IER(uart);
-#ifdef CONFIG_KGDB_UART
-       if (uart->port.line != CONFIG_KGDB_UART_PORT)
-#endif
        ier &= ~ERBFI;
        UART_PUT_IER(uart, ier);
 #endif
+#ifdef CONFIG_KGDB_UART
+       }
+#endif
 }
 
 /*
@@ -175,8 +176,11 @@ void kgdb_put_debug_char(int chr)
        while (!(UART_GET_LSR(uart) & THRE)) {
                SSYNC();
        }
+
+#ifndef CONFIG_BF54x
        UART_PUT_LCR(uart, UART_GET_LCR(uart)&(~DLAB));
        SSYNC();
+#endif
        UART_PUT_CHAR(uart, (unsigned char)chr);
        SSYNC();
 }
@@ -194,8 +198,10 @@ int kgdb_get_debug_char(void)
        while(!(UART_GET_LSR(uart) & DR)) {
                SSYNC();
        }
+#ifndef CONFIG_BF54x
        UART_PUT_LCR(uart, UART_GET_LCR(uart)&(~DLAB));
        SSYNC();
+#endif
        chr = UART_GET_CHAR(uart);
        SSYNC();
 
@@ -697,17 +703,19 @@ static int bfin_serial_startup(struct uart_port *port)
        uart->rx_dma_timer.expires = jiffies + DMA_RX_FLUSH_JIFFIES;
        add_timer(&(uart->rx_dma_timer));
 #else
+       if (request_irq(uart->port.irq, bfin_serial_rx_int, IRQF_DISABLED,
+            "BFIN_UART_RX", uart)) {
 # ifdef        CONFIG_KGDB_UART
-       if (uart->port.line != CONFIG_KGDB_UART_PORT && request_irq
-# else
-       if (request_irq
+               if (uart->port.line != CONFIG_KGDB_UART_PORT) {
 # endif
-           (uart->port.irq, bfin_serial_rx_int, IRQF_DISABLED,
-            "BFIN_UART_RX", uart)) {
                printk(KERN_NOTICE "Unable to attach BlackFin UART RX interrupt\n");
                return -EBUSY;
+# ifdef        CONFIG_KGDB_UART
+               }
+# endif
        }
 
+
        if (request_irq
            (uart->port.irq+1, bfin_serial_tx_int, IRQF_DISABLED,
             "BFIN_UART_TX", uart)) {
@@ -1154,10 +1162,6 @@ struct console __init *bfin_earlyserial_init(unsigned int port,
                port = 0;
        bfin_serial_init_ports();
        bfin_early_serial_console.index = port;
-#ifdef CONFIG_KGDB_UART
-       kgdb_entry_state = 0;
-       init_kgdb_uart();
-#endif
        uart = &bfin_serial_ports[port];
        t.c_cflag = cflag;
        t.c_iflag = 0;
@@ -1255,7 +1259,7 @@ static int __init bfin_serial_init(void)
        int ret;
 #ifdef CONFIG_KGDB_UART
        struct bfin_serial_port *uart = &bfin_serial_ports[CONFIG_KGDB_UART_PORT];
-       struct termios t;
+       struct ktermios t;
 #endif
 
        pr_info("Serial: Blackfin serial driver\n");
@@ -1272,10 +1276,14 @@ static int __init bfin_serial_init(void)
        }
 #ifdef CONFIG_KGDB_UART
        if (uart->port.cons->index != CONFIG_KGDB_UART_PORT) {
-               request_irq(uart->port.irq, bfin_serial_int,
+               request_irq(uart->port.irq, bfin_serial_rx_int,
                        IRQF_DISABLED, "BFIN_UART_RX", uart);
                pr_info("Request irq for kgdb uart port\n");
+#ifdef CONFIG_BF54x
+               UART_SET_IER(uart, ERBFI);
+#else
                UART_PUT_IER(uart, UART_GET_IER(uart) | ERBFI);
+#endif
                SSYNC();
                t.c_cflag = CS8|B57600;
                t.c_iflag = 0;
index 532bd90520044629c4c7184ea913a2bf44a82fa7..0f73847fd6bc53f4d90538477c814d632d777ab2 100644 (file)
@@ -179,5 +179,6 @@ enum regnames {
 #define STATDA1                0x80
 
 extern void kgdb_print(const char *fmt, ...);
+extern void init_kgdb_uart(void);
 
 #endif