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: 2642961 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 8ABB43FD2B for ; Fri, 31 May 2013 12:03:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756378Ab3EaMDq (ORCPT ); Fri, 31 May 2013 08:03:46 -0400 Received: from mail-pb0-f43.google.com ([209.85.160.43]:49223 "EHLO mail-pb0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756087Ab3EaMDU (ORCPT ); Fri, 31 May 2013 08:03:20 -0400 Received: by mail-pb0-f43.google.com with SMTP id ma3so2107880pbc.16 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=FLHN97ouWkJw7Z2MgSqNDm1MwOPU/9LPoJOlW0Rjam44KYEDEfvFtVJc9RT1FFlHFE ue/+66gMz60QjK7ZfjQwF3ippDo+lXYV94oIccAytsykmIdo74DkdRTyfCODvcNpbDY5 PNnCefVRvSC+J/Xjrdr9OuNrBeUz6ufR9/SU+WBsO7kGyn8msk6nrS/qXsfUa8aKiWy5 lmG1AuD8DdFpIb840P2/PHjf1nIKSRDhNyXRd8SIgSS/4HhP7bmf+ZhidhO+wADOI2SZ SyVeoL3rVge4rLsYPJWOTNH3dV1kjlhuNJDokFgyALLkHkEZ6KB18kLrewUejTMW712u byjg== 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 Cc: arnd@arndb.de, kgene.kim@samsung.com, olof@lixom.net, patches@linaro.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: ALoCoQl4CB2eISzm8UX5hlG/nWD9MFqBN27Szrx6+n157yTP2yYdHV9PGMDZ99zfsjdaDACjV0Ll Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.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) {