summaryrefslogtreecommitdiffstats
path: root/core/nvram.c
Commit message (Collapse)AuthorAgeFilesLines
* nvram: Print how long we waited for nvramOliver O'Halloran2018-09-171-0/+9
| | | | | | | | 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>
* Quieten console output on bootStewart Smith2018-06-051-2/+2
| | | | | | | | | | | We print out a whole bunch of things on boot, most of which aren't interesting, so we should *not* print them instead. Printing things like what CPUs we found and what PCI devices we found *are* useful, so continue to do that. But we don't need to splat out a bunch of things that are always going to be true. Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
* nvram: run nvram_validate() after nvram_reformat()Nicholas Piggin2018-03-271-3/+5
| | | | | | | | | | 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>
* nvram: Fix 'missing' nvram on FSP systems.Cyril Bur2017-11-301-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* nvram: force re-verification after writingOliver O'Halloran2016-10-141-13/+32
| | | | | | | | | | 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>
* core/init: recheck nvram on fast rebootOliver O'Halloran2016-08-301-9/+23
| | | | | | | | | If the previously running OS modifies the NVRAM it may be left in an invalid state. To prevent errors we need to re-validate the nvram format in the fast-reboot path. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* nvram: rename nvram-format.h to nvram.hOliver O'Halloran2016-08-301-1/+1
| | | | | | | | | | 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>
* Use additional checks in skiboot for pointersBalbir Singh2016-08-171-0/+8
| | | | | | | | | | | The checks validate pointers sent in using opal_addr_valid() in opal_call API's provided via the console, cpu, fdt, flash, i2c, interrupts, nvram, opal-msg, opal, opal-pci, xscom and cec modules Signed-off-by: Balbir Singh <bsingharora@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* nvram: Add extra debug printing when NVRAM needs formattingCyril Bur2016-07-271-1/+2
| | | | | | | | 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>
* Move NVRAM format/check code out into separate file to unit testStewart Smith2015-06-241-132/+8
| | | | | | | 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>
* Remove redundant includes of opal-api.hMichael Ellerman2015-04-011-1/+0
| | | | | | | | Now that opal.h includes opal-api.h, there are a bunch of files that include both but don't need to. Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Move skiboot internal things from opal.h to opal-api.hStewart Smith2015-02-061-0/+1
| | | | | | | | | | This is probably not the best collection of things in the world, but it means that opal.h is much closer to being directly usable by an OS. This triggers a bunch of #include fixes throughout the tree. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Initial commit of Open Source releaseBenjamin Herrenschmidt2014-07-021-0/+248
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
OpenPOWER on IntegriCloud