blob: ab419a77090c08daacceb2313bad32195083a831 [file] [log] [blame]
Julius Werner98eeb962019-12-11 15:47:42 -08001/* SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0-or-later */
2
3#ifndef _COMMONLIB_BSD_CB_ERR_H_
4#define _COMMONLIB_BSD_CB_ERR_H_
5
6#include <stdint.h>
7
8/**
9 * coreboot error codes
10 *
11 * Common error definitions that can be used for any function. All error values
12 * should be negative -- when useful, positive values can also be used to denote
13 * success. Allocate a new group or errors every 100 values.
14 */
15enum cb_err {
16 CB_SUCCESS = 0, /**< Call completed successfully */
17 CB_ERR = -1, /**< Generic error code */
18 CB_ERR_ARG = -2, /**< Invalid argument */
19
20 /* NVRAM/CMOS errors */
21 CB_CMOS_OTABLE_DISABLED = -100, /**< Option table disabled */
22 CB_CMOS_LAYOUT_NOT_FOUND = -101, /**< Layout file not found */
23 CB_CMOS_OPTION_NOT_FOUND = -102, /**< Option string not found */
24 CB_CMOS_ACCESS_ERROR = -103, /**< CMOS access error */
25 CB_CMOS_CHECKSUM_INVALID = -104, /**< CMOS checksum is invalid */
26
27 /* Keyboard test failures */
28 CB_KBD_CONTROLLER_FAILURE = -200,
29 CB_KBD_INTERFACE_FAILURE = -201,
30
31 /* I2C controller failures */
32 CB_I2C_NO_DEVICE = -300, /**< Device is not responding */
33 CB_I2C_BUSY = -301, /**< Device tells it's busy */
34 CB_I2C_PROTOCOL_ERROR = -302, /**< Data lost or spurious slave
35 device response, try again? */
36 CB_I2C_TIMEOUT = -303, /**< Transmission timed out */
37};
38
39/* Don't typedef the enum directly, so the size is unambiguous for serialization. */
40typedef int32_t cb_err_t;
41
42#endif /* _COMMONLIB_BSD_CB_ERR_H_ */