From patchwork Wed Nov 3 15:11:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 1550361 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=U/HheJBS; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=ca8FIdWO; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4Hkqyd67Pwz9sX3 for ; Thu, 4 Nov 2021 02:12:57 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=tBjmnKskBVaaDF/yZUJou4qzyx85PseKHcyjBS9bAXU=; b=U/HheJBSvC9OZV Dxia2BMqCzQrye+Lrib4d09paDlLXSxULZrbhm9pJd2l8UrAsAfApbEqGfQHKVmUYW0ApX7SxPZ/I PASUX4U2DR3fhKpZzf5K85OOL5gdInhSAqxlry0RUywXUrbA3RJ9waPVG/+sGSWFh4u6Ch0rOCP/n yjf49dNVrU0roO4hoC+dnj3Arl85sasalVSFbcyd1Tg+Lx8ynMO4mSPZeZRAV0CVlnCu1wDf2fwz+ /azQR9bZIJWXeQzX8nGyWDL96Cc84nhpq4J0TiEL4oGdvFotuCt5KJ1M88+4XclZ8DS7CzV/0TUOo 0LGhVJ0nM6wap+8aOxYw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1miHvT-005Y6c-OI; Wed, 03 Nov 2021 15:11:43 +0000 Received: from mail-lj1-x233.google.com ([2a00:1450:4864:20::233]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1miHvJ-005Y4A-Mq for linux-mtd@lists.infradead.org; Wed, 03 Nov 2021 15:11:35 +0000 Received: by mail-lj1-x233.google.com with SMTP id 17so4454362ljq.0 for ; Wed, 03 Nov 2021 08:11:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=nw4lw3QdWRjlNxPGRbwuhTvxj/pxfOmMSn4h4+Uf8y4=; b=ca8FIdWOsgZurU2wKXFP/wrDipadzFVOuQO1FksS8gQ/3KwUoo2tAL3sBBDHH31vxd AtcEVGDkkEmzc7VrGykHVoDcIz2+dzRKvxQGnzIrCrKBJypTGzvYet7tYVnx4Ffb1Nec 7OtdEeOofKVwjvfqcvMSFxKIXTdeTR1cPrGctSt5E9LlWgFr5d/VZ0XdA0SZfmKjbo7c Le1S7vFeerX9EwUeFHJFWhnJF6G8G/j0ED60SA/aVrLdHMPRDlRjfkAfKjRTJZTIjWkK qUEL2jq8FQ8C2OKY83cxaBjMIE1LKdjZ+c9sQq9tPLOF7ZB0Ze0NB+j5Ahl7wEpVEANw fDAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=nw4lw3QdWRjlNxPGRbwuhTvxj/pxfOmMSn4h4+Uf8y4=; b=2db1s9GSra5wgROfeNO4SS+3aDl3GzlySHogDi2Q59C/3GuQR2NrYuB/r13q+wNffe CxJ0SYXV+4SqDkzvRcLTbDgIh0PTPWHpjF4au4tWQlM7GR1XLGMS6JfdREQKnqGapRW/ 5LhdKYVNiO/92XeHE6X8nZVmBI4XAdxOqkvkfJbj1mRy4C0uq1E4RyGtPYw69lylbOz/ gZyItfYUCAQRwhMvw1qNwaEFL47B95pR4a4+s8NIUSYRBONnRPQFT6tba/cABbIly8JF PR78ezXVTCjYxBOfbKavnuTvtfr41Dvzb8A5m+gB7No8ik4SIbtxjiHz5D2W39puGTl9 4pFg== X-Gm-Message-State: AOAM532ZWX4Dnj8N/U4s75l8DnEFtgabCa1Sxtj18Se83z0dLwUhAJ00 ezPKtxhXqj6SfSVNw2ZtRJM= X-Google-Smtp-Source: ABdhPJwTpJkWvurpf4sUrvT5F7IoRvgQdE67o5LHmudIX3zYW0DieyPYt3EUzvqRNnmD+WHgo7j/ZQ== X-Received: by 2002:a05:651c:160e:: with SMTP id f14mr42824957ljq.379.1635952291983; Wed, 03 Nov 2021 08:11:31 -0700 (PDT) Received: from localhost.lan (ip-194-187-74-233.konfederacka.maverick.com.pl. [194.187.74.233]) by smtp.gmail.com with ESMTPSA id p3sm224107ljc.25.2021.11.03.08.11.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Nov 2021 08:11:31 -0700 (PDT) From: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= To: Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Rob Herring , Brian Norris , Kamal Dasu Cc: linux-mtd@lists.infradead.org, devicetree@vger.kernel.org, Florian Fainelli , bcm-kernel-feedback-list@broadcom.com, =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= Subject: [PATCH 2/2] mtd: rawnand: brcmnand: support "no-wp" DT property Date: Wed, 3 Nov 2021 16:11:17 +0100 Message-Id: <20211103151117.18690-2-zajec5@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211103151117.18690-1-zajec5@gmail.com> References: <20211103151117.18690-1-zajec5@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211103_081133_791780_25607787 X-CRM114-Status: GOOD ( 13.11 ) X-Spam-Score: 0.1 (/) X-Spam-Report: =?unknown-8bit?q?Spam_detection_software=2C_running_on_the_sy?= =?unknown-8bit?q?stem_=22bombadil=2Einfradead=2Eorg=22=2C?= =?unknown-8bit?q?_has_NOT_identified_this_incoming_email_as_spam=2E__The_ori?= =?unknown-8bit?q?ginal?= =?unknown-8bit?q?_message_has_been_attached_to_this_so_you_can_view_it_or_la?= =?unknown-8bit?q?bel?= =?unknown-8bit?q?_similar_future_email=2E__If_you_have_any_questions=2C_see?= =?unknown-8bit?q?_the_administrator_of_that_system_for_details=2E?= =?unknown-8bit?q?_?= =?unknown-8bit?q?_Content_preview=3A__From=3A_Rafa=C5=82_Mi=C5=82ecki_Some_b?= =?unknown-8bit?q?oards_may_use_WP-capable_controller?= =?unknown-8bit?q?_but_still_have_WP_not_connected=2E_This_change_fixes=3A_?= =?unknown-8bit?q?=5B_1=2E175550=5D_bcm63138=5Fnand?= =?unknown-8bit?q?_ff801800=2Enand=3A_timeout_on_status_poll_=28expected_c000?= =?unknown-8bit?q?0040_got_c00000c0=29_=5B?= =?unknown-8bit?b?IDEuMTg0NTIgWy4uLl0g?= =?unknown-8bit?q?_?= =?unknown-8bit?q?_Content_analysis_details=3A___=280=2E1_points=2C_5=2E0_req?= =?unknown-8bit?q?uired=29?= =?unknown-8bit?q?_?= =?unknown-8bit?q?_pts_rule_name______________description?= =?unknown-8bit?q?_----_----------------------_------------------------------?= =?unknown-8bit?q?--------------------?= =?unknown-8bit?q?_-0=2E0_RCVD=5FIN=5FDNSWL=5FNONE_____RBL=3A_Sender_listed_a?= =?unknown-8bit?q?t_https=3A//www=2Ednswl=2Eorg/=2C?= =?unknown-8bit?q?_no_trust?= =?unknown-8bit?b?IFsyYTAwOjE0NTA6NDg2NDoyMDowOjA6MDoyMzMgbGlzdGVkIGluXQ==?= =?unknown-8bit?b?IFtsaXN0LmRuc3dsLm9yZ10=?= =?unknown-8bit?q?_-0=2E0_SPF=5FPASS_______________SPF=3A_sender_matches_SPF_?= =?unknown-8bit?q?record?= =?unknown-8bit?q?_0=2E0_SPF=5FHELO=5FNONE__________SPF=3A_HELO_does_not_publ?= =?unknown-8bit?q?ish_an_SPF_Record?= =?unknown-8bit?q?_0=2E0_FREEMAIL=5FFROM__________Sender_email_is_commonly_ab?= =?unknown-8bit?q?used_enduser_mail?= =?unknown-8bit?q?_provider?= =?unknown-8bit?q?_=5Bzajec5=5Bat=5Dgmail=2Ecom=5D?= =?unknown-8bit?q?_0=2E2_FREEMAIL=5FENVFROM=5FEND=5FDIGIT_Envelope-from_freem?= =?unknown-8bit?q?ail_username_ends?= =?unknown-8bit?q?_in_digit?= =?unknown-8bit?q?_=5Bzajec5=5Bat=5Dgmail=2Ecom=5D?= =?unknown-8bit?q?_-0=2E1_DKIM=5FVALID=5FAU__________Message_has_a_valid_DKIM?= =?unknown-8bit?q?_or_DK_signature_from?= =?unknown-8bit?q?_author=27s_domain?= =?unknown-8bit?q?_-0=2E1_DKIM=5FVALID_____________Message_has_at_least_one_v?= =?unknown-8bit?q?alid_DKIM_or_DK_signature?= =?unknown-8bit?q?_0=2E1_DKIM=5FSIGNED____________Message_has_a_DKIM_or_DK_si?= =?unknown-8bit?q?gnature=2C_not_necessarily?= =?unknown-8bit?q?_valid?= =?unknown-8bit?q?_-0=2E1_DKIM=5FVALID=5FEF__________Message_has_a_valid_DKIM?= =?unknown-8bit?q?_or_DK_signature_from?= =?unknown-8bit?q?_envelope-from_domain?= X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Rafał Miłecki 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 --- 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;