From patchwork Fri May 9 15:44:28 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dinh Nguyen X-Patchwork-Id: 4144221 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D359F9F387 for ; Fri, 9 May 2014 15:50:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D234C2013A for ; Fri, 9 May 2014 15:50:19 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6B54D202EA for ; Fri, 9 May 2014 15:50:18 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Win1N-0002rJ-0n; Fri, 09 May 2014 15:47:37 +0000 Received: from mail-bn1bon0132.outbound.protection.outlook.com ([157.56.111.132] helo=na01-bn1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Win1J-0002ZR-Jx for linux-arm-kernel@lists.infradead.org; Fri, 09 May 2014 15:47:34 +0000 Received: from BN1BFFO11FD019.protection.gbl (10.58.144.30) by BN1BFFO11HUB041.protection.gbl (10.58.144.188) with Microsoft SMTP Server (TLS) id 15.0.929.8; Fri, 9 May 2014 15:47:09 +0000 Received: from SJ-ITEXEDGE02.altera.priv.altera.com (66.35.236.232) by BN1BFFO11FD019.mail.protection.outlook.com (10.58.144.82) with Microsoft SMTP Server (TLS) id 15.0.939.9 via Frontend Transport; Fri, 9 May 2014 15:47:09 +0000 Received: from sj-mail01.altera.com (137.57.1.6) by SJ-ITEXEDGE02.altera.priv.altera.com (66.35.236.232) with Microsoft SMTP Server id 8.3.348.2; Fri, 9 May 2014 08:33:35 -0700 Received: from linux-builds1.altera.com (linux-builds1.altera.com [137.57.188.114]) by sj-mail01.altera.com (8.13.7+Sun/8.13.7) with ESMTP id s49Fl79B005210; Fri, 9 May 2014 08:47:07 -0700 (PDT) From: To: , Subject: [PATCH] ARM: socfpga: Remove static declaration for the SCU virtual address Date: Fri, 9 May 2014 10:44:28 -0500 Message-ID: <1399650268-30964-1-git-send-email-dinguyen@altera.com> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:66.35.236.232; CTRY:US; IPV:NLI; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019001)(6009001)(189002)(199002)(97736001)(20776003)(36756003)(76482001)(74662001)(62966002)(83322001)(87286001)(88136002)(31966008)(77982001)(19580395003)(19580405001)(33646001)(50986999)(92566001)(79102001)(84676001)(80022001)(81342001)(92726001)(87936001)(50466002)(50226001)(2009001)(47776003)(48376002)(6806004)(53416003)(4396001)(89996001)(86152002)(83072002)(85852003)(44976005)(93916002)(77156001)(81542001)(86362001)(46102001)(74502001); DIR:OUT; SFP:1102; SCL:1; SRVR:BN1BFFO11HUB041; H:SJ-ITEXEDGE02.altera.priv.altera.com; FPR:FEEAF7D9.8BCAA46F.9F75B7F.80202ABD.20207; MLV:sfv; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-OriginatorOrg: altera.onmicrosoft.com X-Forefront-PRVS: 02065A9E77 Received-SPF: SoftFail (: domain of transitioning altera.com discourages use of 66.35.236.232 as permitted sender) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140509_084733_808461_3BD935B5 X-CRM114-Status: UNSURE ( 8.95 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.0 (/) Cc: olof@lixom.net, Dinh Nguyen , khilman@linaro.org, arnd@arndb.de, linux-arm-kernel@lists.infradead.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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Dinh Nguyen Use common scu_a9_get_base() to get the SCU base address and just use what scu_a9_get_base() returns as the virtual address. Signed-off-by: Dinh Nguyen --- arch/arm/mach-socfpga/core.h | 2 -- arch/arm/mach-socfpga/socfpga.c | 15 +++++++++------ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/arch/arm/mach-socfpga/core.h b/arch/arm/mach-socfpga/core.h index 572b8f7..6e2560c 100644 --- a/arch/arm/mach-socfpga/core.h +++ b/arch/arm/mach-socfpga/core.h @@ -42,6 +42,4 @@ extern char secondary_trampoline, secondary_trampoline_end; extern unsigned long cpu1start_addr; -#define SOCFPGA_SCU_VIRT_BASE 0xfffec000 - #endif diff --git a/arch/arm/mach-socfpga/socfpga.c b/arch/arm/mach-socfpga/socfpga.c index d86231e..5d65b41 100644 --- a/arch/arm/mach-socfpga/socfpga.c +++ b/arch/arm/mach-socfpga/socfpga.c @@ -23,16 +23,16 @@ #include #include #include +#include #include "core.h" -void __iomem *socfpga_scu_base_addr = ((void __iomem *)(SOCFPGA_SCU_VIRT_BASE)); +void __iomem *socfpga_scu_base_addr; void __iomem *sys_manager_base_addr; void __iomem *rst_manager_base_addr; unsigned long cpu1start_addr; static struct map_desc scu_io_desc __initdata = { - .virtual = SOCFPGA_SCU_VIRT_BASE, .pfn = 0, /* run-time */ .length = SZ_8K, .type = MT_DEVICE, @@ -49,11 +49,14 @@ static void __init socfpga_scu_map_io(void) { unsigned long base; - /* Get SCU base */ - asm("mrc p15, 4, %0, c15, c0, 0" : "=r" (base)); + if (scu_a9_has_base()) { + base = scu_a9_get_base(); - scu_io_desc.pfn = __phys_to_pfn(base); - iotable_init(&scu_io_desc, 1); + scu_io_desc.pfn = __phys_to_pfn(base); + scu_io_desc.virtual = base; + iotable_init(&scu_io_desc, 1); + socfpga_scu_base_addr = (void __iomem *)base; + } } static void __init socfpga_map_io(void)