summaryrefslogtreecommitdiffstats
path: root/external
Commit message (Collapse)AuthorAgeFilesLines
...
* external/opal-prd: Refactor the handle_prd_control() functionNeelesh Gupta2015-09-011-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>
* external/opal-prd: Move client socket common code to a functionNeelesh Gupta2015-09-011-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>
* external/opal-prd: send socket response in the error pathNeelesh Gupta2015-09-011-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>
* external/common: Write an includeable rules.mk.Cyril Bur2015-08-287-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>
* external/pflash: Update distclean make targetCyril Bur2015-08-281-1/+2
| | | | | Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* external/common: Add x86 code reenable building pflashCyril Bur2015-08-283-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>
* external/common: Add POWERPC code reenable building pflash for POWERCyril Bur2015-08-283-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>
* libflash: Reintroduce typesafety in lowlevel libflash callsCyril Bur2015-08-281-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>
* external/common: Create common code for initialising libflash componentsCyril Bur2015-08-288-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>
* libflash: Return a pointer to internal structure.Cyril Bur2015-08-281-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>
* external/gard: Check the validity of the flashCyril Bur2015-08-281-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>
* external/mambo: Update PVR valueSamuel Mendoza-Jonas2015-08-211-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>
* in skbioot-5.1.0 commit, accidentally somehow removed two compiler warning ↵Stewart Smith2015-08-191-1/+1
| | | | | | fixes. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Add skiboot-5.1.0 release notesStewart Smith2015-08-171-1/+1
| | | | Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* external/gard: Fix uninitialised variable warningJeremy Kerr2015-08-171-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>
* external/opal-prd: Allow instance numbers for PRD rangesJeremy Kerr2015-08-172-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>
* fix fat-fingering of FSPSSHUSER support in extract_gcov.shStewart Smith2015-08-131-4/+6
| | | | Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* support FSPSSHUSER env variables in extract_gcov.shStewart Smith2015-08-131-1/+1
| | | | Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Merge 'external/opal-prd: Only map each PRD range once' from branch 'stable'Stewart Smith2015-08-101-12/+23
|\
| * external/opal-prd: Only map each PRD range onceJeremy Kerr2015-08-101-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>
* | external/opal-prd: Use opal-prd as version prefixCyril Bur2015-07-311-5/+5
| | | | | | | | | | | | Cc: Jeremy Kerr <jeremy.kerr@au1.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | versioning: Unify all versioning to match skiboot versionsCyril Bur2015-07-311-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>
* | external/boot-tests: update boot-test.sh usage for BMC single partition flashingAndrew Donnellan2015-07-311-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>
* | external/boot-tests: Fix logging functions in boot_test.shAndrew Donnellan2015-07-311-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>
* | external/gard: Update gard tool to new blocklevel interfaceCyril Bur2015-07-172-77/+55
| | | | | | | | | | Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | external/gard: change gard manual page filenameCédric Le Goater2015-07-101-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>
* | Create targets for each symlink for making pflashStewart Smith2015-06-231-1/+11
| | | | | | | | | | | | This way the make dependency resolution works correctly Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | libffs: init with ecc protection at blocklevel levelCyril Bur2015-06-231-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>
* | libflash/ecc: Simplify and cleanup ecc code.Cyril Bur2015-06-231-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>
* | external/gard: Install gard manual pageCédric Le Goater2015-06-231-0/+3
| | | | | | | | | | Signed-off-by: Cédric Le Goater <clg@fr.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | Renaming to opal-gard and minus escapingFrederic Bonnard2015-06-232-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>
* | Fixes for compilation with -WerrorFrederic Bonnard2015-06-233-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>
* | Honor compilation flags passed from the environmentFrederic Bonnard2015-06-232-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>
* | external/gard: Add gard manual pageCyril Bur2015-06-191-0/+32
| | | | | | | | | | Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | external/opal-prd: Add opal-prd manual pageJeremy Kerr2015-06-192-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>
* | external/opal-prd: Add --version optionJeremy Kerr2015-06-192-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>
* | external/opal-prd: Include libflash blocklevel.oJeremy Kerr2015-06-191-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>
* | external/pflash: quote CROSS_COMPILE when passed to get_arch.shCyril Bur2015-06-191-1/+1
| | | | | | | | Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | external/pflash: fix range printingCédric Le Goater2015-06-191-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>
* | Add single partition flashing for BMC platforms to boot_test.shStewart Smith2015-06-192-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>
* | external/pflash: Add --clear commandCyril Bur2015-06-191-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>
* | external/pflash: move --side and --toc usage textCyril Bur2015-06-191-5/+5
| | | | | | | | | | Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | Because BMCs love to change things, use dd rather than scpStewart Smith2015-06-181-2/+6
| | | | | | | | Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | external/opal-prd: Fix error message for handle_attnsJeremy Kerr2015-06-161-1/+1
| | | | | | | | | | | | | | We have the wrong function name listed in the output. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | external/gard: add Makefile targets to make debian packagesCyril Bur2015-06-091-0/+8
| | | | | | | | | | | | | | | | | | | | The Makefile is missing a install target which will be needed to package and distribute into ubuntu. Added a simple install target. Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | libflash: start using the blocklevel interface.Cyril Bur2015-06-092-16/+17
| | | | | | | | | | | | | | | | | | | | Converted all the libflash calls to use the blocklevel interface, modified all callers to libflash to use the blocklevel interface. This patch should introduce next to no functional change. Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | external/pflash: Allow the libffs TOC to operate on to be specifiedCyril Bur2015-06-011-5/+25
| | | | | | | | | | | | | | | | | | On systems with multiple TOCs it may be useful to be able to specify which one should be operated on. Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com> Reviewed-By: Alistair Popple <alistair@popple.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | external/pflash: Perform flashing on flash sides other than side 0Cyril Bur2015-06-011-6/+55
| | | | | | | | | | | | | | | | | | | | | | | | Currently pflash only looks at the first ffs TOC it finds in order to locate an ffs partition. Problems arise when there are identical partitions in both sides of the flash as it is current impossible to specify the second side. This adds a parameter to specify the second side of the flash when pflash does the lookup for the partition. Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com> Reviewed-By: Alistair Popple <alistair@popple.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | external/pflash: Show the partitions on the second side flashCyril Bur2015-06-011-20/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | Currently pflash is unaware that that some platforms can have two sides of flash and therefore doesn't include the ability to print it. The ffs TOC at the start of the flash may contain a partition called "OTHER_SIDE" which will start with the TOC for the second side. If OTHER_SIDE is found pflash will dump that flash information too. Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com> Reviewed-By: Alistair Popple <alistair@popple.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | external/pflash: Report if a flash partition is ECC protectedCyril Bur2015-06-011-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | Currently pflash doesn't display if a flash partition contains ECC bits or not when dumping the flash layout. libffs has all this information it's just that pflash doesn't relay it. Trivial change to add to the information pflash prints about each partition Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com> Reviewed-By: Alistair Popple <alistair@popple.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
OpenPOWER on IntegriCloud