1#
2# Copyright (c) 2020 Nordic Semiconductor ASA
3#
4# SPDX-License-Identifier: Apache-2.0
5#
6
7menuconfig STREAM_FLASH
8	bool "Stream to flash"
9	help
10	  Enable support of stream to flash API
11
12if STREAM_FLASH
13
14config STREAM_FLASH_INSPECT
15	bool "Check whether device layout is OK with Stream Flash definition"
16	default y
17	select FLASH_PAGE_LAYOUT
18	help
19	  Runs simple check to find whether provided device can be used for
20	  stream flash by verifying that buffer size will fit into page.
21	  Once correct configuration has been established and tested it is
22	  worth to disable the option to cut out some unneeded code.
23
24config STREAM_FLASH_POST_WRITE_CALLBACK
25	bool "Write complete callback"
26	default y
27	help
28	  Enable callback that will be invoked once data is synchronized from
29	  stream to device. When callback is not used, disabling the option
30	  allows to save some code storage and RAM.
31
32config STREAM_FLASH_ERASE
33	bool "Perform erase operations"
34	depends on FLASH_HAS_EXPLICIT_ERASE
35	help
36	  If disabled an external actor must erase the flash area being written
37	  to.
38	  Option available only if there is at least one device in, a configuration,
39	  that requires erase prior to write.
40
41config STREAM_FLASH_ERASE_ONLY_WHEN_SUPPORTED
42	bool "Check if device supports erase prior to attempting one"
43	depends on STREAM_FLASH_ERASE
44	depends on FLASH_HAS_NO_EXPLICIT_ERASE
45	help
46	  This is used in stream flash code to exclude invocation of erase on devices that do not
47	  have such requirement prior to write nor support rase as a way to increase write speed.
48	  Option is available only if there is a mix of devices, in a configuration, where some
49	  support erase and some do not. If user is sure to not use Stream Flash with devices that
50	  have no support for erase, this option may be disabled to discard small amount of code
51	  from final application.
52
53config STREAM_FLASH_PROGRESS
54	bool "Persistent stream write progress"
55	depends on SETTINGS
56	depends on !SETTINGS_NONE
57	help
58	  Enable API for loading and storing the current write progress to flash
59	  using the settings subsystem. In case of power failure or device
60	  reset, the API can be used to resume writing from the latest state.
61
62module = STREAM_FLASH
63module-str = stream flash
64source "subsys/logging/Kconfig.template.log_config"
65
66endif # STREAM_FLASH
67