* [PATCH v1 0/3] soc: rockchip: power-domain: support RK3328 SoC @ 2016-12-23 3:47 ` Elaine Zhang 0 siblings, 0 replies; 17+ messages in thread From: Elaine Zhang @ 2016-12-23 3:47 UTC (permalink / raw) To: heiko, xf, wxt Cc: robh+dt, mark.rutland, khilman, tomeu.vizoso, devicetree, linux-arm-kernel, huangtao, xxx, cl, linux-rockchip, linux-kernel, Elaine Zhang Elaine Zhang (3): dt/bindings: power: add RK3328 SoCs header for idle-request dt-bindings: add binding for rk3328 power domains soc: rockchip: power-domain: Modify power domain driver for rk3328 .../bindings/soc/rockchip/power_domain.txt | 3 ++ drivers/soc/rockchip/pm_domains.c | 63 +++++++++++++++++++--- include/dt-bindings/power/rk3328-power.h | 18 +++++++ 3 files changed, 78 insertions(+), 6 deletions(-) create mode 100644 include/dt-bindings/power/rk3328-power.h -- 1.9.1 ^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v1 0/3] soc: rockchip: power-domain: support RK3328 SoC @ 2016-12-23 3:47 ` Elaine Zhang 0 siblings, 0 replies; 17+ messages in thread From: Elaine Zhang @ 2016-12-23 3:47 UTC (permalink / raw) To: linux-arm-kernel Elaine Zhang (3): dt/bindings: power: add RK3328 SoCs header for idle-request dt-bindings: add binding for rk3328 power domains soc: rockchip: power-domain: Modify power domain driver for rk3328 .../bindings/soc/rockchip/power_domain.txt | 3 ++ drivers/soc/rockchip/pm_domains.c | 63 +++++++++++++++++++--- include/dt-bindings/power/rk3328-power.h | 18 +++++++ 3 files changed, 78 insertions(+), 6 deletions(-) create mode 100644 include/dt-bindings/power/rk3328-power.h -- 1.9.1 ^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v1 0/3] soc: rockchip: power-domain: support RK3328 SoC @ 2016-12-23 3:47 ` Elaine Zhang 0 siblings, 0 replies; 17+ messages in thread From: Elaine Zhang @ 2016-12-23 3:47 UTC (permalink / raw) To: heiko-4mtYJXux2i+zQB+pC5nmwQ, xf-TNX95d0MmH7DzftRWevZcw, wxt-TNX95d0MmH7DzftRWevZcw Cc: robh+dt-DgEjT+Ai2ygdnm+yROfE0A, mark.rutland-5wv7dgnIgG8, khilman-rdvid1DuHRBWk0Htik3J/w, tomeu.vizoso-ZGY8ohtN/8qB+jHODAdFcQ, devicetree-u79uwXL29TY76Z2rM5mHXA, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, huangtao-TNX95d0MmH7DzftRWevZcw, xxx-TNX95d0MmH7DzftRWevZcw, cl-TNX95d0MmH7DzftRWevZcw, linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, linux-kernel-u79uwXL29TY76Z2rM5mHXA, Elaine Zhang Elaine Zhang (3): dt/bindings: power: add RK3328 SoCs header for idle-request dt-bindings: add binding for rk3328 power domains soc: rockchip: power-domain: Modify power domain driver for rk3328 .../bindings/soc/rockchip/power_domain.txt | 3 ++ drivers/soc/rockchip/pm_domains.c | 63 +++++++++++++++++++--- include/dt-bindings/power/rk3328-power.h | 18 +++++++ 3 files changed, 78 insertions(+), 6 deletions(-) create mode 100644 include/dt-bindings/power/rk3328-power.h -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v1 1/3] dt/bindings: power: add RK3328 SoCs header for idle-request 2016-12-23 3:47 ` Elaine Zhang @ 2016-12-23 3:47 ` Elaine Zhang -1 siblings, 0 replies; 17+ messages in thread From: Elaine Zhang @ 2016-12-23 3:47 UTC (permalink / raw) To: heiko, xf, wxt Cc: robh+dt, mark.rutland, khilman, tomeu.vizoso, devicetree, linux-arm-kernel, huangtao, xxx, cl, linux-rockchip, linux-kernel, Elaine Zhang According to a description from TRM, add all the idle request. Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com> --- include/dt-bindings/power/rk3328-power.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 include/dt-bindings/power/rk3328-power.h diff --git a/include/dt-bindings/power/rk3328-power.h b/include/dt-bindings/power/rk3328-power.h new file mode 100644 index 000000000000..10c3c3715334 --- /dev/null +++ b/include/dt-bindings/power/rk3328-power.h @@ -0,0 +1,18 @@ +#ifndef __DT_BINDINGS_POWER_RK3328_POWER_H__ +#define __DT_BINDINGS_POWER_RK3328_POWER_H__ + +/** + * RK3328 idle id Summary. + */ +#define RK3328_PD_CORE 0 +#define RK3328_PD_GPU 1 +#define RK3328_PD_BUS 2 +#define RK3328_PD_MSCH 3 +#define RK3328_PD_PERI 4 +#define RK3328_PD_VIDEO 5 +#define RK3328_PD_HEVC 6 +#define RK3328_PD_SYS 7 +#define RK3328_PD_VPU 8 +#define RK3328_PD_VIO 9 + +#endif -- 1.9.1 ^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH v1 1/3] dt/bindings: power: add RK3328 SoCs header for idle-request @ 2016-12-23 3:47 ` Elaine Zhang 0 siblings, 0 replies; 17+ messages in thread From: Elaine Zhang @ 2016-12-23 3:47 UTC (permalink / raw) To: linux-arm-kernel According to a description from TRM, add all the idle request. Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com> --- include/dt-bindings/power/rk3328-power.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 include/dt-bindings/power/rk3328-power.h diff --git a/include/dt-bindings/power/rk3328-power.h b/include/dt-bindings/power/rk3328-power.h new file mode 100644 index 000000000000..10c3c3715334 --- /dev/null +++ b/include/dt-bindings/power/rk3328-power.h @@ -0,0 +1,18 @@ +#ifndef __DT_BINDINGS_POWER_RK3328_POWER_H__ +#define __DT_BINDINGS_POWER_RK3328_POWER_H__ + +/** + * RK3328 idle id Summary. + */ +#define RK3328_PD_CORE 0 +#define RK3328_PD_GPU 1 +#define RK3328_PD_BUS 2 +#define RK3328_PD_MSCH 3 +#define RK3328_PD_PERI 4 +#define RK3328_PD_VIDEO 5 +#define RK3328_PD_HEVC 6 +#define RK3328_PD_SYS 7 +#define RK3328_PD_VPU 8 +#define RK3328_PD_VIO 9 + +#endif -- 1.9.1 ^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH v1 2/3] dt-bindings: add binding for rk3328 power domains @ 2016-12-23 3:47 ` Elaine Zhang 0 siblings, 0 replies; 17+ messages in thread From: Elaine Zhang @ 2016-12-23 3:47 UTC (permalink / raw) To: heiko, xf, wxt Cc: robh+dt, mark.rutland, khilman, tomeu.vizoso, devicetree, linux-arm-kernel, huangtao, xxx, cl, linux-rockchip, linux-kernel, Elaine Zhang Add binding documentation for the power domains found on Rockchip RK3328 SoCs. But RK3328 SoC just support idle, not support pd. Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com> --- Documentation/devicetree/bindings/soc/rockchip/power_domain.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Documentation/devicetree/bindings/soc/rockchip/power_domain.txt b/Documentation/devicetree/bindings/soc/rockchip/power_domain.txt index f909ce06afc4..01bfb6745fbd 100644 --- a/Documentation/devicetree/bindings/soc/rockchip/power_domain.txt +++ b/Documentation/devicetree/bindings/soc/rockchip/power_domain.txt @@ -6,6 +6,7 @@ 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 SoCs. + "rockchip,rk3328-power-controller" - for RK3328 SoCs. "rockchip,rk3368-power-controller" - for RK3368 SoCs. "rockchip,rk3399-power-controller" - for RK3399 SoCs. - #power-domain-cells: Number of cells in a power-domain specifier. @@ -16,6 +17,7 @@ Required properties for power domain controller: Required properties for power domain sub nodes: - reg: index of the power domain, should use macros in: "include/dt-bindings/power/rk3288-power.h" - for RK3288 type power domain. + "include/dt-bindings/power/rk3328-power.h" - for RK3328 type power domain. "include/dt-bindings/power/rk3368-power.h" - for RK3368 type power domain. "include/dt-bindings/power/rk3399-power.h" - for RK3399 type power domain. - clocks (optional): phandles to clocks which need to be enabled while power domain @@ -90,6 +92,7 @@ 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/rk3288-power.h" - for rk3288 type power domain. + "include/dt-bindings/power/rk3328-power.h" - for rk3328 type power domain. "include/dt-bindings/power/rk3368-power.h" - for rk3368 type power domain. "include/dt-bindings/power/rk3399-power.h" - for rk3399 type power domain. -- 1.9.1 ^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH v1 2/3] dt-bindings: add binding for rk3328 power domains @ 2016-12-23 3:47 ` Elaine Zhang 0 siblings, 0 replies; 17+ messages in thread From: Elaine Zhang @ 2016-12-23 3:47 UTC (permalink / raw) To: linux-arm-kernel Add binding documentation for the power domains found on Rockchip RK3328 SoCs. But RK3328 SoC just support idle, not support pd. Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com> --- Documentation/devicetree/bindings/soc/rockchip/power_domain.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Documentation/devicetree/bindings/soc/rockchip/power_domain.txt b/Documentation/devicetree/bindings/soc/rockchip/power_domain.txt index f909ce06afc4..01bfb6745fbd 100644 --- a/Documentation/devicetree/bindings/soc/rockchip/power_domain.txt +++ b/Documentation/devicetree/bindings/soc/rockchip/power_domain.txt @@ -6,6 +6,7 @@ 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 SoCs. + "rockchip,rk3328-power-controller" - for RK3328 SoCs. "rockchip,rk3368-power-controller" - for RK3368 SoCs. "rockchip,rk3399-power-controller" - for RK3399 SoCs. - #power-domain-cells: Number of cells in a power-domain specifier. @@ -16,6 +17,7 @@ Required properties for power domain controller: Required properties for power domain sub nodes: - reg: index of the power domain, should use macros in: "include/dt-bindings/power/rk3288-power.h" - for RK3288 type power domain. + "include/dt-bindings/power/rk3328-power.h" - for RK3328 type power domain. "include/dt-bindings/power/rk3368-power.h" - for RK3368 type power domain. "include/dt-bindings/power/rk3399-power.h" - for RK3399 type power domain. - clocks (optional): phandles to clocks which need to be enabled while power domain @@ -90,6 +92,7 @@ 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/rk3288-power.h" - for rk3288 type power domain. + "include/dt-bindings/power/rk3328-power.h" - for rk3328 type power domain. "include/dt-bindings/power/rk3368-power.h" - for rk3368 type power domain. "include/dt-bindings/power/rk3399-power.h" - for rk3399 type power domain. -- 1.9.1 ^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH v1 2/3] dt-bindings: add binding for rk3328 power domains @ 2016-12-23 3:47 ` Elaine Zhang 0 siblings, 0 replies; 17+ messages in thread From: Elaine Zhang @ 2016-12-23 3:47 UTC (permalink / raw) To: heiko-4mtYJXux2i+zQB+pC5nmwQ, xf-TNX95d0MmH7DzftRWevZcw, wxt-TNX95d0MmH7DzftRWevZcw Cc: robh+dt-DgEjT+Ai2ygdnm+yROfE0A, mark.rutland-5wv7dgnIgG8, khilman-rdvid1DuHRBWk0Htik3J/w, tomeu.vizoso-ZGY8ohtN/8qB+jHODAdFcQ, devicetree-u79uwXL29TY76Z2rM5mHXA, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, huangtao-TNX95d0MmH7DzftRWevZcw, xxx-TNX95d0MmH7DzftRWevZcw, cl-TNX95d0MmH7DzftRWevZcw, linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, linux-kernel-u79uwXL29TY76Z2rM5mHXA, Elaine Zhang Add binding documentation for the power domains found on Rockchip RK3328 SoCs. But RK3328 SoC just support idle, not support pd. Signed-off-by: Elaine Zhang <zhangqing-TNX95d0MmH7DzftRWevZcw@public.gmane.org> --- Documentation/devicetree/bindings/soc/rockchip/power_domain.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Documentation/devicetree/bindings/soc/rockchip/power_domain.txt b/Documentation/devicetree/bindings/soc/rockchip/power_domain.txt index f909ce06afc4..01bfb6745fbd 100644 --- a/Documentation/devicetree/bindings/soc/rockchip/power_domain.txt +++ b/Documentation/devicetree/bindings/soc/rockchip/power_domain.txt @@ -6,6 +6,7 @@ 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 SoCs. + "rockchip,rk3328-power-controller" - for RK3328 SoCs. "rockchip,rk3368-power-controller" - for RK3368 SoCs. "rockchip,rk3399-power-controller" - for RK3399 SoCs. - #power-domain-cells: Number of cells in a power-domain specifier. @@ -16,6 +17,7 @@ Required properties for power domain controller: Required properties for power domain sub nodes: - reg: index of the power domain, should use macros in: "include/dt-bindings/power/rk3288-power.h" - for RK3288 type power domain. + "include/dt-bindings/power/rk3328-power.h" - for RK3328 type power domain. "include/dt-bindings/power/rk3368-power.h" - for RK3368 type power domain. "include/dt-bindings/power/rk3399-power.h" - for RK3399 type power domain. - clocks (optional): phandles to clocks which need to be enabled while power domain @@ -90,6 +92,7 @@ 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/rk3288-power.h" - for rk3288 type power domain. + "include/dt-bindings/power/rk3328-power.h" - for rk3328 type power domain. "include/dt-bindings/power/rk3368-power.h" - for rk3368 type power domain. "include/dt-bindings/power/rk3399-power.h" - for rk3399 type power domain. -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply related [flat|nested] 17+ messages in thread
* Re: [PATCH v1 2/3] dt-bindings: add binding for rk3328 power domains 2016-12-23 3:47 ` Elaine Zhang (?) @ 2017-01-03 15:24 ` Rob Herring -1 siblings, 0 replies; 17+ messages in thread From: Rob Herring @ 2017-01-03 15:24 UTC (permalink / raw) To: Elaine Zhang Cc: heiko, xf, wxt, mark.rutland, khilman, tomeu.vizoso, devicetree, linux-arm-kernel, huangtao, xxx, cl, linux-rockchip, linux-kernel On Fri, Dec 23, 2016 at 11:47:51AM +0800, Elaine Zhang wrote: > Add binding documentation for the power domains > found on Rockchip RK3328 SoCs. > But RK3328 SoC just support idle, not support pd. > > Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com> > --- > Documentation/devicetree/bindings/soc/rockchip/power_domain.txt | 3 +++ > 1 file changed, 3 insertions(+) Acked-by: Rob Herring <robh@kernel.org> ^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v1 2/3] dt-bindings: add binding for rk3328 power domains @ 2017-01-03 15:24 ` Rob Herring 0 siblings, 0 replies; 17+ messages in thread From: Rob Herring @ 2017-01-03 15:24 UTC (permalink / raw) To: linux-arm-kernel On Fri, Dec 23, 2016 at 11:47:51AM +0800, Elaine Zhang wrote: > Add binding documentation for the power domains > found on Rockchip RK3328 SoCs. > But RK3328 SoC just support idle, not support pd. > > Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com> > --- > Documentation/devicetree/bindings/soc/rockchip/power_domain.txt | 3 +++ > 1 file changed, 3 insertions(+) Acked-by: Rob Herring <robh@kernel.org> ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v1 2/3] dt-bindings: add binding for rk3328 power domains @ 2017-01-03 15:24 ` Rob Herring 0 siblings, 0 replies; 17+ messages in thread From: Rob Herring @ 2017-01-03 15:24 UTC (permalink / raw) To: Elaine Zhang Cc: mark.rutland, devicetree, huangtao, heiko, tomeu.vizoso, xf, khilman, xxx, linux-kernel, linux-rockchip, cl, linux-arm-kernel, wxt On Fri, Dec 23, 2016 at 11:47:51AM +0800, Elaine Zhang wrote: > Add binding documentation for the power domains > found on Rockchip RK3328 SoCs. > But RK3328 SoC just support idle, not support pd. > > Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com> > --- > Documentation/devicetree/bindings/soc/rockchip/power_domain.txt | 3 +++ > 1 file changed, 3 insertions(+) Acked-by: Rob Herring <robh@kernel.org> ^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v1 3/3] soc: rockchip: power-domain: Modify power domain driver for rk3328 @ 2016-12-23 3:47 ` Elaine Zhang 0 siblings, 0 replies; 17+ messages in thread From: Elaine Zhang @ 2016-12-23 3:47 UTC (permalink / raw) To: heiko, xf, wxt Cc: robh+dt, mark.rutland, khilman, tomeu.vizoso, devicetree, linux-arm-kernel, huangtao, xxx, cl, linux-rockchip, linux-kernel, Elaine Zhang This driver is modified to support RK3328 SoC. RK3328 SoC is only support idle. add DOMAIN_M type, for support regs have write_enable bit. Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com> --- drivers/soc/rockchip/pm_domains.c | 63 +++++++++++++++++++++++++++++++++++---- 1 file changed, 57 insertions(+), 6 deletions(-) diff --git a/drivers/soc/rockchip/pm_domains.c b/drivers/soc/rockchip/pm_domains.c index 1c78c42416c6..796c46a6cbe7 100644 --- a/drivers/soc/rockchip/pm_domains.c +++ b/drivers/soc/rockchip/pm_domains.c @@ -19,6 +19,7 @@ #include <linux/regmap.h> #include <linux/mfd/syscon.h> #include <dt-bindings/power/rk3288-power.h> +#include <dt-bindings/power/rk3328-power.h> #include <dt-bindings/power/rk3368-power.h> #include <dt-bindings/power/rk3399-power.h> @@ -29,6 +30,8 @@ struct rockchip_domain_info { int idle_mask; int ack_mask; bool active_wakeup; + int pwr_w_mask; + int req_w_mask; }; struct rockchip_pmu_info { @@ -87,9 +90,24 @@ struct rockchip_pmu { .active_wakeup = wakeup, \ } +#define DOMAIN_M(pwr, status, req, idle, ack, wakeup) \ +{ \ + .pwr_w_mask = (pwr >= 0) ? BIT(pwr + 16) : 0, \ + .pwr_mask = (pwr >= 0) ? BIT(pwr) : 0, \ + .status_mask = (status >= 0) ? BIT(status) : 0, \ + .req_w_mask = (req >= 0) ? BIT(req + 16) : 0, \ + .req_mask = (req >= 0) ? BIT(req) : 0, \ + .idle_mask = (idle >= 0) ? BIT(idle) : 0, \ + .ack_mask = (ack >= 0) ? BIT(ack) : 0, \ + .active_wakeup = wakeup, \ +} + #define DOMAIN_RK3288(pwr, status, req, wakeup) \ DOMAIN(pwr, status, req, req, (req) + 16, wakeup) +#define DOMAIN_RK3328(pwr, status, req, wakeup) \ + DOMAIN_M(pwr, pwr, req, (req) + 10, req, wakeup) + #define DOMAIN_RK3368(pwr, status, req, wakeup) \ DOMAIN(pwr, status, req, (req) + 16, req, wakeup) @@ -127,9 +145,13 @@ static int rockchip_pmu_set_idle_request(struct rockchip_pm_domain *pd, if (pd_info->req_mask == 0) return 0; - - regmap_update_bits(pmu->regmap, pmu->info->req_offset, - pd_info->req_mask, idle ? -1U : 0); + else if (pd_info->req_w_mask) + regmap_write(pmu->regmap, pmu->info->req_offset, + idle ? (pd_info->req_mask | pd_info->req_w_mask) : + pd_info->req_w_mask); + else + regmap_update_bits(pmu->regmap, pmu->info->req_offset, + pd_info->req_mask, idle ? -1U : 0); dsb(sy); @@ -230,9 +252,13 @@ static void rockchip_do_pmu_set_power_domain(struct rockchip_pm_domain *pd, if (pd->info->pwr_mask == 0) return; - - regmap_update_bits(pmu->regmap, pmu->info->pwr_offset, - pd->info->pwr_mask, on ? 0 : -1U); + else if (pd->info->pwr_w_mask) + regmap_write(pmu->regmap, pmu->info->pwr_offset, + on ? pd->info->pwr_mask : + (pd->info->pwr_mask | pd->info->pwr_w_mask)); + else + regmap_update_bits(pmu->regmap, pmu->info->pwr_offset, + pd->info->pwr_mask, on ? 0 : -1U); dsb(sy); @@ -692,6 +718,18 @@ static int rockchip_pm_domain_probe(struct platform_device *pdev) [RK3288_PD_GPU] = DOMAIN_RK3288(9, 9, 2, false), }; +static const struct rockchip_domain_info rk3328_pm_domains[] = { + [RK3328_PD_CORE] = DOMAIN_RK3328(-1, 0, 0, false), + [RK3328_PD_GPU] = DOMAIN_RK3328(-1, 1, 1, false), + [RK3328_PD_BUS] = DOMAIN_RK3328(-1, 2, 2, true), + [RK3328_PD_MSCH] = DOMAIN_RK3328(-1, 3, 3, true), + [RK3328_PD_PERI] = DOMAIN_RK3328(-1, 4, 4, true), + [RK3328_PD_VIDEO] = DOMAIN_RK3328(-1, 5, 5, false), + [RK3328_PD_HEVC] = DOMAIN_RK3328(-1, 6, 6, false), + [RK3328_PD_VIO] = DOMAIN_RK3328(-1, 8, 8, false), + [RK3328_PD_VPU] = DOMAIN_RK3328(-1, 9, 9, false), +}; + static const struct rockchip_domain_info rk3368_pm_domains[] = { [RK3368_PD_PERI] = DOMAIN_RK3368(13, 12, 6, true), [RK3368_PD_VIO] = DOMAIN_RK3368(15, 14, 8, false), @@ -747,6 +785,15 @@ static int rockchip_pm_domain_probe(struct platform_device *pdev) .domain_info = rk3288_pm_domains, }; +static const struct rockchip_pmu_info rk3328_pmu = { + .req_offset = 0x414, + .idle_offset = 0x484, + .ack_offset = 0x484, + + .num_domains = ARRAY_SIZE(rk3328_pm_domains), + .domain_info = rk3328_pm_domains, +}; + static const struct rockchip_pmu_info rk3368_pmu = { .pwr_offset = 0x0c, .status_offset = 0x10, @@ -783,6 +830,10 @@ static int rockchip_pm_domain_probe(struct platform_device *pdev) .data = (void *)&rk3288_pmu, }, { + .compatible = "rockchip,rk3328-power-controller", + .data = (void *)&rk3328_pmu, + }, + { .compatible = "rockchip,rk3368-power-controller", .data = (void *)&rk3368_pmu, }, -- 1.9.1 ^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH v1 3/3] soc: rockchip: power-domain: Modify power domain driver for rk3328 @ 2016-12-23 3:47 ` Elaine Zhang 0 siblings, 0 replies; 17+ messages in thread From: Elaine Zhang @ 2016-12-23 3:47 UTC (permalink / raw) To: linux-arm-kernel This driver is modified to support RK3328 SoC. RK3328 SoC is only support idle. add DOMAIN_M type, for support regs have write_enable bit. Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com> --- drivers/soc/rockchip/pm_domains.c | 63 +++++++++++++++++++++++++++++++++++---- 1 file changed, 57 insertions(+), 6 deletions(-) diff --git a/drivers/soc/rockchip/pm_domains.c b/drivers/soc/rockchip/pm_domains.c index 1c78c42416c6..796c46a6cbe7 100644 --- a/drivers/soc/rockchip/pm_domains.c +++ b/drivers/soc/rockchip/pm_domains.c @@ -19,6 +19,7 @@ #include <linux/regmap.h> #include <linux/mfd/syscon.h> #include <dt-bindings/power/rk3288-power.h> +#include <dt-bindings/power/rk3328-power.h> #include <dt-bindings/power/rk3368-power.h> #include <dt-bindings/power/rk3399-power.h> @@ -29,6 +30,8 @@ struct rockchip_domain_info { int idle_mask; int ack_mask; bool active_wakeup; + int pwr_w_mask; + int req_w_mask; }; struct rockchip_pmu_info { @@ -87,9 +90,24 @@ struct rockchip_pmu { .active_wakeup = wakeup, \ } +#define DOMAIN_M(pwr, status, req, idle, ack, wakeup) \ +{ \ + .pwr_w_mask = (pwr >= 0) ? BIT(pwr + 16) : 0, \ + .pwr_mask = (pwr >= 0) ? BIT(pwr) : 0, \ + .status_mask = (status >= 0) ? BIT(status) : 0, \ + .req_w_mask = (req >= 0) ? BIT(req + 16) : 0, \ + .req_mask = (req >= 0) ? BIT(req) : 0, \ + .idle_mask = (idle >= 0) ? BIT(idle) : 0, \ + .ack_mask = (ack >= 0) ? BIT(ack) : 0, \ + .active_wakeup = wakeup, \ +} + #define DOMAIN_RK3288(pwr, status, req, wakeup) \ DOMAIN(pwr, status, req, req, (req) + 16, wakeup) +#define DOMAIN_RK3328(pwr, status, req, wakeup) \ + DOMAIN_M(pwr, pwr, req, (req) + 10, req, wakeup) + #define DOMAIN_RK3368(pwr, status, req, wakeup) \ DOMAIN(pwr, status, req, (req) + 16, req, wakeup) @@ -127,9 +145,13 @@ static int rockchip_pmu_set_idle_request(struct rockchip_pm_domain *pd, if (pd_info->req_mask == 0) return 0; - - regmap_update_bits(pmu->regmap, pmu->info->req_offset, - pd_info->req_mask, idle ? -1U : 0); + else if (pd_info->req_w_mask) + regmap_write(pmu->regmap, pmu->info->req_offset, + idle ? (pd_info->req_mask | pd_info->req_w_mask) : + pd_info->req_w_mask); + else + regmap_update_bits(pmu->regmap, pmu->info->req_offset, + pd_info->req_mask, idle ? -1U : 0); dsb(sy); @@ -230,9 +252,13 @@ static void rockchip_do_pmu_set_power_domain(struct rockchip_pm_domain *pd, if (pd->info->pwr_mask == 0) return; - - regmap_update_bits(pmu->regmap, pmu->info->pwr_offset, - pd->info->pwr_mask, on ? 0 : -1U); + else if (pd->info->pwr_w_mask) + regmap_write(pmu->regmap, pmu->info->pwr_offset, + on ? pd->info->pwr_mask : + (pd->info->pwr_mask | pd->info->pwr_w_mask)); + else + regmap_update_bits(pmu->regmap, pmu->info->pwr_offset, + pd->info->pwr_mask, on ? 0 : -1U); dsb(sy); @@ -692,6 +718,18 @@ static int rockchip_pm_domain_probe(struct platform_device *pdev) [RK3288_PD_GPU] = DOMAIN_RK3288(9, 9, 2, false), }; +static const struct rockchip_domain_info rk3328_pm_domains[] = { + [RK3328_PD_CORE] = DOMAIN_RK3328(-1, 0, 0, false), + [RK3328_PD_GPU] = DOMAIN_RK3328(-1, 1, 1, false), + [RK3328_PD_BUS] = DOMAIN_RK3328(-1, 2, 2, true), + [RK3328_PD_MSCH] = DOMAIN_RK3328(-1, 3, 3, true), + [RK3328_PD_PERI] = DOMAIN_RK3328(-1, 4, 4, true), + [RK3328_PD_VIDEO] = DOMAIN_RK3328(-1, 5, 5, false), + [RK3328_PD_HEVC] = DOMAIN_RK3328(-1, 6, 6, false), + [RK3328_PD_VIO] = DOMAIN_RK3328(-1, 8, 8, false), + [RK3328_PD_VPU] = DOMAIN_RK3328(-1, 9, 9, false), +}; + static const struct rockchip_domain_info rk3368_pm_domains[] = { [RK3368_PD_PERI] = DOMAIN_RK3368(13, 12, 6, true), [RK3368_PD_VIO] = DOMAIN_RK3368(15, 14, 8, false), @@ -747,6 +785,15 @@ static int rockchip_pm_domain_probe(struct platform_device *pdev) .domain_info = rk3288_pm_domains, }; +static const struct rockchip_pmu_info rk3328_pmu = { + .req_offset = 0x414, + .idle_offset = 0x484, + .ack_offset = 0x484, + + .num_domains = ARRAY_SIZE(rk3328_pm_domains), + .domain_info = rk3328_pm_domains, +}; + static const struct rockchip_pmu_info rk3368_pmu = { .pwr_offset = 0x0c, .status_offset = 0x10, @@ -783,6 +830,10 @@ static int rockchip_pm_domain_probe(struct platform_device *pdev) .data = (void *)&rk3288_pmu, }, { + .compatible = "rockchip,rk3328-power-controller", + .data = (void *)&rk3328_pmu, + }, + { .compatible = "rockchip,rk3368-power-controller", .data = (void *)&rk3368_pmu, }, -- 1.9.1 ^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH v1 3/3] soc: rockchip: power-domain: Modify power domain driver for rk3328 @ 2016-12-23 3:47 ` Elaine Zhang 0 siblings, 0 replies; 17+ messages in thread From: Elaine Zhang @ 2016-12-23 3:47 UTC (permalink / raw) To: heiko-4mtYJXux2i+zQB+pC5nmwQ, xf-TNX95d0MmH7DzftRWevZcw, wxt-TNX95d0MmH7DzftRWevZcw Cc: robh+dt-DgEjT+Ai2ygdnm+yROfE0A, mark.rutland-5wv7dgnIgG8, khilman-rdvid1DuHRBWk0Htik3J/w, tomeu.vizoso-ZGY8ohtN/8qB+jHODAdFcQ, devicetree-u79uwXL29TY76Z2rM5mHXA, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, huangtao-TNX95d0MmH7DzftRWevZcw, xxx-TNX95d0MmH7DzftRWevZcw, cl-TNX95d0MmH7DzftRWevZcw, linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, linux-kernel-u79uwXL29TY76Z2rM5mHXA, Elaine Zhang This driver is modified to support RK3328 SoC. RK3328 SoC is only support idle. add DOMAIN_M type, for support regs have write_enable bit. Signed-off-by: Elaine Zhang <zhangqing-TNX95d0MmH7DzftRWevZcw@public.gmane.org> --- drivers/soc/rockchip/pm_domains.c | 63 +++++++++++++++++++++++++++++++++++---- 1 file changed, 57 insertions(+), 6 deletions(-) diff --git a/drivers/soc/rockchip/pm_domains.c b/drivers/soc/rockchip/pm_domains.c index 1c78c42416c6..796c46a6cbe7 100644 --- a/drivers/soc/rockchip/pm_domains.c +++ b/drivers/soc/rockchip/pm_domains.c @@ -19,6 +19,7 @@ #include <linux/regmap.h> #include <linux/mfd/syscon.h> #include <dt-bindings/power/rk3288-power.h> +#include <dt-bindings/power/rk3328-power.h> #include <dt-bindings/power/rk3368-power.h> #include <dt-bindings/power/rk3399-power.h> @@ -29,6 +30,8 @@ struct rockchip_domain_info { int idle_mask; int ack_mask; bool active_wakeup; + int pwr_w_mask; + int req_w_mask; }; struct rockchip_pmu_info { @@ -87,9 +90,24 @@ struct rockchip_pmu { .active_wakeup = wakeup, \ } +#define DOMAIN_M(pwr, status, req, idle, ack, wakeup) \ +{ \ + .pwr_w_mask = (pwr >= 0) ? BIT(pwr + 16) : 0, \ + .pwr_mask = (pwr >= 0) ? BIT(pwr) : 0, \ + .status_mask = (status >= 0) ? BIT(status) : 0, \ + .req_w_mask = (req >= 0) ? BIT(req + 16) : 0, \ + .req_mask = (req >= 0) ? BIT(req) : 0, \ + .idle_mask = (idle >= 0) ? BIT(idle) : 0, \ + .ack_mask = (ack >= 0) ? BIT(ack) : 0, \ + .active_wakeup = wakeup, \ +} + #define DOMAIN_RK3288(pwr, status, req, wakeup) \ DOMAIN(pwr, status, req, req, (req) + 16, wakeup) +#define DOMAIN_RK3328(pwr, status, req, wakeup) \ + DOMAIN_M(pwr, pwr, req, (req) + 10, req, wakeup) + #define DOMAIN_RK3368(pwr, status, req, wakeup) \ DOMAIN(pwr, status, req, (req) + 16, req, wakeup) @@ -127,9 +145,13 @@ static int rockchip_pmu_set_idle_request(struct rockchip_pm_domain *pd, if (pd_info->req_mask == 0) return 0; - - regmap_update_bits(pmu->regmap, pmu->info->req_offset, - pd_info->req_mask, idle ? -1U : 0); + else if (pd_info->req_w_mask) + regmap_write(pmu->regmap, pmu->info->req_offset, + idle ? (pd_info->req_mask | pd_info->req_w_mask) : + pd_info->req_w_mask); + else + regmap_update_bits(pmu->regmap, pmu->info->req_offset, + pd_info->req_mask, idle ? -1U : 0); dsb(sy); @@ -230,9 +252,13 @@ static void rockchip_do_pmu_set_power_domain(struct rockchip_pm_domain *pd, if (pd->info->pwr_mask == 0) return; - - regmap_update_bits(pmu->regmap, pmu->info->pwr_offset, - pd->info->pwr_mask, on ? 0 : -1U); + else if (pd->info->pwr_w_mask) + regmap_write(pmu->regmap, pmu->info->pwr_offset, + on ? pd->info->pwr_mask : + (pd->info->pwr_mask | pd->info->pwr_w_mask)); + else + regmap_update_bits(pmu->regmap, pmu->info->pwr_offset, + pd->info->pwr_mask, on ? 0 : -1U); dsb(sy); @@ -692,6 +718,18 @@ static int rockchip_pm_domain_probe(struct platform_device *pdev) [RK3288_PD_GPU] = DOMAIN_RK3288(9, 9, 2, false), }; +static const struct rockchip_domain_info rk3328_pm_domains[] = { + [RK3328_PD_CORE] = DOMAIN_RK3328(-1, 0, 0, false), + [RK3328_PD_GPU] = DOMAIN_RK3328(-1, 1, 1, false), + [RK3328_PD_BUS] = DOMAIN_RK3328(-1, 2, 2, true), + [RK3328_PD_MSCH] = DOMAIN_RK3328(-1, 3, 3, true), + [RK3328_PD_PERI] = DOMAIN_RK3328(-1, 4, 4, true), + [RK3328_PD_VIDEO] = DOMAIN_RK3328(-1, 5, 5, false), + [RK3328_PD_HEVC] = DOMAIN_RK3328(-1, 6, 6, false), + [RK3328_PD_VIO] = DOMAIN_RK3328(-1, 8, 8, false), + [RK3328_PD_VPU] = DOMAIN_RK3328(-1, 9, 9, false), +}; + static const struct rockchip_domain_info rk3368_pm_domains[] = { [RK3368_PD_PERI] = DOMAIN_RK3368(13, 12, 6, true), [RK3368_PD_VIO] = DOMAIN_RK3368(15, 14, 8, false), @@ -747,6 +785,15 @@ static int rockchip_pm_domain_probe(struct platform_device *pdev) .domain_info = rk3288_pm_domains, }; +static const struct rockchip_pmu_info rk3328_pmu = { + .req_offset = 0x414, + .idle_offset = 0x484, + .ack_offset = 0x484, + + .num_domains = ARRAY_SIZE(rk3328_pm_domains), + .domain_info = rk3328_pm_domains, +}; + static const struct rockchip_pmu_info rk3368_pmu = { .pwr_offset = 0x0c, .status_offset = 0x10, @@ -783,6 +830,10 @@ static int rockchip_pm_domain_probe(struct platform_device *pdev) .data = (void *)&rk3288_pmu, }, { + .compatible = "rockchip,rk3328-power-controller", + .data = (void *)&rk3328_pmu, + }, + { .compatible = "rockchip,rk3368-power-controller", .data = (void *)&rk3368_pmu, }, -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply related [flat|nested] 17+ messages in thread
* Re: [PATCH v1 0/3] soc: rockchip: power-domain: support RK3328 SoC @ 2017-01-05 14:07 ` Heiko Stuebner 0 siblings, 0 replies; 17+ messages in thread From: Heiko Stuebner @ 2017-01-05 14:07 UTC (permalink / raw) To: Elaine Zhang Cc: xf, wxt, robh+dt, mark.rutland, khilman, tomeu.vizoso, devicetree, linux-arm-kernel, huangtao, xxx, cl, linux-rockchip, linux-kernel Am Freitag, 23. Dezember 2016, 11:47:49 CET schrieb Elaine Zhang: > Elaine Zhang (3): > dt/bindings: power: add RK3328 SoCs header for idle-request > dt-bindings: add binding for rk3328 power domains > soc: rockchip: power-domain: Modify power domain driver for rk3328 > > .../bindings/soc/rockchip/power_domain.txt | 3 ++ > drivers/soc/rockchip/pm_domains.c | 63 > +++++++++++++++++++--- include/dt-bindings/power/rk3328-power.h | > 18 +++++++ > 3 files changed, 78 insertions(+), 6 deletions(-) > create mode 100644 include/dt-bindings/power/rk3328-power.h I've split patch 3 into two parts (hiword support and rk3328 addition) and applied all for 4.11 Thanks Heiko ^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v1 0/3] soc: rockchip: power-domain: support RK3328 SoC @ 2017-01-05 14:07 ` Heiko Stuebner 0 siblings, 0 replies; 17+ messages in thread From: Heiko Stuebner @ 2017-01-05 14:07 UTC (permalink / raw) To: linux-arm-kernel Am Freitag, 23. Dezember 2016, 11:47:49 CET schrieb Elaine Zhang: > Elaine Zhang (3): > dt/bindings: power: add RK3328 SoCs header for idle-request > dt-bindings: add binding for rk3328 power domains > soc: rockchip: power-domain: Modify power domain driver for rk3328 > > .../bindings/soc/rockchip/power_domain.txt | 3 ++ > drivers/soc/rockchip/pm_domains.c | 63 > +++++++++++++++++++--- include/dt-bindings/power/rk3328-power.h | > 18 +++++++ > 3 files changed, 78 insertions(+), 6 deletions(-) > create mode 100644 include/dt-bindings/power/rk3328-power.h I've split patch 3 into two parts (hiword support and rk3328 addition) and applied all for 4.11 Thanks Heiko ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v1 0/3] soc: rockchip: power-domain: support RK3328 SoC @ 2017-01-05 14:07 ` Heiko Stuebner 0 siblings, 0 replies; 17+ messages in thread From: Heiko Stuebner @ 2017-01-05 14:07 UTC (permalink / raw) To: Elaine Zhang Cc: xf-TNX95d0MmH7DzftRWevZcw, wxt-TNX95d0MmH7DzftRWevZcw, robh+dt-DgEjT+Ai2ygdnm+yROfE0A, mark.rutland-5wv7dgnIgG8, khilman-rdvid1DuHRBWk0Htik3J/w, tomeu.vizoso-ZGY8ohtN/8qB+jHODAdFcQ, devicetree-u79uwXL29TY76Z2rM5mHXA, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, huangtao-TNX95d0MmH7DzftRWevZcw, xxx-TNX95d0MmH7DzftRWevZcw, cl-TNX95d0MmH7DzftRWevZcw, linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, linux-kernel-u79uwXL29TY76Z2rM5mHXA Am Freitag, 23. Dezember 2016, 11:47:49 CET schrieb Elaine Zhang: > Elaine Zhang (3): > dt/bindings: power: add RK3328 SoCs header for idle-request > dt-bindings: add binding for rk3328 power domains > soc: rockchip: power-domain: Modify power domain driver for rk3328 > > .../bindings/soc/rockchip/power_domain.txt | 3 ++ > drivers/soc/rockchip/pm_domains.c | 63 > +++++++++++++++++++--- include/dt-bindings/power/rk3328-power.h | > 18 +++++++ > 3 files changed, 78 insertions(+), 6 deletions(-) > create mode 100644 include/dt-bindings/power/rk3328-power.h I've split patch 3 into two parts (hiword support and rk3328 addition) and applied all for 4.11 Thanks Heiko -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 17+ messages in thread
end of thread, other threads:[~2017-01-05 14:07 UTC | newest] Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2016-12-23 3:47 [PATCH v1 0/3] soc: rockchip: power-domain: support RK3328 SoC Elaine Zhang 2016-12-23 3:47 ` Elaine Zhang 2016-12-23 3:47 ` Elaine Zhang 2016-12-23 3:47 ` [PATCH v1 1/3] dt/bindings: power: add RK3328 SoCs header for idle-request Elaine Zhang 2016-12-23 3:47 ` Elaine Zhang 2016-12-23 3:47 ` [PATCH v1 2/3] dt-bindings: add binding for rk3328 power domains Elaine Zhang 2016-12-23 3:47 ` Elaine Zhang 2016-12-23 3:47 ` Elaine Zhang 2017-01-03 15:24 ` Rob Herring 2017-01-03 15:24 ` Rob Herring 2017-01-03 15:24 ` Rob Herring 2016-12-23 3:47 ` [PATCH v1 3/3] soc: rockchip: power-domain: Modify power domain driver for rk3328 Elaine Zhang 2016-12-23 3:47 ` Elaine Zhang 2016-12-23 3:47 ` Elaine Zhang 2017-01-05 14:07 ` [PATCH v1 0/3] soc: rockchip: power-domain: support RK3328 SoC Heiko Stuebner 2017-01-05 14:07 ` Heiko Stuebner 2017-01-05 14:07 ` Heiko Stuebner
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.