1 /* SPDX-License-Identifier: BSD-3-Clause */
2 /*
3  * Copyright (c) 2018-2019, STMicroelectronics
4  */
5 
6 #ifndef __STM32MP1_PWR_H
7 #define __STM32MP1_PWR_H
8 
9 #include <types_ext.h>
10 #include <util.h>
11 
12 #define PWR_CR1_OFF		0x00
13 #define PWR_CR2_OFF		0x08
14 #define PWR_CR3_OFF		0x0c
15 #define PWR_MPUCR_OFF		0x10
16 #define PWR_WKUPCR_OFF		0x20
17 #define PWR_MPUWKUPENR_OFF	0x28
18 
19 #define PWR_OFFSET_MASK		0x3fUL
20 
21 enum pwr_regulator {
22 	PWR_REG11 = 0,
23 	PWR_REG18,
24 	PWR_USB33,
25 	PWR_REGU_COUNT
26 };
27 
28 vaddr_t stm32_pwr_base(void);
29 
30 unsigned int stm32mp1_pwr_regulator_mv(enum pwr_regulator id);
31 void stm32mp1_pwr_regulator_set_state(enum pwr_regulator id, bool enable);
32 bool stm32mp1_pwr_regulator_is_enabled(enum pwr_regulator id);
33 
34 #endif /*__STM32MP1_PWR_H*/
35