Software APIs
ownership_activate.h
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_SILICON_CREATOR_LIB_OWNERSHIP_OWNERSHIP_ACTIVATE_H_
6 #define OPENTITAN_SW_DEVICE_SILICON_CREATOR_LIB_OWNERSHIP_OWNERSHIP_ACTIVATE_H_
7 
8 #include "sw/device/silicon_creator/lib/boot_data.h"
9 #include "sw/device/silicon_creator/lib/boot_svc/boot_svc_msg.h"
10 #include "sw/device/silicon_creator/lib/drivers/lifecycle.h"
11 #include "sw/device/silicon_creator/lib/error.h"
12 
13 #ifdef __cplusplus
14 extern "C" {
15 #endif // __cplusplus
16 
17 /**
18  * Activate the owner configuration on owner page 1.
19  *
20  * @param bootdata A pointer to the current boot_data in RAM.
21  * @param write_both_pages Whether to write the activated page to both owner
22  * pages.
23  * @return rom_error_t
24  */
25 rom_error_t ownership_activate(boot_data_t *bootdata,
26  hardened_bool_t write_both_pages);
27 
28 /**
29  * Process a boot_svc OwnershipActivate message.
30  *
31  * @param msg The boot_svc OwnershipActivate message to process.
32  * @param bootdata A pointer to the current boot_data in RAM.
33  * @return rom_error_t
34  */
35 
36 rom_error_t ownership_activate_handler(boot_svc_msg_t *msg,
37  boot_data_t *bootdata);
38 
39 #ifdef __cplusplus
40 } // extern "C"
41 #endif // __cplusplus
42 #endif // OPENTITAN_SW_DEVICE_SILICON_CREATOR_LIB_OWNERSHIP_OWNERSHIP_ACTIVATE_H_