diff options
author | Cyril Bur <cyril.bur@au1.ibm.com> | 2015-06-23 13:22:13 +1000 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2015-06-23 13:38:42 +1000 |
commit | 29d1e6f7810982d2c8f057ae35a39c2ac0cf484b (patch) | |
tree | f2b6d5283c05acd56ccf90bd76d9232c076035b5 /libflash/blocklevel.h | |
parent | b7ca08072ec01cc3b89f8babf2856adcd4e3fe77 (diff) | |
download | talos-skiboot-29d1e6f7810982d2c8f057ae35a39c2ac0cf484b.tar.gz talos-skiboot-29d1e6f7810982d2c8f057ae35a39c2ac0cf484b.zip |
libflash/blocklevel: add a smart write function which wraps up eraseing and writing
For consumers who can't do better or who aren't to phased about
performance, having to book keep erasing in order to be able to write data
can be painful. Blocklevel can do it, possibly naively but its a convenience
function
Reviewed-By: Alistair Popple <alistair@popple.id.au>
Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'libflash/blocklevel.h')
-rw-r--r-- | libflash/blocklevel.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libflash/blocklevel.h b/libflash/blocklevel.h index 310e2746..e9a1978d 100644 --- a/libflash/blocklevel.h +++ b/libflash/blocklevel.h @@ -60,6 +60,9 @@ int blocklevel_erase(struct blocklevel_device *bl, uint32_t pos, uint32_t len); int blocklevel_get_info(struct blocklevel_device *bl, const char **name, uint32_t *total_size, uint32_t *erase_granule); +/* Convienience functions */ +int blocklevel_smart_write(struct blocklevel_device *bl, uint32_t pos, const void *buf, uint32_t len); + /* Implemented in software at this level */ int blocklevel_ecc_protect(struct blocklevel_device *bl, uint32_t start, uint32_t len); |