linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH v3 3/3] dt-bindings: modify document of Rockchip power domains
  2016-01-11 10:36 ` [PATCH v3 3/3] dt-bindings: modify document of Rockchip power domains zhangqing
@ 2016-01-11  2:55   ` Rob Herring
  0 siblings, 0 replies; 13+ messages in thread
From: Rob Herring @ 2016-01-11  2:55 UTC (permalink / raw)
  To: zhangqing
  Cc: heiko, wxt, pawel.moll, mark.rutland, ijc+devicetree, galak,
	khilman, linux-arm-kernel, devicetree, huangtao, zyw,
	linux-rockchip, linux-kernel

On Mon, Jan 11, 2016 at 02:36:40AM -0800, zhangqing wrote:
> Modify binding documentation for the power domains
> found on Rockchip RK3368 SoCs.
> 
> Signed-off-by: zhangqing <zhangqing@rock-chips.com>
> ---
>  .../bindings/soc/rockchip/power_domain.txt          | 21 +++++++++++++++++++++
>  1 file changed, 21 insertions(+)

Acked-by: Rob Herring <robh@kernel.org>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH v3 0/3] SoC: rockchip: support power domain for RK3368
@ 2016-01-11 10:36 zhangqing
  2016-01-11 10:36 ` [PATCH v3 1/3] dt-bindings: add power-domain header for RK3368 SoCs zhangqing
                   ` (4 more replies)
  0 siblings, 5 replies; 13+ messages in thread
From: zhangqing @ 2016-01-11 10:36 UTC (permalink / raw)
  To: heiko, wxt
  Cc: robh+dt, pawel.moll, mark.rutland, ijc+devicetree, galak,
	khilman, linux-arm-kernel, devicetree, huangtao, zyw,
	linux-rockchip, linux-kernel, zhangqing

add pd id in rk3368-power.h
modify pm_domains.c to support RK3368 SoC
add RK3368 document for Rockchip power domains

zhangqing (3):
  dt-bindings: add power-domain header for RK3368 SoCs
  soc: rockchip: power-domain: Modify power domain driver for rk3368
  dt-bindings: modify document of Rockchip power domains

 .../bindings/soc/rockchip/power_domain.txt         | 21 ++++++++++++++
 drivers/soc/rockchip/pm_domains.c                  | 33 ++++++++++++++++++++++
 include/dt-bindings/power/rk3368-power.h           | 28 ++++++++++++++++++
 3 files changed, 82 insertions(+)
 create mode 100644 include/dt-bindings/power/rk3368-power.h

-- 
1.9.1

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH v3 1/3] dt-bindings: add power-domain header for RK3368 SoCs
  2016-01-11 10:36 [PATCH v3 0/3] SoC: rockchip: support power domain for RK3368 zhangqing
@ 2016-01-11 10:36 ` zhangqing
  2016-01-12  2:03   ` Caesar Wang
  2016-01-11 10:36 ` [PATCH v3 2/3] soc: rockchip: power-domain: Modify power domain driver for rk3368 zhangqing
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 13+ messages in thread
From: zhangqing @ 2016-01-11 10:36 UTC (permalink / raw)
  To: heiko, wxt
  Cc: robh+dt, pawel.moll, mark.rutland, ijc+devicetree, galak,
	khilman, linux-arm-kernel, devicetree, huangtao, zyw,
	linux-rockchip, linux-kernel, zhangqing

According to a description from TRM, add all the power domains.

Signed-off-by: zhangqing <zhangqing@rock-chips.com>
---
 include/dt-bindings/power/rk3368-power.h | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)
 create mode 100644 include/dt-bindings/power/rk3368-power.h

diff --git a/include/dt-bindings/power/rk3368-power.h b/include/dt-bindings/power/rk3368-power.h
new file mode 100644
index 0000000..93633d5
--- /dev/null
+++ b/include/dt-bindings/power/rk3368-power.h
@@ -0,0 +1,28 @@
+#ifndef __DT_BINDINGS_POWER_RK3368_POWER_H__
+#define __DT_BINDINGS_POWER_RK3368_POWER_H__
+
+/* VD_CORE */
+#define RK3368_PD_A53_L0	0
+#define RK3368_PD_A53_L1	1
+#define RK3368_PD_A53_L2	2
+#define RK3368_PD_A53_L3	3
+#define RK3368_PD_SCU_L		4
+#define RK3368_PD_A53_B0	5
+#define RK3368_PD_A53_B1	6
+#define RK3368_PD_A53_B2	7
+#define RK3368_PD_A53_B3	8
+#define RK3368_PD_SCU_B		9
+
+/* VD_LOGIC */
+#define RK3368_PD_BUS		10
+#define RK3368_PD_PERI		11
+#define RK3368_PD_VIO		12
+#define RK3368_PD_ALIVE		13
+#define RK3368_PD_VIDEO		14
+#define RK3368_PD_GPU_0		15
+#define RK3368_PD_GPU_1		16
+
+/* VD_PMU */
+#define RK3368_PD_PMU		17
+
+#endif
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH v3 2/3] soc: rockchip: power-domain: Modify power domain driver for rk3368
  2016-01-11 10:36 [PATCH v3 0/3] SoC: rockchip: support power domain for RK3368 zhangqing
  2016-01-11 10:36 ` [PATCH v3 1/3] dt-bindings: add power-domain header for RK3368 SoCs zhangqing
@ 2016-01-11 10:36 ` zhangqing
  2016-01-11 13:27   ` Caesar Wang
  2016-01-12  2:00   ` Caesar Wang
  2016-01-11 10:36 ` [PATCH v3 3/3] dt-bindings: modify document of Rockchip power domains zhangqing
                   ` (2 subsequent siblings)
  4 siblings, 2 replies; 13+ messages in thread
From: zhangqing @ 2016-01-11 10:36 UTC (permalink / raw)
  To: heiko, wxt
  Cc: robh+dt, pawel.moll, mark.rutland, ijc+devicetree, galak,
	khilman, linux-arm-kernel, devicetree, huangtao, zyw,
	linux-rockchip, linux-kernel, zhangqing

This driver is modified to support RK3368 SoC.

Signed-off-by: zhangqing <zhangqing@rock-chips.com>
---
 drivers/soc/rockchip/pm_domains.c | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/drivers/soc/rockchip/pm_domains.c b/drivers/soc/rockchip/pm_domains.c
index 534c589..6cdffb1 100644
--- a/drivers/soc/rockchip/pm_domains.c
+++ b/drivers/soc/rockchip/pm_domains.c
@@ -18,6 +18,7 @@
 #include <linux/regmap.h>
 #include <linux/mfd/syscon.h>
 #include <dt-bindings/power/rk3288-power.h>
+#include <dt-bindings/power/rk3368-power.h>
 
 struct rockchip_domain_info {
 	int pwr_mask;
@@ -75,6 +76,9 @@ struct rockchip_pmu {
 #define DOMAIN_RK3288(pwr, status, req)		\
 	DOMAIN(pwr, status, req, req, (req) + 16)
 
+#define DOMAIN_RK3368(pwr, status, req)		\
+	DOMAIN(pwr, status, req, (req) + 16, req)
+
 static bool rockchip_pmu_domain_is_idle(struct rockchip_pm_domain *pd)
 {
 	struct rockchip_pmu *pmu = pd->pmu;
@@ -444,6 +448,14 @@ static const struct rockchip_domain_info rk3288_pm_domains[] = {
 	[RK3288_PD_GPU]		= DOMAIN_RK3288(9, 9, 2),
 };
 
+static const struct rockchip_domain_info rk3368_pm_domains[] = {
+	[RK3368_PD_PERI]	= DOMAIN_RK3368(13, 12, 6),
+	[RK3368_PD_VIO]		= DOMAIN_RK3368(15, 14, 8),
+	[RK3368_PD_VIDEO]	= DOMAIN_RK3368(14, 13, 7),
+	[RK3368_PD_GPU_0]	= DOMAIN_RK3368(16, 15, 2),
+	[RK3368_PD_GPU_1]	= DOMAIN_RK3368(17, 16, 2),
+};
+
 static const struct rockchip_pmu_info rk3288_pmu = {
 	.pwr_offset = 0x08,
 	.status_offset = 0x0c,
@@ -461,11 +473,32 @@ static const struct rockchip_pmu_info rk3288_pmu = {
 	.domain_info = rk3288_pm_domains,
 };
 
+static const struct rockchip_pmu_info rk3368_pmu = {
+	.pwr_offset = 0x0c,
+	.status_offset = 0x10,
+	.req_offset = 0x3c,
+	.idle_offset = 0x40,
+	.ack_offset = 0x40,
+
+	.core_pwrcnt_offset = 0x48,
+	.gpu_pwrcnt_offset = 0x50,
+
+	.core_power_transition_time = 24,
+	.gpu_power_transition_time = 24,
+
+	.num_domains = ARRAY_SIZE(rk3368_pm_domains),
+	.domain_info = rk3368_pm_domains,
+};
+
 static const struct of_device_id rockchip_pm_domain_dt_match[] = {
 	{
 		.compatible = "rockchip,rk3288-power-controller",
 		.data = (void *)&rk3288_pmu,
 	},
+	{
+		.compatible = "rockchip,rk3368-power-controller",
+		.data = (void *)&rk3368_pmu,
+	},
 	{ /* sentinel */ },
 };
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH v3 3/3] dt-bindings: modify document of Rockchip power domains
  2016-01-11 10:36 [PATCH v3 0/3] SoC: rockchip: support power domain for RK3368 zhangqing
  2016-01-11 10:36 ` [PATCH v3 1/3] dt-bindings: add power-domain header for RK3368 SoCs zhangqing
  2016-01-11 10:36 ` [PATCH v3 2/3] soc: rockchip: power-domain: Modify power domain driver for rk3368 zhangqing
@ 2016-01-11 10:36 ` zhangqing
  2016-01-11  2:55   ` Rob Herring
  2016-01-20 10:28 ` [PATCH v3 0/3] SoC: rockchip: support power domain for RK3368 zhangqing
  2016-01-24 22:52 ` Heiko Stübner
  4 siblings, 1 reply; 13+ messages in thread
From: zhangqing @ 2016-01-11 10:36 UTC (permalink / raw)
  To: heiko, wxt
  Cc: robh+dt, pawel.moll, mark.rutland, ijc+devicetree, galak,
	khilman, linux-arm-kernel, devicetree, huangtao, zyw,
	linux-rockchip, linux-kernel, zhangqing

Modify binding documentation for the power domains
found on Rockchip RK3368 SoCs.

Signed-off-by: zhangqing <zhangqing@rock-chips.com>
---
 .../bindings/soc/rockchip/power_domain.txt          | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/Documentation/devicetree/bindings/soc/rockchip/power_domain.txt b/Documentation/devicetree/bindings/soc/rockchip/power_domain.txt
index 112756e..13dc6a3 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,rk3368-power-controller" - for RK3368 SoCs.
 - #power-domain-cells: Number of cells in a power-domain specifier.
 	Should be 1 for multiple PM domains.
 - #address-cells: Should be 1.
@@ -14,6 +15,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/rk3368-power.h" - for RK3368 type power domain.
 - clocks (optional): phandles to clocks which need to be enabled while power domain
 	switches state.
 
@@ -31,11 +33,24 @@ Example:
 		};
 	};
 
+	 power: power-controller {
+                compatible = "rockchip,rk3368-power-controller";
+                #power-domain-cells = <1>;
+                #address-cells = <1>;
+                #size-cells = <0>;
+
+                pd_gpu_1 {
+                        reg = <RK3368_PD_GPU_1>;
+                        clocks = <&cru ACLK_GPU_CFG>;
+                };
+        };
+
 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/rk3288-power.h" - for rk3288 type power domain.
+	"include/dt-bindings/power/rk3368-power.h" - for rk3368 type power domain.
 
 Example of the node using power domain:
 
@@ -44,3 +59,9 @@ Example of the node using power domain:
 		power-domains = <&power RK3288_PD_GPU>;
 		/* ... */
 	};
+
+	node {
+                /* ... */
+                power-domains = <&power RK3368_PD_GPU_1>;
+                /* ... */
+        };
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH v3 2/3] soc: rockchip: power-domain: Modify power domain driver for rk3368
  2016-01-11 10:36 ` [PATCH v3 2/3] soc: rockchip: power-domain: Modify power domain driver for rk3368 zhangqing
@ 2016-01-11 13:27   ` Caesar Wang
  2016-01-12  8:57     ` zhangqing
  2016-01-12  2:00   ` Caesar Wang
  1 sibling, 1 reply; 13+ messages in thread
From: Caesar Wang @ 2016-01-11 13:27 UTC (permalink / raw)
  To: zhangqing
  Cc: heiko, robh+dt, pawel.moll, mark.rutland, ijc+devicetree, galak,
	khilman, linux-arm-kernel, devicetree, huangtao, zyw,
	linux-rockchip, linux-kernel

Hi zhangqin,

 From my datasheet "Rockchip RK3368 TRM V2.0.pdf"
Maybe i'm missing something.


在 2016年01月11日 18:36, zhangqing 写道:
> This driver is modified to support RK3368 SoC.
>
> Signed-off-by: zhangqing <zhangqing@rock-chips.com>
> ---
>   drivers/soc/rockchip/pm_domains.c | 33 +++++++++++++++++++++++++++++++++
>   1 file changed, 33 insertions(+)
>
> diff --git a/drivers/soc/rockchip/pm_domains.c b/drivers/soc/rockchip/pm_domains.c
> index 534c589..6cdffb1 100644
> --- a/drivers/soc/rockchip/pm_domains.c
> +++ b/drivers/soc/rockchip/pm_domains.c
> @@ -18,6 +18,7 @@
>   #include <linux/regmap.h>
>   #include <linux/mfd/syscon.h>
>   #include <dt-bindings/power/rk3288-power.h>
> +#include <dt-bindings/power/rk3368-power.h>
>   
>   struct rockchip_domain_info {
>   	int pwr_mask;
> @@ -75,6 +76,9 @@ struct rockchip_pmu {
>   #define DOMAIN_RK3288(pwr, status, req)		\
>   	DOMAIN(pwr, status, req, req, (req) + 16)
>   
> +#define DOMAIN_RK3368(pwr, status, req)		\
> +	DOMAIN(pwr, status, req, (req) + 16, req)
> +

You should  remove it, that's seem same with the rk3288.

The rk3368 datasheet:
PMU_PMU_BUS_IDLE_ST  ----->idle_vio[24]----->ack
PMU_PMU_BUS_IDLE_REQ ---->idle_req_vio[8]----->idle

>   static bool rockchip_pmu_domain_is_idle(struct rockchip_pm_domain *pd)
>   {
>   	struct rockchip_pmu *pmu = pd->pmu;
> @@ -444,6 +448,14 @@ static const struct rockchip_domain_info rk3288_pm_domains[] = {
>   	[RK3288_PD_GPU]		= DOMAIN_RK3288(9, 9, 2),
>   };
>   
> +static const struct rockchip_domain_info rk3368_pm_domains[] = {
> +	[RK3368_PD_PERI]	= DOMAIN_RK3368(13, 12, 6),
> +	[RK3368_PD_VIO]		= DOMAIN_RK3368(15, 14, 8),
> +	[RK3368_PD_VIDEO]	= DOMAIN_RK3368(14, 13, 7),
> +	[RK3368_PD_GPU_0]	= DOMAIN_RK3368(16, 15, 2),
> +	[RK3368_PD_GPU_1]	= DOMAIN_RK3368(17, 16, 2),
> +};
> +
>   static const struct rockchip_pmu_info rk3288_pmu = {
>   	.pwr_offset = 0x08,
>   	.status_offset = 0x0c,
> @@ -461,11 +473,32 @@ static const struct rockchip_pmu_info rk3288_pmu = {
>   	.domain_info = rk3288_pm_domains,
>   };
>   
> +static const struct rockchip_pmu_info rk3368_pmu = {
> +	.pwr_offset = 0x0c,
> +	.status_offset = 0x10,
> +	.req_offset = 0x3c,
> +	.idle_offset = 0x40,
> +	.ack_offset = 0x40,
> +
> +	.core_pwrcnt_offset = 0x48,
> +	.gpu_pwrcnt_offset = 0x50,
> +
> +	.core_power_transition_time = 24,
> +	.gpu_power_transition_time = 24,
> +
> +	.num_domains = ARRAY_SIZE(rk3368_pm_domains),
> +	.domain_info = rk3368_pm_domains,
> +};
> +
>   static const struct of_device_id rockchip_pm_domain_dt_match[] = {
>   	{
>   		.compatible = "rockchip,rk3288-power-controller",
>   		.data = (void *)&rk3288_pmu,
>   	},
> +	{
> +		.compatible = "rockchip,rk3368-power-controller",
> +		.data = (void *)&rk3368_pmu,
> +	},
>   	{ /* sentinel */ },
>   };
>   
>
> -- 
> Thanks,
> Caesar

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v3 2/3] soc: rockchip: power-domain: Modify power domain driver for rk3368
  2016-01-12  8:57     ` zhangqing
@ 2016-01-12  1:57       ` Caesar Wang
  0 siblings, 0 replies; 13+ messages in thread
From: Caesar Wang @ 2016-01-12  1:57 UTC (permalink / raw)
  To: zhangqing
  Cc: Caesar Wang, mark.rutland, devicetree, khilman, huangtao, heiko,
	pawel.moll, ijc+devicetree, linux-kernel, linux-rockchip,
	robh+dt, galak, zyw, linux-arm-kernel



在 2016年01月12日 16:57, zhangqing 写道:
> hi Caesar Wang
>
> you need check the datasheet again.
> > The rk3368 datasheet:
> > PMU_PMU_BUS_IDLE_ST  ----->ack_vio[8]----->ack status
>             ----->idle_vio[24]----->idle status
> > PMU_PMU_BUS_IDLE_REQ ---->idle_req_vio[8]----->idle req

You are right from the new datasheet.


>
> On 01/11/2016 05:27 AM, Caesar Wang wrote:
>> Hi zhangqin,
>>
>>  From my datasheet "Rockchip RK3368 TRM V2.0.pdf"
>> Maybe i'm missing something.
>>
>>
>> 在 2016年01月11日 18:36, zhangqing 写道:
>>> This driver is modified to support RK3368 SoC.
>>>
>>> Signed-off-by: zhangqing <zhangqing@rock-chips.com>
>>> ---
>>>   drivers/soc/rockchip/pm_domains.c | 33
>>> +++++++++++++++++++++++++++++++++
>>>   1 file changed, 33 insertions(+)
>>>
>>> diff --git a/drivers/soc/rockchip/pm_domains.c
>>> b/drivers/soc/rockchip/pm_domains.c
>>> index 534c589..6cdffb1 100644
>>> --- a/drivers/soc/rockchip/pm_domains.c
>>> +++ b/drivers/soc/rockchip/pm_domains.c
>>> @@ -18,6 +18,7 @@
>>>   #include <linux/regmap.h>
>>>   #include <linux/mfd/syscon.h>
>>>   #include <dt-bindings/power/rk3288-power.h>
>>> +#include <dt-bindings/power/rk3368-power.h>
>>>   struct rockchip_domain_info {
>>>       int pwr_mask;
>>> @@ -75,6 +76,9 @@ struct rockchip_pmu {
>>>   #define DOMAIN_RK3288(pwr, status, req)        \
>>>       DOMAIN(pwr, status, req, req, (req) + 16)
>>> +#define DOMAIN_RK3368(pwr, status, req)        \
>>> +    DOMAIN(pwr, status, req, (req) + 16, req)
>>> +
>>
>> You should  remove it, that's seem same with the rk3288.
>>
>> The rk3368 datasheet:
>> PMU_PMU_BUS_IDLE_ST  ----->idle_vio[24]----->ack
>> PMU_PMU_BUS_IDLE_REQ ---->idle_req_vio[8]----->idle
>>
>>>   static bool rockchip_pmu_domain_is_idle(struct rockchip_pm_domain 
>>> *pd)
>>>   {
>>>       struct rockchip_pmu *pmu = pd->pmu;
>>> @@ -444,6 +448,14 @@ static const struct rockchip_domain_info
>>> rk3288_pm_domains[] = {
>>>       [RK3288_PD_GPU]        = DOMAIN_RK3288(9, 9, 2),
>>>   };
>>> +static const struct rockchip_domain_info rk3368_pm_domains[] = {
>>> +    [RK3368_PD_PERI]    = DOMAIN_RK3368(13, 12, 6),
>>> +    [RK3368_PD_VIO]        = DOMAIN_RK3368(15, 14, 8),
>>> +    [RK3368_PD_VIDEO]    = DOMAIN_RK3368(14, 13, 7),
>>> +    [RK3368_PD_GPU_0]    = DOMAIN_RK3368(16, 15, 2),
>>> +    [RK3368_PD_GPU_1]    = DOMAIN_RK3368(17, 16, 2),
>>> +};
>>> +
>>>   static const struct rockchip_pmu_info rk3288_pmu = {
>>>       .pwr_offset = 0x08,
>>>       .status_offset = 0x0c,
>>> @@ -461,11 +473,32 @@ static const struct rockchip_pmu_info rk3288_pmu
>>> = {
>>>       .domain_info = rk3288_pm_domains,
>>>   };
>>> +static const struct rockchip_pmu_info rk3368_pmu = {
>>> +    .pwr_offset = 0x0c,
>>> +    .status_offset = 0x10,
>>> +    .req_offset = 0x3c,
>>> +    .idle_offset = 0x40,
>>> +    .ack_offset = 0x40,
>>> +
>>> +    .core_pwrcnt_offset = 0x48,
>>> +    .gpu_pwrcnt_offset = 0x50,
>>> +
>>> +    .core_power_transition_time = 24,
>>> +    .gpu_power_transition_time = 24,
>>> +
>>> +    .num_domains = ARRAY_SIZE(rk3368_pm_domains),
>>> +    .domain_info = rk3368_pm_domains,
>>> +};
>>> +
>>>   static const struct of_device_id rockchip_pm_domain_dt_match[] = {
>>>       {
>>>           .compatible = "rockchip,rk3288-power-controller",
>>>           .data = (void *)&rk3288_pmu,
>>>       },
>>> +    {
>>> +        .compatible = "rockchip,rk3368-power-controller",
>>> +        .data = (void *)&rk3368_pmu,
>>> +    },
>>>       { /* sentinel */ },
>>>   };
>>>
>>> -- 
>>> Thanks,
>>> Caesar
>>
>>
>>
>
>
> _______________________________________________
> Linux-rockchip mailing list
> Linux-rockchip@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-rockchip


-- 
Thanks,
Caesar

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v3 2/3] soc: rockchip: power-domain: Modify power domain driver for rk3368
  2016-01-11 10:36 ` [PATCH v3 2/3] soc: rockchip: power-domain: Modify power domain driver for rk3368 zhangqing
  2016-01-11 13:27   ` Caesar Wang
@ 2016-01-12  2:00   ` Caesar Wang
  1 sibling, 0 replies; 13+ messages in thread
From: Caesar Wang @ 2016-01-12  2:00 UTC (permalink / raw)
  To: zhangqing
  Cc: heiko, wxt, mark.rutland, devicetree, khilman, huangtao,
	pawel.moll, ijc+devicetree, linux-kernel, linux-rockchip,
	robh+dt, galak, zyw, linux-arm-kernel

Hi

在 2016年01月11日 18:36, zhangqing 写道:
> This driver is modified to support RK3368 SoC.
>
> Signed-off-by: zhangqing <zhangqing@rock-chips.com>

Reviewed-by: Caesar Wang <wxt@rock-chips.com>

> ---
>   drivers/soc/rockchip/pm_domains.c | 33 +++++++++++++++++++++++++++++++++
>   1 file changed, 33 insertions(+)
>
> diff --git a/drivers/soc/rockchip/pm_domains.c b/drivers/soc/rockchip/pm_domains.c
> index 534c589..6cdffb1 100644
> --- a/drivers/soc/rockchip/pm_domains.c
> +++ b/drivers/soc/rockchip/pm_domains.c
> @@ -18,6 +18,7 @@
>   #include <linux/regmap.h>
>   #include <linux/mfd/syscon.h>
>   #include <dt-bindings/power/rk3288-power.h>
> +#include <dt-bindings/power/rk3368-power.h>
>   
>   struct rockchip_domain_info {
>   	int pwr_mask;
> @@ -75,6 +76,9 @@ struct rockchip_pmu {
>   #define DOMAIN_RK3288(pwr, status, req)		\
>   	DOMAIN(pwr, status, req, req, (req) + 16)
>   
> +#define DOMAIN_RK3368(pwr, status, req)		\
> +	DOMAIN(pwr, status, req, (req) + 16, req)
> +
>   static bool rockchip_pmu_domain_is_idle(struct rockchip_pm_domain *pd)
>   {
>   	struct rockchip_pmu *pmu = pd->pmu;
> @@ -444,6 +448,14 @@ static const struct rockchip_domain_info rk3288_pm_domains[] = {
>   	[RK3288_PD_GPU]		= DOMAIN_RK3288(9, 9, 2),
>   };
>   
> +static const struct rockchip_domain_info rk3368_pm_domains[] = {
> +	[RK3368_PD_PERI]	= DOMAIN_RK3368(13, 12, 6),
> +	[RK3368_PD_VIO]		= DOMAIN_RK3368(15, 14, 8),
> +	[RK3368_PD_VIDEO]	= DOMAIN_RK3368(14, 13, 7),
> +	[RK3368_PD_GPU_0]	= DOMAIN_RK3368(16, 15, 2),
> +	[RK3368_PD_GPU_1]	= DOMAIN_RK3368(17, 16, 2),
> +};
> +
>   static const struct rockchip_pmu_info rk3288_pmu = {
>   	.pwr_offset = 0x08,
>   	.status_offset = 0x0c,
> @@ -461,11 +473,32 @@ static const struct rockchip_pmu_info rk3288_pmu = {
>   	.domain_info = rk3288_pm_domains,
>   };
>   
> +static const struct rockchip_pmu_info rk3368_pmu = {
> +	.pwr_offset = 0x0c,
> +	.status_offset = 0x10,
> +	.req_offset = 0x3c,
> +	.idle_offset = 0x40,
> +	.ack_offset = 0x40,
> +
> +	.core_pwrcnt_offset = 0x48,
> +	.gpu_pwrcnt_offset = 0x50,
> +
> +	.core_power_transition_time = 24,
> +	.gpu_power_transition_time = 24,
> +
> +	.num_domains = ARRAY_SIZE(rk3368_pm_domains),
> +	.domain_info = rk3368_pm_domains,
> +};
> +
>   static const struct of_device_id rockchip_pm_domain_dt_match[] = {
>   	{
>   		.compatible = "rockchip,rk3288-power-controller",
>   		.data = (void *)&rk3288_pmu,
>   	},
> +	{
> +		.compatible = "rockchip,rk3368-power-controller",
> +		.data = (void *)&rk3368_pmu,
> +	},
>   	{ /* sentinel */ },
>   };
>   


-- 
Thanks,
Caesar

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v3 1/3] dt-bindings: add power-domain header for RK3368 SoCs
  2016-01-11 10:36 ` [PATCH v3 1/3] dt-bindings: add power-domain header for RK3368 SoCs zhangqing
@ 2016-01-12  2:03   ` Caesar Wang
  0 siblings, 0 replies; 13+ messages in thread
From: Caesar Wang @ 2016-01-12  2:03 UTC (permalink / raw)
  To: zhangqing
  Cc: heiko, wxt, mark.rutland, devicetree, khilman, huangtao,
	pawel.moll, ijc+devicetree, linux-kernel, linux-rockchip,
	robh+dt, galak, zyw, linux-arm-kernel

Hi

在 2016年01月11日 18:36, zhangqing 写道:
> According to a description from TRM, add all the power domains.
>
> Signed-off-by: zhangqing <zhangqing@rock-chips.com>

Reviewed-by: Caesar Wang <wxt@rock-chips.com>

> ---
>   include/dt-bindings/power/rk3368-power.h | 28 ++++++++++++++++++++++++++++
>   1 file changed, 28 insertions(+)
>   create mode 100644 include/dt-bindings/power/rk3368-power.h
>
> diff --git a/include/dt-bindings/power/rk3368-power.h b/include/dt-bindings/power/rk3368-power.h
> new file mode 100644
> index 0000000..93633d5
> --- /dev/null
> +++ b/include/dt-bindings/power/rk3368-power.h
> @@ -0,0 +1,28 @@
> +#ifndef __DT_BINDINGS_POWER_RK3368_POWER_H__
> +#define __DT_BINDINGS_POWER_RK3368_POWER_H__
> +
> +/* VD_CORE */
> +#define RK3368_PD_A53_L0	0
> +#define RK3368_PD_A53_L1	1
> +#define RK3368_PD_A53_L2	2
> +#define RK3368_PD_A53_L3	3
> +#define RK3368_PD_SCU_L		4
> +#define RK3368_PD_A53_B0	5
> +#define RK3368_PD_A53_B1	6
> +#define RK3368_PD_A53_B2	7
> +#define RK3368_PD_A53_B3	8
> +#define RK3368_PD_SCU_B		9
> +
> +/* VD_LOGIC */
> +#define RK3368_PD_BUS		10
> +#define RK3368_PD_PERI		11
> +#define RK3368_PD_VIO		12
> +#define RK3368_PD_ALIVE		13
> +#define RK3368_PD_VIDEO		14
> +#define RK3368_PD_GPU_0		15
> +#define RK3368_PD_GPU_1		16
> +
> +/* VD_PMU */
> +#define RK3368_PD_PMU		17
> +
> +#endif


-- 
Thanks,
Caesar

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v3 2/3] soc: rockchip: power-domain: Modify power domain driver for rk3368
  2016-01-11 13:27   ` Caesar Wang
@ 2016-01-12  8:57     ` zhangqing
  2016-01-12  1:57       ` Caesar Wang
  0 siblings, 1 reply; 13+ messages in thread
From: zhangqing @ 2016-01-12  8:57 UTC (permalink / raw)
  To: Caesar Wang
  Cc: heiko, robh+dt, pawel.moll, mark.rutland, ijc+devicetree, galak,
	khilman, linux-arm-kernel, devicetree, huangtao, zyw,
	linux-rockchip, linux-kernel

hi Caesar Wang

you need check the datasheet again.
 > The rk3368 datasheet:
 > PMU_PMU_BUS_IDLE_ST  ----->ack_vio[8]----->ack status
			----->idle_vio[24]----->idle status
 > PMU_PMU_BUS_IDLE_REQ ---->idle_req_vio[8]----->idle req

On 01/11/2016 05:27 AM, Caesar Wang wrote:
> Hi zhangqin,
>
>  From my datasheet "Rockchip RK3368 TRM V2.0.pdf"
> Maybe i'm missing something.
>
>
> 在 2016年01月11日 18:36, zhangqing 写道:
>> This driver is modified to support RK3368 SoC.
>>
>> Signed-off-by: zhangqing <zhangqing@rock-chips.com>
>> ---
>>   drivers/soc/rockchip/pm_domains.c | 33
>> +++++++++++++++++++++++++++++++++
>>   1 file changed, 33 insertions(+)
>>
>> diff --git a/drivers/soc/rockchip/pm_domains.c
>> b/drivers/soc/rockchip/pm_domains.c
>> index 534c589..6cdffb1 100644
>> --- a/drivers/soc/rockchip/pm_domains.c
>> +++ b/drivers/soc/rockchip/pm_domains.c
>> @@ -18,6 +18,7 @@
>>   #include <linux/regmap.h>
>>   #include <linux/mfd/syscon.h>
>>   #include <dt-bindings/power/rk3288-power.h>
>> +#include <dt-bindings/power/rk3368-power.h>
>>   struct rockchip_domain_info {
>>       int pwr_mask;
>> @@ -75,6 +76,9 @@ struct rockchip_pmu {
>>   #define DOMAIN_RK3288(pwr, status, req)        \
>>       DOMAIN(pwr, status, req, req, (req) + 16)
>> +#define DOMAIN_RK3368(pwr, status, req)        \
>> +    DOMAIN(pwr, status, req, (req) + 16, req)
>> +
>
> You should  remove it, that's seem same with the rk3288.
>
> The rk3368 datasheet:
> PMU_PMU_BUS_IDLE_ST  ----->idle_vio[24]----->ack
> PMU_PMU_BUS_IDLE_REQ ---->idle_req_vio[8]----->idle
>
>>   static bool rockchip_pmu_domain_is_idle(struct rockchip_pm_domain *pd)
>>   {
>>       struct rockchip_pmu *pmu = pd->pmu;
>> @@ -444,6 +448,14 @@ static const struct rockchip_domain_info
>> rk3288_pm_domains[] = {
>>       [RK3288_PD_GPU]        = DOMAIN_RK3288(9, 9, 2),
>>   };
>> +static const struct rockchip_domain_info rk3368_pm_domains[] = {
>> +    [RK3368_PD_PERI]    = DOMAIN_RK3368(13, 12, 6),
>> +    [RK3368_PD_VIO]        = DOMAIN_RK3368(15, 14, 8),
>> +    [RK3368_PD_VIDEO]    = DOMAIN_RK3368(14, 13, 7),
>> +    [RK3368_PD_GPU_0]    = DOMAIN_RK3368(16, 15, 2),
>> +    [RK3368_PD_GPU_1]    = DOMAIN_RK3368(17, 16, 2),
>> +};
>> +
>>   static const struct rockchip_pmu_info rk3288_pmu = {
>>       .pwr_offset = 0x08,
>>       .status_offset = 0x0c,
>> @@ -461,11 +473,32 @@ static const struct rockchip_pmu_info rk3288_pmu
>> = {
>>       .domain_info = rk3288_pm_domains,
>>   };
>> +static const struct rockchip_pmu_info rk3368_pmu = {
>> +    .pwr_offset = 0x0c,
>> +    .status_offset = 0x10,
>> +    .req_offset = 0x3c,
>> +    .idle_offset = 0x40,
>> +    .ack_offset = 0x40,
>> +
>> +    .core_pwrcnt_offset = 0x48,
>> +    .gpu_pwrcnt_offset = 0x50,
>> +
>> +    .core_power_transition_time = 24,
>> +    .gpu_power_transition_time = 24,
>> +
>> +    .num_domains = ARRAY_SIZE(rk3368_pm_domains),
>> +    .domain_info = rk3368_pm_domains,
>> +};
>> +
>>   static const struct of_device_id rockchip_pm_domain_dt_match[] = {
>>       {
>>           .compatible = "rockchip,rk3288-power-controller",
>>           .data = (void *)&rk3288_pmu,
>>       },
>> +    {
>> +        .compatible = "rockchip,rk3368-power-controller",
>> +        .data = (void *)&rk3368_pmu,
>> +    },
>>       { /* sentinel */ },
>>   };
>>
>> --
>> Thanks,
>> Caesar
>
>
>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v3 0/3] SoC: rockchip: support power domain for RK3368
  2016-01-20 10:28 ` [PATCH v3 0/3] SoC: rockchip: support power domain for RK3368 zhangqing
@ 2016-01-20  8:26   ` Heiko Stuebner
  0 siblings, 0 replies; 13+ messages in thread
From: Heiko Stuebner @ 2016-01-20  8:26 UTC (permalink / raw)
  To: zhangqing
  Cc: wxt, robh+dt, pawel.moll, mark.rutland, ijc+devicetree, galak,
	khilman, linux-arm-kernel, devicetree, huangtao, zyw,
	linux-rockchip, linux-kernel

Hi Elaine,

Am Mittwoch, 20. Januar 2016, 02:28:05 schrieb zhangqing:
> On 01/11/2016 02:36 AM, zhangqing wrote:
> > add pd id in rk3368-power.h
> > modify pm_domains.c to support RK3368 SoC
> > add RK3368 document for Rockchip power domains
> > 
> > zhangqing (3):
> >    dt-bindings: add power-domain header for RK3368 SoCs
> >    soc: rockchip: power-domain: Modify power domain driver for rk3368
> >    dt-bindings: modify document of Rockchip power domains
> 
> Are there any other questions about the three patches.Please review.

actually the patches look fine. I just need to wait for 4.5-rc1 to be 
released (probably sunday) before I can apply them.


Heiko

> 
> >   .../bindings/soc/rockchip/power_domain.txt         | 21 ++++++++++++++
> >   drivers/soc/rockchip/pm_domains.c                  | 33
> >   ++++++++++++++++++++++ include/dt-bindings/power/rk3368-power.h      
> >       | 28 ++++++++++++++++++ 3 files changed, 82 insertions(+)
> >   create mode 100644 include/dt-bindings/power/rk3368-power.h

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v3 0/3] SoC: rockchip: support power domain for RK3368
  2016-01-11 10:36 [PATCH v3 0/3] SoC: rockchip: support power domain for RK3368 zhangqing
                   ` (2 preceding siblings ...)
  2016-01-11 10:36 ` [PATCH v3 3/3] dt-bindings: modify document of Rockchip power domains zhangqing
@ 2016-01-20 10:28 ` zhangqing
  2016-01-20  8:26   ` Heiko Stuebner
  2016-01-24 22:52 ` Heiko Stübner
  4 siblings, 1 reply; 13+ messages in thread
From: zhangqing @ 2016-01-20 10:28 UTC (permalink / raw)
  To: heiko, wxt
  Cc: robh+dt, pawel.moll, mark.rutland, ijc+devicetree, galak,
	khilman, linux-arm-kernel, devicetree, huangtao, zyw,
	linux-rockchip, linux-kernel



On 01/11/2016 02:36 AM, zhangqing wrote:
> add pd id in rk3368-power.h
> modify pm_domains.c to support RK3368 SoC
> add RK3368 document for Rockchip power domains
>
> zhangqing (3):
>    dt-bindings: add power-domain header for RK3368 SoCs
>    soc: rockchip: power-domain: Modify power domain driver for rk3368
>    dt-bindings: modify document of Rockchip power domains

Are there any other questions about the three patches.Please review.
>
>   .../bindings/soc/rockchip/power_domain.txt         | 21 ++++++++++++++
>   drivers/soc/rockchip/pm_domains.c                  | 33 ++++++++++++++++++++++
>   include/dt-bindings/power/rk3368-power.h           | 28 ++++++++++++++++++
>   3 files changed, 82 insertions(+)
>   create mode 100644 include/dt-bindings/power/rk3368-power.h
>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v3 0/3] SoC: rockchip: support power domain for RK3368
  2016-01-11 10:36 [PATCH v3 0/3] SoC: rockchip: support power domain for RK3368 zhangqing
                   ` (3 preceding siblings ...)
  2016-01-20 10:28 ` [PATCH v3 0/3] SoC: rockchip: support power domain for RK3368 zhangqing
@ 2016-01-24 22:52 ` Heiko Stübner
  4 siblings, 0 replies; 13+ messages in thread
From: Heiko Stübner @ 2016-01-24 22:52 UTC (permalink / raw)
  To: zhangqing
  Cc: wxt, robh+dt, pawel.moll, mark.rutland, ijc+devicetree, galak,
	khilman, linux-arm-kernel, devicetree, huangtao, zyw,
	linux-rockchip, linux-kernel

Hi Elaine,

Am Montag, 11. Januar 2016, 02:36:37 schrieb zhangqing:
> add pd id in rk3368-power.h
> modify pm_domains.c to support RK3368 SoC
> add RK3368 document for Rockchip power domains
> 
> zhangqing (3):
>   dt-bindings: add power-domain header for RK3368 SoCs
>   soc: rockchip: power-domain: Modify power domain driver for rk3368
>   dt-bindings: modify document of Rockchip power domains

applied all 3 to appropriate branches for 4.6


Thanks
Heiko

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2016-01-24 22:52 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-11 10:36 [PATCH v3 0/3] SoC: rockchip: support power domain for RK3368 zhangqing
2016-01-11 10:36 ` [PATCH v3 1/3] dt-bindings: add power-domain header for RK3368 SoCs zhangqing
2016-01-12  2:03   ` Caesar Wang
2016-01-11 10:36 ` [PATCH v3 2/3] soc: rockchip: power-domain: Modify power domain driver for rk3368 zhangqing
2016-01-11 13:27   ` Caesar Wang
2016-01-12  8:57     ` zhangqing
2016-01-12  1:57       ` Caesar Wang
2016-01-12  2:00   ` Caesar Wang
2016-01-11 10:36 ` [PATCH v3 3/3] dt-bindings: modify document of Rockchip power domains zhangqing
2016-01-11  2:55   ` Rob Herring
2016-01-20 10:28 ` [PATCH v3 0/3] SoC: rockchip: support power domain for RK3368 zhangqing
2016-01-20  8:26   ` Heiko Stuebner
2016-01-24 22:52 ` Heiko Stübner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).