diff options
author | Heiko Stuebner <heiko@sntech.de> | 2014-10-15 10:23:01 -0700 |
---|---|---|
committer | Heiko Stuebner <heiko@sntech.de> | 2014-11-05 22:18:36 +0100 |
commit | 6de2d21adaf05b7a456077625b6e311feabd3718 (patch) | |
tree | 2e49cd6325051c13dd43e21652f9a8362581c308 /arch/arm/mach-rockchip | |
parent | d003b58c8389d596e9fc6a131fc2901e3d039343 (diff) | |
download | linux-6de2d21adaf05b7a456077625b6e311feabd3718.tar.gz linux-6de2d21adaf05b7a456077625b6e311feabd3718.tar.bz2 linux-6de2d21adaf05b7a456077625b6e311feabd3718.zip |
ARM: rockchip: add option to access the pmu via a phandle in smp_operations
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>
Diffstat (limited to 'arch/arm/mach-rockchip')
-rw-r--r-- | arch/arm/mach-rockchip/platsmp.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/arch/arm/mach-rockchip/platsmp.c b/arch/arm/mach-rockchip/platsmp.c index 4c36fbf99afb..57b53b32e103 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; |