Skip to contentSkip to conversation

drivers/tty/serial: add LiteUART driver

PATCH Superseded Mateusz Holenko 1 participant 1 message Sep 30, 2019

Subsystems (2)

v1 of 12 Superseded Latest is v12 →

lore
Share & tools
lore

Mateusz Holenko

author maintainer
#0 lore raw

PATCH 3/3 drivers/tty/serial: add LiteUART driver

From: Filip Kokosinski <[email protected]>

This commit adds driver for the FPGA-based LiteUART serial controller from LiteX SoC builder.

The current implementation supports LiteUART configured for 32 bit data width and 8 bit CSR bus width.

It does not support IRQ.

---
 MAINTAINERS                      |   1 +
 drivers/tty/serial/Kconfig       |  30 +++
 drivers/tty/serial/Makefile      |   1 +
 drivers/tty/serial/liteuart.c    | 382 +++++++++++++++++++++++++++++++
 include/uapi/linux/serial_core.h |   3 +
 5 files changed, 417 insertions(+)
 create mode 100644 drivers/tty/serial/liteuart.c
MAINTAINERS +1 -0
index 65a6cf296..d108b6044 100644
@@ -9467,6 +9467,7 @@ M:	Karol Gugala <[email protected]>
 M:	Mateusz Holenko <[email protected]>
 S:	Maintained
 F:	Documentation/devicetree/bindings/serial/litex,liteuart.txt
+F:	drivers/tty/serial/liteuart.c
 
 LIVE PATCHING
 M:	Josh Poimboeuf <[email protected]>
drivers/tty/serial/Kconfig +30 -0
index 4789b5d62..b01fe12a1 100644
@@ -1571,6 +1571,36 @@ config SERIAL_MILBEAUT_USIO_CONSOLE
 	  receives all kernel messages and warnings and which allows logins in
 	  single user mode).
 
+config SERIAL_LITEUART
+	tristate "LiteUART serial port support"
+	depends on HAS_IOMEM
+	depends on OF
+	select SERIAL_CORE
+	help
+	  This driver is for the FPGA-based LiteUART serial controller from LiteX
+	  SoC builder.
+
+	  Say 'Y' here if you wish to use the LiteUART serial controller.
+	  Otherwise, say 'N'.
+
+config SERIAL_LITEUART_NR_PORTS
+	int "Number of LiteUART ports"
+	depends on SERIAL_LITEUART
+	default "1"
+	help
+	  Set this to the number of serial ports you want the driver
+	  to support.
+
+config SERIAL_LITEUART_CONSOLE
+	bool "LiteUART serial port console support"
+	depends on SERIAL_LITEUART=y
+	select SERIAL_CORE_CONSOLE
+	help
+	  Say 'Y' here if you wish to use the FPGA-based LiteUART serial controller
+	  from LiteX SoC builder as the system console (the system console is the
+	  device which receives all kernel messages and warnings and which allows
+	  logins in single user mode). Otherwise, say 'N'.
+
 endmenu
 
 config SERIAL_MCTRL_GPIO
drivers/tty/serial/Makefile +1 -0
index 863f47056..c8d7e2046 100644
@@ -89,6 +89,7 @@ obj-$(CONFIG_SERIAL_OWL)	+= owl-uart.o
 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
 
 # GPIOLIB helpers for modem control lines
 obj-$(CONFIG_SERIAL_MCTRL_GPIO)	+= serial_mctrl_gpio.o
drivers/tty/serial/liteuart.c new file +382 -0

382 lines not on this page · raw message

include/uapi/linux/serial_core.h +3 -0
index 0f4f87a6f..8fe6b0bf8 100644
@@ -293,4 +293,7 @@
 /* Freescale Linflex UART */
 #define PORT_LINFLEXUART	121
 
+/* LiteUART */
+#define PORT_LITEUART	122
+
 #endif /* _UAPILINUX_SERIAL_CORE_H */
Signature · 1 line
2.23.0