aboutsummaryrefslogtreecommitdiff
path: root/libflash/libflash.h
diff options
context:
space:
mode:
authorCyril Bur <cyril.bur@au1.ibm.com>2015-06-23 13:22:09 +1000
committerStewart Smith <stewart@linux.vnet.ibm.com>2015-06-23 13:38:42 +1000
commit199be6b84faeff7ef03032c857766d4a023fbbb4 (patch)
tree8d03612cfd543eb37bdb8419812314525e1c7c1d /libflash/libflash.h
parent69b152cab30aae6188b590b2df9a6f55932c4408 (diff)
downloadskiboot-199be6b84faeff7ef03032c857766d4a023fbbb4.zip
skiboot-199be6b84faeff7ef03032c857766d4a023fbbb4.tar.gz
skiboot-199be6b84faeff7ef03032c857766d4a023fbbb4.tar.bz2
libflash/blocklevel: Extend the block level to be able to do ecc
At the moment ECC reads and writes are still being handled by the low level core of libflash. ECC should be none of libflashes concern, it is primarily a hardware access backend. It makes sense for blocklevel to take care of ECC but currently it has no way of knowing. With some simple modifications (which are rudimentary at the moment and will need a performance improvement) blocklevel can handle ECC, and with a little more effort this can be extended to provide read and write protection in blocklevel. 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/libflash.h')
-rw-r--r--libflash/libflash.h31
1 files changed, 8 insertions, 23 deletions
diff --git a/libflash/libflash.h b/libflash/libflash.h
index 30f984d..f3973ab 100644
--- a/libflash/libflash.h
+++ b/libflash/libflash.h
@@ -20,6 +20,14 @@
#include <stdbool.h>
#include <libflash/blocklevel.h>
+/* API status/return:
+ *
+ * <0 = flash controller errors passed through,
+ * 0 = success
+ * >0 = libflash error
+ */
+#include <libflash/errors.h>
+
#ifdef __SKIBOOT__
#include <skiboot.h>
#define FL_INF(fmt...) do { prlog(PR_INFO, fmt); } while(0)
@@ -33,29 +41,6 @@ extern bool libflash_debug;
#define FL_ERR(fmt...) do { printf(fmt); } while(0)
#endif
-/* API status/return:
- *
- * <0 = flash controller errors passed through,
- * 0 = success
- * >0 = libflash error
- */
-
-#define FLASH_ERR_MALLOC_FAILED 1
-#define FLASH_ERR_CHIP_UNKNOWN 2
-#define FLASH_ERR_PARM_ERROR 3
-#define FLASH_ERR_ERASE_BOUNDARY 4
-#define FLASH_ERR_WREN_TIMEOUT 5
-#define FLASH_ERR_WIP_TIMEOUT 6
-#define FLASH_ERR_BAD_PAGE_SIZE 7
-#define FLASH_ERR_VERIFY_FAILURE 8
-#define FLASH_ERR_4B_NOT_SUPPORTED 9
-#define FLASH_ERR_CTRL_CONFIG_MISMATCH 10
-#define FLASH_ERR_CHIP_ER_NOT_SUPPORTED 11
-#define FLASH_ERR_CTRL_CMD_UNSUPPORTED 12
-#define FLASH_ERR_CTRL_TIMEOUT 13
-#define FLASH_ERR_ECC_INVALID 14
-#define FLASH_ERR_BAD_READ 15
-
/* Flash chip, opaque */
struct flash_chip;
struct spi_flash_ctrl;