--- zzzz-none-000/linux-3.10.107/include/linux/mtd/nand.h 2017-06-27 09:49:32.000000000 +0000 +++ vr9-7490-729/linux-3.10.107/include/linux/mtd/nand.h 2021-11-10 11:53:56.000000000 +0000 @@ -48,6 +48,11 @@ /* unlocks specified locked blocks */ extern int nand_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len); +/* AVM/TKL: swap red/write/read_oob/write_oob against versions suitable + * for use during kernel panic/oops + */ +extern void nand_base_panic_reinit(struct mtd_info *mtd); + /* The maximum number of NAND chips in an array */ #define NAND_MAX_CHIPS 8 @@ -95,6 +100,12 @@ #define NAND_CMD_SET_FEATURES 0xef #define NAND_CMD_RESET 0xff +#ifdef CONFIG_AVM_ENHANCED +#define NAND_CMD_CACHEREAD_SEQ_CONTINUE 0x31 +#define NAND_CMD_CACHEREAD_SEQ_STOP 0x3F +#define NAND_CMD_ECCSTATUS 0x7A +#endif + #define NAND_CMD_LOCK 0x2a #define NAND_CMD_UNLOCK1 0x23 #define NAND_CMD_UNLOCK2 0x24 @@ -109,6 +120,9 @@ /* Status bits */ #define NAND_STATUS_FAIL 0x01 #define NAND_STATUS_FAIL_N1 0x02 +#ifdef CONFIG_AVM_ENHANCED +#define NAND_STATUS_CRITICAL_BLOCK 0x08 +#endif #define NAND_STATUS_TRUE_READY 0x20 #define NAND_STATUS_READY 0x40 #define NAND_STATUS_WP 0x80 @@ -191,6 +205,11 @@ */ #define NAND_BUSWIDTH_AUTO 0x00080000 +#ifdef CONFIG_AVM_ENHANCED +/* Flash has internal ECC. Use options to e.g. check status after read and write ops. */ +#define NAND_FLASH_HWECC 0x00100000 +#endif + /* Options set by nand scan */ /* Nand scan has allocated controller struct */ #define NAND_CONTROLLER_ALLOC 0x80000000 @@ -655,6 +674,9 @@ unsigned int options; unsigned int bbt_options; const char **part_probe_types; +#ifdef CONFIG_AVM_ENHANCED + int (*chip_fixup)(struct mtd_info *mtd); +#endif }; /* Keep gcc happy */