blob: ad93a0a3502932f7efb59b4f9f1bdbfbceca1cb0 [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,
27 addHbStatusRegs = 0x0500
28};
29
30/** @brief Attention handler error reason codes */
31enum AttnCodes
32{
33 ATTN_NO_ERROR = 0,
34 ATTN_INFO_NULL = 1,
35 ATTN_PDBG_CFAM = 2,
36 ATTN_PDBG_SCOM = 3
37};
38
Ben Tynerb8335562021-07-16 12:43:52 -050039/**
40 * @brief Traces some regs for hostboot
41 *
42 * When we receive a Checkstop or special Attention Term Immediate,
43 * hostboot wants some regs added to the error log. We will do this
44 * by tracing them and then the traces will get added to the error
45 * log later.
46 *
47 * @return nothing
48 */
49void addHbStatusRegs();
50
Ben Tyner135793a2021-10-27 09:18:41 -050051/**
52 * @brief Check for recoverable errors present
53 *
54 * @return true if any recoverable errors are present, else false
55 */
56bool recoverableErrors();
57
Ben Tyner07ebb9b2021-12-01 12:16:24 -060058/**
59 * @brief sleep for n-seconds
60 *
61 * @param[in] seconds number of seconds to sleep
62 */
63void sleepSeconds(const unsigned int seconds);
64
Ben Tynerbcf65a82020-12-01 08:46:36 -060065} // namespace attn