| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The initial PCIe slot power state should be retrieved from the PCIe
Slot Control register (offset: +0x18), instead of having the fixed
state (power-off) wrongly. Otherwise, we possibly have mismatched
states by software and hardware. One side-effect is PCIe slot can
not be powered off from hardware for the first time.
This fixes above issue by fetching the initial PCIe slot power state
from hardware (PCIe Slot Control register) if the power control is
supported on the slot. Otherwise, it doesn't matter on what we have
for the initial PCIe slot power state.
Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
[stewart@linux.vnet.ibm.com: use PCI_SLOT_POWER_ON|OFF rather than 1/0]
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
| |
It's useful to know the CRS retry times before the PCI device is
detected successfully. In PCI hot add case, it usually indicates
time consumed for the adapter's firmware to be partially ready
(responsive PCI config space).
Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
flash_read_corrected() assumes the passed blocklevel device is an
actual flash device. However the blocklevel flash abstraction supports
automatically reading ECC protected data so use that instead.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
[Cyril added true to last param to ffs_init() in flash_register()]
[Cyril rebased onto 46c006f core/console: use char literals instead of
numeric]
Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
| |
If NVRAM has ECC (as per the ffs header) then the actual size of the
partition is less than reported by the ffs header in the PNOR then the
actual size of the partition is less than reported by the ffs header.
Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
|
|
| |
e.g. in a simulator, we could load in a STB container and verify/measure
it.
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
secure/trusted boot
Using some basic math on the ELF headers, we can work out how big the
BOOTKERNEL is that may be already loaded (e.g. in mambo, pointed to in the
device tree or built into the skiboot binary).
From there, we can measure the BOOTKERNEL in the TPM and/or verify signature.
This is only useful in a simulation environment, as real machines will
do all of this throught the load_resource API.
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
| |
While currently, the only platform with any support for trusted boot
is a reworked habanero with a new hostboot, we act on the device
tree entry of /ibm,secureboot which will be added by earlier system
firmware (hostboot, or a simulator) in the event that we should
be doing secure/trusted boot.
Based-on-habanero-only-patch-by: Claudio Carvalho <cclaudio@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As defined in the TCG Platform Firmware Profile specification revision
00.21, the digest of 0xFFFFFFFF or 0x00000000 must be extended in
PCR[0-7] and an EV_SEPARATOR event must be recorded in the event log for
PCR[0-7] prior to the first invocation of the first Ready to Boot call.
This calls stb_final() before the handover to petitboot kernel in order
to have a clean handover. stb_final() implements the steps above and also
deallocates the memory allocated for secure and trusted boot.
Signed-off-by: Claudio Carvalho <cclaudio@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
| |
This changes core/flash.c to verify and measure the downloaded PNOR
resource before it is returned to the caller.
sb_verify() and tb_measure() do nothing if libstb is not initialized
in the platform.
Signed-off-by: Claudio Carvalho <cclaudio@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently, the CAPP lid has the TOC (4K) and one supartition (36K). For
secure boot we can either build one container for the TOC and another one for
the subpartition, or build one container for the whole CAPP partition.
We decided implement the second option.
The first option would require changes to the CAPP TOC layout in order to
correlate the TOC with the subpartitions. Besides that, the first option
also increases the boot time since we would need to verify and measure
the CAPP TOC.
This patch adds the flash_subpart_info function so the correct CAPP
subpartition can be selected also outside of the flash API.
Signed-off-by: Claudio Carvalho <cclaudio@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
| |
We are downloading 0x20000 bytes from PNOR for CAPP, but currently the
CAPP lid is only 40K.
This loads the actual partition size as opposed to the total partition
size.
Signed-off-by: Claudio Carvalho <cclaudio@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
| |
This adjusts the kernel header offset if BOOTKERNEL is a secure boot
container
Signed-off-by: Claudio Carvalho <cclaudio@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently we are getting request to queue occ load opal message when host services
got load occ request from FSP. This request we got before initializing opal messaging
due to which we are failed to get list node from msg_free_list list.
[3204300512,3] opalmsg: No available node in the free list, allocating
This patch fixes this issue by initializing opal messaging(opal_init_msg) before
platform.init, as in platform.init we are loading host services lid and getting
occ load request command from FSP. So when opal_init_msg initializes we will
be initialized msg_free_list with an empty list.
Signed-off-by: Pridhiviraj Paidipeddi <ppaidipe@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This changes the boot ABI, so it's only active for P9 and later systems,
even though it's unrelated to hardware changes. There is an associated
Linux change to properly search for this node as well.
This change properly specifies #address-cells for the flash node, so we
can avoid DTC errors like:
device tree: Warning (reg_format): "reg" property in /ibm,opal/flash@0
has invalid length (8 bytes) (#address-cells == 0, #size-cells == 0)
Base on a patch from Cyril Bur
Signed-off-by: Jack Miller <jack@codezen.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
| |
This is created seperately when parsing the hdat and when expanding the
DT. There is no real reason for this and it makes more sense to create
it in the main init path.
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
master_cpu is used to determine the ChipTOD master if no ChipTOD
information is available in the HDAT. However, it is set to zero at every
skiboot entry point (fdt_entry, the 0x180 FSP entry and
opal_boot_trampoline) and is otherwise unused. This patch removes this
passing around and uses the boot CPU PIR to find the ChipTOD master rather
than zero.
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
| |
This allows ipmi-opal to properly use the OPAL irqchip rather than
falling back to the event interface in Linux.
Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
Signed-off-by: Alistair Popple <alistair@popple.id.au>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
| |
This allows devices such as IPMI and serial consoles to use dynamic irq
numbers and have separate irq numbers in Linux.
Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
Signed-off-by: Alistair Popple <alistair@popple.id.au>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The timeout should be 1000ms instead of 1000 ticks while powering
off PCI slot in pci_slot_power_off(). Otherwise, it's likely to
hit timeout powering off the PCI slot as below skiboot logs reveal:
[47912590456,5] SkiBoot skiboot-5.3.6 starting...
:
[5399532365,7] PHB#0005:02:11.0 Bus 0f..ff scanning...
[5399540804,7] PHB#0005:02:11.0 No card in slot
[5399576870,5] PHB#0005:02:11.0 Timeout powering off slot
[5401431782,3] FIRENZE-PCI: Wrong state 00000000 on slot 8000000002880005
This replaces time_wait() with time_wait_ms() to resolve the issue.
Fixes: 358b4d654f100cfdfcba939cae012099a851b3bc
Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
|
|
| |
Sycnhronize => Synchronize
Signed-off-by: Mukesh Ojha <mukesh02@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
|
|
| |
Use prlog replacing printfs in core/platform.c
Signed-off-by: Vipin K Parashar <vipin@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
| |
This file contains several helper functions which also take an argument
named "vpd". Even at the best of times, the VPD parsing code is a soup
of confusing terminology so lets not make a bad situation worse. This
patch renames vpd to vpd_lid and vpd_size to vpd_lid_size to clarify the
situation.
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
| |
When setting up the VPD lid preload a buffer of VPD_LID_MAX_SIZE bytes
is allocated. Once the lid has been transferred from the FSP this buffer
is shrunk with realloc. However, the contents of the buffer are copied
into the devicetree and the buffer is freed making the shrinking
pointless.
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The VPD LID is used on FSP machines to discover hotpluggable PCI slots.
Currently if we fail to load the LID skiboot will fail an assert()
preventing the system from booting. This is excessive since this is an
otherwise recoverable failure. This patch converts the assert() to an
if-NULL-return check so we can continue to boot.
Cc: Gavin Shan <gwshan@linux.vnet.ibm.com>
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
[stewart@linux.vnet.ibm.com: fix missing verb]
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
POWER9 has an off core MMU called the Nest MMU which allows other
units within a chip to perform address translations. The context and
setup for translations is handled by the requesting agents, however
the Nest MMU does need to know where in system memory the page tables
are located.
This patch adds a call to setup the Nest MMU page table pointer on a
per-chip basis.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
Reviewed-by: Balbir Singh <bsingharora@gmail.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It appears the inital patch was incomplete and coverity has caught
more issues. The initial patch addressed one aspect of passing
pointers instead of values, actual function prototypes needed to be
changed and callers adjusted.
Fixes coverity 134277 and 134278
Fixes: 81a538a ("core/flash: Fix passing pointer instead of value")
Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com>
Reviewed-by: Mukesh Ojha <mukesh02@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
| |
We have only ever supported running with HRMOR = 0. Having a non-zero
HRMOR causes all real mode accesses to have the value of HRMOR bitwise
ORed into the address that would have been accessed. This causes issues
when accessing MMIO registers such as the XSCOMs.
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
| |
This patch adds a check when to verify that we have initialised the
cpu_thread structure for the called in thread.
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
| |
This patch adds a function that is called early in the primary thread
and secondary thread init paths. No actual checks are added in this
patch. It just provides a sensible place to add them.
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
| |
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The NVLinks (v1 and v2 to be supported in future) are exposed to
Linux kernel by emulated PCI devices (aka PCI virtual devices).
Currently, the implementation is covered by NVLink driver (npu.c),
meaning npu2.c will have similar implementation though it will be
totally duplicated with that in npu.c.
This supports PCI virtual device in the generic layer so that it
can be shared by all NVLink drivers. The design is highlighted as:
* There are 3 config spaces for every PCI virtual device, corresponds
to the cached config space, readonly space, write-1-clear space.
* Reuse PCI config register filter mechanism to allow NVLink driver
to emulate the access to the designated config registers. The config
values are fetched from or written to the cached config space when
the config registers aren't covered by filter.
Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Reviewed-by: Russell Currey <ruscur@russell.cc>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Throughout skiboot (and the kernel) PE numbers are named "pe_no",
"pe_num" and "pe_number", and sized as 16, 32 and 64bit uints depending
on where you look. This is annoying and potentially misleading in cases
such as the OPAL API, where different calls have different int sizes
even though the PE number they want is the same.
Fix this by making *everything* uint64_t pe_number. In doing this, there
are some whitespace fixes and mve_number gets dragged into this as well
for cases like set_msi_{32/64} where they essentially mean the same thing.
Signed-off-by: Russell Currey <ruscur@russell.cc>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
| |
Adds some basic functionality tests for nvram_query() to the core test
suite.
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
| |
Adds a test for nvram_check() that the ibm,skiboot nvram partition is
correctly terminated.
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
| |
Adds support for supplying the kernel boot arguments from the "bootargs"
configuration string in the ibm,skiboot partition.
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>
|
|
|
|
|
|
|
|
|
| |
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 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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The current flash code was written with only one flash chip, which is
a system_flash (ie. the PNOR image), in mind.
Now that we have mambo bogusdisk flash, we can have many flash chips.
This is resulting in some confusing output messages.
This reworks some of the error paths and warnings to make this more
coherent when we have multiple flash chips.
We assume everything can be a system flash, so I've removed the
is_system_flash parameter from flash_register(). We'll use the first
system flash we find and warn if we find another since discovery order
is not a guaranteed API.
Signed-off-by: Michael Neuling <mikey@neuling.org>
Acked-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>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
High volume of SYNC errors onto LPC bus cause degraded system
performance and are likely due to bad hardware present onto system.
Thus once LPC SYNC errors cross a certain threshold, OPAL should log
them onto BMC as unrecoverable errors in manufacturing mode. This
will help manufacturing screen bad parts, causing such errors.
Cc: stable
Signed-off-by: Vipin K Parashar <vipin@linux.vnet.ibm.com>
[stewart@linux.vnet.ibm.com: s/mfg/manufacturing/]
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I've tried to align it with what the kernel prints today
The existing logs show:
[20287269125,5] PSI[0x000]: Found PSI bridge [working=1, active=0]
[890425679,5] BT: Interface initialized, IO 0x00e4
[1249199642,4] SLW: HB-provided idle states property found
[1249344409,5] NVRAM: Size is 576 KB
[1484422964,3] NVRAM: Layout appears sane
The mftb() output is not very meaningful, the changed output shows:
[ 38.315784591,5] CENTAUR: FSI host: 0x0 cMFSI0 port 2
[ 38.315922971,5] PSI[0x000]: Found PSI bridge [working=1, active=0]
[ 1.448765255,5] BT: Interface initialized, IO 0x00e4
[ 2.398136129,5] NVRAM: Size is 576 KB
[ 3.145017865,3] NVRAM: Layout appears sane
For the output sample, I've taken bits where one can see the time move back
w.r.t. previous log, but that was always the case. I don't think that is
worth fixing here
Adds an additional divide and modulo for every log printed. I've also
fixed the test cases that run as a part of make check
Signed-off-by: Balbir Singh <bsingharora@gmail.com>
[stewart@linux.vnet.ibm.com: fix up tb in console tests]
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
| |
Those will be needed by fast reboot. For now, mark qemu and mambo
as not having them.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
| |
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
| |
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
| |
This allows us to send threads to nap mode when either idle (waiting
for a job) or when in a sleep delay (time_wait*).
We only enable the functionality after the 0x100 vector has been
patched, and we disable it before transferring control to Linux.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This will be handled by time_wait_ms(). Also remove a useless
smt_medium().
Note that this introduce a difference in behaviour: time_wait
will only call the pollers on the boot CPU while cpu_wait_job()
could call them on any. However, I can't think of a case where
this is a problem.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Instead, target a specific CPU for a global job at queuing time.
This will allow us to wake up the target using an interrupt when
implementing nap mode.
The algorithm used is to look for idle primary threads first, then
idle secondaries, and finally the less loaded thread. If nothing can
be found, we fallback to a synchronous call.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
| |
This will currently do nothing more than spin but will eventually
allow us to nap until the decrementer fires.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|