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
f46f6b20
Commit
f46f6b20
authored
Jun 23, 2005
by
Linus Torvalds
Browse files
Options
Browse Files
Download
Plain Diff
Merge master.kernel.org:/home/rmk/linux-2.6-serial
parents
a8ad86f2
67f7654e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
10 deletions
+47
-10
drivers/serial/8250.c
drivers/serial/8250.c
+44
-10
drivers/serial/8250.h
drivers/serial/8250.h
+3
-0
No files found.
drivers/serial/8250.c
View file @
f46f6b20
...
@@ -132,9 +132,9 @@ struct uart_8250_port {
...
@@ -132,9 +132,9 @@ struct uart_8250_port {
struct
uart_port
port
;
struct
uart_port
port
;
struct
timer_list
timer
;
/* "no irq" timer */
struct
timer_list
timer
;
/* "no irq" timer */
struct
list_head
list
;
/* ports on this IRQ */
struct
list_head
list
;
/* ports on this IRQ */
unsigned
int
capabilities
;
/* port capabilities */
unsigned
short
capabilities
;
/* port capabilities */
unsigned
short
bugs
;
/* port bugs */
unsigned
int
tx_loadsz
;
/* transmit fifo load size */
unsigned
int
tx_loadsz
;
/* transmit fifo load size */
unsigned
short
rev
;
unsigned
char
acr
;
unsigned
char
acr
;
unsigned
char
ier
;
unsigned
char
ier
;
unsigned
char
lcr
;
unsigned
char
lcr
;
...
@@ -560,7 +560,14 @@ static void autoconfig_has_efr(struct uart_8250_port *up)
...
@@ -560,7 +560,14 @@ static void autoconfig_has_efr(struct uart_8250_port *up)
if
(
id1
==
0x16
&&
id2
==
0xC9
&&
if
(
id1
==
0x16
&&
id2
==
0xC9
&&
(
id3
==
0x50
||
id3
==
0x52
||
id3
==
0x54
))
{
(
id3
==
0x50
||
id3
==
0x52
||
id3
==
0x54
))
{
up
->
port
.
type
=
PORT_16C950
;
up
->
port
.
type
=
PORT_16C950
;
up
->
rev
=
rev
|
(
id3
<<
8
);
/*
* Enable work around for the Oxford Semiconductor 952 rev B
* chip which causes it to seriously miscalculate baud rates
* when DLL is 0.
*/
if
(
id3
==
0x52
&&
rev
==
0x01
)
up
->
bugs
|=
UART_BUG_QUOT
;
return
;
return
;
}
}
...
@@ -577,8 +584,6 @@ static void autoconfig_has_efr(struct uart_8250_port *up)
...
@@ -577,8 +584,6 @@ static void autoconfig_has_efr(struct uart_8250_port *up)
id2
=
id1
>>
8
;
id2
=
id1
>>
8
;
if
(
id2
==
0x10
||
id2
==
0x12
||
id2
==
0x14
)
{
if
(
id2
==
0x10
||
id2
==
0x12
||
id2
==
0x14
)
{
if
(
id2
==
0x10
)
up
->
rev
=
id1
&
255
;
up
->
port
.
type
=
PORT_16850
;
up
->
port
.
type
=
PORT_16850
;
return
;
return
;
}
}
...
@@ -809,6 +814,7 @@ static void autoconfig(struct uart_8250_port *up, unsigned int probeflags)
...
@@ -809,6 +814,7 @@ static void autoconfig(struct uart_8250_port *up, unsigned int probeflags)
// save_flags(flags); cli();
// save_flags(flags); cli();
up
->
capabilities
=
0
;
up
->
capabilities
=
0
;
up
->
bugs
=
0
;
if
(
!
(
up
->
port
.
flags
&
UPF_BUGGY_UART
))
{
if
(
!
(
up
->
port
.
flags
&
UPF_BUGGY_UART
))
{
/*
/*
...
@@ -1021,6 +1027,8 @@ static void serial8250_stop_tx(struct uart_port *port, unsigned int tty_stop)
...
@@ -1021,6 +1027,8 @@ static void serial8250_stop_tx(struct uart_port *port, unsigned int tty_stop)
}
}
}
}
static
void
transmit_chars
(
struct
uart_8250_port
*
up
);
static
void
serial8250_start_tx
(
struct
uart_port
*
port
,
unsigned
int
tty_start
)
static
void
serial8250_start_tx
(
struct
uart_port
*
port
,
unsigned
int
tty_start
)
{
{
struct
uart_8250_port
*
up
=
(
struct
uart_8250_port
*
)
port
;
struct
uart_8250_port
*
up
=
(
struct
uart_8250_port
*
)
port
;
...
@@ -1028,6 +1036,14 @@ static void serial8250_start_tx(struct uart_port *port, unsigned int tty_start)
...
@@ -1028,6 +1036,14 @@ static void serial8250_start_tx(struct uart_port *port, unsigned int tty_start)
if
(
!
(
up
->
ier
&
UART_IER_THRI
))
{
if
(
!
(
up
->
ier
&
UART_IER_THRI
))
{
up
->
ier
|=
UART_IER_THRI
;
up
->
ier
|=
UART_IER_THRI
;
serial_out
(
up
,
UART_IER
,
up
->
ier
);
serial_out
(
up
,
UART_IER
,
up
->
ier
);
if
(
up
->
bugs
&
UART_BUG_TXEN
)
{
unsigned
char
lsr
,
iir
;
lsr
=
serial_in
(
up
,
UART_LSR
);
iir
=
serial_in
(
up
,
UART_IIR
);
if
(
lsr
&
UART_LSR_TEMT
&&
iir
&
UART_IIR_NO_INT
)
transmit_chars
(
up
);
}
}
}
/*
/*
* We only do this from uart_start
* We only do this from uart_start
...
@@ -1433,6 +1449,7 @@ static int serial8250_startup(struct uart_port *port)
...
@@ -1433,6 +1449,7 @@ static int serial8250_startup(struct uart_port *port)
{
{
struct
uart_8250_port
*
up
=
(
struct
uart_8250_port
*
)
port
;
struct
uart_8250_port
*
up
=
(
struct
uart_8250_port
*
)
port
;
unsigned
long
flags
;
unsigned
long
flags
;
unsigned
char
lsr
,
iir
;
int
retval
;
int
retval
;
up
->
capabilities
=
uart_config
[
up
->
port
.
type
].
flags
;
up
->
capabilities
=
uart_config
[
up
->
port
.
type
].
flags
;
...
@@ -1536,6 +1553,26 @@ static int serial8250_startup(struct uart_port *port)
...
@@ -1536,6 +1553,26 @@ static int serial8250_startup(struct uart_port *port)
up
->
port
.
mctrl
|=
TIOCM_OUT2
;
up
->
port
.
mctrl
|=
TIOCM_OUT2
;
serial8250_set_mctrl
(
&
up
->
port
,
up
->
port
.
mctrl
);
serial8250_set_mctrl
(
&
up
->
port
,
up
->
port
.
mctrl
);
/*
* Do a quick test to see if we receive an
* interrupt when we enable the TX irq.
*/
serial_outp
(
up
,
UART_IER
,
UART_IER_THRI
);
lsr
=
serial_in
(
up
,
UART_LSR
);
iir
=
serial_in
(
up
,
UART_IIR
);
serial_outp
(
up
,
UART_IER
,
0
);
if
(
lsr
&
UART_LSR_TEMT
&&
iir
&
UART_IIR_NO_INT
)
{
if
(
!
(
up
->
bugs
&
UART_BUG_TXEN
))
{
up
->
bugs
|=
UART_BUG_TXEN
;
pr_debug
(
"ttyS%d - enabling bad tx status workarounds
\n
"
,
port
->
line
);
}
}
else
{
up
->
bugs
&=
~
UART_BUG_TXEN
;
}
spin_unlock_irqrestore
(
&
up
->
port
.
lock
,
flags
);
spin_unlock_irqrestore
(
&
up
->
port
.
lock
,
flags
);
/*
/*
...
@@ -1677,12 +1714,9 @@ serial8250_set_termios(struct uart_port *port, struct termios *termios,
...
@@ -1677,12 +1714,9 @@ serial8250_set_termios(struct uart_port *port, struct termios *termios,
quot
=
serial8250_get_divisor
(
port
,
baud
);
quot
=
serial8250_get_divisor
(
port
,
baud
);
/*
/*
* Work around a bug in the Oxford Semiconductor 952 rev B
* Oxford Semi 952 rev B workaround
* chip which causes it to seriously miscalculate baud rates
* when DLL is 0.
*/
*/
if
((
quot
&
0xff
)
==
0
&&
up
->
port
.
type
==
PORT_16C950
&&
if
(
up
->
bugs
&
UART_BUG_QUOT
&&
(
quot
&
0xff
)
==
0
)
up
->
rev
==
0x5201
)
quot
++
;
quot
++
;
if
(
up
->
capabilities
&
UART_CAP_FIFO
&&
up
->
port
.
fifosize
>
1
)
{
if
(
up
->
capabilities
&
UART_CAP_FIFO
&&
up
->
port
.
fifosize
>
1
)
{
...
...
drivers/serial/8250.h
View file @
f46f6b20
...
@@ -51,6 +51,9 @@ struct serial8250_config {
...
@@ -51,6 +51,9 @@ struct serial8250_config {
#define UART_CAP_AFE (1 << 11)
/* MCR-based hw flow control */
#define UART_CAP_AFE (1 << 11)
/* MCR-based hw flow control */
#define UART_CAP_UUE (1 << 12)
/* UART needs IER bit 6 set (Xscale) */
#define UART_CAP_UUE (1 << 12)
/* UART needs IER bit 6 set (Xscale) */
#define UART_BUG_QUOT (1 << 0)
/* UART has buggy quot LSB */
#define UART_BUG_TXEN (1 << 1)
/* UART has buggy TX IIR status */
#if defined(__i386__) && (defined(CONFIG_M386) || defined(CONFIG_M486))
#if defined(__i386__) && (defined(CONFIG_M386) || defined(CONFIG_M486))
#define _INLINE_ inline
#define _INLINE_ inline
#else
#else
...
...
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