Re: [PATCH 11/13 v3] serial: Add OMAP high-speed UART driver

2010-09-28 Thread Kevin Hilman
Greg KH  writes:

> On Tue, Sep 28, 2010 at 07:52:49AM +0100, Alan Cox wrote:
>> On Mon, 27 Sep 2010 15:05:52 -0700
>> Kevin Hilman  wrote:
>> 
>> > "Govindraj.R"  writes:
>> > 
>> > > This patch adds driver support for OMAP2/3/4 high speed UART.
>> > 
>> > Cc'ing Greg KH and Alan Cox for review of the the new serial driver in
>> > this series.
>> > 
>> > Greg/Alan, this has been on linux-serial several times now with review
>> > mostly from OMAP folks.  If this looks OK from your side, with your
>> > ack(s) we can merge via the OMAP tree with the rest of the series
>> > which is a major reorg/cleanup of the OMAP platform init for serial
>> > drivers.
>> 
>> Looks fine to me

Alan, I'm assuming this as an Acked-by.  

Thanks for the review.

> Same here, feel free to add:
>   Acked-by: Greg Kroah-Hartman 
>
> and add it to the omap tree.

Greg, will merge this series via the OMAP tree.

Thanks,

Kevin
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 11/13 v3] serial: Add OMAP high-speed UART driver

2010-09-28 Thread Greg KH
On Tue, Sep 28, 2010 at 07:52:49AM +0100, Alan Cox wrote:
> On Mon, 27 Sep 2010 15:05:52 -0700
> Kevin Hilman  wrote:
> 
> > "Govindraj.R"  writes:
> > 
> > > This patch adds driver support for OMAP2/3/4 high speed UART.
> > 
> > Cc'ing Greg KH and Alan Cox for review of the the new serial driver in
> > this series.
> > 
> > Greg/Alan, this has been on linux-serial several times now with review
> > mostly from OMAP folks.  If this looks OK from your side, with your
> > ack(s) we can merge via the OMAP tree with the rest of the series
> > which is a major reorg/cleanup of the OMAP platform init for serial
> > drivers.
> 
> Looks fine to me

Same here, feel free to add:
Acked-by: Greg Kroah-Hartman 

and add it to the omap tree.

thanks,

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


Re: [PATCH 11/13 v3] serial: Add OMAP high-speed UART driver

2010-09-28 Thread Alan Cox
On Mon, 27 Sep 2010 15:05:52 -0700
Kevin Hilman  wrote:

> "Govindraj.R"  writes:
> 
> > This patch adds driver support for OMAP2/3/4 high speed UART.
> 
> Cc'ing Greg KH and Alan Cox for review of the the new serial driver in
> this series.
> 
> Greg/Alan, this has been on linux-serial several times now with review
> mostly from OMAP folks.  If this looks OK from your side, with your
> ack(s) we can merge via the OMAP tree with the rest of the series
> which is a major reorg/cleanup of the OMAP platform init for serial
> drivers.

Looks fine to me

Alan
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 11/13 v3] serial: Add OMAP high-speed UART driver

2010-09-27 Thread Kevin Hilman
"Govindraj.R"  writes:

> This patch adds driver support for OMAP2/3/4 high speed UART.

Cc'ing Greg KH and Alan Cox for review of the the new serial driver in
this series.

Greg/Alan, this has been on linux-serial several times now with review
mostly from OMAP folks.  If this looks OK from your side, with your
ack(s) we can merge via the OMAP tree with the rest of the series which
is a major reorg/cleanup of the OMAP platform init for serial drivers.

Thanks,

Kevin


> The driver is made separate from 8250 driver as we cannot
> over load 8250 driver with omap platform specific configuration for
> features like DMA, it makes easier to implement features like DMA and
> hardware flow control and software flow control configuration with
> this driver as required for the omap-platform.
> This patch involves only the core driver and its dependent.
>
> Cc: Tony Lindgren 
> Tested-by: Kevin Hilman 
> Signed-off-by: Govindraj.R 
> ---
>  arch/arm/plat-omap/include/plat/omap-serial.h |  129 +++
>  drivers/serial/Kconfig|   27 +
>  drivers/serial/Makefile   |1 +
>  drivers/serial/omap-serial.c  | 1333 
> +
>  include/linux/serial_core.h   |3 +
>  5 files changed, 1493 insertions(+), 0 deletions(-)
>  create mode 100644 arch/arm/plat-omap/include/plat/omap-serial.h
>  create mode 100644 drivers/serial/omap-serial.c
>
> diff --git a/arch/arm/plat-omap/include/plat/omap-serial.h
> b/arch/arm/plat-omap/include/plat/omap-serial.h
> new file mode 100644
> index 000..0d6f076
> --- /dev/null
> +++ b/arch/arm/plat-omap/include/plat/omap-serial.h
> @@ -0,0 +1,129 @@
> +/*
> + * Driver for OMAP-UART controller.
> + * Based on drivers/serial/8250.c
> + *
> + * Copyright (C) 2010 Texas Instruments.
> + *
> + * Authors:
> + *   Govindraj R 
> + *   Thara Gopinath  
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License as published by
> + * the Free Software Foundation; either version 2 of the License, or
> + * (at your option) any later version.
> + */
> +
> +#ifndef __OMAP_SERIAL_H__
> +#define __OMAP_SERIAL_H__
> +
> +#include 
> +#include 
> +
> +#include 
> +#include 
> +
> +#define DRIVER_NAME  "omap-hsuart"
> +
> +/*
> + * Use tty device name as ttyO, [O -> OMAP]
> + * in bootargs we specify as console=ttyO0 if uart1
> + * is used as console uart.
> + */
> +#define OMAP_SERIAL_NAME "ttyO"
> +
> +#define OMAP_MDR1_DISABLE0x07
> +#define OMAP_MDR1_MODE13X0x03
> +#define OMAP_MDR1_MODE16X0x00
> +#define OMAP_MODE13X_SPEED   230400
> +
> +/*
> + * LCR = 0XBF: Switch to Configuration Mode B.
> + * In configuration mode b allow access
> + * to EFR,DLL,DLH.
> + * Reference OMAP TRM Chapter 17
> + * Section: 1.4.3 Mode Selection
> + */
> +#define OMAP_UART_LCR_CONF_MDB   0XBF
> +
> +/* WER = 0x7F
> + * Enable module level wakeup in WER reg
> + */
> +#define OMAP_UART_WER_MOD_WKUP   0X7F
> +
> +/* Enable XON/XOFF flow control on output */
> +#define OMAP_UART_SW_TX  0x04
> +
> +/* Enable XON/XOFF flow control on input */
> +#define OMAP_UART_SW_RX  0x04
> +
> +#define OMAP_UART_SYSC_RESET 0X07
> +#define OMAP_UART_TCR_TRIG   0X0F
> +#define OMAP_UART_SW_CLR 0XF0
> +#define OMAP_UART_FIFO_CLR   0X06
> +
> +#define OMAP_UART_DMA_CH_FREE-1
> +
> +#define RX_TIMEOUT   (3 * HZ)
> +#define OMAP_MAX_HSUART_PORTS4
> +
> +#define MSR_SAVE_FLAGS   UART_MSR_ANY_DELTA
> +
> +struct omap_uart_port_info {
> + booldma_enabled;/* To specify DMA Mode */
> + unsigned intuartclk;/* UART clock rate */
> + void __iomem*membase;   /* ioremap cookie or NULL */
> + resource_size_t mapbase;/* resource base */
> + unsigned long   irqflags;   /* request_irq flags */
> + upf_t   flags;  /* UPF_* flags */
> +};
> +
> +struct uart_omap_dma {
> + u8  uart_dma_tx;
> + u8  uart_dma_rx;
> + int rx_dma_channel;
> + int tx_dma_channel;
> + dma_addr_t  rx_buf_dma_phys;
> + dma_addr_t  tx_buf_dma_phys;
> + unsigned intuart_base;
> + /*
> +  * Buffer for rx dma.It is not required for tx because the buffer
> +  * comes from port structure.
> +  */
> + unsigned char   *rx_buf;
> + unsigned intprev_rx_dma_pos;
> + int tx_buf_size;
> + int tx_dma_used;
> + int rx_dma_used;
> + spinlock_t  tx_lock;
> + spinlock_t  rx_lock;
> + /* timer to poll activity on rx dma */
> + struct timer_list   rx_timer;
> + int rx_buf_size;
> + int 

Re: [PATCH 11/13 v3] serial: Add OMAP high-speed UART driver

2010-09-27 Thread Greg KH
On Mon, Sep 27, 2010 at 01:55:46PM -0700, Kevin Hilman wrote:
> [resent with correct address for Greg, sorry for duplicates.]
> 
> Greg,
> 
> "Govindraj.R"  writes:
> 
> > This patch adds driver support for OMAP2/3/4 high speed UART.
> 
> According to MAINTAINERS, you seem to be the one looking after the
> serial core.  Are you the one to ack/merge new drivers?

Yup, but Alan Cox is also a good person to get review from as well.

> With your ack, we can merge this through the OMAP tree along with the
> rest of the series that has OMAP-specific platform reorg and updates.
> 
> If you're not the right person, please let us know who would be the
> right person to ack/sign-off on this.

Cc both of us so we can review it please.

thanks,

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


[PATCH 11/13 v3] serial: Add OMAP high-speed UART driver

2010-09-27 Thread Govindraj.R
This patch adds driver support for OMAP2/3/4 high speed UART.

The driver is made separate from 8250 driver as we cannot
over load 8250 driver with omap platform specific configuration for
features like DMA, it makes easier to implement features like DMA and
hardware flow control and software flow control configuration with
this driver as required for the omap-platform.
This patch involves only the core driver and its dependent.

Cc: Tony Lindgren 
Tested-by: Kevin Hilman 
Signed-off-by: Govindraj.R 
---
 arch/arm/plat-omap/include/plat/omap-serial.h |  129 +++
 drivers/serial/Kconfig|   27 +
 drivers/serial/Makefile   |1 +
 drivers/serial/omap-serial.c  | 1333 +
 include/linux/serial_core.h   |3 +
 5 files changed, 1493 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/plat-omap/include/plat/omap-serial.h
 create mode 100644 drivers/serial/omap-serial.c

diff --git a/arch/arm/plat-omap/include/plat/omap-serial.h
b/arch/arm/plat-omap/include/plat/omap-serial.h
new file mode 100644
index 000..0d6f076
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/omap-serial.h
@@ -0,0 +1,129 @@
+/*
+ * Driver for OMAP-UART controller.
+ * Based on drivers/serial/8250.c
+ *
+ * Copyright (C) 2010 Texas Instruments.
+ *
+ * Authors:
+ * Govindraj R 
+ * Thara Gopinath  
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+#ifndef __OMAP_SERIAL_H__
+#define __OMAP_SERIAL_H__
+
+#include 
+#include 
+
+#include 
+#include 
+
+#define DRIVER_NAME"omap-hsuart"
+
+/*
+ * Use tty device name as ttyO, [O -> OMAP]
+ * in bootargs we specify as console=ttyO0 if uart1
+ * is used as console uart.
+ */
+#define OMAP_SERIAL_NAME   "ttyO"
+
+#define OMAP_MDR1_DISABLE  0x07
+#define OMAP_MDR1_MODE13X  0x03
+#define OMAP_MDR1_MODE16X  0x00
+#define OMAP_MODE13X_SPEED 230400
+
+/*
+ * LCR = 0XBF: Switch to Configuration Mode B.
+ * In configuration mode b allow access
+ * to EFR,DLL,DLH.
+ * Reference OMAP TRM Chapter 17
+ * Section: 1.4.3 Mode Selection
+ */
+#define OMAP_UART_LCR_CONF_MDB 0XBF
+
+/* WER = 0x7F
+ * Enable module level wakeup in WER reg
+ */
+#define OMAP_UART_WER_MOD_WKUP 0X7F
+
+/* Enable XON/XOFF flow control on output */
+#define OMAP_UART_SW_TX0x04
+
+/* Enable XON/XOFF flow control on input */
+#define OMAP_UART_SW_RX0x04
+
+#define OMAP_UART_SYSC_RESET   0X07
+#define OMAP_UART_TCR_TRIG 0X0F
+#define OMAP_UART_SW_CLR   0XF0
+#define OMAP_UART_FIFO_CLR 0X06
+
+#define OMAP_UART_DMA_CH_FREE  -1
+
+#define RX_TIMEOUT (3 * HZ)
+#define OMAP_MAX_HSUART_PORTS  4
+
+#define MSR_SAVE_FLAGS UART_MSR_ANY_DELTA
+
+struct omap_uart_port_info {
+   booldma_enabled;/* To specify DMA Mode */
+   unsigned intuartclk;/* UART clock rate */
+   void __iomem*membase;   /* ioremap cookie or NULL */
+   resource_size_t mapbase;/* resource base */
+   unsigned long   irqflags;   /* request_irq flags */
+   upf_t   flags;  /* UPF_* flags */
+};
+
+struct uart_omap_dma {
+   u8  uart_dma_tx;
+   u8  uart_dma_rx;
+   int rx_dma_channel;
+   int tx_dma_channel;
+   dma_addr_t  rx_buf_dma_phys;
+   dma_addr_t  tx_buf_dma_phys;
+   unsigned intuart_base;
+   /*
+* Buffer for rx dma.It is not required for tx because the buffer
+* comes from port structure.
+*/
+   unsigned char   *rx_buf;
+   unsigned intprev_rx_dma_pos;
+   int tx_buf_size;
+   int tx_dma_used;
+   int rx_dma_used;
+   spinlock_t  tx_lock;
+   spinlock_t  rx_lock;
+   /* timer to poll activity on rx dma */
+   struct timer_list   rx_timer;
+   int rx_buf_size;
+   int rx_timeout;
+};
+
+struct uart_omap_port {
+   struct uart_portport;
+   struct uart_omap_dmauart_dma;
+   struct platform_device  *pdev;
+
+   unsigned char   ier;
+   unsigned char   lcr;
+   unsigned char   mcr;
+   unsigned char   fcr;
+   unsigned char   efr;
+
+   int use_dma;
+   /*
+* Some bits in registers are cleared on a read, so they must
+* be saved whenever the register is read but the bits will not
+* be immediately processed.
+*/
+