Ben Tyner | bcf65a8 | 2020-12-01 08:46:36 -0600 | [diff] [blame] | 1 | #pragma once |
| 2 | |
Ben Tyner | 21cc627 | 2022-10-05 18:26:36 -0500 | [diff] [blame] | 3 | #include <util/ffdc.hpp> |
| 4 | |
Ben Tyner | bcf65a8 | 2020-12-01 08:46:36 -0600 | [diff] [blame] | 5 | namespace attn |
| 6 | { |
| 7 | |
Ben Tyner | 07ebb9b | 2021-12-01 12:16:24 -0600 | [diff] [blame] | 8 | // number of seconds to wait for power fault handling |
| 9 | constexpr int POWER_FAULT_WAIT = 10; |
| 10 | |
Ben Tyner | b833556 | 2021-07-16 12:43:52 -0500 | [diff] [blame] | 11 | /** @brief Attention handler return codes */ |
| 12 | enum ReturnCodes |
| 13 | { |
| 14 | RC_SUCCESS = 0, |
| 15 | RC_NOT_HANDLED = 1, |
| 16 | RC_ANALYZER_ERROR = 2, |
| 17 | RC_CFAM_ERROR = 3, |
| 18 | RC_DBUS_ERROR = 4 |
| 19 | }; |
| 20 | |
| 21 | /** @brief Code seciton for error reporing */ |
| 22 | enum class AttnSection |
| 23 | { |
| 24 | reserved = 0x0000, |
| 25 | attnHandler = 0x0100, |
| 26 | tiHandler = 0x0200, |
| 27 | handlePhypTi = 0x0300, |
| 28 | handleHbTi = 0x0400, |
austinfcui | c49d20b | 2022-02-22 16:36:47 -0600 | [diff] [blame] | 29 | addHbStatusRegs = 0x0500, |
| 30 | attnLogging = 0x0600 |
Ben Tyner | b833556 | 2021-07-16 12:43:52 -0500 | [diff] [blame] | 31 | }; |
| 32 | |
| 33 | /** @brief Attention handler error reason codes */ |
| 34 | enum AttnCodes |
| 35 | { |
austinfcui | c49d20b | 2022-02-22 16:36:47 -0600 | [diff] [blame] | 36 | ATTN_NO_ERROR = 0, |
| 37 | ATTN_INFO_NULL = 1, |
| 38 | ATTN_PDBG_CFAM = 2, |
| 39 | ATTN_PDBG_SCOM = 3, |
| 40 | ATTN_INVALID_KEY = 4 |
Ben Tyner | b833556 | 2021-07-16 12:43:52 -0500 | [diff] [blame] | 41 | }; |
| 42 | |
Ben Tyner | b833556 | 2021-07-16 12:43:52 -0500 | [diff] [blame] | 43 | /** |
| 44 | * @brief Traces some regs for hostboot |
| 45 | * |
| 46 | * When we receive a Checkstop or special Attention Term Immediate, |
| 47 | * hostboot wants some regs added to the error log. We will do this |
| 48 | * by tracing them and then the traces will get added to the error |
| 49 | * log later. |
| 50 | * |
| 51 | * @return nothing |
| 52 | */ |
| 53 | void addHbStatusRegs(); |
| 54 | |
Ben Tyner | 21cc627 | 2022-10-05 18:26:36 -0500 | [diff] [blame] | 55 | /** @brief Capture some scratch registers for PRD |
| 56 | * |
| 57 | * Capture some scratch register data that PRD can use to handle |
| 58 | * cases where analysis may have been interrupted. The data will |
| 59 | * be traced and also written to the user data section of a PEL. |
| 60 | * |
| 61 | * @param[out] o_files vector of FFDC files |
| 62 | * |
| 63 | * @return nothing |
| 64 | */ |
| 65 | void addPrdScratchRegs(std::vector<util::FFDCFile>& o_files); |
| 66 | |
Ben Tyner | 135793a | 2021-10-27 09:18:41 -0500 | [diff] [blame] | 67 | /** |
| 68 | * @brief Check for recoverable errors present |
| 69 | * |
| 70 | * @return true if any recoverable errors are present, else false |
| 71 | */ |
| 72 | bool recoverableErrors(); |
| 73 | |
Ben Tyner | 07ebb9b | 2021-12-01 12:16:24 -0600 | [diff] [blame] | 74 | /** |
| 75 | * @brief sleep for n-seconds |
| 76 | * |
| 77 | * @param[in] seconds number of seconds to sleep |
| 78 | */ |
| 79 | void sleepSeconds(const unsigned int seconds); |
| 80 | |
Ben Tyner | bcf65a8 | 2020-12-01 08:46:36 -0600 | [diff] [blame] | 81 | } // namespace attn |