From patchwork Fri May 31 11:49:03 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tushar Behera X-Patchwork-Id: 2643001 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by patchwork1.kernel.org (Postfix) with ESMTP id ED9243FD2B for ; Fri, 31 May 2013 12:04:53 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UiO40-0000OS-9R; Fri, 31 May 2013 12:04:09 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UiO3f-00081q-UO; Fri, 31 May 2013 12:03:47 +0000 Received: from mail-pd0-f172.google.com ([209.85.192.172]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UiO3V-0007zZ-Rh for linux-arm-kernel@lists.infradead.org; Fri, 31 May 2013 12:03:40 +0000 Received: by mail-pd0-f172.google.com with SMTP id 10so2098220pdi.3 for ; Fri, 31 May 2013 05:03:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=uKMqRn0xsMYdpeX5RmX5gPrp+cCQkp0SyPZ1XC+2qEw=; b=Vl+RaR3iC9RsZn1Y75OyQN9zem7UKpcsKbWb8MkCqsIomVV33nhk7IybEs+0W8WCGp FNdOqUTwZuEjPTO9UeAO/hv0i6TL0ydttR7EFU47ZaJr60knzSsnMVHJq0j2OPoe4JVv HRm2MhpYUR59HRTdl9JYHCPozgA4Jx5OknvUwxz/qkkjrDWbiBNS6oSXpmE7v23Sixuf lRjL8h/cB/g3HPYv2W6xtcgEn0zbt+egi3P2W2jwv5FfTx5o6ooMWDqMxJwLgq2X/Oj+ qZAp30Q03geqTfk9tnZO8bCQD4eVN0s8NNyJ02K3K6LscMhdpNyrM0TcZhaL0CC02rJf Nzfw== X-Received: by 10.68.170.68 with SMTP id ak4mr12206715pbc.211.1370001796209; Fri, 31 May 2013 05:03:16 -0700 (PDT) Received: from linaro.sisodomain.com ([115.113.119.130]) by mx.google.com with ESMTPSA id ag4sm46445160pbc.20.2013.05.31.05.03.12 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 31 May 2013 05:03:15 -0700 (PDT) From: Tushar Behera To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org Subject: [PATCH 2/3] ARM: SAMSUNG: Consolidate uncompress subroutine Date: Fri, 31 May 2013 17:19:03 +0530 Message-Id: <1370000944-19786-3-git-send-email-tushar.behera@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1370000944-19786-1-git-send-email-tushar.behera@linaro.org> References: <1370000944-19786-1-git-send-email-tushar.behera@linaro.org> X-Gm-Message-State: ALoCoQlJjXhXyaiTY09jWwPM2LlF1VhLxW2QP1cXBqLisoWCzqcXxtvW5wDsyXXJEgpM53hsxgw3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130531_080338_040862_1F7D0A6B X-CRM114-Status: GOOD ( 13.76 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [209.85.192.172 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: olof@lixom.net, kgene.kim@samsung.com, arnd@arndb.de, patches@linaro.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org For mach-exynos, uart_base is a pointer and the value is calculated in the machine folder. For other machines, uart_base is defined as a macro in platform directory. For symmetry, the uart_base macro definition is removed and the uart_base calculation is moved to specific machine folders. This would help us consolidating uncompress subroutine for s5p64x0. Signed-off-by: Tushar Behera --- arch/arm/mach-exynos/include/mach/uncompress.h | 3 --- arch/arm/mach-s3c24xx/include/mach/uncompress.h | 7 +++++++ arch/arm/mach-s3c64xx/include/mach/uncompress.h | 7 +++++++ arch/arm/mach-s5pc100/include/mach/uncompress.h | 6 ++++++ arch/arm/mach-s5pv210/include/mach/uncompress.h | 6 ++++++ arch/arm/plat-samsung/include/plat/uncompress.h | 6 ++---- 6 files changed, 28 insertions(+), 7 deletions(-) diff --git a/arch/arm/mach-exynos/include/mach/uncompress.h b/arch/arm/mach-exynos/include/mach/uncompress.h index 730f69f..30592fd 100644 --- a/arch/arm/mach-exynos/include/mach/uncompress.h +++ b/arch/arm/mach-exynos/include/mach/uncompress.h @@ -15,9 +15,6 @@ #include #include - -volatile u8 *uart_base; - #include static unsigned int __raw_readl(unsigned int ptr) diff --git a/arch/arm/mach-s3c24xx/include/mach/uncompress.h b/arch/arm/mach-s3c24xx/include/mach/uncompress.h index 8b283f8..638893e 100644 --- a/arch/arm/mach-s3c24xx/include/mach/uncompress.h +++ b/arch/arm/mach-s3c24xx/include/mach/uncompress.h @@ -49,6 +49,13 @@ static void arch_detect_cpu(void) fifo_mask = S3C2410_UFSTAT_TXMASK; fifo_max = 15 << S3C2410_UFSTAT_TXSHIFT; } + +#ifdef CONFIG_DEBUG_LL + uart_base = (volatile u8 *) S3C_PA_UART + + (S3C_UART_OFFSET * CONFIG_S3C_LOWLEVEL_UART_PORT); +#else + uart_base = NULL; +#endif } #endif /* __ASM_ARCH_UNCOMPRESS_H */ diff --git a/arch/arm/mach-s3c64xx/include/mach/uncompress.h b/arch/arm/mach-s3c64xx/include/mach/uncompress.h index c6a82a2..d6f9188 100644 --- a/arch/arm/mach-s3c64xx/include/mach/uncompress.h +++ b/arch/arm/mach-s3c64xx/include/mach/uncompress.h @@ -23,6 +23,13 @@ static void arch_detect_cpu(void) /* we do not need to do any cpu detection here at the moment. */ fifo_mask = S3C2440_UFSTAT_TXMASK; fifo_max = 63 << S3C2440_UFSTAT_TXSHIFT; + +#ifdef CONFIG_DEBUG_LL + uart_base = (volatile u8 *)S3C_PA_UART + + (S3C_UART_OFFSET * CONFIG_S3C_LOWLEVEL_UART_PORT); +#else + uart_base = NULL; +#endif } #endif /* __ASM_ARCH_UNCOMPRESS_H */ diff --git a/arch/arm/mach-s5pc100/include/mach/uncompress.h b/arch/arm/mach-s5pc100/include/mach/uncompress.h index 01ccf53..c1242df 100644 --- a/arch/arm/mach-s5pc100/include/mach/uncompress.h +++ b/arch/arm/mach-s5pc100/include/mach/uncompress.h @@ -23,6 +23,12 @@ static void arch_detect_cpu(void) /* we do not need to do any cpu detection here at the moment. */ fifo_mask = S3C2440_UFSTAT_TXMASK; fifo_max = 63 << S3C2440_UFSTAT_TXSHIFT; + +#ifdef CONFIG_DEBUG_LL + uart_base = (volatile u8 *)S5P_PA_UART(CONFIG_S3C_LOWLEVEL_UART_PORT); +#else + uart_base = NULL; +#endif } #endif /* __ASM_ARCH_UNCOMPRESS_H */ diff --git a/arch/arm/mach-s5pv210/include/mach/uncompress.h b/arch/arm/mach-s5pv210/include/mach/uncompress.h index ef977ea..2193812 100644 --- a/arch/arm/mach-s5pv210/include/mach/uncompress.h +++ b/arch/arm/mach-s5pv210/include/mach/uncompress.h @@ -21,6 +21,12 @@ static void arch_detect_cpu(void) /* we do not need to do any cpu detection here at the moment. */ fifo_mask = S5PV210_UFSTAT_TXMASK; fifo_max = 63 << S5PV210_UFSTAT_TXSHIFT; + +#ifdef CONFIG_DEBUG_LL + uart_base = (volatile u8 *)S5P_PA_UART(CONFIG_S3C_LOWLEVEL_UART_PORT); +#else + uart_base = NULL; +#endif } #endif /* __ASM_ARCH_UNCOMPRESS_H */ diff --git a/arch/arm/plat-samsung/include/plat/uncompress.h b/arch/arm/plat-samsung/include/plat/uncompress.h index 350032b..78274eb 100644 --- a/arch/arm/plat-samsung/include/plat/uncompress.h +++ b/arch/arm/plat-samsung/include/plat/uncompress.h @@ -21,6 +21,8 @@ typedef unsigned int upf_t; /* cannot include linux/serial_core.h */ unsigned int fifo_mask; unsigned int fifo_max; +volatile u8 *uart_base; + /* forward declerations */ static void arch_detect_cpu(void); @@ -37,10 +39,6 @@ static void arch_detect_cpu(void); /* how many bytes we allow into the FIFO at a time in FIFO mode */ #define FIFO_MAX (14) -#ifdef S3C_PA_UART -#define uart_base S3C_PA_UART + (S3C_UART_OFFSET * CONFIG_S3C_LOWLEVEL_UART_PORT) -#endif - static __inline__ void uart_wr(unsigned int reg, unsigned int val) {