aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Neuling <mikey@neuling.org>2022-02-04 18:01:08 +1100
committerCédric Le Goater <clg@kaod.org>2022-02-04 08:35:25 +0100
commitfa732a8462b5541b29c3b4b4e65d95e2c964b698 (patch)
treedf09224ff4c413172db201cd1b817dc7b8e9225f
parent81aa2af275c5ebef082ad8d418517001544ebd4d (diff)
downloadskiboot-fa732a8462b5541b29c3b4b4e65d95e2c964b698.zip
skiboot-fa732a8462b5541b29c3b4b4e65d95e2c964b698.tar.gz
skiboot-fa732a8462b5541b29c3b4b4e65d95e2c964b698.tar.bz2
external/mambo: Handle greater than 16 CPUs
In OF mambo pads zeros in the CPU node names. So if you have more than 16 CPUs, the first core will be at /cpus/PowerPC@00. Currently we always look for /cpus/PowerPC@0. Fix by zero padding based on the max CPU count. This also converts to hex since that's what's actually needed. This fix should handle any topology. I've tested upto 128 threads (16 cores * 8 threads) but past that the mambo I have starts throwing internal errors. Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Cédric Le Goater <clg@kaod.org>
-rw-r--r--external/mambo/skiboot.tcl5
1 files changed, 4 insertions, 1 deletions
diff --git a/external/mambo/skiboot.tcl b/external/mambo/skiboot.tcl
index ebabeb7..33a892d 100644
--- a/external/mambo/skiboot.tcl
+++ b/external/mambo/skiboot.tcl
@@ -466,8 +466,11 @@ add_feature_node $np "inst-l1d-flush-ori30,30,0" $mconf(inst_l1d_flush_ori30)
# Init CPUs
set pir 0
+set pirmax [expr $mconf(cpus) * $mconf(threads)]
+set pirbits [expr int(ceil(log($pirmax) / log (16)))]
for { set c 0 } { $c < $mconf(cpus) } { incr c } {
- set cpu_node [mysim of find_device "/cpus/PowerPC@$pir"]
+ set p [format "%0${pirbits}x" $pir]
+ set cpu_node [mysim of find_device "/cpus/PowerPC@$p"]
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