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
nexedi
linux
Commits
3cbbbd88
Commit
3cbbbd88
authored
Sep 08, 2003
by
Linus Torvalds
Browse files
Options
Browse Files
Download
Plain Diff
Merge
bk://bk.arm.linux.org.uk/linux-2.6-serial
into home.osdl.org:/home/torvalds/v2.5/linux
parents
7a9df5e2
3cd30bf0
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
107 additions
and
103 deletions
+107
-103
drivers/serial/8250.c
drivers/serial/8250.c
+14
-10
drivers/serial/8250.h
drivers/serial/8250.h
+2
-2
drivers/serial/8250_pci.c
drivers/serial/8250_pci.c
+3
-19
drivers/serial/Kconfig
drivers/serial/Kconfig
+26
-6
drivers/serial/Makefile
drivers/serial/Makefile
+2
-2
drivers/serial/clps711x.c
drivers/serial/clps711x.c
+7
-5
drivers/serial/sa1100.c
drivers/serial/sa1100.c
+4
-4
drivers/serial/serial_core.c
drivers/serial/serial_core.c
+41
-53
drivers/serial/serial_cs.c
drivers/serial/serial_cs.c
+0
-0
include/linux/serial_core.h
include/linux/serial_core.h
+8
-2
No files found.
drivers/serial/8250.c
View file @
3cbbbd88
...
@@ -122,6 +122,7 @@ struct uart_8250_port {
...
@@ -122,6 +122,7 @@ 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
rev
;
unsigned
short
rev
;
unsigned
char
acr
;
unsigned
char
acr
;
unsigned
char
ier
;
unsigned
char
ier
;
...
@@ -683,6 +684,7 @@ static void autoconfig(struct uart_8250_port *up, unsigned int probeflags)
...
@@ -683,6 +684,7 @@ static void autoconfig(struct uart_8250_port *up, unsigned int probeflags)
serial_outp
(
up
,
UART_LCR
,
save_lcr
);
serial_outp
(
up
,
UART_LCR
,
save_lcr
);
up
->
port
.
fifosize
=
uart_config
[
up
->
port
.
type
].
dfl_xmit_fifo_size
;
up
->
port
.
fifosize
=
uart_config
[
up
->
port
.
type
].
dfl_xmit_fifo_size
;
up
->
capabilities
=
uart_config
[
up
->
port
.
type
].
flags
;
if
(
up
->
port
.
type
==
PORT_UNKNOWN
)
if
(
up
->
port
.
type
==
PORT_UNKNOWN
)
goto
out
;
goto
out
;
...
@@ -1190,6 +1192,8 @@ static int serial8250_startup(struct uart_port *port)
...
@@ -1190,6 +1192,8 @@ static int serial8250_startup(struct uart_port *port)
unsigned
long
flags
;
unsigned
long
flags
;
int
retval
;
int
retval
;
up
->
capabilities
=
uart_config
[
up
->
port
.
type
].
flags
;
if
(
up
->
port
.
type
==
PORT_16C950
)
{
if
(
up
->
port
.
type
==
PORT_16C950
)
{
/* Wake up and initialize UART */
/* Wake up and initialize UART */
up
->
acr
=
0
;
up
->
acr
=
0
;
...
@@ -1215,7 +1219,7 @@ static int serial8250_startup(struct uart_port *port)
...
@@ -1215,7 +1219,7 @@ static int serial8250_startup(struct uart_port *port)
* Clear the FIFO buffers and disable them.
* Clear the FIFO buffers and disable them.
* (they will be reeanbled in set_termios())
* (they will be reeanbled in set_termios())
*/
*/
if
(
u
art_config
[
up
->
port
.
type
].
flag
s
&
UART_CLEAR_FIFO
)
{
if
(
u
p
->
capabilitie
s
&
UART_CLEAR_FIFO
)
{
serial_outp
(
up
,
UART_FCR
,
UART_FCR_ENABLE_FIFO
);
serial_outp
(
up
,
UART_FCR
,
UART_FCR_ENABLE_FIFO
);
serial_outp
(
up
,
UART_FCR
,
UART_FCR_ENABLE_FIFO
|
serial_outp
(
up
,
UART_FCR
,
UART_FCR_ENABLE_FIFO
|
UART_FCR_CLEAR_RCVR
|
UART_FCR_CLEAR_XMIT
);
UART_FCR_CLEAR_RCVR
|
UART_FCR_CLEAR_XMIT
);
...
@@ -1428,7 +1432,7 @@ serial8250_set_termios(struct uart_port *port, struct termios *termios,
...
@@ -1428,7 +1432,7 @@ serial8250_set_termios(struct uart_port *port, struct termios *termios,
up
->
rev
==
0x5201
)
up
->
rev
==
0x5201
)
quot
++
;
quot
++
;
if
(
u
art_config
[
up
->
port
.
type
].
flag
s
&
UART_USE_FIFO
)
{
if
(
u
p
->
capabilitie
s
&
UART_USE_FIFO
)
{
if
(
baud
<
2400
)
if
(
baud
<
2400
)
fcr
=
UART_FCR_ENABLE_FIFO
|
UART_FCR_TRIGGER_1
;
fcr
=
UART_FCR_ENABLE_FIFO
|
UART_FCR_TRIGGER_1
;
#ifdef CONFIG_SERIAL_8250_RSA
#ifdef CONFIG_SERIAL_8250_RSA
...
@@ -1489,13 +1493,13 @@ serial8250_set_termios(struct uart_port *port, struct termios *termios,
...
@@ -1489,13 +1493,13 @@ serial8250_set_termios(struct uart_port *port, struct termios *termios,
serial_out
(
up
,
UART_IER
,
up
->
ier
);
serial_out
(
up
,
UART_IER
,
up
->
ier
);
if
(
u
art_config
[
up
->
port
.
type
].
flag
s
&
UART_STARTECH
)
{
if
(
u
p
->
capabilitie
s
&
UART_STARTECH
)
{
serial_outp
(
up
,
UART_LCR
,
0xBF
);
serial_outp
(
up
,
UART_LCR
,
0xBF
);
serial_outp
(
up
,
UART_EFR
,
serial_outp
(
up
,
UART_EFR
,
termios
->
c_cflag
&
CRTSCTS
?
UART_EFR_CTS
:
0
);
termios
->
c_cflag
&
CRTSCTS
?
UART_EFR_CTS
:
0
);
}
}
if
(
u
art_config
[
up
->
port
.
type
].
flag
s
&
UART_NATSEMI
)
{
if
(
u
p
->
capabilitie
s
&
UART_NATSEMI
)
{
/* Switch to bank 2 not bank 1, to avoid resetting EXCR2 */
/* Switch to bank 2 not bank 1, to avoid resetting EXCR2 */
serial_outp
(
up
,
UART_LCR
,
0xe0
);
serial_outp
(
up
,
UART_LCR
,
0xe0
);
}
else
{
}
else
{
...
@@ -1524,7 +1528,7 @@ serial8250_pm(struct uart_port *port, unsigned int state,
...
@@ -1524,7 +1528,7 @@ serial8250_pm(struct uart_port *port, unsigned int state,
struct
uart_8250_port
*
up
=
(
struct
uart_8250_port
*
)
port
;
struct
uart_8250_port
*
up
=
(
struct
uart_8250_port
*
)
port
;
if
(
state
)
{
if
(
state
)
{
/* sleep */
/* sleep */
if
(
u
art_config
[
up
->
port
.
type
].
flag
s
&
UART_STARTECH
)
{
if
(
u
p
->
capabilitie
s
&
UART_STARTECH
)
{
/* Arrange to enter sleep mode */
/* Arrange to enter sleep mode */
serial_outp
(
up
,
UART_LCR
,
0xBF
);
serial_outp
(
up
,
UART_LCR
,
0xBF
);
serial_outp
(
up
,
UART_EFR
,
UART_EFR_ECB
);
serial_outp
(
up
,
UART_EFR
,
UART_EFR_ECB
);
...
@@ -1543,7 +1547,7 @@ serial8250_pm(struct uart_port *port, unsigned int state,
...
@@ -1543,7 +1547,7 @@ serial8250_pm(struct uart_port *port, unsigned int state,
up
->
pm
(
port
,
state
,
oldstate
);
up
->
pm
(
port
,
state
,
oldstate
);
}
else
{
}
else
{
/* wake */
/* wake */
if
(
u
art_config
[
up
->
port
.
type
].
flag
s
&
UART_STARTECH
)
{
if
(
u
p
->
capabilitie
s
&
UART_STARTECH
)
{
/* Wake up UART */
/* Wake up UART */
serial_outp
(
up
,
UART_LCR
,
0xBF
);
serial_outp
(
up
,
UART_LCR
,
0xBF
);
serial_outp
(
up
,
UART_EFR
,
UART_EFR_ECB
);
serial_outp
(
up
,
UART_EFR
,
UART_EFR_ECB
);
...
@@ -2101,9 +2105,9 @@ void serial8250_get_irq_map(unsigned int *map)
...
@@ -2101,9 +2105,9 @@ void serial8250_get_irq_map(unsigned int *map)
*
*
* Suspend one serial port.
* Suspend one serial port.
*/
*/
void
serial8250_suspend_port
(
int
line
,
u32
level
)
void
serial8250_suspend_port
(
int
line
)
{
{
uart_suspend_port
(
&
serial8250_reg
,
&
serial8250_ports
[
line
].
port
,
level
);
uart_suspend_port
(
&
serial8250_reg
,
&
serial8250_ports
[
line
].
port
);
}
}
/**
/**
...
@@ -2112,9 +2116,9 @@ void serial8250_suspend_port(int line, u32 level)
...
@@ -2112,9 +2116,9 @@ void serial8250_suspend_port(int line, u32 level)
*
*
* Resume one serial port.
* Resume one serial port.
*/
*/
void
serial8250_resume_port
(
int
line
,
u32
level
)
void
serial8250_resume_port
(
int
line
)
{
{
uart_resume_port
(
&
serial8250_reg
,
&
serial8250_ports
[
line
].
port
,
level
);
uart_resume_port
(
&
serial8250_reg
,
&
serial8250_ports
[
line
].
port
);
}
}
static
int
__init
serial8250_init
(
void
)
static
int
__init
serial8250_init
(
void
)
...
...
drivers/serial/8250.h
View file @
3cbbbd88
...
@@ -27,8 +27,8 @@ struct serial8250_probe {
...
@@ -27,8 +27,8 @@ struct serial8250_probe {
int
serial8250_register_probe
(
struct
serial8250_probe
*
probe
);
int
serial8250_register_probe
(
struct
serial8250_probe
*
probe
);
void
serial8250_unregister_probe
(
struct
serial8250_probe
*
probe
);
void
serial8250_unregister_probe
(
struct
serial8250_probe
*
probe
);
void
serial8250_get_irq_map
(
unsigned
int
*
map
);
void
serial8250_get_irq_map
(
unsigned
int
*
map
);
void
serial8250_suspend_port
(
int
line
,
u32
level
);
void
serial8250_suspend_port
(
int
line
);
void
serial8250_resume_port
(
int
line
,
u32
level
);
void
serial8250_resume_port
(
int
line
);
struct
old_serial_port
{
struct
old_serial_port
{
unsigned
int
uart
;
unsigned
int
uart
;
...
...
drivers/serial/8250_pci.c
View file @
3cbbbd88
...
@@ -1600,19 +1600,6 @@ static void __devexit pciserial_remove_one(struct pci_dev *dev)
...
@@ -1600,19 +1600,6 @@ static void __devexit pciserial_remove_one(struct pci_dev *dev)
}
}
}
}
static
int
pciserial_save_state_one
(
struct
pci_dev
*
dev
,
u32
state
)
{
struct
serial_private
*
priv
=
pci_get_drvdata
(
dev
);
if
(
priv
)
{
int
i
;
for
(
i
=
0
;
i
<
priv
->
nr
;
i
++
)
serial8250_suspend_port
(
priv
->
line
[
i
],
SUSPEND_SAVE_STATE
);
}
return
0
;
}
static
int
pciserial_suspend_one
(
struct
pci_dev
*
dev
,
u32
state
)
static
int
pciserial_suspend_one
(
struct
pci_dev
*
dev
,
u32
state
)
{
{
struct
serial_private
*
priv
=
pci_get_drvdata
(
dev
);
struct
serial_private
*
priv
=
pci_get_drvdata
(
dev
);
...
@@ -1621,7 +1608,7 @@ static int pciserial_suspend_one(struct pci_dev *dev, u32 state)
...
@@ -1621,7 +1608,7 @@ static int pciserial_suspend_one(struct pci_dev *dev, u32 state)
int
i
;
int
i
;
for
(
i
=
0
;
i
<
priv
->
nr
;
i
++
)
for
(
i
=
0
;
i
<
priv
->
nr
;
i
++
)
serial8250_suspend_port
(
priv
->
line
[
i
]
,
SUSPEND_POWER_DOWN
);
serial8250_suspend_port
(
priv
->
line
[
i
]);
}
}
return
0
;
return
0
;
}
}
...
@@ -1639,10 +1626,8 @@ static int pciserial_resume_one(struct pci_dev *dev)
...
@@ -1639,10 +1626,8 @@ static int pciserial_resume_one(struct pci_dev *dev)
if
(
priv
->
quirk
->
init
)
if
(
priv
->
quirk
->
init
)
priv
->
quirk
->
init
(
dev
);
priv
->
quirk
->
init
(
dev
);
for
(
i
=
0
;
i
<
priv
->
nr
;
i
++
)
{
for
(
i
=
0
;
i
<
priv
->
nr
;
i
++
)
serial8250_resume_port
(
priv
->
line
[
i
],
RESUME_POWER_ON
);
serial8250_resume_port
(
priv
->
line
[
i
]);
serial8250_resume_port
(
priv
->
line
[
i
],
RESUME_RESTORE_STATE
);
}
}
}
return
0
;
return
0
;
}
}
...
@@ -2040,7 +2025,6 @@ static struct pci_driver serial_pci_driver = {
...
@@ -2040,7 +2025,6 @@ static struct pci_driver serial_pci_driver = {
.
name
=
"serial"
,
.
name
=
"serial"
,
.
probe
=
pciserial_init_one
,
.
probe
=
pciserial_init_one
,
.
remove
=
__devexit_p
(
pciserial_remove_one
),
.
remove
=
__devexit_p
(
pciserial_remove_one
),
.
save_state
=
pciserial_save_state_one
,
.
suspend
=
pciserial_suspend_one
,
.
suspend
=
pciserial_suspend_one
,
.
resume
=
pciserial_resume_one
,
.
resume
=
pciserial_resume_one
,
.
id_table
=
serial_pci_tbl
,
.
id_table
=
serial_pci_tbl
,
...
...
drivers/serial/Kconfig
View file @
3cbbbd88
...
@@ -10,6 +10,7 @@ menu "Serial drivers"
...
@@ -10,6 +10,7 @@ menu "Serial drivers"
# The new 8250/16550 serial drivers
# The new 8250/16550 serial drivers
config SERIAL_8250
config SERIAL_8250
tristate "8250/16550 and compatible serial support"
tristate "8250/16550 and compatible serial support"
select SERIAL_CORE
---help---
---help---
This selects whether you want to include the driver for the standard
This selects whether you want to include the driver for the standard
serial ports. The standard answer is Y. People who might say N
serial ports. The standard answer is Y. People who might say N
...
@@ -41,6 +42,7 @@ config SERIAL_8250
...
@@ -41,6 +42,7 @@ config SERIAL_8250
config SERIAL_8250_CONSOLE
config SERIAL_8250_CONSOLE
bool "Console on 8250/16550 and compatible serial port"
bool "Console on 8250/16550 and compatible serial port"
depends on SERIAL_8250=y
depends on SERIAL_8250=y
select SERIAL_CORE_CONSOLE
---help---
---help---
If you say Y here, it will be possible to use a serial port as the
If you say Y here, it will be possible to use a serial port as the
system console (the system console is the device which receives all
system console (the system console is the device which receives all
...
@@ -167,12 +169,14 @@ config SERIAL_8250_ACORN
...
@@ -167,12 +169,14 @@ config SERIAL_8250_ACORN
config SERIAL_ANAKIN
config SERIAL_ANAKIN
bool "Anakin serial port support"
bool "Anakin serial port support"
depends on ARM && ARCH_ANAKIN
depends on ARM && ARCH_ANAKIN
select SERIAL_CORE
help
help
::: To be written :::
::: To be written :::
config SERIAL_ANAKIN_CONSOLE
config SERIAL_ANAKIN_CONSOLE
bool "Console on Anakin serial port"
bool "Console on Anakin serial port"
depends on SERIAL_ANAKIN
depends on SERIAL_ANAKIN
select SERIAL_CORE_CONSOLE
help
help
Even if you say Y here, the currently visible virtual console
Even if you say Y here, the currently visible virtual console
(/dev/tty0) will still be used as the system console by default, but
(/dev/tty0) will still be used as the system console by default, but
...
@@ -190,7 +194,8 @@ config ANAKIN_DEFAULT_BAUDRATE
...
@@ -190,7 +194,8 @@ config ANAKIN_DEFAULT_BAUDRATE
config SERIAL_AMBA
config SERIAL_AMBA
tristate "ARM AMBA serial port support"
tristate "ARM AMBA serial port support"
depends on ARM && ARCH_INTEGRATOR
depends on ARM_AMBA
select SERIAL_CORE
help
help
This selects the ARM(R) AMBA(R) PrimeCell UART. If you have an
This selects the ARM(R) AMBA(R) PrimeCell UART. If you have an
Integrator platform, say Y or M here.
Integrator platform, say Y or M here.
...
@@ -200,6 +205,7 @@ config SERIAL_AMBA
...
@@ -200,6 +205,7 @@ config SERIAL_AMBA
config SERIAL_AMBA_CONSOLE
config SERIAL_AMBA_CONSOLE
bool "Support for console on AMBA serial port"
bool "Support for console on AMBA serial port"
depends on SERIAL_AMBA=y
depends on SERIAL_AMBA=y
select SERIAL_CORE_CONSOLE
---help---
---help---
Say Y here if you wish to use an AMBA PrimeCell UART as the system
Say Y here if you wish to use an AMBA PrimeCell UART as the system
console (the system console is the device which receives all kernel
console (the system console is the device which receives all kernel
...
@@ -214,18 +220,20 @@ config SERIAL_AMBA_CONSOLE
...
@@ -214,18 +220,20 @@ config SERIAL_AMBA_CONSOLE
config SERIAL_INTEGRATOR
config SERIAL_INTEGRATOR
bool
bool
depends on SERIAL_AMBA
=y
depends on SERIAL_AMBA
&& ARCH_INTEGRATOR
default y
default y
config SERIAL_CLPS711X
config SERIAL_CLPS711X
tristate "CLPS711X serial port support"
tristate "CLPS711X serial port support"
depends on ARM && ARCH_CLPS711X
depends on ARM && ARCH_CLPS711X
select SERIAL_CORE
help
help
::: To be written :::
::: To be written :::
config SERIAL_CLPS711X_CONSOLE
config SERIAL_CLPS711X_CONSOLE
bool "Support for console on CLPS711X serial port"
bool "Support for console on CLPS711X serial port"
depends on SERIAL_CLPS711X=y
depends on SERIAL_CLPS711X=y
select SERIAL_CORE_CONSOLE
help
help
Even if you say Y here, the currently visible virtual console
Even if you say Y here, the currently visible virtual console
(/dev/tty0) will still be used as the system console by default, but
(/dev/tty0) will still be used as the system console by default, but
...
@@ -243,6 +251,7 @@ config SERIAL_CLPS711X_OLD_NAME
...
@@ -243,6 +251,7 @@ config SERIAL_CLPS711X_OLD_NAME
config SERIAL_21285
config SERIAL_21285
tristate "DC21285 serial port support"
tristate "DC21285 serial port support"
depends on ARM && FOOTBRIDGE
depends on ARM && FOOTBRIDGE
select SERIAL_CORE
help
help
If you have a machine based on a 21285 (Footbridge) StrongARM(R)/
If you have a machine based on a 21285 (Footbridge) StrongARM(R)/
PCI bridge you can enable its onboard serial port by enabling this
PCI bridge you can enable its onboard serial port by enabling this
...
@@ -258,6 +267,7 @@ config SERIAL_21285_OLD
...
@@ -258,6 +267,7 @@ config SERIAL_21285_OLD
config SERIAL_21285_CONSOLE
config SERIAL_21285_CONSOLE
bool "Console on DC21285 serial port"
bool "Console on DC21285 serial port"
depends on SERIAL_21285=y
depends on SERIAL_21285=y
select SERIAL_CORE_CONSOLE
help
help
If you have enabled the serial port on the 21285 footbridge you can
If you have enabled the serial port on the 21285 footbridge you can
make it the console by answering Y to this option.
make it the console by answering Y to this option.
...
@@ -272,6 +282,7 @@ config SERIAL_21285_CONSOLE
...
@@ -272,6 +282,7 @@ config SERIAL_21285_CONSOLE
config SERIAL_UART00
config SERIAL_UART00
bool "Excalibur serial port (uart00) support"
bool "Excalibur serial port (uart00) support"
depends on ARM && ARCH_CAMELOT
depends on ARM && ARCH_CAMELOT
select SERIAL_CORE
help
help
Say Y here if you want to use the hard logic uart on Excalibur. This
Say Y here if you want to use the hard logic uart on Excalibur. This
driver also supports soft logic implentations of this uart core.
driver also supports soft logic implentations of this uart core.
...
@@ -279,6 +290,7 @@ config SERIAL_UART00
...
@@ -279,6 +290,7 @@ config SERIAL_UART00
config SERIAL_UART00_CONSOLE
config SERIAL_UART00_CONSOLE
bool "Support for console on Excalibur serial port"
bool "Support for console on Excalibur serial port"
depends on SERIAL_UART00
depends on SERIAL_UART00
select SERIAL_CORE_CONSOLE
help
help
Say Y here if you want to support a serial console on an Excalibur
Say Y here if you want to support a serial console on an Excalibur
hard logic uart or uart00 IP core.
hard logic uart or uart00 IP core.
...
@@ -293,6 +305,7 @@ config SERIAL_UART00_CONSOLE
...
@@ -293,6 +305,7 @@ config SERIAL_UART00_CONSOLE
config SERIAL_SA1100
config SERIAL_SA1100
bool "SA1100 serial port support"
bool "SA1100 serial port support"
depends on ARM && ARCH_SA1100
depends on ARM && ARCH_SA1100
select SERIAL_CORE
help
help
If you have a machine based on a SA1100/SA1110 StrongARM(R) CPU you
If you have a machine based on a SA1100/SA1110 StrongARM(R) CPU you
can enable its onboard serial port by enabling this option.
can enable its onboard serial port by enabling this option.
...
@@ -302,6 +315,7 @@ config SERIAL_SA1100
...
@@ -302,6 +315,7 @@ config SERIAL_SA1100
config SERIAL_SA1100_CONSOLE
config SERIAL_SA1100_CONSOLE
bool "Console on SA1100 serial port"
bool "Console on SA1100 serial port"
depends on SERIAL_SA1100
depends on SERIAL_SA1100
select SERIAL_CORE_CONSOLE
help
help
If you have enabled the serial port on the SA1100/SA1110 StrongARM
If you have enabled the serial port on the SA1100/SA1110 StrongARM
CPU you can make it the console by answering Y to this option.
CPU you can make it the console by answering Y to this option.
...
@@ -316,6 +330,8 @@ config SERIAL_SA1100_CONSOLE
...
@@ -316,6 +330,8 @@ config SERIAL_SA1100_CONSOLE
config SERIAL_SUNCORE
config SERIAL_SUNCORE
bool
bool
depends on SPARC32 || SPARC64
depends on SPARC32 || SPARC64
select SERIAL_CORE
select SERIAL_CORE_CONSOLE
default y
default y
config SERIAL_SUNZILOG
config SERIAL_SUNZILOG
...
@@ -352,6 +368,7 @@ config SERIAL_SUNSU_CONSOLE
...
@@ -352,6 +368,7 @@ config SERIAL_SUNSU_CONSOLE
config SERIAL_MUX
config SERIAL_MUX
tristate "Serial MUX support"
tristate "Serial MUX support"
depends on PARISC
depends on PARISC
select SERIAL_CORE
default y
default y
---help---
---help---
Saying Y here will enable the hardware MUX serial driver for
Saying Y here will enable the hardware MUX serial driver for
...
@@ -369,6 +386,7 @@ config SERIAL_MUX
...
@@ -369,6 +386,7 @@ config SERIAL_MUX
config SERIAL_MUX_CONSOLE
config SERIAL_MUX_CONSOLE
bool "Support for console on serial MUX"
bool "Support for console on serial MUX"
depends on SERIAL_MUX
depends on SERIAL_MUX
select SERIAL_CORE_CONSOLE
default y
default y
config PDC_CONSOLE
config PDC_CONSOLE
...
@@ -406,6 +424,7 @@ config SERIAL_SUNSAB_CONSOLE
...
@@ -406,6 +424,7 @@ config SERIAL_SUNSAB_CONSOLE
config V850E_UART
config V850E_UART
bool "NEC V850E on-chip UART support"
bool "NEC V850E on-chip UART support"
depends on V850E_MA1 || V850E_ME2 || V850E_TEG || V850E2_ANNA || V850E_AS85EP1
depends on V850E_MA1 || V850E_ME2 || V850E_TEG || V850E2_ANNA || V850E_AS85EP1
select SERIAL_CORE
default y
default y
config V850E_UARTB
config V850E_UARTB
...
@@ -416,10 +435,12 @@ config V850E_UARTB
...
@@ -416,10 +435,12 @@ config V850E_UARTB
config V850E_UART_CONSOLE
config V850E_UART_CONSOLE
bool "Use NEC V850E on-chip UART for console"
bool "Use NEC V850E on-chip UART for console"
depends on V850E_UART
depends on V850E_UART
select SERIAL_CORE_CONSOLE
config SERIAL98
config SERIAL98
tristate "PC-9800 8251-based primary serial port support"
tristate "PC-9800 8251-based primary serial port support"
depends on X86_PC9800
depends on X86_PC9800
select SERIAL_CORE
help
help
If you want to use standard primary serial ports on PC-9800,
If you want to use standard primary serial ports on PC-9800,
say Y. Otherwise, say N.
say Y. Otherwise, say N.
...
@@ -427,16 +448,13 @@ config SERIAL98
...
@@ -427,16 +448,13 @@ config SERIAL98
config SERIAL98_CONSOLE
config SERIAL98_CONSOLE
bool "Support for console on PC-9800 standard serial port"
bool "Support for console on PC-9800 standard serial port"
depends on SERIAL98=y
depends on SERIAL98=y
select SERIAL_CORE_CONSOLE
config SERIAL_CORE
config SERIAL_CORE
tristate
tristate
default m if SERIAL_AMBA!=y && SERIAL_CLPS711X!=y && SERIAL_21285!=y && !SERIAL_SA1100 && !SERIAL_ANAKIN && !SERIAL_UART00 && SERIAL_8250!=y && SERIAL_MUX!=y && !SERIAL_ROCKETPORT && !SERIAL_SUNCORE && !V850E_UART && SERIAL_PMACZILOG!=y && (SERIAL_AMBA=m || SERIAL_CLPS711X=m || SERIAL_21285=m || SERIAL_8250=m || SERIAL_MUX=m || SERIAL98=m || SERIAL_PMACZILOG=m)
default y if SERIAL_AMBA=y || SERIAL_CLPS711X=y || SERIAL_21285=y || SERIAL_SA1100 || SERIAL_ANAKIN || SERIAL_UART00 || SERIAL_8250=y || SERIAL_MUX=y || SERIAL_ROCKETPORT || SERIAL_SUNCORE || V850E_UART || SERIAL98=y || SERIAL_PMACZILOG=y
config SERIAL_CORE_CONSOLE
config SERIAL_CORE_CONSOLE
bool
bool
depends on SERIAL_AMBA_CONSOLE || SERIAL_CLPS711X_CONSOLE || SERIAL_21285_CONSOLE || SERIAL_SA1100_CONSOLE || SERIAL_ANAKIN_CONSOLE || SERIAL_UART00_CONSOLE || SERIAL_8250_CONSOLE || SERIAL_MUX_CONSOLE || SERIAL_SUNZILOG_CONSOLE || SERIAL_SUNSU_CONSOLE || SERIAL_SUNSAB_CONSOLE || V850E_UART_CONSOLE || SERIAL98_CONSOLE || SERIAL_PMACZILOG_CONSOLE
default y
config SERIAL_68328
config SERIAL_68328
bool "68328 serial support"
bool "68328 serial support"
...
@@ -476,6 +494,7 @@ config SERIAL_68360
...
@@ -476,6 +494,7 @@ config SERIAL_68360
config SERIAL_PMACZILOG
config SERIAL_PMACZILOG
tristate "PowerMac z85c30 ESCC support"
tristate "PowerMac z85c30 ESCC support"
depends on PPC_OF
depends on PPC_OF
select SERIAL_CORE
help
help
This driver supports the Zilog z85C30 serial ports found on
This driver supports the Zilog z85C30 serial ports found on
PowerMac machines.
PowerMac machines.
...
@@ -484,6 +503,7 @@ config SERIAL_PMACZILOG
...
@@ -484,6 +503,7 @@ config SERIAL_PMACZILOG
config SERIAL_PMACZILOG_CONSOLE
config SERIAL_PMACZILOG_CONSOLE
bool "Console on PowerMac z85c30 serial port"
bool "Console on PowerMac z85c30 serial port"
depends on SERIAL_PMACZILOG=y
depends on SERIAL_PMACZILOG=y
select SERIAL_CORE_CONSOLE
help
help
If you would like to be able to use the z85c30 serial port
If you would like to be able to use the z85c30 serial port
on your PowerMac as the console, you can do so by answering
on your PowerMac as the console, you can do so by answering
...
...
drivers/serial/Makefile
View file @
3cbbbd88
...
@@ -11,10 +11,10 @@ serial-8250-$(CONFIG_PNP) += 8250_pnp.o
...
@@ -11,10 +11,10 @@ serial-8250-$(CONFIG_PNP) += 8250_pnp.o
serial-8250-$(CONFIG_SERIAL_8250_HCDP)
+=
8250_hcdp.o
serial-8250-$(CONFIG_SERIAL_8250_HCDP)
+=
8250_hcdp.o
serial-8250-$(CONFIG_SERIAL_8250_ACPI)
+=
8250_acpi.o
serial-8250-$(CONFIG_SERIAL_8250_ACPI)
+=
8250_acpi.o
obj-$(CONFIG_SERIAL_CORE)
+=
core.o
obj-$(CONFIG_SERIAL_CORE)
+=
serial_
core.o
obj-$(CONFIG_SERIAL_21285)
+=
21285.o
obj-$(CONFIG_SERIAL_21285)
+=
21285.o
obj-$(CONFIG_SERIAL_8250)
+=
8250.o
$
(
serial-8250-y
)
obj-$(CONFIG_SERIAL_8250)
+=
8250.o
$
(
serial-8250-y
)
obj-$(CONFIG_SERIAL_8250_CS)
+=
8250
_cs.o
obj-$(CONFIG_SERIAL_8250_CS)
+=
serial
_cs.o
obj-$(CONFIG_SERIAL_8250_ACORN)
+=
8250_acorn.o
obj-$(CONFIG_SERIAL_8250_ACORN)
+=
8250_acorn.o
obj-$(CONFIG_SERIAL_ANAKIN)
+=
anakin.o
obj-$(CONFIG_SERIAL_ANAKIN)
+=
anakin.o
obj-$(CONFIG_SERIAL_AMBA)
+=
amba.o
obj-$(CONFIG_SERIAL_AMBA)
+=
amba.o
...
...
drivers/serial/clps711x.c
View file @
3cbbbd88
...
@@ -104,7 +104,7 @@ static void clps711xuart_enable_ms(struct uart_port *port)
...
@@ -104,7 +104,7 @@ static void clps711xuart_enable_ms(struct uart_port *port)
{
{
}
}
static
void
clps711xuart_int_rx
(
int
irq
,
void
*
dev_id
,
struct
pt_regs
*
regs
)
static
irqreturn_t
clps711xuart_int_rx
(
int
irq
,
void
*
dev_id
,
struct
pt_regs
*
regs
)
{
{
struct
uart_port
*
port
=
dev_id
;
struct
uart_port
*
port
=
dev_id
;
struct
tty_struct
*
tty
=
port
->
info
->
tty
;
struct
tty_struct
*
tty
=
port
->
info
->
tty
;
...
@@ -139,7 +139,7 @@ static void clps711xuart_int_rx(int irq, void *dev_id, struct pt_regs *regs)
...
@@ -139,7 +139,7 @@ static void clps711xuart_int_rx(int irq, void *dev_id, struct pt_regs *regs)
}
}
out:
out:
tty_flip_buffer_push
(
tty
);
tty_flip_buffer_push
(
tty
);
return
;
return
IRQ_HANDLED
;
handle_error:
handle_error:
if
(
ch
&
UARTDR_PARERR
)
if
(
ch
&
UARTDR_PARERR
)
...
@@ -180,7 +180,7 @@ static void clps711xuart_int_rx(int irq, void *dev_id, struct pt_regs *regs)
...
@@ -180,7 +180,7 @@ static void clps711xuart_int_rx(int irq, void *dev_id, struct pt_regs *regs)
goto
error_return
;
goto
error_return
;
}
}
static
void
clps711xuart_int_tx
(
int
irq
,
void
*
dev_id
,
struct
pt_regs
*
regs
)
static
irqreturn_t
clps711xuart_int_tx
(
int
irq
,
void
*
dev_id
,
struct
pt_regs
*
regs
)
{
{
struct
uart_port
*
port
=
dev_id
;
struct
uart_port
*
port
=
dev_id
;
struct
circ_buf
*
xmit
=
&
port
->
info
->
xmit
;
struct
circ_buf
*
xmit
=
&
port
->
info
->
xmit
;
...
@@ -190,11 +190,11 @@ static void clps711xuart_int_tx(int irq, void *dev_id, struct pt_regs *regs)
...
@@ -190,11 +190,11 @@ static void clps711xuart_int_tx(int irq, void *dev_id, struct pt_regs *regs)
clps_writel
(
port
->
x_char
,
UARTDR
(
port
));
clps_writel
(
port
->
x_char
,
UARTDR
(
port
));
port
->
icount
.
tx
++
;
port
->
icount
.
tx
++
;
port
->
x_char
=
0
;
port
->
x_char
=
0
;
return
;
return
IRQ_HANDLED
;
}
}
if
(
uart_circ_empty
(
xmit
)
||
uart_tx_stopped
(
port
))
{
if
(
uart_circ_empty
(
xmit
)
||
uart_tx_stopped
(
port
))
{
clps711xuart_stop_tx
(
port
,
0
);
clps711xuart_stop_tx
(
port
,
0
);
return
;
return
IRQ_HANDLED
;
}
}
count
=
port
->
fifosize
>>
1
;
count
=
port
->
fifosize
>>
1
;
...
@@ -211,6 +211,8 @@ static void clps711xuart_int_tx(int irq, void *dev_id, struct pt_regs *regs)
...
@@ -211,6 +211,8 @@ static void clps711xuart_int_tx(int irq, void *dev_id, struct pt_regs *regs)
if
(
uart_circ_empty
(
xmit
))
if
(
uart_circ_empty
(
xmit
))
clps711xuart_stop_tx
(
port
,
0
);
clps711xuart_stop_tx
(
port
,
0
);
return
IRQ_HANDLED
;
}
}
static
unsigned
int
clps711xuart_tx_empty
(
struct
uart_port
*
port
)
static
unsigned
int
clps711xuart_tx_empty
(
struct
uart_port
*
port
)
...
...
drivers/serial/sa1100.c
View file @
3cbbbd88
...
@@ -862,8 +862,8 @@ static int sa1100_serial_suspend(struct device *_dev, u32 state, u32 level)
...
@@ -862,8 +862,8 @@ static int sa1100_serial_suspend(struct device *_dev, u32 state, u32 level)
{
{
struct
sa1100_port
*
sport
=
dev_get_drvdata
(
_dev
);
struct
sa1100_port
*
sport
=
dev_get_drvdata
(
_dev
);
if
(
sport
)
if
(
sport
&&
level
==
SUSPEND_DISABLE
)
uart_suspend_port
(
&
sa1100_reg
,
&
sport
->
port
,
level
);
uart_suspend_port
(
&
sa1100_reg
,
&
sport
->
port
);
return
0
;
return
0
;
}
}
...
@@ -872,8 +872,8 @@ static int sa1100_serial_resume(struct device *_dev, u32 level)
...
@@ -872,8 +872,8 @@ static int sa1100_serial_resume(struct device *_dev, u32 level)
{
{
struct
sa1100_port
*
sport
=
dev_get_drvdata
(
_dev
);
struct
sa1100_port
*
sport
=
dev_get_drvdata
(
_dev
);
if
(
sport
)
if
(
sport
&&
level
==
RESUME_ENABLE
)
uart_resume_port
(
&
sa1100_reg
,
&
sport
->
port
,
level
);
uart_resume_port
(
&
sa1100_reg
,
&
sport
->
port
);
return
0
;
return
0
;
}
}
...
...
drivers/serial/core.c
→
drivers/serial/
serial_
core.c
View file @
3cbbbd88
...
@@ -1875,84 +1875,72 @@ static void uart_change_pm(struct uart_state *state, int pm_state)
...
@@ -1875,84 +1875,72 @@ static void uart_change_pm(struct uart_state *state, int pm_state)
state
->
pm_state
=
pm_state
;
state
->
pm_state
=
pm_state
;
}
}
int
uart_suspend_port
(
struct
uart_driver
*
drv
,
struct
uart_port
*
port
,
u32
level
)
int
uart_suspend_port
(
struct
uart_driver
*
drv
,
struct
uart_port
*
port
)
{
{
struct
uart_state
*
state
=
drv
->
state
+
port
->
line
;
struct
uart_state
*
state
=
drv
->
state
+
port
->
line
;
down
(
&
state
->
sem
);
down
(
&
state
->
sem
);
switch
(
level
)
{
if
(
state
->
info
&&
state
->
info
->
flags
&
UIF_INITIALIZED
)
{
case
SUSPEND_SAVE_STATE
:
struct
uart_ops
*
ops
=
port
->
ops
;
if
(
state
->
info
&&
state
->
info
->
flags
&
UIF_INITIALIZED
)
{
struct
uart_ops
*
ops
=
port
->
ops
;
spin_lock_irq
(
&
port
->
lock
);
spin_lock_irq
(
&
port
->
lock
);
ops
->
stop_tx
(
port
,
0
);
ops
->
stop_tx
(
port
,
0
);
ops
->
set_mctrl
(
port
,
0
);
ops
->
set_mctrl
(
port
,
0
);
ops
->
stop_rx
(
port
);
ops
->
stop_rx
(
port
);
spin_unlock_irq
(
&
port
->
lock
);
spin_unlock_irq
(
&
port
->
lock
);
/*
* Wait for the transmitter to empty.
*/
while
(
!
ops
->
tx_empty
(
port
))
{
set_current_state
(
TASK_UNINTERRUPTIBLE
);
schedule_timeout
(
10
*
HZ
/
1000
);
}
set_current_state
(
TASK_RUNNING
);
ops
->
shutdown
(
port
);
}
break
;
case
SUSPEND_POWER_DOWN
:
/*
/*
*
Disable the console device before suspending
.
*
Wait for the transmitter to empty
.
*/
*/
if
(
uart_console
(
port
))
while
(
!
ops
->
tx_empty
(
port
))
{
port
->
cons
->
flags
&=
~
CON_ENABLED
;
set_current_state
(
TASK_UNINTERRUPTIBLE
);
schedule_timeout
(
10
*
HZ
/
1000
);
}
set_current_state
(
TASK_RUNNING
);
uart_change_pm
(
state
,
3
);
ops
->
shutdown
(
port
);
break
;
}
}
/*
* Disable the console device before suspending.
*/
if
(
uart_console
(
port
))
port
->
cons
->
flags
&=
~
CON_ENABLED
;
uart_change_pm
(
state
,
3
);
up
(
&
state
->
sem
);
up
(
&
state
->
sem
);
return
0
;
return
0
;
}
}
int
uart_resume_port
(
struct
uart_driver
*
drv
,
struct
uart_port
*
port
,
u32
level
)
int
uart_resume_port
(
struct
uart_driver
*
drv
,
struct
uart_port
*
port
)
{
{
struct
uart_state
*
state
=
drv
->
state
+
port
->
line
;
struct
uart_state
*
state
=
drv
->
state
+
port
->
line
;
down
(
&
state
->
sem
);
down
(
&
state
->
sem
);
switch
(
level
)
{
uart_change_pm
(
state
,
0
);
case
RESUME_POWER_ON
:
uart_change_pm
(
state
,
0
);
/*
/*
* Re-enable the console device after suspending.
* Re-enable the console device after suspending.
*/
*/
if
(
uart_console
(
port
))
{
if
(
uart_console
(
port
))
{
uart_change_speed
(
state
,
NULL
);
uart_change_speed
(
state
,
NULL
);
port
->
cons
->
flags
|=
CON_ENABLED
;
port
->
cons
->
flags
|=
CON_ENABLED
;
}
}
break
;
case
RESUME_RESTORE_STATE
:
if
(
state
->
info
&&
state
->
info
->
flags
&
UIF_INITIALIZED
)
{
if
(
state
->
info
&&
state
->
info
->
flags
&
UIF_INITIALIZED
)
{
struct
uart_ops
*
ops
=
port
->
ops
;
struct
uart_ops
*
ops
=
port
->
ops
;
ops
->
set_mctrl
(
port
,
0
);
ops
->
set_mctrl
(
port
,
0
);
ops
->
startup
(
port
);
ops
->
startup
(
port
);
uart_change_speed
(
state
,
NULL
);
uart_change_speed
(
state
,
NULL
);
spin_lock_irq
(
&
port
->
lock
);
spin_lock_irq
(
&
port
->
lock
);
ops
->
set_mctrl
(
port
,
port
->
mctrl
);
ops
->
set_mctrl
(
port
,
port
->
mctrl
);
ops
->
start_tx
(
port
,
0
);
ops
->
start_tx
(
port
,
0
);
spin_unlock_irq
(
&
port
->
lock
);
spin_unlock_irq
(
&
port
->
lock
);
}
break
;
}
}
up
(
&
state
->
sem
);
up
(
&
state
->
sem
);
...
...
drivers/serial/
8250
_cs.c
→
drivers/serial/
serial
_cs.c
View file @
3cbbbd88
File moved
include/linux/serial_core.h
View file @
3cbbbd88
...
@@ -67,6 +67,12 @@
...
@@ -67,6 +67,12 @@
#define PORT_PC9861 45
#define PORT_PC9861 45
#define PORT_PC9801_101 46
#define PORT_PC9801_101 46
/* DZ */
#define PORT_DZ 47
/* Parisc type numbers. */
#define PORT_MUX 48
/* Macintosh Zilog type numbers */
/* Macintosh Zilog type numbers */
#define PORT_MAC_ZILOG 50
/* m68k : not yet implemented */
#define PORT_MAC_ZILOG 50
/* m68k : not yet implemented */
#define PORT_PMAC_ZILOG 51
#define PORT_PMAC_ZILOG 51
...
@@ -319,8 +325,8 @@ int uart_remove_one_port(struct uart_driver *reg, struct uart_port *port);
...
@@ -319,8 +325,8 @@ int uart_remove_one_port(struct uart_driver *reg, struct uart_port *port);
/*
/*
* Power Management
* Power Management
*/
*/
int
uart_suspend_port
(
struct
uart_driver
*
reg
,
struct
uart_port
*
port
,
u32
level
);
int
uart_suspend_port
(
struct
uart_driver
*
reg
,
struct
uart_port
*
port
);
int
uart_resume_port
(
struct
uart_driver
*
reg
,
struct
uart_port
*
port
,
u32
level
);
int
uart_resume_port
(
struct
uart_driver
*
reg
,
struct
uart_port
*
port
);
#define uart_circ_empty(circ) ((circ)->head == (circ)->tail)
#define uart_circ_empty(circ) ((circ)->head == (circ)->tail)
#define uart_circ_clear(circ) ((circ)->head = (circ)->tail = 0)
#define uart_circ_clear(circ) ((circ)->head = (circ)->tail = 0)
...
...
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