Skip to contentSkip to conversation

ARM64: dts: meson-gx: fix VPU init for non-vendor u-boot

PATCH In review Neil Armstrong 2 participants 6 messages Nov 20, 2017 – Dec 1, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

v2 cover ARM64: dts: meson-gx: fix VPU init for non-vendor u-boot

On the Amlogic Gx SoCs (GXBB, GXL & GXM), the VPU power domain is initialized by the vendor U-Boot code, but running mainline U-boot has been possible on these SoCs. But lacking such init made the system lock at kernel boot.

A PM Power Domain driver has been pushed at [1] to solve the main issue.

This patchset depends on the the following patchsets :
- [1] soc: amlogic: add support for Meson GX VPU Domains
- [2] reset: meson: add level reset support for GX SoC family
- [3] clk: meson: gxbb: Add VPU and VAPB clocks

Changes since v1 at [4] :
- Dropped hdmi-supply in hdmi node until 4.16
- set 5v regulator always-on for now

[1] https://lkml.kernel.org/r/1508228167-11753-1-git-send-email-narmstrong at baylibre.com
[2] https://lkml.kernel.org/r/1508167573-17396-1-git-send-email-narmstrong at baylibre.com
[3] https://lkml.kernel.org/r/1508168085-19032-1-git-send-email-narmstrong at baylibre.com
[4] https://lkml.kernel.org/r/1508228951-12384-1-git-send-email-narmstrong at baylibre.com

Neil Armstrong (4):
ARM64: dts: meson-gx: add VPU power domain
ARM64: dts: meson-gx: Add HDMI_5V regulator on selected boards
ARM64: dts: meson-gx: grow reset controller memory zone
ARM64: dts: odroid-c2: Add HDMI and CEC Nodes

 .../arm64/boot/dts/amlogic/meson-gx-p23x-q20x.dtsi | 12 ++++++
 arch/arm64/boot/dts/amlogic/meson-gx.dtsi          | 13 ++++++-
 .../arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts | 30 +++++++++++++++
 arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi        | 43 ++++++++++++++++++++++
 .../dts/amlogic/meson-gxl-s905x-libretech-cc.dts   | 12 ++++++
 .../boot/dts/amlogic/meson-gxl-s905x-p212.dtsi     | 12 ++++++
 arch/arm64/boot/dts/amlogic/meson-gxl.dtsi         | 43 ++++++++++++++++++++++
 .../boot/dts/amlogic/meson-gxm-khadas-vim2.dts     | 12 ++++++
 8 files changed, 176 insertions(+), 1 deletion(-)
Signature · 1 line
2.7.4
#1 lore raw

PATCH v2 1/4 ARM64: dts: meson-gx: add VPU power domain

This patch adds support for the VPU Power Domain nodes, and attaches the VPU power domain to the VPU node.

---
 arch/arm64/boot/dts/amlogic/meson-gx.dtsi   | 11 ++++++++
 arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi | 43 +++++++++++++++++++++++++++++
 arch/arm64/boot/dts/amlogic/meson-gxl.dtsi  | 43 +++++++++++++++++++++++++++++
 3 files changed, 97 insertions(+)
arch/arm64/boot/dts/amlogic/meson-gx.dtsi +11 -0
index ab7ce16..668d891 100644
@@ -377,6 +377,12 @@
 				compatible = "amlogic,meson-gx-ao-sysctrl", "syscon", "simple-mfd";
 				reg =  <0x0 0x0 0x0 0x100>;
 
+				pwrc_vpu: power-controller-vpu {
+					compatible = "amlogic,meson-gx-pwrc-vpu";
+					#power-domain-cells = <0>;
+					amlogic,hhi-sysctrl = <&sysctrl>;
+				};
+
 				clkc_AO: clock-controller {
 					compatible = "amlogic,meson-gx-aoclkc";
 					#clock-cells = <1>;
@@ -454,6 +460,11 @@
 			#size-cells = <2>;
 			ranges = <0x0 0x0 0x0 0xc883c000 0x0 0x2000>;
 
+			sysctrl: system-controller at 0 {
+				compatible = "amlogic,meson-gx-hhi-sysctrl", "syscon", "simple-mfd";
+				reg = <0 0 0 0x400>;
+			};
+
 			mailbox: mailbox at 404 {
 				compatible = "amlogic,meson-gx-mhu", "amlogic,meson-gxbb-mhu";
 				reg = <0 0x404 0 0x4c>;
arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi +43 -0

53 lines not on this page · raw message

arch/arm64/boot/dts/amlogic/meson-gxl.dtsi +43 -0

53 lines not on this page · raw message

Signature · 1 line
2.7.4
#2 lore raw

PATCH v2 2/4 ARM64: dts: meson-gx: Add HDMI_5V regulator on selected boards

In reply to Neil Armstrong

On reference boards and derivatives, the HDMI Logic is powered by an external 5V regulator.
This regulator was set by the Vendor U-Boot, add the regulator and set it always-on for now.

---
 arch/arm64/boot/dts/amlogic/meson-gx-p23x-q20x.dtsi          | 12 ++++++++++++
 arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc.dts | 12 ++++++++++++
 arch/arm64/boot/dts/amlogic/meson-gxl-s905x-p212.dtsi        | 12 ++++++++++++
 arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts        | 12 ++++++++++++
 4 files changed, 48 insertions(+)
arch/arm64/boot/dts/amlogic/meson-gx-p23x-q20x.dtsi +12 -0
index 7d4b95e..aeb6d21 100644
@@ -59,6 +59,18 @@
 		reg = <0x0 0x0 0x0 0x80000000>;
 	};
 
+	hdmi_5v: regulator-hdmi-5v {
+		compatible = "regulator-fixed";
+
+		regulator-name = "HDMI_5V";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+
+		gpio = <&gpio GPIOH_3 GPIO_ACTIVE_HIGH>;
+		enable-active-high;
+		regulator-always-on;
+	};
+
 	vddio_boot: regulator-vddio_boot {
 		compatible = "regulator-fixed";
 		regulator-name = "VDDIO_BOOT";
arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc.dts +12 -0
index dc9c3b8..9671f1e 100644
@@ -72,6 +72,18 @@
 		reg = <0x0 0x0 0x0 0x80000000>;
 	};
 
+	hdmi_5v: regulator-hdmi-5v {
+		compatible = "regulator-fixed";
+
+		regulator-name = "HDMI_5V";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+
+		gpio = <&gpio GPIOH_3 GPIO_ACTIVE_HIGH>;
+		enable-active-high;
+		regulator-always-on;
+	};
+
 	vcc_3v3: regulator-vcc_3v3 {
 		compatible = "regulator-fixed";
 		regulator-name = "VCC_3V3";
arch/arm64/boot/dts/amlogic/meson-gxl-s905x-p212.dtsi +12 -0
index ff09df1..7005068 100644
@@ -28,6 +28,18 @@
 		reg = <0x0 0x0 0x0 0x80000000>;
 	};
 
+	hdmi_5v: regulator-hdmi-5v {
+		compatible = "regulator-fixed";
+
+		regulator-name = "HDMI_5V";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+
+		gpio = <&gpio GPIOH_3 GPIO_ACTIVE_HIGH>;
+		enable-active-high;
+		regulator-always-on;
+	};
+
 	vddio_boot: regulator-vddio_boot {
 		compatible = "regulator-fixed";
 		regulator-name = "VDDIO_BOOT";
arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts +12 -0
index 34a41b2..d2595c0 100644
@@ -153,6 +153,18 @@
 		};
 	};
 
+	hdmi_5v: regulator-hdmi-5v {
+		compatible = "regulator-fixed";
+
+		regulator-name = "HDMI_5V";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+
+		gpio = <&gpio GPIOH_3 GPIO_ACTIVE_HIGH>;
+		enable-active-high;
+		regulator-always-on;
+	};
+
 	vcc_3v3: regulator-vcc_3v3 {
 		compatible = "regulator-fixed";
 		regulator-name = "VCC_3V3";
Signature · 1 line
2.7.4
#3 lore raw

PATCH v2 3/4 ARM64: dts: meson-gx: grow reset controller memory zone

In reply to Neil Armstrong

Now the Amlogic Meson GX SoCs datasheet documents all the Reset registers, grow the memory in the node to allow usage of the level registers.

---
 arch/arm64/boot/dts/amlogic/meson-gx.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/amlogic/meson-gx.dtsi +1 -1
index 668d891..7cdbf58 100644
@@ -229,7 +229,7 @@
 
 			reset: reset-controller at 4404 {
 				compatible = "amlogic,meson-gx-reset", "amlogic,meson-gxbb-reset";
-				reg = <0x0 0x04404 0x0 0x20>;
+				reg = <0x0 0x04404 0x0 0x9c>;
 				#reset-cells = <1>;
 			};
 
Signature · 1 line
2.7.4
#4 lore raw

PATCH v2 4/4 ARM64: dts: odroid-c2: Add HDMI and CEC Nodes

In reply to Neil Armstrong

Now the VPU Power Domain has been fixed while boothing from Mainline U-Boot, VPU and HDMI nodes can finally be added to the Odroid-C2 DTS.

---
 .../arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts | 30 ++++++++++++++++++++++
 1 file changed, 30 insertions(+)
arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts +30 -0
index f8d2214..d6d3af5 100644
@@ -135,6 +135,24 @@
 		compatible = "mmc-pwrseq-emmc";
 		reset-gpios = <&gpio BOOT_9 GPIO_ACTIVE_LOW>;
 	};
+
+	hdmi-connector {
+		compatible = "hdmi-connector";
+		type = "a";
+
+		port {
+			hdmi_connector_in: endpoint {
+				remote-endpoint = <&hdmi_tx_tmds_out>;
+			};
+		};
+	};
+};
+
+&cec_AO {
+	status = "okay";
+	pinctrl-0 = <&ao_cec_pins>;
+	pinctrl-names = "default";
+	hdmi-phandle = <&hdmi_tx>;
 };
 
 &ethmac {
@@ -179,6 +197,18 @@
 	};
 };
 
+&hdmi_tx {
+	status = "okay";
+	pinctrl-0 = <&hdmi_hpd_pins>, <&hdmi_i2c_pins>;
+	pinctrl-names = "default";
+};
+
+&hdmi_tx_tmds_port {
+	hdmi_tx_tmds_out: endpoint {
+		remote-endpoint = <&hdmi_connector_in>;
+	};
+};
+
 &i2c_A {
 	status = "okay";
 	pinctrl-0 = <&i2c_a_pins>;
Signature · 1 line
2.7.4
maintainer
#5 lore raw
In reply to Neil Armstrong
Quoted 6 lines · Neil Armstrong

On the Amlogic Gx SoCs (GXBB, GXL & GXM), the VPU power domain is initialized by the vendor U-Boot code, but running mainline U-boot has been possible on these SoCs. But lacking such init made the system lock at kernel boot.

A PM Power Domain driver has been pushed at [1] to solve the main issue.

Quoted 8 lines

This patchset depends on the the following patchsets :
- [1] soc: amlogic: add support for Meson GX VPU Domains
- [2] reset: meson: add level reset support for GX SoC family
- [3] clk: meson: gxbb: Add VPU and VAPB clocks

Changes since v1 at [4] :
- Dropped hdmi-supply in hdmi node until 4.16
- set 5v regulator always-on for now

v2 applied to v4.15/fixes,

Thanks,

Kevin