aboutsummaryrefslogtreecommitdiff
path: root/external
AgeCommit message (Collapse)AuthorFilesLines
2016-08-01Adopt libtool rules for soname versioning for libflashStewart Smith1-1/+18
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-07-28pflash: Fix the makefileJoel Stanley1-9/+17
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>
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-28pflash: use atexit for musl compatibilityJoel Stanley1-3/+2
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>
2016-07-27pflash: Clean up makefiles and resolve build raceJoel Stanley3-21/+20
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>
2016-07-22fwts/generate-fwts-olog: Fix whitespace on json.dumpsDeb McLemore1-0/+1
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>
2016-07-20mambo: Fix bt command and add little endian supportMichael Neuling1-8/+32
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>
2016-07-12make remaining noisy tests quietStewart Smith1-3/+3
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 README.md for skiboot.tclMichael Neuling1-0/+57
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>
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-06-27external: Fix ARM build failure with parallel makeBrad Bishop1-1/+1
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>
2016-06-27external/fwts: fix regex generation for %p formatJeremy Kerr1-1/+1
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>
2016-06-24getscom/putscom: always print full 16 digitsStewart Smith2-2/+2
Suggested-by: Daniel M Crowell <dcrowell@us.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-06-21fwts/generate-fwts-olog: Fix regex matches to allow more printf formatsJeremy Kerr1-2/+2
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>
2016-06-20Fix for typosFrederic Bonnard10-15/+15
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>
2016-06-07external: Add dynamically linked pflashBrad Bishop2-4/+17
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>
2016-06-07external: Create shared rules.mkBrad Bishop2-5/+5
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>
2016-06-07external: Remove -m64 from shared CFLAGS on ARMBrad Bishop1-1/+4
-m64 isn't an ARM flag. Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-06-07external: Fix pflash install targetBrad Bishop1-0/+1
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>
2016-06-07external: Remove external/shared link targetsBrad Bishop1-12/+0
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>
2016-06-07gard: fix compile error on ARMCédric Le Goater1-3/+3
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>
2016-05-18pflash: add support for manipulating file rather than flashStewart Smith1-2/+9
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>
2016-05-11external: add a gitignore to xscom-utilsCédric Le Goater1-0/+3
Signed-off-by: Cédric Le Goater <clg@fr.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-05-03external/pflash: Handle incorrect cmd-line options betterCyril Bur1-6/+27
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>
2016-05-03gard: disable cross compile for travisStewart Smith1-2/+2
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-05-02gard: remove err.h includeStewart Smith1-1/+0
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-05-02fix gard help output testStewart Smith1-1/+1
Fixes: c51ceb9b9a380a7ed8e2af5b4d5e6c33386cd6f9 Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-04-29Fix gard --help outputStewart Smith1-1/+1
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-04-28external/fwts: Add parser to extract olog pattern definitionsJeremy Kerr1-0/+229
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>
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-18external: Update gitignore for building opal-prdMichael Neuling2-0/+4
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>
2016-04-18external/opal-prd: Ensure that struct host_interfaces matches the thunkJeremy Kerr3-1/+28
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>
2016-04-18boot-tests: allow running boot_test.sh via a symlinkAndrew Donnellan1-1/+1
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>
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-04-17pflash: Allow building under yocto.Patrick Williams5-9/+4
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>
2016-04-01boot-tests: force booting from primary (non-golden) sideStewart Smith3-0/+12
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>
2016-04-01external: improve xscom commands MakefileCédric Le Goater4-13/+53
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>
2016-04-01external: fix exit code in xscom commandsCédric Le Goater3-15/+15
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>
2016-03-31opal-prd: fix make test dependencies for common symlink generationStewart Smith1-1/+1
Fixes: e42206bf0729782330778e77283af2aca23499dc Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-03-31Make links target reusableDinar Valeev4-63/+29
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>
2016-03-31external/common: Fix callers of file_init_path()Cyril Bur2-3/+6
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>
2016-03-31external: use skiboot make_version scriptCédric Le Goater4-17/+6
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>
2016-03-31external: simplify help output in xscom commandsCédric Le Goater3-45/+19
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>
2016-03-31external: add copyright to xscom filesCédric Le Goater4-0/+64
Signed-off-by: Cédric Le Goater <clg@fr.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-03-31external: Add a getsram commandCédric Le Goater4-2/+261
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>
2016-03-09getscom: Add Naples chip supportCédric Le Goater1-0/+3
Signed-off-by: Cédric Le Goater <clg@fr.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-03-08opal-prd: Add debug output for firmware-driven OCC eventsJeremy Kerr1-0/+4
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>