Skip to contentSkip to conversation

Add SMP support

PATCH New Biju Das 2 participants 9 messages Aug 8, 2017 – Aug 17, 2017 Device tree bindings

lore
Share & tools
lore

Biju Das

author
#0 lore raw

cover Add SMP support

This series aims to add SMP support for r8a7743 SoC.

This series has been tested against Linux-next tag 20170727 and renesas-dev branch.

Biju Das (3):
dt-bindings: apmu: Document r8a7743 support
ARM: dts: r8a7743: Add APMU node and second CPU core
ARM: dts: r8a7743: Add OPP table for frequency scaling

 .../devicetree/bindings/power/renesas,apmu.txt     |  3 ++-
 arch/arm/boot/dts/r8a7743.dtsi                     | 25 ++++++++++++++++++++++
 2 files changed, 27 insertions(+), 1 deletion(-)
Signature · 1 line
1.9.1
author
#1 lore raw

PATCH 1/3 dt-bindings: apmu: Document r8a7743 support

Document APMU and SMP enable method for RZ/G1M
(also known as r8a7743) SoC.

---
 Documentation/devicetree/bindings/power/renesas,apmu.txt | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/power/renesas,apmu.txt +2 -1
index 84404c9..af21502 100644
@@ -1,12 +1,13 @@
 DT bindings for the Renesas Advanced Power Management Unit
 
-Renesas R-Car line of SoCs utilize one or more APMU hardware units
+Renesas R-Car and RZ/G1 SoCs utilize one or more APMU hardware units
 for CPU core power domain control including SMP boot and CPU Hotplug.
 
 Required properties:
 
 - compatible: Should be "renesas,<soctype>-apmu", "renesas,apmu" as fallback.
 	      Examples with soctypes are:
+		- "renesas,r8a7743-apmu" (RZ/G1M)
 		- "renesas,r8a7790-apmu" (R-Car H2)
 		- "renesas,r8a7791-apmu" (R-Car M2-W)
 		- "renesas,r8a7792-apmu" (R-Car V2H)
Signature · 1 line
1.9.1
author
#2 lore raw

PATCH 2/3 ARM: dts: r8a7743: Add APMU node and second CPU core

In reply to Biju Das

Add DT nodes for the Advanced Power Management Unit (APMU) and the second CPU core. Use the enable-method to point out that the APMU should be used for SMP support.

---
 arch/arm/boot/dts/r8a7743.dtsi | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
arch/arm/boot/dts/r8a7743.dtsi +16 -0
index f62e858..77da319 100644
@@ -21,6 +21,7 @@
 	cpus {
 		#address-cells = <1>;
 		#size-cells = <0>;
+		enable-method = "renesas,apmu";
 
 		cpu0: cpu at 0 {
 			device_type = "cpu";
@@ -32,6 +33,15 @@
 			next-level-cache = <&L2_CA15>;
 		};
 
+		cpu1: cpu at 1 {
+			device_type = "cpu";
+			compatible = "arm,cortex-a15";
+			reg = <1>;
+			clock-frequency = <1500000000>;
+			power-domains = <&sysc R8A7743_PD_CA15_CPU1>;
+			next-level-cache = <&L2_CA15>;
+		};
+
 		L2_CA15: cache-controller-0 {
 			compatible = "cache";
 			cache-unified;
@@ -48,6 +58,12 @@
 		#size-cells = <2>;
 		ranges;
 
+		apmu at e6152000 {
+			compatible = "renesas,r8a7743-apmu", "renesas,apmu";
+			reg = <0 0xe6152000 0 0x188>;
+			cpus = <&cpu0 &cpu1>;
+		};
+
 		gic: interrupt-controller at f1001000 {
 			compatible = "arm,gic-400";
 			#interrupt-cells = <3>;
Signature · 1 line
1.9.1
author
#3 lore raw

PATCH 3/3 ARM: dts: r8a7743: Add OPP table for frequency scaling

In reply to Biju Das

Add needed information inside CPU0 for the generic cpufreq-cpu0 driver.

- clock-latency = 300 us
Approximate worst-case latency to do clock transition for every OPPs. Using an arbitrary safe value similar to r8a7791(R-Car M2) Soc.

- operating-points = < kHz - uV >
List of 6 operating points. All of them are using the same voltage since DVS is not supported in RZ/G1 Soc.

Note:This also fixes the below errors seen on kernel logs

[    0.876877] cpu cpu0: dev_pm_opp_get_opp_count: OPP table not found (-19)
[    0.883727] cpu cpu1: cpufreq_init: failed to get clk: -2
---
 arch/arm/boot/dts/r8a7743.dtsi | 9 +++++++++
 1 file changed, 9 insertions(+)
arch/arm/boot/dts/r8a7743.dtsi +9 -0
index 77da319..8c46f62 100644
@@ -29,8 +29,17 @@
 			reg = <0>;
 			clock-frequency = <1500000000>;
 			clocks = <&cpg CPG_CORE R8A7743_CLK_Z>;
+			clock-latency = <300000>; /* 300 us */
 			power-domains = <&sysc R8A7743_PD_CA15_CPU0>;
 			next-level-cache = <&L2_CA15>;
+
+			/* kHz - uV - OPPs unknown yet */
+			operating-points = <1500000 1000000>,
+					   <1312500 1000000>,
+					   <1125000 1000000>,
+					   < 937500 1000000>,
+					   < 750000 1000000>,
+					   < 375000 1000000>;
 		};
 
 		cpu1: cpu at 1 {
Signature · 1 line
1.9.1
#4 lore raw

cover Add SMP support

In reply to Biju Das
Quoted 4 lines · Biju Das

This series aims to add SMP support for r8a7743 SoC.

This series has been tested against Linux-next tag 20170727 and renesas-dev branch.

It seems that these patches are targeted at the renesas tree. The best practice in that case is to base patches on the latest devel branch. Please consider doing so in future.

The patches themselves seem good to me, however, I would like to enquire about testing. In particular, have you tested CPU hotplug and suspend to RAM with these patches (and without in the case of the latter)?

I am cautious about any regressions that may creep in when going from UP to SMP.

Quoted 13 lines

Biju Das (3):
dt-bindings: apmu: Document r8a7743 support
ARM: dts: r8a7743: Add APMU node and second CPU core
ARM: dts: r8a7743: Add OPP table for frequency scaling

 .../devicetree/bindings/power/renesas,apmu.txt     |  3 ++-
 arch/arm/boot/dts/r8a7743.dtsi                     | 25 ++++++++++++++++++++++
 2 files changed, 27 insertions(+), 1 deletion(-)
Signature · 1 line
1.9.1
author
#5 lore raw

cover Add SMP support

Quoted 18 lines

-----Original Message-----
From: Simon Horman [mailto:horms at verge.net.au]
Sent: 09 August 2017 09:36
To: Biju Das <[email protected]>
Cc: Rob Herring <[email protected]>; Mark Rutland <[email protected]>; Magnus Damm <[email protected]>; Russell King <[email protected]>; Chris Paterson <[email protected]>; devicetree at vger.kernel.org; linux-renesas- soc at vger.kernel.org; linux-arm-kernel at lists.infradead.org
Subject: Re: [PATCH 0/3] Add SMP support

Quoted 4 lines · Biju Das

This series aims to add SMP support for r8a7743 SoC.

This series has been tested against Linux-next tag 20170727 and renesas-dev branch.

Quoted 7 lines

It seems that these patches are targeted at the renesas tree.
The best practice in that case is to base patches on the latest devel branch. Please consider doing so in future.

The patches themselves seem good to me, however, I would like to enquire about testing. In particular, have you tested CPU hotplug and suspend to RAM with these patches (and without in the case of the latter)?

I have tested CPU hotplug with this patch and it works ok.

Currently iWave platform doesn't support STR I guess. But we should check the changes on other M2 platforms to prove that things don't break.

[>]

Quoted 16 lines

I am cautious about any regressions that may creep in when going from UP to SMP.

Quoted 13 lines

Biju Das (3):
dt-bindings: apmu: Document r8a7743 support
ARM: dts: r8a7743: Add APMU node and second CPU core
ARM: dts: r8a7743: Add OPP table for frequency scaling

 .../devicetree/bindings/power/renesas,apmu.txt     |  3 ++-
 arch/arm/boot/dts/r8a7743.dtsi                     | 25 ++++++++++++++++++++++
 2 files changed, 27 insertions(+), 1 deletion(-)

--
1.9.1

Renesas Electronics Europe Ltd, Dukes Meadow, Millboard Road, Bourne End, Buckinghamshire, SL8 5FH, UK. Registered in England & Wales under Registered No. 04586709.

author
#6 lore raw

cover Add SMP support

In reply to Simon Horman
Quoted 37 lines

-----Original Message-----
From: Biju Das
Sent: 10 August 2017 10:17
To: 'Simon Horman' <[email protected]>
Cc: Rob Herring <[email protected]>; Mark Rutland <[email protected]>; Magnus Damm <[email protected]>; Russell King <[email protected]>; Chris Paterson <[email protected]>; devicetree at vger.kernel.org; linux-renesas- soc at vger.kernel.org; linux-arm-kernel at lists.infradead.org
Subject: RE: [PATCH 0/3] Add SMP support

Quoted 6 lines

-----Original Message-----
From: Simon Horman [mailto:horms at verge.net.au]
Sent: 09 August 2017 09:36
To: Biju Das <[email protected]>
Cc: Rob Herring <[email protected]>; Mark Rutland <[email protected]>; Magnus Damm <[email protected]>;

Russell

Quoted 16 lines

King <[email protected]>; Chris Paterson <[email protected]>; devicetree at vger.kernel.org; linux-renesas- soc at vger.kernel.org; linux-arm-kernel at lists.infradead.org
Subject: Re: [PATCH 0/3] Add SMP support

Quoted 4 lines · Biju Das

This series aims to add SMP support for r8a7743 SoC.

This series has been tested against Linux-next tag 20170727 and renesas-dev branch.

It seems that these patches are targeted at the renesas tree.
The best practice in that case is to base patches on the latest devel branch. Please consider doing so in future.

Quoted 8 lines
Quoted 3 lines

The patches themselves seem good to me, however, I would like to enquire about testing. In particular, have you tested CPU hotplug and suspend to RAM with these patches (and without in the case of the latter)?

I have tested CPU hotplug with this patch and it works ok.

Currently iWave platform doesn't support STR I guess. But we should check the changes on other M2 platforms to prove that things don't break.

I have tested STR on RZ-G1M SK(r8a7743) platform using gpio-key as wake up source. It works fine with and without the patch . It is tested against renesas-developer branch.

Also I have tested STR on R-Car M2 board.it works fine with gpio-key as wake up source.

Quoted 5 lines

[>]

Quoted 4 lines

I am cautious about any regressions that may creep in when going from UP to SMP.

Quoted 1 line
Quoted 13 lines
Quoted 7 lines
Quoted 7 lines

Biju Das (3):
dt-bindings: apmu: Document r8a7743 support
ARM: dts: r8a7743: Add APMU node and second CPU core
ARM: dts: r8a7743: Add OPP table for frequency scaling

 .../devicetree/bindings/power/renesas,apmu.txt     |  3 ++-
 arch/arm/boot/dts/r8a7743.dtsi                     | 25

++++++++++++++++++++++

Quoted 5 lines
Quoted 5 lines
 2 files changed, 27 insertions(+), 1 deletion(-)

--
1.9.1

Renesas Electronics Europe Ltd, Dukes Meadow, Millboard Road, Bourne End, Buckinghamshire, SL8 5FH, UK. Registered in England & Wales under Registered No. 04586709.

author
#7 lore raw

cover Add SMP support

In reply to Simon Horman

Hello,

Quoted 48 lines

-----Original Message-----
From: Biju Das
Sent: 10 August 2017 12:19
To: 'Simon Horman' <[email protected]>
Cc: 'Rob Herring' <[email protected]>; 'Mark Rutland' <[email protected]>; 'Magnus Damm' <[email protected]>; 'Russell King' <[email protected]>; Chris Paterson <[email protected]>; 'devicetree at vger.kernel.org' <[email protected]>; 'linux-renesas-soc at vger.kernel.org' <linux- renesas-soc at vger.kernel.org>; 'linux-arm-kernel at lists.infradead.org' <linux- arm-kernel at lists.infradead.org>
Subject: RE: [PATCH 0/3] Add SMP support

Quoted 6 lines

-----Original Message-----
From: Biju Das
Sent: 10 August 2017 10:17
To: 'Simon Horman' <[email protected]>
Cc: Rob Herring <[email protected]>; Mark Rutland <[email protected]>; Magnus Damm <[email protected]>;

Russell

Quoted 26 lines

King <[email protected]>; Chris Paterson <[email protected]>; devicetree at vger.kernel.org; linux-renesas- soc at vger.kernel.org; linux-arm-kernel at lists.infradead.org
Subject: RE: [PATCH 0/3] Add SMP support

Quoted 6 lines

-----Original Message-----
From: Simon Horman [mailto:horms at verge.net.au]
Sent: 09 August 2017 09:36
To: Biju Das <[email protected]>
Cc: Rob Herring <[email protected]>; Mark Rutland <[email protected]>; Magnus Damm <[email protected]>;

Russell

Quoted 12 lines

King <[email protected]>; Chris Paterson <[email protected]>; devicetree at vger.kernel.org; linux-renesas- soc at vger.kernel.org; linux-arm-kernel at lists.infradead.org
Subject: Re: [PATCH 0/3] Add SMP support

Quoted 4 lines · Biju Das

This series aims to add SMP support for r8a7743 SoC.

This series has been tested against Linux-next tag 20170727 and renesas-dev branch.

Quoted 13 lines
Quoted 7 lines
Quoted 7 lines

It seems that these patches are targeted at the renesas tree.
The best practice in that case is to base patches on the latest devel branch. Please consider doing so in future.

The patches themselves seem good to me, however, I would like to enquire about testing. In particular, have you tested CPU hotplug and suspend to RAM with these patches (and without in the case of the

latter)?

Quoted 5 lines

I have tested CPU hotplug with this patch and it works ok.

Currently iWave platform doesn't support STR I guess. But we should check the changes on other M2 platforms to prove that things don't break.

I have tested STR on iWave RZ-G1M platform as well. I used ttySC0 as wake up Source(echo enabled > /sys/class/tty/ttySC0/power/wakeup)

It works fine with and without the patch .

It is tested against renesas-developer branch tag 20170809-v4.13-rc4.

Quoted 5 lines

I have tested STR on RZ-G1M SK(r8a7743) platform using gpio-key as wake up source.
It works fine with and without the patch . It is tested against renesas-developer branch.

Quoted 21 lines

Also I have tested STR on R-Car M2 board.it works fine with gpio-key as wake up source.

Quoted 18 lines

[>]

Quoted 11 lines

I am cautious about any regressions that may creep in when going from UP to SMP.

Quoted 8 lines

Biju Das (3):
dt-bindings: apmu: Document r8a7743 support
ARM: dts: r8a7743: Add APMU node and second CPU core
ARM: dts: r8a7743: Add OPP table for frequency scaling

 .../devicetree/bindings/power/renesas,apmu.txt     |  3 ++-
 arch/arm/boot/dts/r8a7743.dtsi                     | 25

++++++++++++++++++++++

Quoted 5 lines
Quoted 5 lines
 2 files changed, 27 insertions(+), 1 deletion(-)

--
1.9.1

Renesas Electronics Europe Ltd, Dukes Meadow, Millboard Road, Bourne End, Buckinghamshire, SL8 5FH, UK. Registered in England & Wales under Registered No. 04586709.

#8 lore raw

cover Add SMP support

Quoted 65 lines · Biju Das

Hello,

Quoted 48 lines

-----Original Message-----
From: Biju Das
Sent: 10 August 2017 12:19
To: 'Simon Horman' <[email protected]>
Cc: 'Rob Herring' <[email protected]>; 'Mark Rutland' <[email protected]>; 'Magnus Damm' <[email protected]>; 'Russell King' <[email protected]>; Chris Paterson <[email protected]>; 'devicetree at vger.kernel.org' <[email protected]>; 'linux-renesas-soc at vger.kernel.org' <linux- renesas-soc at vger.kernel.org>; 'linux-arm-kernel at lists.infradead.org' <linux- arm-kernel at lists.infradead.org>
Subject: RE: [PATCH 0/3] Add SMP support

Quoted 6 lines

-----Original Message-----
From: Biju Das
Sent: 10 August 2017 10:17
To: 'Simon Horman' <[email protected]>
Cc: Rob Herring <[email protected]>; Mark Rutland <[email protected]>; Magnus Damm <[email protected]>;

Russell

Quoted 26 lines

King <[email protected]>; Chris Paterson <[email protected]>; devicetree at vger.kernel.org; linux-renesas- soc at vger.kernel.org; linux-arm-kernel at lists.infradead.org
Subject: RE: [PATCH 0/3] Add SMP support

Quoted 6 lines

-----Original Message-----
From: Simon Horman [mailto:horms at verge.net.au]
Sent: 09 August 2017 09:36
To: Biju Das <[email protected]>
Cc: Rob Herring <[email protected]>; Mark Rutland <[email protected]>; Magnus Damm <[email protected]>;

Russell

Quoted 12 lines

King <[email protected]>; Chris Paterson <[email protected]>; devicetree at vger.kernel.org; linux-renesas- soc at vger.kernel.org; linux-arm-kernel at lists.infradead.org
Subject: Re: [PATCH 0/3] Add SMP support

Quoted 4 lines · Biju Das

This series aims to add SMP support for r8a7743 SoC.

This series has been tested against Linux-next tag 20170727 and renesas-dev branch.

Quoted 13 lines
Quoted 7 lines
Quoted 7 lines

It seems that these patches are targeted at the renesas tree.
The best practice in that case is to base patches on the latest devel branch. Please consider doing so in future.

The patches themselves seem good to me, however, I would like to enquire about testing. In particular, have you tested CPU hotplug and suspend to RAM with these patches (and without in the case of the

latter)?

Quoted 5 lines

I have tested CPU hotplug with this patch and it works ok.

Currently iWave platform doesn't support STR I guess. But we should check the changes on other M2 platforms to prove that things don't break.

Quoted 18 lines

I have tested STR on iWave RZ-G1M platform as well. I used ttySC0 as wake up Source(echo enabled > /sys/class/tty/ttySC0/power/wakeup)

It works fine with and without the patch .

It is tested against renesas-developer branch tag 20170809-v4.13-rc4.

Quoted 11 lines

I have tested STR on RZ-G1M SK(r8a7743) platform using gpio-key as wake up source.
It works fine with and without the patch . It is tested against renesas-developer branch.

Also I have tested STR on R-Car M2 board.it works fine with gpio-key as wake up source.

Quoted 3 lines

[>]

Quoted 2 lines

I am cautious about any regressions that may creep in when going from UP to SMP.

Thanks for testing, I have applied this series.