blob: cefa126e8e352f60155c16e646f04783d83f7602 [file] [log] [blame]
Ben Tynerbcf65a82020-12-01 08:46:36 -06001#pragma once
2
3namespace attn
4{
5
Ben Tyner07ebb9b2021-12-01 12:16:24 -06006// number of seconds to wait for power fault handling
7constexpr int POWER_FAULT_WAIT = 10;
8
Ben Tynerb8335562021-07-16 12:43:52 -05009/** @brief Attention handler return codes */
10enum ReturnCodes
11{
12 RC_SUCCESS = 0,
13 RC_NOT_HANDLED = 1,
14 RC_ANALYZER_ERROR = 2,
15 RC_CFAM_ERROR = 3,
16 RC_DBUS_ERROR = 4
17};
18
19/** @brief Code seciton for error reporing */
20enum class AttnSection
21{
22 reserved = 0x0000,
23 attnHandler = 0x0100,
24 tiHandler = 0x0200,
25 handlePhypTi = 0x0300,
26 handleHbTi = 0x0400,
austinfcuic49d20b2022-02-22 16:36:47 -060027 addHbStatusRegs = 0x0500,
28 attnLogging = 0x0600
Ben Tynerb8335562021-07-16 12:43:52 -050029};
30
31/** @brief Attention handler error reason codes */
32enum AttnCodes
33{
austinfcuic49d20b2022-02-22 16:36:47 -060034 ATTN_NO_ERROR = 0,
35 ATTN_INFO_NULL = 1,
36 ATTN_PDBG_CFAM = 2,
37 ATTN_PDBG_SCOM = 3,
38 ATTN_INVALID_KEY = 4
Ben Tynerb8335562021-07-16 12:43:52 -050039};
40
Ben Tynerb8335562021-07-16 12:43:52 -050041/**
42 * @brief Traces some regs for hostboot
43 *
44 * When we receive a Checkstop or special Attention Term Immediate,
45 * hostboot wants some regs added to the error log. We will do this
46 * by tracing them and then the traces will get added to the error
47 * log later.
48 *
49 * @return nothing
50 */
51void addHbStatusRegs();
52
Ben Tyner135793a2021-10-27 09:18:41 -050053/**
54 * @brief Check for recoverable errors present
55 *
56 * @return true if any recoverable errors are present, else false
57 */
58bool recoverableErrors();
59
Ben Tyner07ebb9b2021-12-01 12:16:24 -060060/**
61 * @brief sleep for n-seconds
62 *
63 * @param[in] seconds number of seconds to sleep
64 */
65void sleepSeconds(const unsigned int seconds);
66
Ben Tynerbcf65a82020-12-01 08:46:36 -060067} // namespace attn