All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kever Yang <kever.yang@rock-chips.com>
To: heiko@sntech.de
Cc: dianders@chromium.org, sonnyrao@chromium.org,
	addy.ke@rock-chips.com, cf@rock-chips.com, xjq@rock-chips.com,
	hj@rock-chips.com, huangtao@rock-chips.com,
	linux-rockchip@lists.infradead.org,
	Kever Yang <kever.yang@rock-chips.com>,
	Russell King <linux@arm.linux.org.uk>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH v3 3/6] ARM: rockchip: add option to access the pmu via a phandle in smp_operations
Date: Fri, 10 Oct 2014 14:26:07 -0700	[thread overview]
Message-ID: <1412976370-14468-4-git-send-email-kever.yang@rock-chips.com> (raw)
In-Reply-To: <1412976370-14468-1-git-send-email-kever.yang@rock-chips.com>

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 <heiko@sntech.de>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
---

Changes in v3:
- add this patch

Changes in v2: None

 arch/arm/mach-rockchip/platsmp.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

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;
-- 
1.9.1


WARNING: multiple messages have this Message-ID (diff)
From: kever.yang@rock-chips.com (Kever Yang)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 3/6] ARM: rockchip: add option to access the pmu via a phandle in smp_operations
Date: Fri, 10 Oct 2014 14:26:07 -0700	[thread overview]
Message-ID: <1412976370-14468-4-git-send-email-kever.yang@rock-chips.com> (raw)
In-Reply-To: <1412976370-14468-1-git-send-email-kever.yang@rock-chips.com>

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 <heiko@sntech.de>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
---

Changes in v3:
- add this patch

Changes in v2: None

 arch/arm/mach-rockchip/platsmp.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

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;
-- 
1.9.1

  parent reply	other threads:[~2014-10-10 21:27 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-10 21:26 [PATCH v3 0/6] add basic rk3288 smp support Kever Yang
2014-10-10 21:26 ` Kever Yang
2014-10-10 21:26 ` Kever Yang
2014-10-10 21:26 ` [PATCH v3 1/6] ARM: rockchip: convert to regmap and use pmu syscon if available Kever Yang
2014-10-10 21:26   ` Kever Yang
2014-10-11 17:42   ` Heiko Stübner
2014-10-11 17:42     ` Heiko Stübner
2014-10-10 21:26 ` [PATCH v3 2/6] ARM: dts: rockchip: use the same pmu node name as before Kever Yang
2014-10-10 21:26   ` Kever Yang
2014-10-11 17:43   ` Heiko Stübner
2014-10-11 17:43     ` Heiko Stübner
2014-10-10 21:26 ` Kever Yang [this message]
2014-10-10 21:26   ` [PATCH v3 3/6] ARM: rockchip: add option to access the pmu via a phandle in smp_operations Kever Yang
2014-10-11 17:45   ` Heiko Stübner
2014-10-11 17:45     ` Heiko Stübner
2014-10-10 21:26 ` [PATCH v3 4/6] ARM: dts: rockchip: add pmu references to cpus nodes Kever Yang
2014-10-10 21:26   ` Kever Yang
2014-10-11 17:47   ` Heiko Stübner
2014-10-11 17:47     ` Heiko Stübner
2014-10-11 17:47     ` Heiko Stübner
2014-10-10 21:26 ` [PATCH v3 5/6] ARM: rockchip: add basic smp support for rk3288 Kever Yang
2014-10-10 21:26   ` Kever Yang
2014-10-11 17:55   ` Heiko Stübner
2014-10-11 17:55     ` Heiko Stübner
2014-10-10 21:26 ` [PATCH v3 6/6] ARM: dts: rockchip: add intmem node for rk3288 smp support Kever Yang
2014-10-10 21:26   ` Kever Yang
2014-10-11 18:01   ` Heiko Stübner
2014-10-11 18:01     ` Heiko Stübner
2014-10-11 18:04 ` [PATCH v3 0/6] add basic " Heiko Stübner
2014-10-11 18:04   ` Heiko Stübner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1412976370-14468-4-git-send-email-kever.yang@rock-chips.com \
    --to=kever.yang@rock-chips.com \
    --cc=addy.ke@rock-chips.com \
    --cc=cf@rock-chips.com \
    --cc=dianders@chromium.org \
    --cc=heiko@sntech.de \
    --cc=hj@rock-chips.com \
    --cc=huangtao@rock-chips.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=linux@arm.linux.org.uk \
    --cc=sonnyrao@chromium.org \
    --cc=xjq@rock-chips.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.