Skip to contentSkip to conversation

serial/arc-uart: Add new driver

PATCH Superseded [email protected] 2 participants 3 messages Oct 27, 2012 – Oct 29, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v7 1/1 serial/arc-uart: Add new driver

From: Vineet Gupta <[email protected]>

Hi,

Here's the updated revision with all of Felipe' review comments. -Rebased off tty-next tip.
-Build tested for x86, both as builtin and as module -Same driver (as module) verified on ARCAngel4 Board.

Please consider applying.

Thanks,
Vineet

v7:
* Reinstated (request|release)_port() as they are called w/o NULL check by core
* verify_port() now does some basic checking
* Use container_of() for converting embedded uart_port to arc_uart_port
* dev_* instead of pr_*

v6:
* syntactical changes per comments by Felipe
* Empty (request|release)_port removed

v5:
* Driver now builds as module; default !y
* Fixed some build wreckage due to SERIAL_ARC && !SERIAL_ARC_CONSOLE
* Fixed a sparse warning due to forced cast, hence reg offsets now in bytes

v4:
* UAPI disintegration fallout for serial_core.h
* rebased off of tty-next

v3:
* Removed empty arc_serial_set_ldisc()
* More set_termios fixes - CSIZE forced to CS8 (for 8N1)
* global @running_on_iss replaced with platform data, saved in device specific port structure.

v2:
* ttyARC used as device name
* Dynamic assignment of major/minor numbers.
* Ref counting tty in rx routine to prevent it from disappearing in case of a hangup
* set_termios fixes:
- hardware flow control/parity are marked as unsupported
- baud written back to termios
* cosmetics such as commenting the need for @running_on_iss, empty lines etc

Vineet Gupta (1):
serial/arc-uart: Add new driver

 drivers/tty/serial/Kconfig       |   23 ++
 drivers/tty/serial/Makefile      |    1 +
 drivers/tty/serial/arc_uart.c    |  754 ++++++++++++++++++++++++++++++++++++++
 include/uapi/linux/serial_core.h |    2 +
 4 files changed, 780 insertions(+), 0 deletions(-)
 create mode 100644 drivers/tty/serial/arc_uart.c
Signature · 1 line
1.7.4.1
#1 lore raw

PATCH v7 1/1 serial/arc-uart: Add new driver

From: Vineet Gupta <[email protected]>

Driver for non-standard on-chip UART, instantiated in the ARC (Synopsys) FPGA Boards such as ARCAngel4/ML50x

---
 drivers/tty/serial/Kconfig       |   23 ++
 drivers/tty/serial/Makefile      |    1 +
 drivers/tty/serial/arc_uart.c    |  746 ++++++++++++++++++++++++++++++++++++++
 include/uapi/linux/serial_core.h |    2 +
 4 files changed, 772 insertions(+), 0 deletions(-)
 create mode 100644 drivers/tty/serial/arc_uart.c
drivers/tty/serial/Kconfig +23 -0
index 2a53be5..b176801 100644
@@ -1423,4 +1423,27 @@ config SERIAL_EFM32_UART_CONSOLE
 	depends on SERIAL_EFM32_UART=y
 	select SERIAL_CORE_CONSOLE
 
+config SERIAL_ARC
+	tristate "ARC UART driver support"
+	select SERIAL_CORE
+	help
+	  Driver for on-chip UART for ARC(Synopsys) for the legacy
+	  FPGA Boards (ML50x/ARCAngel4)
+
+config SERIAL_ARC_CONSOLE
+	bool "Console on ARC UART"
+	depends on SERIAL_ARC=y
+	select SERIAL_CORE_CONSOLE
+	help
+	  Enable system Console on ARC UART
+
+config SERIAL_ARC_NR_PORTS
+	int "Number of ARC UART ports"
+	depends on SERIAL_ARC
+	range 1 3
+	default "1"
+	help
+	  Set this to the number of serial ports you want the driver
+	  to support.
+
 endmenu
drivers/tty/serial/Makefile +1 -0
index 4f694da..df1b998 100644
@@ -82,3 +82,4 @@ obj-$(CONFIG_SERIAL_XILINX_PS_UART) += xilinx_uartps.o
 obj-$(CONFIG_SERIAL_SIRFSOC) += sirfsoc_uart.o
 obj-$(CONFIG_SERIAL_AR933X)   += ar933x_uart.o
 obj-$(CONFIG_SERIAL_EFM32_UART) += efm32-uart.o
+obj-$(CONFIG_SERIAL_ARC)	+= arc_uart.o
drivers/tty/serial/arc_uart.c new file +746 -0

746 lines not on this page · raw message

include/uapi/linux/serial_core.h +2 -0
index 7e1ab20..ebcc73f 100644
@@ -215,5 +215,7 @@
 /* Energy Micro efm32 SoC */
 #define PORT_EFMUART   100
 
+/* ARC (Synopsys) on-chip UART */
+#define PORT_ARC       101
 
 #endif /* _UAPILINUX_SERIAL_CORE_H */
Signature · 1 line
1.7.4.1
Reviewed-by on v7 1/1
#2 lore raw

Hi,

Quoted 6 lines · On Sat, Oct 27, 2012 at 12:47:12PM +0530, [email protected] wrote:

From: Vineet Gupta <[email protected]>

Driver for non-standard on-chip UART, instantiated in the ARC (Synopsys) FPGA Boards such as ARCAngel4/ML50x

I'm by no means an expert on the tty layer, but this looks a lot better than previous version.

FWIW:

Signature · 1 line
balbi