From patchwork Mon Oct 13 20:11:58 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kever Yang X-Patchwork-Id: 5077181 Return-Path: X-Original-To: patchwork-linux-rockchip@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 D3CD89F387 for ; Mon, 13 Oct 2014 20:13:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F35DA2024F for ; Mon, 13 Oct 2014 20:13:02 +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 2628C20254 for ; Mon, 13 Oct 2014 20:13:02 +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 1XdlzJ-0004jT-CN; Mon, 13 Oct 2014 20:13:01 +0000 Received: from mail-pa0-x229.google.com ([2607:f8b0:400e:c03::229]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Xdlyo-0004Xc-On; Mon, 13 Oct 2014 20:12:31 +0000 Received: by mail-pa0-f41.google.com with SMTP id eu11so6466551pac.0 for ; Mon, 13 Oct 2014 13:12:09 -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=QY2jwy18YLEmbsYTBBJEYYCkxKCr9TBhzm0y3eq+okg=; b=yZqMm0fUgEcFDKQswyDRbZHYehOEuYJh75x/ZnG7Eb6EVI/Jc68bGqAbCs2Hnezxin MoRLbsD9RwpKdz6lkEmP43fRoZ9cp9UWMlOE5gjlvyhpTud9WIEwonkjP1nZAH94xrd5 b4d2yLEscuZtaKjP1BX4zzNSdyNDVqHMR32N/0bUYP720cQ+YSi+rqVdBTO8ryMZu6If Yc1BT2QafOHt4Zv7lqSkTjjRRLRJkbfKpZ1IRmZ3W1zmfrbjdNj5t4VU2C/VJsWJjz38 tQ0TQB3gAfiXOu9QzRjXozVroQie7Do3Qqy0sXb8Wf4qybVweiCbC+oKpeu18tQC4C1j 0FhQ== X-Received: by 10.70.10.33 with SMTP id f1mr662631pdb.1.1413231129752; Mon, 13 Oct 2014 13:12:09 -0700 (PDT) Received: from kever-X240.corp.google.com (dhcp-172-22-52-129.mtv.corp.google.com [172.22.52.129]) by mx.google.com with ESMTPSA id fg1sm11968146pdb.91.2014.10.13.13.12.08 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 13 Oct 2014 13:12:09 -0700 (PDT) From: Kever Yang To: heiko@sntech.de Subject: [PATCH v4 2/6] ARM: rockchip: add option to access the pmu via a phandle in smp_operations Date: Mon, 13 Oct 2014 13:11:58 -0700 Message-Id: <1413231122-1770-3-git-send-email-kever.yang@rock-chips.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1413231122-1770-1-git-send-email-kever.yang@rock-chips.com> References: <1413231122-1770-1-git-send-email-kever.yang@rock-chips.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141013_131230_888637_737D7316 X-CRM114-Status: GOOD ( 12.72 ) X-Spam-Score: -0.7 (/) Cc: Mark Rutland , Catalin Marinas , Kever Yang , Rohit Vaswani , xjq@rock-chips.com, Lorenzo Pieralisi , Russell King , Pawel Moll , linux-rockchip@lists.infradead.org, hj@rock-chips.com, huangtao@rock-chips.com, devicetree@vger.kernel.org, addy.ke@rock-chips.com, Jason Cooper , Arnd Bergmann , Ian Campbell , cf@rock-chips.com, Rob Herring , Gregory CLEMENT , sonnyrao@chromium.org, linux-arm-kernel@lists.infradead.org, Marc Carino , dianders@chromium.org, linux-kernel@vger.kernel.org, Kumar Gala , Olof Johansson , Maxime Ripard X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_NONE, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=no 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: Heiko Stuebner Makes it possible to define a rockchip,pmu phandle in the cpus node directly referencing the pmu syscon instead of searching for specific compatible. The old way of finding the pmu stays of course available. Signed-off-by: Heiko Stuebner Signed-off-by: Kever Yang --- Changes in v4: - add rockchip,pmu property into cpus.txt Changes in v3: - add this patch Changes in v2: None Documentation/devicetree/bindings/arm/cpus.txt | 9 +++++++++ arch/arm/mach-rockchip/platsmp.c | 13 +++++++++++++ 2 files changed, 22 insertions(+) diff --git a/Documentation/devicetree/bindings/arm/cpus.txt b/Documentation/devicetree/bindings/arm/cpus.txt index fc44634..b2aacbe 100644 --- a/Documentation/devicetree/bindings/arm/cpus.txt +++ b/Documentation/devicetree/bindings/arm/cpus.txt @@ -227,6 +227,15 @@ nodes to be present and contain the properties described below. # List of phandles to idle state nodes supported by this cpu [3]. + - rockchip,pmu + Usage: optional for systems that have an "enable-method" + property value of "rockchip,rk3066-smp" + While optional, it is the preferred way to get access to + the cpu-core power-domains. + Value type: + Definition: Specifies the syscon node controlling the cpu core + power domains. + Example 1 (dual-cluster big.LITTLE system 32-bit): cpus { diff --git a/arch/arm/mach-rockchip/platsmp.c b/arch/arm/mach-rockchip/platsmp.c index 4c36fbf..57b53b3 100644 --- a/arch/arm/mach-rockchip/platsmp.c +++ b/arch/arm/mach-rockchip/platsmp.c @@ -155,6 +155,19 @@ static int __init rockchip_smp_prepare_pmu(void) struct device_node *node; void __iomem *pmu_base; + /* + * This function is only called via smp_ops->smp_prepare_cpu(). + * That only happens if a "/cpus" device tree node exists + * and has an "enable-method" property that selects the SMP + * operations defined herein. + */ + node = of_find_node_by_path("/cpus"); + + pmu = syscon_regmap_lookup_by_phandle(node, "rockchip,pmu"); + of_node_put(node); + if (!IS_ERR(pmu)) + return 0; + pmu = syscon_regmap_lookup_by_compatible("rockchip,rk3066-pmu"); if (!IS_ERR(pmu)) return 0;