aboutsummaryrefslogtreecommitdiff
path: root/external/mambo/skiboot.tcl
AgeCommit message (Collapse)AuthorFilesLines
2017-12-20Mambo: run hello_world and sreset_world tests with Secure and Trusted BootStewart Smith1-1/+1
We *disable* the secure boot part, but we keep the verified boot part as we don't currently have container verification code for Mambo. We can run a small part of the code currently though. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-11-30mambo: Add support for NUMAMichael Ellerman1-0/+25
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 <mpe@ellerman.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-09-12skiboot/skiboot.tcl: Add imc device nodes to skiboot.tclMadhavan Srinivasan1-0/+82
Add In-Memory Collection counter dummy nodes to the skiboot.tcl to aid code testing in mambo for both OPAL and Kernel side enablement. Signed-off-by: Madhavan Srinivasan <maddy@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-06-19mambo: Update P9 PVR to reflect Scale out 24 core chipsMichael Neuling1-2/+2
The P9 PVR bits 48:51 don't indicate a revision but instead different configurations. From BookIV we have: Bits: Configuration 0: Scale out 12 cores 1: Scale out 24 cores 2: Scale up 12 cores 3: Scale up 24 cores Skiboot will mostly the use "Scale out 24 core" configuration (ie. SMT4 not SMT8) so reflect this in mambo. Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-06-14mambo: Create multiple chips when we have multiple CPUsMichael Ellerman1-1/+11
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@ellerman.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-06-08mambo: fix cpio/initramfs reservationStewart Smith1-0/+1
We didn't init cpio_size in the no cpio case. Fixes: 52aed80bddd5eed94c537f2bb0b846e4b5683728 Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-06-08mambo: Add a reservation for the initramfsOliver O'Halloran1-0/+5
On most systems the initramfs is loaded inside the part of memory reserved for the OS [0x0-0x30000000] and skiboot will never touch it. On mambo it's loaded at 0x80000000 and if you're unlucky skiboot can allocate over the top of it and corrupt the initramfs blob. There might be the downside that the kernel cannot re-use the initramfs memory since it's marked as reserved, but the kernel might also free it anyway. Fixes: 65612f120735 Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Tested-by: Michael Ellerman <mpe@ellerman.id.au> [stewart@linux.vnet.ibm.com: add Fixes] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-05-31mambo: Allow loading multiple CPIOsMichael Ellerman1-4/+10
Currently we have support for loading a single CPIO and telling Linux to use it as the initrd. But the Linux code actually supports having multiple CPIOs contiguously in memory, between initrd-start and end, and will unpack them all in order. That is a really nice feature as it means you can have a base CPIO with your root filesystem, and then tack on others as you need for various tests etc. So expand the logic to handle SKIBOOT_INITRD, and treat it as a comma separated list of CPIOs to load. I chose comma as it's fairly rare in filenames, but we could make it space, colon, whatever. Or we could add a new environment variable entirely. The code also supports trimming whitespace from the values, so you can have "cpio1, cpio2". Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-05-19mambo: Add skiboot/linux symbol lookupOliver O'Halloran1-0/+16
Adds the skisym and linsym commands which can be used to find the address of a Linux or Skiboot symbol. To function this requires the user to provide the SKIBOOT_MAP and VMLINUX_MAP environmental variables which indicate which skiboot.map and System.map files should be used. Examples: Look up a symbol address: systemsim % skisym .load_and_boot_kernel 0x0000000030013a08 Set a breakpoint there: systemsim % b [skisym .load_and_boot_kernel] breakpoint set at [0:0]: 0x0000000030013a08 (0x0000000030013A08) Enc:0x7D800026 : mfcr r12 Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-05-03mambo: Fix reserved-ranges nodeOliver O'Halloran1-0/+4
The DT bindings for the /reserved-memory node requires that it: a) Has #size-cells equal to the root b) Has #address-cells equal to the root c) Has an empty ranges property (i.e directly maps on the root) Currently we do not assign any of these when generating the Mambo device tree which causes the booted kernel to ignore the reservations in the /reserved-memory node. Fixes: b7b5302af737 Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-04-07mambo: Allow setting the Linux command line from the environmentMichael Ellerman1-1/+5
For automated testing it's helpful to be able to set the Linux command line via an environment variable. Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-03-24mambo: No need to explicitly look for env(SKIBOOT)Michael Ellerman1-3/+0
We don't need to explicitly check for the SKIBOOT environment variable, the existing code that does: mconfig boot_image SKIBOOT ../../skiboot.lid Will do that for us, using the content of SKIBOOT if it's set, otherwise falling back to ../../skiboot.lid. Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-02-22external/mambo: add device tree fixup for POWER9 stop levelsNicholas Piggin1-0/+7
Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Reviewed-by: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-12-13mambo: fake NVRAM supportChris Smart1-1/+21
This re-configures the Mambo platform to use the new fake NVRAM introduced by Jack Miller <jack@codezen.org> in commit: mambo: Add Fake NVRAM driver An existing NVRAM file can be loaded by pointing SKIBOOT_NVRAM environment variable to the file when running Mambo. If no NVRAM file is provided, the default is set to 256Kb and will be formatted automatically by Skiboot on boot, e.g.: [ 0.000975501,5 ] NVRAM: Size is 256 KB [ 0.002292860,3 ] NVRAM: Partition at offset 0x0 has incorrect 0 length [ 0.002298792,3 ] NVRAM: Re-initializing (size: 0x00040000) This has been tested in Mambo, on bare metal Linux, as well as OpenPower BMC machines. Signed-off-by: Chris Smart <chris@distroguy.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-10-17mambo: Advertise available RADIX page sizesChris Smart1-2/+16
This adds a device tree entry which advertises additional support for 2M and 1G pages in a PAPR compliant manner. Without this, the kernel will default to only 4K and 64K page sizes. With this patch, 1G (0x40000000) pages for linear mapping will be used. This can be seen by when checking the output of "Mapping range" in the kernel log: # dmesg |grep "Mapping range" Mapping range 0x0 - 0x100000000 with 0x40000000 Without this patch, the kernel will use 64K (0x10000) instead: # dmesg |grep "Mapping range" Mapping range 0x0 - 0x100000000 with 0x10000 Signed-off-by: Chris Smart <chris@distroguy.com> Acked-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-10-11v2 mambo: Add section for kernel command line boot argsChris Smart1-0/+4
Users can set kernel command line boot arguments for Mambo in a tcl script. This adds a place holder at the bottom of the skiboot.tcl script so that users know what format to use. Signed-off-by: Chris Smart <chris@distroguy.com> Acked-by: Balbir Singh <bsingharora@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-10-10Add software STB "ROM" implementation for MamboStewart Smith1-0/+28
Pass SKIBOOT_ENABLE_MAMBO_STB=1 as environment variable to skiboot.tcl and the tcl will enable the /ibm,secureboot node, enabling hash and signature "verification" for that mambo session. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-09-16mambo: Make POWER9 look like DD2Michael Neuling1-1/+2
In a recent Linux (next) change we added support for Radix Tree Size (RTS) encodings for different POWER9 revs. Linux commit: commit 694c4951922d114e789f669deb409b2aef440ae9 Author: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Date: Wed Aug 24 15:03:37 2016 +0530 powerpc/mm/radix: Use different RTS encoding for different POWER9 revs In mambo, we support the DD2 encoding of RTS but the PVR we advertise is DD1. Hence Linux uses the wrong RTS encoding and we don't boot. This fixes mambo to use the POWER9 DD2 PVR encoding. Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-09-02external/mambo: Update skiboot.tcl to add page-sizes nodes to device treeSuraj Jitindar Singh1-0/+14
Currently skiboot.tcl doesn't add device tree nodes ibm,processor-page-sizes or ibm,segment-page-sizes. This results in failure when trying to boot a P8 guest using kvm in mambo. Update skiboot.tcl in order to have it add these device tree nodes. The values for these properties were taken from those hard-coded into skiboot in hdata/cpu-common.c:78; the format was preserved for readability and to make it obvious where these values came from. With this change it is possible to boot a P8 kvm guest in mambo. Signed-off-by: Suraj Jitindar Singh <sjitindarsingh@gmail.com> Acked-By: Michael Neuling <mikey@neuling.org> Reviewed-by: Balbir Singh <bsingharora@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-07-28mambo: Update Radix Tree Size as per ISA 3.0Michael Neuling1-1/+1
Fix Radix Tree Size (RTS) encoding as per ISA 3.0. This is controlled via a SIM_CTRL1 bit in mambo. In Linux we recently changed to this encoding, so we no longer boot. The associated Linux commit is: commit b23d9c5b9c83c05e013aa52460f12a8365062cf4 Author: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Date: Fri Jun 17 11:40:36 2016 +0530 powerpc/mm/radix: Update Radix tree size as per ISA 3.0 Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-07-05mambo: Run at fastest speed.Michael Neuling1-2/+2
Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-07-01mambo: Add support for POWER9Michael Neuling1-2/+31
Ensures the simulator is configured correctly and we advertise the right features via the device tree. Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-04-28mambo: Remove reliance on env(SIMHOST)Michael Neuling1-5/+3
The SIMHOST environment variable is not present in all version of mambo. This removes the reliance on it and instead uses the "display default_configure" command to find the simulator type. Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-04-18mambo: Flatten device tree at the endMichael Neuling1-4/+3
Flatten device tree at the end to ensure we've configured everything first. Otherwise we may get an old dump of the device tree in skiboot. Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-04-18mambo: Increase memory to 4GB and change memory mapMichael Neuling1-2/+4
Increase memory in the sim to 4GB up from 1GB. We need to turn off the small RAM and ROM in mambo as that sits at 3.75GB currently. We don't use these currently. Also change where we put the CPIO to give ourselves more space. Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-04-17mambo: Enable multicore configurationsMichael Neuling1-13/+23
This enables multicore configurations in mambo. You can change the number of cores in mambo by changing the line: mconfig cpus CPUS 1 To do this, we need to sanitise the PIR that mambo sets and fixup the ibm,ppc-interrupt-server#s properties. Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-01-15external/mambo: Load skiboot already offsetMichael Neuling1-2/+2
Load skiboot already offset at 768MB so that it doesn't need to relocate itself. This shaves about 1M instructions off boot time. Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-10-21mambo: Auto start the simulator using SKIBOOT_AUTORUNMichael Neuling1-0/+4
Automatically start the simulator using the SKIBOOT_AUTORUN environment variable. Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-10-21mambo: Add SKIBOOT_SIMCONF for additional configurationMichael Neuling1-0/+4
Add ability to add additional configuration information using the SKIBOOT_SIMCONF environment variable. Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-10-21mambo: Advertise the sim supports 256M and 1TB segments in device treeMichael Neuling1-0/+2
Advertise the sim supports 256M and 1TB segments in device tree. If we don't have this, Linux will default to 256MB segments. Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-10-21mambo: Add ability to load initrdMichael Neuling1-0/+11
Add ability to load initrd using SKIBOOT_INITRD environment variable. Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-10-21mambo: Make PVR change only on p8Michael Neuling1-1/+5
Only make PVR change when running on the POWER8 simulator. Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-10-21mambo: Use SIMHOST to determine the simulator typeMichael Neuling1-2/+4
Use SIMHOST to determine the simulator type. This means we can support past and future sims other than P8. Signed-off-by: Michael Neuling <mikey@neuling.org> [stewart@linux.vnet.ibm.com: support environments without SIMHOST] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-10-21mambo: Use alternate skiboot.lid with SKIBOOTMichael Neuling1-0/+3
Make it possible to use an alternate skiboot.lid by setting the SKIBOOT environment variable. Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-08-21external/mambo: Update PVR valueSamuel Mendoza-Jonas1-0/+1
Running little-endian kernels in mambo requires HILE to be set properly, which requires a bump in the machine's pvr value to a DD2.x chip. Reported-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-05-25Refactor mambo test runningStewart Smith1-2/+0
we now properly control the simulation rather than just killing off Mambo. For boot test, we wait for petitboot and actually shut down the simulation properly with 'halt'. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-03-31mambo: Make mambo_utils.tcl optionalMichael Ellerman1-5/+8
Only source mambo_utils.tcl if we can find it. This allows using skiboot.tcl from another directory, which is useful for automated testing. We need to open code the body of "ton" and "c" obviously, in case we didn't find skiboot.tcl. Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-03-31mambo: Exit mambo when the simulation is stoppedMichael Ellerman1-2/+1
When the simulation runs to completion, exit mambo. In addition to the previous patch this allows "halt" on the Linux command line to stop the simulation and exit mambo. Note that this only takes effect if the "mysim go" is left to run until the simulation is stopped. If the user interrupts the simulation, eg. with Ctrl-C, to inspect state, then the exit has no effect. Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-12-15mambo: Get the zImage from an environment variableMichael Ellerman1-1/+4
Rather than hard coding /tmp/zImage.epapr, get the zImage from an environment variable. This is a) cleaner, and b) allows running multiple copies of the simulator against different kernels simultaneously. Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-12-06Improve mambo configBenjamin Herrenschmidt1-3/+71
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-12-01Add scripts to run from MamboBenjamin Herrenschmidt1-0/+107
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>