aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/serial/bfin_5xx.c40
-rw-r--r--include/asm-blackfin/mach-bf527/bfin_serial_5xx.h3
-rw-r--r--include/asm-blackfin/mach-bf533/bfin_serial_5xx.h3
-rw-r--r--include/asm-blackfin/mach-bf537/bfin_serial_5xx.h3
-rw-r--r--include/asm-blackfin/mach-bf548/bfin_serial_5xx.h3
-rw-r--r--include/asm-blackfin/mach-bf561/bfin_serial_5xx.h3
6 files changed, 22 insertions, 33 deletions
diff --git a/drivers/serial/bfin_5xx.c b/drivers/serial/bfin_5xx.c
index 869c99aa77a4..d6b4ead693b7 100644
--- a/drivers/serial/bfin_5xx.c
+++ b/drivers/serial/bfin_5xx.c
@@ -136,10 +136,7 @@ void kgdb_put_debug_char(int chr)
136 SSYNC(); 136 SSYNC();
137 } 137 }
138 138
139#ifndef CONFIG_BF54x 139 UART_CLEAR_DLAB(uart);
140 UART_PUT_LCR(uart, UART_GET_LCR(uart)&(~DLAB));
141 SSYNC();
142#endif
143 UART_PUT_CHAR(uart, (unsigned char)chr); 140 UART_PUT_CHAR(uart, (unsigned char)chr);
144 SSYNC(); 141 SSYNC();
145} 142}
@@ -158,10 +155,7 @@ int kgdb_get_debug_char(void)
158 while(!(UART_GET_LSR(uart) & DR)) { 155 while(!(UART_GET_LSR(uart) & DR)) {
159 SSYNC(); 156 SSYNC();
160 } 157 }
161#ifndef CONFIG_BF54x 158 UART_CLEAR_DLAB(uart);
162 UART_PUT_LCR(uart, UART_GET_LCR(uart)&(~DLAB));
163 SSYNC();
164#endif
165 chr = UART_GET_CHAR(uart); 159 chr = UART_GET_CHAR(uart);
166 SSYNC(); 160 SSYNC();
167 161
@@ -764,26 +758,15 @@ bfin_serial_set_termios(struct uart_port *port, struct ktermios *termios,
764 UART_PUT_IER(uart, 0); 758 UART_PUT_IER(uart, 0);
765#endif 759#endif
766 760
767#ifndef CONFIG_BF54x
768 /* Set DLAB in LCR to Access DLL and DLH */ 761 /* Set DLAB in LCR to Access DLL and DLH */
769 val = UART_GET_LCR(uart); 762 UART_SET_DLAB(uart);
770 val |= DLAB;
771 UART_PUT_LCR(uart, val);
772 SSYNC();
773#endif
774 763
775 UART_PUT_DLL(uart, quot & 0xFF); 764 UART_PUT_DLL(uart, quot & 0xFF);
776 SSYNC();
777 UART_PUT_DLH(uart, (quot >> 8) & 0xFF); 765 UART_PUT_DLH(uart, (quot >> 8) & 0xFF);
778 SSYNC(); 766 SSYNC();
779 767
780#ifndef CONFIG_BF54x
781 /* Clear DLAB in LCR to Access THR RBR IER */ 768 /* Clear DLAB in LCR to Access THR RBR IER */
782 val = UART_GET_LCR(uart); 769 UART_CLEAR_DLAB(uart);
783 val &= ~DLAB;
784 UART_PUT_LCR(uart, val);
785 SSYNC();
786#endif
787 770
788 UART_PUT_LCR(uart, lcr); 771 UART_PUT_LCR(uart, lcr);
789 772
@@ -946,8 +929,7 @@ bfin_serial_console_get_options(struct bfin_serial_port *uart, int *baud,
946 status = UART_GET_IER(uart) & (ERBFI | ETBEI); 929 status = UART_GET_IER(uart) & (ERBFI | ETBEI);
947 if (status == (ERBFI | ETBEI)) { 930 if (status == (ERBFI | ETBEI)) {
948 /* ok, the port was enabled */ 931 /* ok, the port was enabled */
949 unsigned short lcr, val; 932 u16 lcr, dlh, dll;
950 unsigned short dlh, dll;
951 933
952 lcr = UART_GET_LCR(uart); 934 lcr = UART_GET_LCR(uart);
953 935
@@ -964,22 +946,14 @@ bfin_serial_console_get_options(struct bfin_serial_port *uart, int *baud,
964 case 2: *bits = 7; break; 946 case 2: *bits = 7; break;
965 case 3: *bits = 8; break; 947 case 3: *bits = 8; break;
966 } 948 }
967#ifndef CONFIG_BF54x
968 /* Set DLAB in LCR to Access DLL and DLH */ 949 /* Set DLAB in LCR to Access DLL and DLH */
969 val = UART_GET_LCR(uart); 950 UART_SET_DLAB(uart);
970 val |= DLAB;
971 UART_PUT_LCR(uart, val);
972#endif
973 951
974 dll = UART_GET_DLL(uart); 952 dll = UART_GET_DLL(uart);
975 dlh = UART_GET_DLH(uart); 953 dlh = UART_GET_DLH(uart);
976 954
977#ifndef CONFIG_BF54x
978 /* Clear DLAB in LCR to Access THR RBR IER */ 955 /* Clear DLAB in LCR to Access THR RBR IER */
979 val = UART_GET_LCR(uart); 956 UART_CLEAR_DLAB(uart);
980 val &= ~DLAB;
981 UART_PUT_LCR(uart, val);
982#endif
983 957
984 *baud = get_sclk() / (16*(dll | dlh << 8)); 958 *baud = get_sclk() / (16*(dll | dlh << 8));
985 } 959 }
diff --git a/include/asm-blackfin/mach-bf527/bfin_serial_5xx.h b/include/asm-blackfin/mach-bf527/bfin_serial_5xx.h
index 1bbfc2d75bde..26e3c8076b4e 100644
--- a/include/asm-blackfin/mach-bf527/bfin_serial_5xx.h
+++ b/include/asm-blackfin/mach-bf527/bfin_serial_5xx.h
@@ -50,6 +50,9 @@
50#define UART_PUT_LCR(uart, v) bfin_write16(((uart)->port.membase + OFFSET_LCR), v) 50#define UART_PUT_LCR(uart, v) bfin_write16(((uart)->port.membase + OFFSET_LCR), v)
51#define UART_PUT_GCTL(uart, v) bfin_write16(((uart)->port.membase + OFFSET_GCTL), v) 51#define UART_PUT_GCTL(uart, v) bfin_write16(((uart)->port.membase + OFFSET_GCTL), v)
52 52
53#define UART_SET_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) | DLAB); SSYNC(); } while (0)
54#define UART_CLEAR_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) & ~DLAB); SSYNC(); } while (0)
55
53#if defined(CONFIG_BFIN_UART0_CTSRTS) || defined(CONFIG_BFIN_UART1_CTSRTS) 56#if defined(CONFIG_BFIN_UART0_CTSRTS) || defined(CONFIG_BFIN_UART1_CTSRTS)
54# define CONFIG_SERIAL_BFIN_CTSRTS 57# define CONFIG_SERIAL_BFIN_CTSRTS
55 58
diff --git a/include/asm-blackfin/mach-bf533/bfin_serial_5xx.h b/include/asm-blackfin/mach-bf533/bfin_serial_5xx.h
index d22f052d6c80..d016603b6615 100644
--- a/include/asm-blackfin/mach-bf533/bfin_serial_5xx.h
+++ b/include/asm-blackfin/mach-bf533/bfin_serial_5xx.h
@@ -50,6 +50,9 @@
50#define UART_PUT_LCR(uart,v) bfin_write16(((uart)->port.membase + OFFSET_LCR),v) 50#define UART_PUT_LCR(uart,v) bfin_write16(((uart)->port.membase + OFFSET_LCR),v)
51#define UART_PUT_GCTL(uart,v) bfin_write16(((uart)->port.membase + OFFSET_GCTL),v) 51#define UART_PUT_GCTL(uart,v) bfin_write16(((uart)->port.membase + OFFSET_GCTL),v)
52 52
53#define UART_SET_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) | DLAB); SSYNC(); } while (0)
54#define UART_CLEAR_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) & ~DLAB); SSYNC(); } while (0)
55
53#ifdef CONFIG_BFIN_UART0_CTSRTS 56#ifdef CONFIG_BFIN_UART0_CTSRTS
54# define CONFIG_SERIAL_BFIN_CTSRTS 57# define CONFIG_SERIAL_BFIN_CTSRTS
55# ifndef CONFIG_UART0_CTS_PIN 58# ifndef CONFIG_UART0_CTS_PIN
diff --git a/include/asm-blackfin/mach-bf537/bfin_serial_5xx.h b/include/asm-blackfin/mach-bf537/bfin_serial_5xx.h
index ae2362c0bf97..f79d1a0e9129 100644
--- a/include/asm-blackfin/mach-bf537/bfin_serial_5xx.h
+++ b/include/asm-blackfin/mach-bf537/bfin_serial_5xx.h
@@ -50,6 +50,9 @@
50#define UART_PUT_LCR(uart,v) bfin_write16(((uart)->port.membase + OFFSET_LCR),v) 50#define UART_PUT_LCR(uart,v) bfin_write16(((uart)->port.membase + OFFSET_LCR),v)
51#define UART_PUT_GCTL(uart,v) bfin_write16(((uart)->port.membase + OFFSET_GCTL),v) 51#define UART_PUT_GCTL(uart,v) bfin_write16(((uart)->port.membase + OFFSET_GCTL),v)
52 52
53#define UART_SET_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) | DLAB); SSYNC(); } while (0)
54#define UART_CLEAR_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) & ~DLAB); SSYNC(); } while (0)
55
53#if defined(CONFIG_BFIN_UART0_CTSRTS) || defined(CONFIG_BFIN_UART1_CTSRTS) 56#if defined(CONFIG_BFIN_UART0_CTSRTS) || defined(CONFIG_BFIN_UART1_CTSRTS)
54# define CONFIG_SERIAL_BFIN_CTSRTS 57# define CONFIG_SERIAL_BFIN_CTSRTS
55 58
diff --git a/include/asm-blackfin/mach-bf548/bfin_serial_5xx.h b/include/asm-blackfin/mach-bf548/bfin_serial_5xx.h
index 6547027cd3e6..5eb46a77d919 100644
--- a/include/asm-blackfin/mach-bf548/bfin_serial_5xx.h
+++ b/include/asm-blackfin/mach-bf548/bfin_serial_5xx.h
@@ -54,6 +54,9 @@
54#define UART_PUT_GCTL(uart,v) bfin_write16(((uart)->port.membase + OFFSET_GCTL),v) 54#define UART_PUT_GCTL(uart,v) bfin_write16(((uart)->port.membase + OFFSET_GCTL),v)
55#define UART_PUT_MCR(uart,v) bfin_write16(((uart)->port.membase + OFFSET_MCR),v) 55#define UART_PUT_MCR(uart,v) bfin_write16(((uart)->port.membase + OFFSET_MCR),v)
56 56
57#define UART_SET_DLAB(uart) /* MMRs not muxed on BF54x */
58#define UART_CLEAR_DLAB(uart) /* MMRs not muxed on BF54x */
59
57#if defined(CONFIG_BFIN_UART0_CTSRTS) || defined(CONFIG_BFIN_UART1_CTSRTS) 60#if defined(CONFIG_BFIN_UART0_CTSRTS) || defined(CONFIG_BFIN_UART1_CTSRTS)
58# define CONFIG_SERIAL_BFIN_CTSRTS 61# define CONFIG_SERIAL_BFIN_CTSRTS
59 62
diff --git a/include/asm-blackfin/mach-bf561/bfin_serial_5xx.h b/include/asm-blackfin/mach-bf561/bfin_serial_5xx.h
index c209f0df47f7..7a9628769296 100644
--- a/include/asm-blackfin/mach-bf561/bfin_serial_5xx.h
+++ b/include/asm-blackfin/mach-bf561/bfin_serial_5xx.h
@@ -50,6 +50,9 @@
50#define UART_PUT_LCR(uart,v) bfin_write16(((uart)->port.membase + OFFSET_LCR),v) 50#define UART_PUT_LCR(uart,v) bfin_write16(((uart)->port.membase + OFFSET_LCR),v)
51#define UART_PUT_GCTL(uart,v) bfin_write16(((uart)->port.membase + OFFSET_GCTL),v) 51#define UART_PUT_GCTL(uart,v) bfin_write16(((uart)->port.membase + OFFSET_GCTL),v)
52 52
53#define UART_SET_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) | DLAB); SSYNC(); } while (0)
54#define UART_CLEAR_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) & ~DLAB); SSYNC(); } while (0)
55
53#ifdef CONFIG_BFIN_UART0_CTSRTS 56#ifdef CONFIG_BFIN_UART0_CTSRTS
54# define CONFIG_SERIAL_BFIN_CTSRTS 57# define CONFIG_SERIAL_BFIN_CTSRTS
55# ifndef CONFIG_UART0_CTS_PIN 58# ifndef CONFIG_UART0_CTS_PIN