diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2019-08-28 11:08:38 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2019-08-28 12:06:10 +0200 |
commit | c74930f7bd2189a4f2ebcd05c9803307a9e6652f (patch) | |
tree | 17cb928c2967001ab1887000ae3a6ded3c539e19 /include | |
parent | 81937bf0c5c586436c3a6af9df9c4ad5357acb79 (diff) | |
download | barebox-c74930f7bd2189a4f2ebcd05c9803307a9e6652f.tar.gz barebox-c74930f7bd2189a4f2ebcd05c9803307a9e6652f.tar.xz |
mtd: peb: Add function to write file
This adds a function to the mtd peb API to write a file spanning
multiple blocks to a mtd device. Bad blocks are automatically skipped
and before anything is done we check if the image will fit into the
remaining space (honouring bad blocks).
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/mtd/mtd-peb.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/mtd/mtd-peb.h b/include/mtd/mtd-peb.h index 23f89d89a8..311f25c3df 100644 --- a/include/mtd/mtd-peb.h +++ b/include/mtd/mtd-peb.h @@ -21,5 +21,7 @@ int mtd_num_pebs(struct mtd_info *mtd); int mtd_peb_create_bitflips(struct mtd_info *mtd, int pnum, int offset, int len, int num_bitflips, int random, int info); +int mtd_peb_write_file(struct mtd_info *mtd, int peb_start, int max_pebs, + const void *buf, size_t len); #endif /* __LINUX_MTD_MTDPEB_H */ |