linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 1/3] arm64: dts: fvp: Add system timer for broadcast during CPU idle
@ 2025-05-09 15:46 Sudeep Holla
  2025-05-09 15:46 ` [PATCH v2 2/3] arm64: dts: fvp: Add CPU idle states for Rev C model Sudeep Holla
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Sudeep Holla @ 2025-05-09 15:46 UTC (permalink / raw)
  To: linux-arm-kernel, devicetree
  Cc: Sudeep Holla, Lorenzo Pieralisi, Liviu Dudau, Leo Yan

Introduce a system-level timer node in the FVP device tree to act as
a broadcast timer when CPUs are in context losing idle states where
the local timer stops on entering such low power states.

This change complements recent CPU idle state additions.

Tested-by: Leo Yan <leo.yan@arm.com>
Message-Id: <20250508103225.354925-2-sudeep.holla@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
---
 arch/arm64/boot/dts/arm/fvp-base-revc.dts | 13 +++++++++++++
 1 file changed, 13 insertions(+)

v1->v2:
	- Dropped clock-frequency property
	- Fixed #size-cell to 1 as expected by the schema
	- Also update the ranges property and the frame reg property

diff --git a/arch/arm64/boot/dts/arm/fvp-base-revc.dts b/arch/arm64/boot/dts/arm/fvp-base-revc.dts
index 9e10d7a6b5a2..50b5993a2460 100644
--- a/arch/arm64/boot/dts/arm/fvp-base-revc.dts
+++ b/arch/arm64/boot/dts/arm/fvp-base-revc.dts
@@ -217,6 +217,19 @@ timer {
 			     <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW>;
 	};
 
+	timer@2a810000 {
+		compatible = "arm,armv7-timer-mem";
+		reg = <0x0 0x2a810000 0x0 0x10000>;
+		ranges = <0 0x0 0x2a820000 0x20000>;
+		#address-cells = <1>;
+		#size-cells = <1>;
+		frame@2a830000 {
+			frame-number = <1>;
+			interrupts = <GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>;
+			reg = <0x10000 0x10000>;
+		};
+	};
+
 	pmu {
 		compatible = "arm,armv8-pmuv3";
 		interrupts = <GIC_PPI 7 IRQ_TYPE_LEVEL_HIGH>;
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v2 2/3] arm64: dts: fvp: Add CPU idle states for Rev C model
  2025-05-09 15:46 [PATCH v2 1/3] arm64: dts: fvp: Add system timer for broadcast during CPU idle Sudeep Holla
@ 2025-05-09 15:46 ` Sudeep Holla
  2025-05-09 15:46 ` [PATCH v2 3/3] arm64: dts: fvp: Reserve 64MB for the FF-A firmware in memory map Sudeep Holla
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Sudeep Holla @ 2025-05-09 15:46 UTC (permalink / raw)
  To: linux-arm-kernel, devicetree
  Cc: Sudeep Holla, Lorenzo Pieralisi, Liviu Dudau, Leo Yan

Add CPU idle state definitions to the FVP Rev C device tree to enable
support for CPU lower power modes. This allows the system to properly
enter low power states during idle. It is disabled by default as it is
know to impact performance on the models.

Note that the power_state parameter(arm,psci-suspend-param) doesn't use
the Extended StateID format for compatibility reasons on FVP.

Tested on the FVP Rev C model with PSCI support enabled firmware.

Tested-by: Leo Yan <leo.yan@arm.com>
Message-Id: <20250508103225.354925-1-sudeep.holla@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
---
 arch/arm64/boot/dts/arm/fvp-base-revc.dts | 32 +++++++++++++++++++++++
 1 file changed, 32 insertions(+)

v1->v2:
	- Change "arm,psci" to "psci" as in the schema

diff --git a/arch/arm64/boot/dts/arm/fvp-base-revc.dts b/arch/arm64/boot/dts/arm/fvp-base-revc.dts
index 50b5993a2460..755b1407c4dc 100644
--- a/arch/arm64/boot/dts/arm/fvp-base-revc.dts
+++ b/arch/arm64/boot/dts/arm/fvp-base-revc.dts
@@ -44,6 +44,30 @@ cpus {
 		#address-cells = <2>;
 		#size-cells = <0>;
 
+		idle-states {
+			entry-method = "psci";
+
+			CPU_SLEEP_0: cpu-sleep-0 {
+				compatible = "arm,idle-state";
+				local-timer-stop;
+				arm,psci-suspend-param = <0x0010000>;
+				entry-latency-us = <40>;
+				exit-latency-us = <100>;
+				min-residency-us = <150>;
+				status = "disabled";
+			};
+
+			CLUSTER_SLEEP_0: cluster-sleep-0 {
+				compatible = "arm,idle-state";
+				local-timer-stop;
+				arm,psci-suspend-param = <0x1010000>;
+				entry-latency-us = <500>;
+				exit-latency-us = <1000>;
+				min-residency-us = <2500>;
+				status = "disabled";
+			};
+		};
+
 		cpu0: cpu@0 {
 			device_type = "cpu";
 			compatible = "arm,armv8";
@@ -56,6 +80,7 @@ cpu0: cpu@0 {
 			d-cache-line-size = <64>;
 			d-cache-sets = <256>;
 			next-level-cache = <&C0_L2>;
+			cpu-idle-states = <&CPU_SLEEP_0 &CLUSTER_SLEEP_0>;
 		};
 		cpu1: cpu@100 {
 			device_type = "cpu";
@@ -69,6 +94,7 @@ cpu1: cpu@100 {
 			d-cache-line-size = <64>;
 			d-cache-sets = <256>;
 			next-level-cache = <&C0_L2>;
+			cpu-idle-states = <&CPU_SLEEP_0 &CLUSTER_SLEEP_0>;
 		};
 		cpu2: cpu@200 {
 			device_type = "cpu";
@@ -82,6 +108,7 @@ cpu2: cpu@200 {
 			d-cache-line-size = <64>;
 			d-cache-sets = <256>;
 			next-level-cache = <&C0_L2>;
+			cpu-idle-states = <&CPU_SLEEP_0 &CLUSTER_SLEEP_0>;
 		};
 		cpu3: cpu@300 {
 			device_type = "cpu";
@@ -95,6 +122,7 @@ cpu3: cpu@300 {
 			d-cache-line-size = <64>;
 			d-cache-sets = <256>;
 			next-level-cache = <&C0_L2>;
+			cpu-idle-states = <&CPU_SLEEP_0 &CLUSTER_SLEEP_0>;
 		};
 		cpu4: cpu@10000 {
 			device_type = "cpu";
@@ -108,6 +136,7 @@ cpu4: cpu@10000 {
 			d-cache-line-size = <64>;
 			d-cache-sets = <256>;
 			next-level-cache = <&C1_L2>;
+			cpu-idle-states = <&CPU_SLEEP_0 &CLUSTER_SLEEP_0>;
 		};
 		cpu5: cpu@10100 {
 			device_type = "cpu";
@@ -121,6 +150,7 @@ cpu5: cpu@10100 {
 			d-cache-line-size = <64>;
 			d-cache-sets = <256>;
 			next-level-cache = <&C1_L2>;
+			cpu-idle-states = <&CPU_SLEEP_0 &CLUSTER_SLEEP_0>;
 		};
 		cpu6: cpu@10200 {
 			device_type = "cpu";
@@ -134,6 +164,7 @@ cpu6: cpu@10200 {
 			d-cache-line-size = <64>;
 			d-cache-sets = <256>;
 			next-level-cache = <&C1_L2>;
+			cpu-idle-states = <&CPU_SLEEP_0 &CLUSTER_SLEEP_0>;
 		};
 		cpu7: cpu@10300 {
 			device_type = "cpu";
@@ -147,6 +178,7 @@ cpu7: cpu@10300 {
 			d-cache-line-size = <64>;
 			d-cache-sets = <256>;
 			next-level-cache = <&C1_L2>;
+			cpu-idle-states = <&CPU_SLEEP_0 &CLUSTER_SLEEP_0>;
 		};
 		C0_L2: l2-cache0 {
 			compatible = "cache";
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v2 3/3] arm64: dts: fvp: Reserve 64MB for the FF-A firmware in memory map
  2025-05-09 15:46 [PATCH v2 1/3] arm64: dts: fvp: Add system timer for broadcast during CPU idle Sudeep Holla
  2025-05-09 15:46 ` [PATCH v2 2/3] arm64: dts: fvp: Add CPU idle states for Rev C model Sudeep Holla
@ 2025-05-09 15:46 ` Sudeep Holla
  2025-05-12 16:21 ` [PATCH v2 1/3] arm64: dts: fvp: Add system timer for broadcast during CPU idle Liviu Dudau
  2025-05-13 14:42 ` Sudeep Holla
  3 siblings, 0 replies; 5+ messages in thread
From: Sudeep Holla @ 2025-05-09 15:46 UTC (permalink / raw)
  To: linux-arm-kernel, devicetree
  Cc: Sudeep Holla, Lorenzo Pieralisi, Liviu Dudau, Leo Yan

Reserve 64MB of memory at the end of the first bank of DRAM on FVP model.
This is mainly for FF-A firmware use, as required by various firmware
configurations using the Firmware Framework for Arm (FF-A). This prevents
the kernel from overwriting the firmware region.

This is also useful when running other firmware configurations(non FF-A
based) that rely on usage of 64MB at the end of first DRAM bank.

Necessary for proper coexistence of firmware(FF-A partitions) and the OS.

Message-Id: <20250508103225.354925-3-sudeep.holla@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
---
 arch/arm64/boot/dts/arm/fvp-base-revc.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/arm/fvp-base-revc.dts b/arch/arm64/boot/dts/arm/fvp-base-revc.dts
index 755b1407c4dc..a5024075e3f3 100644
--- a/arch/arm64/boot/dts/arm/fvp-base-revc.dts
+++ b/arch/arm64/boot/dts/arm/fvp-base-revc.dts
@@ -201,7 +201,7 @@ C1_L2: l2-cache1 {
 
 	memory@80000000 {
 		device_type = "memory";
-		reg = <0x00000000 0x80000000 0 0x80000000>,
+		reg = <0x00000000 0x80000000 0 0x7c000000>,
 		      <0x00000008 0x80000000 0 0x80000000>;
 	};
 
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2 1/3] arm64: dts: fvp: Add system timer for broadcast during CPU idle
  2025-05-09 15:46 [PATCH v2 1/3] arm64: dts: fvp: Add system timer for broadcast during CPU idle Sudeep Holla
  2025-05-09 15:46 ` [PATCH v2 2/3] arm64: dts: fvp: Add CPU idle states for Rev C model Sudeep Holla
  2025-05-09 15:46 ` [PATCH v2 3/3] arm64: dts: fvp: Reserve 64MB for the FF-A firmware in memory map Sudeep Holla
@ 2025-05-12 16:21 ` Liviu Dudau
  2025-05-13 14:42 ` Sudeep Holla
  3 siblings, 0 replies; 5+ messages in thread
From: Liviu Dudau @ 2025-05-12 16:21 UTC (permalink / raw)
  To: Sudeep Holla; +Cc: linux-arm-kernel, devicetree, Lorenzo Pieralisi, Leo Yan

On Fri, May 09, 2025 at 04:46:38PM +0100, Sudeep Holla wrote:
> Introduce a system-level timer node in the FVP device tree to act as
> a broadcast timer when CPUs are in context losing idle states where
> the local timer stops on entering such low power states.
> 
> This change complements recent CPU idle state additions.
> 
> Tested-by: Leo Yan <leo.yan@arm.com>
> Message-Id: <20250508103225.354925-2-sudeep.holla@arm.com>
> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>

For the whole series:

Reviewed-by: Liviu Dudau <liviu.dudau@arm.com>

Best regards,
Liviu

> ---
>  arch/arm64/boot/dts/arm/fvp-base-revc.dts | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> v1->v2:
> 	- Dropped clock-frequency property
> 	- Fixed #size-cell to 1 as expected by the schema
> 	- Also update the ranges property and the frame reg property
> 
> diff --git a/arch/arm64/boot/dts/arm/fvp-base-revc.dts b/arch/arm64/boot/dts/arm/fvp-base-revc.dts
> index 9e10d7a6b5a2..50b5993a2460 100644
> --- a/arch/arm64/boot/dts/arm/fvp-base-revc.dts
> +++ b/arch/arm64/boot/dts/arm/fvp-base-revc.dts
> @@ -217,6 +217,19 @@ timer {
>  			     <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW>;
>  	};
>  
> +	timer@2a810000 {
> +		compatible = "arm,armv7-timer-mem";
> +		reg = <0x0 0x2a810000 0x0 0x10000>;
> +		ranges = <0 0x0 0x2a820000 0x20000>;
> +		#address-cells = <1>;
> +		#size-cells = <1>;
> +		frame@2a830000 {
> +			frame-number = <1>;
> +			interrupts = <GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>;
> +			reg = <0x10000 0x10000>;
> +		};
> +	};
> +
>  	pmu {
>  		compatible = "arm,armv8-pmuv3";
>  		interrupts = <GIC_PPI 7 IRQ_TYPE_LEVEL_HIGH>;
> -- 
> 2.34.1
> 

-- 
====================
| I would like to |
| fix the world,  |
| but they're not |
| giving me the   |
 \ source code!  /
  ---------------
    ¯\_(ツ)_/¯


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2 1/3] arm64: dts: fvp: Add system timer for broadcast during CPU idle
  2025-05-09 15:46 [PATCH v2 1/3] arm64: dts: fvp: Add system timer for broadcast during CPU idle Sudeep Holla
                   ` (2 preceding siblings ...)
  2025-05-12 16:21 ` [PATCH v2 1/3] arm64: dts: fvp: Add system timer for broadcast during CPU idle Liviu Dudau
@ 2025-05-13 14:42 ` Sudeep Holla
  3 siblings, 0 replies; 5+ messages in thread
From: Sudeep Holla @ 2025-05-13 14:42 UTC (permalink / raw)
  To: linux-arm-kernel, devicetree, Sudeep Holla
  Cc: Lorenzo Pieralisi, Liviu Dudau, Leo Yan

On Fri, 09 May 2025 16:46:38 +0100, Sudeep Holla wrote:
> Introduce a system-level timer node in the FVP device tree to act as
> a broadcast timer when CPUs are in context losing idle states where
> the local timer stops on entering such low power states.
> 
> This change complements recent CPU idle state additions.
> 
> 
> [...]

Applied to sudeep.holla/linux (for-next/juno/updates), thanks!

[1/3] arm64: dts: fvp: Add system timer for broadcast during CPU idle
      https://git.kernel.org/sudeep.holla/c/7556a55b07c0
[2/3] arm64: dts: fvp: Add CPU idle states for Rev C model
      https://git.kernel.org/sudeep.holla/c/44845ea83d5e
[3/3] arm64: dts: fvp: Reserve 64MB for the FF-A firmware in memory map
      https://git.kernel.org/sudeep.holla/c/bbb59b3614a7
--
Regards,
Sudeep



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-05-13 14:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-09 15:46 [PATCH v2 1/3] arm64: dts: fvp: Add system timer for broadcast during CPU idle Sudeep Holla
2025-05-09 15:46 ` [PATCH v2 2/3] arm64: dts: fvp: Add CPU idle states for Rev C model Sudeep Holla
2025-05-09 15:46 ` [PATCH v2 3/3] arm64: dts: fvp: Reserve 64MB for the FF-A firmware in memory map Sudeep Holla
2025-05-12 16:21 ` [PATCH v2 1/3] arm64: dts: fvp: Add system timer for broadcast during CPU idle Liviu Dudau
2025-05-13 14:42 ` Sudeep Holla

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).