From patchwork Thu Aug 21 13:07:37 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vikas Sajjan X-Patchwork-Id: 4757771 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 243209F2E9 for ; Thu, 21 Aug 2014 13:13:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 009742017D for ; Thu, 21 Aug 2014 13:13:11 +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 BC2DD20179 for ; Thu, 21 Aug 2014 13:13:09 +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 1XKS91-0002uw-Pn; Thu, 21 Aug 2014 13:11:11 +0000 Received: from mail-pa0-x232.google.com ([2607:f8b0:400e:c03::232]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XKS6J-0005PH-2o for linux-arm-kernel@lists.infradead.org; Thu, 21 Aug 2014 13:08:23 +0000 Received: by mail-pa0-f50.google.com with SMTP id et14so14720727pad.9 for ; Thu, 21 Aug 2014 06:08:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=WOTJRdxEYp97EXyUBpjfiZ+Sp2ODEVEeN9ZUk3IUg1k=; b=ri6+klv0foui6ynfAg5QIOcVdC8bBeUmRIpb6Pg/ULZAcMLKzAHeESR78pxYWknngs CI23jVnF0eUKCzjpXunZ5SLxHvxA3P4L5M2bJJ+oot6H+O9FpvgY63XhRhtNi0sQx7D4 6FfIYNkEz46XK+ofCrG2j/eUjZo7fvrn2pDtlono4qslhsesmuR2mcbUJ3hQMxs0ZG3o 2au8W8CFQR3/OsJuXPb8jlzJfp+KAA6OH9fusxRUafMZ+6ka5ycZ87rKyfDAynhxgM3f OUcRI6mfrlSgz5oos8sLYug3dB/nQD8LnnshoMJMT/iE7r+O+/R3wmkPZj/ymiGCRd63 ZzTg== X-Received: by 10.66.189.73 with SMTP id gg9mr60733257pac.114.1408626480791; Thu, 21 Aug 2014 06:08:00 -0700 (PDT) Received: from localhost.localdomain ([14.140.216.146]) by mx.google.com with ESMTPSA id fg9sm34027259pad.4.2014.08.21.06.07.56 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 21 Aug 2014 06:07:59 -0700 (PDT) From: Vikas Sajjan To: linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org Subject: [PATCH v2 3/3] ARM: exynos: Add PMU and S2R support for exynos5800 SoC Date: Thu, 21 Aug 2014 18:52:37 +0545 Message-Id: <1408626457-3422-4-git-send-email-vikas.sajjan@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1408626457-3422-1-git-send-email-vikas.sajjan@samsung.com> References: <1408626457-3422-1-git-send-email-vikas.sajjan@samsung.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140821_060823_158131_3E7E7734 X-CRM114-Status: GOOD ( 13.80 ) X-Spam-Score: -0.7 (/) Cc: sajjan.linux@gmail.com, kgene.kim@samsung.com, tomasz.figa@gmail.com, dianders@chromium.org, olof@lixom.net, joshi@samsung.com 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+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_NONE,RP_MATCHES_RCVD,T_DKIM_INVALID,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 Adds PMU and S2R support for exynos5800 SoC. Signed-off-by: Vikas Sajjan --- arch/arm/mach-exynos/pm.c | 3 +++ arch/arm/mach-exynos/pmu.c | 22 ++++++++++++++++++++++ arch/arm/mach-exynos/regs-pmu.h | 3 ++- 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-exynos/pm.c b/arch/arm/mach-exynos/pm.c index acdcf0b..41fc1c3 100644 --- a/arch/arm/mach-exynos/pm.c +++ b/arch/arm/mach-exynos/pm.c @@ -646,6 +646,9 @@ static struct of_device_id exynos_pmu_of_device_ids[] = { }, { .compatible = "samsung,exynos5420-pmu", .data = &exynos5420_pm_data, + }, { + .compatible = "samsung,exynos5800-pmu", + .data = &exynos5420_pm_data, }, { /*sentinel*/ }, }; diff --git a/arch/arm/mach-exynos/pmu.c b/arch/arm/mach-exynos/pmu.c index f8ced42..c1cd31c 100644 --- a/arch/arm/mach-exynos/pmu.c +++ b/arch/arm/mach-exynos/pmu.c @@ -719,6 +719,19 @@ static void exynos5420_pmu_init(void) pr_info("EXYNOS5420 PMU initialized\n"); } +static void exynos5800_pmu_init(void) +{ + unsigned int value; + + exynos5420_pmu_init(); + + value = pmu_raw_readl(EXYNOS5420_LPI_MASK); + value |= EXYNOS5800_POWER_GATE_CTRL; + pmu_raw_writel(value, EXYNOS5420_LPI_MASK); + + pr_info("EXYNOS5800 PMU initialized\n"); +} + static const struct exynos_pmu_data exynos4210_pmu_data = { .pmu_config = exynos4210_pmu_config, @@ -745,6 +758,12 @@ static struct exynos_pmu_data exynos5420_pmu_data = { .powerdown_conf = exynos5420_powerdown_conf, }; +static struct exynos_pmu_data exynos5800_pmu_data = { + .pmu_config = exynos5420_pmu_config, + .pmu_init = exynos5800_pmu_init, + .powerdown_conf = exynos5420_powerdown_conf, +}; + static const struct regmap_config pmu_regmap_config = { .reg_bits = 32, .val_bits = 32, @@ -770,6 +789,9 @@ static const struct of_device_id exynos_pmu_of_device_ids[] = { }, { .compatible = "samsung,exynos5420-pmu", .data = &exynos5420_pmu_data, + }, { + .compatible = "samsung,exynos5800-pmu", + .data = &exynos5800_pmu_data, }, { /*sentinel*/ }, }; diff --git a/arch/arm/mach-exynos/regs-pmu.h b/arch/arm/mach-exynos/regs-pmu.h index 3a6a559..3a0140c 100644 --- a/arch/arm/mach-exynos/regs-pmu.h +++ b/arch/arm/mach-exynos/regs-pmu.h @@ -555,5 +555,6 @@ static inline unsigned int exynos_pmu_cpunr(unsigned int mpidr) | EXYNOS5420_KFC_USE_STANDBY_WFI1 \ | EXYNOS5420_KFC_USE_STANDBY_WFI2 \ | EXYNOS5420_KFC_USE_STANDBY_WFI3) - +/* for exynos5800 only */ +#define EXYNOS5800_POWER_GATE_CTRL (1 << 15) #endif /* __ASM_ARCH_REGS_PMU_H */