From patchwork Tue Jun 4 04:19:11 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tushar Behera X-Patchwork-Id: 17494 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f197.google.com (mail-qc0-f197.google.com [209.85.216.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id DF128238F2 for ; Tue, 4 Jun 2013 04:33:37 +0000 (UTC) Received: by mail-qc0-f197.google.com with SMTP id d1sf6225736qcz.0 for ; Mon, 03 Jun 2013 21:33:37 -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 :in-reply-to:references: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=PGTsQ2942cyRQN9jK29jEn3zNL14JPkHUEGu4zURCa8=; b=JALNJjYxNPZe5P4VNRPDJOSZ/uICcRsVIcie7NxLdnua7X7YFVUuRb3r2pW453Qnyd EFkeZeLyuVWmCgtv3KSrList2OO7L81puhiLtIuihIpY0Um5/msBy/QqagqMyuiIAcqF IaeFyby4zsYVl8zBN7Thq/KzUxCtEkms+UpooSfqK0dj9SAt9xxYNnoavcGvtfsxRtPB BQXA0q9lqAzeuRAQ9mWYE3fXHJTIMlQoqvbkbCK3HFww3m3EalfMCcHx/Hj7XVWVZN+A YW9ZoskSvh2+xsnJMQ/xMqRR3veFoIdkHluDs8hq8ud1dWyoq2FiW3mizBLicU2zc45C k24Q== X-Received: by 10.224.200.202 with SMTP id ex10mr15621145qab.8.1370320417754; Mon, 03 Jun 2013 21:33:37 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.73.37 with SMTP id i5ls75604qev.54.gmail; Mon, 03 Jun 2013 21:33:37 -0700 (PDT) X-Received: by 10.52.25.40 with SMTP id z8mr15013937vdf.7.1370320417594; Mon, 03 Jun 2013 21:33:37 -0700 (PDT) Received: from mail-vc0-f181.google.com (mail-vc0-f181.google.com [209.85.220.181]) by mx.google.com with ESMTPS id 11si29602370vch.33.2013.06.03.21.33.37 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 03 Jun 2013 21:33:37 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.181 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.181; Received: by mail-vc0-f181.google.com with SMTP id lf11so3201699vcb.40 for ; Mon, 03 Jun 2013 21:33:37 -0700 (PDT) X-Received: by 10.52.170.148 with SMTP id am20mr15253474vdc.75.1370320417427; Mon, 03 Jun 2013 21:33:37 -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.221.10.206 with SMTP id pb14csp108426vcb; Mon, 3 Jun 2013 21:33:36 -0700 (PDT) X-Received: by 10.68.13.199 with SMTP id j7mr16635950pbc.17.1370320416333; Mon, 03 Jun 2013 21:33:36 -0700 (PDT) Received: from mail-pb0-x22c.google.com (mail-pb0-x22c.google.com [2607:f8b0:400e:c01::22c]) by mx.google.com with ESMTPS id ns8si41408054pbb.319.2013.06.03.21.33.36 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 03 Jun 2013 21:33:36 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400e:c01::22c is neither permitted nor denied by best guess record for domain of tushar.behera@linaro.org) client-ip=2607:f8b0:400e:c01::22c; Received: by mail-pb0-f44.google.com with SMTP id wz12so6691013pbc.3 for ; Mon, 03 Jun 2013 21:33:36 -0700 (PDT) X-Received: by 10.66.122.8 with SMTP id lo8mr26449861pab.165.1370320415951; Mon, 03 Jun 2013 21:33:35 -0700 (PDT) Received: from linaro.sisodomain.com ([115.113.119.130]) by mx.google.com with ESMTPSA id ya4sm61570412pbb.24.2013.06.03.21.33.31 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 03 Jun 2013 21:33:35 -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 v2 2/3] ARM: SAMSUNG: Consolidate uncompress subroutine Date: Tue, 4 Jun 2013 09:49:11 +0530 Message-Id: <1370319552-17694-3-git-send-email-tushar.behera@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1370319552-17694-1-git-send-email-tushar.behera@linaro.org> References: <1370319552-17694-1-git-send-email-tushar.behera@linaro.org> X-Gm-Message-State: ALoCoQn6kE7VWpB7Kmq+xO06S1hgTna7omXJVCjHCOk55S8SmGX6l00Gzb8bvmRDOd2NoV81m8j3 X-Original-Sender: tushar.behera@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.181 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: , 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 --- Changes for v2: * Remove ifdef's while calculating uart_base value. arch/arm/mach-exynos/include/mach/uncompress.h | 3 --- arch/arm/mach-s3c24xx/include/mach/uncompress.h | 3 +++ arch/arm/mach-s3c64xx/include/mach/uncompress.h | 3 +++ arch/arm/mach-s5pc100/include/mach/uncompress.h | 2 ++ arch/arm/mach-s5pv210/include/mach/uncompress.h | 2 ++ arch/arm/plat-samsung/include/plat/uncompress.h | 6 ++---- 6 files changed, 12 insertions(+), 7 deletions(-) diff --git a/arch/arm/mach-exynos/include/mach/uncompress.h b/arch/arm/mach-exynos/include/mach/uncompress.h index 2979995..d405762 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..7d2ce20 100644 --- a/arch/arm/mach-s3c24xx/include/mach/uncompress.h +++ b/arch/arm/mach-s3c24xx/include/mach/uncompress.h @@ -49,6 +49,9 @@ static void arch_detect_cpu(void) fifo_mask = S3C2410_UFSTAT_TXMASK; fifo_max = 15 << S3C2410_UFSTAT_TXSHIFT; } + + uart_base = (volatile u8 *) S3C_PA_UART + + (S3C_UART_OFFSET * CONFIG_S3C_LOWLEVEL_UART_PORT); } #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..1c95673 100644 --- a/arch/arm/mach-s3c64xx/include/mach/uncompress.h +++ b/arch/arm/mach-s3c64xx/include/mach/uncompress.h @@ -23,6 +23,9 @@ 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; + + uart_base = (volatile u8 *)S3C_PA_UART + + (S3C_UART_OFFSET * CONFIG_S3C_LOWLEVEL_UART_PORT); } #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..720e133 100644 --- a/arch/arm/mach-s5pc100/include/mach/uncompress.h +++ b/arch/arm/mach-s5pc100/include/mach/uncompress.h @@ -23,6 +23,8 @@ 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; + + uart_base = (volatile u8 *)S5P_PA_UART(CONFIG_S3C_LOWLEVEL_UART_PORT); } #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..231cb07 100644 --- a/arch/arm/mach-s5pv210/include/mach/uncompress.h +++ b/arch/arm/mach-s5pv210/include/mach/uncompress.h @@ -21,6 +21,8 @@ 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; + + uart_base = (volatile u8 *)S5P_PA_UART(CONFIG_S3C_LOWLEVEL_UART_PORT); } #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 02b66d7..2ace0d5 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) {