Age | Commit message (Collapse) | Author | Files | Lines |
|
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Adds the skisym and linsym commands which can be used to find the
address of a Linux or Skiboot symbol. To function this requires
the user to provide the SKIBOOT_MAP and VMLINUX_MAP environmental
variables which indicate which skiboot.map and System.map files
should be used.
Examples:
Look up a symbol address:
systemsim % skisym .load_and_boot_kernel
0x0000000030013a08
Set a breakpoint there:
systemsim % b [skisym .load_and_boot_kernel]
breakpoint set at [0:0]: 0x0000000030013a08 (0x0000000030013A08) Enc:0x7D800026 : mfcr r12
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
When interacting with an I2C master the p8-i2c driver (common to p9)
aquires a per-master lock which it holds for the duration of it's
interaction with the master. Unfortunately, when
p8_i2c_check_initial_status() detects that the master is busy with
another transaction it drops the lock and returns OPAL_BUSY. This is
contrary to the driver's locking strategy which requires that the
caller aquire and drop the lock. This leads to a crash due to the
double unlock(), which skiboot treats as fatal.
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
OpenSSL has some API changes which causes a build break in libstb.
Specifically, directly accessing some members of a signature now requires using
a helper.
This fixes things in OpenSSL 1.1 and has no effect on OpenSSL 1.0.
The build failure was as follows:
[ HOSTCC ] libstb/create-container.c
In file included from /usr/include/openssl/asn1.h:24:0,
from /usr/include/openssl/ec.h:30,
from libstb/create-container.c:36:
libstb/create-container.c: In function ‘getSigRaw’:
libstb/create-container.c:104:31: error: dereferencing pointer to incomplete
type ‘ECDSA_SIG {aka struct ECDSA_SIG_st}’
rlen = BN_num_bytes(signature->r);
^
Signed-off-by: Russell Currey <ruscur@russell.cc>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
A lot of stuff that is useful for debugging and general sanity checking
of the HDAT parser is only printed at PR_DEBUG. Bump up the log level
for hdata_to_dt so that more of this is output by default. The actual
test cases only look at the DTS output so there's no harm in being
verbose.
Clean up the space indentation while we're here.
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
These are useful for side-stepping various HW specific functions.
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Using printf() here results in the output going into the stdout stream
when running the hdata_to_dt test. This results in an invalid dtb output
so lets not do that.
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
In the past we've ignored these since Hostboot insisted in exporting
broken reservations and the OCC was not being used yet. This situation
seems to have resolved itself so we should respect the reservations that
hostboot provides.
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Acked-by: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com>
Tested-by: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com>
Tested-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
New memory regions need to be either fully contained by an existing
region or completely disjoint. Right now we just fail silently or crash
with an assert which is less than helpful. Printing some basic
information, such as the names of the overlapping regions is helpful.
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
When a new memory region is added (e.g for memory reserved by firmware)
the list of existing memory regions is iterated through and a cut-out is
made in any existing region that overlaps with the new one. Prior to the
HDAT reservations being made the region init process was always:
1) Create regions from the memory@<addr> DT nodes. (mostly large)
2) Create reserved regions from the device-tree. (mostly small)
When adding new regions we have assume that the new region will only
every intersect with at most one existing region, which it will split.
Adding reservations inside the HDAT parser breaks this because when
adding the memory@<addr> node regions we can potentially overlap with
multiple reserved regions. This patch fixes this by maintaining a
seperate list of memory reservations and delaying merging them until
after the normal memory init has finished, similar to how DT
reservations are handled.
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
This adds a couple of tests to ensure that there are no holes in the
map for MMIO mappings and the map is sorted by start address.
Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
When we first added the map, we accidentally left a hole after the NPU
PHY regs region. Fix this hole.
Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
We don't use this region currrently but we should add for
completeness.
Signed-off-by: Michael Neuling <mikey@neuling.org>
Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
If any new or unknown command need to be handled, just log
un-hnadled message from only fsp, not required from fsp-dpo.
cat /sys/firmware/opal/msglog | grep -i ,3
[ 110.232114723,3] FSP: fsp_trigger_reset() entry
[ 188.431793837,3] FSP #0: Link down, starting R&R
[ 464.109239162,3] FSP #0: Got XUP with no pending message !
[ 466.340598554,3] FSP-DPO: Unknown command 0xce0900
[ 466.340600126,3] FSP: Unhandled message ce0900
Signed-off-by: Pridhiviraj Paidipeddi <ppaidipe@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
It turns out GCC7 adds a useful warning and does fancy things like
parsing your comments to work out that you intended to do the fallthrough.
There's a few places where we don't match the regex. Fix them, as it's
harmless to do so.
Found by building on Fedora Rawhide in Travis.
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
They've been really reliable for a while now, so let's switch
to not ignoring any failures there (when introduced, there were some
problems with the fedora mirrors that could cause spurious failures)
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Having the option to disable EEH for MMIO without rebuilding skiboot
could be useful for testing, so check for pci-eeh-mmio=disabled in nvram.
Signed-off-by: Russell Currey <ruscur@russell.cc>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
We're safe up until engine number 524288.
Found by static analysis
Fixes: ae4e50eb35695
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Fixes: 5f67c1e253788691d376e4e639d4a6e7785efa55
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
We always assign BARs in phb4, so this removes the unnecessary force
assign logic.
This patch also cleanup the logging to make it less verbose.
Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Primarily for GPUs which may have large MMIO space for frame buffers.
This shuffles the memory map around a bit and starts using the 2TB
region.
Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Keeps existing address. No functional change.
Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Keeps existing addresses. No functional change.
Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Keeps existing addresses. No functional change.
Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Keeps existing address. No functional change.
Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
This adds a bunch of tests to the physical memory map
infrastructure. It checks for overlaps and alignment..
Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
This adds a global map for allocating physical memory address. This
centralises physical memory space allocations into one location rather
than spread through, PHB, XIVE, NX etc.
This adds a new call phys_map_get() which takes a chip, type and index
and returns a address and size for the region to be used.
An error in a call to this function crashes skiboot. This is done
since bogus calls here are going to be hit by developers not users and
they need to be fixed.
Currently only P9 is implemented but other chips should be easy to
add. On P9 BARs are generally set by skiboot. On P8 this was done by
hostboot so this is not needed there.
This just adds the infrastructure. User (PHB4, XIVE etc) will be
migrated in subsequent patches.
Suggested-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>
|
|
The root complex config space size on PHB4 is 2048. This patch sets
that size and enforces it when trying to read/write the config space
in the root complex.
Without this someone reading the config space via /sysfs in linux will
cause an EEH on the PHB.
If too high, reads returns 1s and writes are silently dropped.
Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
If a downstream PCIe link is down we currently reserve a number of
busses for hot pluggable devices. However we do not need to do this
when we know a slot is not hotplug capable.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
Acked-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
In the days of yore libpore was closed source and people wanted the
option to not use it. That's no longer the case so lets ditch all
the #ifdef crap.
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
In the hdata_to_dt test application the PVR override flags do not
correctly set proc_gen. This causes some butchering of the compatible
strings and some XSCOM addresses.
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
There are significant changes to hardware register addresses and
meanings on newer chip revisions making them unlikely to work
correctly with the existing code. Better to fail clearly and early.
Suggested-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Alistair Popple <alistair@popple.id.au>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
NPU2 BARs were being assigned and tracked with a global static
array. This worked fine when there was only a single chip/NPU2 in the
system however multiple chips results in the a shared data structure
for BAR management which results in multiple chips getting assigned
the same BAR addresses and other incorrect sharing of BAR properties.
This patch splits the static and dynamic BAR configuration and stores
the dynamic configuration in the per-NPU2 data structure.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
The arguments to npu2_scom_write() in npu2_write_bar() resulting in
incorrect BAR setup in some circumstances. This patch swaps the
arguments so they are correct.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Trigging a Host Initiated Reset (when the host detects the FSP has gone
out to lunch and should be rebooted), would cause "Unknown Command" messages
to appear in the OPAL log.
This patch implements those messages
How to trigger FSP RR(HIR):
$ putmemproc 300000f8 0x00000000deadbeef
s1 k0:n0:s0:p00
ecmd_ppc putmemproc 300000f8 0x00000000deadbeef
Log showing unknown command:
/ # cat /sys/firmware/opal/msglog | grep -i ,3
[ 110.232114723,3] FSP: fsp_trigger_reset() entry
[ 188.431793837,3] FSP #0: Link down, starting R&R
[ 464.109239162,3] FSP #0: Got XUP with no pending message !
[ 466.340598554,3] FSP-DPO: Unknown command 0xce0900
[ 466.340600126,3] FSP: Unhandled message ce0900
The message we need to handle is "Get PLID after host initiated FipS
reset/reload". When the FSP comes back from HIR, it asks "hey, so, which
error log explains why you rebooted me?". So, we tell it.
Reported-by: Pridhiviraj Paidipeddi <ppaidipe@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Long existing typo of r5 rather than r6, meaning we were storing CTR
instead of LR.
Reported-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Signed-off-by: Dave Heller <hellerda@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
phb4_get_presence_state() needs to set *val to indicate the presence
of something in the slot. Currently it doesn't set *val at all.
The existing logic is correct, so this patch just sets val in the
right places.
This has the nice side effect of improving boot times since we no
longer waste time tring to train links that don't have anything
present.
Signed-off-by: Michael Neuling <mikey@neuling.org>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
When saving the CTR and LR registers the skiboot exception handlers use the
'stw' instruction which only saves the lower 32 bits of the register. Given
these are both 64 bit registers this leads to some strange register dumps,
for example:
***********************************************
Unexpected exception 200 !
SRR0 : 0000000030016968 SRR1 : 9000000000201000
HSRR0: 0000000000000180 HSRR1: 9000000000001000
LR : 3003438830823f50 CTR : 3003438800000018
CFAR : 00000000300168fc
CR : 40004208 XER: 00000000
In this dump the upper 32 bits of LR and CTR are actually stack gunk
which obscures the underlying issue.
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Acked-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Add some more explicit instructions about how to install and use cross
compilers.
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
[stewart@linux.vnet.ibm.com: Add dependencies from our CI Dockerfiles]
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
When the system is IPLed with an elevated risk level Hostboot will
set a flag in the IPL parameters structure. Parse and export this
in the device tree at: /ipl-params/sys-params/elevated-risk-level
Cc: Adrian Barrera <abarrera@us.ibm.com>
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
NPU and NPU2 don't use diag data, but the kernel will allocate a buffer for
NPU PHBs regardless. Set ibm,phb-diag-data-size to 0 for NPU PHBs to save a
whole precious 8K.
Signed-off-by: Russell Currey <ruscur@russell.cc>
Acked-by: Alistair Popple <alistair@popple.id.au>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
A HW issue can cause accesses to the content of the indirect data
area to pass the actual selection of the target thread. The
workaround is to read the PC_TCTXT_INDIR0 register back before
accessing the data area.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
The DT bindings for the /reserved-memory node requires that it:
a) Has #size-cells equal to the root
b) Has #address-cells equal to the root
c) Has an empty ranges property (i.e directly maps on the root)
Currently we do not assign any of these when generating the Mambo
device tree which causes the booted kernel to ignore the reservations
in the /reserved-memory node.
Fixes: b7b5302af737
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
One less thing to work around for those crazy enough to try.
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|