Commit a359cca7 authored by Sonic Zhang's avatar Sonic Zhang Committed by Bryan Wu

Blackfin arch: update kgdb patch

Signed-off-by: default avatarSonic Zhang <sonic.zhang@analog.com>
Signed-off-by: default avatarBryan Wu <bryan.wu@analog.com>
parent 2b39331a
...@@ -86,10 +86,8 @@ static void bfin_serial_stop_tx(struct uart_port *port) ...@@ -86,10 +86,8 @@ static void bfin_serial_stop_tx(struct uart_port *port)
{ {
struct bfin_serial_port *uart = (struct bfin_serial_port *)port; struct bfin_serial_port *uart = (struct bfin_serial_port *)port;
#ifdef CONFIG_BF54x
while (!(UART_GET_LSR(uart) & TEMT)) while (!(UART_GET_LSR(uart) & TEMT))
continue; continue;
#endif
#ifdef CONFIG_SERIAL_BFIN_DMA #ifdef CONFIG_SERIAL_BFIN_DMA
disable_dma(uart->tx_dma_channel); disable_dma(uart->tx_dma_channel);
...@@ -128,8 +126,8 @@ static void bfin_serial_start_tx(struct uart_port *port) ...@@ -128,8 +126,8 @@ static void bfin_serial_start_tx(struct uart_port *port)
ier = UART_GET_IER(uart); ier = UART_GET_IER(uart);
ier |= ETBEI; ier |= ETBEI;
UART_PUT_IER(uart, ier); UART_PUT_IER(uart, ier);
bfin_serial_tx_chars(uart);
#endif #endif
bfin_serial_tx_chars(uart);
#endif #endif
} }
...@@ -139,18 +137,21 @@ static void bfin_serial_start_tx(struct uart_port *port) ...@@ -139,18 +137,21 @@ static void bfin_serial_start_tx(struct uart_port *port)
static void bfin_serial_stop_rx(struct uart_port *port) static void bfin_serial_stop_rx(struct uart_port *port)
{ {
struct bfin_serial_port *uart = (struct bfin_serial_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 #ifdef CONFIG_BF54x
UART_CLEAR_IER(uart, ERBFI); UART_CLEAR_IER(uart, ERBFI);
#else #else
unsigned short ier; unsigned short ier;
ier = UART_GET_IER(uart); ier = UART_GET_IER(uart);
#ifdef CONFIG_KGDB_UART
if (uart->port.line != CONFIG_KGDB_UART_PORT)
#endif
ier &= ~ERBFI; ier &= ~ERBFI;
UART_PUT_IER(uart, ier); UART_PUT_IER(uart, ier);
#endif #endif
#ifdef CONFIG_KGDB_UART
}
#endif
} }
/* /*
...@@ -175,8 +176,11 @@ void kgdb_put_debug_char(int chr) ...@@ -175,8 +176,11 @@ void kgdb_put_debug_char(int chr)
while (!(UART_GET_LSR(uart) & THRE)) { while (!(UART_GET_LSR(uart) & THRE)) {
SSYNC(); SSYNC();
} }
#ifndef CONFIG_BF54x
UART_PUT_LCR(uart, UART_GET_LCR(uart)&(~DLAB)); UART_PUT_LCR(uart, UART_GET_LCR(uart)&(~DLAB));
SSYNC(); SSYNC();
#endif
UART_PUT_CHAR(uart, (unsigned char)chr); UART_PUT_CHAR(uart, (unsigned char)chr);
SSYNC(); SSYNC();
} }
...@@ -194,8 +198,10 @@ int kgdb_get_debug_char(void) ...@@ -194,8 +198,10 @@ int kgdb_get_debug_char(void)
while(!(UART_GET_LSR(uart) & DR)) { while(!(UART_GET_LSR(uart) & DR)) {
SSYNC(); SSYNC();
} }
#ifndef CONFIG_BF54x
UART_PUT_LCR(uart, UART_GET_LCR(uart)&(~DLAB)); UART_PUT_LCR(uart, UART_GET_LCR(uart)&(~DLAB));
SSYNC(); SSYNC();
#endif
chr = UART_GET_CHAR(uart); chr = UART_GET_CHAR(uart);
SSYNC(); SSYNC();
...@@ -697,17 +703,19 @@ static int bfin_serial_startup(struct uart_port *port) ...@@ -697,17 +703,19 @@ static int bfin_serial_startup(struct uart_port *port)
uart->rx_dma_timer.expires = jiffies + DMA_RX_FLUSH_JIFFIES; uart->rx_dma_timer.expires = jiffies + DMA_RX_FLUSH_JIFFIES;
add_timer(&(uart->rx_dma_timer)); add_timer(&(uart->rx_dma_timer));
#else #else
if (request_irq(uart->port.irq, bfin_serial_rx_int, IRQF_DISABLED,
"BFIN_UART_RX", uart)) {
# ifdef CONFIG_KGDB_UART # ifdef CONFIG_KGDB_UART
if (uart->port.line != CONFIG_KGDB_UART_PORT && request_irq if (uart->port.line != CONFIG_KGDB_UART_PORT) {
# else
if (request_irq
# endif # 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"); printk(KERN_NOTICE "Unable to attach BlackFin UART RX interrupt\n");
return -EBUSY; return -EBUSY;
# ifdef CONFIG_KGDB_UART
}
# endif
} }
if (request_irq if (request_irq
(uart->port.irq+1, bfin_serial_tx_int, IRQF_DISABLED, (uart->port.irq+1, bfin_serial_tx_int, IRQF_DISABLED,
"BFIN_UART_TX", uart)) { "BFIN_UART_TX", uart)) {
...@@ -1154,10 +1162,6 @@ struct console __init *bfin_earlyserial_init(unsigned int port, ...@@ -1154,10 +1162,6 @@ struct console __init *bfin_earlyserial_init(unsigned int port,
port = 0; port = 0;
bfin_serial_init_ports(); bfin_serial_init_ports();
bfin_early_serial_console.index = port; bfin_early_serial_console.index = port;
#ifdef CONFIG_KGDB_UART
kgdb_entry_state = 0;
init_kgdb_uart();
#endif
uart = &bfin_serial_ports[port]; uart = &bfin_serial_ports[port];
t.c_cflag = cflag; t.c_cflag = cflag;
t.c_iflag = 0; t.c_iflag = 0;
...@@ -1255,7 +1259,7 @@ static int __init bfin_serial_init(void) ...@@ -1255,7 +1259,7 @@ static int __init bfin_serial_init(void)
int ret; int ret;
#ifdef CONFIG_KGDB_UART #ifdef CONFIG_KGDB_UART
struct bfin_serial_port *uart = &bfin_serial_ports[CONFIG_KGDB_UART_PORT]; struct bfin_serial_port *uart = &bfin_serial_ports[CONFIG_KGDB_UART_PORT];
struct termios t; struct ktermios t;
#endif #endif
pr_info("Serial: Blackfin serial driver\n"); pr_info("Serial: Blackfin serial driver\n");
...@@ -1272,10 +1276,14 @@ static int __init bfin_serial_init(void) ...@@ -1272,10 +1276,14 @@ static int __init bfin_serial_init(void)
} }
#ifdef CONFIG_KGDB_UART #ifdef CONFIG_KGDB_UART
if (uart->port.cons->index != CONFIG_KGDB_UART_PORT) { 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); IRQF_DISABLED, "BFIN_UART_RX", uart);
pr_info("Request irq for kgdb uart port\n"); 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); UART_PUT_IER(uart, UART_GET_IER(uart) | ERBFI);
#endif
SSYNC(); SSYNC();
t.c_cflag = CS8|B57600; t.c_cflag = CS8|B57600;
t.c_iflag = 0; t.c_iflag = 0;
......
...@@ -179,5 +179,6 @@ enum regnames { ...@@ -179,5 +179,6 @@ enum regnames {
#define STATDA1 0x80 #define STATDA1 0x80
extern void kgdb_print(const char *fmt, ...); extern void kgdb_print(const char *fmt, ...);
extern void init_kgdb_uart(void);
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment