aboutsummaryrefslogtreecommitdiff
path: root/external
AgeCommit message (Collapse)AuthorFilesLines
2015-09-08external/gard: Fix Coverity defect 107465Cyril Bur1-1/+1
Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-09-08external/gard: Fix Coverity defect 107466Cyril Bur1-1/+1
Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-09-08external/gard: Fix Coverity defect 107467Cyril Bur1-1/+2
Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-09-08external/opal-prd: move hservices_init after the ipmi and pnor initNeelesh Gupta1-4/+4
The IPMI device and pnor should be ready with the devices present and module loaded before the host service interfaces. So, reorder the initialization code in the daemon. Suggested-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Neelesh Gupta <neelegup@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-09-07external/gard: Recover the entire gard partitionCyril Bur1-12/+2
If the gard tool detects that the GUARD partition has been corrupted it has logic to attempt to recover the GUARD partition in a best effort attempt to leave the GUARD partition in a state that will allow the machine to boot. It has come to light that Hostboot is more sensitive to what must be in the GUARD partition in order to be able to bring a machine up, as such, the gard tool will now fill the entire partition with all 1's and ECC bytes, not simply the first record as it currently does Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com> Reviewed-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-09-07external/gard: Update record clearing to match Hostboots expectationsCyril Bur1-46/+59
When the gard tool is told to clear all the gard records it actually erases the entire flash and inserts ECC bytes only for the size of the first gard record. The current method appears to have stopped working, Hostboot expects the entire partition to have ECC bytes throughout the entire partition, and as such the current method causes Hostboot to error and be unable to bring up machines. Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com> Reviewed-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-09-07external/opal-prd: Add 'run' option to execute HBRT commandsVaidyanathan Srinivasan3-1/+135
opal-prd client to accept run command and pass it as-is to hbrt. Example: opal-prd -d run test hbrt -t 1 -c "good cmd" argv[0] = test argv[1] = hbrt argv[2] = -t argv[3] = 1 argv[4] = -c argv[5] = good cmd Above argc/argv passed to hbrt->run_command() and result out string sent to the console. Signed-off-by: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com> Signed-off-by: Neelesh Gupta <neelegup@linux.vnet.ibm.com> Reviewed-by: Patrick Williams <iawillia@us.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-09-07external/opal-prd: Support manufacturing command HTMGT and attribute overrideNeelesh Gupta3-48/+345
The patch adds the support to invoke manufacturing htmgt pass through and attribute override command in HBRT. The command format would look something as below: # opal-prd --expert-mode htmgt-passthru 0x10 0x11 0x12 It will pass the arguments after 'passthru' in an array as input data to hbrt->htmgt_pass_thru(). The HBRT will return the output data to a buffer provided by 'opal-prd' of maximum length 4096 bytes. # opal-prd override <file_name_of_binary_blob> It will read the contents of the binary blob into a buffer and invoke hbrt->apply_attr_override() with the buffer and size as the input to the interface. Signed-off-by: Neelesh Gupta <neelegup@linux.vnet.ibm.com> Reviewed-by: Patrick Williams <iawillia@us.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-09-01build pflash in travis-ciStewart Smith1-1/+1
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-09-01external/opal-prd: Refactor the handle_prd_control() functionNeelesh Gupta1-33/+47
Depending upon the control message type, the daemon parses the incoming messages, invoke the corresponding HBRT interface and sends the response back to the waiting client. Putting all this into one leads to cumbersome switch-case and a fat function. This patch creates the individual functions for different types of control messages keeping the common code into the handle_prd_control(). It also does clean up and minor fixes. Signed-off-by: Neelesh Gupta <neelegup@linux.vnet.ibm.com> Acked-by: Jeremy Kerr <jk@ozlabs.org> Reviewed-by: Patrick Williams <iawillia@us.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-09-01external/opal-prd: Move client socket common code to a functionNeelesh Gupta1-27/+34
This patch moves out the common code to a function send_prd_control() which can be invoked for sending the control message to the opal-prd daemon. It avoids the duplication of the code into the individual functions corresponding to variety of control messages. Signed-off-by: Neelesh Gupta <neelegup@linux.vnet.ibm.com> Acked-by: Jeremy Kerr <jk@ozlabs.org> Reviewed-by: Patrick Williams <iawillia@us.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-09-01external/opal-prd: send socket response in the error pathNeelesh Gupta1-1/+3
The server should send the response in the case of error too, so that the waiting client is not blocked forever. Signed-off-by: Neelesh Gupta <neelegup@linux.vnet.ibm.com> Reviewed-by: Patrick Williams <iawillia@us.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-08-28external/common: Write an includeable rules.mk.Cyril Bur7-45/+51
It would be nice if tools like the gard tool or pflash don't have to worry about how to build the arch specific code they want to include through the new external/common code. This patch adds an external/common/rules.mk which each tool can include and with some minor tweaking of the existing makefiles it should get the arch code building nicely. The one caveat is that it requires a symlink in the directory to create common/ dir for everything to behave. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-08-28external/pflash: Update distclean make targetCyril Bur1-1/+2
Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-08-28external/common: Add x86 code reenable building pflashCyril Bur3-0/+57
This allows for manipulation of flash image files on an x86 system before flashing. This may prove useful for development. Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-08-28external/common: Add POWERPC code reenable building pflash for POWERCyril Bur3-0/+233
As per commit to create the external/common code, this commit introduces the POWER arch compatibility flash reading code. This commit actually should cause no functional change to pflash (it won't be able to access the BMC flash if it ever could), however rather than accessing the flash via the debugfs opal_lpc_{read,write} interface it will access it though the MTD interface provided by linux and importantly skiboot. Not only does using the MTD interface allows applications to treat it like flash despite the fact that they are talking through several layers of abstraction. Using passing through skiboot means that all the access to the flash from the Power8 can be protected from concurrent access. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-08-28libflash: Reintroduce typesafety in lowlevel libflash callsCyril Bur1-2/+2
Previous work did away with some typesafety when adding the blocklevel_device abstraction, this has resulted in the ability to accidently call libflash low level code with a blocklevel_device which has not been initialised by the libflash backend. The end result will not be good. Best to reintroduce that low level calls be called with libflashes own structures. Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-08-28external/common: Create common code for initialising libflash componentsCyril Bur8-319/+427
In order to access the flash on ARM (presumably code running on a BMC), the hardware is involved. In order to access the flash on POWER (presumably code running on a host), opal calls through the Linux MTD driver are involved. In order to access the flash on x86 (presumably on a developer/admin system), you can't but it would be nice to be able to manipulate data which has come from the flash or will go onto the flash. The pflash and the gard tool both can read and write to the 'flash' and with the introduction of the blocklevel interface the details of how the flash is read from and written to is sufficiently abstracted that these tools don't need to know what they're running on. What does differ is the setup, and not by too much either. This common code pulls out the setup of the flash hardware on ARM, the searching for the appropriate MTD device on power and generic blocklevel device init for all three architectures. Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-08-28libflash: Return a pointer to internal structure.Cyril Bur1-2/+2
There are some functions (notably: erase_chip and set_4b_mode) which cannot be abstracted away by the blocklevel interface, this means that if they are really needed (by pflash for example) then at the moment a program like pflash would need to pass a blocklevel_device struct to libflash. This forces libflash to trust that it was given a blocklevel that it did init. If it didn't init it the container_of call will return junk and libflash has no way to protect its self. This method (while very useful) has destroyed type safety. As such, this commit reintroduces some typesafety back into this stack. Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-08-28external/gard: Check the validity of the flashCyril Bur1-5/+55
If the GUARD partition has been corrupted such that ECC checks fail and not even the first gard record can be read then the gard tool will be unable to do anything. If this happens it is possible that hostboot will have a similar problem. The only sane thing to do at is point is probably to wipe the GUARD partition. This patch adds a check for this case and provides the user with the option to wipe the entirety of the GUARD partition to attempt recovery. Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com> 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-08-19in skbioot-5.1.0 commit, accidentally somehow removed two compiler warning ↵Stewart Smith1-1/+1
fixes. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-08-17Add skiboot-5.1.0 release notesskiboot-5.1.0Stewart Smith1-1/+1
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-08-17external/gard: Fix uninitialised variable warningJeremy Kerr1-1/+1
gcc -g -O3 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -m64 -Werror -Wall -g2 -ggdb -D_FORTIFY_SOURCE=2 -I. -I../../ -c gard.c -o gard.o gard.c: In function main: gard.c:741:5: error: i may be used uninitialized in this function [-Werror=maybe-uninitialized] if (i == ARRAY_SIZE(actions)) { ^ cc1: all warnings being treated as errors If we 'goto out;', we'll perform the check on 'i' without having initialised it. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-08-17external/opal-prd: Allow instance numbers for PRD rangesJeremy Kerr2-18/+130
We have a provision for multiple instances of the same PRD range. For example, multiple-socket systems may have a PRD range per socket. This change adds an 'int instance' argument to the get_reserved_mem() call, allowing HBRT to request a specific instance of a range. We bump the hinterface version in indicate that this new parameter is present. These ranges can be provided by ibm,prd-instance properties in the reserved-memory nodes. If these are provided, they'll be used, otherwise opal-prd will number the instances automatically, based on increading physical addreses. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-08-13fix fat-fingering of FSPSSHUSER support in extract_gcov.shStewart Smith1-4/+6
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-08-13support FSPSSHUSER env variables in extract_gcov.shStewart Smith1-1/+1
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-08-10Merge 'external/opal-prd: Only map each PRD range once' from branch 'stable'Stewart Smith1-12/+23
2015-08-10external/opal-prd: Only map each PRD range onceJeremy Kerr1-12/+23
Currently, opal-prd will create a new mapping (via mmap()) on every call to get_reserved_mem(). HBRT may end up calling this many times for the same range, which will consume virtual address space. There's no interface to unmap memory, so we may fail after too many calls. Instead, store the mapping in struct prd_range on first get_reserved_mem. Subsequent calls will re-use the same mapping. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-07-31external/opal-prd: Use opal-prd as version prefixCyril Bur1-5/+5
Cc: Jeremy Kerr <jeremy.kerr@au1.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-07-31versioning: Unify all versioning to match skiboot versionsCyril Bur1-1/+1
Previously there has been some uncertainty as to how separate binaries were to be versioned compared to the firmware version as they could change (or not change) out of sync with skiboot versioning. Historically pflash was born with its own version which didn't help the issue. It has been decided that make_version.sh should always return one version which is shall be the skiboot firmware version, external binaries can supply their own prefix which will be s/skiboot/$prefix/ but the default behaviour is the git tag versioning. The main reason for versioning here is so developers can identify which version of the code someone is running, versions which closly match the source tree are easiest to deal with. The idea with one version and every binary getting a bump regardless of changes is that there is a lot of shared code (libflash/libffs are a prime example) and even if an external binary isn't explicitly updated it is possible that changes to shared code may be missed. This patch simplifies make_version.sh which had been updated to deal with pflash- git tags. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-07-31external/boot-tests: update boot-test.sh usage for BMC single partition flashingAndrew Donnellan1-4/+7
Update boot-test.sh usage to document single partition flashing on BMC platforms. Signed-off-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-07-31external/boot-tests: Fix logging functions in boot_test.shAndrew Donnellan1-5/+15
Fix the error() and msg() functions in boot_test.sh so they don't cause a shell error when called before $target is set (i.e. before parameter parsing). Change error() to allow the use of multiple arguments in the message, in line with msg(). Use $* rather than $@ as it's very slightly more correct. Signed-off-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-07-17external/gard: Update gard tool to new blocklevel interfaceCyril Bur2-77/+55
Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-07-10external/gard: change gard manual page filenameCédric Le Goater1-1/+1
This patch fixes : commit 6c458a036949 ("external/gard: Install gard manual page") which did not take into account the changes from : commit 2e2fb4dfff5c ("Renaming to opal-gard and minus escaping") Signed-off-by: Cédric Le Goater <clg@fr.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-06-23Create targets for each symlink for making pflashStewart Smith1-1/+11
This way the make dependency resolution works correctly Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-06-23libffs: init with ecc protection at blocklevel levelCyril Bur1-2/+2
Passing a flag on libffs init will register all regions of the flash with ecc (as per the libffs partition information) as being ecc protected (or not). This saves the consumer needing to know or care about the presence of ecc. Reviewed-By: Alistair Popple <alistair@popple.id.au> Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-06-23libflash/ecc: Simplify and cleanup ecc code.Cyril Bur1-1/+1
The ecc 'memcpy' style functions return success or fail in terms of the ECC enum. This doesn't really make sense, use true or false. As the result the ecc enum doesn't need to be exposed anymore, which makes more sense, not clear why it was exposed in the first place. Convert some of the ecc #defines to static inlines, shouldn't make any difference but feels safer. Fix minor stylistic and typo issues. Reviewed-By: Alistair Popple <alistair@popple.id.au> Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-06-23external/gard: Install gard manual pageCé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>
2015-06-23Renaming to opal-gard and minus escapingFrederic Bonnard2-32/+30
The binary installed is opal-gard so renaming all occurences of 'gard' else distro package checkers complain. Minus for options should be escaped, else this is considered as hyphens. Signed-off-by: Frederic Bonnard <frediz@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-06-23Fixes for compilation with -WerrorFrederic Bonnard3-10/+40
On Debian/Ubuntu, additionnal compilation flags are added such as -Werror which make compilation fail. So : - checking function return codes so that the compilation doesn't fail. - moving 'largest' variable so that gcc always sees it with a value. Signed-off-by: Frederic Bonnard <frediz@linux.vnet.ibm.com> Acked-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-06-23Honor compilation flags passed from the environmentFrederic Bonnard2-6/+6
Adding the environment variables CFLAGS, CPPFLAGS and LDFLAGS to the one in the Makefiles. Debian/Ubuntu use this mechanism to do hardened builds. Signed-off-by: Frederic Bonnard <frediz@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-06-19external/gard: Add gard manual pageCyril Bur1-0/+32
Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-06-19external/opal-prd: Add opal-prd manual pageJeremy Kerr2-0/+81
Add an initial manual page for the opal-prd utility. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-06-19external/opal-prd: Add --version optionJeremy Kerr2-1/+26
This change adds a --version option to opal-prd, and the make_version infrastructure to support it. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-06-19external/opal-prd: Include libflash blocklevel.oJeremy Kerr1-1/+2
Since 39d9e14cd, the flash interface needs the blocklevel backend to work. We don't have this included in the opal-prd build; this change adds the blocklevel module for a complete libflash build. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-06-19external/pflash: quote CROSS_COMPILE when passed to get_arch.shCyril Bur1-1/+1
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-06-19external/pflash: fix range printingCédric Le Goater1-2/+2
Signed-off-by: Cédric Le Goater <clg@fr.ibm.com> Reviewed-by: Alistair Popple <alistair@popple.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-06-19Add single partition flashing for BMC platforms to boot_test.shStewart Smith2-19/+42
Support flashing whole PNOR and/or individual partitions. This should let you flash a known good whole PNOR and then replace individual partitions in one command. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-06-19external/pflash: Add --clear commandCyril Bur1-5/+47
The current pflash --erase command simply sets all the bits of the flash back to 1 and When hostboot decides to gard everything there isn't a useful way to get the machine booting again as even --eraseing the GUARD partition won't leave the necessary ECC bits. The --clear command will erase the specified partition and then fill in the ECC bits. Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com> Reviewed-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>