Age | Commit message (Collapse) | Author | Files | Lines |
|
We print a message when nvram_query() needs to wait for the NVRAM to
be loaded from the BMC/FSP. Currently this is printed at PR_WARNING
which is excessive since this doesn't actually indicate that anything is
wrong. There's also nothing that we can really do about loading the
NVRAM being slow, so just print this at PR_DEBUG.
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
|
|
Print how long we had to wait for NVRAM to become available if we needed
to wait.
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
|
|
A fault will occur if 'value == NULL' is passed to nvram_query_eq() to
check if a given key doesn't exists in nvram partition. This is an
invalid use of the API as its only supposed to be used for keys that
exist in nvram and 'value == NULL' is never possible.
Hence this patch adds an assert to the function to flag such a use and
also prevent NULL being passed as an argument to strcmp().
Signed-off-by: Vaibhav Jain <vaibhav@linux.ibm.com>
Suggested-by: Oliver O'Halloran <oohall@gmail.com>
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
|
|
nvram_reformat() sets nvram_valid = true, but it does not set
skiboot_part_hdr. Call nvram_validate() instead, which sets
everything up properly.
Reviewed-by: Oliver O'Halloran <oohall@gmail.com>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
commit ba4d46fdd9eb ("console: Set log level from nvram") wants to read
from NVRAM rather early. This works fine on BMC based systems as
nvram_init() is actually synchronous. This is not true for FSP systems
and it turns out that the query for the console log level simply
queries blank nvram.
The simple fix is to wait for the NVRAM read to complete before
performing any query. Unfortunately it turns out that the fsp-nvram
code does not inform the generic NVRAM layer when the read is complete,
rather, it must be prompted to do so.
This patch addresses both these problems. This patch adds a check before
the first read of the NVRAM (for the console log level) that the read
has completed. The fsp-nvram code has been updated to inform the generic
layer as soon as the read completes.
The old prompt to the fsp-nvram code has been removed but a check to
ensure that the NVRAM has been loaded remains. It is conservative but
if the NVRAM is not done loading before the host is booted it will not
have an nvram device-tree node which means it won't be able to access
the NVRAM at all, ever, even after the NVRAM has loaded.
Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
90% of what we print isn't useful to a normal user. This
dramatically reduces the amount of messages printed by
OPAL in normal circumstances.
We still need to add a way to bump the log level at boot
based on a BMC scratch register or some HDAT property.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
NVRAM formats are always BE, so let's use the sparse annotation to catch
any issues (and correct said issues).
On LE platforms, the test was erroneously passing as with building the
nvram-format code on LE we were produces an incorrect NVRAM image.
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Add static to various declarations that can use it, as found by sparse.
It turns out that one of these (fsp_pcie_inv_lock in
platform/ibm-fsp/firenze.c) is actually unused, so remove it.
Signed-off-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Adds a helper that looks for the given NVRAM config string and checks
that associated value is equal to the supplied value.
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
The running OS is free to re-write the contents of NVRAM. The skiboot
NVRAM parser relies on the NVRAM contents being valid so we need to
force the NVRAM contents to be revalidated after the host OS has written
to it.
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
This allows the ibm,skiboot partition to be used to store NUL terminated
key=value OF configuration strings. These strings can be written using
the nvram utility found in the linux powerpc-utils package. Currently
the only use case for this is passing command line arguments to the
boot kernel so only ASCII strings are supported. The 0xFF binary
escaping mechanism for configuration strings is not supported.
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
NVRAM configuration strings are required to be NUL terminated and unused
data bytes in the partition should be set to NUL. Badly behaved system
software may not do this so same sanity checking is required. Ensuring
that the final data byte in a partition is a NUL should be sufficient.
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
The NVRAM handling code was split into two files so that the partition
parsing could be separately tested. Currently there is no nvram.h and
the tests #include nvram-format.c directly. This patch renames
nvram-format.h to something more sensible.
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Below are the in-memory console log messages observed with error level(PR_ERROR)
[54460318,3] HBRT: Mem region 'ibm,homer-image' not found !
[54465404,3] HBRT: Mem region 'ibm,homer-image' not found !
[54470372,3] HBRT: Mem region 'ibm,homer-image' not found !
[54475369,3] HBRT: Mem region 'ibm,homer-image' not found !
[11540917382,3] NVRAM: Layout appears sane
[11694529822,3] OPAL: Trying a CPU re-init with flags: 0x2
[61291003267,3] OPAL: Trying a CPU re-init with flags: 0x1
[61394005956,3] OPAL: Trying a CPU re-init with flags: 0x2
Lowering the log level of mem region not found messages to PR_WARNING and remaining messages to PR_INFO level
[54811683,4] HBRT: Mem region 'ibm,homer-image' not found !
[10923382751,6] NVRAM: Layout appears sane
[55533988976,6] OPAL: Trying a CPU re-init with flags: 0x1
Signed-off-by: Pridhiviraj Paidipeddi <ppaidipe@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Be more verbose (at debug level) when formatting the NVRAM, this can
help catch errors at other levels of the stack.
Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Found by smatch static analysis (http://smatch.sourceforge.net/):
core/nvram-format.c:146 nvram_check() warn: inconsistent indenting
core/nvram-format.c:151 nvram_check() warn: inconsistent indenting
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>
|
|
We (slightly) change the internal API so that we operate on parameters
rather than globals, this means it's easier to unit test too.
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|