Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
915ab177
K
Kernel
项目概览
openeuler
/
Kernel
1 年多 前同步成功
通知
8
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看板
提交
915ab177
编写于
12年前
作者:
P
Paul Mundt
浏览文件
操作
浏览文件
下载
差异文件
Merge branches 'sh/urgent', 'sh/vsyscall' and 'common/serial-rework' into sh-latest
上级
87c34ed3
cd34e202
b12bb29f
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
131 addition
and
102 deletion
+131
-102
arch/sh/kernel/vsyscall/vsyscall-sigreturn.S
arch/sh/kernel/vsyscall/vsyscall-sigreturn.S
+35
-0
arch/sh/kernel/vsyscall/vsyscall-trapa.S
arch/sh/kernel/vsyscall/vsyscall-trapa.S
+10
-13
drivers/tty/serial/sh-sci.c
drivers/tty/serial/sh-sci.c
+82
-85
drivers/tty/serial/sh-sci.h
drivers/tty/serial/sh-sci.h
+4
-4
未找到文件。
arch/sh/kernel/vsyscall/vsyscall-sigreturn.S
浏览文件 @
915ab177
...
...
@@ -34,6 +34,41 @@ __kernel_rt_sigreturn:
1
:
.
short
__NR_rt_sigreturn
.
LEND_rt_sigreturn
:
.
size
__kernel_rt_sigreturn
,
.
-
.
LSTART_rt_sigreturn
.
previous
.
section
.
eh_frame
,
"a"
,
@
progbits
.
LCIE1
:
.
ualong
.
LCIE1_end
-
.
LCIE1_start
.
LCIE1_start
:
.
ualong
0
/*
CIE
ID
*/
.
byte
0x1
/*
Version
number
*/
.
string
"zRS"
/*
NUL
-
terminated
augmentation
string
*/
.
uleb128
0x1
/*
Code
alignment
factor
*/
.
sleb128
-
4
/*
Data
alignment
factor
*/
.
byte
0x11
/*
Return
address
register
column
*/
.
uleb128
0x1
/*
Augmentation
length
and
data
*/
.
byte
0x1b
/*
DW_EH_PE_pcrel
|
DW_EH_PE_sdata4
.
*/
.
byte
0xc
,
0xf
,
0x0
/*
DW_CFA_def_cfa
:
r15
ofs
0
*/
.
align
2
.
LCIE1_end
:
.
ualong
.
LFDE0_end
-
.
LFDE0_start
/*
Length
FDE0
*/
.
LFDE0_start
:
.
ualong
.
LFDE0_start
-
.
LCIE1
/*
CIE
pointer
*/
.
ualong
.
LSTART_sigreturn
-
.
/*
PC
-
relative
start
address
*/
.
ualong
.
LEND_sigreturn
-
.
LSTART_sigreturn
.
uleb128
0
/*
Augmentation
*/
.
align
2
.
LFDE0_end
:
.
ualong
.
LFDE1_end
-
.
LFDE1_start
/*
Length
FDE1
*/
.
LFDE1_start
:
.
ualong
.
LFDE1_start
-
.
LCIE1
/*
CIE
pointer
*/
.
ualong
.
LSTART_rt_sigreturn
-
.
/*
PC
-
relative
start
address
*/
.
ualong
.
LEND_rt_sigreturn
-
.
LSTART_rt_sigreturn
.
uleb128
0
/*
Augmentation
*/
.
align
2
.
LFDE1_end
:
.
previous
This diff is collapsed.
Click to expand it.
arch/sh/kernel/vsyscall/vsyscall-trapa.S
浏览文件 @
915ab177
...
...
@@ -3,37 +3,34 @@
.
type
__kernel_vsyscall
,
@
function
__kernel_vsyscall
:
.
LSTART_vsyscall
:
/
*
XXX
:
We
'll have to do something here once we opt to use the vDSO
*
page
for
something
other
than
the
signal
trampoline
..
as
well
as
*
fill
out
.
eh_frame
--
PFM
.
*/
trapa
#
0x10
nop
.
LEND_vsyscall
:
.
size
__kernel_vsyscall
,
.
-
.
LSTART_vsyscall
.
previous
.
section
.
eh_frame
,
"a"
,
@
progbits
.
previous
.
LCIE
:
.
ualong
.
LCIE_end
-
.
LCIE_start
.
LCIE_start
:
.
ualong
0
/*
CIE
ID
*/
.
byte
0x1
/*
Version
number
*/
.
string
"zR
S
"
/*
NUL
-
terminated
augmentation
string
*/
.
string
"zR"
/*
NUL
-
terminated
augmentation
string
*/
.
uleb128
0x1
/*
Code
alignment
factor
*/
.
sleb128
-
4
/*
Data
alignment
factor
*/
.
byte
0x11
/*
Return
address
register
column
*/
/
*
Augmentation
length
and
data
(
none
)
*/
.
byte
0xc
/*
DW_CFA_def_cfa
*/
.
uleb128
0xf
/*
r15
*/
.
uleb128
0x0
/*
offset
0
*/
.
uleb128
0x1
/*
Augmentation
length
and
data
*/
.
byte
0x1b
/*
DW_EH_PE_pcrel
|
DW_EH_PE_sdata4
.
*/
.
byte
0xc
,
0xf
,
0x0
/*
DW_CFA_def_cfa
:
r15
ofs
0
*/
.
align
2
.
LCIE_end
:
.
ualong
.
LFDE_end
-
.
LFDE_start
/*
Length
FDE
*/
.
LFDE_start
:
.
ualong
.
L
CIE
/*
CIE
pointer
*/
.
ualong
.
LSTART_vsyscall
-
.
/*
start
address
*/
.
ualong
.
L
FDE_start
-
.
LCIE
/*
CIE
pointer
*/
.
ualong
.
LSTART_vsyscall
-
.
/*
PC
-
relative
start
address
*/
.
ualong
.
LEND_vsyscall
-
.
LSTART_vsyscall
.
uleb128
0
.
uleb128
0
/*
Augmentation
*/
.
align
2
.
LFDE_end
:
.
previous
...
...
This diff is collapsed.
Click to expand it.
drivers/tty/serial/sh-sci.c
浏览文件 @
915ab177
...
...
@@ -355,9 +355,6 @@ static void sci_serial_out(struct uart_port *p, int offset, int value)
WARN
(
1
,
"Invalid register access
\n
"
);
}
#define sci_in(up, offset) (up->serial_in(up, offset))
#define sci_out(up, offset, value) (up->serial_out(up, offset, value))
static
int
sci_probe_regmap
(
struct
plat_sci_port
*
cfg
)
{
switch
(
cfg
->
type
)
{
...
...
@@ -422,9 +419,9 @@ static int sci_poll_get_char(struct uart_port *port)
int
c
;
do
{
status
=
s
ci
_in
(
port
,
SCxSR
);
status
=
s
erial_port
_in
(
port
,
SCxSR
);
if
(
status
&
SCxSR_ERRORS
(
port
))
{
s
ci
_out
(
port
,
SCxSR
,
SCxSR_ERROR_CLEAR
(
port
));
s
erial_port
_out
(
port
,
SCxSR
,
SCxSR_ERROR_CLEAR
(
port
));
continue
;
}
break
;
...
...
@@ -433,11 +430,11 @@ static int sci_poll_get_char(struct uart_port *port)
if
(
!
(
status
&
SCxSR_RDxF
(
port
)))
return
NO_POLL_CHAR
;
c
=
s
ci
_in
(
port
,
SCxRDR
);
c
=
s
erial_port
_in
(
port
,
SCxRDR
);
/* Dummy read */
s
ci
_in
(
port
,
SCxSR
);
s
ci
_out
(
port
,
SCxSR
,
SCxSR_RDxF_CLEAR
(
port
));
s
erial_port
_in
(
port
,
SCxSR
);
s
erial_port
_out
(
port
,
SCxSR
,
SCxSR_RDxF_CLEAR
(
port
));
return
c
;
}
...
...
@@ -448,11 +445,11 @@ static void sci_poll_put_char(struct uart_port *port, unsigned char c)
unsigned
short
status
;
do
{
status
=
s
ci
_in
(
port
,
SCxSR
);
status
=
s
erial_port
_in
(
port
,
SCxSR
);
}
while
(
!
(
status
&
SCxSR_TDxE
(
port
)));
s
ci
_out
(
port
,
SCxTDR
,
c
);
s
ci
_out
(
port
,
SCxSR
,
SCxSR_TDxE_CLEAR
(
port
)
&
~
SCxSR_TEND
(
port
));
s
erial_port
_out
(
port
,
SCxTDR
,
c
);
s
erial_port
_out
(
port
,
SCxSR
,
SCxSR_TDxE_CLEAR
(
port
)
&
~
SCxSR_TEND
(
port
));
}
#endif
/* CONFIG_CONSOLE_POLL || CONFIG_SERIAL_SH_SCI_CONSOLE */
...
...
@@ -480,10 +477,10 @@ static void sci_init_pins(struct uart_port *port, unsigned int cflag)
((
!
(
cflag
&
CRTSCTS
))))
{
unsigned
short
status
;
status
=
s
ci
_in
(
port
,
SCSPTR
);
status
=
s
erial_port
_in
(
port
,
SCSPTR
);
status
&=
~
SCSPTR_CTSIO
;
status
|=
SCSPTR_RTSIO
;
s
ci
_out
(
port
,
SCSPTR
,
status
);
/* Set RTS = 1 */
s
erial_port
_out
(
port
,
SCSPTR
,
status
);
/* Set RTS = 1 */
}
}
...
...
@@ -493,13 +490,13 @@ static int sci_txfill(struct uart_port *port)
reg
=
sci_getreg
(
port
,
SCTFDR
);
if
(
reg
->
size
)
return
s
ci
_in
(
port
,
SCTFDR
)
&
0xff
;
return
s
erial_port
_in
(
port
,
SCTFDR
)
&
0xff
;
reg
=
sci_getreg
(
port
,
SCFDR
);
if
(
reg
->
size
)
return
s
ci
_in
(
port
,
SCFDR
)
>>
8
;
return
s
erial_port
_in
(
port
,
SCFDR
)
>>
8
;
return
!
(
s
ci
_in
(
port
,
SCxSR
)
&
SCI_TDRE
);
return
!
(
s
erial_port
_in
(
port
,
SCxSR
)
&
SCI_TDRE
);
}
static
int
sci_txroom
(
struct
uart_port
*
port
)
...
...
@@ -513,13 +510,13 @@ static int sci_rxfill(struct uart_port *port)
reg
=
sci_getreg
(
port
,
SCRFDR
);
if
(
reg
->
size
)
return
s
ci
_in
(
port
,
SCRFDR
)
&
0xff
;
return
s
erial_port
_in
(
port
,
SCRFDR
)
&
0xff
;
reg
=
sci_getreg
(
port
,
SCFDR
);
if
(
reg
->
size
)
return
s
ci
_in
(
port
,
SCFDR
)
&
((
port
->
fifosize
<<
1
)
-
1
);
return
s
erial_port
_in
(
port
,
SCFDR
)
&
((
port
->
fifosize
<<
1
)
-
1
);
return
(
s
ci
_in
(
port
,
SCxSR
)
&
SCxSR_RDxF
(
port
))
!=
0
;
return
(
s
erial_port
_in
(
port
,
SCxSR
)
&
SCxSR_RDxF
(
port
))
!=
0
;
}
/*
...
...
@@ -547,14 +544,14 @@ static void sci_transmit_chars(struct uart_port *port)
unsigned
short
ctrl
;
int
count
;
status
=
s
ci
_in
(
port
,
SCxSR
);
status
=
s
erial_port
_in
(
port
,
SCxSR
);
if
(
!
(
status
&
SCxSR_TDxE
(
port
)))
{
ctrl
=
s
ci
_in
(
port
,
SCSCR
);
ctrl
=
s
erial_port
_in
(
port
,
SCSCR
);
if
(
uart_circ_empty
(
xmit
))
ctrl
&=
~
SCSCR_TIE
;
else
ctrl
|=
SCSCR_TIE
;
s
ci
_out
(
port
,
SCSCR
,
ctrl
);
s
erial_port
_out
(
port
,
SCSCR
,
ctrl
);
return
;
}
...
...
@@ -573,27 +570,27 @@ static void sci_transmit_chars(struct uart_port *port)
break
;
}
s
ci
_out
(
port
,
SCxTDR
,
c
);
s
erial_port
_out
(
port
,
SCxTDR
,
c
);
port
->
icount
.
tx
++
;
}
while
(
--
count
>
0
);
s
ci
_out
(
port
,
SCxSR
,
SCxSR_TDxE_CLEAR
(
port
));
s
erial_port
_out
(
port
,
SCxSR
,
SCxSR_TDxE_CLEAR
(
port
));
if
(
uart_circ_chars_pending
(
xmit
)
<
WAKEUP_CHARS
)
uart_write_wakeup
(
port
);
if
(
uart_circ_empty
(
xmit
))
{
sci_stop_tx
(
port
);
}
else
{
ctrl
=
s
ci
_in
(
port
,
SCSCR
);
ctrl
=
s
erial_port
_in
(
port
,
SCSCR
);
if
(
port
->
type
!=
PORT_SCI
)
{
s
ci
_in
(
port
,
SCxSR
);
/* Dummy read */
s
ci
_out
(
port
,
SCxSR
,
SCxSR_TDxE_CLEAR
(
port
));
s
erial_port
_in
(
port
,
SCxSR
);
/* Dummy read */
s
erial_port
_out
(
port
,
SCxSR
,
SCxSR_TDxE_CLEAR
(
port
));
}
ctrl
|=
SCSCR_TIE
;
s
ci
_out
(
port
,
SCSCR
,
ctrl
);
s
erial_port
_out
(
port
,
SCSCR
,
ctrl
);
}
}
...
...
@@ -608,7 +605,7 @@ static void sci_receive_chars(struct uart_port *port)
unsigned
short
status
;
unsigned
char
flag
;
status
=
s
ci
_in
(
port
,
SCxSR
);
status
=
s
erial_port
_in
(
port
,
SCxSR
);
if
(
!
(
status
&
SCxSR_RDxF
(
port
)))
return
;
...
...
@@ -621,7 +618,7 @@ static void sci_receive_chars(struct uart_port *port)
break
;
if
(
port
->
type
==
PORT_SCI
)
{
char
c
=
s
ci
_in
(
port
,
SCxRDR
);
char
c
=
s
erial_port
_in
(
port
,
SCxRDR
);
if
(
uart_handle_sysrq_char
(
port
,
c
)
||
sci_port
->
break_flag
)
count
=
0
;
...
...
@@ -629,9 +626,9 @@ static void sci_receive_chars(struct uart_port *port)
tty_insert_flip_char
(
tty
,
c
,
TTY_NORMAL
);
}
else
{
for
(
i
=
0
;
i
<
count
;
i
++
)
{
char
c
=
s
ci
_in
(
port
,
SCxRDR
);
char
c
=
s
erial_port
_in
(
port
,
SCxRDR
);
status
=
s
ci
_in
(
port
,
SCxSR
);
status
=
s
erial_port
_in
(
port
,
SCxSR
);
#if defined(CONFIG_CPU_SH3)
/* Skip "chars" during break */
if
(
sci_port
->
break_flag
)
{
...
...
@@ -672,8 +669,8 @@ static void sci_receive_chars(struct uart_port *port)
}
}
s
ci
_in
(
port
,
SCxSR
);
/* dummy read */
s
ci
_out
(
port
,
SCxSR
,
SCxSR_RDxF_CLEAR
(
port
));
s
erial_port
_in
(
port
,
SCxSR
);
/* dummy read */
s
erial_port
_out
(
port
,
SCxSR
,
SCxSR_RDxF_CLEAR
(
port
));
copied
+=
count
;
port
->
icount
.
rx
+=
count
;
...
...
@@ -683,8 +680,8 @@ static void sci_receive_chars(struct uart_port *port)
/* Tell the rest of the system the news. New characters! */
tty_flip_buffer_push
(
tty
);
}
else
{
s
ci
_in
(
port
,
SCxSR
);
/* dummy read */
s
ci
_out
(
port
,
SCxSR
,
SCxSR_RDxF_CLEAR
(
port
));
s
erial_port
_in
(
port
,
SCxSR
);
/* dummy read */
s
erial_port
_out
(
port
,
SCxSR
,
SCxSR_RDxF_CLEAR
(
port
));
}
}
...
...
@@ -726,7 +723,7 @@ static void sci_break_timer(unsigned long data)
static
int
sci_handle_errors
(
struct
uart_port
*
port
)
{
int
copied
=
0
;
unsigned
short
status
=
s
ci
_in
(
port
,
SCxSR
);
unsigned
short
status
=
s
erial_port
_in
(
port
,
SCxSR
);
struct
tty_struct
*
tty
=
port
->
state
->
port
.
tty
;
struct
sci_port
*
s
=
to_sci_port
(
port
);
...
...
@@ -804,8 +801,8 @@ static int sci_handle_fifo_overrun(struct uart_port *port)
if
(
!
reg
->
size
)
return
0
;
if
((
s
ci
_in
(
port
,
SCLSR
)
&
(
1
<<
s
->
cfg
->
overrun_bit
)))
{
s
ci
_out
(
port
,
SCLSR
,
0
);
if
((
s
erial_port
_in
(
port
,
SCLSR
)
&
(
1
<<
s
->
cfg
->
overrun_bit
)))
{
s
erial_port
_out
(
port
,
SCLSR
,
0
);
port
->
icount
.
overrun
++
;
...
...
@@ -822,7 +819,7 @@ static int sci_handle_fifo_overrun(struct uart_port *port)
static
int
sci_handle_breaks
(
struct
uart_port
*
port
)
{
int
copied
=
0
;
unsigned
short
status
=
s
ci
_in
(
port
,
SCxSR
);
unsigned
short
status
=
s
erial_port
_in
(
port
,
SCxSR
);
struct
tty_struct
*
tty
=
port
->
state
->
port
.
tty
;
struct
sci_port
*
s
=
to_sci_port
(
port
);
...
...
@@ -859,8 +856,8 @@ static irqreturn_t sci_rx_interrupt(int irq, void *ptr)
struct
sci_port
*
s
=
to_sci_port
(
port
);
if
(
s
->
chan_rx
)
{
u16
scr
=
s
ci
_in
(
port
,
SCSCR
);
u16
ssr
=
s
ci
_in
(
port
,
SCxSR
);
u16
scr
=
s
erial_port
_in
(
port
,
SCSCR
);
u16
ssr
=
s
erial_port
_in
(
port
,
SCxSR
);
/* Disable future Rx interrupts */
if
(
port
->
type
==
PORT_SCIFA
||
port
->
type
==
PORT_SCIFB
)
{
...
...
@@ -869,9 +866,9 @@ static irqreturn_t sci_rx_interrupt(int irq, void *ptr)
}
else
{
scr
&=
~
SCSCR_RIE
;
}
s
ci
_out
(
port
,
SCSCR
,
scr
);
s
erial_port
_out
(
port
,
SCSCR
,
scr
);
/* Clear current interrupt */
s
ci
_out
(
port
,
SCxSR
,
ssr
&
~
(
1
|
SCxSR_RDxF
(
port
)));
s
erial_port
_out
(
port
,
SCxSR
,
ssr
&
~
(
1
|
SCxSR_RDxF
(
port
)));
dev_dbg
(
port
->
dev
,
"Rx IRQ %lu: setup t-out in %u jiffies
\n
"
,
jiffies
,
s
->
rx_timeout
);
mod_timer
(
&
s
->
rx_timer
,
jiffies
+
s
->
rx_timeout
);
...
...
@@ -909,15 +906,15 @@ static irqreturn_t sci_er_interrupt(int irq, void *ptr)
if
(
port
->
type
==
PORT_SCI
)
{
if
(
sci_handle_errors
(
port
))
{
/* discard character in rx buffer */
s
ci
_in
(
port
,
SCxSR
);
s
ci
_out
(
port
,
SCxSR
,
SCxSR_RDxF_CLEAR
(
port
));
s
erial_port
_in
(
port
,
SCxSR
);
s
erial_port
_out
(
port
,
SCxSR
,
SCxSR_RDxF_CLEAR
(
port
));
}
}
else
{
sci_handle_fifo_overrun
(
port
);
sci_rx_interrupt
(
irq
,
ptr
);
}
s
ci
_out
(
port
,
SCxSR
,
SCxSR_ERROR_CLEAR
(
port
));
s
erial_port
_out
(
port
,
SCxSR
,
SCxSR_ERROR_CLEAR
(
port
));
/* Kick the transmission */
sci_tx_interrupt
(
irq
,
ptr
);
...
...
@@ -931,7 +928,7 @@ static irqreturn_t sci_br_interrupt(int irq, void *ptr)
/* Handle BREAKs */
sci_handle_breaks
(
port
);
s
ci
_out
(
port
,
SCxSR
,
SCxSR_BREAK_CLEAR
(
port
));
s
erial_port
_out
(
port
,
SCxSR
,
SCxSR_BREAK_CLEAR
(
port
));
return
IRQ_HANDLED
;
}
...
...
@@ -955,8 +952,8 @@ static irqreturn_t sci_mpxed_interrupt(int irq, void *ptr)
struct
sci_port
*
s
=
to_sci_port
(
port
);
irqreturn_t
ret
=
IRQ_NONE
;
ssr_status
=
s
ci
_in
(
port
,
SCxSR
);
scr_status
=
s
ci
_in
(
port
,
SCSCR
);
ssr_status
=
s
erial_port
_in
(
port
,
SCxSR
);
scr_status
=
s
erial_port
_in
(
port
,
SCSCR
);
err_enabled
=
scr_status
&
port_rx_irq_mask
(
port
);
/* Tx Interrupt */
...
...
@@ -1170,7 +1167,7 @@ static void sci_free_gpios(struct sci_port *port)
static
unsigned
int
sci_tx_empty
(
struct
uart_port
*
port
)
{
unsigned
short
status
=
s
ci
_in
(
port
,
SCxSR
);
unsigned
short
status
=
s
erial_port
_in
(
port
,
SCxSR
);
unsigned
short
in_tx_fifo
=
sci_txfill
(
port
);
return
(
status
&
SCxSR_TEND
(
port
))
&&
!
in_tx_fifo
?
TIOCSER_TEMT
:
0
;
...
...
@@ -1198,7 +1195,7 @@ static void sci_set_mctrl(struct uart_port *port, unsigned int mctrl)
*/
reg
=
sci_getreg
(
port
,
SCFCR
);
if
(
reg
->
size
)
s
ci_out
(
port
,
SCFCR
,
sci
_in
(
port
,
SCFCR
)
|
1
);
s
erial_port_out
(
port
,
SCFCR
,
serial_port
_in
(
port
,
SCFCR
)
|
1
);
}
}
...
...
@@ -1240,8 +1237,8 @@ static void sci_dma_tx_complete(void *arg)
}
else
{
s
->
cookie_tx
=
-
EINVAL
;
if
(
port
->
type
==
PORT_SCIFA
||
port
->
type
==
PORT_SCIFB
)
{
u16
ctrl
=
s
ci
_in
(
port
,
SCSCR
);
s
ci
_out
(
port
,
SCSCR
,
ctrl
&
~
SCSCR_TIE
);
u16
ctrl
=
s
erial_port
_in
(
port
,
SCSCR
);
s
erial_port
_out
(
port
,
SCSCR
,
ctrl
&
~
SCSCR_TIE
);
}
}
...
...
@@ -1494,13 +1491,13 @@ static void sci_start_tx(struct uart_port *port)
#ifdef CONFIG_SERIAL_SH_SCI_DMA
if
(
port
->
type
==
PORT_SCIFA
||
port
->
type
==
PORT_SCIFB
)
{
u16
new
,
scr
=
s
ci
_in
(
port
,
SCSCR
);
u16
new
,
scr
=
s
erial_port
_in
(
port
,
SCSCR
);
if
(
s
->
chan_tx
)
new
=
scr
|
0x8000
;
else
new
=
scr
&
~
0x8000
;
if
(
new
!=
scr
)
s
ci
_out
(
port
,
SCSCR
,
new
);
s
erial_port
_out
(
port
,
SCSCR
,
new
);
}
if
(
s
->
chan_tx
&&
!
uart_circ_empty
(
&
s
->
port
.
state
->
xmit
)
&&
...
...
@@ -1512,8 +1509,8 @@ static void sci_start_tx(struct uart_port *port)
if
(
!
s
->
chan_tx
||
port
->
type
==
PORT_SCIFA
||
port
->
type
==
PORT_SCIFB
)
{
/* Set TIE (Transmit Interrupt Enable) bit in SCSCR */
ctrl
=
s
ci
_in
(
port
,
SCSCR
);
s
ci
_out
(
port
,
SCSCR
,
ctrl
|
SCSCR_TIE
);
ctrl
=
s
erial_port
_in
(
port
,
SCSCR
);
s
erial_port
_out
(
port
,
SCSCR
,
ctrl
|
SCSCR_TIE
);
}
}
...
...
@@ -1522,40 +1519,40 @@ static void sci_stop_tx(struct uart_port *port)
unsigned
short
ctrl
;
/* Clear TIE (Transmit Interrupt Enable) bit in SCSCR */
ctrl
=
s
ci
_in
(
port
,
SCSCR
);
ctrl
=
s
erial_port
_in
(
port
,
SCSCR
);
if
(
port
->
type
==
PORT_SCIFA
||
port
->
type
==
PORT_SCIFB
)
ctrl
&=
~
0x8000
;
ctrl
&=
~
SCSCR_TIE
;
s
ci
_out
(
port
,
SCSCR
,
ctrl
);
s
erial_port
_out
(
port
,
SCSCR
,
ctrl
);
}
static
void
sci_start_rx
(
struct
uart_port
*
port
)
{
unsigned
short
ctrl
;
ctrl
=
s
ci
_in
(
port
,
SCSCR
)
|
port_rx_irq_mask
(
port
);
ctrl
=
s
erial_port
_in
(
port
,
SCSCR
)
|
port_rx_irq_mask
(
port
);
if
(
port
->
type
==
PORT_SCIFA
||
port
->
type
==
PORT_SCIFB
)
ctrl
&=
~
0x4000
;
s
ci
_out
(
port
,
SCSCR
,
ctrl
);
s
erial_port
_out
(
port
,
SCSCR
,
ctrl
);
}
static
void
sci_stop_rx
(
struct
uart_port
*
port
)
{
unsigned
short
ctrl
;
ctrl
=
s
ci
_in
(
port
,
SCSCR
);
ctrl
=
s
erial_port
_in
(
port
,
SCSCR
);
if
(
port
->
type
==
PORT_SCIFA
||
port
->
type
==
PORT_SCIFB
)
ctrl
&=
~
0x4000
;
ctrl
&=
~
port_rx_irq_mask
(
port
);
s
ci
_out
(
port
,
SCSCR
,
ctrl
);
s
erial_port
_out
(
port
,
SCSCR
,
ctrl
);
}
static
void
sci_enable_ms
(
struct
uart_port
*
port
)
...
...
@@ -1589,13 +1586,13 @@ static void rx_timer_fn(unsigned long arg)
{
struct
sci_port
*
s
=
(
struct
sci_port
*
)
arg
;
struct
uart_port
*
port
=
&
s
->
port
;
u16
scr
=
s
ci
_in
(
port
,
SCSCR
);
u16
scr
=
s
erial_port
_in
(
port
,
SCSCR
);
if
(
port
->
type
==
PORT_SCIFA
||
port
->
type
==
PORT_SCIFB
)
{
scr
&=
~
0x4000
;
enable_irq
(
s
->
cfg
->
irqs
[
1
]);
}
s
ci
_out
(
port
,
SCSCR
,
scr
|
SCSCR_RIE
);
s
erial_port
_out
(
port
,
SCSCR
,
scr
|
SCSCR_RIE
);
dev_dbg
(
port
->
dev
,
"DMA Rx timed out
\n
"
);
schedule_work
(
&
s
->
work_rx
);
}
...
...
@@ -1776,14 +1773,14 @@ static void sci_reset(struct uart_port *port)
unsigned
int
status
;
do
{
status
=
s
ci
_in
(
port
,
SCxSR
);
status
=
s
erial_port
_in
(
port
,
SCxSR
);
}
while
(
!
(
status
&
SCxSR_TEND
(
port
)));
s
ci
_out
(
port
,
SCSCR
,
0x00
);
/* TE=0, RE=0, CKE1=0 */
s
erial_port
_out
(
port
,
SCSCR
,
0x00
);
/* TE=0, RE=0, CKE1=0 */
reg
=
sci_getreg
(
port
,
SCFCR
);
if
(
reg
->
size
)
s
ci
_out
(
port
,
SCFCR
,
SCFCR_RFRST
|
SCFCR_TFRST
);
s
erial_port
_out
(
port
,
SCFCR
,
SCFCR_RFRST
|
SCFCR_TFRST
);
}
static
void
sci_set_termios
(
struct
uart_port
*
port
,
struct
ktermios
*
termios
,
...
...
@@ -1812,7 +1809,7 @@ static void sci_set_termios(struct uart_port *port, struct ktermios *termios,
sci_reset
(
port
);
smr_val
=
s
ci
_in
(
port
,
SCSMR
)
&
3
;
smr_val
=
s
erial_port
_in
(
port
,
SCSMR
)
&
3
;
if
((
termios
->
c_cflag
&
CSIZE
)
==
CS7
)
smr_val
|=
0x40
;
...
...
@@ -1825,19 +1822,19 @@ static void sci_set_termios(struct uart_port *port, struct ktermios *termios,
uart_update_timeout
(
port
,
termios
->
c_cflag
,
baud
);
s
ci
_out
(
port
,
SCSMR
,
smr_val
);
s
erial_port
_out
(
port
,
SCSMR
,
smr_val
);
dev_dbg
(
port
->
dev
,
"%s: SMR %x, t %x, SCSCR %x
\n
"
,
__func__
,
smr_val
,
t
,
s
->
cfg
->
scscr
);
if
(
t
>
0
)
{
if
(
t
>=
256
)
{
s
ci_out
(
port
,
SCSMR
,
(
sci
_in
(
port
,
SCSMR
)
&
~
3
)
|
1
);
s
erial_port_out
(
port
,
SCSMR
,
(
serial_port
_in
(
port
,
SCSMR
)
&
~
3
)
|
1
);
t
>>=
2
;
}
else
s
ci_out
(
port
,
SCSMR
,
sci
_in
(
port
,
SCSMR
)
&
~
3
);
s
erial_port_out
(
port
,
SCSMR
,
serial_port
_in
(
port
,
SCSMR
)
&
~
3
);
s
ci
_out
(
port
,
SCBRR
,
t
);
s
erial_port
_out
(
port
,
SCBRR
,
t
);
udelay
((
1000000
+
(
baud
-
1
))
/
baud
);
/* Wait one bit interval */
}
...
...
@@ -1845,7 +1842,7 @@ static void sci_set_termios(struct uart_port *port, struct ktermios *termios,
reg
=
sci_getreg
(
port
,
SCFCR
);
if
(
reg
->
size
)
{
unsigned
short
ctrl
=
s
ci
_in
(
port
,
SCFCR
);
unsigned
short
ctrl
=
s
erial_port
_in
(
port
,
SCFCR
);
if
(
s
->
cfg
->
capabilities
&
SCIx_HAVE_RTSCTS
)
{
if
(
termios
->
c_cflag
&
CRTSCTS
)
...
...
@@ -1861,10 +1858,10 @@ static void sci_set_termios(struct uart_port *port, struct ktermios *termios,
*/
ctrl
&=
~
(
SCFCR_RFRST
|
SCFCR_TFRST
);
s
ci
_out
(
port
,
SCFCR
,
ctrl
);
s
erial_port
_out
(
port
,
SCFCR
,
ctrl
);
}
s
ci
_out
(
port
,
SCSCR
,
s
->
cfg
->
scscr
);
s
erial_port
_out
(
port
,
SCSCR
,
s
->
cfg
->
scscr
);
#ifdef CONFIG_SERIAL_SH_SCI_DMA
/*
...
...
@@ -2166,7 +2163,7 @@ static void serial_console_write(struct console *co, const char *s,
/* wait until fifo is empty and last bit has been transmitted */
bits
=
SCxSR_TDxE
(
port
)
|
SCxSR_TEND
(
port
);
while
((
s
ci
_in
(
port
,
SCxSR
)
&
bits
)
!=
bits
)
while
((
s
erial_port
_in
(
port
,
SCxSR
)
&
bits
)
!=
bits
)
cpu_relax
();
sci_port_disable
(
sci_port
);
...
...
@@ -2260,12 +2257,12 @@ static int sci_runtime_suspend(struct device *dev)
if
(
uart_console
(
port
))
{
struct
plat_sci_reg
*
reg
;
sci_port
->
saved_smr
=
s
ci
_in
(
port
,
SCSMR
);
sci_port
->
saved_brr
=
s
ci
_in
(
port
,
SCBRR
);
sci_port
->
saved_smr
=
s
erial_port
_in
(
port
,
SCSMR
);
sci_port
->
saved_brr
=
s
erial_port
_in
(
port
,
SCBRR
);
reg
=
sci_getreg
(
port
,
SCFCR
);
if
(
reg
->
size
)
sci_port
->
saved_fcr
=
s
ci
_in
(
port
,
SCFCR
);
sci_port
->
saved_fcr
=
s
erial_port
_in
(
port
,
SCFCR
);
else
sci_port
->
saved_fcr
=
0
;
}
...
...
@@ -2279,13 +2276,13 @@ static int sci_runtime_resume(struct device *dev)
if
(
uart_console
(
port
))
{
sci_reset
(
port
);
s
ci
_out
(
port
,
SCSMR
,
sci_port
->
saved_smr
);
s
ci
_out
(
port
,
SCBRR
,
sci_port
->
saved_brr
);
s
erial_port
_out
(
port
,
SCSMR
,
sci_port
->
saved_smr
);
s
erial_port
_out
(
port
,
SCBRR
,
sci_port
->
saved_brr
);
if
(
sci_port
->
saved_fcr
)
s
ci
_out
(
port
,
SCFCR
,
sci_port
->
saved_fcr
);
s
erial_port
_out
(
port
,
SCFCR
,
sci_port
->
saved_fcr
);
s
ci
_out
(
port
,
SCSCR
,
sci_port
->
cfg
->
scscr
);
s
erial_port
_out
(
port
,
SCSCR
,
sci_port
->
cfg
->
scscr
);
}
return
0
;
}
...
...
This diff is collapsed.
Click to expand it.
drivers/tty/serial/sh-sci.h
浏览文件 @
915ab177
...
...
@@ -20,10 +20,10 @@
defined(CONFIG_ARCH_SH7372) || \
defined(CONFIG_ARCH_R8A7740)
# define SCxSR_RDxF_CLEAR(port) (s
ci
_in(port, SCxSR) & 0xfffc)
# define SCxSR_ERROR_CLEAR(port) (s
ci
_in(port, SCxSR) & 0xfd73)
# define SCxSR_TDxE_CLEAR(port) (s
ci
_in(port, SCxSR) & 0xffdf)
# define SCxSR_BREAK_CLEAR(port) (s
ci
_in(port, SCxSR) & 0xffe3)
# define SCxSR_RDxF_CLEAR(port) (s
erial_port
_in(port, SCxSR) & 0xfffc)
# define SCxSR_ERROR_CLEAR(port) (s
erial_port
_in(port, SCxSR) & 0xfd73)
# define SCxSR_TDxE_CLEAR(port) (s
erial_port
_in(port, SCxSR) & 0xffdf)
# define SCxSR_BREAK_CLEAR(port) (s
erial_port
_in(port, SCxSR) & 0xffe3)
#else
# define SCxSR_RDxF_CLEAR(port) (((port)->type == PORT_SCI) ? 0xbc : 0x00fc)
# define SCxSR_ERROR_CLEAR(port) (((port)->type == PORT_SCI) ? 0xc4 : 0x0073)
...
...
This diff is collapsed.
Click to expand it.
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录
反馈
建议
客服
返回
顶部