Software APIs
boot_stage.h
Go to the documentation of this file.
1 // Copyright lowRISC contributors (OpenTitan project).
2 // Licensed under the Apache License, Version 2.0, see LICENSE for details.
3 // SPDX-License-Identifier: Apache-2.0
4 
5 #ifndef OPENTITAN_SW_DEVICE_LIB_ARCH_BOOT_STAGE_H_
6 #define OPENTITAN_SW_DEVICE_LIB_ARCH_BOOT_STAGE_H_
7 
8 #ifdef __cplusplus
9 extern "C" {
10 #endif // __cplusplus
11 
12 /**
13  * @file
14  * @brief This header contains declarations of boot stage information.
15  *
16  * This header contains the boot stage specific symbol declarations that can be
17  * used by the consumer of this library to determine which stage in the boot
18  * sequence the binary is executing from.
19  *
20  * Definitions for these symbols can be found in other files in this directory,
21  * which should be linked in depending on which boot stage an executable is
22  * intended for.
23  */
24 
25 /**
26  * A `boot_stage_t` represents a particular boot stage.
27  */
28 typedef enum boot_stage {
29  /**
30  * Undefined boot stage.
31  */
33  /**
34  * The ROM boot stage. Represents the non-mutable code that is used to
35  * establish the hardware root of trust in the boot sequence.
36  */
38  /**
39  * The ROM_EXT boot stage. Represents the first mutable boot stage, which is
40  * signed by the Silicon Creator entity.
41  */
43  /**
44  * The First Silicon Owner boot stage.
45  */
48 
49 /**
50  * Indicates the boot stage that this program has been linked for.
51  *
52  * This can be used, for example, for conditioning an operation on the precise
53  * boot stage.
54  */
55 extern const boot_stage_t kBootStage;
56 
57 #ifdef __cplusplus
58 } // extern "C"
59 #endif // __cplusplus
60 
61 #endif // OPENTITAN_SW_DEVICE_LIB_ARCH_BOOT_STAGE_H_