Some chips have their on-die ECC forcibly enabled, there's no point in
trying to enable/disable the ECC engine in that case.
Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
Tested-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
} __packed;
struct micron_on_die_ecc {
+ bool forced;
void *rawbuf;
};
static int micron_nand_on_die_ecc_setup(struct nand_chip *chip, bool enable)
{
+ struct micron_nand *micron = nand_get_manufacturer_data(chip);
u8 feature[ONFI_SUBFEATURE_PARAM_LEN] = { 0, };
+ if (micron->ecc.forced)
+ return 0;
+
if (enable)
feature[0] |= ONFI_FEATURE_ON_DIE_ECC_EN;
goto err_free_manuf_data;
}
+ if (ondie == MICRON_ON_DIE_MANDATORY)
+ micron->ecc.forced = true;
+
/*
* In case of 4bit on-die ECC, we need a buffer to store a
* page dumped in raw mode so that we can compare its content