From patchwork Thu May 14 08:41:44 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: kim kyuwon X-Patchwork-Id: 23722 X-Patchwork-Delegate: khilman@deeprootsystems.com Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n4E8hGNg003968 for ; Thu, 14 May 2009 08:43:16 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754107AbZENInN (ORCPT ); Thu, 14 May 2009 04:43:13 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752423AbZENInN (ORCPT ); Thu, 14 May 2009 04:43:13 -0400 Received: from mail-qy0-f133.google.com ([209.85.221.133]:65504 "EHLO mail-qy0-f133.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751423AbZENInM convert rfc822-to-8bit (ORCPT ); Thu, 14 May 2009 04:43:12 -0400 Received: by qyk39 with SMTP id 39so2171593qyk.33 for ; Thu, 14 May 2009 01:43:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:from:date:message-id :subject:to:cc:content-type:content-transfer-encoding; bh=5GYYXCTYLCQyB8y0Mr2AGkIReiemIDmr4ldworv2beU=; b=Im1M3KZDINX9NXfUMVJLWx8E2hcyDW8nIT1g9psuAKDsZZ3Icqx+kWLnxc1uwH3X/S LvfKqj3Jllfrsut4XQzW0m3Unu+0Mn2qjwfFB2jiHjU1WMDZjIuMjDIyQvby5/AR7ucO CrhHVffEsnMSW8dpoB6WQ05ZckfnyNxd9uPT0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; b=frIEYpVBMwdWusiKjH+cuZWaUMZ8f997b79uaOjB7Uw5hfFTh0u86meFzfPgssYirn 94W98DWRezc6J2jrnYmb86z54N+pLpy/ZqiRz8lOzlhPdypvHYlZo7a/Tty75IuLRNOj 0OuENqrCwXTPl8t5lFEdJkFGiVAOMX+CAM5sA= MIME-Version: 1.0 Received: by 10.220.85.205 with SMTP id p13mr3020600vcl.1.1242290589427; Thu, 14 May 2009 01:43:09 -0700 (PDT) From: Kim Kyuwon Date: Thu, 14 May 2009 17:41:44 +0900 Message-ID: <4d34a0a70905140141t3f8e2b08uefb4141f904bfcc@mail.gmail.com> Subject: [PATCH] OMAP: UART: don't initialize membase and mapbase when its port is not enabled To: OMAP Cc: Kevin Hilman , Kyungmin Park , =?EUC-KR?B?seix1L/4?= , Paul Mundt Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org 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 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 --- arch/arm/mach-omap2/serial.c | 5 +---- 1 files changed, 1 insertions(+), 4 deletions(-) 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);