xref: /aosp_15_r20/external/coreboot/src/vendorcode/cavium/include/bdk/libbdk-boot/bdk-boot-status.h (revision b9411a12aaaa7e1e6a6fb7c5e057f44ee179a49c)
1 #ifndef __CB_BDK_BOOT_STATUS_H__
2 #define __CB_BDK_BOOT_STATUS_H__
3 /***********************license start***********************************
4 * Copyright (c) 2003-2017  Cavium Inc. ([email protected]). All rights
5 * reserved.
6 *
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions are
10 * met:
11 *
12 *   * Redistributions of source code must retain the above copyright
13 *     notice, this list of conditions and the following disclaimer.
14 *
15 *   * Redistributions in binary form must reproduce the above
16 *     copyright notice, this list of conditions and the following
17 *     disclaimer in the documentation and/or other materials provided
18 *     with the distribution.
19 *
20 *   * Neither the name of Cavium Inc. nor the names of
21 *     its contributors may be used to endorse or promote products
22 *     derived from this software without specific prior written
23 *     permission.
24 *
25 * This Software, including technical data, may be subject to U.S. export
26 * control laws, including the U.S. Export Administration Act and its
27 * associated regulations, and may be subject to export or import
28 * regulations in other countries.
29 *
30 * TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED "AS IS"
31 * AND WITH ALL FAULTS AND CAVIUM INC. MAKES NO PROMISES, REPRESENTATIONS OR
32 * WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, WITH RESPECT
33 * TO THE SOFTWARE, INCLUDING ITS CONDITION, ITS CONFORMITY TO ANY
34 * REPRESENTATION OR DESCRIPTION, OR THE EXISTENCE OF ANY LATENT OR PATENT
35 * DEFECTS, AND CAVIUM SPECIFICALLY DISCLAIMS ALL IMPLIED (IF ANY) WARRANTIES
36 * OF TITLE, MERCHANTABILITY, NONINFRINGEMENT, FITNESS FOR A PARTICULAR
37 * PURPOSE, LACK OF VIRUSES, ACCURACY OR COMPLETENESS, QUIET ENJOYMENT,
38 * QUIET POSSESSION OR CORRESPONDENCE TO DESCRIPTION. THE ENTIRE  RISK
39 * ARISING OUT OF USE OR PERFORMANCE OF THE SOFTWARE LIES WITH YOU.
40 ***********************license end**************************************/
41 
42 /**
43  * @file
44  *
45  * Interface to report boot status
46  *
47  * @addtogroup boot
48  * @{
49  */
50 
51 /**
52  * Possible boot statuses that can be reported
53  */
54 typedef enum
55 {
56     /* Codes for boot stub */
57     BDK_BOOT_STATUS_BOOT_STUB_STARTING              = 0x000,
58     BDK_BOOT_STATUS_BOOT_STUB_WAITING_FOR_KEY       = 0x001,
59     BDK_BOOT_STATUS_BOOT_STUB_BOOT_MENU_KEY         = 0x102, /* Signal boot complete as stopped by user */
60     BDK_BOOT_STATUS_BOOT_STUB_NO_BOOT_MENU_KEY      = 0x003,
61     BDK_BOOT_STATUS_BOOT_STUB_LOAD_FAILED           = 0x004,
62     /* Codes for init.bin */
63     BDK_BOOT_STATUS_INIT_STARTING                   = 0x005,
64     BDK_BOOT_STATUS_INIT_NODE0_DRAM                 = 0x006,
65     BDK_BOOT_STATUS_INIT_NODE0_DRAM_COMPLETE        = 0x007,
66     BDK_BOOT_STATUS_INIT_NODE0_DRAM_FAILED          = 0x008,
67     BDK_BOOT_STATUS_INIT_CCPI                       = 0x009,
68     BDK_BOOT_STATUS_INIT_CCPI_COMPLETE              = 0x00a,
69     BDK_BOOT_STATUS_INIT_CCPI_FAILED                = 0x00b,
70     BDK_BOOT_STATUS_INIT_NODE1_DRAM                 = 0x00c,
71     BDK_BOOT_STATUS_INIT_NODE1_DRAM_COMPLETE        = 0x00d,
72     BDK_BOOT_STATUS_INIT_NODE1_DRAM_FAILED          = 0x00e,
73     BDK_BOOT_STATUS_INIT_QLM                        = 0x00f,
74     BDK_BOOT_STATUS_INIT_QLM_COMPLETE               = 0x010,
75     BDK_BOOT_STATUS_INIT_QLM_FAILED                 = 0x011,
76     BDK_BOOT_STATUS_INIT_LOAD_ATF                   = 0x012,
77     BDK_BOOT_STATUS_INIT_LOAD_DIAGNOSTICS           = 0x013,
78     BDK_BOOT_STATUS_INIT_LOAD_FAILED                = 0x014,
79     /* Codes for diagnostics.bin */
80     BDK_BOOT_STATUS_DIAG_STARTING                   = 0x015,
81     BDK_BOOT_STATUS_DIAG_COMPLETE                   = 0x116, /* Signal boot complete */
82     /* Special codes */
83     BDK_BOOT_STATUS_REQUEST_POWER_CYCLE             = 0x0f2, /* Don't continue, power cycle */
84 } bdk_boot_status_t;
85 
86 /**
87  * Report boot status to the BMC or whomever might care. This function
88  * will return quickly except for a status of "power cycle". In the power cycle
89  * case it is assumed the board is in a bad state and should not continue until
90  * a power cycle restarts us.
91  *
92  * @param status Status to report. Enumerated in bdk_boot_status_t
93  */
94 extern void bdk_boot_status(bdk_boot_status_t status);
95 
96 /** @} */
97 #endif	/* !__CB_BDK_BOOT_STATUS_H__ */
98