summaryrefslogtreecommitdiffstats
path: root/libflash/blocklevel.h
diff options
context:
space:
mode:
authorCyril Bur <cyril.bur@au1.ibm.com>2015-06-23 13:22:13 +1000
committerStewart Smith <stewart@linux.vnet.ibm.com>2015-06-23 13:38:42 +1000
commit29d1e6f7810982d2c8f057ae35a39c2ac0cf484b (patch)
treef2b6d5283c05acd56ccf90bd76d9232c076035b5 /libflash/blocklevel.h
parentb7ca08072ec01cc3b89f8babf2856adcd4e3fe77 (diff)
downloadtalos-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.h3
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);
OpenPOWER on IntegriCloud