return 0;
}
+static int xnandps_read_subpage_raw(struct mtd_info *mtd, struct nand_chip *chip,
+ uint32_t data_offs, uint32_t readlen, uint8_t *buf)
+{
+ if (data_offs != 0) {
+ chip->cmdfunc(mtd, NAND_CMD_RNDOUT, data_offs, -1);
+ buf += data_offs;
+ }
+
+ chip->read_buf(mtd, buf, readlen);
+ return 0;
+}
+
/**
* xnandps_write_page_raw - [Intern] raw page write function
* @mtd: mtd info structure
SMC controller */
nand_chip->ecc.mode = NAND_ECC_HW;
nand_chip->ecc.read_page = xnandps_read_page_raw;
+ nand_chip->ecc.read_subpage = xnandps_read_subpage_raw;
nand_chip->ecc.write_page = xnandps_write_page_raw;
nand_chip->ecc.read_page_raw = xnandps_read_page_raw;
nand_chip->ecc.write_page_raw = xnandps_write_page_raw;
nand_chip->ecc.size = mtd->writesize;
nand_chip->ecc.bytes = 0;
+ /* NAND with on-die ECC supports subpage reads */
+ nand_chip->options |= NAND_SUBPAGE_READ;
+
/* On-Die ECC spare bytes offset 8 is used for ECC codes */
if (ondie_ecc_enabled) {
nand_chip->ecc.layout = &ondie_nand_oob_64;
#define NAND_HAS_SUBPAGE_READ(chip) ((chip->options & NAND_SUBPAGE_READ))
/* Mask to zero out the chip options, which come from the id table */
-#define NAND_CHIPOPTIONS_MSK (0x0000ffff & ~NAND_NO_AUTOINCR)
+#define NAND_CHIPOPTIONS_MSK (0x0000efff & ~NAND_NO_AUTOINCR)
/* Non chip related options */
/* Use a flash based bad block table. This option is passed to the