Skip to contentSkip to conversation

arm64: dts: meson-axg: enable SCPI

PATCH Applied Jerome Brunet 5 participants 12 messages Nov 8, 2018 – Nov 17, 2018

Subsystems (2)
lore
Share & tools
lore

Jerome Brunet

author reviewer
#0 lore raw

cover arm64: dts: meson-axg: enable SCPI

The goal of this patchset is to enable SCPI (dvfs and hwmon) the axg platform. The first patches in this series fix a few issues to acheive this.

Jerome Brunet (4):
arm64: dts: meson-axg: fix mailbox address
arm64: dts: meson-axg: correct sram shared mem unit-address
Documentation: bindings: Add missing Amlogic SCPI sensor bindings
arm64: dts: meson-axg: enable SCPI

 .../devicetree/bindings/arm/amlogic,scpi.txt  |  7 ++++
 arch/arm64/boot/dts/amlogic/meson-axg.dtsi    | 34 ++++++++++++++++---
 2 files changed, 37 insertions(+), 4 deletions(-)
Signature · 1 line
2.19.1
author reviewer
#1 lore raw

PATCH 1/4 arm64: dts: meson-axg: fix mailbox address

MHU mailbox address is wrong. Fixing it enables the mailboxes on the A113. These mailboxes are needed for SCPI

Fixes 9d59b708500f ("arm64: dts: meson-axg: add initial A113D SoC DT support")
---
 arch/arm64/boot/dts/amlogic/meson-axg.dtsi | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/amlogic/meson-axg.dtsi +2 -2
index 3cc0044d3468..ff8b3406aff6 100644
@@ -1067,9 +1067,9 @@
 			};
 		};
 
-		mailbox: mailbox at ff63dc00 {
+		mailbox: mailbox at ff63c404 {
 			compatible = "amlogic,meson-gx-mhu", "amlogic,meson-gxbb-mhu";
-			reg = <0 0xff63dc00 0 0x400>;
+			reg = <0 0xff63c404 0 0x4c>;
 			interrupts = <GIC_SPI 208 IRQ_TYPE_EDGE_RISING>,
 				     <GIC_SPI 209 IRQ_TYPE_EDGE_RISING>,
 				     <GIC_SPI 210 IRQ_TYPE_EDGE_RISING>;
Signature · 1 line
2.19.1
author reviewer
#3 lore raw

PATCH 2/4 arm64: dts: meson-axg: correct sram shared mem unit-address

In reply to Jerome Brunet

Correct the unit-address in the node name of the SRAM shared memory

---
 arch/arm64/boot/dts/amlogic/meson-axg.dtsi | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/amlogic/meson-axg.dtsi +2 -2
index ff8b3406aff6..b8893675e39c 100644
@@ -1659,12 +1659,12 @@
 			#size-cells = <1>;
 			ranges = <0 0x0 0xfffc0000 0x20000>;
 
-			cpu_scp_lpri: scp-shmem at 0 {
+			cpu_scp_lpri: scp-shmem at 13000 {
 				compatible = "amlogic,meson-axg-scp-shmem";
 				reg = <0x13000 0x400>;
 			};
 
-			cpu_scp_hpri: scp-shmem at 200 {
+			cpu_scp_hpri: scp-shmem at 13400 {
 				compatible = "amlogic,meson-axg-scp-shmem";
 				reg = <0x13400 0x400>;
 			};
Signature · 1 line
2.19.1
author reviewer
#5 lore raw

PATCH 3/4 Documentation: bindings: Add missing Amlogic SCPI sensor bindings

In reply to Jerome Brunet

amlogic,meson-gxbb-scpi-sensors is both the driver and DT but is not documented. Just add it to amlogic's scpi documentation

---
 Documentation/devicetree/bindings/arm/amlogic,scpi.txt | 7 +++++++
 1 file changed, 7 insertions(+)
Documentation/devicetree/bindings/arm/amlogic,scpi.txt +7 -0
index 7b9a861e9306..5ab59da052df 100644
@@ -17,4 +17,11 @@ Required sub-node properties:
 - compatible : should be "amlogic,meson-gxbb-scp-shmem" for SRAM based shared
 		memory on Amlogic GXBB SoC.
 
+Sensor bindings for the sensors based on SCPI Message Protocol
+--------------------------------------------------------------
+SCPI provides an API to access the various sensors on the SoC.
+
+Required properties:
+- compatible : should be "amlogic,meson-gxbb-scpi-sensors".
+
 [0] Documentation/devicetree/bindings/arm/arm,scpi.txt
Signature · 1 line
2.19.1
author reviewer
#9 lore raw

PATCH 4/4 arm64: dts: meson-axg: enable SCPI

In reply to Jerome Brunet

Enable SCPI on the axg platform, with cpu clock and hwmon (core temperature) support

---
 arch/arm64/boot/dts/amlogic/meson-axg.dtsi | 26 ++++++++++++++++++++++
 1 file changed, 26 insertions(+)
arch/arm64/boot/dts/amlogic/meson-axg.dtsi +26 -0
index b8893675e39c..5f512c91471e 100644
@@ -79,6 +79,7 @@
 			reg = <0x0 0x0>;
 			enable-method = "psci";
 			next-level-cache = <&l2>;
+			clocks = <&scpi_dvfs 0>;
 		};
 
 		cpu1: cpu at 1 {
@@ -87,6 +88,7 @@
 			reg = <0x0 0x1>;
 			enable-method = "psci";
 			next-level-cache = <&l2>;
+			clocks = <&scpi_dvfs 0>;
 		};
 
 		cpu2: cpu at 2 {
@@ -95,6 +97,7 @@
 			reg = <0x0 0x2>;
 			enable-method = "psci";
 			next-level-cache = <&l2>;
+			clocks = <&scpi_dvfs 0>;
 		};
 
 		cpu3: cpu at 3 {
@@ -103,6 +106,7 @@
 			reg = <0x0 0x3>;
 			enable-method = "psci";
 			next-level-cache = <&l2>;
+			clocks = <&scpi_dvfs 0>;
 		};
 
 		l2: l2-cache0 {
@@ -137,6 +141,28 @@
 		};
 	};
 
+	scpi {
+		compatible = "arm,scpi-pre-1.0";
+		mboxes = <&mailbox 1 &mailbox 2>;
+		shmem = <&cpu_scp_lpri &cpu_scp_hpri>;
+
+		scpi_clocks: clocks {
+			compatible = "arm,scpi-clocks";
+
+			scpi_dvfs: clock-controller {
+				compatible = "arm,scpi-dvfs-clocks";
+				#clock-cells = <1>;
+				clock-indices = <0>;
+				clock-output-names = "vcpu";
+			};
+		};
+
+		scpi_sensors: sensors {
+			compatible = "amlogic,meson-gxbb-scpi-sensors";
+			#thermal-sensor-cells = <1>;
+		};
+	};
+
 	soc {
 		compatible = "simple-bus";
 		#address-cells = <2>;
Signature · 1 line
2.19.1
#6 lore raw

Re: [PATCH 3/4] Documentation: bindings: Add missing Amlogic SCPI sensor bindings

In reply to Jerome Brunet
Quoted 13 lines · Jerome Brunet

amlogic,meson-gxbb-scpi-sensors is both the driver and DT but is not documented. Just add it to amlogic's scpi documentation

---
 Documentation/devicetree/bindings/arm/amlogic,scpi.txt | 7 +++++++
 1 file changed, 7 insertions(+)
Documentation/devicetree/bindings/arm/amlogic,scpi.txt +0 -0
index 7b9a861e9306..5ab59da052df 100644

Documentation/devicetree/bindings/arm/amlogic,scpi.txt Required sub-node properties: · line 26

Quoted 10 lines
Documentation/devicetree/bindings/arm/amlogic,scpi.txt +7 -0
@@ -17,4 +17,11 @@ Required sub-node properties:
 - compatible : should be "amlogic,meson-gxbb-scp-shmem" for SRAM based shared
 		memory on Amlogic GXBB SoC.
 
+Sensor bindings for the sensors based on SCPI Message Protocol
+--------------------------------------------------------------
+SCPI provides an API to access the various sensors on the SoC.
+
+Required properties:
+- compatible : should be "amlogic,meson-gxbb-scpi-sensors".
+

Not sure if it's worth mentioning the reason for being able to identify amlogic,meson-gxbb sensors from generic scpi ones. IIRC it was for the unit values of these sensors are different ? But I will leave that to DT or platform maintainers' taste.

--
Regards,
Sudeep

author reviewer
#7 lore raw

Re: [PATCH 3/4] Documentation: bindings: Add missing Amlogic SCPI sensor bindings

Quoted 19 lines · Sudeep Holla
Quoted 18 lines · Jerome Brunet

amlogic,meson-gxbb-scpi-sensors is both the driver and DT but is not documented. Just add it to amlogic's scpi documentation

---
 Documentation/devicetree/bindings/arm/amlogic,scpi.txt | 7 +++++++
 1 file changed, 7 insertions(+)
Documentation/devicetree/bindings/arm/amlogic,scpi.txt +0 -0
index 7b9a861e9306..5ab59da052df 100644
@@ -17,4 +17,11 @@ Required sub-node properties:
 - compatible : should be "amlogic,meson-gxbb-scp-shmem" for SRAM based

shared
memory on Amlogic GXBB SoC.

Quoted 12 lines

Documentation/devicetree/bindings/arm/amlogic,scpi.txt Required sub-node properties: · line 26

Quoted 7 lines
Documentation/devicetree/bindings/arm/amlogic,scpi.txt +7 -0
+Sensor bindings for the sensors based on SCPI Message Protocol
+--------------------------------------------------------------
+SCPI provides an API to access the various sensors on the SoC.
+
+Required properties:
+- compatible : should be "amlogic,meson-gxbb-scpi-sensors".
+

Not sure if it's worth mentioning the reason for being able to identify amlogic,meson-gxbb sensors from generic scpi ones. IIRC it was for the unit values of these sensors are different ? But I will leave that to DT or platform maintainers' taste.

Yes Sudeep, the unit are different.
If we probe on the generic one, it will "work" but the result is just not good.

BTW, the point of this patch is merely to remove an existing issue. The scpi driver and meson-gx.dtsi are both refering to an undocumented compatible.

Quoted 4 lines

--
Regards,
Sudeep

Reviewed-by on v1 1/4
#2 lore raw

Re: [PATCH 1/4] arm64: dts: meson-axg: fix mailbox address

In reply to Jerome Brunet
Quoted 16 lines · Jerome Brunet

MHU mailbox address is wrong. Fixing it enables the mailboxes on the A113. These mailboxes are needed for SCPI

Fixes 9d59b708500f ("arm64: dts: meson-axg: add initial A113D SoC DT support")
---
 arch/arm64/boot/dts/amlogic/meson-axg.dtsi | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/amlogic/meson-axg.dtsi +0 -0
index 3cc0044d3468..ff8b3406aff6 100644
@@ -1067,9 +1067,9 @@
 			};

arch/arm64/boot/dts/amlogic/meson-axg.dtsi line 1075

Quoted 10 lines
arch/arm64/boot/dts/amlogic/meson-axg.dtsi +2 -2
 		};
 
-		mailbox: mailbox at ff63dc00 {
+		mailbox: mailbox at ff63c404 {
 			compatible = "amlogic,meson-gx-mhu", "amlogic,meson-gxbb-mhu";
-			reg = <0 0xff63dc00 0 0x400>;
+			reg = <0 0xff63c404 0 0x4c>;
 			interrupts = <GIC_SPI 208 IRQ_TYPE_EDGE_RISING>,
 				     <GIC_SPI 209 IRQ_TYPE_EDGE_RISING>,
 				     <GIC_SPI 210 IRQ_TYPE_EDGE_RISING>;
Reviewed-by on v1 2/4
#4 lore raw

Re: [PATCH 2/4] arm64: dts: meson-axg: correct sram shared mem unit-address

In reply to Jerome Brunet
Quoted 17 lines · Jerome Brunet

Correct the unit-address in the node name of the SRAM shared memory

---
 arch/arm64/boot/dts/amlogic/meson-axg.dtsi | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/amlogic/meson-axg.dtsi +0 -1
index ff8b3406aff6..b8893675e39c 100644
@@ -1659,12 +1659,12 @@
 			#size-cells = <1>;
 			ranges = <0 0x0 0xfffc0000 0x20000>;
 
-			cpu_scp_lpri: scp-shmem at 0 {

arch/arm64/boot/dts/amlogic/meson-axg.dtsi line 1670

Quoted 10 lines
arch/arm64/boot/dts/amlogic/meson-axg.dtsi +2 -1
+			cpu_scp_lpri: scp-shmem at 13000 {
 				compatible = "amlogic,meson-axg-scp-shmem";
 				reg = <0x13000 0x400>;
 			};
 
-			cpu_scp_hpri: scp-shmem at 200 {
+			cpu_scp_hpri: scp-shmem at 13400 {
 				compatible = "amlogic,meson-axg-scp-shmem";
 				reg = <0x13400 0x400>;
 			};
Reviewed-by on v1 4/4
#10 lore raw
In reply to Jerome Brunet
Quoted 64 lines · Jerome Brunet

Enable SCPI on the axg platform, with cpu clock and hwmon (core temperature) support

---
 arch/arm64/boot/dts/amlogic/meson-axg.dtsi | 26 ++++++++++++++++++++++
 1 file changed, 26 insertions(+)
arch/arm64/boot/dts/amlogic/meson-axg.dtsi +19 -0
index b8893675e39c..5f512c91471e 100644
@@ -79,6 +79,7 @@
 			reg = <0x0 0x0>;
 			enable-method = "psci";
 			next-level-cache = <&l2>;
+			clocks = <&scpi_dvfs 0>;
 		};
 
 		cpu1: cpu at 1 {
@@ -87,6 +88,7 @@
 			reg = <0x0 0x1>;
 			enable-method = "psci";
 			next-level-cache = <&l2>;
+			clocks = <&scpi_dvfs 0>;
 		};
 
 		cpu2: cpu at 2 {
@@ -95,6 +97,7 @@
 			reg = <0x0 0x2>;
 			enable-method = "psci";
 			next-level-cache = <&l2>;
+			clocks = <&scpi_dvfs 0>;
 		};
 
 		cpu3: cpu at 3 {
@@ -103,6 +106,7 @@
 			reg = <0x0 0x3>;
 			enable-method = "psci";
 			next-level-cache = <&l2>;
+			clocks = <&scpi_dvfs 0>;
 		};
 
 		l2: l2-cache0 {
@@ -137,6 +141,28 @@
 		};
 	};
 
+	scpi {
+		compatible = "arm,scpi-pre-1.0";
+		mboxes = <&mailbox 1 &mailbox 2>;
+		shmem = <&cpu_scp_lpri &cpu_scp_hpri>;
+
+		scpi_clocks: clocks {
+			compatible = "arm,scpi-clocks";
+
+			scpi_dvfs: clock-controller {
+				compatible = "arm,scpi-dvfs-clocks";
+				#clock-cells = <1>;
+				clock-indices = <0>;
+				clock-output-names = "vcpu";
+			};
+		};

arch/arm64/boot/dts/amlogic/meson-axg.dtsi line 168

Quoted 10 lines
arch/arm64/boot/dts/amlogic/meson-axg.dtsi +7 -0
+
+		scpi_sensors: sensors {
+			compatible = "amlogic,meson-gxbb-scpi-sensors";
+			#thermal-sensor-cells = <1>;
+		};
+	};
+
 	soc {
 		compatible = "simple-bus";
 		#address-cells = <2>;
maintainer Applied
#11 lore raw
In reply to Jerome Brunet
Quoted 3 lines · Jerome Brunet

The goal of this patchset is to enable SCPI (dvfs and hwmon) the axg platform. The first patches in this series fix a few issues to acheive this.

Queued for v4.21 (branch: v4.21/dt64)

Kevin

maintainer Reviewed-by on v1 3/4
#8 lore raw

Re: [PATCH 3/4] Documentation: bindings: Add missing Amlogic SCPI sensor bindings

In reply to Jerome Brunet
Quoted 8 lines · Jerome Brunet

amlogic,meson-gxbb-scpi-sensors is both the driver and DT but is not documented. Just add it to amlogic's scpi documentation

---
 Documentation/devicetree/bindings/arm/amlogic,scpi.txt | 7 +++++++
 1 file changed, 7 insertions(+)