rockbox/firmware/target/mips/ingenic_x1000/nand-x1000-err.h
amachronic 28c89386af 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
2021-04-06 17:27:12 +01:00

18 lines
681 B
C

#ifndef __NAND_X1000_ERR_H__
#define __NAND_X1000_ERR_H__
/* Error codes which can be returned by the nand-x1000 API. These codes are
* also used by host-side tools, so we define them here to avoid polluting
* the namespace with useless X1000 APIs. */
#define NANDERR_CHIP_UNSUPPORTED (-1)
#define NANDERR_WRITE_PROTECTED (-2)
#define NANDERR_UNALIGNED_ADDRESS (-3)
#define NANDERR_UNALIGNED_LENGTH (-4)
#define NANDERR_READ_FAILED (-5)
#define NANDERR_ECC_FAILED (-6)
#define NANDERR_ERASE_FAILED (-7)
#define NANDERR_PROGRAM_FAILED (-8)
#define NANDERR_COMMAND_FAILED (-9)
#define NANDERR_OTHER (-99)
#endif /* __NAND_X1000_ERR_H__ */