From patchwork Thu May 14 16:13:10 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 48520 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f72.google.com (mail-la0-f72.google.com [209.85.215.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5AEF621411 for ; Thu, 14 May 2015 16:20:09 +0000 (UTC) Received: by lagr1 with SMTP id r1sf5095748lag.3 for ; Thu, 14 May 2015 09:20:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:subject:date:message-id:cc :precedence:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:sender:errors-to:x-original-sender :x-original-authentication-results:mailing-list; bh=WadHWhkarAc8k1sCcXz7283XjA69FvT1YsZzG6QuB2M=; b=miemlv6d3d4iKCjYSvdjLgjMt/9swTqnc/j9XSrcHD8OE48KTIADuzNwVDpaS7d4L9 RPKzwHRKEZQTaYKcFGTJAbPAvrMV2wtvJZaGljEPYUOY2Imm4kWzHK9mpB4aBqIoSztY uBy2npCnN5kj347NstwNXidCgvpvts6sQtsaEzFVrCv1llmKfVGUvOlKKHA+oF+fsxF+ ImM5mMyd33CKsx0CFl+1zrgqi16SK318uBTmoDjfodpj510FnvFoeX6TKL6gNNKr58Nn DVaxmBzm+5zbR5l6exvyfePMd/PvL6VcLCEExiXAEdqWSCH5jDUDIIb/3Mr6q1n38u+m QSGw== X-Gm-Message-State: ALoCoQlkFIyZosQxbSUv32QK1wBBjCMTfxretVfh8zkDh0rawvIdlEnMUJ7P0js/bOFVCTrRR+FC X-Received: by 10.180.85.129 with SMTP id h1mr9669694wiz.6.1431620408008; Thu, 14 May 2015 09:20:08 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.239.130 with SMTP id vs2ls362368lac.97.gmail; Thu, 14 May 2015 09:20:07 -0700 (PDT) X-Received: by 10.112.17.8 with SMTP id k8mr3879012lbd.28.1431620407788; Thu, 14 May 2015 09:20:07 -0700 (PDT) Received: from mail-la0-f45.google.com (mail-la0-f45.google.com. [209.85.215.45]) by mx.google.com with ESMTPS id p3si14871341lap.2.2015.05.14.09.20.07 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 May 2015 09:20:07 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.45 as permitted sender) client-ip=209.85.215.45; Received: by labbd9 with SMTP id bd9so75314007lab.2 for ; Thu, 14 May 2015 09:20:07 -0700 (PDT) X-Received: by 10.112.204.72 with SMTP id kw8mr3822887lbc.88.1431620407547; Thu, 14 May 2015 09:20:07 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp1380957lbb; Thu, 14 May 2015 09:20:06 -0700 (PDT) X-Received: by 10.66.236.167 with SMTP id uv7mr9515756pac.58.1431620405821; Thu, 14 May 2015 09:20:05 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id qw6si33171693pab.54.2015.05.14.09.20.05 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 May 2015 09:20:05 -0700 (PDT) Received-SPF: none (google.com: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org does not designate permitted sender hosts) client-ip=2001:1868:205::9; 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 1Ysvpb-0001C9-KS; Thu, 14 May 2015 16:17:55 +0000 Received: from mail-la0-f47.google.com ([209.85.215.47]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YsvlT-0005kU-S4 for linux-arm-kernel@lists.infradead.org; Thu, 14 May 2015 16:13:40 +0000 Received: by lagv1 with SMTP id v1so74923454lag.3 for ; Thu, 14 May 2015 09:13:15 -0700 (PDT) X-Received: by 10.152.203.233 with SMTP id kt9mr3785369lac.21.1431619995457; Thu, 14 May 2015 09:13:15 -0700 (PDT) Received: from localhost.localdomain ([85.235.11.236]) by mx.google.com with ESMTPSA id do6sm6254256lac.19.2015.05.14.09.13.13 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 May 2015 09:13:14 -0700 (PDT) From: Linus Walleij To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 05/10] ARM: ux500: get rid of static GIC dist base Date: Thu, 14 May 2015 18:13:10 +0200 Message-Id: <1431619990-15014-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 1.9.3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150514_091340_141796_04C168DD X-CRM114-Status: GOOD ( 17.28 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.215.47 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.215.47 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders Cc: Linus Walleij X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 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+patch=linaro.org@lists.infradead.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: linus.walleij@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.45 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 The GIC distributor was mapped statically for the PM code but the driver already get the base address from the DT. Augment the PM code to get the base from the device tree and remove the static map. Signed-off-by: Linus Walleij --- arch/arm/mach-ux500/cpu-db8500.c | 1 - arch/arm/mach-ux500/pm.c | 15 +++++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-ux500/cpu-db8500.c b/arch/arm/mach-ux500/cpu-db8500.c index 0b3ebbf38702..a36fdd8657d2 100644 --- a/arch/arm/mach-ux500/cpu-db8500.c +++ b/arch/arm/mach-ux500/cpu-db8500.c @@ -47,7 +47,6 @@ static struct prcmu_pdata db8500_prcmu_pdata = { static struct map_desc u8500_common_io_desc[] __initdata = { /* SCU base also covers GIC CPU BASE and TWD with its 4K page */ __IO_DEV_DESC(U8500_SCU_BASE, SZ_4K), - __IO_DEV_DESC(U8500_GIC_DIST_BASE, SZ_4K), __IO_DEV_DESC(U8500_L2CC_BASE, SZ_4K), __IO_DEV_DESC(U8500_BACKUPRAM0_BASE, SZ_8K), }; diff --git a/arch/arm/mach-ux500/pm.c b/arch/arm/mach-ux500/pm.c index 2cb587b50905..8538910db202 100644 --- a/arch/arm/mach-ux500/pm.c +++ b/arch/arm/mach-ux500/pm.c @@ -15,6 +15,8 @@ #include #include #include +#include +#include #include "db8500-regs.h" #include "pm_domains.h" @@ -42,6 +44,7 @@ #define PRCM_ARMITVAL127TO96 (prcmu_base + 0x26C) static void __iomem *prcmu_base; +static void __iomem *dist_base; /* This function decouple the gic from the prcmu */ int prcmu_gic_decouple(void) @@ -88,7 +91,6 @@ bool prcmu_gic_pending_irq(void) { u32 pr; /* Pending register */ u32 er; /* Enable register */ - void __iomem *dist_base = __io_address(U8500_GIC_DIST_BASE); int i; /* 5 registers. STI & PPI not skipped */ @@ -143,7 +145,6 @@ bool prcmu_is_cpu_in_wfi(int cpu) int prcmu_copy_gic_settings(void) { u32 er; /* Enable register */ - void __iomem *dist_base = __io_address(U8500_GIC_DIST_BASE); int i; /* We skip the STI and PPI */ @@ -179,11 +180,21 @@ static const struct platform_suspend_ops ux500_suspend_ops = { void __init ux500_pm_init(u32 phy_base, u32 size) { + struct device_node *np; + prcmu_base = ioremap(phy_base, size); if (!prcmu_base) { pr_err("could not remap PRCMU for PM functions\n"); return; } + np = of_find_compatible_node(NULL, NULL, "arm,cortex-a9-gic"); + dist_base = of_iomap(np, 0); + of_node_put(np); + if (!dist_base) { + pr_err("could not remap GIC dist base for PM functions\n"); + return; + } + /* * On watchdog reboot the GIC is in some cases decoupled. * This will make sure that the GIC is correctly configured.