Skip to contentSkip to conversation

Update arm64 ZTE zx296718 device trees

PATCH New Shawn Guo 1 participant 11 messages Aug 9, 2017 Device tree bindings

lore
Share & tools
lore

Shawn Guo

author
#0 lore raw

cover Update arm64 ZTE zx296718 device trees

From: Shawn Guo <[email protected]>

The series updates arm64 ZTE zx296718 device trees with new devices and a new zx296718-pcbox board support.

Shawn Guo (10):
arm64: dts: zx296718: add VGA device support
arm64: dts: zx296718: add I2S and I2C audio codec
arm64: dts: zx296718: add pinctrl and gpio devices
arm64: dts: zx296718: set a better parent clock for I2S0
arm64: dts: zx296718: add voltage data into OPP table
arm64: dts: zx296718: add PWM device support
arm64: dts: zx296718: add irdec device for remote control
arm64: dts: zx296718-evb: use audio-graph-card for HDMI audio
arm64: dts: zx296718-evb: add I2S sound card support
arm64: dts: zte: add initial zx296718-pcbox board support

 arch/arm64/boot/dts/zte/Makefile           |   1 +
 arch/arm64/boot/dts/zte/zx296718-evb.dts   |  68 ++++++++++--
 arch/arm64/boot/dts/zte/zx296718-pcbox.dts | 143 ++++++++++++++++++++++++
 arch/arm64/boot/dts/zte/zx296718.dtsi      | 169 +++++++++++++++++++++++++++++
 4 files changed, 373 insertions(+), 8 deletions(-)
 create mode 100644 arch/arm64/boot/dts/zte/zx296718-pcbox.dts
Signature · 1 line
1.9.1
author
#1 lore raw

PATCH 1/10 arm64: dts: zx296718: add VGA device support

From: Shawn Guo <[email protected]>

It adds VGA device in zx296718.dtsi, so that boards with VGA connector can enable the support by changing 'status' in board DTS file.

---
 arch/arm64/boot/dts/zte/zx296718.dtsi | 10 ++++++++++
 1 file changed, 10 insertions(+)
arch/arm64/boot/dts/zte/zx296718.dtsi +10 -0
index 07368ab1e5e9..fdb1a57867ac 100644
@@ -387,6 +387,16 @@
 					      "main_wclk", "aux_wclk";
 			};
 
+			vga: vga at 8000 {
+				compatible = "zte,zx296718-vga";
+				reg = <0x8000 0x1000>;
+				interrupts = <GIC_SPI 86 IRQ_TYPE_LEVEL_HIGH>;
+				clocks = <&topcrm VGA_I2C_WCLK>;
+				clock-names = "i2c_wclk";
+				zte,vga-power-control = <&sysctrl 0x170 0xe0>;
+				status = "disabled";
+			};
+
 			hdmi: hdmi at c000 {
 				compatible = "zte,zx296718-hdmi";
 				reg = <0xc000 0x4000>;
Signature · 1 line
1.9.1
author
#2 lore raw

PATCH 2/10 arm64: dts: zx296718: add I2S and I2C audio codec

In reply to Shawn Guo

From: Shawn Guo <[email protected]>

It adds I2S and I2C audio codec devices for zx296718 SoC support.

---
 arch/arm64/boot/dts/zte/zx296718.dtsi | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)
arch/arm64/boot/dts/zte/zx296718.dtsi +30 -0
index fdb1a57867ac..37eb93a39c92 100644
@@ -455,6 +455,36 @@
 			#clock-cells = <1>;
 		};
 
+		i2s0: i2s at 1482000 {
+			compatible = "zte,zx296718-i2s", "zte,zx296702-i2s";
+			reg = <0x01482000 0x1000>;
+			clocks = <&audiocrm AUDIO_I2S0_WCLK>,
+				 <&audiocrm AUDIO_I2S0_PCLK>;
+			clock-names = "wclk", "pclk";
+			interrupts = <GIC_SPI 60 IRQ_TYPE_LEVEL_HIGH>;
+			dmas = <&dma 22>, <&dma 23>;
+			dma-names = "tx", "rx";
+			#sound-dai-cells = <0>;
+			status = "disabled";
+		};
+
+		i2c0: i2c at 1486000 {
+			compatible = "zte,zx296718-i2c";
+			reg = <0x01486000 0x1000>;
+			interrupts = <GIC_SPI 35 IRQ_TYPE_LEVEL_HIGH>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			clocks = <&audiocrm AUDIO_I2C0_WCLK>;
+			clock-frequency = <1600000>;
+			status = "disabled";
+
+			aud96p22: codec at 22 {
+				compatible = "zte,zx-aud96p22";
+				#sound-dai-cells = <0>;
+				reg = <0x22>;
+			};
+		};
+
 		spdif0: spdif at 1488000 {
 			compatible = "zte,zx296702-spdif";
 			reg = <0x1488000 0x1000>;
Signature · 1 line
1.9.1
author
#3 lore raw

PATCH 3/10 arm64: dts: zx296718: add pinctrl and gpio devices

In reply to Shawn Guo

From: Shawn Guo <[email protected]>

It adds pinctrl and gpio devices for zx296718 SoC support.

---
 arch/arm64/boot/dts/zte/zx296718.dtsi | 105 ++++++++++++++++++++++++++++++++++
 1 file changed, 105 insertions(+)
arch/arm64/boot/dts/zte/zx296718.dtsi +105 -0
index 37eb93a39c92..53bd504b4400 100644
@@ -53,6 +53,13 @@
 	interrupt-parent = <&gic>;
 
 	aliases {
+		gpio0 = &bgpio0;
+		gpio1 = &bgpio1;
+		gpio2 = &bgpio2;
+		gpio3 = &bgpio3;
+		gpio4 = &bgpio4;
+		gpio5 = &bgpio5;
+		gpio6 = &bgpio6;
 		serial0 = &uart0;
 	};
 
@@ -288,6 +295,11 @@
 			reg = <0x116000 0x1000>;
 		};
 
+		iocfg: pin-controller at 119000 {
+			compatible = "zte,zx296718-iocfg";
+			reg = <0x119000 0x1000>;
+		};
+
 		uart0: uart at 11f000 {
 			compatible = "arm,pl011", "arm,primecell";
 			arm,primecell-periphid = <0x001feffe>;
@@ -360,6 +372,93 @@
 			#clock-cells = <1>;
 		};
 
+		bgpio0: gpio at 142d000 {
+			compatible = "zte,zx296718-gpio", "zte,zx296702-gpio";
+			reg = <0x142d000 0x40>;
+			gpio-controller;
+			#gpio-cells = <2>;
+			gpio-ranges = <&pmm 0 48 16>;
+			interrupts = <GIC_SPI 49 IRQ_TYPE_LEVEL_HIGH>;
+			interrupt-parent = <&gic>;
+			interrupt-controller;
+			#interrupt-cells = <2>;
+		};
+
+		bgpio1: gpio at 142d040 {
+			compatible = "zte,zx296718-gpio", "zte,zx296702-gpio";
+			reg = <0x142d040 0x40>;
+			gpio-controller;
+			#gpio-cells = <2>;
+			gpio-ranges = <&pmm 0 80 16>;
+			interrupts = <GIC_SPI 50 IRQ_TYPE_LEVEL_HIGH>;
+			interrupt-parent = <&gic>;
+			interrupt-controller;
+			#interrupt-cells = <2>;
+		};
+
+		bgpio2: gpio at 142d080 {
+			compatible = "zte,zx296718-gpio", "zte,zx296702-gpio";
+			reg = <0x142d080 0x40>;
+			gpio-controller;
+			#gpio-cells = <2>;
+			gpio-ranges = <&pmm 0 80 3
+				       &pmm 3 32 4
+				       &pmm 7 83 9>;
+			interrupts = <GIC_SPI 51 IRQ_TYPE_LEVEL_HIGH>;
+			interrupt-parent = <&gic>;
+			interrupt-controller;
+			#interrupt-cells = <2>;
+		};
+
+		bgpio3: gpio at 142d0c0 {
+			compatible = "zte,zx296718-gpio", "zte,zx296702-gpio";
+			reg = <0x142d0c0 0x40>;
+			gpio-controller;
+			#gpio-cells = <2>;
+			gpio-ranges = <&pmm 0 92 16>;
+			interrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>;
+			interrupt-parent = <&gic>;
+			interrupt-controller;
+			#interrupt-cells = <2>;
+		};
+
+		bgpio4: gpio at 142d100 {
+			compatible = "zte,zx296718-gpio", "zte,zx296702-gpio";
+			reg = <0x142d100 0x40>;
+			gpio-controller;
+			#gpio-cells = <2>;
+			gpio-ranges = <&pmm 0 108 12
+				       &pmm 12 121 4>;
+			interrupts = <GIC_SPI 53 IRQ_TYPE_LEVEL_HIGH>;
+			interrupt-parent = <&gic>;
+			interrupt-controller;
+			#interrupt-cells = <2>;
+		};
+
+		bgpio5: gpio at 142d140 {
+			compatible = "zte,zx296718-gpio", "zte,zx296702-gpio";
+			reg = <0x142d140 0x40>;
+			gpio-controller;
+			#gpio-cells = <2>;
+			gpio-ranges = <&pmm 0 125 16>;
+			interrupts = <GIC_SPI 54 IRQ_TYPE_LEVEL_HIGH>;
+			interrupt-parent = <&gic>;
+			interrupt-controller;
+			#interrupt-cells = <2>;
+		};
+
+		bgpio6: gpio at 142d180 {
+			compatible = "zte,zx296718-gpio", "zte,zx296702-gpio";
+			reg = <0x142d180 0x40>;
+			gpio-controller;
+			#gpio-cells = <2>;
+			gpio-ranges = <&pmm 0 141 2>;
+			interrupts = <GIC_SPI 55 IRQ_TYPE_LEVEL_HIGH>;
+			interrupt-parent = <&gic>;
+			interrupt-controller;
+			#interrupt-cells = <2>;
+		};
+
 		lsp1crm: clock-controller at 1430000 {
 			compatible = "zte,zx296718-lsp1crm";
 			reg = <0x01430000 0x1000>;
@@ -423,6 +522,12 @@
 			#clock-cells = <1>;
 		};
 
+		pmm: pin-controller at 1462000 {
+			compatible = "zte,zx296718-pmm";
+			reg = <0x1462000 0x1000>;
+			zte,auxiliary-controller = <&iocfg>;
+		};
+
 		sysctrl: sysctrl at 1463000 {
 			compatible = "zte,zx296718-sysctrl", "syscon";
 			reg = <0x1463000 0x1000>;
Signature · 1 line
1.9.1
author
#4 lore raw

PATCH 4/10 arm64: dts: zx296718: set a better parent clock for I2S0

In reply to Shawn Guo

From: Shawn Guo <[email protected]>

The default I2S0 parent clock AUDIO_24M can not be divided into required sample rate in some cases, for example when 48KHz is needed. Change the parent clock to AUDIO_99M which works for most sample rates.

---
 arch/arm64/boot/dts/zte/zx296718.dtsi | 2 ++
 1 file changed, 2 insertions(+)
arch/arm64/boot/dts/zte/zx296718.dtsi +2 -0
index 53bd504b4400..507bc39be96b 100644
@@ -566,6 +566,8 @@
 			clocks = <&audiocrm AUDIO_I2S0_WCLK>,
 				 <&audiocrm AUDIO_I2S0_PCLK>;
 			clock-names = "wclk", "pclk";
+			assigned-clocks = <&audiocrm I2S0_WCLK_MUX>;
+			assigned-clock-parents = <&topcrm AUDIO_99M>;
 			interrupts = <GIC_SPI 60 IRQ_TYPE_LEVEL_HIGH>;
 			dmas = <&dma 22>, <&dma 23>;
 			dma-names = "tx", "rx";
Signature · 1 line
1.9.1
author
#5 lore raw

PATCH 5/10 arm64: dts: zx296718: add voltage data into OPP table

In reply to Shawn Guo

From: Shawn Guo <[email protected]>

We will enable PWM device to control voltage through pwm-regulator support. So let's add voltage data into OPP table.

---
 arch/arm64/boot/dts/zte/zx296718.dtsi | 5 +++++
 1 file changed, 5 insertions(+)
arch/arm64/boot/dts/zte/zx296718.dtsi +5 -0
index 507bc39be96b..74c37e443627 100644
@@ -127,26 +127,31 @@
 
 		opp-500000000 {
 			opp-hz = /bits/ 64 <500000000>;
+			opp-microvolt = <866000>;
 			clock-latency-ns = <500000>;
 		};
 
 		opp-648000000 {
 			opp-hz = /bits/ 64 <648000000>;
+			opp-microvolt = <866000>;
 			clock-latency-ns = <500000>;
 		};
 
 		opp-800000000 {
 			opp-hz = /bits/ 64 <800000000>;
+			opp-microvolt = <888000>;
 			clock-latency-ns = <500000>;
 		};
 
 		opp-1000000000 {
 			opp-hz = /bits/ 64 <1000000000>;
+			opp-microvolt = <898000>;
 			clock-latency-ns = <500000>;
 		};
 
 		opp-1188000000 {
 			opp-hz = /bits/ 64 <1188000000>;
+			opp-microvolt = <1015000>;
 			clock-latency-ns = <500000>;
 		};
 	};
Signature · 1 line
1.9.1
author
#6 lore raw

PATCH 6/10 arm64: dts: zx296718: add PWM device support

In reply to Shawn Guo

From: Shawn Guo <[email protected]>

It adds PWM device support which will be used to control voltage of core supply on some boards.

---
 arch/arm64/boot/dts/zte/zx296718.dtsi | 10 ++++++++++
 1 file changed, 10 insertions(+)
arch/arm64/boot/dts/zte/zx296718.dtsi +10 -0
index 74c37e443627..413de88b01db 100644
@@ -470,6 +470,16 @@
 			#clock-cells = <1>;
 		};
 
+		pwm: pwm at 1439000 {
+			compatible = "zte,zx296718-pwm";
+			reg = <0x1439000 0x1000>;
+			clocks = <&lsp1crm LSP1_PWM_PCLK>,
+				 <&lsp1crm LSP1_PWM_WCLK>;
+			clock-names = "pclk", "wclk";
+			#pwm-cells = <3>;
+			status = "disabled";
+		};
+
 		vou: vou at 1440000 {
 			compatible = "zte,zx296718-vou";
 			#address-cells = <1>;
Signature · 1 line
1.9.1
author
#7 lore raw

PATCH 7/10 arm64: dts: zx296718: add irdec device for remote control

In reply to Shawn Guo

From: Shawn Guo <[email protected]>

Add irdec device for remote control support.

---
 arch/arm64/boot/dts/zte/zx296718.dtsi | 7 +++++++
 1 file changed, 7 insertions(+)
arch/arm64/boot/dts/zte/zx296718.dtsi +7 -0
index 413de88b01db..d984da2b1143 100644
@@ -295,6 +295,13 @@
 		compatible = "simple-bus";
 		ranges;
 
+		irdec: ir-decoder at 111000 {
+			compatible = "zte,zx296718-irdec";
+			reg = <0x111000 0x1000>;
+			interrupts = <GIC_SPI 111 IRQ_TYPE_LEVEL_HIGH>;
+			status = "disabled";
+		};
+
 		aon_sysctrl: aon-sysctrl at 116000 {
 			compatible = "zte,zx296718-aon-sysctrl", "syscon";
 			reg = <0x116000 0x1000>;
Signature · 1 line
1.9.1
author
#8 lore raw

PATCH 8/10 arm64: dts: zx296718-evb: use audio-graph-card for HDMI audio

In reply to Shawn Guo

From: Shawn Guo <[email protected]>

Instead of simple-audio-card, audio-graph-card is recommended for audio bindings. Let's change to it, so that the HDMI/SPDIF audio card can align with the new I2S/Codec card which will be added later.

---
 arch/arm64/boot/dts/zte/zx296718-evb.dts | 26 +++++++++++++++-----------
 1 file changed, 15 insertions(+), 11 deletions(-)
arch/arm64/boot/dts/zte/zx296718-evb.dts +15 -11
index bb900d2bbcfb..d34d4cae38cd 100644
@@ -57,17 +57,9 @@
 		reg = <0x40000000 0x40000000>;
 	};
 
-	sound0 {
-		compatible = "simple-audio-card";
-		simple-audio-card,name = "zx_snd_spdif0";
-
-		simple-audio-card,cpu {
-			sound-dai = <&spdif0>;
-		};
-
-		simple-audio-card,codec {
-			sound-dai = <&hdmi>;
-		};
+	sound-spdif0 {
+		compatible = "audio-graph-card";
+		dais = <&spdif0_port>;
 	};
 };
 
@@ -77,6 +69,12 @@
 
 &hdmi {
 	status = "okay";
+
+	port {
+		hdmi_endpoint: endpoint {
+			remote-endpoint = <&spdif0_endpoint>;
+		};
+	};
 };
 
 &sd1 {
@@ -85,6 +83,12 @@
 
 &spdif0 {
 	status = "okay";
+
+	spdif0_port: port {
+		spdif0_endpoint: endpoint {
+			remote-endpoint = <&hdmi_endpoint>;
+		};
+	};
 };
 
 &uart0 {
Signature · 1 line
1.9.1
author
#9 lore raw

PATCH 9/10 arm64: dts: zx296718-evb: add I2S sound card support

In reply to Shawn Guo

From: Shawn Guo <[email protected]>

It enables the I2S sound card support, which is used to drive audio through aud96p22 codec in case of TV output.

---
 arch/arm64/boot/dts/zte/zx296718-evb.dts | 48 ++++++++++++++++++++++++++++++++
 1 file changed, 48 insertions(+)
arch/arm64/boot/dts/zte/zx296718-evb.dts +48 -0
index d34d4cae38cd..cb2519ecd724 100644
@@ -61,6 +61,26 @@
 		compatible = "audio-graph-card";
 		dais = <&spdif0_port>;
 	};
+
+	sound-i2s0 {
+		compatible = "audio-graph-card";
+		dais = <&i2s0_port>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&amplifier_pins>;
+		pa-gpios = <&bgpio4 0 GPIO_ACTIVE_HIGH>;
+		widgets = "Line", "Line Out Jack";
+		routing = "Amplifier", "LINEOUTL",
+			  "Amplifier", "LINEOUTR",
+			  "Line Out Jack", "Amplifier";
+	};
+};
+
+&aud96p22 {
+	port {
+		aud96p22_endpoint: endpoint {
+			remote-endpoint = <&i2s0_endpoint>;
+		};
+	};
 };
 
 &emmc {
@@ -77,6 +97,30 @@
 	};
 };
 
+&i2c0 {
+	status = "okay";
+};
+
+&i2s0 {
+	status = "okay";
+
+	i2s0_port: port {
+		i2s0_endpoint: endpoint {
+			remote-endpoint = <&aud96p22_endpoint>;
+			dai-format = "i2s";
+			frame-master;
+			bitclock-master;
+		};
+	};
+};
+
+&pmm {
+	amplifier_pins: amplifier {
+		pins = "TSI3_DATA";
+		function = "BGPIO";
+	};
+};
+
 &sd1 {
 	status = "okay";
 };
@@ -91,6 +135,10 @@
 	};
 };
 
+&tvenc {
+	status = "okay";
+};
+
 &uart0 {
 	status = "okay";
 };
Signature · 1 line
1.9.1
author
#10 lore raw

PATCH 10/10 arm64: dts: zte: add initial zx296718-pcbox board support

In reply to Shawn Guo

From: Shawn Guo <[email protected]>

It adds the initial zx296718-pcbox board support with devices like storage, audio and VGA output enabled.

---
 arch/arm64/boot/dts/zte/Makefile           |   1 +
 arch/arm64/boot/dts/zte/zx296718-pcbox.dts | 143 +++++++++++++++++++++++++++++
 2 files changed, 144 insertions(+)
 create mode 100644 arch/arm64/boot/dts/zte/zx296718-pcbox.dts
arch/arm64/boot/dts/zte/Makefile +1 -0
index 667806620f59..d86c4def6bc9 100644
@@ -1,4 +1,5 @@
 dtb-$(CONFIG_ARCH_ZX) += zx296718-evb.dtb
+dtb-$(CONFIG_ARCH_ZX) += zx296718-pcbox.dtb
 
 always		:= $(dtb-y)
 subdir-y	:= $(dts-dirs)
arch/arm64/boot/dts/zte/zx296718-pcbox.dts new file +143 -0

143 lines not on this page · raw message

Signature · 1 line
1.9.1