Skip to content

Commit

Permalink
serial:sunplus-uart:Add Sunplus SoC UART Driver
Browse files Browse the repository at this point in the history
Add Sunplus SoC UART Driver.
SP7021 UART block contains 5 UARTs.
There are UART0~4 that supported in SP7021, the features list as below.
Support Full-duplex communication.
Support data packet length configurable.
Support stop bit number configurable.
Support force break condition.
Support baud rate configurable.
Support error detection and report.
Support RXD Noise Rejection Vote configurable.

UART0 pinout only support TX/RX two pins.
UART1 to UART4 pinout support TX/RX/CTS/RTS four pins.
Normally UART0 used for kernel console, also can be used for normal uart.
Command line set "console=ttySUP0,115200", SUP means Sunplus Uart Port.
UART driver probe will create path named "/dev/ttySUPx".

https://sunplus.atlassian.net/wiki/spaces/doc/pages/1873412290/13.+Universal+Asynchronous+Receiver+Transmitter+UART

Signed-off-by: Hammer Hsieh <hammerh0314@gmail.com>
  • Loading branch information
Hammer Hsieh authored and intel-lab-lkp committed Feb 15, 2022
1 parent f00bffe commit acb196d
Show file tree
Hide file tree
Showing 5 changed files with 806 additions and 0 deletions.
1 change: 1 addition & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -18494,6 +18494,7 @@ SUNPLUS UART DRIVER
M: Hammer Hsieh <hammerh0314@gmail.com>
S: Maintained
F: Documentation/devicetree/bindings/serial/sunplus,sp7021-uart.yaml
F: drivers/tty/serial/sunplus-uart.c

SUPERH
M: Yoshinori Sato <ysato@users.sourceforge.jp>
Expand Down
25 changes: 25 additions & 0 deletions drivers/tty/serial/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1562,6 +1562,31 @@ config SERIAL_LITEUART_CONSOLE
and warnings and which allows logins in single user mode).
Otherwise, say 'N'.

config SERIAL_SUNPLUS
tristate "Sunplus UART support"
depends on OF || COMPILE_TEST
select SERIAL_CORE
help
Select this option if you would like to use Sunplus serial port on
Sunplus SoC SP7021.
If you enable this option, Sunplus serial ports in the system will
be registered as ttySUPx.
This driver can also be built as a module. If so, the module will be
called sunplus-uart.

config SERIAL_SUNPLUS_CONSOLE
bool "Console on Sunplus UART"
depends on SERIAL_SUNPLUS
select SERIAL_CORE_CONSOLE
select SERIAL_EARLYCON
help
Select this option if you would like to use a Sunplus UART as the
system 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
you can alter that using a kernel command line option such as
"console=ttySUPx".

endmenu

config SERIAL_MCTRL_GPIO
Expand Down
1 change: 1 addition & 0 deletions drivers/tty/serial/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ obj-$(CONFIG_SERIAL_RDA) += rda-uart.o
obj-$(CONFIG_SERIAL_MILBEAUT_USIO) += milbeaut_usio.o
obj-$(CONFIG_SERIAL_SIFIVE) += sifive.o
obj-$(CONFIG_SERIAL_LITEUART) += liteuart.o
obj-$(CONFIG_SERIAL_SUNPLUS) += sunplus-uart.o

# GPIOLIB helpers for modem control lines
obj-$(CONFIG_SERIAL_MCTRL_GPIO) += serial_mctrl_gpio.o
Expand Down
Loading

0 comments on commit acb196d

Please sign in to comment.