From: "Rafał Miłecki" <zajec5@gmail.com>
To: Miquel Raynal <miquel.raynal@bootlin.com>,
Richard Weinberger <richard@nod.at>,
Vignesh Raghavendra <vigneshr@ti.com>,
Rob Herring <robh+dt@kernel.org>,
Brian Norris <computersforpeace@gmail.com>,
Kamal Dasu <kdasu.kdev@gmail.com>
Cc: linux-mtd@lists.infradead.org, devicetree@vger.kernel.org,
"Florian Fainelli" <f.fainelli@gmail.com>,
bcm-kernel-feedback-list@broadcom.com,
"Rafał Miłecki" <rafal@milecki.pl>
Subject: [PATCH 2/2] mtd: rawnand: brcmnand: support "no-wp" DT property
Date: Wed, 3 Nov 2021 16:11:17 +0100 [thread overview]
Message-ID: <20211103151117.18690-2-zajec5@gmail.com> (raw)
In-Reply-To: <20211103151117.18690-1-zajec5@gmail.com>
From: Rafał Miłecki <rafal@milecki.pl>
Some boards may use WP-capable controller but still have WP not
connected. This change fixes:
[ 1.175550] bcm63138_nand ff801800.nand: timeout on status poll (expected c0000040 got c00000c0)
[ 1.184524] bcm63138_nand ff801800.nand: nand #WP expected on
[ 1.285547] bcm63138_nand ff801800.nand: timeout on status poll (expected c0000040 got c00000c0)
[ 1.294516] bcm63138_nand ff801800.nand: nand #WP expected on
[ 1.395548] bcm63138_nand ff801800.nand: timeout on status poll (expected c0000040 got c00000c0)
[ 1.404517] bcm63138_nand ff801800.nand: nand #WP expected on
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
---
drivers/mtd/nand/raw/brcmnand/brcmnand.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/mtd/nand/raw/brcmnand/brcmnand.c b/drivers/mtd/nand/raw/brcmnand/brcmnand.c
index f75929783b94..8b6167457f0c 100644
--- a/drivers/mtd/nand/raw/brcmnand/brcmnand.c
+++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.c
@@ -714,7 +714,8 @@ static int brcmnand_revision_init(struct brcmnand_controller *ctrl)
if (ctrl->nand_version >= 0x0500)
ctrl->features |= BRCMNAND_HAS_1K_SECTORS;
- if (ctrl->nand_version >= 0x0700)
+ if (ctrl->nand_version >= 0x0700 &&
+ !of_property_read_bool(ctrl->dev->of_node, "no-wp"))
ctrl->features |= BRCMNAND_HAS_WP;
else if (of_property_read_bool(ctrl->dev->of_node, "brcm,nand-has-wp"))
ctrl->features |= BRCMNAND_HAS_WP;
--
2.31.1
next prev parent reply other threads:[~2021-11-03 15:11 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-03 15:11 [PATCH 1/2] dt-bindings: mtd: brcmnand: add "no-wp" property Rafał Miłecki
2021-11-03 15:11 ` Rafał Miłecki [this message]
2021-11-03 17:50 ` [PATCH 2/2] mtd: rawnand: brcmnand: support "no-wp" DT property Florian Fainelli
2021-11-03 18:03 ` Rafał Miłecki
2021-11-03 18:08 ` Florian Fainelli
2021-11-09 7:49 ` [PATCH 1/2] dt-bindings: mtd: brcmnand: add "no-wp" property Rafał Miłecki
2021-11-09 10:52 ` Miquel Raynal
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=20211103151117.18690-2-zajec5@gmail.com \
--to=zajec5@gmail.com \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=computersforpeace@gmail.com \
--cc=devicetree@vger.kernel.org \
--cc=f.fainelli@gmail.com \
--cc=kdasu.kdev@gmail.com \
--cc=linux-mtd@lists.infradead.org \
--cc=miquel.raynal@bootlin.com \
--cc=rafal@milecki.pl \
--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