Age | Commit message (Collapse) | Author | Files | Lines |
|
We need the core to do proper endian among others since that
code is compiled in run-trace
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
|
|
OPAL is expected to leave OCC stopped after receiving reset OCC
message from FSP. FSP will send this either at boot before
a load/start, or during runtime before load/start. If there
is no subsequent load/start command, the OCC can be left stopped.
After few attempts (runtime reset), FSP can just send reset and
expect OPAL to leave OCC in stopped state.
Call HBRT to stop OCC on FSP reset OCC command and acknowledge.
Signed-off-by: Shilpasri G Bhat <shilpa.bhat@linux.vnet.ibm.com>
Signed-off-by: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
Removed following:
- Machine check handle and other related routines.
- per-cpu MCE event used to record machine check data
cpu_thread->mc_event;
- Machine check related definition including mce event structure from
include/opal.h
- A comment above GET_STACK() #define that warns about runtime modification
made to GET_STACK macro by MC patching code.
Signed-off-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
Now that we catch/handle machine check interrupt directly in Linux host
PowerNV kernel, we are not anymore dependent on OPAL firmware to do MCE
handling job for us. The MCE handling code in OPAL has exclusive stack
space (4k size) reserved and remains unused with Linux host not being
dependent on it anymore. Hence, this patch removes the code that allows
machine check interrupt patching in OPAL and reclaims back 4k of stack
space for use of normal stack. For older kernel the patching request
will result into an error.
The subsequent patch will remove the rest of MCE handling code from OPAL.
Signed-off-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
We grab a version from git tags (or SKIBOOT_VERSION environment variable),
optionally tack on EXTRA_VERSION (if from git) as well as add things to the
git version number if we're ahead of the most recent tag or the tree is dirty.
Also fix-up makefiles so that we don't have to rebuild version.c every time
you run make.
fsp attn area needed updating as we can have >40 character version strings.
We also export the version string via device tree rather than just the gitid.
For buildroot builds, setting SKIBOOT_VERSION environment variable to the
tag you grab will do the correct thing.
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
We use a double link technique, doing a first pass with a .o containing
a dummy symbol map, then re-linking with a new .o
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
It only exposed one function that is local to the hdat stuff
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
__builtin_frame_address really wants constants
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
Separate text translation from capture of the backtrace
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
This patch adds:
- Normal builds are done with -fstack-protector (we want to investigate
using -fstack-protector-strong on gcc4.9 but for now we just use that
- Build with STACK_CHECK=1 will use -fstack-protector-all and -pg and
will check the stack in mcount
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
Define SRCs of I2C component and interface with the existing
skiboot 'errorlog' infrasturcute for commiting the logs. Add the
i2c specific OPAL error codes to differentiate various types of
errors during i2c operations.
To ease debugging, dump the i2c register contents, 'master' and
'request' structure bits in case any error occured during transfer
on the bus. Minor clean-ups as well.
Signed-off-by: Neelesh Gupta <neelegup@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
Due to the lack of SLW timed interrupt support, we take the opportunity
to check out timers on any incoming interrupt. However we really don't
want to do that for the background pollers.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
We only poll the masters for the chip that got the interrupt
and we improve the running of the timers as well.
We user the new TIMER_POLL facility to replace the use of the
OPAL poller, which simplifies the code further.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
These have no expiry and get called whenever the opal pollers run,
they are intended to replace most opal pollers and allow the same
code in drivers to chose between a poller or a timer based on things
like interrupt availability for example.
The other advantage over existing pollers (which I hope to deprecate)
is that they are protected against re-entrancy (while still running
without locks held).
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
And start adding interfaces to lookup i2c busses.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
This updates the i2c driver significantly, using a simpler state machine,
using the new timer for timeouts, and fixing a number of issues. I also
changed the Linux interface so I've changed the token number since some
builds have been done with the old code already.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
For now running off the event pollers, that will improve once we get
delayed interrupts from the SLW
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
Fixed few bugs and clean up a lot. Renamed the state machine variables
to make more sense. A new helper 'p8_i2c_check_work' to avoid hitting
deep call stack after request complete.
Signed-off-by: Neelesh Gupta <neelegup@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
Using the platform.load_resource interface, allow an external initramfs
image to be passed to the kernel.
We split the KERNEL_LOAD_BASE/KERNEL_LOAD_SIZE region in half, to allow
space for the initramfs.
Signed-off-by: Jeremy Kerr <jeremy.kerr@au.ibm.com>
Acked-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Currently, in core/init.c we do a fsp-specific load procedure to grab
the kernel image.
We'd like to do two things: allow other types of resources, and have
paths for non-FSP platforms to perform loads.
This change adds a platform-specific load_resource hook, and moves the
currently loading code to fsp_load_resource. To allow other resource
types, we add an identifier to indicate the type of resouce to load.
Signed-off-by: Jeremy Kerr <jeremy.kerr@au.ibm.com>
Acked-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Acked-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
This patch adds two opal calls (opal_ipmi_send and opal_ipmi_recv)
to allow an operating system to send and receive arbitrary ipmi
messages to the BMC.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
We steal opal_update_pending_evt's lock for protecting the allocated
dynamic event mask.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
This patch adds the generic i2c driver infrastructure to handle multiple i2c
master cores present in the system and exposes structures and interfaces for
the client to perform I/O on the i2c slave devices.
The driver adds the capability to queue multiple requests from client and
let clients notified asynchronously after completion. It does that by
handling the i2c interrupt or through OPAL poller in the absence of
interrupt.
Signed-off-by: Neelesh Gupta <neelegup@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
This makes OPAL use the OCC interrupt facility to send itself an interrupt
whenever the OPAL event bit is set as a result of an OPAL call that wasn't
itself opal_handle_interrupt() or opal_handle_hmi() (both of which we know
the OS will already deal with appropriately).
This ensures that OPAL event changes are notified to Linux via its
interrupt path which is necessary for it to properly broadcast the state
change to its various clients.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
OpenPOWER boxes don't have an FSP and therefore implement their own
method for passing log messages to a support processor. This patch
makes the logging method platform specific.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
Reviewed-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
In order to support fsp-less machines we need to be able to log errors
using a BMC or some other mechanism. Currently the error logging code
is tightly coupled to the platform making it difficult to add
different platforms.
This patch factors out the generic parts of the error logging code in
preparation for adding different logging backends. It also adds a
generic mechanism for pre-allocating a specific number of objects.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
The PEL log format is not specific to the FSP. We plan to use the same
format for OpenPOWER systems. This patch refactors the code into a
platform agnostic file.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
Reviewed-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
This better states the intention of what it should return.
I was bit unsure when fixing mem_size(), so hopefully this
makes future me (or other people) less unsure as to the
intended return value of this function.
No functional changes, just rename.
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Acked-by: Rusty Russell <rusty@au1.ibm.com>
|
|
There are more components using asynchronous infrastructure for messaging
between OPAL and kernel, therefore the patch bumps up the count and
documents the usage.
Signed-off-by: Neelesh Gupta <neelegup@linux.vnet.ibm.com>
Reviewed-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
The patch adds the support for reading and updating the system
parameter boot device path.
Signed-off-by: Neelesh Gupta <neelegup@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
This means the Linux output no longer gets into our internal log,
which makes dumping of it from Linux a lot nicer. It will also allow
us to improve the way we do the bufferring for Linux and to exploit
eventually the TX interrupts. It will also allow us to implement
some form of timeouts for the OPAL console variant of it so we don't
get stuck of the BMC doesn't consume from the virtual UART.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
Fixes 64MB chip support, improve Macronix settings, add Micron
chip support, etc...
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
Right now if any non-LED FSP_MCLASS_INDICATOR class sub
command is received, we print it as an invalid sub command
like the following which then eventually gets reported as an
unhandled FSP message.
[163022636453,5] FSPLED: Invalid FSP async sub command da1105
[163022638116,3] FSP: Unhandled message da1105
This patch defines the complete list of FSP_MCLASS_INDICATOR
sub commands and handle them in the registered FSP async command
client by sending a generic error acknowledgement to the FSP.
Reported-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Signed-off-by: Anshuman Khandual <khandual@linux.vnet.ibm.com>
Reviewed-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
Presently we are logging informational event if OCC timeout happens
during boot. Change the severity to Unrecoverable Error.
Also updated the elog description.
Sample Output:
|------------------------------------------------------------------------------|
| Entry Id Commit Time SubSystem Committed by |
| Platform Id State Event Severity Ascii Str |
|------------------------------------------------------------------------------|
| 0x53A530C8 10/09/2014 10:13:06 CEC Hardware Subsystem OC |
| 0xB0000001 Sent to Hypervisor Unrecoverable Error BB82C013 |
|------------------------------------------------------------------------------|
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Acked-by: Deepthi Dharwar <deepthi@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
When doing error injection to 32-bits MMIO range, fixed length 8MB
is used. That's incorrect as one PE might span multile segments.
Also the 32-bits MMIO segment size isn't 8MB necessarily.
The patch fixes the issue to cover all (contiguous) 32-bits MMIO
segments assigned to the specified PE. Also, it fixes the 48 bits
of 50 bits AIB address, instead of all bits used for comparison.
BZ: 115222
Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
The patch refactors the code we had for PCI error injection. It
doesn't change the logic:
* Rename names of error types and functions according to the
comments given by Michael Ellerman when reviewing the kernel
counterpart.
* Split The backend of error injection for PHB3 and P7IOC to
multiple functions to improve code readability. Some logics
are simplified without affecting their original functionality.
* Misc cleanup like renaming variables and functions.
Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
The bits in the control register are mostly write-1-to-clear, so
the rmw sequences in bt_setmask() and bt_clearmask() don't work.
Additionally, H_BUSY is weird as it's a write-1-to-toggle, so let's
write a "safe" function that sets it to the desired state based on
its previous state. (We can optimize that further later).
Also enable interrupt operations.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
The AMI images use the virtual UART, not the SIO UART, so configuring
the SIO the way we do is incorrect. Additionally, they don't configure
the interrupts properly (bad polarity for VUART and bad number for iBT).
This reworks the inits to fix that up:
- All SIO interrupts are set to level low
- Check if VUART is enabled. If yes, configure and use it (and disable
SIO UART which hostboot might have left enabled).
- Else, reconfigure VUART LPC address and IRQ properly
- Configure iBT LPC address and IRQ properly
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
This patch adds validation of the ipmi cmd and netfn numbers returned
by the bmc. It also ensures the sequence number is correct by
searching the outstanding message queue for the corresponding sequence
number.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
Similar to the use of fsp_present, this is so code can safely call
functions which may not work on the platform they are running on, or as
protection against calling before the device is initialised.
Signed-off-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
This sends command 20.7, Set ACPI Power State. It is to be used to
inform a BMC of the runtime state of the system. We drop the ACPI part
from the function name to avoid confusion.
As soon as IPMI is up, the palmetto platform init code will set the
power ptate to S0/working.
Signed-off-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
Linux sends us a 0 when shutting down. This means we don't need to pass
the u64 to the IPMI driver. Add a check that the value is what we expect
in case Linux changes it's behaviour in the future.
When rebooting, we should send the BMC a HARD_RESET command (0x03), not
POWER_CYCLE (0x02).
While we are here, trim some whitespace and drop opal from the IPMI
function name for readability.
Signed-off-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
Previously we were doing synchronous messaging and cranking the bt
state machine from within OPAL. This was not ideal as it could
potentially take control away from the OS for long periods of
time if the BMC is busy. This patch solves the problem using the
opal_poll api to do asynchronous messaging.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
The initial implementation of the ipmi stack was still tightly coupled
with the backend (in this case bt). This patch refactors the ipmi code
to use a generic backend device.
The core ipmi messaging functionality and the implementation of
specific commands has also been split into different files.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
The original implementation of the bt and ipmi layers required the bt,
ipmi and message data to be allocated separately. This is sub-optimal
as it could cause excessive memory fragmentation. This patch fixes the
problem by adding a function to the bt layer to allocate space for
both the required data and bt/ipmi message.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|