diff options
Diffstat (limited to 'include/asm-blackfin/mach-bf533/bfin_serial_5xx.h')
-rw-r--r-- | include/asm-blackfin/mach-bf533/bfin_serial_5xx.h | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/include/asm-blackfin/mach-bf533/bfin_serial_5xx.h b/include/asm-blackfin/mach-bf533/bfin_serial_5xx.h index 7871d4313f49..b6f513bee56e 100644 --- a/include/asm-blackfin/mach-bf533/bfin_serial_5xx.h +++ b/include/asm-blackfin/mach-bf533/bfin_serial_5xx.h | |||
@@ -23,7 +23,6 @@ | |||
23 | #define UART_GET_DLH(uart) bfin_read16(((uart)->port.membase + OFFSET_DLH)) | 23 | #define UART_GET_DLH(uart) bfin_read16(((uart)->port.membase + OFFSET_DLH)) |
24 | #define UART_GET_IIR(uart) bfin_read16(((uart)->port.membase + OFFSET_IIR)) | 24 | #define UART_GET_IIR(uart) bfin_read16(((uart)->port.membase + OFFSET_IIR)) |
25 | #define UART_GET_LCR(uart) bfin_read16(((uart)->port.membase + OFFSET_LCR)) | 25 | #define UART_GET_LCR(uart) bfin_read16(((uart)->port.membase + OFFSET_LCR)) |
26 | #define UART_GET_LSR(uart) bfin_read16(((uart)->port.membase + OFFSET_LSR)) | ||
27 | #define UART_GET_GCTL(uart) bfin_read16(((uart)->port.membase + OFFSET_GCTL)) | 26 | #define UART_GET_GCTL(uart) bfin_read16(((uart)->port.membase + OFFSET_GCTL)) |
28 | 27 | ||
29 | #define UART_PUT_CHAR(uart,v) bfin_write16(((uart)->port.membase + OFFSET_THR),v) | 28 | #define UART_PUT_CHAR(uart,v) bfin_write16(((uart)->port.membase + OFFSET_THR),v) |
@@ -46,6 +45,7 @@ | |||
46 | struct bfin_serial_port { | 45 | struct bfin_serial_port { |
47 | struct uart_port port; | 46 | struct uart_port port; |
48 | unsigned int old_status; | 47 | unsigned int old_status; |
48 | unsigned int lsr; | ||
49 | #ifdef CONFIG_SERIAL_BFIN_DMA | 49 | #ifdef CONFIG_SERIAL_BFIN_DMA |
50 | int tx_done; | 50 | int tx_done; |
51 | int tx_count; | 51 | int tx_count; |
@@ -56,14 +56,34 @@ struct bfin_serial_port { | |||
56 | unsigned int rx_dma_channel; | 56 | unsigned int rx_dma_channel; |
57 | struct work_struct tx_dma_workqueue; | 57 | struct work_struct tx_dma_workqueue; |
58 | #else | 58 | #else |
59 | struct work_struct cts_workqueue; | 59 | # if ANOMALY_05000230 |
60 | unsigned int anomaly_threshold; | ||
61 | # endif | ||
60 | #endif | 62 | #endif |
61 | #ifdef CONFIG_SERIAL_BFIN_CTSRTS | 63 | #ifdef CONFIG_SERIAL_BFIN_CTSRTS |
64 | struct work_struct cts_workqueue; | ||
62 | int cts_pin; | 65 | int cts_pin; |
63 | int rts_pin; | 66 | int rts_pin; |
64 | #endif | 67 | #endif |
65 | }; | 68 | }; |
66 | 69 | ||
70 | /* The hardware clears the LSR bits upon read, so we need to cache | ||
71 | * some of the more fun bits in software so they don't get lost | ||
72 | * when checking the LSR in other code paths (TX). | ||
73 | */ | ||
74 | static inline unsigned int UART_GET_LSR(struct bfin_serial_port *uart) | ||
75 | { | ||
76 | unsigned int lsr = bfin_read16(uart->port.membase + OFFSET_LSR); | ||
77 | uart->lsr |= (lsr & (BI|FE|PE|OE)); | ||
78 | return lsr | uart->lsr; | ||
79 | } | ||
80 | |||
81 | static inline void UART_CLEAR_LSR(struct bfin_serial_port *uart) | ||
82 | { | ||
83 | uart->lsr = 0; | ||
84 | bfin_write16(uart->port.membase + OFFSET_LSR, -1); | ||
85 | } | ||
86 | |||
67 | struct bfin_serial_port bfin_serial_ports[NR_PORTS]; | 87 | struct bfin_serial_port bfin_serial_ports[NR_PORTS]; |
68 | struct bfin_serial_res { | 88 | struct bfin_serial_res { |
69 | unsigned long uart_base_addr; | 89 | unsigned long uart_base_addr; |