Message ID | 20240223034758.13753-14-william.zhang@broadcom.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-77738-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp391489dyb; Thu, 22 Feb 2024 21:10:27 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCW9L6iNLvurHSL95ExC0Nzy4sahpT3WbwCN8+4O5AWE40IDo9ZqEMStHIMtox1CtkkTx9wX1jcikANL0CULh3y/Lb4hhA== X-Google-Smtp-Source: AGHT+IGJUJtRQXkVTGx3eIpevMIp0NRWCibE80UaJ2vufcWZkWlrMZphE9bB8bwzdl44yowsBxof X-Received: by 2002:a05:620a:8:b0:787:7479:62d6 with SMTP id j8-20020a05620a000800b00787747962d6mr1159284qki.52.1708665027174; Thu, 22 Feb 2024 21:10:27 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708665027; cv=pass; d=google.com; s=arc-20160816; b=tCFhjs8CztClRMKgam/JCplHcSrd5dggLQuAgsrvmDfCJRxIcwnjY+fBtqZGqxCfHo YGAhF1PAn8uIirDjBLyTP3C2yx74/BBVZqogiggpvBJk1Kmt2m6py9AUi5V9b7t8wUyy VihA2X36uFE3ObvehPZoUuMmxG9apcqTU4X+Af0X8+KLpLb1C2cjVhOx8ZXEx1BweMkS 4vu68oL81REtLarbwxxnBS5mTMVZDqKOcZSEbp6xaZ+Q5vlmQXPT0OlzJVznWZxrJwRc eSP84NDNg5vwel+sj1tNFcDMBswd14rrpbIRH3DhME7i0JhVAFNw0wNvJnTdGwFdGGI6 x/ng== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature:dkim-filter; bh=f7OrPXkA9h5wUvIzBLPC8L+hyLvLOPdYeBxH789kQv0=; fh=dM09IDhjszaOhVxwrBWY+f266BOhCnoRoNnLsaJcdZ8=; b=m2ryv6vv6fQphAlxFL1YPJw5m+rOKWhwwCUf8vzrXZozOCYFjh3MusowhLBZo4p7HB c0oSvn/hp1zpdBvTAWftLxEqbziQ9Gzx45S9cON/wlk1qWGnoP8tbB5LVYpt3eSBC565 p5/Sbmu53uIOLKpE+LLpxTWdV6hmK/mvaA8LX70VZDLyM2w/x/0dO/Qs3+EKPX9FaYP8 qAtim0GtLWxrh0hpq93FvTS6F4FRq8Qj33pUbom7p8yKPWc3pXl1YSDrmyCTGxbvXtTG WtN1JBT7zPlIe770Qb3/3nz+Tbal8c9teCqWH9Gqan+d9sSm7rhtCIjhOSdLgjqp5vVB ZlKA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@broadcom.com header.s=dkimrelay header.b=AhT4oVyZ; arc=pass (i=1 dkim=pass dkdomain=broadcom.com dmarc=pass fromdomain=broadcom.com); spf=pass (google.com: domain of linux-kernel+bounces-77738-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77738-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id d2-20020a37c402000000b007873af533f2si14065726qki.508.2024.02.22.21.10.27 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 21:10:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-77738-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@broadcom.com header.s=dkimrelay header.b=AhT4oVyZ; arc=pass (i=1 dkim=pass dkdomain=broadcom.com dmarc=pass fromdomain=broadcom.com); spf=pass (google.com: domain of linux-kernel+bounces-77738-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77738-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id BAF271C24D44 for <ouuuleilei@gmail.com>; Fri, 23 Feb 2024 03:51:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0B2C41A28C; Fri, 23 Feb 2024 03:48:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="AhT4oVyZ" Received: from relay.smtp-ext.broadcom.com (relay.smtp-ext.broadcom.com [192.19.144.205]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 98B9B14F8C for <linux-kernel@vger.kernel.org>; Fri, 23 Feb 2024 03:48:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.19.144.205 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708660117; cv=none; b=cz2WIbqFflwBGNJ1weNG2QOqKctW0LWAXd72qad+SwcV0EwOa3FWFF7ClQMN0taKCYSnLIoskqMwfAvoSIWymbLFqCt/CM8CH4IxpvYelBqcMsIK8Tr1ZA/JLI+XQeUtQ90r3NxvFzMZKIykW+LxvTPBn1Tef1lgeC+Wv7JxyWo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708660117; c=relaxed/simple; bh=wKBvVMc60Fe2dxQpvxpi677VlKI114pZ3dAsj88tuns=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=bbhCDxZL5xyEqu1B7WfCtiZB7YhNimCYooR7JSqDjyfgqvp6avGJWIX5biQk0Eaf6TQDK6qy+NMAZYrgIiQPI8sp0N8CnefFITwIu4kWL4UMHPl27Y7ao6Vb6i9oqMbA9PVp2R77NTjmq5Enyc4YkMcMJhREkJ55gMiSM5Av03c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com; spf=fail smtp.mailfrom=broadcom.com; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b=AhT4oVyZ; arc=none smtp.client-ip=192.19.144.205 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=broadcom.com Received: from mail-lvn-it-01.lvn.broadcom.net (mail-lvn-it-01.lvn.broadcom.net [10.36.132.253]) by relay.smtp-ext.broadcom.com (Postfix) with ESMTP id 99370C0000FB; Thu, 22 Feb 2024 19:48:34 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 relay.smtp-ext.broadcom.com 99370C0000FB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1708660114; bh=wKBvVMc60Fe2dxQpvxpi677VlKI114pZ3dAsj88tuns=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AhT4oVyZgKRKY7Nnq2vDCMrwhgFNocShT5rPsyPDWdtvaFG1LiYUuXSPfe+vTDwsI vY0jPY29IlLy+Kfinlw69gTmNR9eR5R4HaxmxOwiO0+8GvulZgblNc084VWDz0l7k5 KRcpTG0OOzNdkLuNI0jVVuHnFsuZq7G0SeS/eIdc= Received: from bcacpedev-irv-3.lvn.broadcom.net (bcacpedev-irv-3.lvn.broadcom.net [10.173.232.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail-lvn-it-01.lvn.broadcom.net (Postfix) with ESMTPSA id EDB2618041CAC4; Thu, 22 Feb 2024 19:48:32 -0800 (PST) From: William Zhang <william.zhang@broadcom.com> To: Linux MTD List <linux-mtd@lists.infradead.org>, Linux ARM List <linux-arm-kernel@lists.infradead.org>, Broadcom Kernel List <bcm-kernel-feedback-list@broadcom.com> Cc: f.fainelli@gmail.com, kursad.oney@broadcom.com, joel.peshkin@broadcom.com, anand.gore@broadcom.com, dregan@mail.com, kamal.dasu@broadcom.com, tomer.yacoby@broadcom.com, dan.beygelman@broadcom.com, William Zhang <william.zhang@broadcom.com>, Florian Fainelli <florian.fainelli@broadcom.com>, David Regan <dregan@broadcom.com>, Miquel Raynal <miquel.raynal@bootlin.com>, linux-kernel@vger.kernel.org, Vignesh Raghavendra <vigneshr@ti.com>, Brian Norris <computersforpeace@gmail.com>, Richard Weinberger <richard@nod.at> Subject: [PATCH v6 13/13] mtd: rawnand: brcmnand: Support write protection setting from dts Date: Thu, 22 Feb 2024 19:47:58 -0800 Message-Id: <20240223034758.13753-14-william.zhang@broadcom.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20240223034758.13753-1-william.zhang@broadcom.com> References: <20240223034758.13753-1-william.zhang@broadcom.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791665139745866813 X-GMAIL-MSGID: 1791665139745866813 |
Series |
mtd: rawnand: brcmnand: driver and doc updates
|
|
Commit Message
William Zhang
Feb. 23, 2024, 3:47 a.m. UTC
The write protection feature is controlled by the module parameter wp_on with default set to enabled. But not all the board use this feature especially in BCMBCA broadband board. And module parameter is not sufficient as different board can have different option. Add a device tree property and allow this feature to be configured through the board dts on per board basis. Signed-off-by: William Zhang <william.zhang@broadcom.com> Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com> Reviewed-by: Kamal Dasu <kamal.dasu@broadcom.com> Reviewed-by: David Regan <dregan@broadcom.com> --- Changes in v6: None Changes in v5: None Changes in v4: - Use the new brcm,wp-not-connected property based on the dts binding change Changes in v3: None Changes in v2: None drivers/mtd/nand/raw/brcmnand/brcmnand.c | 4 ++++ 1 file changed, 4 insertions(+)
Comments
On Fri, 2024-02-23 at 03:47:58 UTC, William Zhang wrote: > The write protection feature is controlled by the module parameter wp_on > with default set to enabled. But not all the board use this feature > especially in BCMBCA broadband board. And module parameter is not > sufficient as different board can have different option. Add a device > tree property and allow this feature to be configured through the board > dts on per board basis. > > Signed-off-by: William Zhang <william.zhang@broadcom.com> > Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com> > Reviewed-by: Kamal Dasu <kamal.dasu@broadcom.com> > Reviewed-by: David Regan <dregan@broadcom.com> Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next, thanks. Miquel
diff --git a/drivers/mtd/nand/raw/brcmnand/brcmnand.c b/drivers/mtd/nand/raw/brcmnand/brcmnand.c index e8ffc283b365..4810345d0d8a 100644 --- a/drivers/mtd/nand/raw/brcmnand/brcmnand.c +++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.c @@ -3223,6 +3223,10 @@ int brcmnand_probe(struct platform_device *pdev, struct brcmnand_soc *soc) /* Disable XOR addressing */ brcmnand_rmw_reg(ctrl, BRCMNAND_CS_XOR, 0xff, 0, 0); + /* Check if the board connects the WP pin */ + if (of_property_read_bool(dn, "brcm,wp-not-connected")) + wp_on = 0; + if (ctrl->features & BRCMNAND_HAS_WP) { /* Permanently disable write protection */ if (wp_on == 2)