]> git.karo-electronics.de Git - linux-beck.git/commitdiff
ARM: rockchip: add option to access the pmu via a phandle in smp_operations
authorHeiko Stuebner <heiko@sntech.de>
Wed, 15 Oct 2014 17:23:01 +0000 (10:23 -0700)
committerHeiko Stuebner <heiko@sntech.de>
Wed, 5 Nov 2014 21:18:36 +0000 (22:18 +0100)
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: Kever Yang <kever.yang@rock-chips.com>
Tested-by: Kevin Hilman <khilman@linaro.org>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Documentation/devicetree/bindings/arm/cpus.txt
arch/arm/mach-rockchip/platsmp.c

index fc446347ab6db4be375cb8125647b8585cba54ae..b2aacbe16ed9af08a616bee7907f7d5890624c2e 100644 (file)
@@ -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: <phandle>
+               Definition: Specifies the syscon node controlling the cpu core
+                           power domains.
+
 Example 1 (dual-cluster big.LITTLE system 32-bit):
 
        cpus {
index 4c36fbf99afb269b205aa5738ebbb750889b0358..57b53b32e103afcd4a038740dcfb67c0c5cd3ab0 100644 (file)
@@ -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;