Not all new socs need to handle idle states on domain state changes,
so add the possibility to make them optional.
Signed-off-by: Elaine Zhang <redacted>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
---
drivers/soc/rockchip/pm_domains.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
Am Donnerstag, 18. Februar 2016, 11:07:13 schrieb Elaine Zhang:
Not all new socs need to handle idle states on domain state changes,
so add the possibility to make them optional.
Signed-off-by: Elaine Zhang <redacted>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
What's up with the Signed-off-bys? I remember creating the draft of this
change, so either my authorship of the patch should be retained or the
Signed-off-by with my name removed :-)
git send-email will keep patch authorship nicely.
I don't really understand why you need this NULL_BIT / OVERFLOW_MASK.
Defining the unset things to -1 should work nicely as well and is already
regularly used elsewhere - so people will already know this scheme. That way
you also don't need to introduce two new constants someone will have to look
up later.
According to a description from TRM, add all the power domains
Signed-off-by: Elaine Zhang <redacted>
---
include/dt-bindings/power/rk3399-power.h | 53 ++++++++++++++++++++++++++++++++
1 file changed, 53 insertions(+)
create mode 100644 include/dt-bindings/power/rk3399-power.h
This patch adds support for making one power domain a sub-domain of
other domain. This is useful for modeling power dependences,
which needs to have more than one power domain enabled to be operational.
Signed-off-by: Elaine Zhang <redacted>
---
drivers/soc/rockchip/pm_domains.c | 54 +++++++++++++++++++++++++++++++++++++++
1 file changed, 54 insertions(+)
Hi Elaine,
Am Donnerstag, 18. Februar 2016, 11:07:15 schrieb Elaine Zhang:
quoted hunk
This patch adds support for making one power domain a sub-domain of
other domain. This is useful for modeling power dependences,
which needs to have more than one power domain enabled to be operational.
Signed-off-by: Elaine Zhang <redacted>
---
drivers/soc/rockchip/pm_domains.c | 54
+++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+)
diff --git a/drivers/soc/rockchip/pm_domains.c
b/drivers/soc/rockchip/pm_domains.c index 350527b..8cdf1b2 100644
In general the code looks like you're going to group the domains
hirarchically, like
power: power-controller {
compatible = "rockchip,rk3399-power-controller";
pd_cci {
reg = <RK3399_PD_CCI>;
clocks = ...;
pd_cci0 {
reg = <RK3399_PD_CCI0>;
clocks = ...;
};
};
};
This isn't documented in the dt-binding and also isn't really improving
reading these declarations. Instead as I said before, I think I'd like more
get inspiration from how Exynos is doing that already (arch/arm/mach-
exynos/pm_domains.c at "Assign the child power domains to their parents")
simply declaring an additional power-domains property like:
power: power-controller {
compatible = "rockchip,rk3399-power-controller";
pd_cci {
reg = <RK3399_PD_CCI>;
clocks = ...;
};
pd_cci0 {
reg = <RK3399_PD_CCI0>;
clocks = ...;
power-domains = <&power RK3399_PD_CCI>;
};
};
From: Kevin Hilman <khilman@baylibre.com> Date: 2016-03-03 00:05:19
On Thu, Feb 18, 2016 at 4:20 PM, Heiko Stuebner [off-list ref] wrote:
In general the code looks like you're going to group the domains
hirarchically, like
power: power-controller {
compatible = "rockchip,rk3399-power-controller";
pd_cci {
reg = <RK3399_PD_CCI>;
clocks = ...;
pd_cci0 {
reg = <RK3399_PD_CCI0>;
clocks = ...;
};
};
};
This isn't documented in the dt-binding and also isn't really improving
reading these declarations. Instead as I said before, I think I'd like more
get inspiration from how Exynos is doing that already
Heiko and I had a chat offline about this, and I mentioned that the
Exynos way is not the preferred way. The nesting that is being done
here (and in v4) is the better way, and is fully supported by the
genpd code.
Kevin
On some Rockchip SoC there exist child-domains only handling their
idle state with the actual power-state handled by a parent-domain.
So allow such types of domains. For them, we can determine their
state (on/of) by checking the inverse idle-state instead.
There exist one special case if both idle as well power handling
were set as not present, but as the domain-data is defined in the
code itself, we can expect the reasonable developer to define them
So allow such types of domains. For them, we can determine their
state (on/of) by checking the inverse idle-state instead.
There exist one special case if both idle as well power handling
were set as not present, but as the domain-data is defined in the
code itself, we can expect the reasonable developer to define them
in a correct, without adding more checks.
Signed-off-by: Elaine Zhang <redacted>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
---
drivers/soc/rockchip/pm_domains.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
@@ -121,6 +121,10 @@ static bool rockchip_pmu_domain_is_on(struct rockchip_pm_domain *pd)structrockchip_pmu*pmu=pd->pmu;unsignedintval;+/* check idle status for idle-only domains */+if(pd->info->status_mask>=OVERFLOW_MASK)+return!rockchip_pmu_domain_is_idle(pd);+regmap_read(pmu->regmap,pmu->info->status_offset,&val);/* 1'b0: power on, 1'b1: power off */
Hi Elaine,
your sending mechanism could use some improvements :-)
I always get patches 1-4 correctly as replies to the cover-letter while
patches 5+6 always come separately (missing in-reply-to?).
I guess using git send-email might help with that.
Also, Kevin Hilman was very involved in reviewing the original Rockchip
power-domain driver, so it might be nice to include him in further versions.
Heiko
Am Donnerstag, 18. Februar 2016, 11:07:12 schrieb Elaine Zhang:
fix some idle handling
support sub-power domain
add rk3399-power.h
modify power domain for RK3399 SoC
modify document for RK3399 Soc
Elaine Zhang (6):
rockchip: power-domain: make idle handling optional
rockchip: power-domain: allow domains only handling idle requests
rockchip: power-domain: add support for sub-power domains
dt/bindings: power: add RK3399 SoCs header for power-domain
rockchip: power-domain: Modify power domain driver for rk3399
dt/bindings: rockchip: modify document of Rockchip power domains
.../bindings/soc/rockchip/power_domain.txt | 21 ++++
drivers/soc/rockchip/pm_domains.c | 131
++++++++++++++++++++- include/dt-bindings/power/rk3399-power.h
| 53 +++++++++ 3 files changed, 200 insertions(+), 5 deletions(-)
create mode 100644 include/dt-bindings/power/rk3399-power.h