From patchwork Thu May 30 04:40:27 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tushar Behera X-Patchwork-Id: 17282 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f200.google.com (mail-ve0-f200.google.com [209.85.128.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4456325D81 for ; Thu, 30 May 2013 04:54:33 +0000 (UTC) Received: by mail-ve0-f200.google.com with SMTP id m1sf2001623ves.11 for ; Wed, 29 May 2013 21:54:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-beenthere:x-forwarded-to:x-forwarded-for :delivered-to:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe; bh=YcwERqGFHg8QqEKNqgpHZFa0XiRC88nlaCcHJ0l/fw8=; b=RzDtRzGCg5pPBFGwEWBG1K/1CyjLSC0kCGoRyZjxLrSK56NMKKwMNa7Ou7dNwBSOKR 3ATtYE8LkhPE15RC7fp5mOJsG8jSf9d59YHLd+u1I2bwV15K1U6Z6Fc3D2QOCGTlGwro GP1Kc5qt0NloB11mAsMZv4fQZERGtQ3kUfbICMy5ywSTYnxuZsvMlO6FR/ueyVf6efIo eMZog07BgZ7YALu8FH5y2FYjwf1Q0No0ZjKfFr+7EzkLWw+o+Qi43k8cnN84r3BZ/JRl hqxAenRZ/Rm8Gd/8yunn+E4arWsSLlkI1KS99LIoDdIZc21YQKX+DXDbqtccyk5VaE5B vP7Q== X-Received: by 10.224.200.202 with SMTP id ex10mr3404365qab.8.1369889672191; Wed, 29 May 2013 21:54:32 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.0.196 with SMTP id 4ls197470qeg.96.gmail; Wed, 29 May 2013 21:54:31 -0700 (PDT) X-Received: by 10.220.237.193 with SMTP id kp1mr3947751vcb.68.1369889671955; Wed, 29 May 2013 21:54:31 -0700 (PDT) Received: from mail-vb0-x22d.google.com (mail-vb0-x22d.google.com [2607:f8b0:400c:c02::22d]) by mx.google.com with ESMTPS id zp6si23613760vdb.132.2013.05.29.21.54.31 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 29 May 2013 21:54:31 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c02::22d is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c02::22d; Received: by mail-vb0-f45.google.com with SMTP id 12so6921524vbf.32 for ; Wed, 29 May 2013 21:54:31 -0700 (PDT) X-Received: by 10.52.34.114 with SMTP id y18mr3378747vdi.56.1369889671821; Wed, 29 May 2013 21:54:31 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.229.199 with SMTP id jj7csp1436vcb; Wed, 29 May 2013 21:54:31 -0700 (PDT) X-Received: by 10.66.235.69 with SMTP id uk5mr6570617pac.110.1369889670874; Wed, 29 May 2013 21:54:30 -0700 (PDT) Received: from mail-pb0-x236.google.com (mail-pb0-x236.google.com [2607:f8b0:400e:c01::236]) by mx.google.com with ESMTPS id xx2si28744571pac.45.2013.05.29.21.54.30 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 29 May 2013 21:54:30 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400e:c01::236 is neither permitted nor denied by best guess record for domain of tushar.behera@linaro.org) client-ip=2607:f8b0:400e:c01::236; Received: by mail-pb0-f54.google.com with SMTP id ro12so10360960pbb.13 for ; Wed, 29 May 2013 21:54:30 -0700 (PDT) X-Received: by 10.68.37.100 with SMTP id x4mr6034740pbj.122.1369889670318; Wed, 29 May 2013 21:54:30 -0700 (PDT) Received: from linaro.sisodomain.com ([115.113.119.130]) by mx.google.com with ESMTPSA id vz8sm42867993pac.20.2013.05.29.21.54.25 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 29 May 2013 21:54:29 -0700 (PDT) From: Tushar Behera To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org Cc: arnd@arndb.de, patches@linaro.org, kgene.kim@samsung.com, olof@lixom.net Subject: [PATCH] ARM: EXYNOS: Consolidate multiple low-level UART port definitions Date: Thu, 30 May 2013 10:10:27 +0530 Message-Id: <1369888827-9427-1-git-send-email-tushar.behera@linaro.org> X-Mailer: git-send-email 1.7.9.5 X-Gm-Message-State: ALoCoQnRDX56dgnPtx5TlySJ3nCXT0LLX2ku2dTiK65FZoTUC+e3okugj4JRPx+G2SjX+amo8thO X-Original-Sender: tushar.behera@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c02::22d is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , There are two definitions for low-level UART ports for Exynos platform. CONFIG_S3C_LOWLEVEL_UART_PORT is used for printing "Uncompressing Linux... done, booting the kernel." and CONFIG_S3C_UART for other low-level messages. The assumption for both the uart ports is that they are pre-configured in the bootloader. Since they are essentially the same always, it would be good to consolidate them to use only one macro, in this case 'DEBUG_S3C_UART' would be a better option. 'DEBUG_S3C_UART' is defined only if DEBUG_LL is enabled. We can safely disable this option when DEBUG_LL is not defined and we can boot various boards with different UART port settings. Only drawback of this approach is that when DEBUG_LL is not defined, we would be missing the print "Uncompressing Linux... done, booting the kernel." Since CONFIG_S3C_LOWLEVEL_UART_PORT is still used by other Samsung boards, the consolidation applies only for ARCH_EXYNOS. Signed-off-by: Tushar Behera Acked-by: Kevin Hilman --- arch/arm/mach-exynos/include/mach/uncompress.h | 11 ++++++++--- arch/arm/plat-samsung/include/plat/uncompress.h | 16 ++++++++++++++-- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/arch/arm/mach-exynos/include/mach/uncompress.h b/arch/arm/mach-exynos/include/mach/uncompress.h index 2979995..45b5c2a 100644 --- a/arch/arm/mach-exynos/include/mach/uncompress.h +++ b/arch/arm/mach-exynos/include/mach/uncompress.h @@ -37,11 +37,16 @@ static void arch_detect_cpu(void) chip_id >>= 20; chip_id &= 0xf; +#ifdef CONFIG_DEBUG_LL if (chip_id == 0x5) - uart_base = (volatile u8 *)EXYNOS5_PA_UART + (S3C_UART_OFFSET * CONFIG_S3C_LOWLEVEL_UART_PORT); + uart_base = (volatile u8 *)EXYNOS5_PA_UART + + (S3C_UART_OFFSET * CONFIG_DEBUG_S3C_UART); else - uart_base = (volatile u8 *)EXYNOS4_PA_UART + (S3C_UART_OFFSET * CONFIG_S3C_LOWLEVEL_UART_PORT); - + uart_base = (volatile u8 *)EXYNOS4_PA_UART + + (S3C_UART_OFFSET * CONFIG_DEBUG_S3C_UART); +#else + uart_base = 0; +#endif /* * For preventing FIFO overrun or infinite loop of UART console, * fifo_max should be the minimum fifo size of all of the UART channels diff --git a/arch/arm/plat-samsung/include/plat/uncompress.h b/arch/arm/plat-samsung/include/plat/uncompress.h index 438b248..028c2a8 100644 --- a/arch/arm/plat-samsung/include/plat/uncompress.h +++ b/arch/arm/plat-samsung/include/plat/uncompress.h @@ -38,7 +38,11 @@ static void arch_detect_cpu(void); #define FIFO_MAX (14) #ifdef S3C_PA_UART -#define uart_base S3C_PA_UART + (S3C_UART_OFFSET * CONFIG_S3C_LOWLEVEL_UART_PORT) +#ifdef CONFIG_DEBUG_LL +#define uart_base (S3C_PA_UART + (S3C_UART_OFFSET * CONFIG_DEBUG_S3C_UART)) +#else +#define uart_base 0 +#endif #endif static __inline__ void @@ -66,6 +70,9 @@ uart_rd(unsigned int reg) static void putc(int ch) { + if (!uart_base) + return; + if (uart_rd(S3C2410_UFCON) & S3C2410_UFCON_FIFOMODE) { int level; @@ -118,7 +125,12 @@ static void arch_decomp_error(const char *x) #ifdef CONFIG_S3C_BOOT_UART_FORCE_FIFO static inline void arch_enable_uart_fifo(void) { - u32 fifocon = uart_rd(S3C2410_UFCON); + u32 fifocon; + + if (!uart_base) + return; + + fifocon = uart_rd(S3C2410_UFCON); if (!(fifocon & S3C2410_UFCON_FIFOMODE)) { fifocon |= S3C2410_UFCON_RESETBOTH;