Skip to contentSkip to conversation

serial: Drivers for Altera UARTs

PATCH Superseded Tobias Klauser 1 participant 3 messages Mar 30, 2010

Subsystems (2)

v4 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
author maintainer
#2 lore raw

PATCH v4 2/2 serial: Add driver for the Altera UART

In reply to Tobias Klauser

Add an UART driver for the UART component available as a SOPC (System on Programmable Chip) component for Altera FPGAs.

---
 drivers/serial/Kconfig       |   31 +++
 drivers/serial/Makefile      |    1 +
 drivers/serial/altera_uart.c |  570 ++++++++++++++++++++++++++++++++++++++++++
 include/linux/altera_uart.h  |   14 +
 include/linux/serial_core.h  |    1 +
 5 files changed, 617 insertions(+), 0 deletions(-)
 create mode 100644 drivers/serial/altera_uart.c
 create mode 100644 include/linux/altera_uart.h
drivers/serial/Kconfig +31 -0
index b584710..e17d6d1 100644
@@ -1527,4 +1527,35 @@ config SERIAL_ALTERA_JTAGUART_CONSOLE_BYPASS
 	  Bypass console output and keep going even if there is no
 	  JTAG terminal connection with the host.
 
+config SERIAL_ALTERA_UART
+	bool "Altera UART support"
+	select SERIAL_CORE
+	help
+	  This driver supports the Altera softcore UART port.
+
+config SERIAL_ALTERA_UART_MAXPORTS
+	int "Maximum number of Altera UART ports"
+	depends on SERIAL_ALTERA_UART
+	default 4
+	help
+	  This setting lets you define the maximum number of the Altera
+	  UART ports. The usual default varies from board to board, and
+	  this setting is a way of catering for that.
+
+config SERIAL_ALTERA_UART_BAUDRATE
+	int "Default baudrate for Altera UART ports"
+	depends on SERIAL_ALTERA_UART
+	default 115200
+	help
+	  This setting lets you define what the default baudrate is for the
+	  Altera UART ports. The usual default varies from board to board,
+	  and this setting is a way of catering for that.
+
+config SERIAL_ALTERA_UART_CONSOLE
+	bool "Altera UART console support"
+	depends on SERIAL_ALTERA_UART
+	select SERIAL_CORE_CONSOLE
+	help
+	  Enable a Altera UART port to be the system console.
+
 endmenu
drivers/serial/Makefile +1 -0
index a4b748f..733a19a 100644
@@ -84,3 +84,4 @@ obj-$(CONFIG_SERIAL_QE) += ucc_uart.o
 obj-$(CONFIG_SERIAL_TIMBERDALE)	+= timbuart.o
 obj-$(CONFIG_SERIAL_GRLIB_GAISLER_APBUART) += apbuart.o
 obj-$(CONFIG_SERIAL_ALTERA_JTAGUART) += altera_jtaguart.o
+obj-$(CONFIG_SERIAL_ALTERA_UART) += altera_uart.o
drivers/serial/altera_uart.c new file +570 -0

570 lines not on this page · raw message

include/linux/altera_uart.h new file +14 -0
new file mode 100644
index 0000000..8d44106
@@ -0,0 +1,14 @@
+/*
+ * altera_uart.h -- Altera UART driver defines.
+ */
+
+#ifndef	__ALTUART_H
+#define	__ALTUART_H
+
+struct altera_uart_platform_uart {
+	unsigned long mapbase;	/* Physical address base */
+	unsigned int irq;	/* Interrupt vector */
+	unsigned int uartclk;	/* UART clock rate */
+};
+
+#endif /* __ALTUART_H */
include/linux/serial_core.h +1 -0
index ade1536..09d0d2d 100644
@@ -184,6 +184,7 @@
 
 /* Altera UARTs */
 #define PORT_ALTERA_JTAGUART	91
+#define PORT_ALTERA_UART	92
 
 #ifdef __KERNEL__
 
Signature · 1 line
1.6.3.3

Tobias Klauser

author maintainer
#0 lore raw

v4 cover serial: Drivers for Altera UARTs

This is the fourth version of the patchset to add the serial drivers for the Altera UARTs. The following changes were made on top of the third version submitted on 5 Mar 2010:

- altera_uart: Remove usage of altera_uart_getppdcd, altera_uart_getppdtr, altera_uart_setppdtr. This makes altera_uart actually compile again (verified on x86_64 with Linus' master branch as of today).

Cheers,
Tobias

Tobias Klauser (2):
serial: Add driver for the Altera JTAG UART
serial: Add driver for the Altera UART

 drivers/serial/Kconfig           |   52 ++++
 drivers/serial/Makefile          |    2 +
 drivers/serial/altera_jtaguart.c |  504 +++++++++++++++++++++++++++++++++
 drivers/serial/altera_uart.c     |  570 ++++++++++++++++++++++++++++++++++++++
 include/linux/altera_jtaguart.h  |   16 +
 include/linux/altera_uart.h      |   14 +
 include/linux/serial_core.h      |    4 +
 7 files changed, 1162 insertions(+), 0 deletions(-)
 create mode 100644 drivers/serial/altera_jtaguart.c
 create mode 100644 drivers/serial/altera_uart.c
 create mode 100644 include/linux/altera_jtaguart.h
 create mode 100644 include/linux/altera_uart.h
author maintainer
#1 lore raw

PATCH v4 1/2 serial: Add driver for the Altera JTAG UART

Add an UART driver for the JTAG UART component available as a SOPC (System on Programmable Chip) component for Altera FPGAs.

---
 drivers/serial/Kconfig           |   21 ++
 drivers/serial/Makefile          |    1 +
 drivers/serial/altera_jtaguart.c |  504 ++++++++++++++++++++++++++++++++++++++
 include/linux/altera_jtaguart.h  |   16 ++
 include/linux/serial_core.h      |    3 +
 5 files changed, 545 insertions(+), 0 deletions(-)
 create mode 100644 drivers/serial/altera_jtaguart.c
 create mode 100644 include/linux/altera_jtaguart.h
drivers/serial/Kconfig +21 -0
index f55c494..b584710 100644
@@ -1506,4 +1506,25 @@ config SERIAL_GRLIB_GAISLER_APBUART_CONSOLE
 	help
 	Support for running a console on the GRLIB APBUART
 
+config SERIAL_ALTERA_JTAGUART
+	bool "Altera JTAG UART support"
+	select SERIAL_CORE
+	help
+	  This driver supports the Altera JTAG UART port.
+
+config SERIAL_ALTERA_JTAGUART_CONSOLE
+	bool "Altera JTAG UART console support"
+	depends on SERIAL_ALTERA_JTAGUART
+	select SERIAL_CORE_CONSOLE
+	help
+	  Enable a Altera JTAG UART port to be the system console.
+
+config SERIAL_ALTERA_JTAGUART_CONSOLE_BYPASS
+	bool "Bypass output when no connection"
+	depends on SERIAL_ALTERA_JTAGUART_CONSOLE
+	select SERIAL_CORE_CONSOLE
+	help
+	  Bypass console output and keep going even if there is no
+	  JTAG terminal connection with the host.
+
 endmenu
drivers/serial/Makefile +1 -0
index 6aa4723..a4b748f 100644
@@ -83,3 +83,4 @@ obj-$(CONFIG_KGDB_SERIAL_CONSOLE) += kgdboc.o
 obj-$(CONFIG_SERIAL_QE) += ucc_uart.o
 obj-$(CONFIG_SERIAL_TIMBERDALE)	+= timbuart.o
 obj-$(CONFIG_SERIAL_GRLIB_GAISLER_APBUART) += apbuart.o
+obj-$(CONFIG_SERIAL_ALTERA_JTAGUART) += altera_jtaguart.o
drivers/serial/altera_jtaguart.c new file +504 -0

504 lines not on this page · raw message

include/linux/altera_jtaguart.h new file +16 -0
new file mode 100644
index 0000000..953b178
@@ -0,0 +1,16 @@
+/*
+ * altera_jtaguart.h -- Altera JTAG UART driver defines.
+ */
+
+#ifndef	__ALTJUART_H
+#define	__ALTJUART_H
+
+#define ALTERA_JTAGUART_MAJOR	204
+#define ALTERA_JTAGUART_MINOR	186
+
+struct altera_jtaguart_platform_uart {
+	unsigned long mapbase;	/* Physical address base */
+	unsigned int irq;	/* Interrupt vector */
+};
+
+#endif /* __ALTJUART_H */
include/linux/serial_core.h +3 -0
index 78dd1e7..ade1536 100644
@@ -182,6 +182,9 @@
 /* Aeroflex Gaisler GRLIB APBUART */
 #define PORT_APBUART    90
 
+/* Altera UARTs */
+#define PORT_ALTERA_JTAGUART	91
+
 #ifdef __KERNEL__
 
 #include <linux/compiler.h>
Signature · 1 line
1.6.3.3