From: "Álvaro Fernández Rojas" <noltari@gmail.com>
To: miquel.raynal@bootlin.com, richard@nod.at, vigneshr@ti.com,
robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org,
masonccyang@mxic.com.tw, linux-mtd@lists.infradead.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: "Álvaro Fernández Rojas" <noltari@gmail.com>
Subject: [PATCH 2/2] mtd: nand: raw: macronix: allow disabling block protection
Date: Thu, 23 Mar 2023 13:45:10 +0100 [thread overview]
Message-ID: <20230323124510.2484808-3-noltari@gmail.com> (raw)
In-Reply-To: <20230323124510.2484808-1-noltari@gmail.com>
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@gmail.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
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
next prev parent reply other threads:[~2023-03-23 12:45 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-23 12:45 [PATCH 0/2] mtd: nand: raw: macronix: allow disabling block protection Álvaro Fernández Rojas
2023-03-23 12:45 ` [PATCH 1/2] dt-bindings: mtd: nand: Macronix: document new binding Álvaro Fernández Rojas
2023-03-24 9:40 ` Miquel Raynal
2023-03-24 10:31 ` Álvaro Fernández Rojas
2023-03-24 10:49 ` Miquel Raynal
2023-03-24 11:21 ` Álvaro Fernández Rojas
2023-03-24 13:45 ` Miquel Raynal
2023-03-24 14:15 ` Álvaro Fernández Rojas
2023-03-24 14:36 ` Miquel Raynal
2023-03-24 17:04 ` Álvaro Fernández Rojas
2023-03-27 8:21 ` Miquel Raynal
2023-04-22 9:28 ` Álvaro Fernández Rojas
2023-03-23 12:45 ` Álvaro Fernández Rojas [this message]
2023-03-23 12:47 ` [PATCH 2/2] mtd: nand: raw: macronix: allow disabling block protection Tudor Ambarus
2023-03-23 12:55 ` Álvaro Fernández Rojas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230323124510.2484808-3-noltari@gmail.com \
--to=noltari@gmail.com \
--cc=devicetree@vger.kernel.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=masonccyang@mxic.com.tw \
--cc=miquel.raynal@bootlin.com \
--cc=richard@nod.at \
--cc=robh+dt@kernel.org \
--cc=vigneshr@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox