pvmfw: Parse cpu-map DT node for the guest

Support a subset of all possible topologies[*] where the guest sees a
set of clusters of cores with the usual read-then-patch approach. Note
that no separate validation is required as parsing ensures that the
nodes within a cluster properly start from 0 and are contiguous (same
for clusters) and that they point to valid CPU nodes. Extra properties,
if any are ignored.

Add labels to the cpu nodes so that DTC generates phandles for them,
which pvmfw can then use when patching the cpu-map node in the template
DT.

[*]: https://www.kernel.org/doc/Documentation/devicetree/bindings/cpu/cpu-topology.txt

Bug: 284369518
Test: m pvmfw
Change-Id: Ia70a73545b1740a3343ce7f0e4549da456cd6d55
diff --git a/pvmfw/platform.dts b/pvmfw/platform.dts
index 569d20a..275a1c9 100644
--- a/pvmfw/platform.dts
+++ b/pvmfw/platform.dts
@@ -52,7 +52,35 @@
 	cpus {
 		#address-cells = <1>;
 		#size-cells = <0>;
-		cpu@0 {
+
+		cpu-map {
+			cluster0 {
+				core0 { cpu = <PLACEHOLDER>; };
+				core1 { cpu = <PLACEHOLDER>; };
+				core2 { cpu = <PLACEHOLDER>; };
+				core3 { cpu = <PLACEHOLDER>; };
+				core4 { cpu = <PLACEHOLDER>; };
+				core5 { cpu = <PLACEHOLDER>; };
+			};
+			cluster1 {
+				core0 { cpu = <PLACEHOLDER>; };
+				core1 { cpu = <PLACEHOLDER>; };
+				core2 { cpu = <PLACEHOLDER>; };
+				core3 { cpu = <PLACEHOLDER>; };
+				core4 { cpu = <PLACEHOLDER>; };
+				core5 { cpu = <PLACEHOLDER>; };
+			};
+			cluster2 {
+				core0 { cpu = <PLACEHOLDER>; };
+				core1 { cpu = <PLACEHOLDER>; };
+				core2 { cpu = <PLACEHOLDER>; };
+				core3 { cpu = <PLACEHOLDER>; };
+				core4 { cpu = <PLACEHOLDER>; };
+				core5 { cpu = <PLACEHOLDER>; };
+			};
+		};
+
+		cpu0: cpu@0 {
 			device_type = "cpu";
 			compatible = "arm,arm-v8";
 			enable-method = "psci";
@@ -84,7 +112,7 @@
 				opp20 { opp-hz = <PLACEHOLDER2>; };
 			};
 		};
-		cpu@1 {
+		cpu1: cpu@1 {
 			device_type = "cpu";
 			compatible = "arm,arm-v8";
 			enable-method = "psci";
@@ -116,7 +144,7 @@
 				opp20 { opp-hz = <PLACEHOLDER2>; };
 			};
 		};
-		cpu@2 {
+		cpu2: cpu@2 {
 			device_type = "cpu";
 			compatible = "arm,arm-v8";
 			enable-method = "psci";
@@ -148,7 +176,7 @@
 				opp20 { opp-hz = <PLACEHOLDER2>; };
 			};
 		};
-		cpu@3 {
+		cpu3: cpu@3 {
 			device_type = "cpu";
 			compatible = "arm,arm-v8";
 			enable-method = "psci";
@@ -180,7 +208,7 @@
 				opp20 { opp-hz = <PLACEHOLDER2>; };
 			};
 		};
-		cpu@4 {
+		cpu4: cpu@4 {
 			device_type = "cpu";
 			compatible = "arm,arm-v8";
 			enable-method = "psci";
@@ -212,7 +240,7 @@
 				opp20 { opp-hz = <PLACEHOLDER2>; };
 			};
 		};
-		cpu@5 {
+		cpu5: cpu@5 {
 			device_type = "cpu";
 			compatible = "arm,arm-v8";
 			enable-method = "psci";
@@ -244,7 +272,7 @@
 				opp20 { opp-hz = <PLACEHOLDER2>; };
 			};
 		};
-		cpu@6 {
+		cpu6: cpu@6 {
 			device_type = "cpu";
 			compatible = "arm,arm-v8";
 			enable-method = "psci";
@@ -276,7 +304,7 @@
 				opp20 { opp-hz = <PLACEHOLDER2>; };
 			};
 		};
-		cpu@7 {
+		cpu7: cpu@7 {
 			device_type = "cpu";
 			compatible = "arm,arm-v8";
 			enable-method = "psci";
@@ -308,7 +336,7 @@
 				opp20 { opp-hz = <PLACEHOLDER2>; };
 			};
 		};
-		cpu@8 {
+		cpu8: cpu@8 {
 			device_type = "cpu";
 			compatible = "arm,arm-v8";
 			enable-method = "psci";
@@ -340,7 +368,7 @@
 				opp20 { opp-hz = <PLACEHOLDER2>; };
 			};
 		};
-		cpu@9 {
+		cpu9: cpu@9 {
 			device_type = "cpu";
 			compatible = "arm,arm-v8";
 			enable-method = "psci";
@@ -372,7 +400,7 @@
 				opp20 { opp-hz = <PLACEHOLDER2>; };
 			};
 		};
-		cpu@10 {
+		cpu10: cpu@10 {
 			device_type = "cpu";
 			compatible = "arm,arm-v8";
 			enable-method = "psci";
@@ -404,7 +432,7 @@
 				opp20 { opp-hz = <PLACEHOLDER2>; };
 			};
 		};
-		cpu@11 {
+		cpu11: cpu@11 {
 			device_type = "cpu";
 			compatible = "arm,arm-v8";
 			enable-method = "psci";
@@ -436,7 +464,7 @@
 				opp20 { opp-hz = <PLACEHOLDER2>; };
 			};
 		};
-		cpu@12 {
+		cpu12: cpu@12 {
 			device_type = "cpu";
 			compatible = "arm,arm-v8";
 			enable-method = "psci";
@@ -468,7 +496,7 @@
 				opp20 { opp-hz = <PLACEHOLDER2>; };
 			};
 		};
-		cpu@13 {
+		cpu13: cpu@13 {
 			device_type = "cpu";
 			compatible = "arm,arm-v8";
 			enable-method = "psci";
@@ -500,7 +528,7 @@
 				opp20 { opp-hz = <PLACEHOLDER2>; };
 			};
 		};
-		cpu@14 {
+		cpu14: cpu@14 {
 			device_type = "cpu";
 			compatible = "arm,arm-v8";
 			enable-method = "psci";
@@ -532,7 +560,7 @@
 				opp20 { opp-hz = <PLACEHOLDER2>; };
 			};
 		};
-		cpu@15 {
+		cpu15: cpu@15 {
 			device_type = "cpu";
 			compatible = "arm,arm-v8";
 			enable-method = "psci";