Skip to contentSkip to conversation

ARM: rockchip: add power-domains for Cortex-A9 socs

PATCH New Heiko Stuebner 2 participants 14 messages Sep 15, 2017 – Oct 14, 2017

Subsystems (3)
lore
Share & tools
lore

Heiko Stuebner

author maintainer
#0 lore raw

cover ARM: rockchip: add power-domains for Cortex-A9 socs

A small bit of cleanup for some clocks nobody used yet but that need to be toggled for the synchronous reset done on power-domain state changes.

Domain values are done by the book (aka soc documentation for pmu and power-domain <-> ip block connections) and tested with the gpu and the wip lima kernel driver on rk3188.

Heiko Stuebner (9):
clk: rockchip: add more rk3188 graphics clock ids
clk: rockchip: use new cif/vdpu clock ids on rk3188
dt-bindings: add power-domain header for RK3188 SoCs
dt-bindings: add power-domain header for RK3066 SoCs
dt-bindings: add compatibles for rk3066/rk3188 power controllers
soc: rockchip: power-domain: add rk3188 powerdomains
soc: rockchip: power-domain: add rk3066 powerdomains
ARM: dts: rockchip: add qos nodes found on rk3066 and rk3188
ARM: dts: rockchip: add rk3066/rk3188 power-domains

 .../bindings/soc/rockchip/power_domain.txt         |  4 ++
 arch/arm/boot/dts/rk3066a.dtsi                     | 51 ++++++++++++++++++++++
 arch/arm/boot/dts/rk3188.dtsi                      | 48 ++++++++++++++++++++
 arch/arm/boot/dts/rk3xxx.dtsi                      | 40 +++++++++++++++++
 drivers/clk/rockchip/clk-rk3188.c                  | 12 ++---
 drivers/soc/rockchip/pm_domains.c                  | 48 ++++++++++++++++++++
 include/dt-bindings/clock/rk3188-cru-common.h      |  9 +++-
 include/dt-bindings/power/rk3066-power.h           | 21 +++++++++
 include/dt-bindings/power/rk3188-power.h           | 23 ++++++++++
 9 files changed, 248 insertions(+), 8 deletions(-)
 create mode 100644 include/dt-bindings/power/rk3066-power.h
 create mode 100644 include/dt-bindings/power/rk3188-power.h
Signature · 1 line
2.14.1
author maintainer
#1 lore raw

PATCH 1/9 clk: rockchip: add more rk3188 graphics clock ids

Add ids for cif, v{d/e}pu clocks on rk3188. ACLK_CIF does get a needed 1 at it's end but that should be safe because no driver for the camera interface has surfaced so far and the old vendor kernels for these socs are based on linux-3.0 and still used board files then, so there really are no previous users anywhere to be found.

---
 include/dt-bindings/clock/rk3188-cru-common.h | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
include/dt-bindings/clock/rk3188-cru-common.h +7 -2
index eff4319d008b..b9462b7d3dfe 100644
@@ -68,12 +68,14 @@
 #define ACLK_LCDC1		196
 #define ACLK_GPU		197
 #define ACLK_SMC		198
-#define ACLK_CIF		199
+#define ACLK_CIF1		199
 #define ACLK_IPP		200
 #define ACLK_RGA		201
 #define ACLK_CIF0		202
 #define ACLK_CPU		203
 #define ACLK_PERI		204
+#define ACLK_VEPU		205
+#define ACLK_VDPU		206
 
 /* pclk gates */
 #define PCLK_GRF		320
@@ -134,8 +136,11 @@
 #define HCLK_NANDC0		467
 #define HCLK_CPU		468
 #define HCLK_PERI		469
+#define HCLK_CIF1		470
+#define HCLK_VEPU		471
+#define HCLK_VDPU		472
 
-#define CLK_NR_CLKS		(HCLK_PERI + 1)
+#define CLK_NR_CLKS		(HCLK_VDPU + 1)
 
 /* soft-reset indices */
 #define SRST_MCORE		2
Signature · 1 line
2.14.1
author maintainer
#2 lore raw

PATCH 1/9 clk: rockchip: add more rk3188 graphics clock ids

Am Freitag, 15. September 2017, 10:33:49 CEST schrieb Heiko Stuebner:

Quoted 7 lines

Add ids for cif, v{d/e}pu clocks on rk3188. ACLK_CIF does get a needed 1 at it's end but that should be safe because no driver for the camera interface has surfaced so far and the old vendor kernels for these socs are based on linux-3.0 and still used board files then, so there really are no previous users anywhere to be found.

applied for 4.15

author maintainer
#3 lore raw

PATCH 2/9 clk: rockchip: use new cif/vdpu clock ids on rk3188

In reply to Heiko Stuebner

Use the new clock-ids for cif, vdpu, vepu on rk3188

---
 drivers/clk/rockchip/clk-rk3188.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/clk/rockchip/clk-rk3188.c +6 -6
index 00ad0e5f8d66..67e73fd71f09 100644
@@ -290,15 +290,15 @@ static struct rockchip_clk_branch common_clk_branches[] __initdata = {
 			RK2928_CLKSEL_CON(0), 6, 2, DFLAGS | CLK_DIVIDER_READ_ONLY,
 			div_core_peri_t, RK2928_CLKGATE_CON(0), 0, GFLAGS),
 
-	COMPOSITE(0, "aclk_vepu", mux_pll_src_cpll_gpll_p, 0,
+	COMPOSITE(ACLK_VEPU, "aclk_vepu", mux_pll_src_cpll_gpll_p, 0,
 			RK2928_CLKSEL_CON(32), 7, 1, MFLAGS, 0, 5, DFLAGS,
 			RK2928_CLKGATE_CON(3), 9, GFLAGS),
-	GATE(0, "hclk_vepu", "aclk_vepu", 0,
+	GATE(HCLK_VEPU, "hclk_vepu", "aclk_vepu", 0,
 			RK2928_CLKGATE_CON(3), 10, GFLAGS),
-	COMPOSITE(0, "aclk_vdpu", mux_pll_src_cpll_gpll_p, 0,
+	COMPOSITE(ACLK_VDPU, "aclk_vdpu", mux_pll_src_cpll_gpll_p, 0,
 			RK2928_CLKSEL_CON(32), 15, 1, MFLAGS, 8, 5, DFLAGS,
 			RK2928_CLKGATE_CON(3), 11, GFLAGS),
-	GATE(0, "hclk_vdpu", "aclk_vdpu", 0,
+	GATE(HCLK_VDPU, "hclk_vdpu", "aclk_vdpu", 0,
 			RK2928_CLKGATE_CON(3), 12, GFLAGS),
 
 	GATE(0, "gpll_ddr", "gpll", CLK_IGNORE_UNUSED,
@@ -644,13 +644,13 @@ static struct rockchip_clk_branch rk3066a_clk_branches[] __initdata = {
 
 	GATE(HCLK_I2S1, "hclk_i2s1", "hclk_cpu", 0, RK2928_CLKGATE_CON(7), 3, GFLAGS),
 	GATE(HCLK_I2S2, "hclk_i2s2", "hclk_cpu", 0, RK2928_CLKGATE_CON(7), 4, GFLAGS),
-	GATE(0, "hclk_cif1", "hclk_cpu", 0, RK2928_CLKGATE_CON(6), 6, GFLAGS),
+	GATE(HCLK_CIF1, "hclk_cif1", "hclk_cpu", 0, RK2928_CLKGATE_CON(6), 6, GFLAGS),
 	GATE(0, "hclk_hdmi", "hclk_cpu", 0, RK2928_CLKGATE_CON(4), 14, GFLAGS),
 
 	GATE(HCLK_OTG1, "hclk_usbotg1", "hclk_peri", CLK_IGNORE_UNUSED,
 			RK2928_CLKGATE_CON(5), 14, GFLAGS),
 
-	GATE(0, "aclk_cif1", "aclk_vio1", 0, RK2928_CLKGATE_CON(6), 7, GFLAGS),
+	GATE(ACLK_CIF1, "aclk_cif1", "aclk_vio1", 0, RK2928_CLKGATE_CON(6), 7, GFLAGS),
 
 	GATE(PCLK_TIMER1, "pclk_timer1", "pclk_cpu", 0, RK2928_CLKGATE_CON(7), 8, GFLAGS),
 	GATE(PCLK_TIMER2, "pclk_timer2", "pclk_cpu", 0, RK2928_CLKGATE_CON(7), 9, GFLAGS),
Signature · 1 line
2.14.1
author maintainer
#4 lore raw

PATCH 2/9 clk: rockchip: use new cif/vdpu clock ids on rk3188

Am Freitag, 15. September 2017, 10:33:50 CEST schrieb Heiko Stuebner:

Quoted 3 lines

Use the new clock-ids for cif, vdpu, vepu on rk3188

applied for 4.15

author maintainer
#5 lore raw

PATCH 3/9 dt-bindings: add power-domain header for RK3188 SoCs

In reply to Heiko Stuebner

Add rk3188 power-domains as described by the TRM.

---
 include/dt-bindings/power/rk3188-power.h | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
 create mode 100644 include/dt-bindings/power/rk3188-power.h
include/dt-bindings/power/rk3188-power.h new file +23 -0
new file mode 100644
index 000000000000..820db55fc4b7
@@ -0,0 +1,23 @@
+#ifndef __DT_BINDINGS_POWER_RK3188_POWER_H__
+#define __DT_BINDINGS_POWER_RK3188_POWER_H__
+
+/* VD_CORE */
+#define RK3188_PD_A9_0		0
+#define RK3188_PD_A9_1		1
+#define RK3188_PD_A9_2		2
+#define RK3188_PD_A9_3		3
+#define RK3188_PD_DBG		4
+#define RK3188_PD_SCU		5
+
+/* VD_LOGIC */
+#define RK3188_PD_VIDEO		6
+#define RK3188_PD_VIO		7
+#define RK3188_PD_GPU		8
+#define RK3188_PD_PERI		9
+#define RK3188_PD_CPU		10
+#define RK3188_PD_ALIVE		11
+
+/* VD_PMU */
+#define RK3188_PD_RTC		12
+
+#endif
Signature · 1 line
2.14.1
author maintainer
#6 lore raw

PATCH 4/9 dt-bindings: add power-domain header for RK3066 SoCs

In reply to Heiko Stuebner

Add rk3066 power-domains as described by the TRM.

---
 include/dt-bindings/power/rk3066-power.h | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
 create mode 100644 include/dt-bindings/power/rk3066-power.h
include/dt-bindings/power/rk3066-power.h new file +21 -0
new file mode 100644
index 000000000000..dd9bbd35c274
@@ -0,0 +1,21 @@
+#ifndef __DT_BINDINGS_POWER_RK3066_POWER_H__
+#define __DT_BINDINGS_POWER_RK3066_POWER_H__
+
+/* VD_CORE */
+#define RK3066_PD_A9_0		0
+#define RK3066_PD_A9_1		1
+#define RK3066_PD_DBG		4
+#define RK3066_PD_SCU		5
+
+/* VD_LOGIC */
+#define RK3066_PD_VIDEO		6
+#define RK3066_PD_VIO		7
+#define RK3066_PD_GPU		8
+#define RK3066_PD_PERI		9
+#define RK3066_PD_CPU		10
+#define RK3066_PD_ALIVE		11
+
+/* VD_PMU */
+#define RK3066_PD_RTC		12
+
+#endif
Signature · 1 line
2.14.1
author maintainer
#7 lore raw

PATCH 5/9 dt-bindings: add compatibles for rk3066/rk3188 power controllers

In reply to Heiko Stuebner

Add the compatible values for the power-domain controllers found on rk3066 and rk3188.

---
 Documentation/devicetree/bindings/soc/rockchip/power_domain.txt | 4 ++++
 1 file changed, 4 insertions(+)
Documentation/devicetree/bindings/soc/rockchip/power_domain.txt +4 -0
index 301d2a9bc1b8..1c42c5b7ca6a 100644
@@ -5,6 +5,8 @@ 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,rk3066-power-controller" - for RK3288 SoCs.
+	"rockchip,rk3188-power-controller" - for RK3288 SoCs.
 	"rockchip,rk3288-power-controller" - for RK3288 SoCs.
 	"rockchip,rk3328-power-controller" - for RK3328 SoCs.
 	"rockchip,rk3366-power-controller" - for RK3366 SoCs.
@@ -17,6 +19,8 @@ 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/rk3066-power.h" - for RK3288 type power domain.
+	"include/dt-bindings/power/rk3188-power.h" - for RK3288 type power domain.
 	"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/rk3366-power.h" - for RK3366 type power domain.
Signature · 1 line
2.14.1
#8 lore raw

PATCH 5/9 dt-bindings: add compatibles for rk3066/rk3188 power controllers

Hello Heiko,

There are a few copy/paste errors in the documentation.

Le 15/09/2017 ? 10:33, Heiko Stuebner a ?crit?:

Quoted 13 lines

Add the compatible values for the power-domain controllers found on rk3066 and rk3188.

---
  Documentation/devicetree/bindings/soc/rockchip/power_domain.txt | 4 ++++
  1 file changed, 4 insertions(+)
Documentation/devicetree/bindings/soc/rockchip/power_domain.txt +0 -0
index 301d2a9bc1b8..1c42c5b7ca6a 100644

Documentation/devicetree/bindings/soc/rockchip/power_domain.txt powered up/down by software based on different application scenes to save power. · line 9

Quoted 5 lines
Documentation/devicetree/bindings/soc/rockchip/power_domain.txt +2 -0
@@ -5,6 +5,8 @@ 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,rk3066-power-controller" - for RK3288 SoCs.
+	"rockchip,rk3188-power-controller" - for RK3288 SoCs.

These should be for RK3066 and RK3188.

Documentation/devicetree/bindings/soc/rockchip/power_domain.txt Required properties for power domain controller: · line 23

Quoted 9 lines
Documentation/devicetree/bindings/soc/rockchip/power_domain.txt +2 -0
  	"rockchip,rk3288-power-controller" - for RK3288 SoCs.
  	"rockchip,rk3328-power-controller" - for RK3328 SoCs.
  	"rockchip,rk3366-power-controller" - for RK3366 SoCs.
@@ -17,6 +19,8 @@ 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/rk3066-power.h" - for RK3288 type power domain.
+	"include/dt-bindings/power/rk3188-power.h" - for RK3288 type power domain.

Same here.

Documentation/devicetree/bindings/soc/rockchip/power_domain.txt Required properties for power domain controller: · line 26

Quoted 3 lines
Documentation/devicetree/bindings/soc/rockchip/power_domain.txt +0 -0
  	"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/rk3366-power.h" - for RK3366 type power domain.

Julien

author maintainer
#9 lore raw

PATCH 5/9 dt-bindings: add compatibles for rk3066/rk3188 power controllers

Am Samstag, 16. September 2017, 23:04:48 CEST schrieb Julien Chauveau:

Quoted 30 lines

Hello Heiko,

There are a few copy/paste errors in the documentation.

Le 15/09/2017 ? 10:33, Heiko Stuebner a ?crit :

Quoted 13 lines

Add the compatible values for the power-domain controllers found on rk3066 and rk3188.

---
  Documentation/devicetree/bindings/soc/rockchip/power_domain.txt | 4 ++++
  1 file changed, 4 insertions(+)
Documentation/devicetree/bindings/soc/rockchip/power_domain.txt +0 -0
index 301d2a9bc1b8..1c42c5b7ca6a 100644

Documentation/devicetree/bindings/soc/rockchip/power_domain.txt powered up/down by software based on different application scenes to save power. · line 9

Quoted 5 lines
Documentation/devicetree/bindings/soc/rockchip/power_domain.txt +2 -0
@@ -5,6 +5,8 @@ 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,rk3066-power-controller" - for RK3288 SoCs.
+	"rockchip,rk3188-power-controller" - for RK3288 SoCs.

These should be for RK3066 and RK3188.

Quoted 5 lines
Documentation/devicetree/bindings/soc/rockchip/power_domain.txt +0 -0
  	"rockchip,rk3288-power-controller" - for RK3288 SoCs.
  	"rockchip,rk3328-power-controller" - for RK3328 SoCs.
  	"rockchip,rk3366-power-controller" - for RK3366 SoCs.
@@ -17,6 +19,8 @@ Required properties for power domain controller:
 
Quoted 5 lines

Documentation/devicetree/bindings/soc/rockchip/power_domain.txt Required properties for power domain controller: · line 23

Quoted 4 lines
Documentation/devicetree/bindings/soc/rockchip/power_domain.txt +2 -0
  Required properties for power domain sub nodes:
  - reg: index of the power domain, should use macros in:
+	"include/dt-bindings/power/rk3066-power.h" - for RK3288 type power domain.
+	"include/dt-bindings/power/rk3188-power.h" - for RK3288 type power domain.

Same here.

bah ... thanks for noticing. Will fix in a v2 shortly.

Thanks
Heiko

Quoted 6 lines

Documentation/devicetree/bindings/soc/rockchip/power_domain.txt Required properties for power domain controller: · line 26

Quoted 3 lines
Documentation/devicetree/bindings/soc/rockchip/power_domain.txt +0 -0
  	"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/rk3366-power.h" - for RK3366 type power domain.

Julien

author maintainer
#10 lore raw

PATCH 6/9 soc: rockchip: power-domain: add rk3188 powerdomains

In reply to Heiko Stuebner

Add power-domains found on rk3188 socs.

---
 drivers/soc/rockchip/pm_domains.c | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
drivers/soc/rockchip/pm_domains.c +24 -0
index 40b75748835f..dc3f13aacdb5 100644
@@ -18,6 +18,7 @@
 #include <linux/clk.h>
 #include <linux/regmap.h>
 #include <linux/mfd/syscon.h>
+#include <dt-bindings/power/rk3188-power.h>
 #include <dt-bindings/power/rk3288-power.h>
 #include <dt-bindings/power/rk3328-power.h>
 #include <dt-bindings/power/rk3366-power.h>
@@ -712,6 +713,14 @@ static int rockchip_pm_domain_probe(struct platform_device *pdev)
 	return error;
 }
 
+static const struct rockchip_domain_info rk3188_pm_domains[] = {
+	[RK3188_PD_GPU]		= DOMAIN(9, 9, 3, 24, 29, false),
+	[RK3188_PD_VIDEO]	= DOMAIN(8, 8, 4, 23, 28, false),
+	[RK3188_PD_VIO]		= DOMAIN(7, 7, 5, 22, 27, false),
+	[RK3188_PD_PERI]	= DOMAIN(6, 6, 2, 25, 30, false),
+	[RK3188_PD_CPU]		= DOMAIN(5, 5, 1, 26, 31, false),
+};
+
 static const struct rockchip_domain_info rk3288_pm_domains[] = {
 	[RK3288_PD_VIO]		= DOMAIN_RK3288(7, 7, 4, false),
 	[RK3288_PD_HEVC]	= DOMAIN_RK3288(14, 10, 9, false),
@@ -779,6 +788,17 @@ static const struct rockchip_domain_info rk3399_pm_domains[] = {
 	[RK3399_PD_SDIOAUDIO]	= DOMAIN_RK3399(31, 31, 29, true),
 };
 
+static const struct rockchip_pmu_info rk3188_pmu = {
+	.pwr_offset = 0x08,
+	.status_offset = 0x0c,
+	.req_offset = 0x38, /* PMU_MISC_CON1 */
+	.idle_offset = 0x0c,
+	.ack_offset = 0x0c,
+
+	.num_domains = ARRAY_SIZE(rk3188_pm_domains),
+	.domain_info = rk3188_pm_domains,
+};
+
 static const struct rockchip_pmu_info rk3288_pmu = {
 	.pwr_offset = 0x08,
 	.status_offset = 0x0c,
@@ -853,6 +873,10 @@ static const struct rockchip_pmu_info rk3399_pmu = {
 };
 
 static const struct of_device_id rockchip_pm_domain_dt_match[] = {
+	{
+		.compatible = "rockchip,rk3188-power-controller",
+		.data = (void *)&rk3188_pmu,
+	},
 	{
 		.compatible = "rockchip,rk3288-power-controller",
 		.data = (void *)&rk3288_pmu,
Signature · 1 line
2.14.1
author maintainer
#11 lore raw

PATCH 7/9 soc: rockchip: power-domain: add rk3066 powerdomains

In reply to Heiko Stuebner

Add power-domains found on rk3066 socs.

---
 drivers/soc/rockchip/pm_domains.c | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
drivers/soc/rockchip/pm_domains.c +24 -0
index dc3f13aacdb5..f8a5dae2db4c 100644
@@ -18,6 +18,7 @@
 #include <linux/clk.h>
 #include <linux/regmap.h>
 #include <linux/mfd/syscon.h>
+#include <dt-bindings/power/rk3066-power.h>
 #include <dt-bindings/power/rk3188-power.h>
 #include <dt-bindings/power/rk3288-power.h>
 #include <dt-bindings/power/rk3328-power.h>
@@ -713,6 +714,14 @@ static int rockchip_pm_domain_probe(struct platform_device *pdev)
 	return error;
 }
 
+static const struct rockchip_domain_info rk3066_pm_domains[] = {
+	[RK3066_PD_GPU]		= DOMAIN(9, 9, 3, 24, 29, false),
+	[RK3066_PD_VIDEO]	= DOMAIN(8, 8, 4, 23, 28, false),
+	[RK3066_PD_VIO]		= DOMAIN(7, 7, 5, 22, 27, false),
+	[RK3066_PD_PERI]	= DOMAIN(6, 6, 2, 25, 30, false),
+	[RK3066_PD_CPU]		= DOMAIN(-1, 5, 1, 26, 31, false),
+};
+
 static const struct rockchip_domain_info rk3188_pm_domains[] = {
 	[RK3188_PD_GPU]		= DOMAIN(9, 9, 3, 24, 29, false),
 	[RK3188_PD_VIDEO]	= DOMAIN(8, 8, 4, 23, 28, false),
@@ -788,6 +797,17 @@ static const struct rockchip_domain_info rk3399_pm_domains[] = {
 	[RK3399_PD_SDIOAUDIO]	= DOMAIN_RK3399(31, 31, 29, true),
 };
 
+static const struct rockchip_pmu_info rk3066_pmu = {
+	.pwr_offset = 0x08,
+	.status_offset = 0x0c,
+	.req_offset = 0x38, /* PMU_MISC_CON1 */
+	.idle_offset = 0x0c,
+	.ack_offset = 0x0c,
+
+	.num_domains = ARRAY_SIZE(rk3066_pm_domains),
+	.domain_info = rk3066_pm_domains,
+};
+
 static const struct rockchip_pmu_info rk3188_pmu = {
 	.pwr_offset = 0x08,
 	.status_offset = 0x0c,
@@ -873,6 +893,10 @@ static const struct rockchip_pmu_info rk3399_pmu = {
 };
 
 static const struct of_device_id rockchip_pm_domain_dt_match[] = {
+	{
+		.compatible = "rockchip,rk3066-power-controller",
+		.data = (void *)&rk3066_pmu,
+	},
 	{
 		.compatible = "rockchip,rk3188-power-controller",
 		.data = (void *)&rk3188_pmu,
Signature · 1 line
2.14.1
author maintainer
#12 lore raw

PATCH 8/9 ARM: dts: rockchip: add qos nodes found on rk3066 and rk3188

In reply to Heiko Stuebner

QoS nodes keep information about priorites etc on the interconnect and loose state when the power-domain gets disabled. Therefore the power-domain driver stores the settings of available qos nodes and restores them when the power-domain gets enabled again.

So add the qos nodes found on the Cortex-A9 socs from Rockchip, so that they can then be connected to the power-domains.

---
 arch/arm/boot/dts/rk3xxx.dtsi | 40 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)
arch/arm/boot/dts/rk3xxx.dtsi +40 -0
index 7458047f5fd5..4a2c9a87fcfe 100644
@@ -184,6 +184,46 @@
 		status = "disabled";
 	};
 
+	qos_gpu: qos at 1012d000 {
+		compatible = "syscon";
+		reg = <0x1012d000 0x20>;
+	};
+
+	qos_vpu: qos at 1012e000 {
+		compatible = "syscon";
+		reg = <0x1012e000 0x20>;
+	};
+
+	qos_lcdc0: qos at 1012f000 {
+		compatible = "syscon";
+		reg = <0x1012f000 0x20>;
+	};
+
+	qos_cif0: qos at 1012f080 {
+		compatible = "syscon";
+		reg = <0x1012f080 0x20>;
+	};
+
+	qos_ipp: qos at 1012f100 {
+		compatible = "syscon";
+		reg = <0x1012f100 0x20>;
+	};
+
+	qos_lcdc1: qos at 1012f180 {
+		compatible = "syscon";
+		reg = <0x1012f180 0x20>;
+	};
+
+	qos_cif1: qos at 1012f200 {
+		compatible = "syscon";
+		reg = <0x1012f200 0x20>;
+	};
+
+	qos_rga: qos at 1012f280 {
+		compatible = "syscon";
+		reg = <0x1012f280 0x20>;
+	};
+
 	usb_otg: usb at 10180000 {
 		compatible = "rockchip,rk3066-usb", "snps,dwc2";
 		reg = <0x10180000 0x40000>;
Signature · 1 line
2.14.1
author maintainer
#13 lore raw

PATCH 9/9 ARM: dts: rockchip: add rk3066/rk3188 power-domains

In reply to Heiko Stuebner

Add the power-domain nodes to both rk3066 and rk3188 including their clocks and qos connections.

---
 arch/arm/boot/dts/rk3066a.dtsi | 51 ++++++++++++++++++++++++++++++++++++++++++
 arch/arm/boot/dts/rk3188.dtsi  | 48 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 99 insertions(+)
arch/arm/boot/dts/rk3066a.dtsi +51 -0
index b76119dd5733..8f8ce8cc9caf 100644
@@ -44,6 +44,7 @@
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/pinctrl/rockchip.h>
 #include <dt-bindings/clock/rk3066a-cru.h>
+#include <dt-bindings/power/rk3066-power.h>
 #include "rk3xxx.dtsi"
 
 / {
@@ -680,6 +681,56 @@
 	dma-names = "rx-tx";
 };
 
+&pmu {
+	power: power-controller {
+		compatible = "rockchip,rk3066-power-controller";
+		#power-domain-cells = <1>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		pd_vio at RK3066_PD_VIO {
+			reg = <RK3066_PD_VIO>;
+			clocks = <&cru ACLK_LCDC0>,
+				 <&cru ACLK_LCDC1>,
+				 <&cru DCLK_LCDC0>,
+				 <&cru DCLK_LCDC1>,
+				 <&cru HCLK_LCDC0>,
+				 <&cru HCLK_LCDC1>,
+				 <&cru SCLK_CIF1>,
+				 <&cru ACLK_CIF1>,
+				 <&cru HCLK_CIF1>,
+				 <&cru SCLK_CIF0>,
+				 <&cru ACLK_CIF0>,
+				 <&cru HCLK_CIF0>,
+				 <&cru ACLK_IPP>,
+				 <&cru HCLK_IPP>,
+				 <&cru ACLK_RGA>,
+				 <&cru HCLK_RGA>;
+			pm_qos = <&qos_lcdc0>,
+				 <&qos_lcdc1>,
+				 <&qos_cif0>,
+				 <&qos_cif1>,
+				 <&qos_ipp>,
+				 <&qos_rga>;
+		};
+
+		pd_video at RK3066_PD_VIDEO {
+			reg = <RK3066_PD_VIDEO>;
+			clocks = <&cru ACLK_VDPU>,
+				 <&cru ACLK_VEPU>,
+				 <&cru HCLK_VDPU>,
+				 <&cru HCLK_VEPU>;
+			pm_qos = <&qos_vpu>;
+		};
+
+		pd_gpu at RK3066_PD_GPU {
+			reg = <RK3066_PD_GPU>;
+			clocks = <&cru ACLK_GPU>;
+			pm_qos = <&qos_gpu>;
+		};
+	};
+};
+
 &pwm0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&pwm0_out>;
arch/arm/boot/dts/rk3188.dtsi +48 -0

60 lines not on this page · raw message

Signature · 1 line
2.14.1