From patchwork Thu Oct 12 10:42:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Ellerman X-Patchwork-Id: 824781 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yCS9J5fnvz9t38 for ; Thu, 12 Oct 2017 21:42:44 +1100 (AEDT) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3yCS9J3hzNzDr6L for ; Thu, 12 Oct 2017 21:42:44 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from ozlabs.org (ozlabs.org [IPv6:2401:3900:2:1::2]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3yCS993DW2zDr4T for ; Thu, 12 Oct 2017 21:42:37 +1100 (AEDT) Received: by ozlabs.org (Postfix, from userid 1034) id 3yCS992NgVz9t2l; Thu, 12 Oct 2017 21:42:37 +1100 (AEDT) From: Michael Ellerman To: skiboot@lists.ozlabs.org Date: Thu, 12 Oct 2017 21:42:31 +1100 Message-Id: <1507804951-18155-1-git-send-email-mpe@ellerman.id.au> X-Mailer: git-send-email 2.7.4 Subject: [Skiboot] [PATCH] mambo: Add support for NUMA X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.24 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Currently the mambo scripts can do multiple chips, but only the first ever has memory. This patch adds support for having memory on each chip, with each appearing as a separate NUMA node. Each node gets MEM_SIZE worth of memory. It's opt-in, via export MAMBO_NUMA=1. Signed-off-by: Michael Ellerman --- external/mambo/skiboot.tcl | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/external/mambo/skiboot.tcl b/external/mambo/skiboot.tcl index ad10355a8551..abceb749537e 100644 --- a/external/mambo/skiboot.tcl +++ b/external/mambo/skiboot.tcl @@ -13,6 +13,10 @@ mconfig cpus CPUS 1 mconfig threads THREADS 1 mconfig memory MEM_SIZE 4G +# Create multiple memory nodes? This will create a MEM_SIZE region +# on each chip (CPUS above). +mconfig numa MAMBO_NUMA 0 + # Should we stop on an illeagal instruction mconfig stop_on_ill MAMBO_STOP_ON_ILL false @@ -80,12 +84,26 @@ myconf config machine_option/NO_ROM TRUE if { $default_config == "PEGASUS" } { # We need to be DD2 or greater on p8 for the HILE HID bit. myconf config processor/initial/PVR 0x4b0201 + + if { $mconf(numa) } { + myconf config memory_region_id_shift 35 + } } + if { $default_config == "P9" } { # PVR configured for POWER9 DD2.0 Scale out 24 Core (ie SMT4) myconf config processor/initial/PVR 0x4e1200 myconf config processor/initial/SIM_CTRL1 0xc228000400000000 + + if { $mconf(numa) } { + myconf config memory_region_id_shift 45 + } +} + +if { $mconf(numa) } { + myconf config memory_regions $mconf(cpus) } + if { [info exists env(SKIBOOT_SIMCONF)] } { source $env(SKIBOOT_SIMCONF) } @@ -257,6 +275,13 @@ for { set c 0 } { $c < $mconf(cpus) } { incr c } { 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" + + if { $mconf(numa) } { + set shift [myconf query memory_region_id_shift] + set addr [format %lx [expr (1 << $shift) * $c]] + set node [mysim of find_device "/memory@$addr"] + mysim of addprop $node int "ibm,chip-id" $c + } } set reg {}