aboutsummaryrefslogtreecommitdiff
path: root/external
AgeCommit message (Collapse)AuthorFilesLines
2015-05-21external/opal-prd: Update for new PRD userspace interfaceJeremy Kerr1-12/+178
Previous updates to the opal-prd firmare interface have 1) added the message size into struct opal_prd_msg 2) split opal_prd_msg into a separate header struct 3) exposed the PRD ranges through the device-tree This update to the opal-prd binary will accommodate these interface changes. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-04-01external: create a GUARD partition parsing utilityCyril Bur5-0/+920
This utility is designed to run completely in userland linux and make use of OPAL APIs (exposed to userland via the linux MTD abstraction) to read, parse, display and optionally clear firmware GUARD partition information. The main intended use case is to have the tool run on the OpenPOWER machine and automatically detect the flash device containing the gard data and display information about the running system. The tool can also read a flash imagine contained in a specified file. The tool can also be used to parse just guard data not contained in a flash image but rather dumped to a file. The tool understands ECC and does its best to detect this automatically. There are three commands: - list: lists all the records - show: show more information about a specific record - clear: clear/erase a specific record or the entire flash. The tool makes some assumptions: - gard data is terminated by an entry containing all FF bytes. In the case of the tool detecting ECC it will always read with ECC correction so the final all FF record will still need to contain ECC bytes. - The GUARD partition will not have gaps, the clear code does shuffle entires up and set the last one to all FF bytes. Note: This tool has been named 'gard' because this is the traditional name for hardware that has been detected as faulty and has been 'gard'ed. It turns out that in the flash the partition is named 'GUARD'. Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com> Reviewed-by: Daniel Axtens <dja@axtens.net> [stewart@linux.vnet.ibm.com: add correct (C) header to gard.c] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-04-01external/opal-prd: Use link register for cross-endian branchJeremy Kerr1-3/+3
With the change to the official switch_endian system call, we lost preservation of the counter across the system call. This change uses the LR instead. It's preserved across the system call, and is going to be overwritten by the branch-and-link instruction anyway. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> 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>
2015-03-31external/opal-prd: Use "official" switch-endian syscallJeremy Kerr1-6/+14
The "fast endian switch" syscall was never fully supported - this change moves to the official switch-endian syscall, using __NR_switch_endian We also form the little-endian instructions using this prepreocessor define. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-03-26memboot: Add a memboot flash backendAlistair Popple1-0/+17
memboot uses bmc system memory instead of a real flash chip. This patch adds a flash backend for bmc system memory to allow use of the memboot tool (in external/memboot) to boot the system. Signed-off-by: Alistair Popple <alistair@popple.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-03-17external/opal-prd: Unify logging calls and log to syslogJeremy Kerr5-154/+287
This change unifies the printf/fprintf/warn/err/perror calls into: pr_log(level, fmt, ...). While doing this, add prefixes to each message, to signify the functionality that raised the log message. We also add syslog initialisation, so that we can log to the system-wide syslog facility. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-03-17external/opal-prd: Add a helper for module loadingJeremy Kerr5-5/+90
Rather than calling system("modprobe ...") in different locations, this change introduces an insert_module() helper function. We use this for the existing i2c modprobe, and add one for the ipmi devintf module too. We won't need the i2c-opal module, as it should be automatically loaded by the platform device. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-03-11Fixup "i" command in mambo scriptsBenjamin Herrenschmidt1-1/+1
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-03-04external/opal-prd: Correct partition offsetJoel Stanley1-8/+2
The start of the partition was not used when sending the size to the mtd_{read,write} calls. This meant they were unconditionally reading and writing to the start of the flash, instead of the partition. Signed-off-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
2015-03-04external/opal-prd: Allow partial ops with PNOR APIJoel Stanley2-10/+26
The PNOR operations will now return the number of bytes successfully written, which may be less than the number of bytes requested, similar to read(2) and write(2). The hostboot interface is updated with this information. The signature does not change. Signed-off-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
2015-03-04external/opal-prd: Enhance PNOR error messagesJoel Stanley1-17/+26
Provide detailed feedback when encountering errors in the PNOR code. Signed-off-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
2015-03-04external/opal-prd: NULL-out FSP-only callbacksJeremy Kerr2-33/+9
The HBRT code will check for NULL callbacks, so don't provide them in the hinterface table. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
2015-03-04external/opal-prd: Fix prototypes of i2c read/write callbacksJeremy Kerr1-4/+4
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
2015-03-04external/opal-prd: Add install targetJeremy Kerr1-0/+6
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
2015-03-04external/opal-prd: Add asm directory for opal-prd linkJeremy Kerr1-0/+2
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
2015-03-04external/opal-prd: Add userspace support for PRD facilityJeremy Kerr12-0/+2775
This change adds an application in external/opal-prd, implementing the userspace portion of a PRD stack. This code is responsible for loading the HBRT code from reserved memory, and provding hostboot runtime functionality through a set of callbacks. Because we may be running little-endian (and expect the HBRT code to be big-endian), we need to thunk the endianness between calls through the HBRT interface. Includes multiple contributions from: Joel Stanley <joel@jms.id.au> Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com> Benjamin Herrenschmidt <benh@kernel.crashing.org Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com> Signed-off-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> [stewart@linux.vnet.ibm.com: squash trailing whitespace] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-02-26external/pflash: libflash needs ecc.oJeremy Kerr1-1/+1
Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Reviewed-By: Joel Stanley <joel@jms.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-02-23libffs: Add ecc parameter on ffs_part_info()Michael Neuling1-2/+2
Add ecc parmenter to ffs_part_info() to indicate if the partition is ECC protected or not. Fix all call sites. Signed-off-by: Michael Neuling <mikey@neuling.org> 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-02esel: Add a logging backend for bmc based machinesAlistair Popple1-0/+55
This patch adds a backend for bmc based machines running AMI firmware supporting the OEM extended sel commands. Errors are logged in pel format to the bmc. Signed-off-by: Alistair Popple <alistair@popple.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-12-01Add scripts to run from MamboBenjamin Herrenschmidt2-0/+362
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-11-28More trace endian fixes so make check works againBenjamin Herrenschmidt1-1/+1
We need the core to do proper endian among others since that code is compiled in run-trace Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-11-26Various fixes to dump_tracesBenjamin Herrenschmidt3-33/+41
Endian breakage, build breakage, ... Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-11-14external: Add the memboot utilityAlistair Popple3-0/+171
The memboot tool is a small utility designed to be run on the ASPEED BMC used in some OpenPower systems. It allows you to boot the P8 host from the main system memory of the BMC rather than from the flash memory. Signed-off-by: Alistair Popple <alistair@popple.id.au> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-11-14Import pflash 0.8.6Benjamin Herrenschmidt12-0/+1637
We share code, it's easier to maintain it this way Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-11-13external: Add xscom utilitiesBenjamin Herrenschmidt5-0/+455
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-10-21Fix make check after Ben broke it with external/* -> external/trace/ renameStewart Smith1-1/+1
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-10-20Move external trace stuff to a subdirectoryBenjamin Herrenschmidt4-0/+0
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-07-02Initial commit of Open Source releaseBenjamin Herrenschmidt4-0/+329
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>