/Zephyr-latest/subsys/storage/flash_map/ |
D | flash_map.c | 51 void flash_area_close(const struct flash_area *fa) in flash_area_close() argument 56 int flash_area_read(const struct flash_area *fa, off_t off, void *dst, in flash_area_read() argument 59 if (!is_in_flash_area_bounds(fa, off, len)) { in flash_area_read() 63 return flash_read(fa->fa_dev, fa->fa_off + off, dst, len); in flash_area_read() 66 int flash_area_write(const struct flash_area *fa, off_t off, const void *src, in flash_area_write() argument 69 if (!is_in_flash_area_bounds(fa, off, len)) { in flash_area_write() 73 return flash_write(fa->fa_dev, fa->fa_off + off, (void *)src, len); in flash_area_write() 76 int flash_area_erase(const struct flash_area *fa, off_t off, size_t len) in flash_area_erase() argument 78 if (!is_in_flash_area_bounds(fa, off, len)) { in flash_area_erase() 82 return flash_erase(fa->fa_dev, fa->fa_off + off, len); in flash_area_erase() [all …]
|
D | flash_map_shell.c | 23 static void fa_cb(const struct flash_area *fa, void *user_data) in fa_cb() argument 27 const char *fa_label = flash_area_label(fa); in fa_cb() 32 shell_print(sh, "%2d 0x%0*" PRIxPTR " %-26s %-24.24s 0x%-10x 0x%-12x", (int)fa->fa_id, in fa_cb() 33 sizeof(uintptr_t) * 2, (uintptr_t)fa->fa_dev, fa->fa_dev->name, fa_label, in fa_cb() 34 (uint32_t)fa->fa_off, fa->fa_size); in fa_cb() 36 shell_print(sh, "%2d 0x%0*" PRIxPTR " %-26s 0x%-10x 0x%-12x", (int)fa->fa_id, in fa_cb() 37 sizeof(uintptr_t) * 2, (uintptr_t)fa->fa_dev, fa->fa_dev->name, in fa_cb() 38 (uint32_t)fa->fa_off, fa->fa_size); in fa_cb()
|
D | flash_map_layout.c | 81 const struct flash_area *fa; in flash_area_get_sectors() local 82 int rc = flash_area_open(idx, &fa); in flash_area_get_sectors() 84 if (rc < 0 || fa == NULL) { in flash_area_get_sectors() 88 rc = flash_area_sectors(fa, cnt, ret); in flash_area_get_sectors() 89 flash_area_close(fa); in flash_area_get_sectors() 94 int flash_area_sectors(const struct flash_area *fa, uint32_t *cnt, struct flash_sector *ret) in flash_area_sectors() argument 99 data.area_off = fa->fa_off; in flash_area_sectors() 100 data.area_len = fa->fa_size; in flash_area_sectors() 107 flash_dev = fa->fa_dev; in flash_area_sectors()
|
D | flash_map_integrity.c | 31 int flash_area_check_int_sha256(const struct flash_area *fa, in flash_area_check_int_sha256() argument 44 if (fa == NULL || fac == NULL || fac->match == NULL || in flash_area_check_int_sha256() 49 if (!is_in_flash_area_bounds(fa, fac->off, fac->clen)) { in flash_area_check_int_sha256() 71 rc = flash_read(fa->fa_dev, (fa->fa_off + fac->off + pos), in flash_area_check_int_sha256()
|
D | flash_map_priv.h | 33 static inline bool is_in_flash_area_bounds(const struct flash_area *fa, in is_in_flash_area_bounds() argument 36 return (off >= 0) && ((off + len) <= fa->fa_size); in is_in_flash_area_bounds()
|
/Zephyr-latest/tests/subsys/storage/flash_map/src/ |
D | main.c | 25 const struct flash_area *fa; in ZTEST() local 29 rc = flash_area_open(FIXED_PARTITION_ID(disabled_a), &fa); in ZTEST() 31 rc = flash_area_open(FIXED_PARTITION_ID(disabled_b), &fa); in ZTEST() 80 const struct flash_area *fa; in ZTEST() local 85 fa = FIXED_PARTITION(SLOT1_PARTITION); in ZTEST() 87 zassert_true(flash_area_device_is_ready(fa)); in ZTEST() 92 zassert_equal(fa->fa_dev, flash_dev_a, "Device for slot1_partition do not match"); in ZTEST() 105 const struct flash_area *fa; in ZTEST() local 110 fa = FIXED_PARTITION(SLOT1_PARTITION); in ZTEST() 112 zassert_true(flash_area_device_is_ready(fa)); in ZTEST() [all …]
|
D | main_sha.c | 95 const struct flash_area *fa; in ZTEST() local 100 rc = flash_area_open(SLOT1_PARTITION_ID, &fa); in ZTEST() 102 rc = flash_area_erase(fa, 0, fa->fa_size); in ZTEST() 104 rc = flash_area_write(fa, 0, tst_vec, sizeof(tst_vec)); in ZTEST() 111 rc = flash_area_check_int_sha256(fa, NULL); in ZTEST() 114 rc = flash_area_check_int_sha256(fa, &fac); in ZTEST() 117 rc = flash_area_check_int_sha256(fa, &fac); in ZTEST() 120 rc = flash_area_check_int_sha256(fa, &fac); in ZTEST() 123 rc = flash_area_check_int_sha256(fa, &fac); in ZTEST() 126 rc = flash_area_check_int_sha256(fa, &fac); in ZTEST() [all …]
|
/Zephyr-latest/tests/subsys/dfu/mcuboot/src/ |
D | main.c | 27 const struct flash_area *fa; in ZTEST() local 33 ret = flash_area_open(SLOT1_PARTITION_ID, &fa); in ZTEST() 39 for (offs = 0; offs < fa->fa_size; offs += sizeof(temp)) { in ZTEST() 40 ret = flash_area_read(fa, offs, &temp, sizeof(temp)); in ZTEST() 43 ret = flash_area_write(fa, offs, &temp2, sizeof(temp)); in ZTEST() 51 for (offs = 0; offs < fa->fa_size; offs += sizeof(temp)) { in ZTEST() 52 ret = flash_area_read(fa, offs, &temp, sizeof(temp)); in ZTEST() 60 const struct flash_area *fa; in ZTEST() local 72 ret = flash_area_open(SLOT1_PARTITION_ID, &fa); in ZTEST() 80 ret = flash_area_read(fa, fa->fa_size - sizeof(expectation), in ZTEST() [all …]
|
/Zephyr-latest/tests/subsys/dfu/mcuboot_multi/src/ |
D | main.c | 20 static void erase_image_status_page(const struct flash_area *fa) in erase_image_status_page() argument 26 sf_dev = flash_area_get_device(fa); in erase_image_status_page() 29 ret = flash_get_page_info_by_offs(sf_dev, fa->fa_off + fa->fa_size - 1, in erase_image_status_page() 39 const struct flash_area *fa; in _test_request_upgrade_n() local 51 ret = flash_area_open(fa_id, &fa); in _test_request_upgrade_n() 54 erase_image_status_page(fa); in _test_request_upgrade_n() 60 ret = flash_area_read(fa, fa->fa_size - sizeof(expectation), in _test_request_upgrade_n() 88 const struct flash_area *fa; in _test_write_confirm_n() local 94 ret = flash_area_open(fa_id, &fa); in _test_write_confirm_n() 97 erase_image_status_page(fa); in _test_write_confirm_n() [all …]
|
/Zephyr-latest/subsys/mgmt/mcumgr/grp/img_mgmt/src/ |
D | zephyr_img_mgmt.c | 61 static int img_mgmt_flash_check_empty_inner(const struct flash_area *fa) in img_mgmt_flash_check_empty_inner() argument 72 assert(fa->fa_size % 4 == 0); in img_mgmt_flash_check_empty_inner() 74 erased_val = flash_area_erased_val(fa); in img_mgmt_flash_check_empty_inner() 77 end = fa->fa_size; in img_mgmt_flash_check_empty_inner() 85 rc = flash_area_read(fa, addr, data, bytes_to_read); in img_mgmt_flash_check_empty_inner() 110 const struct flash_area *fa; in img_mgmt_flash_check_empty() local 113 rc = flash_area_open(fa_id, &fa); in img_mgmt_flash_check_empty() 115 rc = img_mgmt_flash_check_empty_inner(fa); in img_mgmt_flash_check_empty() 117 flash_area_close(fa); in img_mgmt_flash_check_empty() 279 const struct flash_area *fa; in img_mgmt_erase_slot() local [all …]
|
D | img_mgmt_state.c | 202 const struct flash_area *fa; in read_directxip_state() local 207 rc = flash_area_open(fa_id, &fa); in read_directxip_state() 211 rc = boot_read_swap_state(fa, &bss); in read_directxip_state() 212 flash_area_close(fa); in read_directxip_state() 546 const struct flash_area *fa; in img_mgmt_set_next_boot_slot_common() local 550 if (flash_area_open(area_id, &fa) != 0) { in img_mgmt_set_next_boot_slot_common() 554 rc = boot_set_next(fa, slot == active_slot, confirm); in img_mgmt_set_next_boot_slot_common() 572 flash_area_close(fa); in img_mgmt_set_next_boot_slot_common()
|
/Zephyr-latest/include/zephyr/storage/ |
D | flash_map.h | 107 int flash_area_check_int_sha256(const struct flash_area *fa, 124 int flash_area_open(uint8_t id, const struct flash_area **fa); 134 void flash_area_close(const struct flash_area *fa); 152 static ALWAYS_INLINE bool flash_area_device_is_ready(const struct flash_area *fa) in flash_area_device_is_ready() argument 154 return (fa != NULL && device_is_ready(fa->fa_dev)); in flash_area_device_is_ready() 171 int flash_area_read(const struct flash_area *fa, off_t off, void *dst, 188 int flash_area_write(const struct flash_area *fa, off_t off, const void *src, 204 int flash_area_erase(const struct flash_area *fa, off_t off, size_t len); 227 int flash_area_flatten(const struct flash_area *fa, off_t off, size_t len); 239 uint32_t flash_area_align(const struct flash_area *fa); [all …]
|
/Zephyr-latest/subsys/dfu/boot/ |
D | mcuboot.c | 101 const struct flash_area *fa; in boot_read_v1_header() local 104 rc = flash_area_open(area_id, &fa); in boot_read_v1_header() 112 rc = flash_area_read(fa, 0, v1_raw, sizeof(*v1_raw)); in boot_read_v1_header() 113 flash_area_close(fa); in boot_read_v1_header() 227 const struct flash_area *fa; in boot_is_img_confirmed() local 230 rc = flash_area_open(ACTIVE_SLOT_FLASH_AREA_ID, &fa); in boot_is_img_confirmed() 235 rc = boot_read_swap_state(fa, &state); in boot_is_img_confirmed() 254 const struct flash_area *fa; in boot_write_img_confirmed() local 257 if (flash_area_open(ACTIVE_SLOT_FLASH_AREA_ID, &fa) != 0) { in boot_write_img_confirmed() 261 rc = boot_set_next(fa, true, true); in boot_write_img_confirmed() [all …]
|
/Zephyr-latest/subsys/lorawan/services/ |
D | frag_flash.c | 31 static const struct flash_area *fa; variable 45 err = flash_area_open(TARGET_IMAGE_AREA, &fa); in frag_flash_init() 52 err = flash_area_erase(fa, 0, fa->fa_size); in frag_flash_init() 66 err = flash_area_write(fa, addr, data, size); in frag_flash_write() 106 return flash_area_read(fa, addr, data, size) == 0 ? 0 : -1; in frag_flash_read() 120 flash_area_write(fa, frag_cache[i].addr, frag_cache[i].data, frag_size); in frag_flash_finish() 123 flash_area_close(fa); in frag_flash_finish()
|
/Zephyr-latest/subsys/mgmt/mcumgr/grp/zephyr_basic/src/ |
D | basic_mgmt.c | 23 const struct flash_area *fa; in storage_erase() local 24 int rc = flash_area_open(ERASE_TARGET_ID, &fa); in storage_erase() 30 if (flash_area_get_device(fa) == NULL) { in storage_erase() 34 rc = flash_area_flatten(fa, 0, fa->fa_size); in storage_erase() 42 flash_area_close(fa); in storage_erase()
|
/Zephyr-latest/doc/ |
D | index.rst | 37 <span class="grid-icon fa fa-map-signs"></span> 44 <span class="grid-icon fa fa-cogs"></span> 51 <span class="grid-icon fa fa-object-group"></span> 58 <span class="grid-icon fa fa-sign-in"></span> 65 <span class="grid-icon fa fa-lock"></span> 72 <span class="grid-icon fa fa-puzzle-piece"></span> 79 <span class="grid-icon fa fa-github"></span>
|
/Zephyr-latest/tests/subsys/dfu/img_util/src/ |
D | main.c | 45 const struct flash_area *fa; in ZTEST() local 58 ret = flash_area_open(SLOT1_PARTITION_ID, &fa); in ZTEST() 66 ret = flash_area_write(fa, i * sizeof(erase_buf), erase_buf, in ZTEST() 72 ret = flash_area_write(fa, fa->fa_size - sizeof(erase_buf), erase_buf, in ZTEST() 95 ret = flash_area_open(SLOT1_PARTITION_ID, &fa); in ZTEST() 103 zassert(flash_area_read(fa, i, &temp, 1) == 0, "pass", "fail"); in ZTEST() 111 ret = flash_area_read(fa, fa->fa_size - sizeof(buf), buf, sizeof(buf)); in ZTEST()
|
/Zephyr-latest/tests/subsys/settings/fcb_init/src/ |
D | settings_test_fcb_init.c | 104 const struct flash_area *fa; in test_prepare_storage() local 110 err = flash_area_open(TEST_PARTITION_ID, &fa); in test_prepare_storage() 113 err = flash_area_flatten(fa, 0, fa->fa_size); in test_prepare_storage() 116 err = flash_area_open(CODE_PARTITION_ID, &fa); in test_prepare_storage() 119 dev = flash_area_get_device(fa); in test_prepare_storage()
|
/Zephyr-latest/tests/subsys/settings/fcb/src/ |
D | settings_test_compress_reset.c | 15 struct flash_sector *fa; in ZTEST() local 61 fa = cf.cf_fcb.f_active.fe_sector; in ZTEST() 66 zassert_true(fa != cf.cf_fcb.f_active.fe_sector, in ZTEST() 87 zassert_true(fa == cf.cf_fcb.f_active.fe_sector, in ZTEST()
|
/Zephyr-latest/tests/subsys/fs/fcb/src/ |
D | main.c | 158 const struct flash_area *fa; in ZTEST() local 163 rc = flash_area_open(TEST_FCB_FLASH_AREA_ID, &fa); in ZTEST() 166 dev = fa->fa_dev; in ZTEST() 167 flash_area_close(fa); in ZTEST()
|
/Zephyr-latest/subsys/usb/device/class/dfu/ |
D | usb_dfu.c | 555 const struct flash_area *fa; in dfu_class_handle_to_host() local 558 &fa); in dfu_class_handle_to_host() 564 ret = flash_area_read(fa, dfu_data.bytes_sent, in dfu_class_handle_to_host() 566 flash_area_close(fa); in dfu_class_handle_to_host() 811 const struct flash_area *fa; in dfu_custom_handle_req() local 828 if (flash_area_open(dfu_data.flash_area_id, &fa)) { in dfu_custom_handle_req() 832 dfu_data.flash_upload_size = fa->fa_size; in dfu_custom_handle_req() 833 flash_area_close(fa); in dfu_custom_handle_req() 907 const struct flash_area *fa; in usb_dfu_init() local 918 if (flash_area_open(dfu_data.flash_area_id, &fa)) { in usb_dfu_init() [all …]
|
/Zephyr-latest/tests/bluetooth/mesh/blob_io_flash/src/ |
D | main.c | 50 const struct flash_area *fa = NULL; in ZTEST() local 68 err = flash_area_open(SLOT1_PARTITION_ID, &fa); in ZTEST() 71 err = flash_area_flatten(fa, 0, ARRAY_SIZE(ctrl_data)); in ZTEST() 74 err = flash_area_write(fa, 0, test_data, ARRAY_SIZE(ctrl_data)); in ZTEST() 77 err = flash_area_read(fa, 0, ctrl_data, ARRAY_SIZE(ctrl_data)); in ZTEST() 85 flash_area_close(fa); in ZTEST()
|
/Zephyr-latest/subsys/fs/fcb/ |
D | fcb.c | 177 struct flash_sector *fa; in fcb_free_sector_cnt() local 179 fa = fcbp->f_active.fe_sector; in fcb_free_sector_cnt() 181 fa = fcb_getnext_sector(fcbp, fa); in fcb_free_sector_cnt() 182 if (fa == fcbp->f_oldest) { in fcb_free_sector_cnt()
|
/Zephyr-latest/tests/subsys/lorawan/frag_decoder/src/ |
D | main.c | 39 static const struct flash_area *fa; variable 115 flash_area_read(fa, i * FRAG_SIZE, buf, num_bytes); in run_test() 160 ret = flash_area_open(TARGET_IMAGE_AREA, &fa); in frag_decoder_setup()
|
/Zephyr-latest/include/zephyr/mgmt/mcumgr/grp/img_mgmt/ |
D | img_mgmt_callbacks.h | 87 const struct flash_area *fa; member
|