Age | Commit message (Collapse) | Author | Files | Lines |
|
Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
fixes.
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
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>
|
|
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>
|
|
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
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>
|
|
Cc: Jeremy Kerr <jeremy.kerr@au1.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
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>
|
|
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>
|
|
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>
|
|
Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
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>
|
|
This way the make dependency resolution works correctly
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
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>
|
|
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>
|
|
Signed-off-by: Cédric Le Goater <clg@fr.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
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>
|
|
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>
|
|
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>
|
|
Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
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>
|
|
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>
|
|
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>
|
|
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
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>
|
|
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>
|
|
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>
|