2018-11-08 13:56:01

by Jerome Brunet

[permalink] [raw]
Subject: [PATCH 0/4] 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(-)

--
2.19.1



2018-11-08 13:54:48

by Jerome Brunet

[permalink] [raw]
Subject: [PATCH 4/4] arm64: dts: meson-axg: enable SCPI

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

Signed-off-by: Jerome Brunet <[email protected]>
---
arch/arm64/boot/dts/amlogic/meson-axg.dtsi | 26 ++++++++++++++++++++++
1 file changed, 26 insertions(+)

diff --git a/arch/arm64/boot/dts/amlogic/meson-axg.dtsi b/arch/arm64/boot/dts/amlogic/meson-axg.dtsi
index b8893675e39c..5f512c91471e 100644
--- a/arch/arm64/boot/dts/amlogic/meson-axg.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-axg.dtsi
@@ -79,6 +79,7 @@
reg = <0x0 0x0>;
enable-method = "psci";
next-level-cache = <&l2>;
+ clocks = <&scpi_dvfs 0>;
};

cpu1: cpu@1 {
@@ -87,6 +88,7 @@
reg = <0x0 0x1>;
enable-method = "psci";
next-level-cache = <&l2>;
+ clocks = <&scpi_dvfs 0>;
};

cpu2: cpu@2 {
@@ -95,6 +97,7 @@
reg = <0x0 0x2>;
enable-method = "psci";
next-level-cache = <&l2>;
+ clocks = <&scpi_dvfs 0>;
};

cpu3: cpu@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>;
--
2.19.1


2018-11-08 13:55:02

by Jerome Brunet

[permalink] [raw]
Subject: [PATCH 3/4] Documentation: bindings: Add missing Amlogic SCPI sensor bindings

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

Signed-off-by: Jerome Brunet <[email protected]>
---
Documentation/devicetree/bindings/arm/amlogic,scpi.txt | 7 +++++++
1 file changed, 7 insertions(+)

diff --git a/Documentation/devicetree/bindings/arm/amlogic,scpi.txt b/Documentation/devicetree/bindings/arm/amlogic,scpi.txt
index 7b9a861e9306..5ab59da052df 100644
--- a/Documentation/devicetree/bindings/arm/amlogic,scpi.txt
+++ b/Documentation/devicetree/bindings/arm/amlogic,scpi.txt
@@ -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
--
2.19.1


2018-11-08 13:55:08

by Jerome Brunet

[permalink] [raw]
Subject: [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")
Signed-off-by: Jerome Brunet <[email protected]>
---
arch/arm64/boot/dts/amlogic/meson-axg.dtsi | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/boot/dts/amlogic/meson-axg.dtsi b/arch/arm64/boot/dts/amlogic/meson-axg.dtsi
index 3cc0044d3468..ff8b3406aff6 100644
--- a/arch/arm64/boot/dts/amlogic/meson-axg.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-axg.dtsi
@@ -1067,9 +1067,9 @@
};
};

- mailbox: mailbox@ff63dc00 {
+ mailbox: mailbox@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>;
--
2.19.1


2018-11-08 13:56:37

by Jerome Brunet

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

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

Signed-off-by: Jerome Brunet <[email protected]>
---
arch/arm64/boot/dts/amlogic/meson-axg.dtsi | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/boot/dts/amlogic/meson-axg.dtsi b/arch/arm64/boot/dts/amlogic/meson-axg.dtsi
index ff8b3406aff6..b8893675e39c 100644
--- a/arch/arm64/boot/dts/amlogic/meson-axg.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-axg.dtsi
@@ -1659,12 +1659,12 @@
#size-cells = <1>;
ranges = <0 0x0 0xfffc0000 0x20000>;

- cpu_scp_lpri: scp-shmem@0 {
+ cpu_scp_lpri: scp-shmem@13000 {
compatible = "amlogic,meson-axg-scp-shmem";
reg = <0x13000 0x400>;
};

- cpu_scp_hpri: scp-shmem@200 {
+ cpu_scp_hpri: scp-shmem@13400 {
compatible = "amlogic,meson-axg-scp-shmem";
reg = <0x13400 0x400>;
};
--
2.19.1


2018-11-08 16:06:17

by Sudeep Holla

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

On Thu, Nov 08, 2018 at 02:53:51PM +0100, Jerome Brunet wrote:
> amlogic,meson-gxbb-scpi-sensors is both the driver and DT but is not
> documented. Just add it to amlogic's scpi documentation
>
> Signed-off-by: Jerome Brunet <[email protected]>
> ---
> Documentation/devicetree/bindings/arm/amlogic,scpi.txt | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/arm/amlogic,scpi.txt b/Documentation/devicetree/bindings/arm/amlogic,scpi.txt
> index 7b9a861e9306..5ab59da052df 100644
> --- a/Documentation/devicetree/bindings/arm/amlogic,scpi.txt
> +++ b/Documentation/devicetree/bindings/arm/amlogic,scpi.txt
> @@ -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

2018-11-08 16:30:47

by Jerome Brunet

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

On Thu, 2018-11-08 at 16:04 +0000, Sudeep Holla wrote:
> On Thu, Nov 08, 2018 at 02:53:51PM +0100, Jerome Brunet wrote:
> > amlogic,meson-gxbb-scpi-sensors is both the driver and DT but is not
> > documented. Just add it to amlogic's scpi documentation
> >
> > Signed-off-by: Jerome Brunet <[email protected]>
> > ---
> > Documentation/devicetree/bindings/arm/amlogic,scpi.txt | 7 +++++++
> > 1 file changed, 7 insertions(+)
> >
> > diff --git a/Documentation/devicetree/bindings/arm/amlogic,scpi.txt
> > b/Documentation/devicetree/bindings/arm/amlogic,scpi.txt
> > index 7b9a861e9306..5ab59da052df 100644
> > --- a/Documentation/devicetree/bindings/arm/amlogic,scpi.txt
> > +++ b/Documentation/devicetree/bindings/arm/amlogic,scpi.txt
> > @@ -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.

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.

>
> --
> Regards,
> Sudeep



2018-11-09 09:39:00

by Neil Armstrong

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

On 08/11/2018 14:53, Jerome Brunet wrote:
> 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")
> Signed-off-by: Jerome Brunet <[email protected]>
> ---
> arch/arm64/boot/dts/amlogic/meson-axg.dtsi | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm64/boot/dts/amlogic/meson-axg.dtsi b/arch/arm64/boot/dts/amlogic/meson-axg.dtsi
> index 3cc0044d3468..ff8b3406aff6 100644
> --- a/arch/arm64/boot/dts/amlogic/meson-axg.dtsi
> +++ b/arch/arm64/boot/dts/amlogic/meson-axg.dtsi
> @@ -1067,9 +1067,9 @@
> };
> };
>
> - mailbox: mailbox@ff63dc00 {
> + mailbox: mailbox@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: Neil Armstrong <[email protected]>

2018-11-09 09:40:45

by Neil Armstrong

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

On 08/11/2018 14:53, Jerome Brunet wrote:
> Correct the unit-address in the node name of the SRAM shared memory
>
> Signed-off-by: Jerome Brunet <[email protected]>
> ---
> arch/arm64/boot/dts/amlogic/meson-axg.dtsi | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm64/boot/dts/amlogic/meson-axg.dtsi b/arch/arm64/boot/dts/amlogic/meson-axg.dtsi
> index ff8b3406aff6..b8893675e39c 100644
> --- a/arch/arm64/boot/dts/amlogic/meson-axg.dtsi
> +++ b/arch/arm64/boot/dts/amlogic/meson-axg.dtsi
> @@ -1659,12 +1659,12 @@
> #size-cells = <1>;
> ranges = <0 0x0 0xfffc0000 0x20000>;
>
> - cpu_scp_lpri: scp-shmem@0 {
> + cpu_scp_lpri: scp-shmem@13000 {
> compatible = "amlogic,meson-axg-scp-shmem";
> reg = <0x13000 0x400>;
> };
>
> - cpu_scp_hpri: scp-shmem@200 {
> + cpu_scp_hpri: scp-shmem@13400 {
> compatible = "amlogic,meson-axg-scp-shmem";
> reg = <0x13400 0x400>;
> };
>

Reviewed-by: Neil Armstrong <[email protected]>

2018-11-09 09:41:40

by Neil Armstrong

[permalink] [raw]
Subject: Re: [PATCH 4/4] arm64: dts: meson-axg: enable SCPI

On 08/11/2018 14:53, Jerome Brunet wrote:
> Enable SCPI on the axg platform, with cpu clock and hwmon
> (core temperature) support
>
> Signed-off-by: Jerome Brunet <[email protected]>
> ---
> arch/arm64/boot/dts/amlogic/meson-axg.dtsi | 26 ++++++++++++++++++++++
> 1 file changed, 26 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/amlogic/meson-axg.dtsi b/arch/arm64/boot/dts/amlogic/meson-axg.dtsi
> index b8893675e39c..5f512c91471e 100644
> --- a/arch/arm64/boot/dts/amlogic/meson-axg.dtsi
> +++ b/arch/arm64/boot/dts/amlogic/meson-axg.dtsi
> @@ -79,6 +79,7 @@
> reg = <0x0 0x0>;
> enable-method = "psci";
> next-level-cache = <&l2>;
> + clocks = <&scpi_dvfs 0>;
> };
>
> cpu1: cpu@1 {
> @@ -87,6 +88,7 @@
> reg = <0x0 0x1>;
> enable-method = "psci";
> next-level-cache = <&l2>;
> + clocks = <&scpi_dvfs 0>;
> };
>
> cpu2: cpu@2 {
> @@ -95,6 +97,7 @@
> reg = <0x0 0x2>;
> enable-method = "psci";
> next-level-cache = <&l2>;
> + clocks = <&scpi_dvfs 0>;
> };
>
> cpu3: cpu@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>;
>

Reviewed-by: Neil Armstrong <[email protected]>

2018-11-15 20:08:40

by Kevin Hilman

[permalink] [raw]
Subject: Re: [PATCH 0/4] arm64: dts: meson-axg: enable SCPI

Jerome Brunet <[email protected]> writes:

> 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

2018-11-17 16:22:50

by Rob Herring (Arm)

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

On Thu, 8 Nov 2018 14:53:51 +0100, Jerome Brunet wrote:
> amlogic,meson-gxbb-scpi-sensors is both the driver and DT but is not
> documented. Just add it to amlogic's scpi documentation
>
> Signed-off-by: Jerome Brunet <[email protected]>
> ---
> Documentation/devicetree/bindings/arm/amlogic,scpi.txt | 7 +++++++
> 1 file changed, 7 insertions(+)
>

Reviewed-by: Rob Herring <[email protected]>