Age | Commit message (Collapse) | Author | Files | Lines |
|
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Someone was a bit too keen with the cleanups last time. Restore the
ability for pflash to build in non-shared mode.
Fixes: c327eddd9b29 (pflash: Clean up makefiles and resolve build race)
Signed-off-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
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>
|
|
I accidentally built myself a cross-toolchain with the musl libc. It does
not support on_exit which we use to clean up in pflash.
Instead use atexit with is supported by both uclibc, musl and glibc.
Signed-off-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
The pflash build process has regressed from when the were last fixed in
6c21c4ffaf82.
This patch resolves that issue and performs some cleanups:
- Remove duplicated rules. Patches had moved rules into common files,
but forgotten to remove them from the pflash makefiles.
- Make assignements simply expanded variables where possible. Form the
make manual:
Functions referenced in the definition will be executed every time
the variable is expanded. This makes make run slower; worse, it
causes the wildcard and shell functions to give unpredictable
results because you cannot easily control when they are called, or
even how many times.
To avoid all the problems and inconveniences of recursively
expanded variables, there is another flavor: simply expanded
variables.
- set the 'shared' target as a dependency of the libflash objects. This
was the final piece to resolve the race condition.
The failed build could be reproduced by doing a `git clean -f -x` and
then running the following:
$ make -j 32 CROSS_COMPILE=arm-linux-gnueabi- SKIBOOT_VERSION=5.2.4
PFLASH_VERSION=5.2.4 V=1 -C external/pflash all LINKAGE=dynamic
make: Entering directory '/home/joel/dev/skiboot/external/pflash'
ln -sf ../../libflash ./libflash
ln -sf ../../ccan ./ccan
ln -sf ../common ./common
cc -O2 -Wall -I. -c pflash.c -o pflash.o
cc -O2 -Wall -I. -c progress.c -o progress.o
make -C ../shared
make[1]: Entering directory '/home/joel/dev/skiboot/external/shared'
ln -sf ../../hw/ast-bmc/ast-sf-ctrl.c common/ast-sf-ctrl.c
ln -sf ../../include/ast.h common/ast.h
ln -sf arch_flash_arm_io.h common/io.h
cc -O2 -Wall -I. -c common/arch_flash_common.c -o
common-arch_flash_common.o
cc -O2 -Wall -I. -c common/arch_flash_arm.c -o common-arch_flash_arm.o
cc -O2 -Wall -I. -c common/ast-sf-ctrl.c -o common-ast-sf-ctrl.o
cc -O2 -Wall -I. -c version.c -o version.o
ld -r common-arch_flash_common.o common-arch_flash_arm.o
common-ast-sf-ctrl.o -o common-arch_flash.o
ln -sf ../../libflash ./libflash
ln -sf ../../ccan ./ccan
ln -sf ../common ./common
make[1]: *** No rule to make target 'libflash/file.c', needed by
'libflash-file.o'. Stop.
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory '/home/joel/dev/skiboot/external/shared'
rules.mk:25: recipe for target
'../shared/libflash.so.skiboot-5.2.4-1-g9f13f64c322f-joel-dirty-d5873ce'
failed
make: ***
[../shared/libflash.so.skiboot-5.2.4-1-g9f13f64c322f-joel-dirty-d5873ce]
Error 2
Signed-off-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Using the indent option on json dump extra whitespace
preceeds the newline in the json separator formatting.
We need to remove the extra whitespace when the
indent option is used to allow clean patch application.
Signed-off-by: Deb McLemore <debmc@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
This fixes the bt (back trace) command which had bit rot.
It also adds little endian support.
Format looks like this:
systemsim % bt
pc: 0x000000003007F270
lr: 0x000000003007EFAC
stack:0x0000000031C03B60 0x0000000031C03BF0
stack:0x0000000031C03C00 0x0000000030022F44
stack:0x0000000031C03C90 0x0000000030023000
stack:0x0000000031C03D20 0x0000000030039540
stack:0x0000000031C03E30 0x00000000300145BC
stack:0x0000000031C03F00 0x000000003000259C
Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
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>
|
|
Stewart has a great blog post on getting started with mambo and
skiboot. It would be better to have this content here so we can keep
it in sync with the code.
Original blog post here:
https://www.flamingspork.com/blog/2014/12/03/running-skiboot-opal-on-the-power8-simulator/
Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
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>
|
|
Arch headers need to be linked in before compiling.
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Currently, we're emitting a non-grouping bracket expression for %p
formats, which isn't supported by regex(7). This change uses the
grouping format instead. The creation of a group has no effect in the
fwts olog code, so this should have no consequence on matches.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Suggested-by: Daniel M Crowell <dcrowell@us.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
We currently aren't handling the 'll' length modifier, or widths
starting with zero (eg %016x). The former is becase we have the shorter
'l' match in the group first (so borking on the second l). The latter is
because we don't allow a leading zero on width matches.
This change fixes those issues.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
While reviewing the Debian packaging, codespell found those.
Most proposed fixes are based on codespell's default dictionnary.
Signed-off-by: Frederic Bonnard <frediz@linux.vnet.ibm.com>
Reviewed-by: Mukesh Ojha <mukesh02@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Modify the $(EXE) and install target dependencies if LINKAGE=dynamic.
The default remains a statically linked pflash binary.
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Building a dynamically linked pflash will need the shared library
name. Export it here.
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
-m64 isn't an ARM flag.
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
The install target used $(sbindir) which isn't set anywhere.
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
These are already defined just like we need them in common/rules.mk
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Reviewed-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
gard can be used on the BMC to query garded records, but currently
compile fails with :
cc -O2 -Wall -Werror -I. -c gard.c -o gard.o
gard.c: In function 'do_clear_i':
gard.c:421:12: error: format '%lx' expects argument of type 'long unsigned int', but argument 3 has type 'size_t' [-Werror=format]
gard.c: In function 'check_gard_partition':
gard.c:489:36: error: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'unsigned int' [-Werror=format]
This patches provides a fix compatible with x86, armel, ppc64.
Signed-off-by: Cédric Le Goater <clg@kaod.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Add command line parameters for passing into libflash to have
pflash manipulate a file rather than flash.
This is useful for testing.
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Reviewed-by: Cyril Bur <cyril.bur@au1.ibm.com>
|
|
Signed-off-by: Cédric Le Goater <clg@fr.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
The current pflash cmd-line option parsing has two flaws.
Firstly, the error reporting leaves quite a bit to be desired. That is, when
invalid options or argument are found, not much reporting is done. This patch
addresses this.
Secondly, pflash doesn't detect when there are leftovers in argv. This often
signals a typo in what the user meant to do and could lead to the wrong
outcome. For example: `pflash -e -p zImage.next - P BOOTKERNEL` will do quite
the wrong thing.
This patch addresses both issues.
Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Fixes: c51ceb9b9a380a7ed8e2af5b4d5e6c33386cd6f9
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
The fwts project has a facility to scan system logs for interesting
error messages, by matching on patterns in a JSON file. Recently, Deb
has added support for the OPAL msglog to fwts, called 'olog':
http://kernel.ubuntu.com/git/hwe/fwts.git/commit/?id=652b79b
However, we don't yet have any patterns for OPAL.
Rather than generate a separate set of patterns that may go stale, Anton
suggested that we may want to pull these directly from the OPAL source.
This change implements a parser to generate olog pattern definitions
from annotations in OPAL itself. For example, a check in the flash code
might look like:
if (!ffs) {
/**
* @fwts-label SystemFlashNoPartitionTable
* @fwts-advice OPAL Could not read a partition table on
* system flash. Since we've still booted the machine (which
* requires flash), check that we're registering the proper
* system flash device.
*/
prlog(PR_WARNING, "FLASH: attempted to register system flash "
"%s, wwhich has no partition info\n", name);
return;
}
By running generate-fwts-olog on the codebase, we get:
{
"olog_error_warning_patterns": [
{
"advice": "OPAL Could not read a partition table on system flash. Since we've still booted the machine (which requires flash), check that we're registering the proper system flash device.",
"compare_mode": "regex",
"label": "SystemFlashNoPartitionTable",
"level": "LOG_LEVEL_HIGH",
"pattern": "FLASH: attempted to register system flash .*, wwhich has no partition info"
}
]
}
- which is suitable for input to the fwts pattern definitions.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
[stewart@linux.vnet.ibm.com: squash trailing whitespace]
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
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>
|
|
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>
|
|
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>
|
|
Building opal-prd currently leaves the git tree dirty. This fixes it.
Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Currently, we don't describe the reserved area at the end of struct
host_interfaces; it's in the thunk, but not the struct itself.
This change adds the reserved area, and adds a set of runtime asserts to
ensure that the struct layout matches the thunk.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Acked-by: Balbir Singh <bsingharora@gmail.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
In boot_test.sh, use readlink when working out the path to source
{fsp,bmc}_support.sh, so the script doesn't fail when run using a symlink
from outside the boot-tests directory.
Signed-off-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
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>
|
|
The makefiles under external/* utilize the $(CROSS_COMPILE) variable
to determine the cross-compiler prefix. In a few places,
$(CROSS_COMPILE)gcc is called instead of $(CC). The issue with this is
that yocto build passes some compile flags as part of $(CC) instead of
$(CFLAGS), the most important of these is '--sysroot=...'. Without the
proper --sysroot flag, pflash compile fails to find critical libc
headers like stdio.h.
This change delegates setting of $(CC) and $(LD) to
external/common/rules.mk, which is widely used in the external tree, and
ensures that:
1) $(CC) is used instead of $(CROSS_COMPILE)gcc.
2) CC is only set when not passed from the environment.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Reviewed-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Some machines decide to go boot from the Golden side, and this means
we are not boot testing what we flash.
So, use the magic incantation and goat sacrifice that is IPMI raw commands
to boot from the primary side.
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
The current Makefile is a bit rustic compared to other skiboot
tools. This patch adds a proper install target and a new versioning
target.
Signed-off-by: Cédric Le Goater <clg@fr.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
commit 618a201ebf33 ("external: simplify help output in xscom
commands") broke the exit code in some paths.
Fixes: 618a201ebf33
Signed-off-by: Cédric Le Goater <clg@fr.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Fixes: e42206bf0729782330778e77283af2aca23499dc
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Move symlinking target to external/common/rules.mk, so the rule
could be reused by gard and opal-prd.
Signed-off-by: Dinar Valeev <dvaleev@suse.com>
Reviewed-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
The arch_flash_init() in arch_flash_x86.c doesn't actually check the return value
of file_init_path(), rather it is comparing the returned structure against NULL.
It is unsafe (and incorrect at the moment) to assume that file_init_path will
NULL this value on failure, it doesn't have to as it returns a value to
indicate success or failure.
The arch_flash_init() in arch_flash_powerpc.c calls file_init_path() through
another function which will return a pointer (or NULL on failure), this
function doesn't explicitly NULL its return pointer in the case that
file_init_path() fails. It has initialised the pointer to NULL so the case may
be less severe (compared to the arch_flash_x86 problem) as file_init_path()
shouldn't have changed it on failure case, however, assuming that it won't
is unsafe. It is best to explicitly NULL the return pointer if file_init_path()
returns a failure.
Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com>
Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Let's version like skiboot and other external tools do. There is no
need to generate a version.c file. Defining VERSION on the compile
commande line is enough.
Signed-off-by: Cédric Le Goater <clg@fr.ibm.com>
[stewart@linux.vnet.ibm.com: fix makefile CFLAGS so can be overwritten]
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
This kills a few booleans used to output version and help.
Suggested-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Signed-off-by: Cédric Le Goater <clg@fr.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Signed-off-by: Cédric Le Goater <clg@fr.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
The getsram command reads the OCC SRAM. This is useful for debug.
The code is totally inspired from the meltbox tool.
Signed-off-by: Cédric Le Goater <clg@fr.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Signed-off-by: Cédric Le Goater <clg@fr.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
We indicate when we have a user-driven event, so add corresponding
outputs for firmware-driven ones too.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|