tty: serial: Add initial MSM UART High Speed Lite driver
PATCH v2 1/1 tty: serial: Add initial MSM UART High Speed Lite driver
From: "Ivan T. Ivanov" <[email protected]>
This is a tty driver with console support for Qualcomm's UART controllers found in the MSM8974 chipsets. Driver is completely based on implementation found in codeaurora.org msm_serial_hs_lite with Android dependences removed. Other changes include, moved to device managed resources and few cleanups.
Driver functionality was tested in LEGACY_HSUART and BLSP_HSUART mode.
---
Changes since v1
Add support for UARTDM v1.3 selectable by compattible = "qcom,msm-lsuart-v1.3" Rename "qcom,msm-lsuart-v14" to "qcom,msm-lsuart-v1.4"
.../bindings/tty/serial/msm_serial_hsl.txt | 53 + drivers/tty/serial/Kconfig | 18 + drivers/tty/serial/Makefile | 1 + drivers/tty/serial/msm_serial_hsl.c | 1407 ++++++++++++++++++++ drivers/tty/serial/msm_serial_hsl.h | 294 ++++ 5 files changed, 1773 insertions(+) create mode 100644 Documentation/devicetree/bindings/tty/serial/msm_serial_hsl.txt create mode 100644 drivers/tty/serial/msm_serial_hsl.c create mode 100644 drivers/tty/serial/msm_serial_hsl.h
Documentation/devicetree/bindings/tty/serial/msm_serial_hsl.txt new file +53 -0
@@ -0,0 +1,53 @@ +* Qualcomm MSM HSUART Lite + +Required properties: +- compatible : + "qcom,msm-lsuart-v1.4" to be used for UARTDM Core v1.4 + "qcom,msm-lsuart-v1.3" to be used for UARTDM Core v1.3 + +- reg : + offset and length of the register set for both the device, + UART core and GBSI core + +- reg-names : + "uart_mem" to be used as name of the UART core + "gbsi_mem" to be used as name of the GBSI core + +The registers for the "qcom,msm-lsuart-v1.4" device have specify +UART core block. GSBI reg is optional if specified driver will use +GSBI specific functionality. + +- interrupts : interrupts for UART core + +- clocks : Must contain an entry for each entry in clock-names. + +- clock-names : Must include the following entries: + "core_clk" - mandatory + "iface_clk" - optional + +For details see: +Documentation/devicetree/bindings/clock/clock-bindings.txt + +Example: + + serial@f991e000 { + compatible = "qcom,msm-lsuart-v1.4"; + reg = <0xf991e000 0x1000>; + reg-names = "uart_mem"; + interrupts = <0 108 0>; + clocks = <&blsp1_uart2_apps_cxc>, <&blsp1_ahb_cxc>; + clock-names = "core_clk", "iface_clk"; + }; + +Aliases : +An alias may be optionally used to bind the UART device to a TTY device +(ttyHSL<alias_num>) with a given alias number. Aliases are of the form +uart<n> where <n> is an integer representing the alias number to use. +On systems with multiple UART devices present, an alias may optionally be +defined for such devices. The alias value should be from 0 to 255. + +Example: + + aliases { + uart4 = &uart7; // This device will be enumerated as ttyHSL4 + };
drivers/tty/serial/Kconfig +18 -0
@@ -1045,6 +1045,24 @@ config SERIAL_MSM_HS Choose M here to compile it as a module. The module will be called msm_serial_hs. +config SERIAL_MSM_HSL + tristate "MSM High speed serial lite mode driver" + depends on ARM && ARCH_MSM + select SERIAL_CORE + default n + help + Select this module to enable MSM high speed lite mode driver + for UART controllers found in MSM8974 SoC's + + Choose M here to compile it as a module. The module will be + called msm_serial_hsl. + +config SERIAL_MSM_HSL_CONSOLE + bool "MSM High speed serial lite mode console support" + depends on SERIAL_MSM_HSL=y + select SERIAL_CORE_CONSOLE + default n + config SERIAL_VT8500 bool "VIA VT8500 on-chip serial port support" depends on ARCH_VT8500
drivers/tty/serial/Makefile +1 -0
@@ -58,6 +58,7 @@ obj-$(CONFIG_SERIAL_ATMEL) += atmel_serial.o obj-$(CONFIG_SERIAL_UARTLITE) += uartlite.o obj-$(CONFIG_SERIAL_MSM) += msm_serial.o obj-$(CONFIG_SERIAL_MSM_HS) += msm_serial_hs.o +obj-$(CONFIG_SERIAL_MSM_HSL) += msm_serial_hsl.o obj-$(CONFIG_SERIAL_NETX) += netx-serial.o obj-$(CONFIG_SERIAL_OF_PLATFORM) += of_serial.o obj-$(CONFIG_SERIAL_OF_PLATFORM_NWPSERIAL) += nwpserial.o
drivers/tty/serial/msm_serial_hsl.c new file +1407 -0
1,407 lines not on this page · raw message
drivers/tty/serial/msm_serial_hsl.h new file +294 -0
294 lines not on this page · raw message
Signature · 1 line
1.7.9.5
Quoted 9 lines · Ivan T. Ivanov
From: "Ivan T. Ivanov" <[email protected]>
This is a tty driver with console support for Qualcomm's UART controllers found in the MSM8974 chipsets. Driver is completely based on implementation found in codeaurora.org
msm_serial_hs_litewith Android dependences removed. Other changes include, moved to device managed resources and few cleanups.Driver functionality was tested in
LEGACY_HSUARTandBLSP_HSUARTmode.
Ivan, do we need this driver with the fixes Stephen Boyd posted that are supposed to fix the problems with the existing msm_serial.c driver? If a single driver can correctly support both devices, that seems like a better solution to me.
David
Signature · 3 lines
sent by an employee of the Qualcomm Innovation Center, Inc. The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, hosted by The Linux Foundation
Hi David,
Quoted 9 lines · David Brown
Quoted 8 lines · Ivan T. Ivanov
From: "Ivan T. Ivanov" <[email protected]>
This is a tty driver with console support for Qualcomm's UART controllers found in the MSM8974 chipsets. Driver is completely based on implementation found in codeaurora.org
msm_serial_hs_litewith Android dependences removed. Other changes include, moved to device managed resources and few cleanups.
Quoted 6 lines
Quoted 1 line
Driver functionality was tested in
LEGACY_HSUARTandBLSP_HSUARTmode.Ivan, do we need this driver with the fixes Stephen Boyd posted that are supposed to fix the problems with the existing
msm_serial.cdriver? If a single driver can correctly support both devices, that seems like a better solution to me.
I have just tested Stephen's changes and they worked for me on 8074 based dragon board, so I am fine to drop my port of the HSL driver.
Regards,
Ivan
Quoted 3 lines
David