13 #include "sysrst_ctrl_regs.h"
15 static_assert(SYSRST_CTRL_PARAM_NUM_COMBO == 4,
16 "Number of key combinations has changed. Update the "
17 "dif_sysrst_ctrl_key_combo_t enum.");
18 static_assert(SYSRST_CTRL_KEY_INTR_STATUS_FLASH_WP_L_L2H_BIT == 13,
19 "Flash write-protect key interrupt bit has changed. Update the "
20 "dif_sysrst_ctrl_input_change_irq_get_causes() DIF.");
31 ptrdiff_t pre_cond_combo_select_ctl_reg_offset;
32 ptrdiff_t pre_cond_combo_detect_ctl_reg_offset;
33 ptrdiff_t combo_select_ctl_reg_offset;
34 ptrdiff_t combo_detect_ctl_reg_offset;
35 ptrdiff_t combo_action_ctl_reg_offset;
39 pre_cond_combo_select_ctl_reg_offset =
40 SYSRST_CTRL_COM_PRE_SEL_CTL_0_REG_OFFSET;
41 pre_cond_combo_detect_ctl_reg_offset =
42 SYSRST_CTRL_COM_PRE_DET_CTL_0_REG_OFFSET;
43 combo_select_ctl_reg_offset = SYSRST_CTRL_COM_SEL_CTL_0_REG_OFFSET;
44 combo_detect_ctl_reg_offset = SYSRST_CTRL_COM_DET_CTL_0_REG_OFFSET;
45 combo_action_ctl_reg_offset = SYSRST_CTRL_COM_OUT_CTL_0_REG_OFFSET;
48 pre_cond_combo_select_ctl_reg_offset =
49 SYSRST_CTRL_COM_PRE_SEL_CTL_1_REG_OFFSET;
50 pre_cond_combo_detect_ctl_reg_offset =
51 SYSRST_CTRL_COM_PRE_DET_CTL_1_REG_OFFSET;
52 combo_select_ctl_reg_offset = SYSRST_CTRL_COM_SEL_CTL_1_REG_OFFSET;
53 combo_detect_ctl_reg_offset = SYSRST_CTRL_COM_DET_CTL_1_REG_OFFSET;
54 combo_action_ctl_reg_offset = SYSRST_CTRL_COM_OUT_CTL_1_REG_OFFSET;
57 pre_cond_combo_select_ctl_reg_offset =
58 SYSRST_CTRL_COM_PRE_SEL_CTL_2_REG_OFFSET;
59 pre_cond_combo_detect_ctl_reg_offset =
60 SYSRST_CTRL_COM_PRE_DET_CTL_2_REG_OFFSET;
61 combo_select_ctl_reg_offset = SYSRST_CTRL_COM_SEL_CTL_2_REG_OFFSET;
62 combo_detect_ctl_reg_offset = SYSRST_CTRL_COM_DET_CTL_2_REG_OFFSET;
63 combo_action_ctl_reg_offset = SYSRST_CTRL_COM_OUT_CTL_2_REG_OFFSET;
66 pre_cond_combo_select_ctl_reg_offset =
67 SYSRST_CTRL_COM_PRE_SEL_CTL_3_REG_OFFSET;
68 pre_cond_combo_detect_ctl_reg_offset =
69 SYSRST_CTRL_COM_PRE_DET_CTL_3_REG_OFFSET;
70 combo_select_ctl_reg_offset = SYSRST_CTRL_COM_SEL_CTL_3_REG_OFFSET;
71 combo_detect_ctl_reg_offset = SYSRST_CTRL_COM_DET_CTL_3_REG_OFFSET;
72 combo_action_ctl_reg_offset = SYSRST_CTRL_COM_OUT_CTL_3_REG_OFFSET;
78 if (!mmio_region_read32(sysrst_ctrl->
base_addr,
79 SYSRST_CTRL_REGWEN_REG_OFFSET)) {
83 mmio_region_write32(sysrst_ctrl->
base_addr,
84 pre_cond_combo_select_ctl_reg_offset,
86 mmio_region_write32(sysrst_ctrl->
base_addr,
87 pre_cond_combo_detect_ctl_reg_offset,
89 mmio_region_write32(sysrst_ctrl->
base_addr, combo_select_ctl_reg_offset,
91 mmio_region_write32(sysrst_ctrl->
base_addr, combo_detect_ctl_reg_offset,
93 mmio_region_write32(sysrst_ctrl->
base_addr, combo_action_ctl_reg_offset,
97 mmio_region_write32(sysrst_ctrl->
base_addr,
98 SYSRST_CTRL_EC_RST_CTL_REG_OFFSET,
112 if (!mmio_region_read32(sysrst_ctrl->
base_addr,
113 SYSRST_CTRL_REGWEN_REG_OFFSET)) {
117 mmio_region_write32(sysrst_ctrl->
base_addr,
118 SYSRST_CTRL_KEY_INTR_CTL_REG_OFFSET,
120 mmio_region_write32(sysrst_ctrl->
base_addr,
121 SYSRST_CTRL_KEY_INTR_DEBOUNCE_CTL_REG_OFFSET,
130 if (sysrst_ctrl == NULL ||
137 uint32_t pin_out_ctl_bit_index;
138 uint32_t pin_out_value_bit_index;
139 uint32_t pin_out_allow_0_bit_index;
140 uint32_t pin_out_allow_1_bit_index;
142 switch (output_pin) {
144 pin_out_ctl_bit_index = SYSRST_CTRL_PIN_OUT_CTL_KEY0_OUT_BIT;
145 pin_out_value_bit_index = SYSRST_CTRL_PIN_OUT_VALUE_KEY0_OUT_BIT;
146 pin_out_allow_0_bit_index = SYSRST_CTRL_PIN_ALLOWED_CTL_KEY0_OUT_0_BIT;
147 pin_out_allow_1_bit_index = SYSRST_CTRL_PIN_ALLOWED_CTL_KEY0_OUT_1_BIT;
150 pin_out_ctl_bit_index = SYSRST_CTRL_PIN_OUT_CTL_KEY1_OUT_BIT;
151 pin_out_value_bit_index = SYSRST_CTRL_PIN_OUT_VALUE_KEY1_OUT_BIT;
152 pin_out_allow_0_bit_index = SYSRST_CTRL_PIN_ALLOWED_CTL_KEY1_OUT_0_BIT;
153 pin_out_allow_1_bit_index = SYSRST_CTRL_PIN_ALLOWED_CTL_KEY1_OUT_1_BIT;
156 pin_out_ctl_bit_index = SYSRST_CTRL_PIN_OUT_CTL_KEY2_OUT_BIT;
157 pin_out_value_bit_index = SYSRST_CTRL_PIN_OUT_VALUE_KEY2_OUT_BIT;
158 pin_out_allow_0_bit_index = SYSRST_CTRL_PIN_ALLOWED_CTL_KEY2_OUT_0_BIT;
159 pin_out_allow_1_bit_index = SYSRST_CTRL_PIN_ALLOWED_CTL_KEY2_OUT_1_BIT;
162 pin_out_ctl_bit_index = SYSRST_CTRL_PIN_OUT_CTL_PWRB_OUT_BIT;
163 pin_out_value_bit_index = SYSRST_CTRL_PIN_OUT_VALUE_PWRB_OUT_BIT;
164 pin_out_allow_0_bit_index = SYSRST_CTRL_PIN_ALLOWED_CTL_PWRB_OUT_0_BIT;
165 pin_out_allow_1_bit_index = SYSRST_CTRL_PIN_ALLOWED_CTL_PWRB_OUT_1_BIT;
168 pin_out_ctl_bit_index = SYSRST_CTRL_PIN_OUT_CTL_BAT_DISABLE_BIT;
169 pin_out_value_bit_index = SYSRST_CTRL_PIN_OUT_VALUE_BAT_DISABLE_BIT;
170 pin_out_allow_0_bit_index = SYSRST_CTRL_PIN_ALLOWED_CTL_BAT_DISABLE_0_BIT;
171 pin_out_allow_1_bit_index = SYSRST_CTRL_PIN_ALLOWED_CTL_BAT_DISABLE_1_BIT;
174 pin_out_ctl_bit_index = SYSRST_CTRL_PIN_OUT_CTL_Z3_WAKEUP_BIT;
175 pin_out_value_bit_index = SYSRST_CTRL_PIN_OUT_VALUE_Z3_WAKEUP_BIT;
176 pin_out_allow_0_bit_index = SYSRST_CTRL_PIN_ALLOWED_CTL_Z3_WAKEUP_0_BIT;
177 pin_out_allow_1_bit_index = SYSRST_CTRL_PIN_ALLOWED_CTL_Z3_WAKEUP_1_BIT;
180 pin_out_ctl_bit_index = SYSRST_CTRL_PIN_OUT_CTL_EC_RST_L_BIT;
181 pin_out_value_bit_index = SYSRST_CTRL_PIN_OUT_VALUE_EC_RST_L_BIT;
182 pin_out_allow_0_bit_index = SYSRST_CTRL_PIN_ALLOWED_CTL_EC_RST_L_0_BIT;
183 pin_out_allow_1_bit_index = SYSRST_CTRL_PIN_ALLOWED_CTL_EC_RST_L_1_BIT;
186 pin_out_ctl_bit_index = SYSRST_CTRL_PIN_OUT_CTL_FLASH_WP_L_BIT;
187 pin_out_value_bit_index = SYSRST_CTRL_PIN_OUT_VALUE_FLASH_WP_L_BIT;
188 pin_out_allow_0_bit_index = SYSRST_CTRL_PIN_ALLOWED_CTL_FLASH_WP_L_0_BIT;
189 pin_out_allow_1_bit_index = SYSRST_CTRL_PIN_ALLOWED_CTL_FLASH_WP_L_1_BIT;
195 if (!mmio_region_read32(sysrst_ctrl->
base_addr,
196 SYSRST_CTRL_REGWEN_REG_OFFSET)) {
201 uint32_t pin_out_ctl_reg = mmio_region_read32(
202 sysrst_ctrl->
base_addr, SYSRST_CTRL_PIN_OUT_CTL_REG_OFFSET);
205 mmio_region_write32(sysrst_ctrl->
base_addr,
206 SYSRST_CTRL_PIN_OUT_CTL_REG_OFFSET, pin_out_ctl_reg);
209 uint32_t pin_out_value_reg = mmio_region_read32(
210 sysrst_ctrl->
base_addr, SYSRST_CTRL_PIN_OUT_VALUE_REG_OFFSET);
212 pin_out_value_reg, pin_out_value_bit_index, config.
override_value);
213 mmio_region_write32(sysrst_ctrl->
base_addr,
214 SYSRST_CTRL_PIN_OUT_VALUE_REG_OFFSET, pin_out_value_reg);
217 uint32_t pin_out_allowed_values_reg = mmio_region_read32(
218 sysrst_ctrl->
base_addr, SYSRST_CTRL_PIN_ALLOWED_CTL_REG_OFFSET);
220 pin_out_allowed_values_reg, pin_out_allow_0_bit_index, config.
allow_zero);
222 pin_out_allowed_values_reg, pin_out_allow_1_bit_index, config.
allow_one);
223 mmio_region_write32(sysrst_ctrl->
base_addr,
224 SYSRST_CTRL_PIN_ALLOWED_CTL_REG_OFFSET,
225 pin_out_allowed_values_reg);
237 if (!mmio_region_read32(sysrst_ctrl->
base_addr,
238 SYSRST_CTRL_REGWEN_REG_OFFSET)) {
242 mmio_region_write32(sysrst_ctrl->
base_addr, SYSRST_CTRL_ULP_CTL_REG_OFFSET,
244 mmio_region_write32(sysrst_ctrl->
base_addr,
245 SYSRST_CTRL_ULP_AC_DEBOUNCE_CTL_REG_OFFSET,
247 mmio_region_write32(sysrst_ctrl->
base_addr,
248 SYSRST_CTRL_ULP_LID_DEBOUNCE_CTL_REG_OFFSET,
250 mmio_region_write32(sysrst_ctrl->
base_addr,
251 SYSRST_CTRL_ULP_PWRB_DEBOUNCE_CTL_REG_OFFSET,
263 mmio_region_write32(sysrst_ctrl->
base_addr, SYSRST_CTRL_ULP_CTL_REG_OFFSET,
271 if (sysrst_ctrl == NULL || is_enabled == NULL) {
276 sysrst_ctrl->
base_addr, SYSRST_CTRL_ULP_CTL_REG_OFFSET));
287 if (!mmio_region_read32(sysrst_ctrl->
base_addr,
288 SYSRST_CTRL_REGWEN_REG_OFFSET)) {
292 uint32_t inverted_pins = mmio_region_read32(
293 sysrst_ctrl->
base_addr, SYSRST_CTRL_KEY_INVERT_CTL_REG_OFFSET);
296 inverted_pins |= pins;
298 inverted_pins &= ~pins;
301 mmio_region_write32(sysrst_ctrl->
base_addr,
302 SYSRST_CTRL_KEY_INVERT_CTL_REG_OFFSET, inverted_pins);
309 if (sysrst_ctrl == NULL || inverted_pins == NULL) {
313 *inverted_pins = mmio_region_read32(sysrst_ctrl->
base_addr,
314 SYSRST_CTRL_KEY_INVERT_CTL_REG_OFFSET);
320 uint32_t *allow_0_bit_index,
321 uint32_t *allow_1_bit_index) {
324 *allow_0_bit_index = SYSRST_CTRL_PIN_ALLOWED_CTL_KEY0_OUT_0_BIT;
325 *allow_1_bit_index = SYSRST_CTRL_PIN_ALLOWED_CTL_KEY0_OUT_1_BIT;
328 *allow_0_bit_index = SYSRST_CTRL_PIN_ALLOWED_CTL_KEY1_OUT_0_BIT;
329 *allow_1_bit_index = SYSRST_CTRL_PIN_ALLOWED_CTL_KEY1_OUT_1_BIT;
332 *allow_0_bit_index = SYSRST_CTRL_PIN_ALLOWED_CTL_KEY2_OUT_0_BIT;
333 *allow_1_bit_index = SYSRST_CTRL_PIN_ALLOWED_CTL_KEY2_OUT_1_BIT;
336 *allow_0_bit_index = SYSRST_CTRL_PIN_ALLOWED_CTL_PWRB_OUT_0_BIT;
337 *allow_1_bit_index = SYSRST_CTRL_PIN_ALLOWED_CTL_PWRB_OUT_1_BIT;
340 *allow_0_bit_index = SYSRST_CTRL_PIN_ALLOWED_CTL_BAT_DISABLE_0_BIT;
341 *allow_1_bit_index = SYSRST_CTRL_PIN_ALLOWED_CTL_BAT_DISABLE_1_BIT;
344 *allow_0_bit_index = SYSRST_CTRL_PIN_ALLOWED_CTL_Z3_WAKEUP_0_BIT;
345 *allow_1_bit_index = SYSRST_CTRL_PIN_ALLOWED_CTL_Z3_WAKEUP_1_BIT;
348 *allow_0_bit_index = SYSRST_CTRL_PIN_ALLOWED_CTL_EC_RST_L_0_BIT;
349 *allow_1_bit_index = SYSRST_CTRL_PIN_ALLOWED_CTL_EC_RST_L_1_BIT;
352 *allow_0_bit_index = SYSRST_CTRL_PIN_ALLOWED_CTL_FLASH_WP_L_0_BIT;
353 *allow_1_bit_index = SYSRST_CTRL_PIN_ALLOWED_CTL_FLASH_WP_L_1_BIT;
363 bool allow_zero,
bool allow_one) {
364 if (sysrst_ctrl == NULL) {
368 uint32_t allow_0_bit_index;
369 uint32_t allow_1_bit_index;
370 if (!get_output_pin_allowed_bit_indices(pin, &allow_0_bit_index,
371 &allow_1_bit_index)) {
375 if (!mmio_region_read32(sysrst_ctrl->
base_addr,
376 SYSRST_CTRL_REGWEN_REG_OFFSET)) {
380 uint32_t allowed_values_reg = mmio_region_read32(
381 sysrst_ctrl->
base_addr, SYSRST_CTRL_PIN_ALLOWED_CTL_REG_OFFSET);
386 mmio_region_write32(sysrst_ctrl->
base_addr,
387 SYSRST_CTRL_PIN_ALLOWED_CTL_REG_OFFSET,
395 bool *allow_zero,
bool *allow_one) {
396 if (sysrst_ctrl == NULL || allow_zero == NULL || allow_one == NULL) {
400 uint32_t allow_0_bit_index;
401 uint32_t allow_1_bit_index;
402 if (!get_output_pin_allowed_bit_indices(pin, &allow_0_bit_index,
403 &allow_1_bit_index)) {
407 uint32_t allowed_values_reg = mmio_region_read32(
408 sysrst_ctrl->
base_addr, SYSRST_CTRL_PIN_ALLOWED_CTL_REG_OFFSET);
416 uint32_t *pin_out_ctl_bit_index) {
419 *pin_out_ctl_bit_index = SYSRST_CTRL_PIN_OUT_CTL_KEY0_OUT_BIT;
422 *pin_out_ctl_bit_index = SYSRST_CTRL_PIN_OUT_CTL_KEY1_OUT_BIT;
425 *pin_out_ctl_bit_index = SYSRST_CTRL_PIN_OUT_CTL_KEY2_OUT_BIT;
428 *pin_out_ctl_bit_index = SYSRST_CTRL_PIN_OUT_CTL_PWRB_OUT_BIT;
431 *pin_out_ctl_bit_index = SYSRST_CTRL_PIN_OUT_CTL_BAT_DISABLE_BIT;
434 *pin_out_ctl_bit_index = SYSRST_CTRL_PIN_OUT_CTL_Z3_WAKEUP_BIT;
437 *pin_out_ctl_bit_index = SYSRST_CTRL_PIN_OUT_CTL_EC_RST_L_BIT;
440 *pin_out_ctl_bit_index = SYSRST_CTRL_PIN_OUT_CTL_FLASH_WP_L_BIT;
455 uint32_t pin_out_ctl_bit_index;
456 if (!get_output_pin_ctl_bit_index(pin, &pin_out_ctl_bit_index)) {
460 uint32_t pin_out_ctl_reg = mmio_region_read32(
461 sysrst_ctrl->
base_addr, SYSRST_CTRL_PIN_OUT_CTL_REG_OFFSET);
464 mmio_region_write32(sysrst_ctrl->
base_addr,
465 SYSRST_CTRL_PIN_OUT_CTL_REG_OFFSET, pin_out_ctl_reg);
473 if (sysrst_ctrl == NULL || is_enabled == NULL) {
477 uint32_t pin_out_ctl_bit_index;
478 if (!get_output_pin_ctl_bit_index(pin, &pin_out_ctl_bit_index)) {
482 uint32_t pin_out_ctl_reg = mmio_region_read32(
483 sysrst_ctrl->
base_addr, SYSRST_CTRL_PIN_OUT_CTL_REG_OFFSET);
490 uint32_t *pin_out_value_bit_index) {
493 *pin_out_value_bit_index = SYSRST_CTRL_PIN_OUT_VALUE_KEY0_OUT_BIT;
496 *pin_out_value_bit_index = SYSRST_CTRL_PIN_OUT_VALUE_KEY1_OUT_BIT;
499 *pin_out_value_bit_index = SYSRST_CTRL_PIN_OUT_VALUE_KEY2_OUT_BIT;
502 *pin_out_value_bit_index = SYSRST_CTRL_PIN_OUT_VALUE_PWRB_OUT_BIT;
505 *pin_out_value_bit_index = SYSRST_CTRL_PIN_OUT_VALUE_BAT_DISABLE_BIT;
508 *pin_out_value_bit_index = SYSRST_CTRL_PIN_OUT_VALUE_Z3_WAKEUP_BIT;
511 *pin_out_value_bit_index = SYSRST_CTRL_PIN_OUT_VALUE_EC_RST_L_BIT;
514 *pin_out_value_bit_index = SYSRST_CTRL_PIN_OUT_VALUE_FLASH_WP_L_BIT;
525 if (sysrst_ctrl == NULL) {
529 uint32_t pin_out_value_bit_index;
530 if (!get_output_pin_value_bit_index(pin, &pin_out_value_bit_index)) {
534 uint32_t pin_out_value_reg = mmio_region_read32(
535 sysrst_ctrl->
base_addr, SYSRST_CTRL_PIN_OUT_VALUE_REG_OFFSET);
538 mmio_region_write32(sysrst_ctrl->
base_addr,
539 SYSRST_CTRL_PIN_OUT_VALUE_REG_OFFSET, pin_out_value_reg);
547 if (sysrst_ctrl == NULL || value == NULL) {
551 uint32_t pin_out_value_bit_index;
552 if (!get_output_pin_value_bit_index(pin, &pin_out_value_bit_index)) {
556 uint32_t pin_out_value_reg = mmio_region_read32(
557 sysrst_ctrl->
base_addr, SYSRST_CTRL_PIN_OUT_VALUE_REG_OFFSET);
564 uint32_t *pin_in_value_bit_index) {
567 *pin_in_value_bit_index = SYSRST_CTRL_PIN_IN_VALUE_KEY0_IN_BIT;
570 *pin_in_value_bit_index = SYSRST_CTRL_PIN_IN_VALUE_KEY1_IN_BIT;
573 *pin_in_value_bit_index = SYSRST_CTRL_PIN_IN_VALUE_KEY2_IN_BIT;
576 *pin_in_value_bit_index = SYSRST_CTRL_PIN_IN_VALUE_PWRB_IN_BIT;
579 *pin_in_value_bit_index = SYSRST_CTRL_PIN_IN_VALUE_AC_PRESENT_BIT;
582 *pin_in_value_bit_index = SYSRST_CTRL_PIN_IN_VALUE_LID_OPEN_BIT;
585 *pin_in_value_bit_index = SYSRST_CTRL_PIN_IN_VALUE_EC_RST_L_BIT;
588 *pin_in_value_bit_index = SYSRST_CTRL_PIN_IN_VALUE_FLASH_WP_L_BIT;
599 if (sysrst_ctrl == NULL || value == NULL) {
603 uint32_t pin_in_value_bit_index;
604 if (!get_input_pin_value_bit_index(pin, &pin_in_value_bit_index)) {
608 uint32_t pin_in_value_reg = mmio_region_read32(
609 sysrst_ctrl->
base_addr, SYSRST_CTRL_PIN_IN_VALUE_REG_OFFSET);
625 if (!mmio_region_read32(sysrst_ctrl->
base_addr,
626 SYSRST_CTRL_REGWEN_REG_OFFSET)) {
632 0, SYSRST_CTRL_AUTO_BLOCK_DEBOUNCE_CTL_AUTO_BLOCK_ENABLE_BIT,
636 SYSRST_CTRL_AUTO_BLOCK_DEBOUNCE_CTL_DEBOUNCE_TIMER_FIELD,
638 mmio_region_write32(sysrst_ctrl->
base_addr,
639 SYSRST_CTRL_AUTO_BLOCK_DEBOUNCE_CTL_REG_OFFSET,
647 auto_block_ctl_reg, SYSRST_CTRL_AUTO_BLOCK_OUT_CTL_KEY0_OUT_VALUE_BIT,
650 auto_block_ctl_reg, SYSRST_CTRL_AUTO_BLOCK_OUT_CTL_KEY1_OUT_SEL_BIT,
653 auto_block_ctl_reg, SYSRST_CTRL_AUTO_BLOCK_OUT_CTL_KEY1_OUT_VALUE_BIT,
656 auto_block_ctl_reg, SYSRST_CTRL_AUTO_BLOCK_OUT_CTL_KEY2_OUT_SEL_BIT,
659 auto_block_ctl_reg, SYSRST_CTRL_AUTO_BLOCK_OUT_CTL_KEY2_OUT_VALUE_BIT,
661 mmio_region_write32(sysrst_ctrl->
base_addr,
662 SYSRST_CTRL_AUTO_BLOCK_OUT_CTL_REG_OFFSET,
669 uint32_t *en_bit_index) {
672 *en_bit_index = SYSRST_CTRL_AUTO_BLOCK_OUT_CTL_KEY0_OUT_SEL_BIT;
675 *en_bit_index = SYSRST_CTRL_AUTO_BLOCK_OUT_CTL_KEY1_OUT_SEL_BIT;
678 *en_bit_index = SYSRST_CTRL_AUTO_BLOCK_OUT_CTL_KEY2_OUT_SEL_BIT;
693 uint32_t en_bit_index;
694 if (!get_key_auto_override_en_bit_index(key, &en_bit_index)) {
698 if (!mmio_region_read32(sysrst_ctrl->
base_addr,
699 SYSRST_CTRL_REGWEN_REG_OFFSET)) {
703 uint32_t auto_block_ctl_reg = mmio_region_read32(
704 sysrst_ctrl->
base_addr, SYSRST_CTRL_AUTO_BLOCK_OUT_CTL_REG_OFFSET);
707 mmio_region_write32(sysrst_ctrl->
base_addr,
708 SYSRST_CTRL_AUTO_BLOCK_OUT_CTL_REG_OFFSET,
717 if (sysrst_ctrl == NULL || is_enabled == NULL) {
721 uint32_t en_bit_index;
722 if (!get_key_auto_override_en_bit_index(key, &en_bit_index)) {
726 uint32_t auto_block_ctl_reg = mmio_region_read32(
727 sysrst_ctrl->
base_addr, SYSRST_CTRL_AUTO_BLOCK_OUT_CTL_REG_OFFSET);
736 if (sysrst_ctrl == NULL || causes == NULL) {
740 *causes = mmio_region_read32(sysrst_ctrl->
base_addr,
741 SYSRST_CTRL_COMBO_INTR_STATUS_REG_OFFSET);
748 if (sysrst_ctrl == NULL || causes >= (1U << SYSRST_CTRL_PARAM_NUM_COMBO)) {
752 mmio_region_write32(sysrst_ctrl->
base_addr,
753 SYSRST_CTRL_COMBO_INTR_STATUS_REG_OFFSET, causes);
760 if (sysrst_ctrl == NULL || causes == NULL) {
764 *causes = mmio_region_read32(sysrst_ctrl->
base_addr,
765 SYSRST_CTRL_KEY_INTR_STATUS_REG_OFFSET);
772 if (sysrst_ctrl == NULL ||
773 causes >= (1U << (SYSRST_CTRL_KEY_INTR_STATUS_FLASH_WP_L_L2H_BIT + 1))) {
777 mmio_region_write32(sysrst_ctrl->
base_addr,
778 SYSRST_CTRL_KEY_INTR_STATUS_REG_OFFSET, causes);
784 if (sysrst_ctrl == NULL || wakeup_detected == NULL) {
788 *wakeup_detected = mmio_region_read32(sysrst_ctrl->
base_addr,
789 SYSRST_CTRL_WKUP_STATUS_REG_OFFSET);
796 if (sysrst_ctrl == NULL) {
800 mmio_region_write32(sysrst_ctrl->
base_addr,
801 SYSRST_CTRL_WKUP_STATUS_REG_OFFSET, 1);
807 if (sysrst_ctrl == NULL) {
811 mmio_region_write32(sysrst_ctrl->
base_addr, SYSRST_CTRL_REGWEN_REG_OFFSET, 0);
818 if (sysrst_ctrl == NULL || is_locked == NULL) {
822 *is_locked = !mmio_region_read32(sysrst_ctrl->
base_addr,
823 SYSRST_CTRL_REGWEN_REG_OFFSET);