aboutsummaryrefslogtreecommitdiff
path: root/hw/ipmi
AgeCommit message (Collapse)AuthorFilesLines
2023-06-06ipmi: remove unused OS watchdog supportNicholas Piggin1-25/+0
This code hasn't been enabled, remove it. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2023-06-06platforms: Use astbmc_exitNicholas Piggin1-1/+0
Move all platforms using astbmc_init() to use astbmc_exit(). Move ipmi_set_boot_count() to astbmc_exit from ipmi_wdt_final_reset(). Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2021-04-07hw/ipmi: Fix misleading-indentation failuresVasant Hegde1-1/+1
Hitting below issue on recent distro (fedora-rawhide). sample failure: --------------- [ HOSTCC ] hw/ipmi/test/run-fru.c In file included from hw/ipmi/test/run-fru.c:10: hw/ipmi/test/../ipmi-fru.c: In function 'fru_fill_product_info': hw/ipmi/test/../ipmi-fru.c:80:17: error: this 'if' clause does not guard... [-Werror=misleading-indentation] 80 | if (rc < 1) return OPAL_PARAMETER; rc; }) | ^~ hw/ipmi/test/../ipmi-fru.c:102:18: note: in expansion of macro 'FRU_INSERT_STRING' 102 | index += FRU_INSERT_STRING(&buf[index], info->manufacturer); | ^~~~~~~~~~~~~~~~~ hw/ipmi/test/../ipmi-fru.c:80:52: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if' 80 | if (rc < 1) return OPAL_PARAMETER; rc; }) | ^~ hw/ipmi/test/../ipmi-fru.c:102:18: note: in expansion of macro 'FRU_INSERT_STRING' 102 | index += FRU_INSERT_STRING(&buf[index], info->manufacturer); | ^~~~~~~~~~~~~~~~~ Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Reviewed-by: Dan Horák <dan@danny.cz>
2020-06-17test: Do gcov builds as a seperate passOliver O'Halloran1-1/+1
We only really use the gcov output when doing the coverage report as a part of the "docs" CI builds. It's useful for development to just run the unit tests so make sure the "check" and "coverage" targets are seperate. This also speeds up our CI builds since those jobs are already doing a seperate GCOV pass so building and running the GCOV binaries during the check pass is redundant. Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
2020-03-12Re-license IBM written files as Apache 2.0 OR GPLv2+Stewart Smith9-9/+9
SPDX makes it a simpler diff. I have audited the commit history of each file to ensure that they are exclusively authored by IBM and thus we have the right to relicense. The motivation behind this is twofold: 1) We want to enable experiments with coreboot, which is GPLv2 licensed 2) An upcoming firmware component wants to incorporate code from skiboot and code from the Linux kernel, which is GPLv2 licensed. I have gone through the IBM internal way of gaining approval for this. The following files are not exclusively authored by IBM, so are *not* included in this update (I will be seeking approval from contributors): core/direct-controls.c core/flash.c core/pcie-slot.c external/common/arch_flash_unknown.c external/common/rules.mk external/gard/Makefile external/gard/rules.mk external/opal-prd/Makefile external/pflash/Makefile external/xscom-utils/Makefile hdata/vpd.c hw/dts.c hw/ipmi/ipmi-watchdog.c hw/phb4.c include/cpu.h include/phb4.h include/platform.h libflash/libffs.c libstb/mbedtls/sha512.c libstb/mbedtls/sha512.h platforms/astbmc/barreleye.c platforms/astbmc/garrison.c platforms/astbmc/mihawk.c platforms/astbmc/nicole.c platforms/astbmc/p8dnu.c platforms/astbmc/p8dtu.c platforms/astbmc/p9dsu.c platforms/astbmc/vesnin.c platforms/rhesus/ec/config.h platforms/rhesus/ec/gpio.h platforms/rhesus/gpio.c platforms/rhesus/rhesus.c platforms/astbmc/talos.c platforms/astbmc/romulus.c Signed-off-by: Stewart Smith <stewart@linux.ibm.com> [oliver: fixed up the drift] Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
2020-03-11eSEL: Make sure PANIC logs are sent to BMC before calling assertVasant Hegde1-2/+15
eSEL logs are split into multiple smaller chunks and sent to BMC. We use ipmi_queue_msg_sync() interface for sending OPAL_ERROR_PANIC severity events to BMC. But callback handler (ipmi_cmd_done()) clears 'sync_msg' after getting response to first chunk as its not aware that we have more data to send. So in assert()/checkstop path we may endup checkstoping system before error log is sent to BMC completely. We will miss useful error log. This patch introduces new wait loop in ipmi_elog_commit(). It will wait until error log is sent to BMC. I think this is safe because even if something goes wrong (like BMC reset) we will hit timeout and eventually we will come out of this loop. Alternatively we can add additional check in ipmi_cmd_done() path. But I don't wanted to make this path aware of message type. Reviewed-by: Klaus Heinrich Kiwi <klaus@linux.vnet.ibm.com> Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
2020-03-11esel: Fix OEM SEL generator IDVasant Hegde1-1/+1
Fixes: a2c74d83 (ipmi: endian conversion) Cc: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
2020-03-11ipmi-sel: Free ipmi_msg in error pathVasant Hegde1-0/+1
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
2019-12-16ipmi: endian conversionNicholas Piggin1-1/+1
Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
2019-12-16opal-msg: endian fixes for opal-msg.c and opal_queue_msg callersNicholas Piggin1-2/+4
Reported-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Reviewed-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
2019-12-16opal-api: add endian conversions to most opal callsNicholas Piggin1-4/+7
This adds missing endian conversions to most calls, sufficient at least to handle calls from a kernel booting on mambo. Subsystems requiring more extensive changes (e.g., xive) will be done with individual changes. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Reviewed-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
2019-11-14IPMI: Trigger OPAL TI in abort path.Mahesh Salgaonkar1-7/+23
The current assert/abort implementation for BMC based system invokes cec reboot after printing backtrace. This means that BMC never gets notified about OPAL crash/termination. This sometimes leads into never ending IPL-ing loop if OPAL keeps aborting very early in boot path. Trigger a software xstop (OPAL TI) to inform BMC about the OPAL termination. BMC is capable of catching checkstop signal and facilitate in rebooting (IPL-ing) host. With AutoReboot policy, OpenBMC handles checkstop signals and counts them against the reboot counter. In cases where OPAL is crashing before host reaches to runtime, OpenBMC will move the system in Quiesced state after 3 or so attempts of IPL/reboot so that system can be debugged. When OPAL triggers software checkstop it causes all the CPU threads to be stooped and moved to quiesced state. Hence OPAL don't need to explicitly stop all CPUs before calling software xstop. Signed-off-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com> Reviewed-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
2019-08-16ipmi: Use standard MIN() macro definitionJordan Niethe1-3/+1
There is a MIN() macro definition in skiboot.h. Remove the redundant definition from here and use that one. Signed-off-by: Jordan Niethe <jniethe5@gmail.com> Acked-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
2019-08-15MPIPL: Add support to trigger MPIPL on BMC systemVasant Hegde1-3/+11
On FSP based system we call 'attn' instruction. FSP detects attention and initiates memory preserving IPL. On BMC system we have to call SBE S0 interrupt to initiate memory preserving IPL. This patch adds support to call SBE S0 interrupt in assert path. Sequence : - S0 interrupt on secondary chip SBE - S0 interrupt on primary chip SBE Note that this is hooked to ipmi_terminate path. We have HDAT flag for MPIPL support. If MPIPL is not supported then we don't create 'ibm,opal/dump' node and we will fall back to existing termination flow. Finally we want to log error log to BMC before triggerring MPIPL. Hence this patch re-organizes ipmi_terminate() such that we call ipmi_log_terminate_event() before triggering MPIPL. Note: - At present we do not have a proper way to detect SBE is alive or not. So we wait for predefined time and then call normal reboot. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> [oliver: rebased] Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
2019-07-30Support BMC IPMI heartbeat commandAndrew Geissler1-0/+14
A few years ago, the OpenBMC code added support for a "heartbeat" command to send to the host. This command is used after the BMC is reset to check if the host is running. Support was never added to the host side however so currently when the BMC sends this command, this appears in the host console: IPMI: unknown OEM SEL command ff received There is no response needed by the host (other then the low level acknowledge of the command which already occurs). This commit handles the command so the error is no longer printed (does nothing with the command though since no action is needed). Here's the tested output of this patch in the host console (with debug enabled): IPMI: BMC issued heartbeat command: 00 Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
2019-07-26SPDX-ify all skiboot codeStewart Smith10-124/+33
Use Software Package Data Exchange (SPDX) to indicate license for each file that is unique to skiboot. At the same time, ensure the (C) who and years are correct. See https://spdx.org/ Signed-off-by: Stewart Smith <stewart@linux.ibm.com> [oliver: Added a few missing files] Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
2019-05-09platforms/astbmc: Check for SBE validation stepSamuel Mendoza-Jonas1-3/+106
On some POWER8 astbmc systems an update to the SBE requires pausing at runtime to ensure integrity of the SBE. If this is required the BMC will set a chassis boot option IPMI flag using the OEM parameter 0x62. If Skiboot sees this flag is set it waits until the SBE update is complete and the flag is cleared. Unfortunately the mystery operation that validates the SBE also leaves it in a bad state and unable to be used for timer operations. To workaround this the flag is checked as soon as possible (ie. when IPMI and the console are set up), and once complete the system is rebooted. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com> Reviewed-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Reviewed-by: Andrew Jeffery <andrew@aj.id.au> Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
2019-03-28core/stack: Rename backtrace functions, get rid of wrappersAndrew Donnellan1-3/+2
Rename ___backtrace() to backtrace_create() and ___print_backtrace() to backtrace_print(). Get rid of __backtrace() and __print_backtrace() wrappers. Signed-off-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2019-03-28hw/fsp, hw/ipmi: Convert attn code to not use backtrace wrappersAndrew Donnellan1-4/+5
We're about to get rid of __backtrace() and __print_backtrace(), convert the FSP/IPMI attn code to not use them. Signed-off-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2019-03-20hw/ipmi/test/run-fru: Fix string truncation warning, enhance testStewart Smith2-8/+19
We've been getting this warning/error from recent GCC: In file included from hw/ipmi/test/run-fru.c:22: hw/ipmi/test/../ipmi-fru.c: In function ‘fru_add’: hw/ipmi/test/../ipmi-fru.c:162:3: warning: ‘strncpy’ output truncated copying 32 bytes from a string of length 38 [-Wstringop-truncation] strncpy(info.version, version, MAX_STR_LEN + 1); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This patch does two things: 1) Re-arrange some code to shut GCC up. 2) Add extra fu to tests to ensure we're producing correct bytes. Signed-off-by: Stewart Smith <stewart@linux.ibm.com> Tested-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2019-02-18ipmi/power: Fix system reboot issueVasant Hegde1-2/+24
Kernel makes reboot/shudown OPAL call for reboot/shutdown. Once kernel gets response from OPAL it runs opal_poll_events() until firmware handles the request. On BMC based system, OPAL makes IPMI call (IPMI_CHASSIS_CONTROL) to initiate system reboot/shutdown. At present OPAL queues IPMI messages and return SUCESS to Host. If BMC is not ready to accept command (like BMC reboot), then these message will fail. We have to manually reboot/shutdown the system using BMC interface. This patch adds logic to validate message return value. If message failed, then it will resend the message. At some stage BMC will be ready to accept message and handles IPMI message. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-10-11platform: Restructure bmc_platform typeAndrew Jeffery1-4/+4
Segregate the BMC platform configuration into hardware and software components. This allows population of platform default values for hardware configuration that may no-longer be accessible by the host. Signed-off-by: Andrew Jeffery <andrew@aj.id.au> [stewart: fixup pci-quirk unit test] Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-10-10ipmi: Introduce registration for SEL command handlersAndrew Jeffery1-29/+89
Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-06-27occ: Move occ declarations into occ.hAndrew Donnellan1-0/+1
OCC declarations are currently split between skiboot.h and occ-sensor.h. Given the growing unwieldyness of skiboot.h it's probably time to move it all into one header. Rename occ-sensor.h to occ.h, move all OCC-related declarations out of skiboot.h, and add #includes as necessary. Signed-off-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com> Reviewed-by: Shilpasri G Bhat <shilpa.bhat@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-06-18Split debug_descriptor out into own include fileStewart Smith1-0/+1
We only touch it in limited places, let's simplify skiboot.h Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-06-18ipmi-sel: use opal_booting() over poking at debug descriptorStewart Smith1-4/+2
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-06-04ipmi-watchdog: Support handling re-initializationWilliam A. Kennington III1-5/+42
Watchdog resets can return an error code from the BMC indicating that the BMC watchdog was not initialized. Currently we abort skiboot due to a missing error handler. This patch implements handling re-initialization for the watchdog, automatically saving the last watchdog set values and re-issuing them if needed. Signed-off-by: William A. Kennington III <wak@google.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-06-04ipmi-watchdog: Support resetting the watchdog after setWilliam A. Kennington III1-7/+27
This does not create any behavioral change yet, but this will be useful in a future commit that adds support for re-initializing the watchdog. Signed-off-by: William A. Kennington III <wak@google.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-06-04ipmi-watchdog: Simplify our completion functionWilliam A. Kennington III1-12/+15
This makes no functional changes, just refactors the completion function to be used for reset only, since it does nothing but free the message for set calls. This will be useful for future changes to reduce nesting depth. Signed-off-by: William A. Kennington III <wak@google.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-06-04ipmi-watchdog: The stop action should disable resetWilliam A. Kennington III1-0/+9
Otherwise it is possible for the reset timer to elapse and trigger the watchdog to wake back up. This doesn't affect the behavior of the system since we are providing a NONE action to the BMC. However we would like to avoid the action from taking place if possible. Signed-off-by: William A. Kennington III <wak@google.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-06-04ipmi-watchdog: don't run by default yetStewart Smith1-3/+11
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-06-01ipmi-watchdog: Add a flag to determine if we are still tickingWilliam A. Kennington III1-3/+12
This makes it easier for future changes to ensure that the watchdog stops ticking and doesn't requeue itself for execution in the background. This way it is safe for resets to be performed after the ticks are assumed to be stopped and it won't start the timer again. Signed-off-by: William A. Kennington III <wak@google.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-06-01ipmi-watchdog: Don't disable at shutdownWilliam A. Kennington III1-6/+1
The op-build linux kernel has been configured to support the ipmi watchdog. This driver will always handle the watchdog by either leaving it enabled if configured, or by disabling it during module load if no configuration is provided. This increases the coverage of the watchdog during the boot process. The watchdog should no longer be disabled at any point during skiboot execution. Signed-off-by: William A. Kennington III <wak@google.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-06-01ipmi-watchdog: Don't reset the watchdog twiceWilliam A. Kennington III1-4/+0
There is no clarification for why this change was needed, but presumably this is due to a buggy BMC implementation where the Watchdog Set command was processed concurrently or after the initial Watchdog Reset. This inversion would cause the watchdog to stop since the DONT_STOP bit was not set. Since we are now using the DONT_STOP bit during initialization, the watchdog should not be stopped even if an inversion occurs. Signed-off-by: William A. Kennington III <wak@google.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-06-01ipmi-watchdog: Make it possible to set DONT_STOPWilliam A. Kennington III1-6/+8
The IPMI standard supports setting a DONT_STOP bit during an Watchdog Set operation. Most of the time we don't want to stop the Watchdog when updating the settings so we should be using this bit. This patch makes it possible for callers of set_wdt to prevent the watchdog from being stopped. This only changes the behavior of the watchdog during the initial settings update when initializing skiboot. The watchdog is no longer disabled and then immediately re-enabled. Signed-off-by: William A. Kennington III <wak@google.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-06-01ipmi-watchdog: WD_POWER_CYCLE_ACTION -> WD_RESET_ACTIONWilliam A. Kennington III1-3/+3
The IPMI specification denotes that action 0x1 is Host Reset and 0x3 is Host Power Cycle. Use the correct name for Reset in our watchdog code. Signed-off-by: William A. Kennington III <wak@google.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-05-09ipmi: Add BMC firmware version to device treeVasant Hegde2-1/+113
BMC Get device ID command gives BMC firmware version details. Lets add this to device tree. User space tools will use this information to display BMC version details. Stewart, I have added bmc information under /ibm,firmware-version node as its firmware version. But may be we should add new node (/bmc/firmware). So that we can keep BMC related information separately. Let me know your thoughts on this. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-02-28build: use thin archives rather than incremental linkingNicholas Piggin1-1/+1
This changes to build system to use thin archives rather than incremental linking for built-in.o, similar to recent change to Linux. built-in.o is renamed to built-in.a, and is created as a thin archive with no index, for speed and size. All built-in.a are aggregated into a skiboot.tmp.a which is a thin archive built with an index, making it suitable or linking. This is input into the final link. The advantags of build size and linker code placement flexibility are not as great with skiboot as a bigger project like Linux, but it's a conceptually better way to build, and is more compatible with link time optimisation in toolchains which might be interesting for skiboot particularly for size reductions. Size of build tree before this patch is 34.4MB, afterwards 23.1MB. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-12-14IPMI: Fix platform.cec_reboot() null ptr checksMichael Neuling1-2/+2
Kudos to Hugo Landau who reported this in: https://github.com/open-power/skiboot/issues/142 Reported-by: Hugo Landau <hlandau@devever.net> Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-12-03core/lock: Introduce atomic cmpxchg and implement try_lock with itNicholas Piggin1-0/+2
cmpxchg will be used in a subsequent change, and this reduces the amount of asm code. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> [stewart: fix some ifdef __TEST__ foo to ensure unittests work] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-08-11OCC: Map OCC sensor to a chip-idVasant Hegde1-2/+26
Parse device tree to get chip-id for OCC sensor. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-07-13IPMI: Move MAX_IPMI_SENSORS macro to ipmi.hVasant Hegde1-1/+0
..so that it can be used in other places as well. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-06-19ipmi-sel: Fix missing typo, line length and correct eSEL stylisationAndrew Jeffery1-1/+1
It might seem impossible to some that missing typos can be fixed without being first added, but here we are. Further, reduce the line length to sensible limits to ensure Joel provides a Reviewed-by, and fix eSEL stylisation to hopefully extract similar tags from the rest of the peanut gallery. Suggested-by: Joel Stanley <joel@jms.id.au> Suggested-by: Russell Currey <ruscur@russell.cc> Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-06-15hw/ipmi/ipmi-sel: missing newline in prlog warningStewart Smith1-1/+1
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-01-05treewide: squash sparse static warningsAndrew Donnellan1-1/+1
Add static to various declarations that can use it, as found by sparse. It turns out that one of these (fsp_pcie_inv_lock in platform/ibm-fsp/firenze.c) is actually unused, so remove it. Signed-off-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-11-08bmc_platform: fail PNOR access request if no bmc *before* we reserve itStewart Smith1-4/+3
Fixes: 5611389876a748e19b7593d4eb426ced7a6ed31f Reported-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-11-08Add BMC platform to enable correct OEM IPMI commandsStewart Smith1-2/+19
An out of tree platform (p8dtu) uses a different IPMI OEM command for IPMI_PARTIAL_ADD_ESEL. This exposed some assumptions about the BMC implementation in our core code. Now, with platform.bmc, each platform can dictate (or detect) the BMC that is present. We allow it to be set at runtime rather than purely statically in struct platform as it's possible to have differing BMC implementations on the one machine (e.g. AMI BMC or OpenBMC). Acked-by: Jeremy Kerr <jk@ozlabs.org> [stewart@linux.vnet.ibm.com: remove enum, update (C) years] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-11-08hw/ipmi-sensor: Fix setting of firmware progress sensor properly.Pridhiviraj Paidipeddi1-2/+42
Currently Hostboot populates /bmc/sensors dt node and corresponding sensors only for BMC platforms, And for FSP platforms hostboot is not populating any fsp sensors(Management sensors) and also there is no firmware progress sensor exist in fsp platforms. Due to which OPAL incorrectly setting firmware status on a sensor id "00" which is not at all exist. On a FSP system: cat /sys/firmware/opal/msglog | grep -i setting [ 21.189204883,6] IPMI: setting fw progress sensor 00 to 07 [ 21.189559121,6] IPMI: setting fw progress sensor 00 to 13 cat /sys/firmware/opal/msglog | grep -i skiboot [ 84.127416495,5] SkiBoot skiboot-5.4.0-rc3 starting... On a BMC system: cat /sys/firmware/opal/msglog | grep -i setting [ 3.166286901,6] IPMI: setting fw progress sensor 05 to 14 [ 14.259153338,6] IPMI: setting fw progress sensor 05 to 07 [ 14.469070593,5] IPMI: Resetting boot count on successful boot [ 15.001210324,6] IPMI: setting fw progress sensor 05 to 13 So this patch fixes this incorrect setting on a fsp system, and also sets the sensor only if OPAL initialises ipmi sensors and corresponding sensor exists for a given sensor type in the device tree. After patch: On a FSP system: cat /sys/firmware/opal/msglog | grep -i setting On a BMC system: cat /sys/firmware/opal/msglog | grep -i setting [ 3.164859816,6] IPMI: setting fw progress sensor 05 to 14 [ 14.024941077,6] IPMI: setting fw progress sensor 05 to 07 [ 14.211514767,5] IPMI: Resetting boot count on successful boot [ 14.252554375,6] IPMI: setting fw progress sensor 05 to 13 Signed-off-by: Pridhiviraj Paidipeddi <ppaidipe@linux.vnet.ibm.com> [stewart@linux.vnet.ibm.com: return OPAL_UNSUPPORTED on !sensors_present, make ipmi_sensor_type_present() static in ipmi-sensor.c] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-10-25errorlog : Modification as per coding guidelines to make the code more legibleMukesh Ojha1-36/+41
Some modifications related to typo errors, alignment, case letter mismatch to add more clarity to the code. Signed-off-by: Mukesh Ojha <mukesh02@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-09-02consolidate gcov flags into HOSTGCOVFLAGS for host binariesStewart Smith1-1/+1
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>