Skip to contentSkip to conversation

arm64: dts: foundation-v8: Enable PSCI mode

PATCH Superseded Daniel Thompson 4 participants 11 messages Sep 18, 2017 – Oct 3, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm64: dts: foundation-v8: Enable PSCI mode

Currently if the Foundation model is running ARM Trusted Firmware then the kernel, which is configured to use spin tables, cannot start secondary processors or "power off" the simulation.

Add a couple of labels to the include file, and introduce a new .dts file that uses these to override the enable-method.

---
 arch/arm64/boot/dts/arm/Makefile                   |  3 +-
 .../boot/dts/arm/foundation-v8-gicv3-psci.dts      | 51 ++++++++++++++++++++++
 arch/arm64/boot/dts/arm/foundation-v8.dtsi         |  8 ++--
 3 files changed, 57 insertions(+), 5 deletions(-)
 create mode 100644 arch/arm64/boot/dts/arm/foundation-v8-gicv3-psci.dts
arch/arm64/boot/dts/arm/Makefile +2 -1
index 75cc2aa10101..c9ec88809f3d 100644
@@ -1,4 +1,5 @@
-dtb-$(CONFIG_ARCH_VEXPRESS) += foundation-v8.dtb foundation-v8-gicv3.dtb
+dtb-$(CONFIG_ARCH_VEXPRESS) += \
+	foundation-v8.dtb foundation-v8-gicv3.dtb foundation-v8-gicv3-psci.dtb
 dtb-$(CONFIG_ARCH_VEXPRESS) += juno.dtb juno-r1.dtb juno-r2.dtb
 dtb-$(CONFIG_ARCH_VEXPRESS) += rtsm_ve-aemv8a.dtb
 dtb-$(CONFIG_ARCH_VEXPRESS) += vexpress-v2f-1xv7-ca53x2.dtb
arch/arm64/boot/dts/arm/foundation-v8-gicv3-psci.dts new file +51 -0

51 lines not on this page · raw message

arch/arm64/boot/dts/arm/foundation-v8.dtsi +4 -4
index 8ecdd4331980..8c7f8c4f090a 100644
@@ -28,7 +28,7 @@
 		#address-cells = <2>;
 		#size-cells = <0>;
 
-		cpu at 0 {
+		cpu0: cpu at 0 {
 			device_type = "cpu";
 			compatible = "arm,armv8";
 			reg = <0x0 0x0>;
@@ -36,7 +36,7 @@
 			cpu-release-addr = <0x0 0x8000fff8>;
 			next-level-cache = <&L2_0>;
 		};
-		cpu at 1 {
+		cpu1: cpu at 1 {
 			device_type = "cpu";
 			compatible = "arm,armv8";
 			reg = <0x0 0x1>;
@@ -44,7 +44,7 @@
 			cpu-release-addr = <0x0 0x8000fff8>;
 			next-level-cache = <&L2_0>;
 		};
-		cpu at 2 {
+		cpu2: cpu at 2 {
 			device_type = "cpu";
 			compatible = "arm,armv8";
 			reg = <0x0 0x2>;
@@ -52,7 +52,7 @@
 			cpu-release-addr = <0x0 0x8000fff8>;
 			next-level-cache = <&L2_0>;
 		};
-		cpu at 3 {
+		cpu3: cpu at 3 {
 			device_type = "cpu";
 			compatible = "arm,armv8";
 			reg = <0x0 0x3>;

--
2.9.5

Acked-by on v1 1/1
#1 lore raw

Hi Daniel,

Quoted 8 lines · Daniel Thompson

Currently if the Foundation model is running ARM Trusted Firmware then the kernel, which is configured to use spin tables, cannot start secondary processors or "power off" the simulation.

Add a couple of labels to the include file, and introduce a new .dts file that uses these to override the enable-method.

This looks good, but has the unfortunate effect of leaving the (irrelevant) cpu-release-addr property in the PSCI dts files, as that's in the underlying dtsi file.

Could we split spin-table / PSCI parts into separate dtsi files?

e.g. have:

* foundation-v8.dtsi
* foundation-v8-gicv{2,3}.dtsi
* foundation-v8-{psci,spin-table}.dtsi

... and then combine those to build the dts files we want.

FWIW, with that:

Thanks,
Mark.

#2 lore raw
Quoted 18 lines · Mark Rutland

Hi Daniel,

Quoted 8 lines · Daniel Thompson

Currently if the Foundation model is running ARM Trusted Firmware then the kernel, which is configured to use spin tables, cannot start secondary processors or "power off" the simulation.

Add a couple of labels to the include file, and introduce a new .dts file that uses these to override the enable-method.

This looks good, but has the unfortunate effect of leaving the (irrelevant) cpu-release-addr property in the PSCI dts files, as that's in the underlying dtsi file.

Could we split spin-table / PSCI parts into separate dtsi files?

Quoted 7 lines

e.g. have:

* foundation-v8.dtsi
* foundation-v8-gicv{2,3}.dtsi
* foundation-v8-{psci,spin-table}.dtsi

... and then combine those to build the dts files we want.

Will do.

Quoted 4 lines

FWIW, with that:

Talking about what we want... if it's all split out I might as well add a gicv2+psci DT as well. Will that still retain your Acked-by or do you want to see it first ;-) ?

Daniel.

#3 lore raw
Quoted 14 lines · Daniel Thompson
Quoted 9 lines · Mark Rutland

Could we split spin-table / PSCI parts into separate dtsi files?

e.g. have:

* foundation-v8.dtsi
* foundation-v8-gicv{2,3}.dtsi
* foundation-v8-{psci,spin-table}.dtsi

... and then combine those to build the dts files we want.

Will do.

Quoted 7 lines
Quoted 3 lines

FWIW, with that:

Talking about what we want... if it's all split out I might as well add a gicv2+psci DT as well. Will that still retain your Acked-by or do you want to see it first ;-) ?

Sure; that's fine by me. :)

Thanks,
Mark.

#4 lore raw

PATCH v2 1/1 arm64: dts: foundation-v8: Enable PSCI mode

In reply to Daniel Thompson

Currently if the Foundation model is running ARM Trusted Firmware then the kernel, which is configured to use spin tables, cannot start secondary processors or "power off" the simulation.

After adding a couple of labels to the include file and splitting out the spin-table configuration into a header, we add a couple of new headers together with two new DTs (GICv2+PSCI and GICv3+PSCI).

The new GICv3+PSCI DT has been boot tested, the remaining three (two of which existed prior to this patch) have been "tested" by decompiling the blobs and comparing them against a reference.

---
 arch/arm64/boot/dts/arm/Makefile                   |  4 +++-
 arch/arm64/boot/dts/arm/foundation-v8-gicv2.dtsi   | 19 +++++++++++++++
 .../boot/dts/arm/foundation-v8-gicv3-psci.dts      |  9 +++++++
 arch/arm64/boot/dts/arm/foundation-v8-gicv3.dts    | 25 ++-----------------
 arch/arm64/boot/dts/arm/foundation-v8-gicv3.dtsi   | 28 ++++++++++++++++++++++
 arch/arm64/boot/dts/arm/foundation-v8-psci.dts     |  9 +++++++
 arch/arm64/boot/dts/arm/foundation-v8-psci.dtsi    | 28 ++++++++++++++++++++++
 .../boot/dts/arm/foundation-v8-spin-table.dtsi     | 25 +++++++++++++++++++
 arch/arm64/boot/dts/arm/foundation-v8.dts          | 16 ++-----------
 arch/arm64/boot/dts/arm/foundation-v8.dtsi         | 16 ++++---------
 10 files changed, 129 insertions(+), 50 deletions(-)
 create mode 100644 arch/arm64/boot/dts/arm/foundation-v8-gicv2.dtsi
 create mode 100644 arch/arm64/boot/dts/arm/foundation-v8-gicv3-psci.dts
 create mode 100644 arch/arm64/boot/dts/arm/foundation-v8-gicv3.dtsi
 create mode 100644 arch/arm64/boot/dts/arm/foundation-v8-psci.dts
 create mode 100644 arch/arm64/boot/dts/arm/foundation-v8-psci.dtsi
 create mode 100644 arch/arm64/boot/dts/arm/foundation-v8-spin-table.dtsi
arch/arm64/boot/dts/arm/Makefile +3 -1
index 75cc2aa10101..25f82c377f67 100644
@@ -1,4 +1,6 @@
-dtb-$(CONFIG_ARCH_VEXPRESS) += foundation-v8.dtb foundation-v8-gicv3.dtb
+dtb-$(CONFIG_ARCH_VEXPRESS) += \
+	foundation-v8.dtb foundation-v8-psci.dtb \
+	foundation-v8-gicv3.dtb foundation-v8-gicv3-psci.dtb
 dtb-$(CONFIG_ARCH_VEXPRESS) += juno.dtb juno-r1.dtb juno-r2.dtb
 dtb-$(CONFIG_ARCH_VEXPRESS) += rtsm_ve-aemv8a.dtb
 dtb-$(CONFIG_ARCH_VEXPRESS) += vexpress-v2f-1xv7-ca53x2.dtb
arch/arm64/boot/dts/arm/foundation-v8-gicv2.dtsi new file +19 -0
new file mode 100644
index 000000000000..851abf34fc80
@@ -0,0 +1,19 @@
+/*
+ * ARM Ltd.
+ *
+ * ARMv8 Foundation model DTS (GICv2 configuration)
+ */
+
+/ {
+	gic: interrupt-controller at 2c001000 {
+		compatible = "arm,cortex-a15-gic", "arm,cortex-a9-gic";
+		#interrupt-cells = <3>;
+		#address-cells = <2>;
+		interrupt-controller;
+		reg = <0x0 0x2c001000 0 0x1000>,
+		      <0x0 0x2c002000 0 0x2000>,
+		      <0x0 0x2c004000 0 0x2000>,
+		      <0x0 0x2c006000 0 0x2000>;
+		interrupts = <1 9 0xf04>;
+	};
+};
arch/arm64/boot/dts/arm/foundation-v8-gicv3-psci.dts new file +9 -0
new file mode 100644
index 000000000000..e096e670bec3
@@ -0,0 +1,9 @@
+/*
+ * ARM Ltd.
+ *
+ * ARMv8 Foundation model DTS (GICv3+PSCI configuration)
+ */
+
+#include "foundation-v8.dtsi"
+#include "foundation-v8-gicv3.dtsi"
+#include "foundation-v8-psci.dtsi"
arch/arm64/boot/dts/arm/foundation-v8-gicv3.dts +2 -23
index 35588dfa095c..c5d834d7d0ba 100644
@@ -5,26 +5,5 @@
  */
 
 #include "foundation-v8.dtsi"
-
-/ {
-	gic: interrupt-controller at 2f000000 {
-		compatible = "arm,gic-v3";
-		#interrupt-cells = <3>;
-		#address-cells = <2>;
-		#size-cells = <2>;
-		ranges;
-		interrupt-controller;
-		reg =	<0x0 0x2f000000 0x0 0x10000>,
-			<0x0 0x2f100000 0x0 0x200000>,
-			<0x0 0x2c000000 0x0 0x2000>,
-			<0x0 0x2c010000 0x0 0x2000>,
-			<0x0 0x2c02f000 0x0 0x2000>;
-		interrupts = <1 9 4>;
-
-		its: its at 2f020000 {
-			compatible = "arm,gic-v3-its";
-			msi-controller;
-			reg = <0x0 0x2f020000 0x0 0x20000>;
-		};
-	};
-};
+#include "foundation-v8-gicv3.dtsi"
+#include "foundation-v8-spin-table.dtsi"
arch/arm64/boot/dts/arm/foundation-v8-gicv3.dtsi new file +28 -0
new file mode 100644
index 000000000000..91fc5c60d88b
@@ -0,0 +1,28 @@
+/*
+ * ARM Ltd.
+ *
+ * ARMv8 Foundation model DTS (GICv3 configuration)
+ */
+
+/ {
+	gic: interrupt-controller at 2f000000 {
+		compatible = "arm,gic-v3";
+		#interrupt-cells = <3>;
+		#address-cells = <2>;
+		#size-cells = <2>;
+		ranges;
+		interrupt-controller;
+		reg =	<0x0 0x2f000000 0x0 0x10000>,
+			<0x0 0x2f100000 0x0 0x200000>,
+			<0x0 0x2c000000 0x0 0x2000>,
+			<0x0 0x2c010000 0x0 0x2000>,
+			<0x0 0x2c02f000 0x0 0x2000>;
+		interrupts = <1 9 4>;
+
+		its: its at 2f020000 {
+			compatible = "arm,gic-v3-its";
+			msi-controller;
+			reg = <0x0 0x2f020000 0x0 0x20000>;
+		};
+	};
+};
arch/arm64/boot/dts/arm/foundation-v8-psci.dts new file +9 -0
new file mode 100644
index 000000000000..723f23c7cd31
@@ -0,0 +1,9 @@
+/*
+ * ARM Ltd.
+ *
+ * ARMv8 Foundation model DTS (GICv2+PSCI configuration)
+ */
+
+#include "foundation-v8.dtsi"
+#include "foundation-v8-gicv2.dtsi"
+#include "foundation-v8-psci.dtsi"
arch/arm64/boot/dts/arm/foundation-v8-psci.dtsi new file +28 -0
new file mode 100644
index 000000000000..16cdf395728b
@@ -0,0 +1,28 @@
+/*
+ * ARM Ltd.
+ *
+ * ARMv8 Foundation model DTS (PSCI configuration)
+ */
+
+/ {
+	psci {
+		compatible = "arm,psci-1.0";
+		method = "smc";
+	};
+};
+
+&cpu0 {
+	enable-method = "psci";
+};
+
+&cpu1 {
+	enable-method = "psci";
+};
+
+&cpu2 {
+	enable-method = "psci";
+};
+
+&cpu3 {
+	enable-method = "psci";
+};
arch/arm64/boot/dts/arm/foundation-v8-spin-table.dtsi new file +25 -0
new file mode 100644
index 000000000000..4d4186ba0e8c
@@ -0,0 +1,25 @@
+/*
+ * ARM Ltd.
+ *
+ * ARMv8 Foundation model DTS (spin table configuration)
+ */
+
+&cpu0 {
+	enable-method = "spin-table";
+	cpu-release-addr = <0x0 0x8000fff8>;
+};
+
+&cpu1 {
+	enable-method = "spin-table";
+	cpu-release-addr = <0x0 0x8000fff8>;
+};
+
+&cpu2 {
+	enable-method = "spin-table";
+	cpu-release-addr = <0x0 0x8000fff8>;
+};
+
+&cpu3 {
+	enable-method = "spin-table";
+	cpu-release-addr = <0x0 0x8000fff8>;
+};
arch/arm64/boot/dts/arm/foundation-v8.dts +2 -14
index 71168077312d..8ff7c86fc929 100644
@@ -5,17 +5,5 @@
  */
 
 #include "foundation-v8.dtsi"
-
-/ {
-	gic: interrupt-controller at 2c001000 {
-		compatible = "arm,cortex-a15-gic", "arm,cortex-a9-gic";
-		#interrupt-cells = <3>;
-		#address-cells = <2>;
-		interrupt-controller;
-		reg = <0x0 0x2c001000 0 0x1000>,
-		      <0x0 0x2c002000 0 0x2000>,
-		      <0x0 0x2c004000 0 0x2000>,
-		      <0x0 0x2c006000 0 0x2000>;
-		interrupts = <1 9 0xf04>;
-	};
-};
+#include "foundation-v8-gicv2.dtsi"
+#include "foundation-v8-spin-table.dtsi"
arch/arm64/boot/dts/arm/foundation-v8.dtsi +4 -12
index 8ecdd4331980..60f6ab920743 100644
@@ -28,36 +28,28 @@
 		#address-cells = <2>;
 		#size-cells = <0>;
 
-		cpu at 0 {
+		cpu0: cpu at 0 {
 			device_type = "cpu";
 			compatible = "arm,armv8";
 			reg = <0x0 0x0>;
-			enable-method = "spin-table";
-			cpu-release-addr = <0x0 0x8000fff8>;
 			next-level-cache = <&L2_0>;
 		};
-		cpu at 1 {
+		cpu1: cpu at 1 {
 			device_type = "cpu";
 			compatible = "arm,armv8";
 			reg = <0x0 0x1>;
-			enable-method = "spin-table";
-			cpu-release-addr = <0x0 0x8000fff8>;
 			next-level-cache = <&L2_0>;
 		};
-		cpu at 2 {
+		cpu2: cpu at 2 {
 			device_type = "cpu";
 			compatible = "arm,armv8";
 			reg = <0x0 0x2>;
-			enable-method = "spin-table";
-			cpu-release-addr = <0x0 0x8000fff8>;
 			next-level-cache = <&L2_0>;
 		};
-		cpu at 3 {
+		cpu3: cpu at 3 {
 			device_type = "cpu";
 			compatible = "arm,armv8";
 			reg = <0x0 0x3>;
-			enable-method = "spin-table";
-			cpu-release-addr = <0x0 0x8000fff8>;
 			next-level-cache = <&L2_0>;
 		};
 

--
2.9.5

#5 lore raw
Quoted 4 lines · Daniel Thompson

Currently if the Foundation model is running ARM Trusted Firmware then the kernel, which is configured to use spin tables, cannot start secondary processors or "power off" the simulation.

Quoted 8 lines

After adding a couple of labels to the include file and splitting out the spin-table configuration into a header, we add a couple of new headers together with two new DTs (GICv2+PSCI and GICv3+PSCI).

The new GICv3+PSCI DT has been boot tested, the remaining three (two of which existed prior to this patch) have been "tested" by decompiling the blobs and comparing them against a reference.

How different are these from the ones hosted in [1] ?

On argument is that we want to take the DTS out of device tree as firmware is responsible for generating them. Alternatively, we may be duplicating resulting in discrepancies over time by coping it into kernel.

Since users of ARM TF must be able to access these, I am not sure if it makes sense to merge these. Or we remove it from ARM TF to avoid any conflicts/discrepancies.

Thoughts ?

--
Regards,
Sudeep

[1] https://github.com/ARM-software/arm-trusted-firmware/tree/master/fdts

#6 lore raw
Quoted 11 lines · Sudeep Holla
Quoted 8 lines · Daniel Thompson

Currently if the Foundation model is running ARM Trusted Firmware then the kernel, which is configured to use spin tables, cannot start secondary processors or "power off" the simulation.

After adding a couple of labels to the include file and splitting out the spin-table configuration into a header, we add a couple of new headers together with two new DTs (GICv2+PSCI and GICv3+PSCI).

Quoted 6 lines
Quoted 4 lines

The new GICv3+PSCI DT has been boot tested, the remaining three (two of which existed prior to this patch) have been "tested" by decompiling the blobs and comparing them against a reference.

How different are these from the ones hosted in [1] ?

They look like they were either independently written or diverged a long time ago. The existing kernel DTs describe hardware absent from the ARM TF ones and vice versa.

With specific reference to PSCI it looks like my patches could perhaps be improved by adding idle-state support.

Quoted 3 lines

On argument is that we want to take the DTS out of device tree as firmware is responsible for generating them. Alternatively, we may be duplicating resulting in discrepancies over time by coping it into kernel.

The general problem is copying from where?

The kernel DTs are a well maintained centralized repository which is *really* useful. git grep across the kernel DTs is a hugely powerful tool when trying to better understand an ecosystem as sprawling and diverse as ARMs. In fact I've even seen those sort of searchs used as a basis to clean up unused code. Seeing that centralized repository splinter into separate per-vendor silos would be a huge loss for kernel developers.

Quoted 4 lines

Since users of ARM TF must be able to access these, I am not sure if it makes sense to merge these. Or we remove it from ARM TF to avoid any conflicts/discrepancies. >
Thoughts ?

I kind of agree that maintaining DTs and DT documentation in the kernel is a little odd given that the kernel is not the only player here (FreeBSD, u-boot, etc). However it is sufficiently well maintained that projects are content(ish) to regard the kernel as the canonical source for these things (u-boot, for example, seeks to shadow kernel DTs without modifying them).

However regardless of the above I'd say they should be removed from ARM TF. ARM TF does not use, modify, pass on or in any way consume DT... it has no skin in the game here. Why does it want to own a few of blobs for a small subset of the platforms it supports? I'm afraid that makes no sense to me, to the extent that it didn't even occur to me to *look* in the ARM TF sources to find any DTs for FVP until you pointed them out.

In other words, whilst people could discuss alternative ways to manage DTs[1], I can't see any universe where ARM TF would be a logical place to keep them.

Daniel.

[1] ... and I'd further suggest that only perhaps people who are prepared to put resources into fixing it should convene such a discussion.

#7 lore raw

Sorry for late response, I thought I had sent this mail out long back but was sitting in my draft :(

Quoted 19 lines · Daniel Thompson
Quoted 18 lines · Sudeep Holla
Quoted 14 lines · Daniel Thompson

Currently if the Foundation model is running ARM Trusted Firmware then the kernel, which is configured to use spin tables, cannot start secondary
processors or "power off" the simulation.

After adding a couple of labels to the include file and splitting out the
spin-table configuration into a header, we add a couple of new headers together with two new DTs (GICv2+PSCI and GICv3+PSCI).

The new GICv3+PSCI DT has been boot tested, the remaining three (two of which existed prior to this patch) have been "tested" by decompiling the blobs and comparing them against a reference.

Quoted 6 lines
Quoted 1 line

How different are these from the ones hosted in [1] ?

They look like they were either independently written or diverged a long time ago. The existing kernel DTs describe hardware absent from the ARM TF ones and vice versa.

OK.

Quoted 4 lines

With specific reference to PSCI it looks like my patches could perhaps be improved by adding idle-state support.

Yes I know.

Quoted 7 lines
Quoted 4 lines

On argument is that we want to take the DTS out of device tree as firmware is responsible for generating them. Alternatively, we may be duplicating resulting in discrepancies over time by coping it into kernel.

The general problem is copying from where?

Quoted 8 lines

The kernel DTs are a well maintained centralized repository which is *really* useful. git grep across the kernel DTs is a hugely powerful tool when trying to better understand an ecosystem as sprawling and diverse as ARMs. In fact I've even seen those sort of searchs used as a basis to clean up unused code. Seeing that centralized repository splinter into separate per-vendor silos would be a huge loss for kernel developers.

Agreed. But models are configurable and last time this discussion came up, some argued that the DTs must be modified based on the configuration automatically by models or some external scripts.

Quoted 6 lines
Quoted 5 lines

Since users of ARM TF must be able to access these, I am not sure if it makes sense to merge these. Or we remove it from ARM TF to avoid any conflicts/discrepancies. >
Thoughts ?

Quoted 7 lines

I kind of agree that maintaining DTs and DT documentation in the kernel is a little odd given that the kernel is not the only player here (FreeBSD, u-boot, etc). However it is sufficiently well maintained that projects are content(ish) to regard the kernel as the canonical source for these things (u-boot, for example, seeks to shadow kernel DTs without modifying them).

No argument there.

Quoted 7 lines

However regardless of the above I'd say they should be removed from ARM TF. ARM TF does not use, modify, pass on or in any way consume DT... it has no skin in the game here. Why does it want to own a few of blobs for a small subset of the platforms it supports? I'm afraid that makes no sense to me, to the extent that it didn't even occur to me to *look* in the ARM TF sources to find any DTs for FVP until you pointed them out.

Agreed, I can talk to TF guys if required.

Quoted 7 lines

In other words, whilst people could discuss alternative ways to manage DTs[1], I can't see any universe where ARM TF would be a logical place to keep them.

[1] ... and I'd further suggest that only perhaps people who are ??? prepared to put resources into fixing it should convene such a ??? discussion.

While I agree with you, I am worried on the scalability. Models provide tons of options(may not be foundation platform but for sure the base AEM ones). It may so get unmanageable if we keep adding one DTS per configuration.

If we are OK restricting the set of configurations to what you have proposed, then it seems fine.

I will try to push this for v4.15, but I still want to hear more opinions on the scalability part here.

Signature · 2 lines
Regards,
Sudeep
#8 lore raw
Quoted 2 lines · Sudeep Holla

Sorry for late response, I thought I had sent this mail out long back but was sitting in my draft :(

No worries. I've been at Linaro connect this last week anyway.

Quoted 27 lines · Daniel Thompson
Quoted 19 lines · Sudeep Holla
Quoted 18 lines · Daniel Thompson
Quoted 14 lines

Currently if the Foundation model is running ARM Trusted Firmware then the kernel, which is configured to use spin tables, cannot start secondary
processors or "power off" the simulation.

After adding a couple of labels to the include file and splitting out the
spin-table configuration into a header, we add a couple of new headers together with two new DTs (GICv2+PSCI and GICv3+PSCI).

The new GICv3+PSCI DT has been boot tested, the remaining three (two of which existed prior to this patch) have been "tested" by decompiling the blobs and comparing them against a reference.

Quoted 6 lines
Quoted 1 line

How different are these from the ones hosted in [1] ?

They look like they were either independently written or diverged a long time ago. The existing kernel DTs describe hardware absent from the ARM TF ones and vice versa.

Quoted 6 lines

OK.

Quoted 2 lines

With specific reference to PSCI it looks like my patches could perhaps be improved by adding idle-state support.

Yes I know.

You want a v3 with it added?

Quoted 16 lines
Quoted 7 lines
Quoted 4 lines

On argument is that we want to take the DTS out of device tree as firmware is responsible for generating them. Alternatively, we may be duplicating resulting in discrepancies over time by coping it into kernel.

The general problem is copying from where?

Quoted 8 lines

The kernel DTs are a well maintained centralized repository which is *really* useful. git grep across the kernel DTs is a hugely powerful tool when trying to better understand an ecosystem as sprawling and diverse as ARMs. In fact I've even seen those sort of searchs used as a basis to clean up unused code. Seeing that centralized repository splinter into separate per-vendor silos would be a huge loss for kernel developers.

Quoted 3 lines

Agreed. But models are configurable and last time this discussion came up, some argued that the DTs must be modified based on the configuration automatically by models or some external scripts.

Indeed. I can definitely understand why the *models* might want to be bundled with DTs (or a DT generator, or a --just-give-me-a-working-dt-for-my-command-line-options-option).

Quoted 14 lines
Quoted 8 lines

<snip>
In other words, whilst people could discuss alternative ways to manage DTs[1], I can't see any universe where ARM TF would be a logical place to keep them.

[1] ... and I'd further suggest that only perhaps people who are ??? prepared to put resources into fixing it should convene such a ??? discussion.

While I agree with you, I am worried on the scalability. Models provide tons of options(may not be foundation platform but for sure the base AEM ones). It may so get unmanageable if we keep adding one DTS per configuration.

Quoted 5 lines

If we are OK restricting the set of configurations to what you have proposed, then it seems fine.

I will try to push this for v4.15, but I still want to hear more opinions on the scalability part here.

I'm sure you mean other peoples opinions ;-) (especially so, since after reading things back, I realized I expressed mine rather more forefully than intended) but I think there is a reason why PSCI is special... basically its to do with the docs.

I figured out how to use foundation model by reading the documentation. That documentation says "to run Linux go read the Linaro stuff". As it happens the Linaro "stuff" loops you through to a different ARM doc which tells you how to download ARM TF and bootloader binaries from Linaro. Thus if you follow the docs (and are patient enough) you come out the other side with a model running ARM TF and ready for PSCI.

At that point you're ready for mainline kernel development... and you wonder why there is only one CPU running ;-).

Daniel.

#9 lore raw
Quoted 70 lines · Daniel Thompson
Quoted 3 lines · Sudeep Holla

Sorry for late response, I thought I had sent this mail out long back but was sitting in my draft :(

No worries. I've been at Linaro connect this last week anyway.

Quoted 32 lines · Daniel Thompson
Quoted 23 lines · Sudeep Holla
Quoted 21 lines · Daniel Thompson
Quoted 16 lines

Currently if the Foundation model is running ARM Trusted Firmware then the kernel, which is configured to use spin tables, cannot start secondary
processors or "power off" the simulation.

After adding a couple of labels to the include file and splitting out the
spin-table configuration into a header, we add a couple of new headers together with two new DTs (GICv2+PSCI and GICv3+PSCI).

The new GICv3+PSCI DT has been boot tested, the remaining three (two of which existed prior to this patch) have been "tested" by decompiling the
blobs and comparing them against a reference.

Quoted 7 lines
Quoted 1 line

How different are these from the ones hosted in [1] ?

They look like they were either independently written or diverged a long time ago. The existing kernel DTs describe hardware absent from the ARM TF ones and vice versa.

Quoted 7 lines

OK.

Quoted 2 lines

With specific reference to PSCI it looks like my patches could perhaps be improved by adding idle-state support.

Yes I know.

You want a v3 with it added?

Quoted 17 lines
Quoted 16 lines
Quoted 4 lines

On argument is that we want to take the DTS out of device tree as firmware is responsible for generating them. Alternatively, we may be duplicating resulting in discrepancies over time by coping it into kernel.

The general problem is copying from where?

The kernel DTs are a well maintained centralized repository which is *really* useful. git grep across the kernel DTs is a hugely powerful tool when trying to better understand an ecosystem as sprawling and diverse as ARMs. In fact I've even seen those sort of searchs used as a basis to clean up unused code. Seeing that centralized repository splinter into separate per-vendor silos would be a huge loss for kernel developers.

Quoted 10 lines
Quoted 3 lines

Agreed. But models are configurable and last time this discussion came up, some argued that the DTs must be modified based on the configuration automatically by models or some external scripts.

Indeed. I can definitely understand why the *models* might want to be bundled with DTs (or a DT generator, or a --just-give-me-a-working-dt-for-my-command-line-options-option).

The UEFI firmware for the FVP models does implement automatic selection between a variety of builtin DTBs. I.e., FVP base or foundation model, with either GICv2 for GICv3. I think the maintainer of the binary releases chose not to enable this in the builds he distributes, but it is certainly unnecessary to fiddle with DT images if you build the firmware yourself (but you need to set DTB_DIR when building)

#10 lore raw
In reply to Daniel Thompson
Quoted 36 lines · Daniel Thompson
Quoted 2 lines · Sudeep Holla

Sorry for late response, I thought I had sent this mail out long back but was sitting in my draft :(

No worries. I've been at Linaro connect this last week anyway.

Quoted 29 lines · Daniel Thompson
Quoted 27 lines · Sudeep Holla
Quoted 13 lines · Daniel Thompson
Quoted 10 lines

Currently if the Foundation model is running ARM Trusted Firmware then the kernel, which is configured to use spin tables, cannot start secondary
processors or "power off" the simulation.

After adding a couple of labels to the include file and splitting out the
spin-table configuration into a header, we add a couple of new headers together with two new DTs (GICv2+PSCI and GICv3+PSCI).

Quoted 8 lines
Quoted 6 lines

The new GICv3+PSCI DT has been boot tested, the remaining three (two of
which existed prior to this patch) have been "tested" by decompiling the
blobs and comparing them against a reference.

How different are these from the ones hosted in [1] ?

They look like they were either independently written or diverged a long time ago. The existing kernel DTs describe hardware absent from the ARM TF ones and vice versa.

Quoted 9 lines
Quoted 6 lines

OK.

Quoted 2 lines

With specific reference to PSCI it looks like my patches could perhaps be improved by adding idle-state support.

Yes I know.

You want a v3 with it added?

No, that's fine. I have pushed this already [1] with Mark's ack for now. We can add it later after some testing, not urgent.

--
Regards,
Sudeep

[1] https://git.kernel.org/sudeep.holla/linux/h/for-next/juno