ARM: rk3288: Add PM Domain support
Subsystems (4)
v12 cover ARM: rk3288: Add PM Domain support
Add power domain drivers based on generic power domain for Rockchip platform, and support RK3288.
https://chromium-review.googlesource.com/#/c/220253/9
This is the GPU driver, add the following information in DT, and it can support the PMDOMAIN
gpu: gpu at ffa30000 {
compatible = "arm,malit764",
"arm,malit76x",
"arm,malit7xx",
"arm,mali-midgard";
reg = <0xffa30000 0x10000>;
interrupts = <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "JOB", "MMU", "GPU";
clocks = <&cru ACLK_GPU>;
clock-names = "aclk_gpu";
operating-points = <
/* KHz uV */
100000 800000
200000 850000
300000 950000
400000 1000000
600000 1150000
>;
power-domains = <&power RK3288_PD_GPU>;
status = "disabled";
};Based on:
- [PATCH v4 1/3] PM / clock_ops: Add pm_clk_add_clk()
http://patchwork.kernel.org/patch/5242121/
Changes in v12:
- fix the title doamin->domain.
- updated device_attach and device_detach API,otherwise it will compile fail on next kernel.
- Remove essential clocks from rk3288 PD_VIO domain,
Some clocks are essential for the system health and should not be turned down. However there is no owner for them so if they listed as belonging to power domain we'll try toggling them up and down during power domain transition. As a result we either fail to suspend or resume the system.
Changes in v11:
- fix pm_genpd_init(&pd->genpd, NULL, false);
Changes in v10:
- this switches over domain infos to use masks instead of recomputing them each time and also gets rid of custom domain translator and uses standard onecell on.
- fix missing the #include <dt-bindings/power-domain/rk3288.h>
- remove the notes
Changes in v9:
- add document decription
- fix v8 changes as follows:
- This reconciles the v2 and v7 code so that we power domain have lists of clocks they toggle on and off during power transitions and independently from power domains clocks we attach clocks to devices comprising power domain and prepare them so they are turn on and off by runtime PM.
- add rockchip_pm_add_one_domain() to control domains.
- add pd_start/pd_stop interface to control clocks
- add decription for power-doamin node
Changes in v8:
- document go back to v2
- This reconciles the v2 and v7 code so that we power domain have lists of clocks they toggle on and off during power transitions and independently from power domains clocks we attach clocks to devices comprising power domain and prepare them so they are turn on and off by runtime PM.
- DTS go back to v2
Changes in v7:
- Delete unused variables
Changes in v6:
- delete pmu_lock
- modify dev_lock using mutex
- pm_clk_resume(pd->dev) change to pm_clk_resume(ed->dev)
- pm_clk_suspend(pd->dev) change to pm_clk_suspend(ed->dev)
- add devm_kfree(pd->dev, de) in rockchip_pm_domain_detach_dev
Changes in v5:
- delete idle_lock
- add timeout in rockchip_pmu_set_idle_request()
Changes in v4:
- use list storage dev
Changes in v3:
- DT structure has changed
- change use pm_clk_resume() and pm_clk_suspend()
- Decomposition power-controller, changed to multiple controller (gpu-power-controller, hevc-power-controller)
Changes in v2:
- move clocks to "optional"
- remove the "pd->pd.of_node = np"
- make pd_vio clocks all one entry per line and alphabetize.
- power: power-controller move back to pinctrl: pinctrl.
Caesar Wang (3):
dt-bindings: add document of Rockchip power domain
power-domain: rockchip: add power domain driver
ARM: dts: add rk3288 power-domain node
.../bindings/arm/rockchip/power_domain.txt | 48 +++ arch/arm/boot/dts/rk3288.dtsi | 59 +++ arch/arm/mach-rockchip/Kconfig | 1 + arch/arm/mach-rockchip/Makefile | 1 + arch/arm/mach-rockchip/pm_domains.c | 472 +++++++++++++++++++++ include/dt-bindings/power-domain/rk3288.h | 11 + 6 files changed, 592 insertions(+) create mode 100644 Documentation/devicetree/bindings/arm/rockchip/power_domain.txt create mode 100644 arch/arm/mach-rockchip/pm_domains.c create mode 100644 include/dt-bindings/power-domain/rk3288.h
Signature · 1 line
1.9.1
PATCH v12 1/3 dt-bindings: add document of Rockchip power domain
This add the necessary binding documentation for the power domain found on Rockchip Socs.
---
Changes in v12: None
Changes in v11: None
Changes in v10: None
Changes in v9:
- add document decription
Changes in v8:
- document go back to v2
Changes in v7: None
Changes in v6: None
Changes in v5: None
Changes in v4: None
Changes in v3:
- DT structure has changed
Changes in v2:
- move clocks to "optional"
.../bindings/arm/rockchip/power_domain.txt | 48 ++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 Documentation/devicetree/bindings/arm/rockchip/power_domain.txt
Documentation/devicetree/bindings/arm/rockchip/power_domain.txt new file +48 -0
@@ -0,0 +1,48 @@ +* Rockchip Power Domains + +Rockchip processors include support for multiple power domains which can be +powered up/down by software based on different application scenes to save power. + +Required properties for power domain controller: +- compatible: should be one of the following. + * rockchip,rk3288-power-controller - for rk3288 type power domain. +- #power-domain-cells: Number of cells in a power-domain specifier. + should be 1. +- rockchip,pmu: phandle referencing a syscon providing the pmu registers +- #address-cells: should be 1. +- #size-cells: should be 0. + +Required properties for power domain sub nodes: +- reg: index of the power domain, should use macros in: + * include/dt-bindings/power-domain/rk3288.h - for rk3288 type power domain. +- clocks (optional): phandles to clocks which need to be enabled while power domain + switches state. + +Example: + + power: power-controller { + compatible = "rockchip,rk3288-power-controller"; + #power-domain-cells = <1>; + rockchip,pmu = <&pmu>; + #address-cells = <1>; + #size-cells = <0>; + + pd_gpu { + reg = <RK3288_PD_GPU>; + clocks = <&cru ACLK_GPU>; + }; + }; + +Node of a device using power domains must have a power-domains property, +containing a phandle to the power device node and an index specifying which +power domain to use. +The index should use macros in: + * include/dt-bindings/power-domain/rk3288.h - for rk3288 type power domain. + +Example of the node using power domain: + + node { + /* ... */ + power-domains = <&power RK3288_PD_GPU>; + /* ... */ + };
Signature · 1 line
1.9.1
PATCH v12 2/3 power-domain: rockchip: add power domain driver
In reply to Caesar WangIn order to meet high performance and low power requirements, a power management unit is designed or saving power when RK3288 in low power mode. The RK3288 PMU is dedicated for managing the power ot the whole chip.
---
Changes in v12:
- fix the title doamin->domain.
- updated device_attach and device_detach API,otherwise it will compile fail on next kernel.
Changes in v11:
- fix pm_genpd_init(&pd->genpd, NULL, false);
Changes in v10:
- this switches over domain infos to use masks instead of recomputing them each time and also gets rid of custom domain translator and uses standard onecell on.
Changes in v9:
- fix v8 changes as follows:
- This reconciles the v2 and v7 code so that we power domain have lists of clocks they toggle on and off during power transitions and independently from power domains clocks we attach clocks to devices comprising power domain and prepare them so they are turn on and off by runtime PM.
- add rockchip_pm_add_one_domain() to control domains.
- add pd_start/pd_stop interface to control clocks
Changes in v8:
- This reconciles the v2 and v7 code so that we power domain have lists of clocks they toggle on and off during power transitions and independently from power domains clocks we attach clocks to devices comprising power domain and prepare them so they are turn on and off by runtime PM.
Changes in v7:
- Delete unused variables
Changes in v6:
- delete pmu_lock
- modify dev_lock using mutex
- pm_clk_resume(pd->dev) change to pm_clk_resume(ed->dev)
- pm_clk_suspend(pd->dev) change to pm_clk_suspend(ed->dev)
- add devm_kfree(pd->dev, de) in rockchip_pm_domain_detach_dev
Changes in v5:
- delete idle_lock
- add timeout in rockchip_pmu_set_idle_request()
Changes in v4:
- use list storage dev
Changes in v3:
- change use pm_clk_resume() and pm_clk_suspend()
Changes in v2:
- remove the "pd->pd.of_node = np"
arch/arm/mach-rockchip/Kconfig | 1 + arch/arm/mach-rockchip/Makefile | 1 + arch/arm/mach-rockchip/pm_domains.c | 472 ++++++++++++++++++++++++++++++ include/dt-bindings/power-domain/rk3288.h | 11 + 4 files changed, 485 insertions(+) create mode 100644 arch/arm/mach-rockchip/pm_domains.c create mode 100644 include/dt-bindings/power-domain/rk3288.h
arch/arm/mach-rockchip/Kconfig +1 -0
@@ -13,6 +13,7 @@ config ARCH_ROCKCHIP select DW_APB_TIMER_OF select ARM_GLOBAL_TIMER select CLKSRC_ARM_GLOBAL_TIMER_SCHED_CLOCK + select PM_GENERIC_DOMAINS if PM help Support for Rockchip's Cortex-A9 Single-to-Quad-Core-SoCs containing the RK2928, RK30xx and RK31xx series.
arch/arm/mach-rockchip/Makefile +1 -0
@@ -1,4 +1,5 @@ CFLAGS_platsmp.o := -march=armv7-a obj-$(CONFIG_ARCH_ROCKCHIP) += rockchip.o +obj-$(CONFIG_PM_GENERIC_DOMAINS) += pm_domains.o obj-$(CONFIG_SMP) += headsmp.o platsmp.o
arch/arm/mach-rockchip/pm_domains.c new file +472 -0
472 lines not on this page · raw message
include/dt-bindings/power-domain/rk3288.h new file +11 -0
@@ -0,0 +1,11 @@ +#ifndef __DT_BINDINGS_POWER_DOMAIN_RK3288_H__ +#define __DT_BINDINGS_POWER_DOMAIN_RK3288_H__ + +/* RK3288 power domain index */ +#define RK3288_PD_GPU 0 +#define RK3288_PD_VIO 1 +#define RK3288_PD_VIDEO 2 +#define RK3288_PD_HEVC 3 +#define RK3288_PD_PERI 4 + +#endif
Signature · 1 line
1.9.1
PATCH v12 3/3 ARM: dts: add rk3288 power-domain node
In reply to Caesar WangThis patch add the needed clocks into power-controller.
why need we do so that?
Firstly, we always be needed turn off clocks to save power when the system enter suspend.So we need to enumerate the clocks are needed to switch power doamin no and off.
Secondly, Rk3288 reset circuit should be syncchronous reset and then sync revoked.so we need to enable clocks of all devices.
---
Changes in v12:
- Remove essential clocks from rk3288 PD_VIO domain,
Some clocks are essential for the system health and should not be turned down. However there is no owner for them so if they listed as belonging to power domain we'll try toggling them up and down during power domain transition. As a result we either fail to suspend or resume the system.
Changes in v11: None
Changes in v10:
- fix missing the #include <dt-bindings/power-domain/rk3288.h>
- remove the notes
Changes in v9:
- add decription for power-doamin node
Changes in v8:
- DTS go back to v2
Changes in v7: None
Changes in v6: None
Changes in v5: None
Changes in v4: None
Changes in v3:
- Decomposition power-controller, changed to multiple controller (gpu-power-controller, hevc-power-controller)
Changes in v2:
- make pd_vio clocks all one entry per line and alphabetize.
- power: power-controller move back to pinctrl: pinctrl.
arch/arm/boot/dts/rk3288.dtsi | 59 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+)
arch/arm/boot/dts/rk3288.dtsi +59 -0
@@ -15,6 +15,7 @@ #include <dt-bindings/interrupt-controller/arm-gic.h> #include <dt-bindings/pinctrl/rockchip.h> #include <dt-bindings/clock/rk3288-cru.h> +#include <dt-bindings/power-domain/rk3288.h> #include "skeleton.dtsi" / {
@@ -989,4 +990,62 @@ }; }; }; + + power: power-controller { + compatible = "rockchip,rk3288-power-controller"; + #power-domain-cells = <1>; + rockchip,pmu = <&pmu>; + #address-cells = <1>; + #size-cells = <0>; + + pd_gpu { + reg = <RK3288_PD_GPU>; + clocks = <&cru ACLK_GPU>; + }; + + pd_hevc { + reg = <RK3288_PD_HEVC>; + clocks = <&cru ACLK_HEVC>, + <&cru SCLK_HEVC_CABAC>, + <&cru SCLK_HEVC_CORE>, + <&cru HCLK_HEVC>; + }; + + pd_vio { + reg = <RK3288_PD_VIO>; + clocks = <&cru ACLK_IEP>, + <&cru ACLK_ISP>, + <&cru ACLK_RGA>, + <&cru ACLK_VIP>, + <&cru ACLK_VOP0>, + <&cru ACLK_VOP1>, + <&cru DCLK_VOP0>, + <&cru DCLK_VOP1>, + <&cru HCLK_IEP>, + <&cru HCLK_ISP>, + <&cru HCLK_RGA>, + <&cru HCLK_VIP>, + <&cru HCLK_VOP0>, + <&cru HCLK_VOP1>, + <&cru PCLK_EDP_CTRL>, + <&cru PCLK_HDMI_CTRL>, + <&cru PCLK_LVDS_PHY>, + <&cru PCLK_MIPI_CSI>, + <&cru PCLK_MIPI_DSI0>, + <&cru PCLK_MIPI_DSI1>, + <&cru SCLK_EDP_24M>, + <&cru SCLK_EDP>, + <&cru SCLK_HDMI_CEC>, + <&cru SCLK_HDMI_HDCP>, + <&cru SCLK_ISP_JPE>, + <&cru SCLK_ISP>, + <&cru SCLK_RGA>; + }; + + pd_video { + reg = <RK3288_PD_VIDEO>; + clocks = <&cru ACLK_VCODEC>, + <&cru HCLK_VCODEC>; + }; + }; };
Signature · 1 line
1.9.1
Heiko Stübner
maintainerRe: [PATCH v12 3/3] ARM: dts: add rk3288 power-domain node
Hi Caesar,
Am Montag, 17. November 2014, 17:50:41 schrieb Caesar Wang:
Quoted 127 lines
This patch add the needed clocks into power-controller.
why need we do so that?
Firstly, we always be needed turn off clocks to save power when the system enter suspend.So we need to enumerate the clocks are needed to switch power doamin no and off.
Secondly, Rk3288 reset circuit should be syncchronous reset and then sync revoked.so we need to enable clocks of all devices.
Signed-off-by Jack Dai <[email protected]>Signed-off-by jinkun.hong <[email protected]>Signed-off-by Caesar Wang <[email protected]>---
Changes in v12:
- Remove essential clocks from rk3288PD_VIOdomain,
Some clocks are essential for the system health and should not be turned down. However there is no owner for them so if they listed as belonging to power domain we'll try toggling them up and down during power domain transition. As a result we either fail to suspend or
resume the system.Changes in v11: None
Changes in v10:
- fix missing the #include <dt-bindings/power-domain/rk3288.h>
- remove the notesChanges in v9:
- add decription for power-doamin nodeChanges in v8:
- DTS go back to v2Changes in v7: None
Changes in v6: None
Changes in v5: None
Changes in v4: None
Changes in v3:
- Decomposition power-controller, changed to multiple controller (gpu-power-controller, hevc-power-controller)Changes in v2:
- makepd_vioclocks all one entry per line and alphabetize.
- power: power-controller move back to pinctrl: pinctrl.arch/arm/boot/dts/rk3288.dtsi | 59+++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+)
arch/arm/boot/dts/rk3288.dtsi +59
-0@@ -15,6 +15,7 @@ #include <dt-bindings/interrupt-controller/arm-gic.h> #include <dt-bindings/pinctrl/rockchip.h> #include <dt-bindings/clock/rk3288-cru.h> +#include <dt-bindings/power-domain/rk3288.h> #include "skeleton.dtsi" / {@@ -989,4 +990,62 @@ }; }; }; + + power: power-controller { + compatible = "rockchip,rk3288-power-controller"; + #power-domain-cells = <1>; + rockchip,pmu = <&pmu>; + #address-cells = <1>; + #size-cells = <0>; + + pd_gpu { + reg = <RK3288_PD_GPU>; + clocks = <&cru ACLK_GPU>; + }; + + pd_hevc { + reg = <RK3288_PD_HEVC>; + clocks = <&cru ACLK_HEVC>, + <&cru SCLK_HEVC_CABAC>, + <&cru SCLK_HEVC_CORE>, + <&cru HCLK_HEVC>; + }; + + pd_vio { + reg = <RK3288_PD_VIO>; + clocks = <&cru ACLK_IEP>, + <&cru ACLK_ISP>, + <&cru ACLK_RGA>, + <&cru ACLK_VIP>, + <&cru ACLK_VOP0>, + <&cru ACLK_VOP1>, + <&cru DCLK_VOP0>, + <&cru DCLK_VOP1>, + <&cru HCLK_IEP>, + <&cru HCLK_ISP>, + <&cru HCLK_RGA>, + <&cru HCLK_VIP>, + <&cru HCLK_VOP0>, + <&cru HCLK_VOP1>, + <&cru PCLK_EDP_CTRL>, + <&cru PCLK_HDMI_CTRL>, + <&cru PCLK_LVDS_PHY>, + <&cru PCLK_MIPI_CSI>, + <&cru PCLK_MIPI_DSI0>, + <&cru PCLK_MIPI_DSI1>, + <&cru SCLK_EDP_24M>, + <&cru SCLK_EDP>, + <&cru SCLK_HDMI_CEC>, + <&cru SCLK_HDMI_HDCP>, + <&cru SCLK_ISP_JPE>, + <&cru SCLK_ISP>, + <&cru SCLK_RGA>; + }; + + pd_video { + reg = <RK3288_PD_VIDEO>; + clocks = <&cru ACLK_VCODEC>, + <&cru HCLK_VCODEC>; + }; + }; };
Heiko Stübner
maintainerRe: [PATCH v12 3/3] ARM: dts: add rk3288 power-domain node
please ignore this and the previous mail - I accidentially hit a wrong button.
Sorry for the noise
Heiko
Am Freitag, 28. November 2014, 09:57:47 schrieb Heiko Stübner:
Quoted 144 lines
Hi Caesar,
Am Montag, 17. November 2014, 17:50:41 schrieb Caesar Wang:
Quoted 141 lines
This patch add the needed clocks into power-controller.
why need we do so that?
Firstly, we always be needed turn off clocks to save power when the system enter suspend.So we need to enumerate the clocks are needed to switch power doamin no and off.
Secondly, Rk3288 reset circuit should be syncchronous reset and then sync revoked.so we need to enable clocks of all devices.
Signed-off-by Jack Dai <[email protected]>Signed-off-by jinkun.hong <[email protected]>Signed-off-by Caesar Wang <[email protected]>---
Changes in v12:
- Remove essential clocks from rk3288PD_VIOdomain,Some clocks are essential for the system health and should not be turned down. However there is no owner for them so if they listed as belonging to power domain we'll try toggling them up and down during power domain transition. As a result we either fail to suspend or
resume the system.
Changes in v11: None
Changes in v10:
- fix missing the #include <dt-bindings/power-domain/rk3288.h>
- remove the notesChanges in v9:
- add decription for power-doamin nodeChanges in v8:
- DTS go back to v2Changes in v7: None
Changes in v6: None
Changes in v5: None
Changes in v4: NoneChanges in v3:
- Decomposition power-controller, changed to multiple controller (gpu-power-controller, hevc-power-controller)Changes in v2:
- makepd_vioclocks all one entry per line and alphabetize.
- power: power-controller move back to pinctrl: pinctrl.arch/arm/boot/dts/rk3288.dtsi | 59+++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+)
arch/arm/boot/dts/rk3288.dtsi +1
-0@@ -15,6 +15,7 @@ #include <dt-bindings/interrupt-controller/arm-gic.h> #include <dt-bindings/pinctrl/rockchip.h> #include <dt-bindings/clock/rk3288-cru.h> +#include <dt-bindings/power-domain/rk3288.h>#include "
skeleton.dtsi"/ {
arch/arm/boot/dts/rk3288.dtsi +58
-0@@ -989,4 +990,62 @@ }; }; }; + + power: power-controller { + compatible = "rockchip,rk3288-power-controller"; + #power-domain-cells = <1>; + rockchip,pmu = <&pmu>; + #address-cells = <1>; + #size-cells = <0>; + + pd_gpu { + reg = <RK3288_PD_GPU>; + clocks = <&cru ACLK_GPU>; + }; + + pd_hevc { + reg = <RK3288_PD_HEVC>; + clocks = <&cru ACLK_HEVC>, + <&cru SCLK_HEVC_CABAC>, + <&cru SCLK_HEVC_CORE>, + <&cru HCLK_HEVC>; + }; + + pd_vio { + reg = <RK3288_PD_VIO>; + clocks = <&cru ACLK_IEP>, + <&cru ACLK_ISP>, + <&cru ACLK_RGA>, + <&cru ACLK_VIP>, + <&cru ACLK_VOP0>, + <&cru ACLK_VOP1>, + <&cru DCLK_VOP0>, + <&cru DCLK_VOP1>, + <&cru HCLK_IEP>, + <&cru HCLK_ISP>, + <&cru HCLK_RGA>, + <&cru HCLK_VIP>, + <&cru HCLK_VOP0>, + <&cru HCLK_VOP1>, + <&cru PCLK_EDP_CTRL>, + <&cru PCLK_HDMI_CTRL>, + <&cru PCLK_LVDS_PHY>, + <&cru PCLK_MIPI_CSI>, + <&cru PCLK_MIPI_DSI0>, + <&cru PCLK_MIPI_DSI1>, + <&cru SCLK_EDP_24M>, + <&cru SCLK_EDP>, + <&cru SCLK_HDMI_CEC>, + <&cru SCLK_HDMI_HDCP>, + <&cru SCLK_ISP_JPE>, + <&cru SCLK_ISP>, + <&cru SCLK_RGA>; + }; + + pd_video { + reg = <RK3288_PD_VIDEO>; + clocks = <&cru ACLK_VCODEC>, + <&cru HCLK_VCODEC>; + }; + }; };
Heiko Stübner
maintainerAm Montag, 17. November 2014, 17:50:38 schrieb Caesar Wang:
Quoted 6 lines
Add power domain drivers based on generic power domain for Rockchip platform, and support RK3288.
https://chromium-review.googlesource.com/#/c/220253/9
This is the GPU driver, add the following information in DT, and it can support the PMDOMAIN
I'm not sure what to do with this series. Kevin had concerns about the clocks being part of the power-domains and I don't see them actually addressed and/or Kevin being satisfied - actually he isn't even on the recipients list of this version of the series.
@Ceasar: you should include people being part of important previous conversations in new versions of patchsets - especially when they have voiced concerns.
I've added Tomasz whom I remember having previous experience on the Exynos Powerdomains, so maybe he can add some other perspective - new ideas.
@Tomasz: this is the part of Kevin's concerns from v10 of the powerdomain series:
Am Donnerstag, 13. November 2014, 12:24:47 schrieben Kevin Hilman:
Quoted 33 lines
Quoted 11 lines · Heiko Stübner
Am Dienstag, 11. November 2014, 08:53:13 schrieb Kevin Hilman:
Quoted 5 lines
I still don't like having lists of clocks in the power-domain DT.
DT is supposed to describe the hardware, and clocks are properties of devices, not power-domains, so the DT description should follow from that.
on the policy side one could argue that if the clock needs to be enabled to
achieve sucessful domain state-changes, that it is also a property of the domain itself in addition to the device.You could, but from a hardware perspective, the clock is a property of the device.
Quoted 5 lines
And on the pratical side we don't have drivers nor bindings for a big part of the domain users - and this will probably be true for quite some time. This of course makes it very impractical (or impossible) to collect the clocks for parts like the gpu (mali), hevc, vcodec (video encoder/decoder), rga (2d stuff), iep, isp.
This doesn't sound impossible at all.
You have to collect the clocks anyways. The only debate is whether to list them in the device node or the power-domain node.
Even for devices without drivers, you just need a minimal node in the DT if which lists the clocks and has a phandle to the parent power domain.
Sounds rather simple to me, and since the DT is supposed to describe the hardware, doing it this way makes looking at the DT actually help understand the hardware.
Quoted 15 lines · Heiko St?bner
Am Montag, 17. November 2014, 17:50:38 schrieb Caesar Wang:
Quoted 6 lines
Add power domain drivers based on generic power domain for Rockchip platform, and support RK3288.
https://chromium-review.googlesource.com/#/c/220253/9
This is the GPU driver, add the following information in DT, and it can support the PMDOMAINI'm not sure what to do with this series. Kevin had concerns about the clocks being part of the power-domains and I don't see them actually addressed and/or Kevin being satisfied - actually he isn't even on the recipients list of this version of the series.
Quoted 8 lines
@Ceasar: you should include people being part of important previous conversations in new versions of patchsets - especially when they have voiced concerns.
I've added Tomasz whom I remember having previous experience on the Exynos Powerdomains, so maybe he can add some other perspective - new ideas.
Thanks Heiko for adding me to this thread.
Quoted 21 lines
@Tomasz: this is the part of Kevin's concerns from v10 of the powerdomain series:
Am Donnerstag, 13. November 2014, 12:24:47 schrieben Kevin Hilman:
Quoted 16 lines
Quoted 11 lines · Heiko St?bner
Am Dienstag, 11. November 2014, 08:53:13 schrieb Kevin Hilman:
Quoted 5 lines
I still don't like having lists of clocks in the power-domain DT.
DT is supposed to describe the hardware, and clocks are properties of devices, not power-domains, so the DT description should follow from that.
on the policy side one could argue that if the clock needs to be enabled to
achieve sucessful domain state-changes, that it is also a property of the domain itself in addition to the device.You could, but from a hardware perspective, the clock is a property of the device.
Well, the system controller which control the power domains is also a device. In DT we do not represent the domains alone, but rather the system controller, which acts as a power domain provider. If it need certain clocks to do its work, then I believe it should have them listed in its node. However the dependencies between clocks and power domains are not clear to me either, so I don't have any strong opinion on whether this would be the best solution.
Quoted 11 lines
Quoted 11 lines
Quoted 5 lines
And on the pratical side we don't have drivers nor bindings for a big part of the domain users - and this will probably be true for quite some time. This of course makes it very impractical (or impossible) to collect the clocks for parts like the gpu (mali), hevc, vcodec (video encoder/decoder), rga (2d stuff), iep, isp.
This doesn't sound impossible at all.
You have to collect the clocks anyways. The only debate is whether to list them in the device node or the power-domain node.
Quoted 7 lines
Quoted 6 lines
Even for devices without drivers, you just need a minimal node in the DT if which lists the clocks and has a phandle to the parent power domain.
Sounds rather simple to me, and since the DT is supposed to describe the hardware, doing it this way makes looking at the DT actually help understand the hardware.
If the dependency between clocks and power domain is kind of "all clocks of all devices in this domain should be enabled when performing operation on the domain" then IMHO it should be more reasonable to put the clocks only in nodes of respective devices and then follow the links from the domain to devices inside of it and retrieve the clocks from there, so that they don't have to be duplicated. AFAIK, we don't like redundancy in DT.
Best regards,
Tomasz
Quoted 14 lines · Tomasz Figa
Quoted 13 lines · Heiko Stübner
Am Montag, 17. November 2014, 17:50:38 schrieb Caesar Wang:
Quoted 6 lines
Add power domain drivers based on generic power domain for Rockchip platform, and support RK3288.
https://chromium-review.googlesource.com/#/c/220253/9
This is the GPU driver, add the following information in DT, and it can support the PMDOMAINI'm not sure what to do with this series. Kevin had concerns about the clocks being part of the power-domains and I don't see them actually addressed and/or Kevin being satisfied - actually he isn't even on the recipients list of this version of the series.
Quoted 4 lines
Quoted 4 lines
@Ceasar: you should include people being part of important previous conversations in new versions of patchsets - especially when they have voiced concerns.
Thanks Heiko.
OK, Sorry.
I missed some important people, I will add them in next patch.
Quoted 46 lines
Quoted 4 lines
I've added Tomasz whom I remember having previous experience on the Exynos Powerdomains, so maybe he can add some other perspective - new ideas.
Thanks Heiko for adding me to this thread.
Quoted 18 lines
@Tomasz: this is the part of Kevin's concerns from v10 of the powerdomain series:
Am Donnerstag, 13. November 2014, 12:24:47 schrieben Kevin Hilman:
Quoted 14 lines
Quoted 10 lines · Heiko Stübner
Am Dienstag, 11. November 2014, 08:53:13 schrieb Kevin Hilman:
Quoted 5 lines
I still don't like having lists of clocks in the power-domain DT.
DT is supposed to describe the hardware, and clocks are properties of devices, not power-domains, so the DT description should follow from that.
on the policy side one could argue that if the clock needs to be enabled to
achieve sucessful domain state-changes, that it is also a property of the domain itself in addition to the device.You could, but from a hardware perspective, the clock is a property of the device.
Well, the system controller which control the power domains is also a device. In DT we do not represent the domains alone, but rather the system controller, which acts as a power domain provider. If it need certain clocks to do its work, then I believe it should have them listed in its node. However the dependencies between clocks and power domains are not clear to me either, so I don't have any strong opinion on whether this would be the best solution.
Quoted 8 lines
Quoted 8 lines
Quoted 3 lines
And on the pratical side we don't have drivers nor bindings for a big part of the domain users - and this will probably be true for quite some time. This of course makes it very impractical (or impossible) to
This doesn't sound impossible at all.
You have to collect the clocks anyways. The only debate is whether to list them in the device node or the power-domain node.
Quoted 6 lines
Quoted 6 lines
Even for devices without drivers, you just need a minimal node in the DT if which lists the clocks and has a phandle to the parent power domain.
Sounds rather simple to me, and since the DT is supposed to describe the hardware, doing it this way makes looking at the DT actually help understand the hardware.
Quoted 7 lines
If the dependency between clocks and power domain is kind of "all clocks of all devices in this domain should be enabled when performing operation on the domain" then IMHO it should be more reasonable to put the clocks only in nodes of respective devices and then follow the links from the domain to devices inside of it and retrieve the clocks from there, so that they don't have to be duplicated. , we don't like redundancy in DT.
Thanks Tomasz for commnets.
Frankly,I agree your points,we can manager clocks in every devices of PM domains.
I remember jinkun havs submitted the newest v7 patch to fix it.
dts: https://patchwork.kernel.org/patch/5144471/
driver: https://patchwork.kernel.org/patch/5144481/
But,this series patchs will cause some problems.
Says:
we always be needed turn off clocks to save power when
the system enter suspend.So we need to enumerate the clocks are needed
to switch power doamin on and off . I think the patch v7 will be an option
if devices of PM domains has the driver to manager the clocks. Now we only have the gpu and video driver. but clocks for parts like the gpu (mali), hevc, vcodec (video
encoder/decoder), rga (2d stuff), iep, isp. These devices we need add the drives.
Otherwise,suspend/resume will fail. I know someone don't like to do so.
Maybe It is not perfect solution but just a workaround.
YUP,I believe someone can propose a better solution,but so far,I haven't a better way to solve it. :-(
Quoted 5 lines
Best regards,
Tomasz