[U-Boot] [PATCH v12 1/6] sandbox: Put CPUs under a cpu-bus node

Simon Glass sjg at chromium.org
Tue Nov 6 22:57:39 UTC 2018


The CPU uclass expects that all CPUs have a parent device which is a
cpu-bus. Fix up the sandbox test DT to follow this convention. This allow
the code in smbios_write_type4_dm() to work, since it calls
dev_get_parent_platdata() on each CPU.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

Changes in v12:
- Update CPU nodes to comply with the DT spec

Changes in v11:
- Add a new patch to put CPUs under a cpu-bus node

Changes in v9: None
Changes in v7: None
Changes in v5: None
Changes in v4: None
Changes in v3: None

 arch/sandbox/dts/test.dts | 38 ++++++++++++++++++++++++++++++--------
 1 file changed, 30 insertions(+), 8 deletions(-)

diff --git a/arch/sandbox/dts/test.dts b/arch/sandbox/dts/test.dts
index 57e0dd76631..bec912f917f 100644
--- a/arch/sandbox/dts/test.dts
+++ b/arch/sandbox/dts/test.dts
@@ -344,16 +344,38 @@
 		mbox-names = "other", "test";
 	};
 
-	cpu-test1 {
-		compatible = "sandbox,cpu_sandbox";
-	};
+	cpus {
+		#address-cells = <1>;
+		#size-cells = <0>;
 
-	cpu-test2 {
-		compatible = "sandbox,cpu_sandbox";
-	};
+		cpu at 0 {
+			reg = <0>;
+			compatible = "sandbox,cpu_sandbox";
+			device-type = "cpu";
 
-	cpu-test3 {
-		compatible = "sandbox,cpu_sandbox";
+			/*
+			 * These are not used by sandbox, but are required by
+			 * the latest DT spec (v0.2).
+			 */
+			clock-frequency = <0>;
+			timebase-frequency = <0>;
+		};
+
+		cpu at 1 {
+			reg = <1>;
+			compatible = "sandbox,cpu_sandbox";
+			device-type = "cpu";
+			clock-frequency = <0>;
+			timebase-frequency = <0>;
+		};
+
+		cpu at 2 {
+			reg = <2>;
+			compatible = "sandbox,cpu_sandbox";
+			device-type = "cpu";
+			clock-frequency = <0>;
+			timebase-frequency = <0>;
+		};
 	};
 
 	misc-test {
-- 
2.19.1.930.g4563a0d9d0-goog



More information about the U-Boot mailing list