Lines Matching full:regs
25 static inline void flush_cache(FLASH_TypeDef *regs) in flush_cache() argument
30 if (regs->ACR & FLASH_ACR_DCEN) { in flush_cache()
31 regs->ACR &= ~FLASH_ACR_DCEN; in flush_cache()
35 regs->ACR |= FLASH_ACR_DCRST; in flush_cache()
36 regs->ACR &= ~FLASH_ACR_DCRST; in flush_cache()
37 regs->ACR |= FLASH_ACR_DCEN; in flush_cache()
43 if (regs->ACR & FLASH_ACR_ICEN) { in flush_cache()
44 regs->ACR &= ~FLASH_ACR_ICEN; in flush_cache()
49 regs->ACR |= FLASH_ACR_ICRST; in flush_cache()
50 regs->ACR &= ~FLASH_ACR_ICRST; in flush_cache()
51 regs->ACR |= FLASH_ACR_ICEN; in flush_cache()
57 FLASH_TypeDef *regs = FLASH_STM32_REGS(dev); in write_byte() local
62 if (regs->CR & FLASH_CR_LOCK) { in write_byte()
72 regs->CR &= ~FLASH_CR_PSIZE; in write_byte()
73 regs->CR |= FLASH_PSIZE_BYTE; in write_byte()
74 regs->CR |= FLASH_CR_PG; in write_byte()
77 tmp = regs->CR; in write_byte()
85 regs->CR &= (~FLASH_CR_PG); in write_byte()
92 FLASH_TypeDef *regs = FLASH_STM32_REGS(dev); in erase_sector() local
97 if (regs->CR & FLASH_CR_LOCK) { in erase_sector()
107 regs->CR &= ~FLASH_CR_SNB; in erase_sector()
108 regs->CR |= FLASH_CR_SER | (sector << 3); in erase_sector()
109 regs->CR |= FLASH_CR_STRT; in erase_sector()
112 tmp = regs->CR; in erase_sector()
117 flush_cache(regs); in erase_sector()
119 regs->CR &= ~(FLASH_CR_SER | FLASH_CR_SNB); in erase_sector()