summaryrefslogtreecommitdiff
path: root/firmware/target/mips/ingenic_x1000/nand-x1000-err.h
diff options
context:
space:
mode:
authoramachronic <amachronic@protonmail.com>2021-04-06 01:10:01 +0100
committeramachronic <amachronic@protonmail.com>2021-04-06 17:27:12 +0100
commit28c89386af8ea9d002bcc25483233053fe0e7525 (patch)
treeac25a1cbf09d7bc2dadea89002943c722fbd8806 /firmware/target/mips/ingenic_x1000/nand-x1000-err.h
parentb5558c1cf968f0fcff072456408b14f130f29ce3 (diff)
downloadrockbox-28c89386af8ea9d002bcc25483233053fe0e7525.tar.gz
rockbox-28c89386af8ea9d002bcc25483233053fe0e7525.zip
x1000: Improve NAND driver API
- Proper error codes are now returned from all functions. These codes will be used by a host-side flash tool for error reporting. - nand_erase_block() was replaced by nand_erase_bytes(). The caller can't know how big an eraseblock is with the current API, so next best thing is to verify the correct alignment inside the call and reject the erase if it isn't properly aligned. - Fixed typo in nandcmd_block_erase() which would cause an SFC error to be interpreted as success. Yikes. Change-Id: Id4ac9b44fa7fc2fcb81ff19ba730df78457c0383
Diffstat (limited to 'firmware/target/mips/ingenic_x1000/nand-x1000-err.h')
-rw-r--r--firmware/target/mips/ingenic_x1000/nand-x1000-err.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/firmware/target/mips/ingenic_x1000/nand-x1000-err.h b/firmware/target/mips/ingenic_x1000/nand-x1000-err.h
new file mode 100644
index 0000000000..252d591062
--- /dev/null
+++ b/firmware/target/mips/ingenic_x1000/nand-x1000-err.h
@@ -0,0 +1,18 @@
1#ifndef __NAND_X1000_ERR_H__
2#define __NAND_X1000_ERR_H__
3
4/* Error codes which can be returned by the nand-x1000 API. These codes are
5 * also used by host-side tools, so we define them here to avoid polluting
6 * the namespace with useless X1000 APIs. */
7#define NANDERR_CHIP_UNSUPPORTED (-1)
8#define NANDERR_WRITE_PROTECTED (-2)
9#define NANDERR_UNALIGNED_ADDRESS (-3)
10#define NANDERR_UNALIGNED_LENGTH (-4)
11#define NANDERR_READ_FAILED (-5)
12#define NANDERR_ECC_FAILED (-6)
13#define NANDERR_ERASE_FAILED (-7)
14#define NANDERR_PROGRAM_FAILED (-8)
15#define NANDERR_COMMAND_FAILED (-9)
16#define NANDERR_OTHER (-99)
17
18#endif /* __NAND_X1000_ERR_H__ */