aboutsummaryrefslogtreecommitdiff
path: root/hw/fsp
AgeCommit message (Collapse)AuthorFilesLines
2014-10-30fsp: Allow loading initramfs resourcesJeremy Kerr1-0/+4
We have the new 80f00102.lid name for this. 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 Kerr1-0/+48
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-22fsp/elog: Create a logging frontendAlistair Popple1-194/+7
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 Popple1-229/+10
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-15led: Fix white space problemsAnshuman Khandual2-24/+24
This patch removes white space problems from the LED code and it's header file. Signed-off-by: Anshuman Khandual <khandual@linux.vnet.ibm.com> Acked-by: Stewart Smith <stewart@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-15attn: Remove generate_hex_word macroAruna Balakrishnaiah1-7/+2
Remove generate_hex_word macro and do the masking inline. This is just a code cleanup. Signed-off-by: Aruna Balakrishnaiah <aruna@linux.vnet.ibm.com> Acked-by: Stewart Smith <stewart@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-1/+2
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-15led: Handle all the FSP_MCLASS_INDICATOR class sub commandsAnshuman Khandual1-0/+63
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-15Be less verbose in logging about FSP ConsoleStewart Smith1-21/+22
For the most part, PR_DEBUG. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-10-15Perhaps we shouldn't prerror() about the presence of an FSP. perhaps.Stewart Smith1-1/+2
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-10-15Make FSP console a bit quieter, most can be PR_DEBUGStewart Smith1-23/+23
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-10-15Make FSP a lot less verbose by setting log priorityStewart Smith1-54/+63
Some things are errors, informative or just debug/trace. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-10-15Adjust log message priority in fsp-leds.cStewart Smith1-22/+24
Mostly PR_DEBUG or PR_TRACE, but a few error conditions should be PR_ERR. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-10-15FSP buffer allocation messages can be PR_DEBUG.Stewart Smith1-4/+4
Very unlikely to ever actually fail. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-10-10CUPD: Log LID ID in elog if size crosses the limitVasant Hegde1-3/+4
..so that it makes easy to find the culprit LID easily. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-10-08Remove (unused) DBG macros from hw/fsp/fsp-nvram.cStewart Smith1-3/+0
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-10-08Use prlog instead of DBG macros in hw/fsp/fsp-rtc.cStewart Smith1-16/+16
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-10-08Use prlog rather than DBG #ifdef in hw/fsp/fsp-leds.cStewart Smith1-14/+11
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-10-08use prlog(PR_INSANE in hw/fsp/fsp.c in place of DBG ifdefStewart Smith1-8/+6
This means that when log level of PR_INSANE is enabled, you will get traces of messages to/from FSP. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-10-08Change DBG to prlog PR_TRACE and PR_INSANE in hw/fsp/fsp-sensor.cStewart Smith1-13/+16
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-09-30dpo: Return OPAL_WRONG_STATE when not in DPO pending stateAnshuman Khandual1-7/+7
This patch changes fsp_opal_get_dpo_status function to return OPAL_WRONG_STATE when not in DPO pending state. This will help the host to differentiate whether the system is in DPO pending state or not and then analyse the returned timeout value correctly. Signed-off-by: Anshuman Khandual <khandual@linux.vnet.ibm.com> Reviewed-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-09-30dpo: Return error status to FSP when OPAL message queueing failsAnshuman Khandual1-0/+2
Right now if the OPAL message queuing fails, the FSP never gets the ack back for the original DPO initiation message it had sent previously. With this patch, if the OPAL message queuing fails to send the DPO message to the host, it still acks the FSP about the original message but with error flags. Signed-off-by: Anshuman Khandual <khandual@linux.vnet.ibm.com> Acked-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-09-30dpo: Fix missing return statementAnshuman Khandual1-0/+1
This patch adds a positive return statement after handling DPO message from FSP. Currently it was returning a negetive value for all the possible cases. Signed-off-by: Anshuman Khandual <khandual@linux.vnet.ibm.com> Acked-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-09-30dpo: Minor code cleanupAnshuman Khandual1-5/+9
This patch cleans up multiple printf statements and also introduces couple of defines to reflect the byte position signatures present on the FSP DPO initiation command. Signed-off-by: Anshuman Khandual <khandual@linux.vnet.ibm.com> Reviewed-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-08-18console/sysparam: Use the system param to switch console selectionBenjamin Herrenschmidt2-25/+49
The patch provides the in-band support for reading the 'console-select' system parameter. It also adds the console support to honour the system param for switching the console type in P8 systems. Tested-by: Neelesh Gupta <neelegup@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Jeremy Kerr <jeremy.kerr@au.ibm.com>
2014-08-15fsp/rtc: Use libc time functionsAlistair Popple1-147/+9
Our libc now has a proper implementation of mktime, which makes adding tm structures together easy. This patch makes the FSP RTC functions use the library functions and removes the generic time calculation code from the FSP RTC driver. The OPAL<->tm conversion functions are also made public as they will be useful for the IPMI RTC implementation. Signed-off-by: Alistair Popple <alistair@popple.id.au> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-08-15SURV: Trigger HIR on surv sysparam query errorAnanth N Mavinakayanahalli1-1/+2
For the case where the survserver on the fsp server is dead (for whatever reason [1]), even before the first time query via sysparam of the surv status by sapphire, we get an error response to the sysparam query. We should apparently trigger a HIR in that case (same as phyp). [1] survserver has a real bug on a 'fsptelinit --disablerecovery' followed by a 'kill -9 <survserver_pid>' Fixes https://bugzilla.linux.ibm.com/show_bug.cgi?id=114646. Signed-off-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com> Signed-off-by: Jeremy Kerr <jeremy.kerr@au.ibm.com>
2014-08-14fsp/fsp-rtc: Fix typo in 400-year calculation in tm_addJeremy Kerr1-1/+1
This chagne fixes a bug found by Alistair Popple: we have a stray '9' in the count of non-leap-years in 400 years. This will cause an incorrect result from tm_add if the TOD cache is >400 years old. Signed-off-by: Jeremy Kerr <jeremy.kerr@au.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-08-14fsp/surv: Remove tb print on surv errorAnanth N Mavinakayanahalli1-2/+1
Now that the log automatically timestamps entries, remove the tb print in the error paths. Signed-off-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-08-13dpo: Add OPAL interface to access the DPO timeoutAnshuman Khandual1-0/+25
This patch adds a OPAL interface to fetch the DPO timeout. This functionality is required to synchronously query Sapphire about how much seconds are remaining for a forced system shutdown which is useful in cases where the host has missed the OPAL_MSG_DPO for some reason like system boot, reboot or kexec operations. This ensures host can still query about the DPO timeout status and act. This patch also adds helper routine to convert time base into seconds. Signed-off-by: Anshuman Khandual <khandual@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-08-13dpo: Move the FSP async messagae handling into a separate fileAnshuman Khandual3-48/+95
This patch moves the DPO message handling from FSP core code into a separate file to make it more cleaner and to add OPAL interfaces in the subsequent patch. It does not change anything functionally. Signed-off-by: Anshuman Khandual <khandual@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-08-13epow: Change log message prefixAnshuman Khandual1-2/+2
This patch changes the log message prefix from EPOW to FSPEPOW as this standard is followed every where in FSP specific code base. This also changes a bit in the file header. Signed-off-by: Anshuman Khandual <khandual@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-08-13attn: Add git version and backtrace details to user dataAruna Balakrishnaiah1-2/+6
For better debugability, the patch adds git version and backtrace details to user data section (along with file info which was already present). After adding required details TermImmedData looks like: TermImmedData | | 00000000 63386631 6639322D 64697274 793A0000 c8f1f92-dirty:.. | | 00000010 00000000 00000000 00000000 00000000 ................ | | 00000020 00000000 00000000 43505520 30303030 ........CPU 0000 | | 00000030 30303264 20426163 6B747261 63653A0A 002d Backtrace:. | | 00000040 20533A20 30303030 30303030 33316162 S: 0000000031ab | | 00000050 36626130 20523A20 30303030 30303030 6ba0 R: 00000000 | | 00000060 33303031 33306238 0A20533A 20303030 300130b8. S: 000 | | 00000070 30303030 30333161 62366334 3020523A 0000031ab6c40 R: | | 00000080 20303030 30303030 30333030 34623738 000000003004b78 | | 00000090 380A2053 3A203030 30303030 30303331 8. S: 0000000031 | | 000000A0 61623663 63302052 3A203030 30303030 ab6cc0 R: 000000 | | 000000B0 30303330 30313736 31300A20 533A2030 0030017610. S: 0 | | 000000C0 30303030 30303033 31616236 64343020 000000031ab6d40 | | 000000D0 523A2030 30303030 30303033 30303035 R: 0000000030005 | | 000000E0 3133340A 20533A20 30303030 30303030 134. S: 00000000 | | 000000F0 33316162 36663030 20523A20 30303030 31ab6f00 R: 0000 | | 00000100 30303030 33303030 32353534 0A000000 000030002554.... | | 00000110 00000000 00000000 00000000 00000000 ................ | | 00000120 00000000 00000000 00000000 00000000 ................ | | 00000130 00000000 00000000 00000000 00000000 ................ | | 00000140 00000000 00000000 00000000 00000000 ................ | | 00000150 00000000 00000000 00000000 00000000 ................ | | 00000160 00000000 00000000 00000000 00000000 ................ | | 00000170 00000000 00000000 00000000 00000000 ................ | | 00000180 00000000 00000000 00000000 00000000 ................ | | 00000190 00000000 00000000 00000000 00000000 ................ | | 000001A0 00000000 00000000 00000000 00000000 ................ | | 000001B0 00000000 00000000 00000000 00000000 ................ | | 000001C0 00000000 00000000 00000000 636F7265 ............core | | 000001D0 2F6F7061 6C2E633A 3233383A 30000000 /opal.c:238:0... | |------------------------------------------------------------------------------| Signed-off-by: Aruna Balakrishnaiah <aruna@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-08-13attn: Add default attn src in the src sectionAruna Balakrishnaiah1-6/+6
Generating src dynamically results in: 1. Difficulty in documenting and for field people to understand. 2. It might also conflict with existing srcs. Hence add default SRC in SRC section. Assert function call address in hex word 2. errl -d <elog-entry-id>: .. | Reference Code : BB821410 | | Hex Words 2 - 5 : 30017610 00000000 00000000 00000000 | .. Signed-off-by: Aruna Balakrishnaiah <aruna@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-08-13fsp/rtc: Change properties used to advertize TPOBenjamin Herrenschmidt1-2/+1
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-08-13fsp/tpo: Enable Timed power on (TPO) supportMamatha Inamdar1-3/+142
This patch enabled TPO sequence handling in Sapphire. Timed power on notification comes from the user through set_poweron_time tool. After receiving a valid TPO from user, Sapphire sends a request to FSP through maibox command to set TPO. FSP will set TPO and power on the system as per the TPO set by the user. [ Removed global read_data, removed writing to NULL pointers, fixed a couple of memory leaks ... --BenH ] Signed-off-by: Mamatha Inamdar <mamatha4@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-08-13elog: Do not compare elog size in read pathVasant Hegde1-4/+9
Linux can request for lesser bytes than actual elog size. Also make sure Linux is not requesting more than elog size. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-08-08surv: Cleanup log outputBenjamin Herrenschmidt1-4/+6
Don't add timestamps, the core printf does it now Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-08-08lock: Fix races when setting in_con_lockBenjamin Herrenschmidt2-0/+11
When setting the flag in a lock that indicates that it's on the console path, we need to take and release that lock to ensure that any other processor that might have taken it before the flag was set has released it, otherwise the lock might still be held without the console count properly incremented, which can cause it to go negative or cause the deadlock that we mean to avoid by that to still occur. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-08-08FSP: Make mbx error messages more verboseAnanth N Mavinakayanahalli1-5/+6
... helps figure out what the cause of the failure was. Signed-off-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com> Acked-by: Stewart Smith <stewart@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-08-08Write log messages with log_level > PR_NOTICE only to in memory logStewart Smith1-1/+1
We modify write() (adding console_write()) which calls down to a modified __flush_console() which can now decide if it's flushing the added console contents to the console drivers or not. A future patch may add support for changing PR_NOTICE to some other level Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-08-08Use single printf call per FSP LED rather than multipleStewart Smith1-10/+22
Means that we print things correctly in console log with timestamps. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-08-08ELOG: Make sure we do not cross read buffer sizeVasant Hegde1-0/+7
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-08-01ATTN: Set up attention area to handle attentionAruna Balakrishnaiah2-0/+110
At present CPU control area ntuple in SPIRA structure is NULL. ATTN component in Service Processor side checks for this field and if its empty, it logs hardcoded SRC (0xBB821410) and generates SYSDUMP. So we have 1 SRC for all failure (assert call) from OPAL side. This makes difficult to debug the issue. Service processor provides attention area interface (FIPS PHyp Attentions spec), so that we can pass SRC and user data (error message) to service processor. This will helps us identify different failures in OPAL. This patch enables attention area and provides interface (update_sp_attn_area()) to add src and user data (error message) through assert macro. Attention SRC format: 1st byte - Opal src type 2-4 bytes - Holds the address of the assert function call Signed-off-by: Aruna Balakrishnaiah <aruna@linux.vnet.ibm.com> Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-08-01epow: Change how the old and the new system epow status are maintainedAnshuman Khandual1-2/+7
This patch changes the way how the old and the new system epow status are maintained. After receiving FSP EPOW async message, only reset those parts of system EPOW status which will be updated with the new FSP async message. This patch also fixes a problem with comparing the contents of the new and the old system EPOW status. Signed-off-by: Anshuman Khandual <khandual@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-08-01epow: Fix mbox command encoding to remove FSP orphan responsesAnshuman Khandual1-0/+10
This patch changes the EPOW related mbox commands encoding to make sure FSP message response structure is allocated. So that when the command returns from FSP, it can be handled appropriately and orphan response will not be logged. This also adds some more in-code documentation explaining why panel status request based handshaking is required with the FSP. Signed-off-by: Anshuman Khandual <khandual@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-08-01epow: Change the logging of the FSP async messagesAnshuman Khandual1-9/+29
Right now, all the FSP initiated EPOW messages get logged. SPCN configuration change message comes as part of the extended 1 panel status type of FSP message all the time and fills up the log buffer like the following. ------------Sapphire log--------------- EPOW: Received extended 1 EPOW from FSP EPOW: Received extended 1 EPOW from FSP EPOW: Received extended 1 EPOW from FSP EPOW: Received extended 1 EPOW from FSP EPOW: Received extended 1 EPOW from FSP EPOW: Received extended 1 EPOW from FSP EPOW: Received extended 1 EPOW from FSP EPOW: Received extended 1 EPOW from FSP EPOW: Received extended 1 EPOW from FSP EPOW: Received extended 1 EPOW from FSP EPOW: Received extended 1 EPOW from FSP EPOW: Received extended 1 EPOW from FSP EPOW: Received extended 1 EPOW from FSP EPOW: Received extended 1 EPOW from FSP EPOW: Received extended 1 EPOW from FSP EPOW: Received extended 1 EPOW from FSP --------------------------------------- Even without being acted upon, SPCN configuration change does not take down the system. With this patch only the messages, which need to be acted upon will get logged. Signed-off-by: Anshuman Khandual <khandual@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-07-31MDST: Improve error loggingVasant Hegde1-11/+24
Add informational event in add dump region path. Also change the severity of the existing elog event. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-07-31MDST: Add OPAL interface to unregister dump regionVasant Hegde1-0/+32
Add OPAL interface to remove host memory region from SYSDUMP. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-07-31MDST: Add OPAL interface to register host memory regionVasant Hegde1-0/+38
Add OPAL interface to add host memory region to SYSDUMP. [ Added exported IDs in opal.h --BenH ] Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>