Lines Matching refs:reg
35 static int mtcmos_wait_for_state(uint32_t reg, uint32_t mask, bool is_set) in mtcmos_wait_for_state() argument
41 if ((mmio_read_32(reg) & mask) == expect) in mtcmos_wait_for_state()
48 __func__, reg, mask, is_set, mmio_read_32(reg)); in mtcmos_wait_for_state()
69 static int spm_mtcmos_ctrl(enum mtcmos_state state, uintptr_t reg, in spm_mtcmos_ctrl() argument
85 mmio_setbits_32(reg, SRAM_PDN); in spm_mtcmos_ctrl()
86 ret = mtcmos_wait_for_state(reg, SRAM_PDN_ACK, true); in spm_mtcmos_ctrl()
91 mmio_setbits_32(reg, RTFF_CLK_DIS); in spm_mtcmos_ctrl()
92 mmio_setbits_32(reg, RTFF_SAVE); in spm_mtcmos_ctrl()
93 mmio_clrbits_32(reg, RTFF_SAVE); in spm_mtcmos_ctrl()
94 mmio_clrbits_32(reg, RTFF_CLK_DIS); in spm_mtcmos_ctrl()
96 mmio_setbits_32(reg, RTFF_SAVE_FLAG); in spm_mtcmos_ctrl()
101 mmio_setbits_32(reg, PWR_ISO); in spm_mtcmos_ctrl()
102 mmio_setbits_32(reg, PWR_CLK_DIS); in spm_mtcmos_ctrl()
103 mmio_clrbits_32(reg, PWR_RST_B); in spm_mtcmos_ctrl()
105 mmio_clrbits_32(reg, PWR_ON); in spm_mtcmos_ctrl()
106 ret = mtcmos_wait_for_state(reg, PWR_ACK, false); in spm_mtcmos_ctrl()
110 mmio_clrbits_32(reg, PWR_ON_2ND); in spm_mtcmos_ctrl()
111 ret = mtcmos_wait_for_state(reg, PWR_ACK_2ND, false); in spm_mtcmos_ctrl()
115 mmio_setbits_32(reg, PWR_ON); in spm_mtcmos_ctrl()
116 ret = mtcmos_wait_for_state(reg, PWR_ACK, true); in spm_mtcmos_ctrl()
122 mmio_setbits_32(reg, PWR_ON_2ND); in spm_mtcmos_ctrl()
123 ret = mtcmos_wait_for_state(reg, PWR_ACK_2ND, true); in spm_mtcmos_ctrl()
127 mmio_clrbits_32(reg, PWR_CLK_DIS); in spm_mtcmos_ctrl()
128 mmio_clrbits_32(reg, PWR_ISO); in spm_mtcmos_ctrl()
130 mmio_setbits_32(reg, PWR_RST_B); in spm_mtcmos_ctrl()
134 mmio_setbits_32(reg, RTFF_CLK_DIS); in spm_mtcmos_ctrl()
135 mmio_clrbits_32(reg, RTFF_NRESTORE); in spm_mtcmos_ctrl()
136 mmio_setbits_32(reg, RTFF_NRESTORE); in spm_mtcmos_ctrl()
137 mmio_clrbits_32(reg, RTFF_CLK_DIS); in spm_mtcmos_ctrl()
139 mmio_clrbits_32(reg, RTFF_SAVE_FLAG); in spm_mtcmos_ctrl()
145 mmio_clrbits_32(reg, SRAM_PDN); in spm_mtcmos_ctrl()
146 ret = mtcmos_wait_for_state(reg, SRAM_PDN_ACK, false); in spm_mtcmos_ctrl()