diff mbox

OMAP: UART: don't initialize membase and mapbase when its port is not enabled

Message ID 4d34a0a70905140141t3f8e2b08uefb4141f904bfcc@mail.gmail.com (mailing list archive)
State Accepted
Delegated to: Kevin Hilman
Headers show

Commit Message

kim kyuwon May 14, 2009, 8:41 a.m. UTC
Hi All,

We are using two UARTs port in OMAP3430 board shown as following
 UART 1 - not used
 UART 2 - BT
 UART 3 - console ("console=ttyS2,115200n8" in 'bootargs' of bootloader)

Because we are not using UART port 1, I configured our board file as following
 735 static struct omap_uart_config omap3_boardname_uart_config __initdata = {
 736         .enabled_uarts  = ((1 << 1) | (1 << 2)),
 737 };
However, I couldn't see any console message.

If I configured like
 735 static struct omap_uart_config omap3_boardname_uart_config __initdata = {
 736         .enabled_uarts  = ((1 << 0) (1 << 1) | (1 << 2)),
 737 };
I could see console messages. But I think this is not the real solution.

Is it correct to use ttyS2, if I use UART3 as console UART?

Anyway, I kept track of this problem and I'm sending the patch.

Please let me know your opinion about this patch.

---
From 88fc1f0872fd2c6ac42501027e5bf69156cce37f Mon Sep 17 00:00:00 2001
From: Kim Kyuwon <q1.kim@samsung.com>
Date: Thu, 14 May 2009 17:05:35 +0900
Subject: [PATCH] OMAP: UART: don't initialize membase and mapbase when
its port is not enabled

If membase and mapbase are zero, its uart port which is registered to
serial8250(i.e serial8250_port[i]) is overridden, because the
serial8250_find_match_or_unsed() function consider this port as a
unused entry. This make the serial2850_console_setup function use
incorrect uart port, because co->index is used as the index of
serial8250_port. This patch prevent using wrong index of uart.

Signed-off-by: Kim Kyuwon <q1.kim@samsung.com>
---
 arch/arm/mach-omap2/serial.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)

Comments

Grazvydas Ignotas May 14, 2009, 2:09 p.m. UTC | #1
2009/5/14 Kim Kyuwon <chammoru@gmail.com>:
> Hi All,
>
> We are using two UARTs port in OMAP3430 board shown as following
>  UART 1 - not used
>  UART 2 - BT
>  UART 3 - console ("console=ttyS2,115200n8" in 'bootargs' of bootloader)
>
> Because we are not using UART port 1, I configured our board file as following
>  735 static struct omap_uart_config omap3_boardname_uart_config __initdata = {
>  736         .enabled_uarts  = ((1 << 1) | (1 << 2)),
>  737 };
> However, I couldn't see any console message.
>
> If I configured like
>  735 static struct omap_uart_config omap3_boardname_uart_config __initdata = {
>  736         .enabled_uarts  = ((1 << 0) (1 << 1) | (1 << 2)),
>  737 };
> I could see console messages. But I think this is not the real solution.
>
> Is it correct to use ttyS2, if I use UART3 as console UART?
>
> Anyway, I kept track of this problem and I'm sending the patch.

In your case UART2 becomes ttyS0 and UART3 becomes ttyS1, so use
"console=ttyS1" in your bootargs. There is no point exposing UART1 as
ttyS0 in Linux if it's not connected on your board.
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
index 4dcf39c..01c2da7 100644
--- a/arch/arm/mach-omap2/serial.c
+++ b/arch/arm/mach-omap2/serial.c
@@ -118,11 +118,8 @@  void __init omap_serial_init(void)
 	for (i = 0; i < OMAP_MAX_NR_PORTS; i++) {
 		struct plat_serial8250_port *p = serial_platform_data + i;

-		if (!(info->enabled_uarts & (1 << i))) {
-			p->membase = NULL;
-			p->mapbase = 0;
+		if (!(info->enabled_uarts & (1 << i)))
 			continue;
-		}

 		sprintf(name, "uart%d_ick", i+1);
 		uart_ick[i] = clk_get(NULL, name);