#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <zephyr/device.h>
#include <zephyr/drivers/flash.h>
#include <zephyr/devicetree.h>
Go to the source code of this file.
|
uint32_t | tt_boot_fs_next (uint32_t prev) |
int | tt_boot_fs_mount (tt_boot_fs *tt_boot_fs, tt_boot_fs_read hal_read, tt_boot_fs_write hal_write, tt_boot_fs_erase hal_erase) |
int | tt_boot_fs_add_file (const tt_boot_fs *tt_boot_fs, tt_boot_fs_fd fd_data, const uint8_t *image_data_src, bool isFailoverEntry, bool isSecurityBinaryEntry) |
uint32_t | tt_boot_fs_cksum (uint32_t cksum, const uint8_t *data, size_t size) |
int | tt_boot_fs_get_file (const tt_boot_fs *tt_boot_fs, const uint8_t *tag, uint8_t *buf, size_t buf_size, size_t *file_size) |
int | tt_boot_fs_ls (const struct device *dev, tt_boot_fs_fd *fds, size_t nfds, size_t offset) |
| List file descriptors in boot filesystem.
|
int | tt_boot_fs_find_fd_by_tag (const struct device *flash_dev, const uint8_t *tag, tt_boot_fs_fd *fd) |
| Find a boot filesystem file descriptor by name on a given flash device.
|
◆ TT_BOOT_FS_FAILOVER_HEAD_ADDR
#define TT_BOOT_FS_FAILOVER_HEAD_ADDR (0x4000) |
◆ TT_BOOT_FS_FD_HEAD_ADDR
#define TT_BOOT_FS_FD_HEAD_ADDR (0x0) |
◆ TT_BOOT_FS_IMAGE_TAG_SIZE
#define TT_BOOT_FS_IMAGE_TAG_SIZE 8 |
◆ TT_BOOT_FS_SECURITY_BINARY_FD_ADDR
#define TT_BOOT_FS_SECURITY_BINARY_FD_ADDR (0x3FE0) |
◆ tt_boot_fs_erase
◆ tt_boot_fs_read
◆ tt_boot_fs_write
◆ anonymous enum
Enumerator |
---|
TT_BOOT_FS_OK | 0 | |
TT_BOOT_FS_ERR | -1 | |
◆ tt_checksum_res_t
Enumerator |
---|
TT_BOOT_FS_CHK_OK | |
TT_BOOT_FS_CHK_FAIL | |
◆ tt_boot_fs_add_file()
◆ tt_boot_fs_cksum()
◆ tt_boot_fs_find_fd_by_tag()
Find a boot filesystem file descriptor by name on a given flash device.
If fd
is NULL, then a return value of 0 indicates that a file named name
exists in the boot filesystem residing on flash_dev
.
If fd
is non-NULL, then file descriptor contents are written to the memory pointed to by it. The output file descriptor includes useful information about the file, like
- the address of the file in
flash_dev
,
- the size of the file, and
- the checksum of the file, and more.
- Parameters
-
| flash_dev | flash device containing the boot filesystem |
| tag | name of the image to search for |
[out] | fd | optional pointer to memory where the file descriptor will be written, if found |
- Return values
-
0 | on success |
-EIO | if an I/O error occurs |
-ENXIO | if flash_dev does not contain a boot filesystem |
-ENOENT | if no file was found matching the specified tag |
◆ tt_boot_fs_get_file()
◆ tt_boot_fs_ls()
List file descriptors in boot filesystem.
Read up to nfds
file descriptors from a boot filesystem on flash device flash_dev
starting from index offset
. If reading from flash_dev
causes an error, then this function will return -EIO. If flash_dev
does not contain a valid boot fs, this function returns -ENXIO. On success, the number of file descriptors is returned.
This function may also be used to count the number of files that exist on a boot filesystem if fds
is NULL. In that case, the nfds and offset parameters are ignored.
- Parameters
-
dev | Flash device containing the boot filesystem |
fds | Output array to store file descriptors, or NULL to count files |
nfds | Maximum number of file descriptors to read |
offset | File index from which to begin reading file descriptors |
- Returns
- the number of file descriptors successfully read or a negative error code on failure.
◆ tt_boot_fs_mount()
◆ tt_boot_fs_next()
◆ boot_fs_data