/Zephyr-latest/tests/drivers/flash/negative_tests/src/ |
D | main.c | 49 static const struct device *const flash_dev = TEST_AREA_DEVICE; variable 57 zassert_true(device_is_ready(flash_dev)); in flash_driver_setup() 59 TC_PRINT("Test will run on device %s\n", flash_dev->name); in flash_driver_setup() 65 rc = flash_get_page_info_by_offs(flash_dev, TEST_AREA_OFFSET, &page_info); in flash_driver_setup() 92 rc = flash_erase(flash_dev, (TEST_FLASH_START - page_info.size), page_info.size); in ZTEST() 96 rc = flash_erase(flash_dev, (TEST_FLASH_START + TEST_FLASH_SIZE), page_info.size); in ZTEST() 100 rc = flash_erase(flash_dev, (TEST_AREA_OFFSET + 1), (TEST_FLASH_SIZE + 1)); in ZTEST() 104 rc = flash_erase(flash_dev, TEST_AREA_OFFSET, 0); in ZTEST() 125 rc = flash_fill(flash_dev, fill_val, (TEST_FLASH_START - page_info.size), page_info.size); in ZTEST() 129 rc = flash_fill(flash_dev, fill_val, (TEST_FLASH_START + TEST_FLASH_SIZE), page_info.size); in ZTEST() [all …]
|
/Zephyr-latest/tests/drivers/flash_simulator/flash_sim_impl/src/ |
D | main.c | 40 static const struct device *const flash_dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_flash_controller)); variable 42 static const struct device *const flash_dev = DEVICE_DT_GET(DT_NODELABEL(sim_flash_controller)); variable 71 rc = flash_read(flash_dev, start + off, &r_val32, in test_check_pattern32() 99 rc = flash_read(flash_dev, offset + i, in test_check_erase() 123 zassert_true(device_is_ready(flash_dev), in test_init() 132 rc = flash_erase(flash_dev, FLASH_SIMULATOR_BASE_OFFSET, in ZTEST() 137 rc = flash_read(flash_dev, FLASH_SIMULATOR_BASE_OFFSET, in ZTEST() 155 rc = flash_erase(flash_dev, FLASH_SIMULATOR_BASE_OFFSET, in test_write_read() 161 rc = flash_write(flash_dev, FLASH_SIMULATOR_BASE_OFFSET + in test_write_read() 173 rc = flash_read(flash_dev, FLASH_SIMULATOR_BASE_OFFSET + in test_write_read() [all …]
|
/Zephyr-latest/samples/drivers/spi_flash_at45/src/ |
D | main.c | 30 const struct device *const flash_dev = DEVICE_DT_GET_ONE(atmel_at45); in main() local 39 if (!device_is_ready(flash_dev)) { in main() 40 printk("%s: device not ready.\n", flash_dev->name); in main() 45 page_count = flash_get_page_count(flash_dev); in main() 46 (void)flash_get_page_info_by_idx(flash_dev, 0, &pages_info); in main() 49 flash_dev->name, chip_size, pages_info.size); in main() 53 err = flash_read(flash_dev, TEST_REGION_OFFSET, &data, 1); in main() 71 err = flash_erase(flash_dev, 0, chip_size); in main() 77 err = flash_erase(flash_dev, in main() 89 err = flash_read(flash_dev, TEST_REGION_OFFSET, in main() [all …]
|
/Zephyr-latest/samples/drivers/mspi/mspi_flash/src/ |
D | main.c | 20 int single_sector_test(const struct device *flash_dev) in single_sector_test() argument 38 rc = flash_erase(flash_dev, SPI_FLASH_TEST_REGION_OFFSET, in single_sector_test() 49 rc = flash_write(flash_dev, SPI_FLASH_TEST_REGION_OFFSET, expected, len); in single_sector_test() 56 rc = flash_read(flash_dev, SPI_FLASH_TEST_REGION_OFFSET, buf, len); in single_sector_test() 82 int multi_sector_test(const struct device *flash_dev) in multi_sector_test() argument 102 rc = flash_erase(flash_dev, SPI_FLASH_TEST_REGION_OFFSET, SPI_FLASH_SECTOR_SIZE * 2); in multi_sector_test() 111 rc = flash_read(flash_dev, offs, buf, len); in multi_sector_test() 132 rc = flash_write(flash_dev, offs, expected, len); in multi_sector_test() 139 rc = flash_read(flash_dev, offs, buf, len); in multi_sector_test() 169 const struct device *flash_dev = DEVICE_DT_GET(DT_ALIAS(flash0)); in main() local [all …]
|
/Zephyr-latest/tests/drivers/flash/common/src/ |
D | main.c | 52 static const struct device *const flash_dev = TEST_AREA_DEVICE; variable 64 TC_PRINT("Test will run on device %s\n", flash_dev->name); in flash_driver_before() 65 zassert_true(device_is_ready(flash_dev)); in flash_driver_before() 69 const struct flash_parameters *fparams = flash_get_parameters(flash_dev); in flash_driver_before() 74 flash_get_page_info_by_offs(flash_dev, TEST_AREA_OFFSET, in flash_driver_before() 87 rc = flash_read(flash_dev, TEST_AREA_OFFSET, in flash_driver_before() 117 rc = flash_erase(flash_dev, page_info.start_offset, in flash_driver_before() 137 rc = flash_erase(flash_dev, page_info.start_offset, in ZTEST() 147 rc = flash_write(flash_dev, in ZTEST() 162 rc = flash_read(flash_dev, in ZTEST() [all …]
|
/Zephyr-latest/tests/boards/altera_max10/qspi/src/ |
D | qspi_flash.c | 19 const struct device *flash_dev; in ZTEST() local 24 flash_dev = DEVICE_DT_GET(DT_NODELABEL(n25q512ax3)); in ZTEST() 25 zassert_true(!device_is_ready(flash_dev), TC_PASS, "Flash device is not ready!"); in ZTEST() 33 zassert_equal(flash_erase(flash_dev, in ZTEST() 36 zassert_equal(flash_read(flash_dev, offset, in ZTEST() 49 zassert_equal(flash_write(flash_dev, offset, in ZTEST() 52 zassert_equal(flash_read(flash_dev, offset, in ZTEST() 62 zassert_equal(flash_write(flash_dev, offset + sizeof(wr_val), in ZTEST() 65 zassert_equal(flash_read(flash_dev, offset + sizeof(wr_val) + 1, in ZTEST()
|
/Zephyr-latest/samples/drivers/spi_flash/src/ |
D | main.c | 51 void single_sector_test(const struct device *flash_dev) in single_sector_test() argument 69 rc = flash_erase(flash_dev, SPI_FLASH_TEST_REGION_OFFSET, in single_sector_test() 76 rc = flash_read(flash_dev, SPI_FLASH_TEST_REGION_OFFSET, buf, len); in single_sector_test() 91 rc = flash_write(flash_dev, SPI_FLASH_TEST_REGION_OFFSET, expected, len); in single_sector_test() 98 rc = flash_read(flash_dev, SPI_FLASH_TEST_REGION_OFFSET, buf, len); in single_sector_test() 123 void multi_sector_test(const struct device *flash_dev) in multi_sector_test() argument 143 rc = flash_erase(flash_dev, SPI_FLASH_TEST_REGION_OFFSET, SPI_FLASH_SECTOR_SIZE * 2); in multi_sector_test() 152 rc = flash_read(flash_dev, offs, buf, len); in multi_sector_test() 173 rc = flash_write(flash_dev, offs, expected, len); in multi_sector_test() 180 rc = flash_read(flash_dev, offs, buf, len); in multi_sector_test() [all …]
|
/Zephyr-latest/samples/drivers/soc_flash_nrf/src/ |
D | main.c | 68 const struct device *flash_dev = TEST_PARTITION_DEVICE; in main() local 81 memcpy(&flash_params, flash_get_parameters(flash_dev), sizeof(flash_params)); in main() 86 if (!device_is_ready(flash_dev)) { in main() 92 erase_when_needed(flash_dev, in main() 101 if (flash_write(flash_dev, offset, &buf_array_1[i], in main() 107 if (flash_read(flash_dev, offset, &buf_word, in main() 122 erase_when_needed(flash_dev, in main() 130 if (flash_write(flash_dev, offset, &buf_array_2[i], in main() 136 if (flash_read(flash_dev, offset, &buf_word, in main() 150 erase_when_needed(flash_dev, in main() [all …]
|
/Zephyr-latest/tests/drivers/flash/stm32/src/ |
D | main.c | 23 static const struct device *const flash_dev = TEST_AREA_DEVICE; variable 61 zassert_true(device_is_ready(flash_dev)); in flash_stm32_setup() 64 flash_params = flash_get_parameters(flash_dev); in flash_stm32_setup() 66 rc = sector_mask_from_offset(flash_dev, TEST_AREA_OFFSET, EXPECTED_SIZE, in flash_stm32_setup() 74 rc = flash_ex_op(flash_dev, FLASH_STM32_EX_OP_SECTOR_WP, in flash_stm32_setup() 86 rc = flash_ex_op(flash_dev, FLASH_STM32_EX_OP_SECTOR_WP, in flash_stm32_setup() 92 rc = flash_read(flash_dev, TEST_AREA_OFFSET, buf, EXPECTED_SIZE); in flash_stm32_setup() 105 rc = flash_erase(flash_dev, TEST_AREA_OFFSET, EXPECTED_SIZE); in flash_stm32_setup() 129 rc = flash_ex_op(flash_dev, FLASH_STM32_EX_OP_SECTOR_WP, in ZTEST() 134 rc = flash_write(flash_dev, TEST_AREA_OFFSET, expected, EXPECTED_SIZE); in ZTEST() [all …]
|
/Zephyr-latest/drivers/flash/ |
D | flash_shell.c | 48 char **argv[], const struct device * *flash_dev, in parse_helper() 57 *flash_dev = shell_device_get_binding((*argv)[1]); in parse_helper() 58 if (!*flash_dev) { in parse_helper() 68 *flash_dev = zephyr_flash_controller; in parse_helper() 93 const struct device *flash_dev; in cmd_erase() local 97 result = parse_helper(sh, &argc, &argv, &flash_dev, &page_addr); in cmd_erase() 106 result = flash_get_page_info_by_offs(flash_dev, page_addr, in cmd_erase() 118 result = flash_erase(flash_dev, page_addr, size); in cmd_erase() 134 const struct device *flash_dev; in cmd_write() local 139 ret = parse_helper(sh, &argc, &argv, &flash_dev, &w_addr); in cmd_write() [all …]
|
/Zephyr-latest/tests/drivers/flash_simulator/flash_sim_reboot/src/ |
D | main.c | 18 static const struct device *const flash_dev = DEVICE_DT_GET(DT_NODELABEL(sim_flash_controller)); variable 28 rc = flash_erase(flash_dev, 0, FLASH_SIMULATOR_FLASH_SIZE); in ZTEST() 31 rc = flash_write(flash_dev, 0, &word, sizeof(word)); in ZTEST() 39 rc = flash_read(flash_dev, 0, &word, sizeof(word)); in ZTEST() 49 zassert_true(device_is_ready(flash_dev), "Simulated flash device not ready"); in flash_sim_setup()
|
/Zephyr-latest/tests/subsys/bindesc/reading/src/ |
D | main.c | 18 static const struct device *const flash_dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_flash_controller)); variable 20 static const struct device *const flash_dev = DEVICE_DT_GET(DT_NODELABEL(sim_flash_controller)); variable 43 flash_erase(flash_dev, 0, FLASH_SIMULATOR_ERASE_UNIT); in test_setup() 44 flash_write(flash_dev, 0, descriptors, sizeof(descriptors)); in test_setup() 70 bindesc_open_flash(&handle, 0, flash_dev); in ZTEST()
|
/Zephyr-latest/drivers/fpga/ |
D | fpga_mpfs.c | 82 static uint8_t update_spi_flash_directory(const struct device *flash_dev) in update_spi_flash_directory() argument 90 rc = flash_read(flash_dev, SPI_FLASH_DIRECTORY_OFFSET, buf, len); in update_spi_flash_directory() 104 rc = flash_erase(flash_dev, SPI_FLASH_DIRECTORY_OFFSET, SPI_FLASH_SECTOR_SIZE); in update_spi_flash_directory() 110 rc = flash_write(flash_dev, SPI_FLASH_DIRECTORY_OFFSET, buf, len); in update_spi_flash_directory() 120 rc = flash_write(flash_dev, (SPI_FLASH_DIRECTORY_OFFSET + k * 0x100), buf, len); in update_spi_flash_directory() 136 static uint8_t program_new_image(const struct device *flash_dev, uint8_t *image_start, in program_new_image() argument 159 flash_dev, in program_new_image() 187 rc = flash_write(flash_dev, (SPI_FLASH_NEW_IMAGE_OFFSET + i * SPI_FLASH_PAGE_SIZE), in program_new_image() 311 const struct device *flash_dev = DEVICE_DT_GET_OR_NULL(DT_ALIAS(bitstream_flash)); in mpfs_fpga_load() local 313 if (flash_dev == NULL) { in mpfs_fpga_load() [all …]
|
/Zephyr-latest/tests/drivers/mspi/flash/src/ |
D | main.c | 73 static int test_multi_sector_rw(const struct device *flash_dev) in test_multi_sector_rw() argument 82 TC_PRINT("Perform test on multiple consequtive sectors on %s\n", flash_dev->name); in test_multi_sector_rw() 86 const struct flash_driver_api *api = flash_dev->api; in test_multi_sector_rw() 88 api->page_layout(flash_dev, &layout, &layout_size); in test_multi_sector_rw() 115 rc = flash_erase(flash_dev, MSPI_FLASH_TEST_REGION_OFFSET, MSPI_FLASH_SECTOR_SIZE * 2); in test_multi_sector_rw() 125 rc = flash_read(flash_dev, offs, actual, MSPI_FLASH_TEST_SIZE); in test_multi_sector_rw() 145 rc = flash_write(flash_dev, offs, expected, MSPI_FLASH_TEST_SIZE); in test_multi_sector_rw() 152 rc = flash_read(flash_dev, offs, actual, MSPI_FLASH_TEST_SIZE); in test_multi_sector_rw()
|
/Zephyr-latest/tests/boards/espressif/cache_coex/src/ |
D | cache_coex.c | 29 static const struct device *const flash_dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_flash_controller)); variable 82 rc = flash_erase(flash_dev, offset, size); in do_erase() 95 rc = flash_get_page_info_by_idx(flash_dev, FLASH_PAGE_TESTED, &page_info); in page_erase() 110 int rc = flash_get_page_info_by_idx(flash_dev, FLASH_PAGE_TESTED, &page_info); in page_read() 116 rc = flash_read(flash_dev, in page_read() 130 int rc = flash_get_page_info_by_idx(flash_dev, FLASH_PAGE_TESTED, &page_info); in page_write() 137 rc = flash_write(flash_dev, in page_write() 245 if (!device_is_ready(flash_dev)) { in flash_init()
|
/Zephyr-latest/tests/subsys/storage/flash_map/src/ |
D | main.c | 55 static void layout_match(const struct device *flash_dev, uint32_t sec_cnt) in layout_match() argument 65 flash_get_page_info_by_offs(flash_dev, SLOT1_PARTITION_OFFSET + off, &fpi)); in layout_match() 163 const struct device *flash_dev; in ZTEST() local 168 flash_dev = flash_area_get_device(fa); in ZTEST() 170 rc = flash_erase(flash_dev, fa->fa_off, fa->fa_size); in ZTEST() 173 rc = flash_fill(flash_dev, 0xaa, fa->fa_off, fa->fa_size); in ZTEST() 190 rc = flash_read(flash_dev, fa->fa_off + i, buf, chunk); in ZTEST() 202 rc = flash_fill(flash_dev, 0xaa, fa->fa_off, fa->fa_size); in ZTEST() 213 rc = flash_read(flash_dev, fa->fa_off + i, buf, chunk); in ZTEST()
|
/Zephyr-latest/tests/subsys/shell/shell_flash/src/ |
D | shell_flash_test.c | 38 const struct device *const flash_dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_flash_controller)); in ZTEST() local 51 zassert_true(device_is_ready(flash_dev), in ZTEST() 54 ret = flash_write(flash_dev, test_base, data, test_size); in ZTEST()
|
/Zephyr-latest/samples/arch/mpu/mpu_test/src/ |
D | main.c | 34 static const struct device *const flash_dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_flash_controller)); variable 66 if (flash_write(flash_dev, offset, value, in cmd_write_mcux() 87 if (flash_write(flash_dev, offset, &value, sizeof(value)) != 0) { in cmd_write_stm32() 146 if (!device_is_ready(flash_dev)) { in main()
|
/Zephyr-latest/subsys/storage/flash_map/ |
D | flash_map_layout.c | 97 const struct device *flash_dev; in flash_area_sectors() local 107 flash_dev = fa->fa_dev; in flash_area_sectors() 109 flash_page_foreach(flash_dev, get_sectors_cb, &data); in flash_area_sectors()
|
/Zephyr-latest/subsys/bluetooth/mesh/ |
D | blob_io_flash.c | 72 const struct device *flash_dev; in block_start() local 75 flash_dev = flash_area_get_device(flash->area); in block_start() 76 if (!flash_dev) { in block_start() 80 err = flash_get_page_info_by_offs(flash_dev, in block_start()
|
/Zephyr-latest/subsys/dfu/img_util/ |
D | flash_img.c | 133 const struct device *flash_dev; in flash_img_init_id() local 141 flash_dev = flash_area_get_device(ctx->flash_area); in flash_img_init_id() 143 return stream_flash_init(&ctx->stream, flash_dev, ctx->buf, in flash_img_init_id()
|
/Zephyr-latest/subsys/settings/include/settings/ |
D | settings_nvs.h | 40 const struct device *flash_dev; member
|
/Zephyr-latest/drivers/eeprom/ |
D | eeprom_emulator.c | 87 const struct device *flash_dev; member 114 return flash_read(dev_config->flash_dev, dev_config->flash_offset + in eeprom_emu_flash_read() 127 rc = flash_write(dev_config->flash_dev, dev_config->flash_offset + in eeprom_emu_flash_write() 142 rc = flash_erase(dev_config->flash_dev, dev_config->flash_offset + in eeprom_emu_flash_erase() 547 if (!device_is_ready(dev_config->flash_dev)) { in eeprom_emu_read() 603 if (!device_is_ready(dev_config->flash_dev)) { in eeprom_emu_write() 648 if (!device_is_ready(dev_config->flash_dev)) { in eeprom_emu_init() 799 .flash_dev = PART_DEV(EEPROM_PARTITION(n)),\
|
/Zephyr-latest/subsys/debug/coredump/ |
D | coredump_backend_flash_partition.c | 410 const struct device *flash_dev; in coredump_flash_backend_start() local 425 flash_dev = flash_area_get_device(backend_ctx.flash_area); in coredump_flash_backend_start() 435 ret = stream_flash_init(&backend_ctx.stream_ctx, flash_dev, in coredump_flash_backend_start()
|
/Zephyr-latest/subsys/settings/src/ |
D | settings_nvs.c | 363 cf->cf_nvs.flash_device = cf->flash_dev; in settings_nvs_backend_init() 425 default_settings_nvs.flash_dev = fa->fa_dev; in settings_backend_init()
|