[SLOF] [PATCH v1] Remove dependency on cpu/@0 for booting

Nikunj A Dadhania nikunj at linux.vnet.ibm.com
Wed Jul 27 19:16:02 AEST 2016


With the addition of cpu hotplug in QEMU, cpu at 0 can be removed as well.
SLOF should not depend on it. Find the first child in the "/cpus" node
and get the timer base frequency and set it as the chosen cpu as well

Reported-by: Bharata B Rao <bharata at linux.vnet.ibm.com>
Signed-off-by: Nikunj A Dadhania <nikunj at linux.vnet.ibm.com>
---
 board-qemu/slof/tree.fs | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/board-qemu/slof/tree.fs b/board-qemu/slof/tree.fs
index 78dafab..76a9ecc 100644
--- a/board-qemu/slof/tree.fs
+++ b/board-qemu/slof/tree.fs
@@ -45,7 +45,9 @@ device-end
 
 \ Fixup timebase frequency from device-tree
 : fixup-tbfreq
-    " /cpus/@0" find-device
+    " /cpus" find-device
+    get-node child dup 0= ABORT" CPU not found" THEN
+    set-node
     " timebase-frequency" get-node get-package-property IF
         2drop
     ELSE
@@ -167,7 +169,14 @@ populate-pci-busses
 
 6c0 cp
 
-s" /cpus/@0" open-dev encode-int s" cpu" set-chosen
+\ Do not assume that cpu0 is available
+: set-chosen-cpu
+    " /cpus" find-device
+    get-node child dup 0= ABORT" CPU not found" THEN
+    node>path open-dev encode-int s" cpu" set-chosen
+;
+set-chosen-cpu
+
 s" /memory at 0" open-dev encode-int s" memory" set-chosen
 
 6e0 cp
-- 
2.7.4



More information about the SLOF mailing list