summaryrefslogtreecommitdiffstats
path: root/core
Commit message (Collapse)AuthorAgeFilesLines
* opal: Do not overwrite same HMI event for multiple HMI errors.Mahesh Salgaonkar2015-02-121-31/+45
| | | | | | | | | The current implementation overwrites the same HMI event if there are multiple HMI errors reported through a single HMI interrupt. This patch fixes that issue by sending separate HMI event per error. Signed-off-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* core/device: Function to return child node using nameNeelesh Gupta2015-02-111-0/+16
| | | | | | | | Add a function dt_find_by_name() that returns the child node if matches the given name, otherwise NULL. Signed-off-by: Neelesh Gupta <neelegup@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Make abort() update sp attn area (like assert does)Stewart Smith2015-02-111-2/+2
| | | | | | Gives better diagnostics in error logs/dumps Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* ipmi/wdt: Add ipmi watchdog timer supportAlistair Popple2015-02-092-2/+9
| | | | | | | | | | | | | | Add support for an ipmi watchdog timer. During skiboot initialisation this patch will cause the system to be reset if opal_run_pollers() isn't called for more than 60 seconds. Once the payload is started the watchdog timer will be reset and a pre-timeout interrupt set. The payload should then receive the interrupt and call into skiboot which will disable the watchdog timer. 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>
* ipmi: Implement Read Event and SEL parsingJoel Stanley2015-02-091-1/+2
| | | | | | | | | | | | | | | | | | The read event mechanism is used when the BMC has an asynchronous message for the host. It sets a flag that we read with Get Message Flags, and then we read the message using Read Event. This event message contains a SEL message. There are two OEM SEL messages we expect from the AMI BMC: - graceful power operations. This is when the BMC wants the host to power down or reboot. - PNOR Locking. When the BMC wants to access the PNOR, it requests that the host not touch it. This patch implements the parsing. Signed-off-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Merge remote branch 'ka1/master'Stewart Smith2015-02-091-0/+40
|\
| * ipmi: handle SMS_ATN eventsJeremy Kerr2015-02-091-0/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When the bt interface sets the SMS_ATN flag, we perform a Get Message Flags to determine what messages are available. The only message type currently processed is the Event Message Buffer, which provides SEL messages for indicating OEM specific events such as graceful system shutdown and PNOR access requested. These events will be handled by the IPMI layer in skiboot. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | cpu: Handle opal_reinit_cpus() more gracefully on P7Benjamin Herrenschmidt2015-02-091-0/+7
|/ | | | | | | Don't try to call into slw_reinit() which causes error logs to be generated. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
* ipmi: Add support for synchronous message sendingAlistair Popple2015-02-091-0/+23
| | | | | | | | | | | This patch adds support for sending ipmi messages synchronously. This is necessary to allow messages to be sent during skiboot initialisation as interrupt servicing/polling is controlled by the host operating system which is not yet running. 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>
* platform: Add exit platform hookAlistair Popple2015-02-091-0/+3
| | | | | | | | | Add a platform hook that is called just prior to loading and running the payload. 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>
* ipmi: Add a function to (re)initialise a message without allocationAlistair Popple2015-02-091-10/+18
| | | | | | | | | | | | | | | Currently the only functions we have for initialising ipmi messages with the correct values also allocate memory for the message. In some cases we want to reuse previously allocated messages to avoid continually freeing/allocating memory. This patch introduces a function which (re)initialises a previously allocated message and converts existing instances of this behaviour over to the new function. 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>
* Move skiboot internal things from opal.h to opal-api.hStewart Smith2015-02-0617-0/+19
| | | | | | | | | | 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>
* Allow ELF executables with function descriptor entrypoint to be skiboot payloadsNathan Whitehorn2015-02-041-0/+20
| | | | | | | | | | | | | Big-endian ELF64 ELF executables normally (the Linux kernel is an exception) have their entry point refer to a function descriptor instead of the first instruction. Distinguish between the Linux case and the function descriptor case, which is used for the FreeBSD kernel, by checking whether the entry point points into an executable section or not. This allows use of the FreeBSD kernel as a skiboot payload. Signed-off-by: Nathan Whitehorn <nwhitehorn@freebsd.org> [stewart@linux.vnet.ibm.com: reverse test polarity, change continue to break] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Unlock rtc cache lock when cache isn't validStewart Smith2015-01-211-1/+4
| | | | | | Otherwise we crash with recursive lock error during boot on some systems Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Don't run pollers when sending fsp msg for op panel op_display(FATAL)Stewart Smith2015-01-211-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I got the following recursive lock crash: LOCK ERROR: Invalid recursive lock @0x30108108 (state: 0x0000000000000001) [315691375,0] Aborting! CPU 0000 Backtrace: S: 0000000031a03080 R: 0000000030013508 .backtrace+0x24 S: 0000000031a03100 R: 0000000030017128 .abort+0x64 S: 0000000031a03170 R: 0000000030015d34 .lock_error+0x54 S: 0000000031a031f0 R: 0000000030015de8 .lock+0x50 S: 0000000031a03270 R: 000000003004fc20 .elog_timeout_poll+0x28 <- take elog_write_lock S: 0000000031a03300 R: 0000000030017d48 .opal_run_pollers+0x54 S: 0000000031a03380 R: 0000000030043fdc .fsp_sync_msg+0x74 S: 0000000031a03410 R: 000000003004eaa0 .op_display+0xdc S: 0000000031a034c0 R: 0000000030015d08 .lock_error+0x28 <- printf"LOCK ERROR" S: 0000000031a03540 R: 0000000030015de8 .lock+0x50 <- S: 0000000031a035c0 R: 000000003002413c .rtc_cache_get+0x20 <- rtc_tod_lock INCORRECTLY KEPT LOCK S: 0000000031a03650 R: 000000003002421c .rtc_cache_get_datetime+0x24 S: 0000000031a03700 R: 0000000030023100 .create_pel_log+0x340 S: 0000000031a037f0 R: 000000003004f9dc .opal_send_elog_to_fsp+0x5c <- take elog_write_lock S: 0000000031a03880 R: 00000000300238b4 .log_simple_error+0xe0 S: 0000000031a03a10 R: 00000000300245c8 .__xscom_write+0xb8 S: 0000000031a03aa0 R: 00000000300248c0 .xscom_write+0x138 S: 0000000031a03b60 R: 000000003002af1c .occ_send_dummy_interrupt+0x34 S: 0000000031a03bd0 R: 0000000030017b9c .opal_update_pending_evt+0x68 <- take evt_lock S: 0000000031a03c60 R: 00000000300511c8 .update_opal_dump_notify+0x48 S: 0000000031a03cd0 R: 00000000300517f0 .add_dump_id_to_list+0xe8 S: 0000000031a03d80 R: 00000000300553e4 .ibm_fsp_init+0xd4 S: 0000000031a03e30 R: 00000000300140f0 .main_cpu_entry+0x3ec S: 0000000031a03f00 R: 0000000030002504 boot_entry+0x18c Which is wonderfully fascinating as there are *TWO* lock_error frames in the call stack, which means we lost the original error. This is because op_display() sends an FSP message with fsp_sync_msg() which runs opal_run_pollers() which ended up running a poller that tried to take a lock we already had when we ran into trouble. Basically, running pollers during this kind of fatal error handling is a bad idea. So, instead of doing that, just queue the FSP message and don't wait for a response (we don't really care about the response on a fatal error anyway). Additionally, move op_display() to *after* the printf call on the hope that printf ends up being a bit more foolproof than having to send FSP messages. Now, with this bug fixed, the correct lock_error() will be displayed. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Merge branch 'update-2.1.1.1'Stewart Smith2015-01-192-0/+114
|\
| * opal: Add unit test for buffer overrun in prlog/printfMahesh Salgaonkar2015-01-192-2/+125
| | | | | | | | | | | | | | | | | | Add unit test for buffer overrun in prlog/printf. Signed-off-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com> Acked-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com> [stewart@linux.vnet.ibm.com: rebased to stable branch] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | clean CORE_TEST_NOSTUB binariesStewart Smith2014-12-191-0/+1
| | | | | | | | Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | Add console-log unit testStewart Smith2014-12-192-0/+87
| | | | | | | | Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | Exclude all test cases from coverage-reportStewart Smith2014-12-191-0/+2
| | | | | | | | | | | | | | | | This way we get a true representation from the lcov coverage-report about what firmware code we're testing (besides, test cases are always going to only have 50% of branches hit - we're asserting the tests pass!) Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | Add another pel test to test user sectionStewart Smith2014-12-191-0/+33
| | | | | | | | | | | | This increases our code coverage of pel.c from 81.3% to 98.7% Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | Increase test coverage of pel testStewart Smith2014-12-192-2/+6
| | | | | | | | | | | | Cover pel buffer too small case in create_pel_log Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | Pretty print make check and coverage outputStewart Smith2014-12-191-5/+5
| | | | | | | | | | | | Can still get the details with V=1, just like normal make. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | Fix makefile dependency generation, especially for HOSTCCStewart Smith2014-12-151-9/+0
| | | | | | | | | | | | | | | | | | | | | | Instead of having individual rules to generate .d, add -MMD to HOSTCC parameters, and just include the generated .d files. This fixes a few weird dependency issues. Also, make the mambo hello_kernel test depend on skiboot.lid Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | Don't add dummy console property if already in dt.Ryan Grimm2014-12-101-1/+3
| | | | | | | | | | | | | | | | | | | | generic_platform_init() adds this propery by default in commit 9594a715b50c338f1261e88c12c120cf8e5b8bba . If a platform adds it to the dt, Sapphire detects multiple dt props and dies. So don't add it if already exists in the dt. Signed-off-by: Ryan Grimm <grimm@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | silence integer/pointer from integer/pointer warnings in ↵Stewart Smith2014-12-051-3/+3
| | | | | | | | | | | | core/test/run-mem_region_init.c Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | Fix unused result of realloc warning in core/test/run-malloc.cStewart Smith2014-12-051-1/+3
| | | | | | | | Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | Fix unbounded stack usage warning in core/test/run-mem_region_release_unused.cStewart Smith2014-12-051-1/+5
| | | | | | | | Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | opal: Don't put the symbol map whole into a propertyBenjamin Herrenschmidt2014-12-051-3/+5
| | | | | | | | | | | | | | | | | | | | The huge property trips a bug in some versions of kexec, and it generally makes looking at the device-tree more painful than it has to be. Instead, let's just pass the address & size and we'll add a debugfs file on the Linux side to recover them. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | Silence warning for core/tests/stubs.c prlog missing prototypeStewart Smith2014-12-051-1/+3
| | | | | | | | | | | | We get the real prototype in real code from skiboot.h Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | Fix unbounded stack usage warning in ↵Stewart Smith2014-12-051-1/+5
| | | | | | | | | | | | core/test/run-mem_region_release_unused_noalloc.c Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | core/hostservices.c and core/slw.c: cleanup log messagesCédric Le Goater2014-12-031-4/+3
| | | | | | | | | | | | | | | | printing timebase is redundant, prlog does that for us. Signed-off-by: Cédric Le Goater <clg@fr.ibm.com> Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | elog: Clean up error logging headersAlistair Popple2014-12-023-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit cf6f4e8912d29fb89ce85c84834607065ad595a5 introduced a platform independent frontend for error logging. However it failed to move the generic parts of the fsp-elog.h header into the platform independent one, instead relying on the fact that up until now fsp-elog.h was included whenever a function needed to log errors. This patch moves the platform independent defines into the frontend header file (errorlog.h) and removes the include of the platform specific header in generic code paths. Signed-off-by: Alistair Popple <alistair@popple.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | ipmi/bt: Enable adding messages to the start of the queueAlistair Popple2014-12-021-0/+5
| | | | | | | | | | | | | | | | | | | | By default new ipmi messages are added to the end of the transmission queue. However sometimes it is necessary to add messages to the start of the queue. This patch adds a new ipmi function that adds messages to the start of the transmission queue. Signed-off-by: Alistair Popple <alistair@popple.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | rtc: Add a generic rtc cacheAlistair Popple2014-12-023-3/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | Some of the generic skiboot code needs access to the rtc (for example the pel logging code). Currently this is accessed via a call to fsp specific code which implements an rtc cache. Obviously this wont work on systems without a fsp. This patch makes the rtc cache generic so that we can get the time on other platforms (assuming they have some kind of rtc). Signed-off-by: Alistair Popple <alistair@popple.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | core/device: wrap a function to destroy a dt_nodeWei Yang2014-12-021-8/+13
| | | | | | | | | | | | | | | | | | | | | | When destroying a dt_node, it needs to release both the name and itself. And there are several places to do the release. This patch wrap a function dt_destroy() to make sure both of the elements of a dt_node are released when it is not used any more. Signed-off-by: Wei Yang <weiyang@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | core/init: make fdt a local variableWei Yang2014-12-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | Currently there is a file scope variable fdt, which is just used in load_and_boot_kernel(). Since no other user, it is not necessary to define it as a file scope variable. This patch makes it a local variable in the function. Signed-off-by: Wei Yang <weiyang@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | Remove #define sync in test/run-trace.c - don't confuse with sync(2)Stewart Smith2014-12-021-2/+1
| | | | | | | | Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | core/test: fix compile error in run-traceCédric Le Goater2014-12-021-0/+5
| | | | | | | | | | Signed-off-by: Cédric Le Goater <clg@fr.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | Add tweaks to work in Mambo simulatorBenjamin Herrenschmidt2014-12-014-13/+63
| | | | | | | | | | | | | | | | | | | | | | Mambo doesn't implement various things such as PBA SCOMs, LPC, ChipTOD, etc... It also provides a special console hook. This adds detection of Mambo via the /mambo node, and enables us to boot all the way to Linux. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | Remove sprintf: there's no good reason to have this in firmwareStewart Smith2014-11-281-3/+3
| | | | | | | | Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | Merge remote-tracking branch 'ltcgit/master'Benjamin Herrenschmidt2014-11-281-1/+2
|\ \
| * | abort if device tree parsing failsAnton Blanchard2014-11-261-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | I debugged a checkstop with a BML boot which turned out to be device tree issues. A corrupt device tree is very likely to result in a later checkstop, so abort in dt_expand to make debugging much easier. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | | More trace endian fixes so make check works againBenjamin Herrenschmidt2014-11-282-48/+53
|/ / | | | | | | | | | | | | 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>
* | Merge branch 'update-2.1.1.1'Stewart Smith2014-11-261-0/+29
|\ \ | |/
| * occ/hbrt: Call stopOCC() for implementing reset OCC command from FSPShilpasri G Bhat2014-11-251-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | use $(wildcard ) in test MakefilesDan Streetman2014-11-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The core/test/ and libc/test/ Makefile.check files both contain: -include core/test/*.d (or libc/test/*d) which is incorrect, since that evaluates literally to a *.d file. This results in each build trying to find that file, and creating it when not found (in an incorrect way because of other problems in the Makefile). The correct way to specify it is: -include $(wildcard core/test/*.d) Signed-off-by: Dan Streetman <ddstreet@ieee.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
* | Merge remote-tracking branch 'ltcgit/master'Benjamin Herrenschmidt2014-11-222-2/+2
|\ \
| * | Implement skiboot versioningStewart Smith2014-11-192-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | opal: Remove MCE handling code.Mahesh Salgaonkar2014-11-221-164/+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>
OpenPOWER on IntegriCloud