aboutsummaryrefslogtreecommitdiff
path: root/core
AgeCommit message (Collapse)AuthorFilesLines
2014-12-19clean CORE_TEST_NOSTUB binariesStewart Smith1-0/+1
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-12-19Add console-log unit testStewart Smith2-0/+87
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-12-19Exclude all test cases from coverage-reportStewart Smith1-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>
2014-12-19Add another pel test to test user sectionStewart Smith1-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>
2014-12-19Increase test coverage of pel testStewart Smith2-2/+6
Cover pel buffer too small case in create_pel_log Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-12-19Pretty print make check and coverage outputStewart Smith1-5/+5
Can still get the details with V=1, just like normal make. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-12-15Fix makefile dependency generation, especially for HOSTCCStewart Smith1-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>
2014-12-10Don't add dummy console property if already in dt.Ryan Grimm1-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>
2014-12-05silence integer/pointer from integer/pointer warnings in ↵Stewart Smith1-3/+3
core/test/run-mem_region_init.c Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-12-05Fix unused result of realloc warning in core/test/run-malloc.cStewart Smith1-1/+3
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-12-05Fix unbounded stack usage warning in core/test/run-mem_region_release_unused.cStewart Smith1-1/+5
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-12-05opal: Don't put the symbol map whole into a propertyBenjamin Herrenschmidt1-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>
2014-12-05Silence warning for core/tests/stubs.c prlog missing prototypeStewart Smith1-1/+3
We get the real prototype in real code from skiboot.h Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-12-05Fix unbounded stack usage warning in ↵Stewart Smith1-1/+5
core/test/run-mem_region_release_unused_noalloc.c Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-12-03core/hostservices.c and core/slw.c: cleanup log messagesCédric Le Goater1-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>
2014-12-02elog: Clean up error logging headersAlistair Popple3-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>
2014-12-02ipmi/bt: Enable adding messages to the start of the queueAlistair Popple1-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>
2014-12-02rtc: Add a generic rtc cacheAlistair Popple3-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>
2014-12-02core/device: wrap a function to destroy a dt_nodeWei Yang1-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>
2014-12-02core/init: make fdt a local variableWei Yang1-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>
2014-12-02Remove #define sync in test/run-trace.c - don't confuse with sync(2)Stewart Smith1-2/+1
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-12-02core/test: fix compile error in run-traceCédric Le Goater1-0/+5
Signed-off-by: Cédric Le Goater <clg@fr.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-12-01Add tweaks to work in Mambo simulatorBenjamin Herrenschmidt4-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>
2014-11-28Remove sprintf: there's no good reason to have this in firmwareStewart Smith1-3/+3
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-11-28Merge remote-tracking branch 'ltcgit/master'Benjamin Herrenschmidt1-1/+2
2014-11-28More trace endian fixes so make check works againBenjamin Herrenschmidt2-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>
2014-11-26abort if device tree parsing failsAnton Blanchard1-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>
2014-11-26Merge branch 'update-2.1.1.1'Stewart Smith1-0/+29
2014-11-25occ/hbrt: Call stopOCC() for implementing reset OCC command from FSPShilpasri G Bhat1-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>
2014-11-25use $(wildcard ) in test MakefilesDan Streetman1-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>
2014-11-22Merge remote-tracking branch 'ltcgit/master'Benjamin Herrenschmidt2-2/+2
2014-11-22opal: Remove MCE handling code.Mahesh Salgaonkar1-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>
2014-11-22opal: Remove machine check interrupt patching in OPAL.Mahesh Salgaonkar1-25/+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-22core/test: Fix timer test caseVasant Hegde1-1/+1
Commit b54d1a8 broke timer test case. core/test/run-timer.c: In function ‘main’: core/test/run-timer.c:52:3: error: too few arguments to function ‘check_timers’ check_timers(); ^ In file included from core/test/run-timer.c:16:0: core/test/../timer.c:201:6: note: declared here void check_timers(bool from_interrupt) ^ make: *** [core/test/run-timer] Error 1 This patch fixes above compilation issue. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-11-19Implement skiboot versioningStewart Smith2-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>
2014-11-18Add symbolic backtraces and expose skiboot map to LinuxBenjamin Herrenschmidt3-23/+57
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 Herrenschmidt3-3/+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 Herrenschmidt2-15/+22
__builtin_frame_address really wants constants Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-11-18Capture backtraces when measuring stack depthBenjamin Herrenschmidt2-13/+26
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-11-18Rename backtrace.c to stack.c and move stack related bitsBenjamin Herrenschmidt3-82/+83
... from util.c to stack.c Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-11-18Add functions to backtrace into a non-text bufferBenjamin Herrenschmidt2-28/+72
Separate text translation from capture of the backtrace Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-11-17Stack checking extensionsBenjamin Herrenschmidt5-14/+107
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-14timer: Change property name "ibm,heartbeat-freq" -> "ibm,heartbeat-ms"Benjamin Herrenschmidt1-2/+2
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-11-12bt/ipmi: Quieten logging outputAlistair Popple1-1/+1
Some tools (eg. ipmitool) that use the Linux ipmi stack send potentially invalid commands to probe functionality. Currently skiboot prints an error to the console whenever this happens resulting in excessive noise when using the Linux ipmi stack. This patch just removes and/or lowers the logging level of these errors. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-11-12timer: Only check "poll" timers on actual poll, not any interruptBenjamin Herrenschmidt3-4/+5
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 Herrenschmidt2-1/+2
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 Herrenschmidt2-16/+130
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 Herrenschmidt2-1/+117
And start adding interfaces to lookup i2c busses. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-11-07timer: Add scheduled timer facilityBenjamin Herrenschmidt6-1/+202
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-2/+3
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>