Lines Matching +full:write +full:- +full:protected

5  * SPDX-License-Identifier: Apache-2.0
39 if (regs->ACR & FLASH_ACR_DCEN) { in flush_cache()
40 regs->ACR &= ~FLASH_ACR_DCEN; in flush_cache()
44 regs->ACR |= FLASH_ACR_DCRST; in flush_cache()
45 regs->ACR &= ~FLASH_ACR_DCRST; in flush_cache()
46 regs->ACR |= FLASH_ACR_DCEN; in flush_cache()
49 if (regs->ACR & FLASH_ACR_ICEN) { in flush_cache()
50 regs->ACR &= ~FLASH_ACR_ICEN; in flush_cache()
55 regs->ACR |= FLASH_ACR_ICRST; in flush_cache()
56 regs->ACR &= ~FLASH_ACR_ICRST; in flush_cache()
57 regs->ACR |= FLASH_ACR_ICEN; in flush_cache()
72 if (regs->CR & FLASH_CR_LOCK) { in write_dword()
73 return -EIO; in write_dword()
78 * It is allowed to write only zeros over an already written dword in write_dword()
84 return -EIO; in write_dword()
89 return -EIO; in write_dword()
94 …* https://github.com/STMicroelectronics/STM32CubeWB/tree/master/Projects/P-NUCLEO-WB55.Nucleo/Appl… in write_dword()
153 * taken, it is allowed to only write one in write_dword()
160 regs->CR |= FLASH_CR_PG; in write_dword()
162 /* Flush the register write */ in write_dword()
163 tmp = regs->CR; in write_dword()
165 /* Perform the data write operation at desired in write_dword()
179 * This is why this code is protected by a in write_dword()
197 regs->CR &= (~FLASH_CR_PG); in write_dword()
212 if (regs->CR & FLASH_CR_LOCK) { in erase_page()
213 return -EIO; in erase_page()
231 …* https://github.com/STMicroelectronics/STM32CubeWB/tree/master/Projects/P-NUCLEO-WB55.Nucleo/Appl… in erase_page()
296 regs->CR |= FLASH_CR_PER; in erase_page()
297 regs->CR &= ~FLASH_CR_PNB_Msk; in erase_page()
298 regs->CR |= page << FLASH_CR_PNB_Pos; in erase_page()
300 regs->CR |= FLASH_CR_STRT; in erase_page()
310 * This is why this code is protected by a in erase_page()
328 regs->CR &= ~FLASH_CR_PER; in erase_page()
346 * The CPU2 will prevent all flash activity (write or erase) in all in flash_stm32_block_erase_loop()
353 for (; i <= get_page(offset + len - 1) ; ++i) { in flash_stm32_block_erase_loop()
414 error = (regs->SR & FLASH_FLAG_SR_ERRORS); in flash_stm32_check_status()
415 error |= (regs->ECCR & FLASH_FLAG_ECCC); in flash_stm32_check_status()
419 regs->SR |= FLASH_FLAG_SR_ERRORS; in flash_stm32_check_status()
424 return -EIO; in flash_stm32_check_status()