14#ifndef ZEPHYR_INCLUDE_STORAGE_FLASH_MAP_H_
15#define ZEPHYR_INCLUDE_STORAGE_FLASH_MAP_H_
64#if CONFIG_FLASH_MAP_LABELS
83#if defined(CONFIG_FLASH_AREA_CHECK_INTEGRITY)
90struct flash_area_check {
107int flash_area_check_int_sha256(
const struct flash_area *fa,
108 const struct flash_area_check *fac);
272#if CONFIG_FLASH_MAP_LABELS
280const char *flash_area_label(
const struct flash_area *fa);
302#define FIXED_PARTITION_EXISTS(label) DT_FIXED_PARTITION_EXISTS(DT_NODELABEL(label))
311#define FIXED_PARTITION_ID(label) DT_FIXED_PARTITION_ID(DT_NODELABEL(label))
320#define FIXED_PARTITION_OFFSET(label) DT_REG_ADDR(DT_NODELABEL(label))
329#define FIXED_PARTITION_NODE_OFFSET(node) DT_REG_ADDR(node)
338#define FIXED_PARTITION_SIZE(label) DT_REG_SIZE(DT_NODELABEL(label))
347#define FIXED_PARTITION_NODE_SIZE(node) DT_REG_SIZE(node)
356#define FLASH_AREA_DEVICE(label) \
357 DEVICE_DT_GET(DT_MTD_FROM_FIXED_PARTITION(DT_NODE_BY_FIXED_PARTITION_LABEL(label)))
366#define FIXED_PARTITION_DEVICE(label) \
367 DEVICE_DT_GET(DT_MTD_FROM_FIXED_PARTITION(DT_NODELABEL(label)))
376#define FIXED_PARTITION_NODE_DEVICE(node) \
377 DEVICE_DT_GET(DT_MTD_FROM_FIXED_PARTITION(node))
irp nz macro MOVR cc s mov cc s endm endr irp aw macro LDR aa off
Definition asm-macro-32-bit-gnu.h:17
uint32_t flash_area_align(const struct flash_area *fa)
Get write block size of the flash area.
uint8_t flash_area_erased_val(const struct flash_area *fa)
Get the value expected to be read when accessing any erased flash byte.
void flash_area_foreach(flash_area_cb_t user_cb, void *user_data)
Iterate over flash map.
int flash_area_has_driver(const struct flash_area *fa)
Check whether given flash area has supporting flash driver in the system.
int flash_area_get_sectors(int fa_id, uint32_t *count, struct flash_sector *sectors)
Retrieve info about sectors within the area.
int flash_area_open(uint8_t id, const struct flash_area **fa)
Retrieve partitions flash area from the flash_map.
int flash_area_read(const struct flash_area *fa, off_t off, void *dst, size_t len)
Read flash area data.
int flash_area_write(const struct flash_area *fa, off_t off, const void *src, size_t len)
Write data to flash area.
void(* flash_area_cb_t)(const struct flash_area *fa, void *user_data)
Flash map iteration callback.
Definition flash_map.h:242
int flash_area_erase(const struct flash_area *fa, off_t off, size_t len)
Erase flash area.
const struct device * flash_area_get_device(const struct flash_area *fa)
Get driver for given flash area.
int flash_area_flatten(const struct flash_area *fa, off_t off, size_t len)
Erase flash area or fill with erase-value.
void flash_area_close(const struct flash_area *fa)
Close flash_area.
__INTPTR_TYPE__ off_t
Definition types.h:36
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
__UINT16_TYPE__ uint16_t
Definition stdint.h:89
Runtime device structure (in ROM) per driver instance.
Definition device.h:412
Flash partition.
Definition flash_map.h:54
off_t fa_off
Start offset from the beginning of the flash device.
Definition flash_map.h:59
size_t fa_size
Total size.
Definition flash_map.h:61
const struct device * fa_dev
Backing flash device.
Definition flash_map.h:63
uint8_t fa_id
ID number.
Definition flash_map.h:56
uint16_t pad16
Definition flash_map.h:57
Structure for transfer flash sector boundaries.
Definition flash_map.h:76
off_t fs_off
Sector offset from the beginning of the flash device.
Definition flash_map.h:78
size_t fs_size
Sector size in bytes.
Definition flash_map.h:80