From patchwork Mon Apr 21 08:29:49 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chander Kashyap X-Patchwork-Id: 28667 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pb0-f69.google.com (mail-pb0-f69.google.com [209.85.160.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E590B2032B for ; Mon, 21 Apr 2014 08:30:16 +0000 (UTC) Received: by mail-pb0-f69.google.com with SMTP id md12sf18200103pbc.0 for ; Mon, 21 Apr 2014 01:30:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=CFUK/drBUIHtf4vNAzUI94alK0u8PWa2fxTIf9Ged+k=; b=Dzl3mdcUOJHcAgp+lY7mCxWHWVrYOepPLEtYuOYnb8LtSU5UBwQKSZtxk97otsib01 RYLyYUGfvwSKrIaD1wCWT7e8kKzPzf2WF7BtVTlEwYkHBati+EOMLjPlEW2ocytogPqi VJyHmVSuzfTLDUeuWZvS40QqDQUXW4gzbt9RZ/9HfcYSeJ7HjpZoQeDHuv4JE7BhUDK7 dOnIkuxV7kghzRjHc+/LVAsagFNH8ij7Kdx1NI3BrOgNNMW8TyT0hqf6V4XhxJhd+ud3 imLbsBUVJvCUagwSWp4cK7+hEXz7/VOhJqspLeruHDEzTcB+0b1ds1PdqqO0Dvb8+yl9 LRHA== X-Gm-Message-State: ALoCoQkivRKZMOzFduq5iMy/x6tx5qXIKeKhgog3o4TB6h05XKK+58k0nx4Ir4DJkRUoRkQ63VMr X-Received: by 10.66.252.198 with SMTP id zu6mr18048645pac.25.1398069015912; Mon, 21 Apr 2014 01:30:15 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.104.163 with SMTP id a32ls2259070qgf.73.gmail; Mon, 21 Apr 2014 01:30:15 -0700 (PDT) X-Received: by 10.220.250.203 with SMTP id mp11mr29899136vcb.2.1398069015783; Mon, 21 Apr 2014 01:30:15 -0700 (PDT) Received: from mail-ve0-f176.google.com (mail-ve0-f176.google.com [209.85.128.176]) by mx.google.com with ESMTPS id ls10si6148796vec.118.2014.04.21.01.30.15 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 21 Apr 2014 01:30:15 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.176 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.176; Received: by mail-ve0-f176.google.com with SMTP id db11so7465243veb.35 for ; Mon, 21 Apr 2014 01:30:15 -0700 (PDT) X-Received: by 10.220.161.8 with SMTP id p8mr29618859vcx.4.1398069015703; Mon, 21 Apr 2014 01:30:15 -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.220.221.72 with SMTP id ib8csp276509vcb; Mon, 21 Apr 2014 01:30:15 -0700 (PDT) X-Received: by 10.66.142.73 with SMTP id ru9mr36675688pab.41.1398069014436; Mon, 21 Apr 2014 01:30:14 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id uc7si8674799pbc.475.2014.04.21.01.30.13; Mon, 21 Apr 2014 01:30:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750824AbaDUIaF (ORCPT + 8 others); Mon, 21 Apr 2014 04:30:05 -0400 Received: from mail-pa0-f44.google.com ([209.85.220.44]:49318 "EHLO mail-pa0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750774AbaDUIaE (ORCPT ); Mon, 21 Apr 2014 04:30:04 -0400 Received: by mail-pa0-f44.google.com with SMTP id bj1so3509093pad.17 for ; Mon, 21 Apr 2014 01:30:03 -0700 (PDT) X-Received: by 10.66.155.102 with SMTP id vv6mr36748831pab.89.1398069003469; Mon, 21 Apr 2014 01:30:03 -0700 (PDT) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPSA id kl1sm76356139pbd.73.2014.04.21.01.30.00 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 21 Apr 2014 01:30:02 -0700 (PDT) From: Chander Kashyap To: linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: kgene.kim@samsung.com, tomasz.figa@gmail.com, Chander Kashyap , Chander Kashyap Subject: [PATCH v4] arm: exynos: generalize power register address calculation Date: Mon, 21 Apr 2014 13:59:49 +0530 Message-Id: <1398068989-9905-1-git-send-email-chander.kashyap@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: chander.kashyap@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.176 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 Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Currently status/configuration power register values are hard-coded for cpu1. Make it generic so that it is useful for SoC's with more than two cpus. Signed-off-by: Chander Kashyap Signed-off-by: Chander Kashyap --- changes in v4: 1: Dropped changes in platsmp.c and hotplug.c as those are taken care by Tomasz Patches. 2. Converted ENYNOS_PMU_CPUNR macro to static inline function changes in v3: 1. Move cpunr calculation to a macro 2. Changed printk format specifier from unsigned hex to unsigned decimal Changes in v2: 1. Used existing macros for clusterid and cpuid calculation arch/arm/mach-exynos/regs-pmu.h | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-exynos/regs-pmu.h b/arch/arm/mach-exynos/regs-pmu.h index 4f6a256..f39e78c 100644 --- a/arch/arm/mach-exynos/regs-pmu.h +++ b/arch/arm/mach-exynos/regs-pmu.h @@ -105,8 +105,13 @@ #define S5P_GPS_LOWPWR S5P_PMUREG(0x139C) #define S5P_GPS_ALIVE_LOWPWR S5P_PMUREG(0x13A0) -#define S5P_ARM_CORE1_CONFIGURATION S5P_PMUREG(0x2080) -#define S5P_ARM_CORE1_STATUS S5P_PMUREG(0x2084) +#define S5P_ARM_CORE0_CONFIGURATION S5P_PMUREG(0x2000) +#define S5P_ARM_CORE0_STATUS S5P_PMUREG(0x2004) + +#define S5P_ARM_CORE_CONFIGURATION(_cpunr) \ + (S5P_ARM_CORE0_CONFIGURATION + 0x80 * (_cpunr)) +#define S5P_ARM_CORE_STATUS(_cpunr) \ + (S5P_ARM_CORE0_STATUS + 0x80 * (_cpunr)) #define S5P_PAD_RET_MAUDIO_OPTION S5P_PMUREG(0x3028) #define S5P_PAD_RET_GPIO_OPTION S5P_PMUREG(0x3108) @@ -313,4 +318,13 @@ #define EXYNOS5_OPTION_USE_RETENTION (1 << 4) +#include +#define MAX_CPUS_IN_CLUSTER 4 + +static inline unsigned int enynos_pmu_cpunr(unsigned int mpidr) +{ + return ((MPIDR_AFFINITY_LEVEL(mpidr, 1) * MAX_CPUS_IN_CLUSTER) + + MPIDR_AFFINITY_LEVEL(mpidr, 0)); +} + #endif /* __ASM_ARCH_REGS_PMU_H */