Software APIs
pwrmgr.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_DRIVERS_PWRMGR_H_
6 #define OPENTITAN_SW_DEVICE_SILICON_CREATOR_LIB_DRIVERS_PWRMGR_H_
7 
8 #include <stdint.h>
9 
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
13 
14 /**
15  * The following constants represent the expected number of sec_mmio register
16  * writes performed by functions in provided in this module. See
17  * `SEC_MMIO_WRITE_INCREMENT()` for more details.
18  *
19  * Example:
20  * ```
21  * pwrmgr_all_resets_enable();
22  * SEC_MMIO_WRITE_INCREMENT(kPwrmgrSecMmioAllResetsEnable);
23  * ```
24  */
25 enum {
26  kPwrmgrSecMmioAllResetsEnable = 1,
27 };
28 
29 /**
30  * Synchronize across clock domain.
31  *
32  * Synchronizes across clock domains by setting the CDC_SYNC register and
33  * waiting for it to clear.
34  *
35  * @param n Number of synchronizations to perform.
36  */
37 void pwrmgr_cdc_sync(uint32_t n);
38 
39 /**
40  * Enable all resets.
41  */
42 void pwrmgr_all_resets_enable(void);
43 
44 #ifdef __cplusplus
45 }
46 #endif
47 #endif // OPENTITAN_SW_DEVICE_SILICON_CREATOR_LIB_DRIVERS_PWRMGR_H_