Lines Matching refs:regs

52 static inline void flush_cache(FLASH_TypeDef *regs)  in flush_cache()  argument
54 if (regs->ACR & FLASH_ACR_DCEN) { in flush_cache()
55 regs->ACR &= ~FLASH_ACR_DCEN; in flush_cache()
59 regs->ACR |= FLASH_ACR_DCRST; in flush_cache()
60 regs->ACR &= ~FLASH_ACR_DCRST; in flush_cache()
61 regs->ACR |= FLASH_ACR_DCEN; in flush_cache()
64 if (regs->ACR & FLASH_ACR_ICEN) { in flush_cache()
65 regs->ACR &= ~FLASH_ACR_ICEN; in flush_cache()
70 regs->ACR |= FLASH_ACR_ICRST; in flush_cache()
71 regs->ACR &= ~FLASH_ACR_ICRST; in flush_cache()
72 regs->ACR |= FLASH_ACR_ICEN; in flush_cache()
79 FLASH_TypeDef *regs = FLASH_STM32_REGS(dev); in write_dword() local
87 if (regs->CR & FLASH_CR_LOCK) { in write_dword()
114 if (regs->ACR & FLASH_ACR_DCEN) { in write_dword()
116 regs->ACR &= (~FLASH_ACR_DCEN); in write_dword()
121 regs->CR |= FLASH_CR_PG; in write_dword()
124 tmp = regs->CR; in write_dword()
134 regs->CR &= (~FLASH_CR_PG); in write_dword()
139 regs->ACR |= FLASH_ACR_DCRST; in write_dword()
140 regs->ACR &= (~FLASH_ACR_DCRST); in write_dword()
141 regs->ACR |= FLASH_ACR_DCEN; in write_dword()
150 FLASH_TypeDef *regs = FLASH_STM32_REGS(dev); in erase_page() local
156 if (regs->CR & FLASH_CR_LOCK) { in erase_page()
174 regs->CR &= ~FLASH_CR_BKER_Msk; in erase_page()
179 regs->CR &= ~FLASH_CR_BKER_Msk; in erase_page()
184 regs->CR |= FLASH_CR_BKER; in erase_page()
189 regs->CR |= FLASH_CR_BKER; in erase_page()
202 regs->CR |= FLASH_CR_PER; in erase_page()
203 regs->CR &= ~FLASH_CR_PNB_Msk; in erase_page()
204 regs->CR |= (page << FLASH_CR_PNB_Pos); in erase_page()
207 regs->CR |= FLASH_CR_STRT; in erase_page()
210 tmp = regs->CR; in erase_page()
215 flush_cache(regs); in erase_page()
218 regs->CR &= ~(FLASH_CR_PER | FLASH_CR_BKER); in erase_page()
220 regs->CR &= ~(FLASH_CR_PER); in erase_page()
261 FLASH_TypeDef *regs = FLASH_STM32_REGS(dev); in flash_stm32_option_bytes_write() local
264 if (regs->CR & FLASH_CR_OPTLOCK) { in flash_stm32_option_bytes_write()
268 if ((regs->OPTR & mask) == value) { in flash_stm32_option_bytes_write()
277 regs->OPTR = (regs->OPTR & ~mask) | value; in flash_stm32_option_bytes_write()
278 regs->CR |= FLASH_CR_OPTSTRT; in flash_stm32_option_bytes_write()
293 FLASH_TypeDef *regs = FLASH_STM32_REGS(dev); in flash_stm32_option_bytes_read() local
295 return regs->OPTR; in flash_stm32_option_bytes_read()
317 FLASH_TypeDef *regs = FLASH_STM32_REGS(dev); in flash_stm32_get_rdp_level() local
319 return (regs->OPTR & FLASH_OPTR_RDP_Msk) >> FLASH_OPTR_RDP_Pos; in flash_stm32_get_rdp_level()