Software APIs
boot_policy_ptrs.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_ROM_BOOT_POLICY_PTRS_H_
6 #define OPENTITAN_SW_DEVICE_SILICON_CREATOR_ROM_BOOT_POLICY_PTRS_H_
7 
8 #include "sw/device/silicon_creator/lib/manifest.h"
9 
11 
12 #ifdef __cplusplus
13 extern "C" {
14 #endif // __cplusplus
15 
16 static_assert((TOP_EARLGREY_EFLASH_SIZE_BYTES % 2) == 0,
17  "Flash size is not divisible by 2");
18 
19 #ifdef OT_PLATFORM_RV32
20 /**
21  * Returns a pointer to the manifest of the ROM_EXT image stored in flash
22  * slot A.
23  *
24  * @return Pointer to the manifest of the ROM_EXT image in slot A.
25  */
27 inline const manifest_t *boot_policy_manifest_a_get(void) {
29 }
30 
31 /**
32  * Returns a pointer to the manifest of the ROM_EXT image stored in flash
33  * slot B.
34  *
35  * @return Pointer to the manifest of the ROM_EXT image in slot B.
36  */
38 inline const manifest_t *boot_policy_manifest_b_get(void) {
39  return (const manifest_t *)(TOP_EARLGREY_EFLASH_BASE_ADDR +
41 }
42 #else
43 /**
44  * Declarations for the functions above that should be defined in tests.
45  */
46 const manifest_t *boot_policy_manifest_a_get(void);
47 const manifest_t *boot_policy_manifest_b_get(void);
48 #endif
49 
50 #ifdef __cplusplus
51 } // extern "C"
52 #endif // __cplusplus
53 
54 #endif // OPENTITAN_SW_DEVICE_SILICON_CREATOR_ROM_BOOT_POLICY_PTRS_H_