From patchwork Tue Sep 2 21:19:06 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Soren Brinkmann X-Patchwork-Id: 4828371 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 2A0D8C0338 for ; Tue, 2 Sep 2014 21:22:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 74470201CD for ; Tue, 2 Sep 2014 21:22:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8C01D2017D for ; Tue, 2 Sep 2014 21:21:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754836AbaIBVT0 (ORCPT ); Tue, 2 Sep 2014 17:19:26 -0400 Received: from mail-pa0-f53.google.com ([209.85.220.53]:40769 "EHLO mail-pa0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755265AbaIBVTZ (ORCPT ); Tue, 2 Sep 2014 17:19:25 -0400 Received: by mail-pa0-f53.google.com with SMTP id fa1so15672690pad.40 for ; Tue, 02 Sep 2014 14:19:24 -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=hWdGWxze+Y+P6KYqlPzbZ0KuX1Wzpd8mCijzToA1Bnw=; b=wyPglccABb6rXRDM99Anyr9xmVH2JKdOtpp316wxI9KbibfvpwH7OwsUQf0rE3VGHp AJR1RHe3cOqVOFr9QujUm6LXwZMn+GvIoqxT5AHJt0yT4rxUGjYexQGS0qBuhPoJpy8r tcAar59aKTktZF28eGuozgm4LYW9C212jdEm1sKYkdVoEGBMKGl8koRoF/qog13Gat8u C4m1QiVSoToCytJtVprl3tD/kbmFkLAlIt/zlxK67j2IKiCQCFAnVNJI+7IBIQ4/x1iF yERCNRHZoacG1PprteIzz9hP/1DLnyna04uawIFlVkIiZpM9yFW7eZajPoXmlvS7WUME XDNA== X-Received: by 10.67.3.162 with SMTP id bx2mr49585862pad.57.1409692764559; Tue, 02 Sep 2014 14:19:24 -0700 (PDT) Received: from localhost ([149.199.62.254]) by mx.google.com with ESMTPSA id z4sm6826512pda.23.2014.09.02.14.19.22 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 02 Sep 2014 14:19:23 -0700 (PDT) From: Soren Brinkmann To: Michal Simek , Daniel Lezcano Cc: Russell King , "Rafael J. Wysocki" , =?UTF-8?q?S=C3=B6ren=20Brinkmann?= , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-pm@vger.kernel.org, Rob Herring , Mark Rutland , Pawel Moll , Ian Campbell , Kumar Gala Subject: [PATCH v2 1/9] ARM: zynq: PM: Enable A9 internal clock gating feature Date: Tue, 2 Sep 2014 14:19:06 -0700 Message-Id: <1409692754-13437-2-git-send-email-soren.brinkmann@xilinx.com> X-Mailer: git-send-email 2.1.0.1.g27b9230 In-Reply-To: <1409692754-13437-1-git-send-email-soren.brinkmann@xilinx.com> References: <1409692754-13437-1-git-send-email-soren.brinkmann@xilinx.com> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-8.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,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 Signed-off-by: Soren Brinkmann --- v2: - make comments comply to kernel-doc format --- arch/arm/mach-zynq/common.c | 6 ++++++ arch/arm/mach-zynq/common.h | 11 +++++++++++ arch/arm/mach-zynq/platsmp.c | 13 +++++++++++++ 3 files changed, 30 insertions(+) diff --git a/arch/arm/mach-zynq/common.c b/arch/arm/mach-zynq/common.c index 31a6fa40ba37..3cb7c198615a 100644 --- a/arch/arm/mach-zynq/common.c +++ b/arch/arm/mach-zynq/common.c @@ -98,6 +98,11 @@ static int __init zynq_get_revision(void) return revision; } +static void __init zynq_init_late(void) +{ + zynq_core_pm_init(); +} + /** * zynq_init_machine - System specific initialization, intended to be * called from board specific initialization. @@ -204,6 +209,7 @@ DT_MACHINE_START(XILINX_EP107, "Xilinx Zynq Platform") .map_io = zynq_map_io, .init_irq = zynq_irq_init, .init_machine = zynq_init_machine, + .init_late = zynq_init_late, .init_time = zynq_timer_init, .dt_compat = zynq_dt_match, .reserve = zynq_memory_init, diff --git a/arch/arm/mach-zynq/common.h b/arch/arm/mach-zynq/common.h index f652f0a884a6..596ef0b5067c 100644 --- a/arch/arm/mach-zynq/common.h +++ b/arch/arm/mach-zynq/common.h @@ -40,4 +40,15 @@ extern void __iomem *zynq_scu_base; /* Hotplug */ extern void zynq_platform_cpu_die(unsigned int cpu); +static inline void zynq_core_pm_init(void) +{ + /* A9 clock gating */ + asm volatile ("mrc p15, 0, r12, c15, c0, 0\n" + "orr r12, r12, #1\n" + "mcr p15, 0, r12, c15, c0, 0\n" + : /* no outputs */ + : /* no inputs */ + : "r12"); +} + #endif diff --git a/arch/arm/mach-zynq/platsmp.c b/arch/arm/mach-zynq/platsmp.c index abc82ef085c1..6c7843108c7f 100644 --- a/arch/arm/mach-zynq/platsmp.c +++ b/arch/arm/mach-zynq/platsmp.c @@ -112,6 +112,18 @@ static void __init zynq_smp_prepare_cpus(unsigned int max_cpus) scu_enable(zynq_scu_base); } +/** + * zynq_secondary_init - Initialize secondary CPU cores + * @cpu: CPU that is initialized + * + * This function is in the hotplug path. Don't move it into the + * init section!! + */ +static void zynq_secondary_init(unsigned int cpu) +{ + zynq_core_pm_init(); +} + #ifdef CONFIG_HOTPLUG_CPU static int zynq_cpu_kill(unsigned cpu) { @@ -124,6 +136,7 @@ struct smp_operations zynq_smp_ops __initdata = { .smp_init_cpus = zynq_smp_init_cpus, .smp_prepare_cpus = zynq_smp_prepare_cpus, .smp_boot_secondary = zynq_boot_secondary, + .smp_secondary_init = zynq_secondary_init, #ifdef CONFIG_HOTPLUG_CPU .cpu_die = zynq_platform_cpu_die, .cpu_kill = zynq_cpu_kill,