The commit caches write_block_size and erase_value to stream flash
context, at init, to avoid calling Flash API multiple times
to get these values at various stages of code exectuion,
at run-time.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
adds size, offset and divice access macros that are
operating with nodes as an argumet.
Signed-off-by: Mateusz Michalek <mateusz.michalek@nordicsemi.no>
There is no need to make this optional just inform user that
this has to be called to complete write of buffers.
The commit also adds info that there should be no more write
attempts done with use of "flushed", as it may return write
errors anyway.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
Based on information from doc/develop/api/overview.rst, add current
version for some groups representing APIs, following the following
table:
- Experimental: 0.1.0
- Unstable: 0.8.0
- Stable: 1.0.0
Also based on doc/develop/api/overview.rst, add 'since' tag to the
groups.
Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
In Zephyr, this is let to the disk access API user. There is nothing the
driver can do about it.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Change the `src` parameter direction from 'out' to 'in' for the
flash_area_write function, since the src data buffer is the data source
for the flash write and thus an input parameter
Fixes#57996
Signed-off-by: Riccardo Paolo Bestetti <pbl@bestov.io>
Add the labels from the device tree fixed flash partitions
as a column to the flash_map list shell command.
Signed-off-by: Maurits Fassaert <maurits.fassaert@sensorfy.ai>
The field has never been populated and was used by shell
and MCUboot. MCUboot Zephyr code has been changed some
time ago and no longer uses the field, flash_map shell
also no longer uses it, so it can be removed now.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
FLASH_AREA_ macros and usage of label property to identify
fixed-partitions, for purpose of usage with flash map API,
has been deprecated and now FIXED_PARTITION_ macros
should be used with DTS node labels.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
The commit adds FIXED_PARTITION_* macros that take DTS node,
in contrary to FLASH_AREA_* macros that take label property,
to access properties of fixed-partition compatible DTS partition
definitions.
There is FIXED_PARTITION_NODE macro provided for translating
DTS labels to nodes.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
Toward deprecated DT_LABEL() macro, replace the handful of cases
that use DT_LABEL(node) with DT_PROP(node, label).
Signed-off-by: Kumar Gala <galak@kernel.org>
Remove all usage of `device_get_binding` in the subsys by directly
storing the `const struct device*` in the `struct flash_area`.
Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
The commit adds check, to flash_area_open, whether there is any
device driver attached and returns -ENODEV if there isn't any.
This works around a problem where flash_area_open succeeds but
consecutive read/write causes crash.
It is enough to check the condition, and return error, here as
the flash_area_open has to precede, and be checked for success,
any read/write operations.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
In order to bring consistency in-tree, migrate all includes within
include directory to the new prefix <zephyr/...>. Note that the
conversion has been scripted, refer to zephyrproject-rtos#45388 for more
details.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Move include paths and add new target_include_directories to support
backwards compatibility:
* /include -> /include/zephyr
example: <irq.h> -> <zephyr/irq.h>
Issue #41543
Signed-off-by: Yuval Peress <peress@google.com>