Lines Matching refs:regs

124 	FLASH_TypeDef *regs = FLASH_STM32_REGS(dev);  in flash_stm32_flush_caches()
126 if (regs->ACR & FLASH_ACR_DCEN) { in flash_stm32_flush_caches()
127 regs->ACR &= ~FLASH_ACR_DCEN; in flash_stm32_flush_caches()
128 regs->ACR |= FLASH_ACR_DCRST; in flash_stm32_flush_caches()
129 regs->ACR &= ~FLASH_ACR_DCRST; in flash_stm32_flush_caches()
130 regs->ACR |= FLASH_ACR_DCEN; in flash_stm32_flush_caches()
233 FLASH_TypeDef *regs = FLASH_STM32_REGS(dev); in flash_stm32_write_protection() local
247 regs->NSCR |= FLASH_STM32_NSLOCK; in flash_stm32_write_protection()
249 if (regs->NSCR & FLASH_STM32_NSLOCK) { in flash_stm32_write_protection()
250 regs->NSKEYR = FLASH_KEY1; in flash_stm32_write_protection()
251 regs->NSKEYR = FLASH_KEY2; in flash_stm32_write_protection()
256 regs->CR |= FLASH_CR_LOCK; in flash_stm32_write_protection()
258 if (regs->CR & FLASH_CR_LOCK) { in flash_stm32_write_protection()
259 regs->KEYR = FLASH_KEY1; in flash_stm32_write_protection()
260 regs->KEYR = FLASH_KEY2; in flash_stm32_write_protection()
265 regs->PECR |= FLASH_PECR_PRGLOCK; in flash_stm32_write_protection()
266 regs->PECR |= FLASH_PECR_PELOCK; in flash_stm32_write_protection()
268 if (regs->PECR & FLASH_PECR_PRGLOCK) { in flash_stm32_write_protection()
270 regs->PEKEYR = FLASH_PEKEY1; in flash_stm32_write_protection()
271 regs->PEKEYR = FLASH_PEKEY2; in flash_stm32_write_protection()
272 regs->PRGKEYR = FLASH_PRGKEY1; in flash_stm32_write_protection()
273 regs->PRGKEYR = FLASH_PRGKEY2; in flash_stm32_write_protection()
293 FLASH_TypeDef *regs = FLASH_STM32_REGS(dev); in flash_stm32_option_bytes_lock() local
297 regs->OPTCR |= FLASH_OPTCR_OPTLOCK; in flash_stm32_option_bytes_lock()
298 } else if (regs->OPTCR & FLASH_OPTCR_OPTLOCK) { in flash_stm32_option_bytes_lock()
299 regs->OPTKEYR = FLASH_OPT_KEY1; in flash_stm32_option_bytes_lock()
300 regs->OPTKEYR = FLASH_OPT_KEY2; in flash_stm32_option_bytes_lock()
314 regs->CR &= ~FLASH_CR_OPTWRE; in flash_stm32_option_bytes_lock()
315 } else if (!(regs->CR & FLASH_CR_OPTWRE)) { in flash_stm32_option_bytes_lock()
316 regs->OPTKEYR = FLASH_OPTKEY1; in flash_stm32_option_bytes_lock()
317 regs->OPTKEYR = FLASH_OPTKEY2; in flash_stm32_option_bytes_lock()
321 regs->CR |= FLASH_CR_OPTLOCK; in flash_stm32_option_bytes_lock()
322 } else if (regs->CR & FLASH_CR_OPTLOCK) { in flash_stm32_option_bytes_lock()
323 regs->OPTKEYR = FLASH_OPTKEY1; in flash_stm32_option_bytes_lock()
324 regs->OPTKEYR = FLASH_OPTKEY2; in flash_stm32_option_bytes_lock()
328 regs->PECR |= FLASH_PECR_OPTLOCK; in flash_stm32_option_bytes_lock()
329 } else if (regs->PECR & FLASH_PECR_OPTLOCK) { in flash_stm32_option_bytes_lock()
330 regs->OPTKEYR = FLASH_OPTKEY1; in flash_stm32_option_bytes_lock()
331 regs->OPTKEYR = FLASH_OPTKEY2; in flash_stm32_option_bytes_lock()
335 regs->NSCR |= FLASH_NSCR_OPTLOCK; in flash_stm32_option_bytes_lock()
336 } else if (regs->NSCR & FLASH_NSCR_OPTLOCK) { in flash_stm32_option_bytes_lock()
337 regs->OPTKEYR = FLASH_OPTKEY1; in flash_stm32_option_bytes_lock()
338 regs->OPTKEYR = FLASH_OPTKEY2; in flash_stm32_option_bytes_lock()
342 regs->NSCR1 |= FLASH_NSCR1_OPTLOCK; in flash_stm32_option_bytes_lock()
343 } else if (regs->NSCR1 & FLASH_NSCR1_OPTLOCK) { in flash_stm32_option_bytes_lock()
344 regs->OPTKEYR = FLASH_OPTKEY1; in flash_stm32_option_bytes_lock()
345 regs->OPTKEYR = FLASH_OPTKEY2; in flash_stm32_option_bytes_lock()
369 FLASH_TypeDef *regs = FLASH_STM32_REGS(dev); in flash_stm32_control_register_disable() local
379 regs->CR |= FLASH_CR_LOCK; in flash_stm32_control_register_disable()
382 regs->KEYR = 0xffffffff; in flash_stm32_control_register_disable()
390 ARG_UNUSED(regs); in flash_stm32_control_register_disable()
398 FLASH_TypeDef *regs = FLASH_STM32_REGS(dev); in flash_stm32_option_bytes_disable() local
408 regs->OPTCR |= FLASH_OPTCR_OPTLOCK; in flash_stm32_option_bytes_disable()
411 regs->OPTKEYR = 0xffffffff; in flash_stm32_option_bytes_disable()
419 ARG_UNUSED(regs); in flash_stm32_option_bytes_disable()
435 .regs = (FLASH_TypeDef *) DT_INST_REG_ADDR(0),