aboutsummaryrefslogtreecommitdiff
path: root/include
AgeCommit message (Collapse)AuthorFilesLines
2014-11-28More trace endian fixes so make check works againBenjamin Herrenschmidt1-22/+24
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>
2014-11-26Merge branch 'update-2.1.1.1'Stewart Smith1-0/+1
2014-11-25occ/hbrt: Call stopOCC() for implementing reset OCC command from FSPShilpasri G Bhat1-0/+1
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>
2014-11-22Merge remote-tracking branch 'ltcgit/master'Benjamin Herrenschmidt2-5/+5
2014-11-22opal: Remove MCE handling code.Mahesh Salgaonkar3-106/+0
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>
2014-11-22opal: Remove machine check interrupt patching in OPAL.Mahesh Salgaonkar1-7/+1
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>
2014-11-19Implement skiboot versioningStewart Smith2-5/+5
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>
2014-11-18Add symbolic backtraces and expose skiboot map to LinuxBenjamin Herrenschmidt3-2/+8
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>
2014-11-18Remove useless global include memory.hBenjamin Herrenschmidt1-23/+0
It only exposed one function that is local to the hdat stuff Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-11-18Fix backtracesBenjamin Herrenschmidt1-0/+2
__builtin_frame_address really wants constants Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-11-18Capture backtraces when measuring stack depthBenjamin Herrenschmidt2-2/+8
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-11-18Add functions to backtrace into a non-text bufferBenjamin Herrenschmidt3-14/+28
Separate text translation from capture of the backtrace Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-11-17Stack checking extensionsBenjamin Herrenschmidt4-2/+24
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>
2014-11-14i2c: Provide FFDC data in the driverNeelesh Gupta3-1/+31
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>
2014-11-12timer: Only check "poll" timers on actual poll, not any interruptBenjamin Herrenschmidt1-1/+1
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>
2014-11-12i2c: Use new timer facility and improve interrupts handlingBenjamin Herrenschmidt3-4/+7
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>
2014-11-12timer: Add "polling" timersBenjamin Herrenschmidt1-1/+17
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>
2014-11-11i2c: Move bus management and OPAL API to core i2c codeBenjamin Herrenschmidt1-3/+25
And start adding interfaces to lookup i2c busses. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-11-07i2c: Rework P8 i2c driverBenjamin Herrenschmidt2-3/+23
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>
2014-11-07timer: Add scheduled timer facilityBenjamin Herrenschmidt2-0/+72
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>
2014-11-05i2c: Bug fixes, clean up of the codeNeelesh Gupta1-1/+0
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>
2014-10-30core: Add support for loading an external initramfsJeremy Kerr2-1/+5
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>
2014-10-30platform: add a platform hook for loading external resourcesJeremy Kerr2-0/+12
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>
2014-10-30ipmi: Add an opal interface to the ipmi stackAlistair Popple2-1/+17
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>
2014-10-30opal: Add facility for dynamic event bitsJeremy Kerr1-0/+2
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>
2014-10-27hw/i2c: i2c driver infrastructure providing device I/ONeelesh Gupta3-1/+58
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>
2014-10-24irq/occ/opal: Add self-sent dummy interruptBenjamin Herrenschmidt2-1/+5
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>
2014-10-22fsp/elog: Make the logging backend platform specificAlistair Popple1-0/+3
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>
2014-10-22fsp/elog: Create a logging frontendAlistair Popple4-10/+64
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>
2014-10-22fsp/elog: Separate the PEL log formatting functionsAlistair Popple2-148/+178
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>
2014-10-17Rename mem_size() to mem_allocated_size()Stewart Smith1-1/+1
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>
2014-10-15opal-msg: Bump up the maximum asynchronous completion countNeelesh Gupta1-1/+6
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>
2014-10-15sysparam: Add the new system parameter boot device pathNeelesh Gupta1-0/+1
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>
2014-10-15uart: Give UART it's own OPAL console callbacks instead of dummy consoleBenjamin Herrenschmidt2-3/+3
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>
2014-10-15libflash: Sync with pflash 0.8.3Benjamin Herrenschmidt1-0/+6
Fixes 64MB chip support, improve Macronix settings, add Micron chip support, etc... Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-10-15led: Handle all the FSP_MCLASS_INDICATOR class sub commandsAnshuman Khandual1-0/+21
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>
2014-10-10Merge branch 'release-2.1.1'Stewart Smith1-0/+1
2014-10-10OCC: Change OCC timeout elog severityskiboot-2.1.1-fw810.20-1Vasant Hegde1-0/+1
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>
2014-10-08Merge branch 'release-2.1.1'Benjamin Herrenschmidt3-30/+34
2014-10-08PHB3: Support multiple MM32 segments for error injectionGavin Shan1-2/+4
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>
2014-10-08PCI: Refactor error injectionGavin Shan2-28/+30
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>
2014-10-05ipmi/bt: Rework iBT register accessBenjamin Herrenschmidt1-0/+1
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>
2014-10-05plat/palmetto: Fix SIO UART vs UART setup and iBT setupBenjamin Herrenschmidt1-2/+17
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>
2014-10-01ipmi/bt: Improve message validation and allow out-of-order command responsesAlistair Popple1-1/+1
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>
2014-10-01ipmi: Add ipmi_present APIJoel Stanley1-0/+3
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>
2014-10-01ipmi/power: Add power state IPMI commandJoel Stanley1-0/+19
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>
2014-10-01ipmi/power: Update chassis control commandJoel Stanley1-2/+2
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>
2014-10-01bt/ipmi: Convert to using asynchronous messagingAlistair Popple1-1/+2
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>
2014-10-01ipmi: Refactored ipmi layer to use generic backendAlistair Popple2-26/+53
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>
2014-10-01bt/ipmi: Fixup allocation of bt/ipmi messagesAlistair Popple2-2/+7
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>