Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
f46f6b20
K
Kernel
项目概览
openeuler
/
Kernel
大约 1 年 前同步成功
通知
5
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
f46f6b20
编写于
6月 23, 2005
作者:
L
Linus Torvalds
浏览文件
操作
浏览文件
下载
差异文件
Merge master.kernel.org:/home/rmk/linux-2.6-serial
上级
a8ad86f2
67f7654e
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
47 addition
and
10 deletion
+47
-10
drivers/serial/8250.c
drivers/serial/8250.c
+44
-10
drivers/serial/8250.h
drivers/serial/8250.h
+3
-0
未找到文件。
drivers/serial/8250.c
浏览文件 @
f46f6b20
...
...
@@ -132,9 +132,9 @@ struct uart_8250_port {
struct
uart_port
port
;
struct
timer_list
timer
;
/* "no irq" timer */
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
short
rev
;
unsigned
char
acr
;
unsigned
char
ier
;
unsigned
char
lcr
;
...
...
@@ -560,7 +560,14 @@ static void autoconfig_has_efr(struct uart_8250_port *up)
if
(
id1
==
0x16
&&
id2
==
0xC9
&&
(
id3
==
0x50
||
id3
==
0x52
||
id3
==
0x54
))
{
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
;
}
...
...
@@ -577,8 +584,6 @@ static void autoconfig_has_efr(struct uart_8250_port *up)
id2
=
id1
>>
8
;
if
(
id2
==
0x10
||
id2
==
0x12
||
id2
==
0x14
)
{
if
(
id2
==
0x10
)
up
->
rev
=
id1
&
255
;
up
->
port
.
type
=
PORT_16850
;
return
;
}
...
...
@@ -809,6 +814,7 @@ static void autoconfig(struct uart_8250_port *up, unsigned int probeflags)
// save_flags(flags); cli();
up
->
capabilities
=
0
;
up
->
bugs
=
0
;
if
(
!
(
up
->
port
.
flags
&
UPF_BUGGY_UART
))
{
/*
...
...
@@ -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
)
{
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)
if
(
!
(
up
->
ier
&
UART_IER_THRI
))
{
up
->
ier
|=
UART_IER_THRI
;
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
...
...
@@ -1433,6 +1449,7 @@ static int serial8250_startup(struct uart_port *port)
{
struct
uart_8250_port
*
up
=
(
struct
uart_8250_port
*
)
port
;
unsigned
long
flags
;
unsigned
char
lsr
,
iir
;
int
retval
;
up
->
capabilities
=
uart_config
[
up
->
port
.
type
].
flags
;
...
...
@@ -1536,6 +1553,26 @@ static int serial8250_startup(struct uart_port *port)
up
->
port
.
mctrl
|=
TIOCM_OUT2
;
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
);
/*
...
...
@@ -1677,12 +1714,9 @@ serial8250_set_termios(struct uart_port *port, struct termios *termios,
quot
=
serial8250_get_divisor
(
port
,
baud
);
/*
* Work around a bug in the Oxford Semiconductor 952 rev B
* chip which causes it to seriously miscalculate baud rates
* when DLL is 0.
* Oxford Semi 952 rev B workaround
*/
if
((
quot
&
0xff
)
==
0
&&
up
->
port
.
type
==
PORT_16C950
&&
up
->
rev
==
0x5201
)
if
(
up
->
bugs
&
UART_BUG_QUOT
&&
(
quot
&
0xff
)
==
0
)
quot
++
;
if
(
up
->
capabilities
&
UART_CAP_FIFO
&&
up
->
port
.
fifosize
>
1
)
{
...
...
drivers/serial/8250.h
浏览文件 @
f46f6b20
...
...
@@ -51,6 +51,9 @@ struct serial8250_config {
#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_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))
#define _INLINE_ inline
#else
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录