All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xen/serial: setup UART idle mode for OMAP
@ 2014-12-05 13:46 Oleksandr Dmytryshyn
  2014-12-05 14:20 ` Julien Grall
  0 siblings, 1 reply; 5+ messages in thread
From: Oleksandr Dmytryshyn @ 2014-12-05 13:46 UTC (permalink / raw)
  To: xen-devel; +Cc: Tim Deegan, Daniel De Graaf, Stefano Stabellini, Ian Campbell

UART is not able to receive bytes when idle mode is not
configured properly. When we use Xen with old Linux
Kernel (for example 3.8) this kernel configures UART
idle mode even if the UART node in device tree is absent.
So UART works normally in this case. But new Linux
Kernel (3.12 and upper) doesn't configure idle mode for
UART and UART can not work normally in this case.

Signed-off-by: Oleksandr Dmytryshyn <oleksandr.dmytryshyn@globallogic.com>
---
 xen/drivers/char/omap-uart.c | 3 +++
 xen/include/xen/8250-uart.h  | 4 ++++
 2 files changed, 7 insertions(+)

diff --git a/xen/drivers/char/omap-uart.c b/xen/drivers/char/omap-uart.c
index a798b8d..16d1454 100644
--- a/xen/drivers/char/omap-uart.c
+++ b/xen/drivers/char/omap-uart.c
@@ -195,6 +195,9 @@ static void __init omap_uart_init_preirq(struct serial_port *port)
     omap_write(uart, UART_MCR, UART_MCR_DTR|UART_MCR_RTS);
 
     omap_write(uart, UART_OMAP_MDR1, UART_OMAP_MDR1_16X_MODE);
+
+    /* setup iddle mode */
+    omap_write(uart, UART_SYSC, OMAP_UART_SYSC_DEF_CONF);
 }
 
 static void __init omap_uart_init_postirq(struct serial_port *port)
diff --git a/xen/include/xen/8250-uart.h b/xen/include/xen/8250-uart.h
index a682bae..304b9dd 100644
--- a/xen/include/xen/8250-uart.h
+++ b/xen/include/xen/8250-uart.h
@@ -32,6 +32,7 @@
 #define UART_MCR          0x04    /* Modem control        */
 #define UART_LSR          0x05    /* line status          */
 #define UART_MSR          0x06    /* Modem status         */
+#define UART_SYSC         0x15    /* System configuration register */
 #define UART_USR          0x1f    /* Status register (DW) */
 #define UART_DLL          0x00    /* divisor latch (ls) (DLAB=1) */
 #define UART_DLM          0x01    /* divisor latch (ms) (DLAB=1) */
@@ -145,6 +146,9 @@
 /* SCR register bitmasks */
 #define OMAP_UART_SCR_RX_TRIG_GRANU1_MASK (1 << 7)
 
+/* System configuration register */
+#define OMAP_UART_SYSC_DEF_CONF 0x0d /* autoidle mode, wakeup is enabled */
+
 #endif /* __XEN_8250_UART_H__ */
 
 /*
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] xen/serial: setup UART idle mode for OMAP
  2014-12-05 13:46 [PATCH] xen/serial: setup UART idle mode for OMAP Oleksandr Dmytryshyn
@ 2014-12-05 14:20 ` Julien Grall
  2014-12-08  6:34   ` Oleksandr Dmytryshyn
  0 siblings, 1 reply; 5+ messages in thread
From: Julien Grall @ 2014-12-05 14:20 UTC (permalink / raw)
  To: Oleksandr Dmytryshyn, xen-devel
  Cc: Stefano Stabellini, Daniel De Graaf, Tim Deegan, Ian Campbell

Hi Oleksandr,

On 05/12/14 13:46, Oleksandr Dmytryshyn wrote:
> UART is not able to receive bytes when idle mode is not
> configured properly. When we use Xen with old Linux
> Kernel (for example 3.8) this kernel configures UART
> idle mode even if the UART node in device tree is absent.

I don't understand how the kernel can configure the UART as the MMIO
range is not mapped. Is there another way to set the idle mode?

Regards,

-- 
Julien Grall

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] xen/serial: setup UART idle mode for OMAP
  2014-12-05 14:20 ` Julien Grall
@ 2014-12-08  6:34   ` Oleksandr Dmytryshyn
  2014-12-08 12:02     ` Julien Grall
  0 siblings, 1 reply; 5+ messages in thread
From: Oleksandr Dmytryshyn @ 2014-12-08  6:34 UTC (permalink / raw)
  To: Julien Grall
  Cc: Stefano Stabellini, Daniel De Graaf, Tim Deegan, Ian Campbell, xen-devel

In our case We've added an additional fake node to the device tree with
UART MMIO range for Xen and Xen mapped this MMIO range
for the Kernel 3.8. By default UART has wrong configuration in OMAP.

Oleksandr Dmytryshyn | Product Engineering and Development
GlobalLogic
M +38.067.382.2525
www.globallogic.com

http://www.globallogic.com/email_disclaimer.txt


On Fri, Dec 5, 2014 at 4:20 PM, Julien Grall <julien.grall@linaro.org> wrote:
> Hi Oleksandr,
>
> On 05/12/14 13:46, Oleksandr Dmytryshyn wrote:
>> UART is not able to receive bytes when idle mode is not
>> configured properly. When we use Xen with old Linux
>> Kernel (for example 3.8) this kernel configures UART
>> idle mode even if the UART node in device tree is absent.
>
> I don't understand how the kernel can configure the UART as the MMIO
> range is not mapped. Is there another way to set the idle mode?
>
> Regards,
>
> --
> Julien Grall

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] xen/serial: setup UART idle mode for OMAP
  2014-12-08  6:34   ` Oleksandr Dmytryshyn
@ 2014-12-08 12:02     ` Julien Grall
  2014-12-08 13:33       ` Oleksandr Dmytryshyn
  0 siblings, 1 reply; 5+ messages in thread
From: Julien Grall @ 2014-12-08 12:02 UTC (permalink / raw)
  To: Oleksandr Dmytryshyn
  Cc: Stefano Stabellini, Daniel De Graaf, Tim Deegan, Ian Campbell, xen-devel

Hi Oleksandr,

Please avoid top-post.

On 08/12/14 06:34, Oleksandr Dmytryshyn wrote:
> In our case We've added an additional fake node to the device tree with
> UART MMIO range for Xen and Xen mapped this MMIO range
> for the Kernel 3.8. By default UART has wrong configuration in OMAP.

Ok. So it has to be configured properly with Kernel 3.8 too. Your commit
message suggests it works without any kind of workaround on this kernel
version with Xen upstream.

Can you update the commit message?

Regards,

-- 
Julien Grall

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] xen/serial: setup UART idle mode for OMAP
  2014-12-08 12:02     ` Julien Grall
@ 2014-12-08 13:33       ` Oleksandr Dmytryshyn
  0 siblings, 0 replies; 5+ messages in thread
From: Oleksandr Dmytryshyn @ 2014-12-08 13:33 UTC (permalink / raw)
  To: Julien Grall
  Cc: Stefano Stabellini, Daniel De Graaf, Tim Deegan, Ian Campbell, xen-devel

On Mon, Dec 8, 2014 at 2:02 PM, Julien Grall <julien.grall@linaro.org> wrote:
>
> Hi Oleksandr,
>
> Please avoid top-post.
>
> On 08/12/14 06:34, Oleksandr Dmytryshyn wrote:
> > In our case We've added an additional fake node to the device tree with
> > UART MMIO range for Xen and Xen mapped this MMIO range
> > for the Kernel 3.8. By default UART has wrong configuration in OMAP.
>
> Ok. So it has to be configured properly with Kernel 3.8 too. Your commit
> message suggests it works without any kind of workaround on this kernel
> version with Xen upstream.
>
> Can you update the commit message?
I'll do this.

> Regards,
>
> --
> Julien Grall

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-12-08 13:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-05 13:46 [PATCH] xen/serial: setup UART idle mode for OMAP Oleksandr Dmytryshyn
2014-12-05 14:20 ` Julien Grall
2014-12-08  6:34   ` Oleksandr Dmytryshyn
2014-12-08 12:02     ` Julien Grall
2014-12-08 13:33       ` Oleksandr Dmytryshyn

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.