Lines Matching +full:fast +full:- +full:plus
4 * SPDX-License-Identifier: Apache-2.0
61 * Fetch word using sys_get_le32, which performs byte-sized in read_mem_u32()
62 * reads instead of word-sized. This is important as ptr may in read_mem_u32()
64 * stored in little-endian inside the flash. in read_mem_u32()
76 READ_BIT(FLASH->SIZE, FLASH_FLASH_SIZE_FLASH_SIZE) + 1; in get_flash_size_in_bytes()
90 * - illegal command in error_from_irq_flags()
91 * - command error in error_from_irq_flags()
94 return -EINVAL; in error_from_irq_flags()
98 return -EIO; in error_from_irq_flags()
102 * Unexpected error flag -> "out of domain" in error_from_irq_flags()
105 return -EDOM; in error_from_irq_flags()
111 const struct flash_wb0x_data *data = dev->data; in is_valid_flash_range()
117 && IN_RANGE(offset, 0, data->flash_size - 1) in is_valid_flash_range()
120 * byte in flash plus one (an access of `len` in is_valid_flash_range()
124 && IN_RANGE(offset_plus_len, 0, data->flash_size); in is_valid_flash_range()
159 flags = FLASH->IRQRAW; in poll_flash_controller()
163 FLASH->IRQRAW = flags; in poll_flash_controller()
173 FLASH->IRQRAW = FLASH->IRQRAW; in execute_flash_command()
176 FLASH->COMMAND = cmd; in execute_flash_command()
188 * executed fast enough. In this case, we're already done. in execute_flash_command()
207 __ASSERT_NO_MSG((start_page + page_count - 1) < PAGES_IN_FLASH); in erase_page_range()
215 FLASH->ADDRESS = (i << 9); in erase_page_range()
236 * Note that @p buf may not be aligned to 32-bit boundary. in write_word_range()
246 * - write single words using WRITE commands until the write in write_word_range()
249 * - after write address is aligned to quadword, we can use in write_word_range()
252 * - once less than 4 words remain to write, a last BURSTWRITE in write_word_range()
259 FLASH->ADDRESS = dst_addr; in write_word_range()
260 FLASH->DATA0 = read_mem_u32(src_ptr); in write_word_range()
269 remaining--; in write_word_range()
276 FLASH->ADDRESS = dst_addr; in write_word_range()
277 FLASH->DATA0 = read_mem_u32(src_ptr + 0); in write_word_range()
278 FLASH->DATA1 = read_mem_u32(src_ptr + 1); in write_word_range()
279 FLASH->DATA2 = read_mem_u32(src_ptr + 2); in write_word_range()
280 FLASH->DATA3 = read_mem_u32(src_ptr + 3); in write_word_range()
289 remaining -= WORDS_IN_BURST; in write_word_range()
297 FLASH->ADDRESS = dst_addr; in write_word_range()
298 FLASH->DATA0 = read_mem_u32(src_ptr + 0); in write_word_range()
300 FLASH->DATA1 = (remaining >= 2) in write_word_range()
304 FLASH->DATA2 = (remaining == 3) in write_word_range()
308 FLASH->DATA3 = BURST_IGNORE_VALUE; in write_word_range()
329 return -EINVAL; in flash_wb0x_read()
342 struct flash_wb0x_data *data = dev->data; in flash_wb0x_write()
350 return -EINVAL; in flash_wb0x_write()
354 res = k_sem_take(&data->write_lock, K_NO_WAIT); in flash_wb0x_write()
365 k_sem_give(&data->write_lock); in flash_wb0x_write()
372 struct flash_wb0x_data *data = dev->data; in flash_wb0x_erase()
380 return -EINVAL; in flash_wb0x_erase()
384 res = k_sem_take(&data->write_lock, K_NO_WAIT); in flash_wb0x_erase()
395 k_sem_give(&data->write_lock); in flash_wb0x_erase()
443 struct flash_wb0x_data *data = dev->data; in stm32wb0x_flash_init()
445 k_sem_init(&data->write_lock, 1, 1); in stm32wb0x_flash_init()
447 data->flash_size = get_flash_size_in_bytes(); in stm32wb0x_flash_init()