Skip to contentSkip to conversation

tty: serial: add Freescale lpuart driver support

PATCH Superseded Jingchang Lu 3 participants 4 messages May 30, 2013 – Jun 4, 2013

Subsystems (2)

v5 of 7 Superseded Latest is v7 →

lore
Share & tools
lore
#0 lore raw

PATCH v5 1/1 tty: serial: add Freescale lpuart driver support

Add Freescale lpuart driver support. The lpuart device can be found on Vybrid VF610 and Layerscape LS-1 SoCs.

---
changes in v5:
Coding style fix, remove redundant code.
Checking clk_prepare_enable return value.
Using devm_ioremap_resource instead of devm_request_and_ioremap.

changes in v4:
Change Vybrid VF610 SoC compatible string to "fsl,vf610-lpuart"

changes in v3:
Use general driver name lpuart instead of mvf for further share between SoCs. Add bind doc in Documentation/devicetree/bindings/tty/serial. Remove unused #include header lines and clean up code.

changes in v2:
Remove unused variables and clean up the code.

 .../devicetree/bindings/tty/serial/fsl-lpuart.txt  |  14 +
 drivers/tty/serial/Kconfig                         |  14 +
 drivers/tty/serial/Makefile                        |   1 +
 drivers/tty/serial/fsl_lpuart.c                    | 873 +++++++++++++++++++++
 include/uapi/linux/serial_core.h                   |   3 +
 5 files changed, 905 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/tty/serial/fsl-lpuart.txt
 create mode 100644 drivers/tty/serial/fsl_lpuart.c
Documentation/devicetree/bindings/tty/serial/fsl-lpuart.txt new file +14 -0
new file mode 100644
index 0000000..6fd1dd1
@@ -0,0 +1,14 @@
+* Freescale low power universal asynchronous receiver/transmitter (lpuart)
+
+Required properties:
+- compatible : Should be "fsl,<soc>-lpuart"
+- reg : Address and length of the register set for the device
+- interrupts : Should contain uart interrupt
+
+Example:
+
+uart0: serial at 40027000 {
+	       compatible = "fsl,vf610-lpuart";
+	       reg = <0x40027000 0x1000>;
+	       interrupts = <0 61 0x00>;
+       };
drivers/tty/serial/Kconfig +14 -0
index 7e7006f..aee7030 100644
@@ -1484,6 +1484,20 @@ config SERIAL_RP2_NR_UARTS
 	  If multiple cards are present, the default limit of 32 ports may
 	  need to be increased.
 
+config SERIAL_FSL_LPUART
+	bool "Freescale lpuart serial port support"
+	select SERIAL_CORE
+	help
+	  Support for the on-chip lpuart on some Freescale SOCs.
+
+config SERIAL_FSL_LPUART_CONSOLE
+	bool "Console on Freescale lpuart serial port"
+	depends on SERIAL_FSL_LPUART
+	select SERIAL_CORE_CONSOLE
+	help
+	  If you have enabled the lpuart serial port on the Freescale SoCs,
+	  you can make it the console by answering Y to this option.
+
 endmenu
 
 endif # TTY
drivers/tty/serial/Makefile +1 -0
index eedfec4..cf650f0 100644
@@ -85,3 +85,4 @@ obj-$(CONFIG_SERIAL_AR933X)   += ar933x_uart.o
 obj-$(CONFIG_SERIAL_EFM32_UART) += efm32-uart.o
 obj-$(CONFIG_SERIAL_ARC)	+= arc_uart.o
 obj-$(CONFIG_SERIAL_RP2)	+= rp2.o
+obj-$(CONFIG_SERIAL_FSL_LPUART)	+= fsl_lpuart.o
drivers/tty/serial/fsl_lpuart.c new file +873 -0

873 lines not on this page · raw message

include/uapi/linux/serial_core.h +3 -0
index 74c2bf7..c8eaeb5 100644
@@ -226,4 +226,7 @@
 /* Rocketport EXPRESS/INFINITY */
 #define PORT_RP2	102
 
+/* Freescale lpuart */
+#define PORT_LPUART	103
+
 #endif /* _UAPILINUX_SERIAL_CORE_H */
Signature · 1 line
1.8.0
maintainer
#2 lore raw

PATCH v5 1/1 tty: serial: add Freescale lpuart driver support

In reply to Jingchang Lu
Quoted 56 lines · Jingchang Lu

Add Freescale lpuart driver support. The lpuart device can be found on Vybrid VF610 and Layerscape LS-1 SoCs.

---
changes in v5:
Coding style fix, remove redundant code.
Checking clk_prepare_enable return value.
Using devm_ioremap_resource instead of devm_request_and_ioremap.

changes in v4:
Change Vybrid VF610 SoC compatible string to "fsl,vf610-lpuart"

changes in v3:
Use general driver name lpuart instead of mvf for further share between SoCs. Add bind doc in Documentation/devicetree/bindings/tty/serial. Remove unused #include header lines and clean up code.

changes in v2:
Remove unused variables and clean up the code.

 .../devicetree/bindings/tty/serial/fsl-lpuart.txt  |  14 +
 drivers/tty/serial/Kconfig                         |  14 +
 drivers/tty/serial/Makefile                        |   1 +
 drivers/tty/serial/fsl_lpuart.c                    | 873 +++++++++++++++++++++
 include/uapi/linux/serial_core.h                   |   3 +
 5 files changed, 905 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/tty/serial/fsl-lpuart.txt
 create mode 100644 drivers/tty/serial/fsl_lpuart.c
Documentation/devicetree/bindings/tty/serial/fsl-lpuart.txt new file +14 -0
new file mode 100644
index 0000000..6fd1dd1
@@ -0,0 +1,14 @@
+* Freescale low power universal asynchronous receiver/transmitter (lpuart)
+
+Required properties:
+- compatible : Should be "fsl,<soc>-lpuart"
+- reg : Address and length of the register set for the device
+- interrupts : Should contain uart interrupt
+
+Example:
+
+uart0: serial at 40027000 {
+	       compatible = "fsl,vf610-lpuart";
+	       reg = <0x40027000 0x1000>;
+	       interrupts = <0 61 0x00>;
+       };
drivers/tty/serial/Kconfig +0 -0
index 7e7006f..aee7030 100644

drivers/tty/serial/Kconfig config SERIAL_RP2_NR_UARTS · line 1488

Quoted 5 lines
drivers/tty/serial/Kconfig +2 -0
@@ -1484,6 +1484,20 @@ config SERIAL_RP2_NR_UARTS
 	  If multiple cards are present, the default limit of 32 ports may
 	  need to be increased.
 
+config SERIAL_FSL_LPUART
+	bool "Freescale lpuart serial port support"

Why can't this be built as a module? I can't force users to only build this driver into the kernel, sorry.

greg k-h

#3 lore raw

PATCH v5 1/1 tty: serial: add Freescale lpuart driver support

Quoted 5 lines

drivers/tty/serial/Kconfig config SERIAL_RP2_NR_UARTS · line 1488

Quoted 2 lines
drivers/tty/serial/Kconfig +2 -0
+config SERIAL_FSL_LPUART
+	bool "Freescale lpuart serial port support"

Why can't this be built as a module? I can't force users to only build this driver into the kernel, sorry.

[Lu Jingchang-B35083]
I'll enable the module support for this driver, thanks!