Some devices hang when block protection is enabled, so let's add a boolean property to allow disabling it. Fixes: 03a539c7a118 ("mtd: rawnand: Macronix: Add support for block protection") Signed-off-by: Álvaro Fernández Rojas <noltari@xxxxxxxxx> --- drivers/mtd/nand/raw/nand_macronix.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/mtd/nand/raw/nand_macronix.c b/drivers/mtd/nand/raw/nand_macronix.c index 1472f925f386..b9f0338ebdaf 100644 --- a/drivers/mtd/nand/raw/nand_macronix.c +++ b/drivers/mtd/nand/raw/nand_macronix.c @@ -219,9 +219,13 @@ static int mxic_nand_unlock(struct nand_chip *chip, loff_t ofs, uint64_t len) static void macronix_nand_block_protection_support(struct nand_chip *chip) { + struct device_node *dn = nand_get_flash_node(chip); u8 feature[ONFI_SUBFEATURE_PARAM_LEN]; int ret; + if (of_property_read_bool(dn, "mxic,disable-block-protection")) + return; + bitmap_set(chip->parameters.get_feature_list, ONFI_FEATURE_ADDR_MXIC_PROTECTION, 1); -- 2.30.2