34#ifndef LIBOPENCM3_PWR_H
35#define LIBOPENCM3_PWR_H
43#define PWR_CR1 MMIO32(POWER_CONTROL_BASE + 0x00)
46#define PWR_CSR1 MMIO32(POWER_CONTROL_BASE + 0x04)
49#define PWR_CR2 MMIO32(POWER_CONTROL_BASE + 0x08)
52#define PWR_CSR2 MMIO32(POWER_CONTROL_BASE + 0x0c)
62#define PWR_CR1_UDEN_LSB 18
67#define PWR_CR1_UDEN_DISABLED (0x0 << PWR_CR1_UDEN_LSB)
68#define PWR_CR1_UDEN_ENABLED (0x3 << PWR_CR1_UDEN_LSB)
70#define PWR_CR1_UDEN_MASK (0x3 << PWR_CR1_UDEN_LSB)
73#define PWR_CR1_ODSWEN (1 << 17)
76#define PWR_CR1_ODEN (1 << 16)
79#define PWR_CR1_VOS_LSB 14
84#define PWR_CR1_VOS_SCALE_3 (0x1 << PWR_CR1_VOS_LSB)
85#define PWR_CR1_VOS_SCALE_2 (0x2 << PWR_CR1_VOS_LSB)
86#define PWR_CR1_VOS_SCALE_1 (0x3 << PWR_CR1_VOS_LSB)
88#define PWR_CR1_VOS_MASK (0x3 << PWR_CR1_VOS_LSB)
91#define PWR_CR1_ADCDC1 (1 << 13)
96#define PWR_CR1_MRUDS (1 << 11)
99#define PWR_CR1_LPUDS (1 << 10)
102#define PWR_CR1_FPDS (1 << 9)
105#define PWR_CR1_DBP (1 << 8)
108#define PWR_CR1_PLS_LSB 5
113#define PWR_CR1_PLS_2V0 (0x0 << PWR_CR_PLS_LSB)
114#define PWR_CR1_PLS_2V1 (0x1 << PWR_CR_PLS_LSB)
115#define PWR_CR1_PLS_2V3 (0x2 << PWR_CR_PLS_LSB)
116#define PWR_CR1_PLS_2V5 (0x3 << PWR_CR_PLS_LSB)
117#define PWR_CR1_PLS_2V6 (0x4 << PWR_CR_PLS_LSB)
118#define PWR_CR1_PLS_2V7 (0x5 << PWR_CR_PLS_LSB)
119#define PWR_CR1_PLS_2V8 (0x6 << PWR_CR_PLS_LSB)
120#define PWR_CR1_PLS_2V9 (0x7 << PWR_CR_PLS_LSB)
122#define PWR_CR1_PLS_MASK (0x7 << PWR_CR_PLS_LSB)
125#define PWR_CR1_PVDE (1 << 4)
128#define PWR_CR1_CSBF (1 << 3)
133#define PWR_CR1_PDDS (1 << 1)
136#define PWR_CR1_LPDS (1 << 0)
146#define PWR_CSR1_UDRDY_LSB 18
151#define PWR_CSR1_UDRDY_DISABLED (0x0 << PWR_CSR1_UDRDY_LSB)
152#define PWR_CSR1_UDRDY_ACTIVATED (0x3 << PWR_CSR1_UDRDY_LSB)
154#define PWR_CSR1_UDRDY_MASK (0x3 << PWR_CSR1_UDRDY_LSB)
157#define PWR_CSR1_ODSWRDY (1 << 17)
160#define PWR_CSR1_ODRDY (1 << 16)
165#define PWR_CSR1_VOSRDY (1 << 14)
170#define PWR_CSR1_BRE (1 << 9)
173#define PWR_CSR1_EIWUP (1 << 8)
178#define PWR_CSR1_BRR (1 << 3)
181#define PWR_CSR1_PVDO (1 << 2)
184#define PWR_CSR1_SBF (1 << 1)
187#define PWR_CSR1_WUIF (1 << 0)
197#define PWR_CR2_WUPP6 (1 << 13)
200#define PWR_CR2_WUPP5 (1 << 12)
203#define PWR_CR2_WUPP4 (1 << 11)
206#define PWR_CR2_WUPP3 (1 << 10)
209#define PWR_CR2_WUPP2 (1 << 9)
212#define PWR_CR2_WUPP1 (1 << 8)
217#define PWR_CR2_CWUPF6 (1 << 5)
220#define PWR_CR2_CWUPF5 (1 << 4)
223#define PWR_CR2_CWUPF4 (1 << 3)
226#define PWR_CR2_CWUPF3 (1 << 2)
229#define PWR_CR2_CWUPF2 (1 << 1)
232#define PWR_CR2_CWUPF1 (1 << 0)
242#define PWR_CSR2_EWUP6 (1 << 13)
245#define PWR_CSR2_EWUP5 (1 << 12)
248#define PWR_CSR2_EWUP4 (1 << 11)
251#define PWR_CSR2_EWUP3 (1 << 10)
254#define PWR_CSR2_EWUP2 (1 << 19)
257#define PWR_CSR2_EWUP1 (1 << 18)
262#define PWR_CSR2_WUPF6 (1 << 5)
265#define PWR_CSR2_WUPF5 (1 << 4)
268#define PWR_CSR2_WUPF4 (1 << 3)
271#define PWR_CSR2_WUPF3 (1 << 2)
274#define PWR_CSR2_WUPF2 (1 << 1)
277#define PWR_CSR2_WUPF1 (1 << 0)
void pwr_enable_overdrive(void)
void pwr_set_vos_scale(enum pwr_vos_scale scale)
void pwr_disable_overdrive(void)
@ PWR_SCALE2
<= 180MHz w/o overdrive, <= 216MHz w/ overdrive
@ PWR_SCALE3
<= 168MHz w/o overdrive, <= 180MHz w/ overdrive