Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
d6a03f19
Commit
d6a03f19
authored
Apr 11, 2004
by
Russell King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[SERIAL] Add support for TI16C750 hardware flow control.
parent
99ca6b83
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
3 deletions
+25
-3
drivers/serial/8250.c
drivers/serial/8250.c
+24
-3
include/linux/serial_reg.h
include/linux/serial_reg.h
+1
-0
No files found.
drivers/serial/8250.c
View file @
d6a03f19
...
@@ -133,6 +133,7 @@ struct uart_8250_port {
...
@@ -133,6 +133,7 @@ struct uart_8250_port {
unsigned
char
acr
;
unsigned
char
acr
;
unsigned
char
ier
;
unsigned
char
ier
;
unsigned
char
lcr
;
unsigned
char
lcr
;
unsigned
char
mcr
;
unsigned
char
mcr_mask
;
/* mask of user bits */
unsigned
char
mcr_mask
;
/* mask of user bits */
unsigned
char
mcr_force
;
/* mask of forced bits */
unsigned
char
mcr_force
;
/* mask of forced bits */
unsigned
char
lsr_break_flag
;
unsigned
char
lsr_break_flag
;
...
@@ -1176,7 +1177,7 @@ static void serial8250_set_mctrl(struct uart_port *port, unsigned int mctrl)
...
@@ -1176,7 +1177,7 @@ static void serial8250_set_mctrl(struct uart_port *port, unsigned int mctrl)
if
(
mctrl
&
TIOCM_LOOP
)
if
(
mctrl
&
TIOCM_LOOP
)
mcr
|=
UART_MCR_LOOP
;
mcr
|=
UART_MCR_LOOP
;
mcr
=
(
mcr
&
up
->
mcr_mask
)
|
up
->
mcr_force
;
mcr
=
(
mcr
&
up
->
mcr_mask
)
|
up
->
mcr_force
|
up
->
mcr
;
serial_out
(
up
,
UART_MCR
,
mcr
);
serial_out
(
up
,
UART_MCR
,
mcr
);
}
}
...
@@ -1202,6 +1203,7 @@ static int serial8250_startup(struct uart_port *port)
...
@@ -1202,6 +1203,7 @@ static int serial8250_startup(struct uart_port *port)
int
retval
;
int
retval
;
up
->
capabilities
=
uart_config
[
up
->
port
.
type
].
flags
;
up
->
capabilities
=
uart_config
[
up
->
port
.
type
].
flags
;
up
->
mcr
=
0
;
if
(
up
->
port
.
type
==
PORT_16C950
)
{
if
(
up
->
port
.
type
==
PORT_16C950
)
{
/* Wake up and initialize UART */
/* Wake up and initialize UART */
...
@@ -1451,8 +1453,19 @@ serial8250_set_termios(struct uart_port *port, struct termios *termios,
...
@@ -1451,8 +1453,19 @@ serial8250_set_termios(struct uart_port *port, struct termios *termios,
else
else
fcr
=
UART_FCR_ENABLE_FIFO
|
UART_FCR_TRIGGER_8
;
fcr
=
UART_FCR_ENABLE_FIFO
|
UART_FCR_TRIGGER_8
;
}
}
if
(
up
->
port
.
type
==
PORT_16750
)
/*
* TI16C750: hardware flow control and 64 byte FIFOs. When AFE is
* enabled, RTS will be deasserted when the receive FIFO contains
* more characters than the trigger, or the MCR RTS bit is cleared.
*/
if
(
up
->
port
.
type
==
PORT_16750
)
{
up
->
mcr
&=
~
UART_MCR_AFE
;
if
(
termios
->
c_cflag
&
CRTSCTS
)
up
->
mcr
|=
UART_MCR_AFE
;
fcr
|=
UART_FCR7_64BYTE
;
fcr
|=
UART_FCR7_64BYTE
;
}
/*
/*
* Ok, we're now changing the port state. Do it with
* Ok, we're now changing the port state. Do it with
...
@@ -1514,10 +1527,17 @@ serial8250_set_termios(struct uart_port *port, struct termios *termios,
...
@@ -1514,10 +1527,17 @@ serial8250_set_termios(struct uart_port *port, struct termios *termios,
}
else
{
}
else
{
serial_outp
(
up
,
UART_LCR
,
cval
|
UART_LCR_DLAB
);
/* set DLAB */
serial_outp
(
up
,
UART_LCR
,
cval
|
UART_LCR_DLAB
);
/* set DLAB */
}
}
serial_outp
(
up
,
UART_DLL
,
quot
&
0xff
);
/* LS of divisor */
serial_outp
(
up
,
UART_DLL
,
quot
&
0xff
);
/* LS of divisor */
serial_outp
(
up
,
UART_DLM
,
quot
>>
8
);
/* MS of divisor */
serial_outp
(
up
,
UART_DLM
,
quot
>>
8
);
/* MS of divisor */
/*
* LCR DLAB must be set to enable 64-byte FIFO mode. If the FCR
* is written without DLAB set, this mode will be disabled.
*/
if
(
up
->
port
.
type
==
PORT_16750
)
if
(
up
->
port
.
type
==
PORT_16750
)
serial_outp
(
up
,
UART_FCR
,
fcr
);
/* set fcr */
serial_outp
(
up
,
UART_FCR
,
fcr
);
serial_outp
(
up
,
UART_LCR
,
cval
);
/* reset DLAB */
serial_outp
(
up
,
UART_LCR
,
cval
);
/* reset DLAB */
up
->
lcr
=
cval
;
/* Save LCR */
up
->
lcr
=
cval
;
/* Save LCR */
if
(
up
->
port
.
type
!=
PORT_16750
)
{
if
(
up
->
port
.
type
!=
PORT_16750
)
{
...
@@ -1527,6 +1547,7 @@ serial8250_set_termios(struct uart_port *port, struct termios *termios,
...
@@ -1527,6 +1547,7 @@ serial8250_set_termios(struct uart_port *port, struct termios *termios,
}
}
serial_outp
(
up
,
UART_FCR
,
fcr
);
/* set fcr */
serial_outp
(
up
,
UART_FCR
,
fcr
);
/* set fcr */
}
}
serial8250_set_mctrl
(
&
up
->
port
,
up
->
port
.
mctrl
);
spin_unlock_irqrestore
(
&
up
->
port
.
lock
,
flags
);
spin_unlock_irqrestore
(
&
up
->
port
.
lock
,
flags
);
}
}
...
...
include/linux/serial_reg.h
View file @
d6a03f19
...
@@ -121,6 +121,7 @@
...
@@ -121,6 +121,7 @@
/*
/*
* These are the definitions for the Modem Control Register
* These are the definitions for the Modem Control Register
*/
*/
#define UART_MCR_AFE 0x20
/* Enable auto-RTS/CTS (TI16C750) */
#define UART_MCR_LOOP 0x10
/* Enable loopback test mode */
#define UART_MCR_LOOP 0x10
/* Enable loopback test mode */
#define UART_MCR_OUT2 0x08
/* Out2 complement */
#define UART_MCR_OUT2 0x08
/* Out2 complement */
#define UART_MCR_OUT1 0x04
/* Out1 complement */
#define UART_MCR_OUT1 0x04
/* Out1 complement */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment