Lines Matching +full:block +full:- +full:count

4  * SPDX-License-Identifier: Apache-2.0
14 const struct flash_driver_api *api = dev->api; in flash_get_page_info()
19 info->start_offset = 0; in flash_get_page_info()
20 info->index = 0U; in flash_get_page_info()
22 api->page_layout(dev, &layout, &layout_size); in flash_get_page_info()
24 while (layout_size--) { in flash_get_page_info()
25 info->size = layout->pages_size; in flash_get_page_info()
27 index_jmp = index - info->index; in flash_get_page_info()
29 index_jmp = (offs - info->start_offset) / info->size; in flash_get_page_info()
32 index_jmp = MIN(index_jmp, layout->pages_count); in flash_get_page_info()
33 info->start_offset += (index_jmp * info->size); in flash_get_page_info()
34 info->index += index_jmp; in flash_get_page_info()
35 if (index_jmp < layout->pages_count) { in flash_get_page_info()
42 return -EINVAL; /* page at offs or idx doesn't exist */ in flash_get_page_info()
60 const struct flash_driver_api *api = dev->api; in z_impl_flash_get_page_count()
63 size_t count = 0; in z_impl_flash_get_page_count() local
65 api->page_layout(dev, &layout, &layout_size); in z_impl_flash_get_page_count()
67 while (layout_size--) { in z_impl_flash_get_page_count()
68 count += layout->pages_count; in z_impl_flash_get_page_count()
72 return count; in z_impl_flash_get_page_count()
78 const struct flash_driver_api *api = dev->api; in flash_page_foreach()
81 size_t block, num_blocks, page = 0, i; in flash_page_foreach() local
84 api->page_layout(dev, &layout, &num_blocks); in flash_page_foreach()
86 for (block = 0; block < num_blocks; block++) { in flash_page_foreach()
87 const struct flash_pages_layout *l = &layout[block]; in flash_page_foreach()
88 page_info.size = l->pages_size; in flash_page_foreach()
90 for (i = 0; i < l->pages_count; i++) { in flash_page_foreach()