Skip to contentSkip to conversation

ARM: rockchip: move io-domains under GRF

PATCH Superseded Heiko Stuebner 2 participants 8 messages Feb 5, 2016 – Mar 2, 2016

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Heiko Stuebner

author maintainer
#0 lore raw

cover ARM: rockchip: move io-domains under GRF

The GRF contains both individual settings-bits as well as somewhat more fully blocks like different phy-controls and also the io-voltage selection. Similar to the power-domains living under the pmu, things like said io-voltage selection should live under the grf instead of separate nodes higher up.

This is even more important now that socs like the rk3368 and probably more future socs seem to contain more than one GRF-area (a second one under the PMU power-domain) with each containing a part of the voltage selection. So having that in the correct place also prevents confusion.

Ideally patch1 would go into 4.6 through the power or avs tree and the devicetree-related things should wait until after the next merge window due to the updated binding, which I can then simply apply to my dts branches.

Heiko Stuebner (5):
PM / AVS: rockchip-io: make io-domains a child of the GRF
ARM: dts: rockchip: make rk3288-grf a simple-mfd
ARM: dts: rockchip: move rk3288 io-domain nodes to the grf
arm64: dts: rockchip: make rk3368 grf syscons simple-mfds as well
arm64: dts: rockchip: add rk3368 iodomains

 .../bindings/power/rockchip-io-domain.txt          |  4 ++-
 arch/arm/boot/dts/rk3288-firefly.dtsi              | 33 +++++++++++----------
 arch/arm/boot/dts/rk3288-popmetal.dts              | 34 ++++++++++++----------
 arch/arm/boot/dts/rk3288-rock2-som.dtsi            | 34 ++++++++++++----------
 arch/arm/boot/dts/rk3288-veyron.dtsi               | 28 +++++++++---------
 arch/arm/boot/dts/rk3288.dtsi                      |  2 +-
 arch/arm64/boot/dts/rockchip/rk3368-r88.dts        | 22 ++++++++++++++
 arch/arm64/boot/dts/rockchip/rk3368.dtsi           |  4 +--
 drivers/power/avs/rockchip-io-domain.c             | 10 ++++++-
 9 files changed, 105 insertions(+), 66 deletions(-)
Signature · 1 line
2.6.4
author maintainer
#1 lore raw

PATCH 1/5 PM / AVS: rockchip-io: make io-domains a child of the GRF

IO-domain handling is part of the general register files, so should live under the grf directly. This change allows the grf to be a simple-mfd and the io-domains fetching the syscon regmap from that parent-node.

The old binding is of course preserved, though deprecated.

---
 Documentation/devicetree/bindings/power/rockchip-io-domain.txt |  4 +++-
 drivers/power/avs/rockchip-io-domain.c                         | 10 +++++++++-
 2 files changed, 12 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/power/rockchip-io-domain.txt +3 -1
index b8627e7..7ed5518 100644
@@ -35,8 +35,10 @@ Required properties:
   - "rockchip,rk3288-io-voltage-domain" for rk3288
   - "rockchip,rk3368-io-voltage-domain" for rk3368
   - "rockchip,rk3368-pmu-io-voltage-domain" for rk3368 pmu-domains
-- rockchip,grf: phandle to the syscon managing the "general register files"
 
+Deprecated properties:
+- rockchip,grf: phandle to the syscon managing the "general register files"
+    Systems should move the io-domains to a sub-node of the grf simple-mfd.
 
 You specify supplies using the standard regulator bindings by including
 a phandle the relevant regulator.  All specified supplies must be able
drivers/power/avs/rockchip-io-domain.c +9 -1
index 8099456..a5a07d8 100644
@@ -278,6 +278,7 @@ static int rockchip_iodomain_probe(struct platform_device *pdev)
 	struct device_node *np = pdev->dev.of_node;
 	const struct of_device_id *match;
 	struct rockchip_iodomain *iod;
+	struct device *parent;
 	int i, ret = 0;
 
 	if (!np)
@@ -293,7 +294,14 @@ static int rockchip_iodomain_probe(struct platform_device *pdev)
 	match = of_match_node(rockchip_iodomain_match, np);
 	iod->soc_data = (struct rockchip_iodomain_soc_data *)match->data;
 
-	iod->grf = syscon_regmap_lookup_by_phandle(np, "rockchip,grf");
+	parent = pdev->dev.parent;
+	if (parent && parent->of_node) {
+		iod->grf = syscon_node_to_regmap(parent->of_node);
+	} else {
+		dev_dbg(&pdev->dev, "falling back to old binding\n");
+		iod->grf = syscon_regmap_lookup_by_phandle(np, "rockchip,grf");
+	}
+
 	if (IS_ERR(iod->grf)) {
 		dev_err(&pdev->dev, "couldn't find grf regmap\n");
 		return PTR_ERR(iod->grf);
Signature · 1 line
2.6.4
#2 lore raw

PATCH 1/5 PM / AVS: rockchip-io: make io-domains a child of the GRF

Quoted 7 lines · Heiko Stuebner

IO-domain handling is part of the general register files, so should live under the grf directly. This change allows the grf to be a simple-mfd and the io-domains fetching the syscon regmap from that parent-node.

The old binding is of course preserved, though deprecated.

Quoted 49 lines
---
 Documentation/devicetree/bindings/power/rockchip-io-domain.txt |  4 +++-
 drivers/power/avs/rockchip-io-domain.c                         | 10 +++++++++-
 2 files changed, 12 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/power/rockchip-io-domain.txt +3 -1
index b8627e7..7ed5518 100644
@@ -35,8 +35,10 @@ Required properties:
   - "rockchip,rk3288-io-voltage-domain" for rk3288
   - "rockchip,rk3368-io-voltage-domain" for rk3368
   - "rockchip,rk3368-pmu-io-voltage-domain" for rk3368 pmu-domains
-- rockchip,grf: phandle to the syscon managing the "general register files"
 
+Deprecated properties:
+- rockchip,grf: phandle to the syscon managing the "general register files"
+    Systems should move the io-domains to a sub-node of the grf simple-mfd.
 
 You specify supplies using the standard regulator bindings by including
 a phandle the relevant regulator.  All specified supplies must be able
drivers/power/avs/rockchip-io-domain.c +9 -1
index 8099456..a5a07d8 100644
@@ -278,6 +278,7 @@ static int rockchip_iodomain_probe(struct platform_device *pdev)
 	struct device_node *np = pdev->dev.of_node;
 	const struct of_device_id *match;
 	struct rockchip_iodomain *iod;
+	struct device *parent;
 	int i, ret = 0;
 
 	if (!np)
@@ -293,7 +294,14 @@ static int rockchip_iodomain_probe(struct platform_device *pdev)
 	match = of_match_node(rockchip_iodomain_match, np);
 	iod->soc_data = (struct rockchip_iodomain_soc_data *)match->data;
 
-	iod->grf = syscon_regmap_lookup_by_phandle(np, "rockchip,grf");
+	parent = pdev->dev.parent;
+	if (parent && parent->of_node) {
+		iod->grf = syscon_node_to_regmap(parent->of_node);
+	} else {
+		dev_dbg(&pdev->dev, "falling back to old binding\n");
+		iod->grf = syscon_regmap_lookup_by_phandle(np, "rockchip,grf");
+	}
+
 	if (IS_ERR(iod->grf)) {
 		dev_err(&pdev->dev, "couldn't find grf regmap\n");
 		return PTR_ERR(iod->grf);
author maintainer
#3 lore raw

PATCH 1/5 PM / AVS: rockchip-io: make io-domains a child of the GRF

Hi Rafael,

Am Freitag, 5. Februar 2016, 14:47:08 schrieb Kevin Hilman:

Quoted 10 lines
Quoted 7 lines · Heiko Stuebner

IO-domain handling is part of the general register files, so should live under the grf directly. This change allows the grf to be a simple-mfd and the io-domains fetching the syscon regmap from that parent-node.

The old binding is of course preserved, though deprecated.

As before, I guess that means you could apply that patch directly, as nothing else is pending from Kevin's side.

Thanks
Heiko

Quoted 63 lines
Quoted 63 lines

---

 Documentation/devicetree/bindings/power/rockchip-io-domain.txt |  4 +++-
 drivers/power/avs/rockchip-io-domain.c                         | 10

+++++++++- 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/power/rockchip-io-domain.txt b/Documentation/devicetree/bindings/power/rockchip-io-domain.txt index b8627e7..7ed5518 100644

Documentation/devicetree/bindings/power/rockchip-io-domain.txt +0 -1
@@ -35,8 +35,10 @@ Required properties:
   - "rockchip,rk3288-io-voltage-domain" for rk3288
   - "rockchip,rk3368-io-voltage-domain" for rk3368
   - "rockchip,rk3368-pmu-io-voltage-domain" for rk3368 pmu-domains
 
-- rockchip,grf: phandle to the syscon managing the "general register

files"

+Deprecated properties:

+- rockchip,grf: phandle to the syscon managing the "general register
files" +    Systems should move the io-domains to a sub-node of the grf

simple-mfd.>
You specify supplies using the standard regulator bindings by including a phandle the relevant regulator. All specified supplies must be able

(quoted diff) +0 -0

b/drivers/power/avs/rockchip-io-domain.c index 8099456..a5a07d8 100644

drivers/power/avs/rockchip-io-domain.c +0 -0
@@ -278,6 +278,7 @@ static int rockchip_iodomain_probe(struct

platform_device *pdev)>

drivers/power/avs/rockchip-io-domain.c +1 -0
 	struct device_node *np = pdev->dev.of_node;
 	const struct of_device_id *match;
 	struct rockchip_iodomain *iod;
 
+	struct device *parent;
 
 	int i, ret = 0;
 
 	if (!np)
@@ -293,7 +294,14 @@ static int rockchip_iodomain_probe(struct

platform_device *pdev)>

drivers/power/avs/rockchip-io-domain.c +8 -1
 	match = of_match_node(rockchip_iodomain_match, np);
 	iod->soc_data = (struct rockchip_iodomain_soc_data *)match->data;
 
-	iod->grf = syscon_regmap_lookup_by_phandle(np, "rockchip,grf");
+	parent = pdev->dev.parent;
+	if (parent && parent->of_node) {
+		iod->grf = syscon_node_to_regmap(parent->of_node);
+	} else {
+		dev_dbg(&pdev->dev, "falling back to old binding\n");
+		iod->grf = syscon_regmap_lookup_by_phandle(np, "rockchip,grf");
+	}
+
 
 	if (IS_ERR(iod->grf)) {
 
 		dev_err(&pdev->dev, "couldn't find grf regmap\n");
 		return PTR_ERR(iod->grf);
author maintainer
#4 lore raw

PATCH 2/5 ARM: dts: rockchip: make rk3288-grf a simple-mfd

In reply to Heiko Stuebner

Similar to the pmu, the general register files contain a lot of different setting bits grouped into general registers, but also some somewhat special entities like the controls for some phy-blocks or the io-voltage control. To be able to move these blocks under the grf node where they actually belong, make it a simple-mfd.

---
 arch/arm/boot/dts/rk3288.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/rk3288.dtsi +1 -1
index 3d46327..8e49c17 100644
@@ -748,7 +748,7 @@
 	};
 
 	grf: syscon at ff770000 {
-		compatible = "rockchip,rk3288-grf", "syscon";
+		compatible = "rockchip,rk3288-grf", "syscon", "simple-mfd";
 		reg = <0xff770000 0x1000>;
 	};
 
Signature · 1 line
2.6.4
author maintainer
#5 lore raw

PATCH 3/5 ARM: dts: rockchip: move rk3288 io-domain nodes to the grf

In reply to Heiko Stuebner

io-voltage control is actually part of the grf, so move the node under the newly available grf simple-mfd.

---
 arch/arm/boot/dts/rk3288-firefly.dtsi   | 33 ++++++++++++++++----------------
 arch/arm/boot/dts/rk3288-popmetal.dts   | 34 +++++++++++++++++----------------
 arch/arm/boot/dts/rk3288-rock2-som.dtsi | 34 +++++++++++++++++----------------
 arch/arm/boot/dts/rk3288-veyron.dtsi    | 28 ++++++++++++++-------------
 4 files changed, 68 insertions(+), 61 deletions(-)
arch/arm/boot/dts/rk3288-firefly.dtsi +17 -16
index 49ec20d..f219389 100644
@@ -63,22 +63,6 @@
 		clock-output-names = "ext_gmac";
 	};
 
-	io_domains: io-domains {
-		compatible = "rockchip,rk3288-io-voltage-domain";
-		rockchip,grf = <&grf>;
-
-		audio-supply = <&vcca_33>;
-		bb-supply = <&vcc_io>;
-		dvp-supply = <&dovdd_1v8>;
-		flash0-supply = <&vcc_flash>;
-		flash1-supply = <&vcc_lan>;
-		gpio30-supply = <&vcc_io>;
-		gpio1830-supply = <&vcc_io>;
-		lcdc-supply = <&vcc_io>;
-		sdcard-supply = <&vccio_sd>;
-		wifi-supply = <&vccio_wl>;
-	};
-
 	ir: ir-receiver {
 		compatible = "gpio-ir-receiver";
 		pinctrl-names = "default";
@@ -237,6 +221,23 @@
 	status = "ok";
 };
 
+&grf {
+	io_domains: io-domains {
+		compatible = "rockchip,rk3288-io-voltage-domain";
+
+		audio-supply = <&vcca_33>;
+		bb-supply = <&vcc_io>;
+		dvp-supply = <&dovdd_1v8>;
+		flash0-supply = <&vcc_flash>;
+		flash1-supply = <&vcc_lan>;
+		gpio30-supply = <&vcc_io>;
+		gpio1830-supply = <&vcc_io>;
+		lcdc-supply = <&vcc_io>;
+		sdcard-supply = <&vccio_sd>;
+		wifi-supply = <&vccio_wl>;
+	};
+};
+
 &hdmi {
 	ddc-i2c-bus = <&i2c5>;
 	status = "okay";
arch/arm/boot/dts/rk3288-popmetal.dts +18 -16
index 65c4756..4d434f7 100644
@@ -79,22 +79,6 @@
 		};
 	};
 
-	io_domains: io-domains {
-		compatible = "rockchip,rk3288-io-voltage-domain";
-		rockchip,grf = <&grf>;
-
-		audio-supply = <&vcca_33>;
-		bb-supply = <&vcc_io>;
-		dvp-supply = <&vcc18_dvp>;
-		flash0-supply = <&vcc_flash>;
-		flash1-supply = <&vcc_lan>;
-		gpio30-supply = <&vcc_io>;
-		gpio1830-supply = <&vcc_io>;
-		lcdc-supply = <&vcc_io>;
-		sdcard-supply = <&vccio_sd>;
-		wifi-supply = <&vccio_wl>;
-	};
-
 	ir: ir-receiver {
 		compatible = "gpio-ir-receiver";
 		gpios = <&gpio0 6 GPIO_ACTIVE_LOW>;
@@ -205,6 +189,24 @@
 	status = "ok";
 };
 
+&grf {
+	io_domains: io-domains {
+		compatible = "rockchip,rk3288-io-voltage-domain";
+		rockchip,grf = <&grf>;
+
+		audio-supply = <&vcca_33>;
+		bb-supply = <&vcc_io>;
+		dvp-supply = <&vcc18_dvp>;
+		flash0-supply = <&vcc_flash>;
+		flash1-supply = <&vcc_lan>;
+		gpio30-supply = <&vcc_io>;
+		gpio1830-supply = <&vcc_io>;
+		lcdc-supply = <&vcc_io>;
+		sdcard-supply = <&vccio_sd>;
+		wifi-supply = <&vccio_wl>;
+	};
+};
+
 &hdmi {
 	ddc-i2c-bus = <&i2c5>;
 	status = "okay";
arch/arm/boot/dts/rk3288-rock2-som.dtsi +18 -16
index e1ee9f9..8660b8a 100644
@@ -61,22 +61,6 @@
 		clock-output-names = "ext_gmac";
 	};
 
-	io_domains: io-domains {
-		compatible = "rockchip,rk3288-io-voltage-domain";
-		rockchip,grf = <&grf>;
-
-		audio-supply = <&vcc_io>;
-		bb-supply = <&vcc_io>;
-		dvp-supply = <&vcc_18>;
-		flash0-supply = <&vcc_flash>;
-		flash1-supply = <&vccio_pmu>;
-		gpio30-supply = <&vccio_pmu>;
-		gpio1830 = <&vcc_io>;
-		lcdc-supply = <&vcc_io>;
-		sdcard-supply = <&vccio_sd>;
-		wifi-supply = <&vcc_18>;
-	};
-
 	vcc_flash: flash-regulator {
 		compatible = "regulator-fixed";
 		regulator-name = "vcc_sys";
@@ -129,6 +113,24 @@
 	tx_delay = <0x30>;
 };
 
+&grf {
+	io_domains: io-domains {
+		compatible = "rockchip,rk3288-io-voltage-domain";
+		rockchip,grf = <&grf>;
+
+		audio-supply = <&vcc_io>;
+		bb-supply = <&vcc_io>;
+		dvp-supply = <&vcc_18>;
+		flash0-supply = <&vcc_flash>;
+		flash1-supply = <&vccio_pmu>;
+		gpio30-supply = <&vccio_pmu>;
+		gpio1830 = <&vcc_io>;
+		lcdc-supply = <&vcc_io>;
+		sdcard-supply = <&vccio_sd>;
+		wifi-supply = <&vcc_18>;
+	};
+};
+
 &i2c0 {
 	status = "okay";
 
arch/arm/boot/dts/rk3288-veyron.dtsi +15 -13
index 0a43e21..fd55697 100644
@@ -83,19 +83,6 @@
 		reset-gpios = <&gpio2 9 GPIO_ACTIVE_HIGH>;
 	};
 
-	io_domains: io-domains {
-		compatible = "rockchip,rk3288-io-voltage-domain";
-		rockchip,grf = <&grf>;
-
-		bb-supply = <&vcc33_io>;
-		dvp-supply = <&vcc_18>;
-		flash0-supply = <&vcc18_flashio>;
-		gpio1830-supply = <&vcc33_io>;
-		gpio30-supply = <&vcc33_io>;
-		lcdc-supply = <&vcc33_lcd>;
-		wifi-supply = <&vcc18_wl>;
-	};
-
 	sdio_pwrseq: sdio-pwrseq {
 		compatible = "mmc-pwrseq-simple";
 		clocks = <&rk808 RK808_CLKOUT1>;
@@ -159,6 +146,21 @@
 	pinctrl-0 = <&emmc_clk &emmc_cmd &emmc_bus8>;
 };
 
+&grf {
+	io_domains: io-domains {
+		compatible = "rockchip,rk3288-io-voltage-domain";
+		rockchip,grf = <&grf>;
+
+		bb-supply = <&vcc33_io>;
+		dvp-supply = <&vcc_18>;
+		flash0-supply = <&vcc18_flashio>;
+		gpio1830-supply = <&vcc33_io>;
+		gpio30-supply = <&vcc33_io>;
+		lcdc-supply = <&vcc33_lcd>;
+		wifi-supply = <&vcc18_wl>;
+	};
+};
+
 &hdmi {
 	ddc-i2c-bus = <&i2c5>;
 	status = "okay";
Signature · 1 line
2.6.4
author maintainer
#6 lore raw

PATCH 4/5 arm64: dts: rockchip: make rk3368 grf syscons simple-mfds as well

In reply to Heiko Stuebner

The general register files do contain a lot of separate functions and while some really are only registers with a lot of different 1-bit settings, there are also a lot of them containing some bigger function blocks. To be able to define these as sub-devices, make them simple-mfds.

---
 arch/arm64/boot/dts/rockchip/rk3368.dtsi | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/rockchip/rk3368.dtsi +2 -2
index 49d1191..6029310 100644
@@ -556,7 +556,7 @@
 	};
 
 	pmugrf: syscon at ff738000 {
-		compatible = "rockchip,rk3368-pmugrf", "syscon";
+		compatible = "rockchip,rk3368-pmugrf", "syscon", "simple-mfd";
 		reg = <0x0 0xff738000 0x0 0x1000>;
 	};
 
@@ -569,7 +569,7 @@
 	};
 
 	grf: syscon at ff770000 {
-		compatible = "rockchip,rk3368-grf", "syscon";
+		compatible = "rockchip,rk3368-grf", "syscon", "simple-mfd";
 		reg = <0x0 0xff770000 0x0 0x1000>;
 	};
 
Signature · 1 line
2.6.4
author maintainer
#7 lore raw

PATCH 5/5 arm64: dts: rockchip: add rk3368 iodomains

In reply to Heiko Stuebner

Add the supply-links according to the R88 schematics.

---
 arch/arm64/boot/dts/rockchip/rk3368-r88.dts | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
arch/arm64/boot/dts/rockchip/rk3368-r88.dts +22 -0
index 104cbee..e6e2a1f 100644
@@ -211,6 +211,18 @@
 	status = "ok";
 };
 
+&grf {
+	io-domains {
+		compatible = "rockchip,rk3368-io-voltage-domain";
+
+		audio-supply = <&vcc_io>;
+		gpio30-supply = <&vcc_io>;
+		gpio1830-supply = <&vcc_io>;
+		sdcard-supply = <&vccio_sd>;
+		wifi-supply = <&vccio_wl>;
+	};
+};
+
 &i2c0 {
 	status = "okay";
 
@@ -331,6 +343,16 @@
 	};
 };
 
+&pmugrf {
+	io-domains {
+		compatible = "rockchip,rk3368-pmu-io-voltage-domain";
+		rockchip,grf = <&pmugrf>;
+
+		pmu-supply = <&vcc_io>;
+		vop-supply = <&vcc_io>;
+	};
+};
+
 &saradc {
 	vref-supply = <&vcc_18>;
 	status = "okay";
Signature · 1 line
2.6.4