linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] serial: Provide capability to disable modem status interrupts in 8250 driver
@ 2011-01-04 13:51 Michael Williamson
  2011-01-04 13:51 ` [PATCH 2/2] davinci: Disable modem status (CTS) interrupts on UART1 Michael Williamson
  2011-01-04 13:56 ` [PATCH 1/2] serial: Provide capability to disable modem status interrupts in 8250 driver Alan Cox
  0 siblings, 2 replies; 4+ messages in thread
From: Michael Williamson @ 2011-01-04 13:51 UTC (permalink / raw)
  To: linux-arm-kernel

Certain SOC platforms utilize the 8250 serial UART core that do not provide
valid modem control lines (in particular, CTS).  A mechanism is needed to
allow platforms to configure the 8250 driver to disable modem status interrupts.
Add a new UPF_NO_MSR flag and use it to check for the condition.

This patch was tested using a MityDSP-L138F platform having a UART CTS pin
connected to a clock signal (and configured, via pinmux, as a clock input
for another peripheral function).

Signed-off-by: Michael Williamson <michael.williamson@criticallink.com>
---
Tested against linux-davinci tree.
Checked that patch against davinci-next was successful.

 drivers/serial/8250.c       |    3 ++-
 include/linux/serial_core.h |    3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
index 09a5508..5b9e9f3 100644
--- a/drivers/serial/8250.c
+++ b/drivers/serial/8250.c
@@ -2613,7 +2613,8 @@ static void serial8250_config_port(struct uart_port *port, int flags)
 		autoconfig(up, probeflags);
 
 	/* if access method is AU, it is a 16550 with a quirk */
-	if (up->port.type == PORT_16550A && up->port.iotype == UPIO_AU)
+	if ((up->port.type == PORT_16550A && up->port.iotype == UPIO_AU) ||
+	     up->port.flags & UPF_NO_MSR)
 		up->bugs |= UART_BUG_NOMSR;
 
 	if (up->port.type != PORT_UNKNOWN && flags & UART_CONFIG_IRQ)
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index 212eb4c..e76064e 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -339,6 +339,7 @@ struct uart_port {
 #define UPF_BUGGY_UART		((__force upf_t) (1 << 14))
 #define UPF_NO_TXEN_TEST	((__force upf_t) (1 << 15))
 #define UPF_MAGIC_MULTIPLIER	((__force upf_t) (1 << 16))
+#define UPF_NO_MSR		((__force upf_t) (1 << 17))
 #define UPF_CONS_FLOW		((__force upf_t) (1 << 23))
 #define UPF_SHARE_IRQ		((__force upf_t) (1 << 24))
 /* The exact UART type is known and should not be probed.  */
@@ -348,7 +349,7 @@ struct uart_port {
 #define UPF_DEAD		((__force upf_t) (1 << 30))
 #define UPF_IOREMAP		((__force upf_t) (1 << 31))
 
-#define UPF_CHANGE_MASK		((__force upf_t) (0x17fff))
+#define UPF_CHANGE_MASK		((__force upf_t) (0x37fff))
 #define UPF_USR_MASK		((__force upf_t) (UPF_SPD_MASK|UPF_LOW_LATENCY))
 
 	unsigned int		mctrl;			/* current modem ctrl settings */
-- 
1.7.0.4

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

* [PATCH 2/2] davinci: Disable modem status (CTS) interrupts on UART1
  2011-01-04 13:51 [PATCH 1/2] serial: Provide capability to disable modem status interrupts in 8250 driver Michael Williamson
@ 2011-01-04 13:51 ` Michael Williamson
  2011-01-04 13:56 ` [PATCH 1/2] serial: Provide capability to disable modem status interrupts in 8250 driver Alan Cox
  1 sibling, 0 replies; 4+ messages in thread
From: Michael Williamson @ 2011-01-04 13:51 UTC (permalink / raw)
  To: linux-arm-kernel

All supported configurations of the MityDSP-L138 and MityARM-1808 platforms do
not use the CTS pin associated with UART1 as a CTS function.  Instead, this
pin is typically configured as AHCLKX for the McASP or as the USB reference clock.
Disable the modem status interrupts that may be generated by this pin toggling.

Signed-off-by: Michael Williamson <michael.williamson@criticallink.com>
---
 arch/arm/mach-davinci/board-mityomapl138.c |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-davinci/board-mityomapl138.c b/arch/arm/mach-davinci/board-mityomapl138.c
index 0bb5f0c..87ffe06 100644
--- a/arch/arm/mach-davinci/board-mityomapl138.c
+++ b/arch/arm/mach-davinci/board-mityomapl138.c
@@ -17,6 +17,7 @@
 #include <linux/i2c.h>
 #include <linux/i2c/at24.h>
 #include <linux/etherdevice.h>
+#include <linux/serial_8250.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
@@ -352,6 +353,16 @@ static struct platform_device da850_pm_device = {
 	.id	= -1,
 };
 
+static void __init mityomapl138_init_serial(void)
+{
+	struct davinci_soc_info *soc_info = &davinci_soc_info;
+	struct device *dev = &soc_info->serial_dev->dev;
+	struct plat_serial8250_port *p = dev->platform_data;
+
+	p[1].flags |= UPF_NO_MSR;
+	davinci_serial_init(&mityomapl138_uart_config);
+}
+
 static void __init mityomapl138_init(void)
 {
 	int ret;
@@ -365,7 +376,7 @@ static void __init mityomapl138_init(void)
 	if (ret)
 		pr_warning("watchdog registration failed: %d\n", ret);
 
-	davinci_serial_init(&mityomapl138_uart_config);
+	mityomapl138_init_serial();
 
 	ret = da8xx_register_i2c(0, &mityomap_i2c_0_pdata);
 	if (ret)
-- 
1.7.0.4

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

* [PATCH 1/2] serial: Provide capability to disable modem status interrupts in 8250 driver
  2011-01-04 13:51 [PATCH 1/2] serial: Provide capability to disable modem status interrupts in 8250 driver Michael Williamson
  2011-01-04 13:51 ` [PATCH 2/2] davinci: Disable modem status (CTS) interrupts on UART1 Michael Williamson
@ 2011-01-04 13:56 ` Alan Cox
  2011-01-04 14:10   ` Michael Williamson
  1 sibling, 1 reply; 4+ messages in thread
From: Alan Cox @ 2011-01-04 13:56 UTC (permalink / raw)
  To: linux-arm-kernel

> This patch was tested using a MityDSP-L138F platform having a UART CTS pin
> connected to a clock signal (and configured, via pinmux, as a clock input
> for another peripheral function).

Please hide such horrors in your platform code. We are trying todrive all
the quirks stuff we can out of the core code.

Instead provide your own I/O methods when registering the port and mask
the appropriate bogus bits in the register.

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

* [PATCH 1/2] serial: Provide capability to disable modem status interrupts in 8250 driver
  2011-01-04 13:56 ` [PATCH 1/2] serial: Provide capability to disable modem status interrupts in 8250 driver Alan Cox
@ 2011-01-04 14:10   ` Michael Williamson
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Williamson @ 2011-01-04 14:10 UTC (permalink / raw)
  To: linux-arm-kernel

On 1/4/2011 8:56 AM, Alan Cox wrote:

>> This patch was tested using a MityDSP-L138F platform having a UART CTS pin
>> connected to a clock signal (and configured, via pinmux, as a clock input
>> for another peripheral function).
> 
> Please hide such horrors in your platform code. We are trying todrive all
> the quirks stuff we can out of the core code.
> 
> Instead provide your own I/O methods when registering the port and mask
> the appropriate bogus bits in the register.
> 


Got it.  Thanks for the guidance.

-Mike

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

end of thread, other threads:[~2011-01-04 14:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-04 13:51 [PATCH 1/2] serial: Provide capability to disable modem status interrupts in 8250 driver Michael Williamson
2011-01-04 13:51 ` [PATCH 2/2] davinci: Disable modem status (CTS) interrupts on UART1 Michael Williamson
2011-01-04 13:56 ` [PATCH 1/2] serial: Provide capability to disable modem status interrupts in 8250 driver Alan Cox
2011-01-04 14:10   ` Michael Williamson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).