Lines Matching +full:opt +full:- +full:in
4 * SPDX-License-Identifier: Apache-2.0
36 flash_get_page_info_by_offs(dev, offset + size - 1, &end_page)) { in sector_mask_from_offset()
37 return -EINVAL; in sector_mask_from_offset()
40 *mask = ((1UL << (end_page.index + 1)) - 1) & in sector_mask_from_offset()
41 ~((1UL << start_page.index) - 1); in sector_mask_from_offset()
57 /* Check if tested region fits in flash. */ in flash_stm32_setup()
97 if (buf[i] != flash_params->erase_value) { in flash_stm32_setup()
142 zassert_true(buf[i] == flash_params->erase_value, in ZTEST()
196 return regs->OPTCR & FLASH_OPTCR_OPTLOCK; in flash_opt_locked()
203 regs->KEYR = FLASH_KEY1; in flash_cr_unlock()
204 regs->KEYR = FLASH_KEY2; in flash_cr_unlock()
211 return regs->CR & FLASH_CR_LOCK; in flash_cr_locked()
216 /* Test OPT lock. */ in ZTEST()
217 TC_PRINT("Unlocking OPT\n"); in ZTEST()
219 zassert_false(flash_opt_locked(), "Unable to unlock OPT"); in ZTEST()
221 TC_PRINT("Blocking OPT\n"); in ZTEST()
224 zassert_true(flash_opt_locked(), "Blocking OPT didn't lock OPT"); in ZTEST()
225 TC_PRINT("Try to unlock blocked OPT\n"); in ZTEST()
229 SCB->SHCSR &= ~SCB_SHCSR_BUSFAULTPENDED_Msk; in ZTEST()
231 zassert_true(flash_opt_locked(), "OPT unlocked after being blocked"); in ZTEST()
245 SCB->SHCSR &= ~SCB_SHCSR_BUSFAULTPENDED_Msk; in ZTEST()