[Skiboot] [PATCH 3/5] mambo: Create multiple chips when we have multiple CPUs

Michael Ellerman mpe at ellerman.id.au
Thu Jun 8 22:54:19 AEST 2017

Currently when we boot mambo with multiple CPUs, we create multiple CPU nodes in
the device tree, and each claims to be on a separate chip.

However we don't create multiple xscom nodes, which means skiboot only knows
about a single chip, and all CPUs end up on it. At the moment mambo is not able
to create multiple xscom controllers. We can create fake ones, just by faking
the device tree up, but that seems uglier than this solution.

So create a mambo-chip for each CPU other than 0, to tell skiboot we want a
separate chip created. This then enables Linux to see multiple chips:

  smp: Brought up 2 nodes, 2 CPUs
  numa: Node 0 CPUs: 0
  numa: Node 1 CPUs: 1

Signed-off-by: Michael Ellerman <mpe at ellerman.id.au>
 external/mambo/skiboot.tcl | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/external/mambo/skiboot.tcl b/external/mambo/skiboot.tcl
index 9ac765dbb6b5..cc5f25ece4e3 100644
--- a/external/mambo/skiboot.tcl
+++ b/external/mambo/skiboot.tcl
@@ -244,11 +244,21 @@ if { $default_config == "P9" } {
 set pir 0
 for { set c 0 } { $c < $mconf(cpus) } { incr c } {
     set cpu_node [mysim of find_device "/cpus/PowerPC@$pir"]
-    mysim of addprop $cpu_node int "ibm,chip-id" $c
     mysim of addprop $cpu_node int "ibm,pir" $pir
     set reg  [list 0x0000001c00000028 0xffffffffffffffff]
     mysim of addprop $cpu_node array64 "ibm,processor-segment-sizes" reg
+    mysim of addprop $cpu_node int "ibm,chip-id" $c
+    # Create a chip node to tell skiboot to create another chip for this CPU.
+    # This bubbles up to Linux which will then see a new chip (aka nid).
+    # For chip 0 the xscom node above has already definied chip 0, so skip it.
+    if { $c > 0 } {
+        set node [mysim of addchild $root_node "mambo-chip" [format %x $c]]
+        mysim of addprop $node int "ibm,chip-id" $c
+        mysim of addprop $node string "compatible" "ibm,mambo-chip"
+    }
     set reg {}
     lappend reg 0x0000000c 0x00000010 0x00000018 0x00000022
     mysim of addprop $cpu_node array "ibm,processor-page-sizes" reg

More information about the Skiboot mailing list