[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230323124510.2484808-3-noltari@gmail.com>
Date: Thu, 23 Mar 2023 13:45:10 +0100
From: Álvaro Fernández Rojas
<noltari@...il.com>
To: miquel.raynal@...tlin.com, richard@....at, vigneshr@...com,
robh+dt@...nel.org, krzysztof.kozlowski+dt@...aro.org,
masonccyang@...c.com.tw, linux-mtd@...ts.infradead.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org
Cc: Álvaro Fernández Rojas
<noltari@...il.com>
Subject: [PATCH 2/2] mtd: nand: raw: macronix: allow disabling block protection
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@...il.com>
---
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
Powered by blists - more mailing lists