aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2014-12-02opal: Handle more TFAC errors.Mahesh Salgaonkar1-0/+5
Handle more TFAC errors reported through TFMR i.e TB_RESIDUE_ERR, FW_CONTROL_ERR and CHIP_TOD_PARITY_ERR. Clear these errors by writing to respective TFMR bits. Signed-off-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-12-01Add documentation describing skiboot versioningStewart Smith1-0/+107
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-12-01Add scripts to run from MamboBenjamin Herrenschmidt2-0/+362
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-12-01Add tweaks to work in Mambo simulatorBenjamin Herrenschmidt13-18/+123
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 vsprintf: just like sprintf, vsnprintf is a much better ideaStewart Smith4-22/+2
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-11-28Remove sprintf: there's no good reason to have this in firmwareStewart Smith8-43/+12
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-11-28PLAT: Add i2c busses on firenzeNeelesh Gupta2-1/+133
Set up the device tree nodes of i2c masters and their busses, eventually all this has to come from hostboot. Signed-off-by: Neelesh Gupta <neelegup@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-11-28elog: (sensor) Replace prerror with elogNeelesh Gupta1-7/+7
Replace prerror with 'elog' interface and correct one existing SRC map from error type. Signed-off-by: Neelesh Gupta <neelegup@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-11-28Enable warn_unused_result for fsp_queue_msg()Stewart Smith1-1/+1
We now get a bunch of warnings of places where we should go and fix the code, yay! (acked in discussing thread on list) Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com> Acked-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Acked-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
2014-11-28Merge remote-tracking branch 'ltcgit/master'Benjamin Herrenschmidt11-21/+28
2014-11-28More trace endian fixes so make check works againBenjamin Herrenschmidt4-71/+78
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-27Liberally sprinkle attribute((warn_unused_result)) around the placeStewart Smith7-18/+22
None of these actually produce any warnings. My next patch will. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-11-26Add attribute warn_unused_result to compiler.h and dt_expand_nodeStewart Smith2-1/+3
This would have thrown a compiler warning for cf8def9 rather than failing at runtime. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
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-26Make lpc_interrupt() attribute constStewart Smith1-1/+1
It's a placeholder at the moment, which makes it easy to say "this never gives a different answer". It also silences our one compiler warning: hw/lpc.c: In function 'lpc_interrupt': hw/lpc.c:457:6: warning: function might be candidate for attribute 'const' [-Wsuggest-attribute=const] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-11-26Various fixes to dump_tracesBenjamin Herrenschmidt3-33/+41
Endian breakage, build breakage, ... Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-11-26Merge branch 'update-2.1.1.1'Stewart Smith2-9/+10
2014-11-26Include stdint.h for libc/test/run-time.c, fixing buildStewart Smith1-0/+1
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-11-26vsnprintf: Change print_itoa to use less stackShreyas B. Prabhu1-9/+9
Remove recursive call in print_itoa to reduce the stack usage. Signed-off-by: Shreyas B. Prabhu <shreyas@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-11-26Add Travis configurationJoel Stanley1-0/+21
This will allow Travis CI (https://travis-ci.org) to build the firmware and run the test suite. In the future we can also use it to run and publish the results of scan-build and lcov. Travis build environments are stuck back on 12.04, so we don't have a powerpc cross compiler as part of the archive. Instead download one from kernel.org and use that. The 'make check' tests rely on newer -Wstack-usage flags that are not present on the old version of gcc shipped with 12.04. Install 4.8 from the toolchain ppa and set it to be the system default. The tests also require valgrind, so include that in the VM environment. Signed-off-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-11-26Merge branch 'update-2.1.1.1'Stewart Smith1-1/+1
2014-11-26FSP: Validate fsp_msg in fsp_queue_msgVasant Hegde1-1/+1
There are many places where we just pass fsp_msg without validating whether message allocation succeded or not (like fsp_queue_msg(fsp_mkmsg(...))). If message allocation fails then we endup crashing OPAL. This patch validates fsp_msg before using. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-11-26fix Makefile when using a build directoryCédric Le Goater1-1/+2
When using a build directory different from the source tree, .C files and make_version.sh are not found : make: *** No rule to make target `libpore/p8_pore_table_gen_api_fixed.o', needed by `libpore/built-in.o'. make: *** No rule to make target `make_version.sh', needed by `version.c'. Signed-off-by: Cédric Le Goater <clg@fr.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-11-26Merge branch 'update-2.1.1.1'Stewart Smith3-12/+63
2014-11-25occ: Reduce stack usage in add_cpu_pstate_properties()Vaidyanathan Srinivasan1-8/+24
This function uses int arrays from stack that pushes stack usage to more than 2kB. Reduce stack usage by allocating memory. Ben H's stack check compile option exposed this usage count: hw/occ.c: In function 'add_cpu_pstate_properties': hw/occ.c:187:1: warning: the frame size of 2064 bytes is larger than 2048 bytes [-Wframe-larger-than=] Signed-off-by: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-11-25occ: Fix the low level ACK message sent to FSP on receiving {RESET/LOAD}_OCCShilpasri G Bhat1-2/+2
Modify the FSP response message to include the status code in the status/error byte instead of adding a new word to it which is incorrect. FSP ack messages are 2 words with status in the 3rd byte of second word. Status byte is in the extra (3rd) word only on new status messages from OPAL to FSP. Code corrected based on FSP mailbox spec version 3.16. 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-25occ/hbrt: Call stopOCC() for implementing reset OCC command from FSPShilpasri G Bhat3-2/+37
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-25palmetto: Use the right model of VPD eepromBenjamin Herrenschmidt1-1/+1
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-11-25use $(wildcard ) in test MakefilesDan Streetman2-2/+2
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 Herrenschmidt9-22/+105
2014-11-22opal: Remove MCE handling code.Mahesh Salgaonkar5-275/+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 Salgaonkar2-32/+2
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-19don't echo version during make.Stewart Smith1-1/+0
whoops Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-11-19Fail build when SKIBOOT_VERSION not set and not in git treeskiboot-4.0Stewart Smith1-1/+6
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-11-19Implement skiboot versioningStewart Smith8-18/+65
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-19Merge branch 'update-2.1.1.1'Stewart Smith1-0/+32
2014-11-18Add symbolic backtraces and expose skiboot map to LinuxBenjamin Herrenschmidt12-32/+113
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 Herrenschmidt8-29/+1
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 Herrenschmidt3-15/+24
__builtin_frame_address really wants constants Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-11-18Capture backtraces when measuring stack depthBenjamin Herrenschmidt6-17/+38
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 Herrenschmidt7-44/+114
Separate text translation from capture of the backtrace Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-11-18phb3: Increase some timeouts (SW283991)skiboot-2.1.1-fw810.20-2Benjamin Herrenschmidt1-4/+40
This increase various timeouts as per CQ SW283991 which should help with some external drawers and GPUs. We also fixup the timeouts in the PEC which HB won't do before GA3. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-11-17Stack checking extensionsBenjamin Herrenschmidt14-18/+166
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-17Quote built-in kernel path from MakefileBenjamin Herrenschmidt2-6/+2
Otherwise, if your path contains something like "linux-foo" then the "linux" part gets replaced by the preprocessor due to stupid built-ins. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-11-17Merge branch 'update-2.1.1.1'Benjamin Herrenschmidt1-8/+9
Merge PHB3 fixes from stable update
2014-11-17phb3: Increase some timeouts (SW283991)Benjamin Herrenschmidt1-4/+8
This increase various timeouts as per CQ SW283991 which should help with some external drawers and GPUs. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-11-17PHB3: wait 1s after PERST deassert for CAPP adaptersRyan Grimm1-4/+1
On a re-ipl or warm reboot, Sapphire asserts and deasserts PERST to each slot. This results in the fpga image loaded into the flash for a CAPP adapter. HMIs have been observed with a 200ms wait following PERST deassert, so bump time up to 1s. Do this for all cases because re-ipl does not preserve memory and we'd need a mechanism for Sapphire know that there is a CAPP adapter. We might be able to reduce this to 750ms or 500ms but need more testing. Use 1s to be safe. Also, phyp fw uses 1s after deassert. Signed-off-by: Ryan Grimm <grimm@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-11-14platforms/astbmc: Temporary reboot workaroundJoel Stanley1-1/+3
The BMC does not currently support the IPMI_RESET (03h) chassis power control command. In order to have reboot working in the interim, send a POWER_CYCLE (02h) instead. This should be reverted once the BMC has support for 03h to ensure we follow the specification. Signed-off-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>