Skip to contentSkip to conversation

serial: msm_serial_hs: Add MSM high speed UART driver

PATCH Superseded Mayank Rana 3 participants 7 messages Nov 25, 2010 – Dec 13, 2010

Subsystems (2)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 serial: msm_serial_hs: Add MSM high speed UART driver

This driver supports UART-DM HW on MSM platforms. It uses the on
chip DMA to drive data transfers and has optional support for UART power management independent of Linux suspend/resume and wakeup from Rx.

The driver was originally developed by Google. It is functionally equivalent to the version available at:
http://android.git.kernel.org/?p=kernel/experimental.git
the differences being:
1) Remove wakelocks and change unsupported DMA API.
2) Replace clock selection register codes by macros.
3) Fix checkpatch errors and add inline documentation.
4) Add runtime PM hooks for active power state transitions.

---
 drivers/serial/Kconfig               |   12 +
 drivers/serial/Makefile              |    1 +
 drivers/serial/msm_serial_hs.c       | 1680 
++++++++++++++++++++++++++++++++++
 drivers/serial/msm_serial_hs_hwreg.h |  167 ++++
 include/linux/msm_serial_hs.h        |   49 +
 5 files changed, 1909 insertions(+), 0 deletions(-)
 create mode 100644 drivers/serial/msm_serial_hs.c
 create mode 100644 drivers/serial/msm_serial_hs_hwreg.h
 create mode 100644 include/linux/msm_serial_hs.h
drivers/serial/Kconfig +12 -0
index aff9dcd..0a935ee 100644
@@ -1381,6 +1381,18 @@ config SERIAL_MSM_CONSOLE
     depends on SERIAL_MSM=y
     select SERIAL_CORE_CONSOLE
 
+config SERIAL_MSM_HS
+    tristate "MSM UART High Speed: Serial Driver"
+    depends on ARM && ARCH_MSM
+    select SERIAL_CORE
+    help
+      If you have a machine based on MSM family of SoCs, you
+      can enable its onboard high speed serial port by enabling
+      this option.
+
+      Choose M here to compile it as a module. The module will be
+      called msm_serial_hs.
+
 config SERIAL_NETX
     tristate "NetX serial port support"
     depends on ARM && ARCH_NETX
drivers/serial/Makefile +1 -0
index c570576..667de45 100644
@@ -76,6 +76,7 @@ obj-$(CONFIG_SERIAL_SGI_IOC3) += ioc3_serial.o
 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_NETX) += netx-serial.o
 obj-$(CONFIG_SERIAL_OF_PLATFORM) += of_serial.o
 obj-$(CONFIG_SERIAL_OF_PLATFORM_NWPSERIAL) += nwpserial.o
drivers/serial/msm_serial_hs.c new file +1680 -0

1,680 lines not on this page · raw message

drivers/serial/msm_serial_hs_hwreg.h new file +167 -0

167 lines not on this page · raw message

include/linux/msm_serial_hs.h new file +49 -0

49 lines not on this page · raw message

Signature · 5 lines
1.6.0.4

-- 
Sent by a consultant of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
#1 lore raw
Quoted 14 lines · Mayank Rana

This driver supports UART-DM HW on MSM platforms. It uses the on
chip DMA to drive data transfers and has optional support for UART power management independent of Linux suspend/resume and wakeup from Rx.

The driver was originally developed by Google. It is functionally equivalent to the version available at:
http://android.git.kernel.org/?p=kernel/experimental.git
the differences being:
1) Remove wakelocks and change unsupported DMA API.
2) Replace clock selection register codes by macros.
3) Fix checkpatch errors and add inline documentation.
4) Add runtime PM hooks for active power state transitions.

Quoted 8 lines
---
 drivers/serial/Kconfig               |   12 +
 drivers/serial/Makefile              |    1 +
 drivers/serial/msm_serial_hs.c       | 1680 

++++++++++++++++++++++++++++++++++

Your patch is line-wrapped and can not be applid.

Please fix your email client and try again.

Quoted 49 lines
 drivers/serial/msm_serial_hs_hwreg.h |  167 ++++
 include/linux/msm_serial_hs.h        |   49 +
 5 files changed, 1909 insertions(+), 0 deletions(-)
 create mode 100644 drivers/serial/msm_serial_hs.c
 create mode 100644 drivers/serial/msm_serial_hs_hwreg.h
 create mode 100644 include/linux/msm_serial_hs.h
drivers/serial/Kconfig +12 -0
index aff9dcd..0a935ee 100644
@@ -1381,6 +1381,18 @@ config SERIAL_MSM_CONSOLE
     depends on SERIAL_MSM=y
     select SERIAL_CORE_CONSOLE
 
+config SERIAL_MSM_HS
+    tristate "MSM UART High Speed: Serial Driver"
+    depends on ARM && ARCH_MSM
+    select SERIAL_CORE
+    help
+      If you have a machine based on MSM family of SoCs, you
+      can enable its onboard high speed serial port by enabling
+      this option.
+
+      Choose M here to compile it as a module. The module will be
+      called msm_serial_hs.
+
 config SERIAL_NETX
     tristate "NetX serial port support"
     depends on ARM && ARCH_NETX
drivers/serial/Makefile +1 -0
index c570576..667de45 100644
@@ -76,6 +76,7 @@ obj-$(CONFIG_SERIAL_SGI_IOC3) += ioc3_serial.o
 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_NETX) += netx-serial.o
 obj-$(CONFIG_SERIAL_OF_PLATFORM) += of_serial.o
 obj-$(CONFIG_SERIAL_OF_PLATFORM_NWPSERIAL) += nwpserial.o
drivers/serial/msm_serial_hs.c new file +0 -0
new file mode 100644
index 0000000..4fdc70e

drivers/serial/msm_serial_hs.c line 7

Quoted 7 lines
drivers/serial/msm_serial_hs.c new file +7 -0
@@ -0,0 +1,1680 @@
+/* drivers/serial/msm_serial_hs.c
+ *
+ * MSM 7k/8k High speed uart driver
+ *
+ * Copyright (c) 2007-2010, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2008 Google Inc.
+ * Modified: Nick Pelly <[email protected]>

I don't understand, Nick originally wrote it? Or modified your version?

Quoted 52 lines
drivers/serial/msm_serial_hs.c new file +27 -0
+ *
+ * All source code in this file is licensed under the following license
+ * except where indicated.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, you can find it at http://www.fsf.org
+ */
+
+/*
+ * MSM 7k/8k High speed uart driver
+ *
+ * Has optional support for uart power management independent of linux
+ * suspend/resume:
+ *
+ * RX wakeup.
+ * UART wakeup can be triggered by RX activity (using a wakeup GPIO on the
+ * UART RX pin). This should only be used if there is not a wakeup
+ * GPIO on the UART CTS, and the first RX byte is known (for example, with 

the
+ * Bluetooth Texas Instruments HCILL protocol), since the first RX byte will
+ * always be lost. RTS will be asserted even while the UART is off in this mode
+ * of operation. See msm_serial_hs_platform_data.rx_wakeup_irq.
+ */

drivers/serial/msm_serial_hs.c new file +18 -0
+
+#include <linux/module.h>
+
+#include <linux/serial.h>
+#include <linux/serial_core.h>
+#include <linux/slab.h>
+#include <linux/init.h>
+#include <linux/interrupt.h>
+#include <linux/irq.h>
+#include <linux/io.h>
+#include <linux/ioport.h>
+#include <linux/kernel.h>
+#include <linux/timer.h>
+#include <linux/clk.h>
+#include <linux/platform_device.h>
+#include <linux/pm_runtime.h>
+#include <linux/dma-mapping.h>
+#include <linux/dmapool.h>

drivers/serial/msm_serial_hs.c line 66

Quoted 10 lines
drivers/serial/msm_serial_hs.c new file +10 -0
+#include <linux/wait.h>
+#include <linux/workqueue.h>
+
+#include <asm/atomic.h>
+#include <asm/irq.h>
+#include <asm/system.h>
+
+#include <mach/hardware.h>
+#include <mach/dma.h>
+#include <linux/msm_serial_hs.h>

Please put this file in include/platform_data/ instead.

thanks,

greg k-h

#2 lore raw
Quoted 23 lines · Greg KH
Quoted 14 lines · Mayank Rana

This driver supports UART-DM HW on MSM platforms. It uses the on
chip DMA to drive data transfers and has optional support for UART power management independent of Linux suspend/resume and wakeup from Rx.

The driver was originally developed by Google. It is functionally equivalent to the version available at:
http://android.git.kernel.org/?p=kernel/experimental.git
the differences being:
1) Remove wakelocks and change unsupported DMA API.
2) Replace clock selection register codes by macros.
3) Fix checkpatch errors and add inline documentation.
4) Add runtime PM hooks for active power state transitions.

Quoted 8 lines
---
  drivers/serial/Kconfig               |   12 +
  drivers/serial/Makefile              |    1 +
  drivers/serial/msm_serial_hs.c       | 1680

++++++++++++++++++++++++++++++++++

Quoted 3 lines

Your patch is line-wrapped and can not be applid.

Please fix your email client and try again.

I will make sure that next patch won't have this problem.

Quoted 49 lines
Quoted 49 lines
  drivers/serial/msm_serial_hs_hwreg.h |  167 ++++
  include/linux/msm_serial_hs.h        |   49 +
  5 files changed, 1909 insertions(+), 0 deletions(-)

create mode 100644 drivers/serial/msm_serial_hs.c create mode 100644 drivers/serial/msm_serial_hs_hwreg.h create mode 100644 include/linux/msm_serial_hs.h

drivers/serial/Kconfig +12 -0
index aff9dcd..0a935ee 100644
@@ -1381,6 +1381,18 @@ config SERIAL_MSM_CONSOLE
      depends on SERIAL_MSM=y
      select SERIAL_CORE_CONSOLE
 
+config SERIAL_MSM_HS
+    tristate "MSM UART High Speed: Serial Driver"
+    depends on ARM&&  ARCH_MSM
+    select SERIAL_CORE
+    help
+      If you have a machine based on MSM family of SoCs, you
+      can enable its onboard high speed serial port by enabling
+      this option.
+
+      Choose M here to compile it as a module. The module will be
+      called msm_serial_hs.
+
  config SERIAL_NETX
      tristate "NetX serial port support"
      depends on ARM&&  ARCH_NETX
drivers/serial/Makefile +1 -0
index c570576..667de45 100644
@@ -76,6 +76,7 @@ obj-$(CONFIG_SERIAL_SGI_IOC3) += ioc3_serial.o
  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_NETX) += netx-serial.o
  obj-$(CONFIG_SERIAL_OF_PLATFORM) += of_serial.o
  obj-$(CONFIG_SERIAL_OF_PLATFORM_NWPSERIAL) += nwpserial.o
drivers/serial/msm_serial_hs.c new file +0 -0
new file mode 100644
index 0000000..4fdc70e
@@ -0,0 +1,1680 @@
Quoted 9 lines

drivers/serial/msm_serial_hs.c

Quoted 7 lines
drivers/serial/msm_serial_hs.c new file +7 -0
+/* drivers/serial/msm_serial_hs.c
+ *
+ * MSM 7k/8k High speed uart driver
+ *
+ * Copyright (c) 2007-2010, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2008 Google Inc.
+ * Modified: Nick Pelly<[email protected]>

I don't understand, Nick originally wrote it? Or modified your version?

It looks that very initial driver has been done by QUIC , redone and
redesign by Nick for particular target.

Quoted 55 lines
Quoted 55 lines
drivers/serial/msm_serial_hs.c new file +27 -0
+ *
+ * All source code in this file is licensed under the following license
+ * except where indicated.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, you can find it at http://www.fsf.org
+ */
+
+/*
+ * MSM 7k/8k High speed uart driver
+ *
+ * Has optional support for uart power management independent of linux
+ * suspend/resume:
+ *
+ * RX wakeup.
+ * UART wakeup can be triggered by RX activity (using a wakeup GPIO on the
+ * UART RX pin). This should only be used if there is not a wakeup
+ * GPIO on the UART CTS, and the first RX byte is known (for example, with

the
+ * Bluetooth Texas Instruments HCILL protocol), since the first RX byte will
+ * always be lost. RTS will be asserted even while the UART is off in this mode
+ * of operation. See msm_serial_hs_platform_data.rx_wakeup_irq.
+ */

drivers/serial/msm_serial_hs.c new file +21 -0
+
+#include<linux/module.h>
+
+#include<linux/serial.h>
+#include<linux/serial_core.h>
+#include<linux/slab.h>
+#include<linux/init.h>
+#include<linux/interrupt.h>
+#include<linux/irq.h>
+#include<linux/io.h>
+#include<linux/ioport.h>
+#include<linux/kernel.h>
+#include<linux/timer.h>
+#include<linux/clk.h>
+#include<linux/platform_device.h>
+#include<linux/pm_runtime.h>
+#include<linux/dma-mapping.h>
+#include<linux/dmapool.h>
+#include<linux/wait.h>
+#include<linux/workqueue.h>
+
Quoted 9 lines

drivers/serial/msm_serial_hs.c

Quoted 7 lines
drivers/serial/msm_serial_hs.c new file +7 -0
+#include<asm/atomic.h>
+#include<asm/irq.h>
+#include<asm/system.h>
+
+#include<mach/hardware.h>
+#include<mach/dma.h>
+#include<linux/msm_serial_hs.h>

Please put this file in include/platform_data/ instead.

You mean to say putting msm_serial_hs.h file into include of
arch/arm/<platform_data>.
next patch will have modification for that.

Quoted 7 lines

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 2 lines
Sent by a consultant of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
#3 lore raw
In reply to Greg KH
Quoted 144 lines · Greg KH
Quoted 14 lines · Mayank Rana

This driver supports UART-DM HW on MSM platforms. It uses the on
chip DMA to drive data transfers and has optional support for UART power management independent of Linux suspend/resume and wakeup from Rx.

The driver was originally developed by Google. It is functionally equivalent to the version available at:
http://android.git.kernel.org/?p=kernel/experimental.git
the differences being:
1) Remove wakelocks and change unsupported DMA API.
2) Replace clock selection register codes by macros.
3) Fix checkpatch errors and add inline documentation.
4) Add runtime PM hooks for active power state transitions.

Quoted 8 lines
---
  drivers/serial/Kconfig               |   12 +
  drivers/serial/Makefile              |    1 +
  drivers/serial/msm_serial_hs.c       | 1680

++++++++++++++++++++++++++++++++++

Your patch is line-wrapped and can not be applid.

Please fix your email client and try again.

Quoted 49 lines
  drivers/serial/msm_serial_hs_hwreg.h |  167 ++++
  include/linux/msm_serial_hs.h        |   49 +
  5 files changed, 1909 insertions(+), 0 deletions(-)

create mode 100644 drivers/serial/msm_serial_hs.c create mode 100644 drivers/serial/msm_serial_hs_hwreg.h create mode 100644 include/linux/msm_serial_hs.h

drivers/serial/Kconfig +12 -0
index aff9dcd..0a935ee 100644
@@ -1381,6 +1381,18 @@ config SERIAL_MSM_CONSOLE
      depends on SERIAL_MSM=y
      select SERIAL_CORE_CONSOLE
 
+config SERIAL_MSM_HS
+    tristate "MSM UART High Speed: Serial Driver"
+    depends on ARM&&  ARCH_MSM
+    select SERIAL_CORE
+    help
+      If you have a machine based on MSM family of SoCs, you
+      can enable its onboard high speed serial port by enabling
+      this option.
+
+      Choose M here to compile it as a module. The module will be
+      called msm_serial_hs.
+
  config SERIAL_NETX
      tristate "NetX serial port support"
      depends on ARM&&  ARCH_NETX
drivers/serial/Makefile +1 -0
index c570576..667de45 100644
@@ -76,6 +76,7 @@ obj-$(CONFIG_SERIAL_SGI_IOC3) += ioc3_serial.o
  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_NETX) += netx-serial.o
  obj-$(CONFIG_SERIAL_OF_PLATFORM) += of_serial.o
  obj-$(CONFIG_SERIAL_OF_PLATFORM_NWPSERIAL) += nwpserial.o
drivers/serial/msm_serial_hs.c new file +0 -0
new file mode 100644
index 0000000..4fdc70e

drivers/serial/msm_serial_hs.c line 7

Quoted 7 lines
drivers/serial/msm_serial_hs.c new file +7 -0
@@ -0,0 +1,1680 @@
+/* drivers/serial/msm_serial_hs.c
+ *
+ * MSM 7k/8k High speed uart driver
+ *
+ * Copyright (c) 2007-2010, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2008 Google Inc.
+ * Modified: Nick Pelly<[email protected]>

I don't understand, Nick originally wrote it? Or modified your version?

Quoted 56 lines
drivers/serial/msm_serial_hs.c new file +27 -0
+ *
+ * All source code in this file is licensed under the following license
+ * except where indicated.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, you can find it at http://www.fsf.org
+ */
+
+/*
+ * MSM 7k/8k High speed uart driver
+ *
+ * Has optional support for uart power management independent of linux
+ * suspend/resume:
+ *
+ * RX wakeup.
+ * UART wakeup can be triggered by RX activity (using a wakeup GPIO on the
+ * UART RX pin). This should only be used if there is not a wakeup
+ * GPIO on the UART CTS, and the first RX byte is known (for example, with

the
+ * Bluetooth Texas Instruments HCILL protocol), since the first RX byte will
+ * always be lost. RTS will be asserted even while the UART is off in this mode
+ * of operation. See msm_serial_hs_platform_data.rx_wakeup_irq.
+ */

drivers/serial/msm_serial_hs.c new file +22 -0
+
+#include<linux/module.h>
+
+#include<linux/serial.h>
+#include<linux/serial_core.h>
+#include<linux/slab.h>
+#include<linux/init.h>
+#include<linux/interrupt.h>
+#include<linux/irq.h>
+#include<linux/io.h>
+#include<linux/ioport.h>
+#include<linux/kernel.h>
+#include<linux/timer.h>
+#include<linux/clk.h>
+#include<linux/platform_device.h>
+#include<linux/pm_runtime.h>
+#include<linux/dma-mapping.h>
+#include<linux/dmapool.h>
+#include<linux/wait.h>
+#include<linux/workqueue.h>
+
+#include<asm/atomic.h>
Quoted 8 lines

drivers/serial/msm_serial_hs.c

Quoted 6 lines
drivers/serial/msm_serial_hs.c new file +6 -0
+#include<asm/irq.h>
+#include<asm/system.h>
+
+#include<mach/hardware.h>
+#include<mach/dma.h>
+#include<linux/msm_serial_hs.h>

Please put this file in include/platform_data/ instead.

Greg,

Thanks for reviewing the patch.
Is there any particular reason not allowing msm_serial_hs.h as part of include/linux and need of moving same into as part of include/platform_data? I am seeing multiple driver doing same. Can you please suggest on this ?

Regards,
_-_Mayank Rana_-_

Signature · 2 lines
Sent by a consultant of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
#4 lore raw
Quoted 10 lines · Mayank Rana
Quoted 3 lines
Quoted 1 line

+#include<linux/msm_serial_hs.h>

Please put this file in include/platform_data/ instead.

Greg,

Thanks for reviewing the patch.
Is there any particular reason not allowing msm_serial_hs.h as part of include/linux and need of moving same into as part of include/platform_data? I am seeing multiple driver doing same. Can you please suggest on this ?

Yes, it's not good to clutter up include/linux/ with this kind of platform specific stuff. Create a new directory and we will then move all of these types of files over to it, yours will be one of the first.

thanks,

greg k-h

#5 lore raw
Quoted 3 lines · Greg KH

Yes, it's not good to clutter up include/linux/ with this kind of platform specific stuff. Create a new directory and we will then move all of these types of files over to it, yours will be one of the first.

I like this idea. If we agree on the directory name of include/linux/platform_data then I'll start having people change that as they are preparing various drivers for submission.

Thanks,
David

Signature · 2 lines
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
#6 lore raw
Quoted 9 lines · David Brown
Quoted 3 lines · Greg KH

Yes, it's not good to clutter up include/linux/ with this kind of platform specific stuff. Create a new directory and we will then move all of these types of files over to it, yours will be one of the first.

I like this idea. If we agree on the directory name of include/linux/platform_data then I'll start having people change that as they are preparing various drivers for submission.

I thought people already agreed on this, as it's come up a number of times over the past few months :)

thanks,

greg k-h