From patchwork Wed Mar 3 09:48:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Bauer X-Patchwork-Id: 1446738 X-Patchwork-Delegate: tudor.ambarus@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2001:8b0:10b:1:d65d:64ff:fe57:4e05; helo=desiato.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=desiato.20200630 header.b=ATVkCl88; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=casper.20170209 header.b=vzKlYfiS; dkim-atps=neutral Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) (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 ozlabs.org (Postfix) with ESMTPS id 4DrLSL5hxyz9sSC for ; Thu, 4 Mar 2021 04:23:30 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To:From: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=uKP7m+hg8CtZxm2RgyvfKGyW1s3bbQtmP9hEANfcyI0=; b=ATVkCl88APwxAG PUDDkQNI7JazXceieUAwV84/VFgFY8vVAcNS4y3VELrgNtEmrI+UxkGxU52kX47dIMdlSMei3V7BJ BkXoLabPQT65r0jMeqRTl1Ds7nygTQpYgaQGU4GQz/x634FKQMK50YgPNSyTL/AWcfYwuy4YhRrPF pizVaUsnFqS57m7yJEeqF6niuKKsURyY7hSwyYMXkFUBtCf8ERNmWiMhL/XvEaviMDRNbKZMM1B1/ 2Kka3+cqfEH05zBeFp93+jMIQe3PT/lV7miLjNUMLsyE7x55aDk80CgN1PNQfmM1WmLoVxgrF0P5v LQ4iP2wLfLB/+RltuC8g==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lHVCN-005maW-8d; Wed, 03 Mar 2021 17:22:11 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lHSud-005FKi-83 for linux-mtd@desiato.infradead.org; Wed, 03 Mar 2021 14:55:43 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: Message-Id:Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type:Content-ID: Content-Description:In-Reply-To:References; bh=3y4qmTiGdbIFuupuPkvPAsKkvoNKr0zm+aN2aaexqIo=; b=vzKlYfiSdwDWpLVUe3kFHBt2qu A9CmqjPT2xtIilMuUcqHaqNz98X3jCn45qYqtkUN6KDsWnzOOcAD4qU3PwicTpZ4HxRixSKBmApCN x0Qag6zEAf2xVCwfpRzOQPRaR5gF/ryIagcyGmFu1bDa3zgT+t6zqkCbQbOTVJXdHFl7CBoQ1G7pe 3QmHpwaOYy5rrKXI/FU2W1LJGBlM1miru12PJfhNAb0NoUwvA8wTJCv/Yfaxn4yTt1GItz5WlIvat 4dBbUefhNkVDhmQJv+TqZ87pVa1wjm6ptM5Y0ojGfN22TdndctOb4JXkw9ESeMtesEkjo7BS2b6Rc JIywuxfQ==; Received: from mars.blocktrron.ovh ([51.254.112.43] helo=mail.blocktrron.ovh) by casper.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lHO8C-0023tN-88 for linux-mtd@lists.infradead.org; Wed, 03 Mar 2021 09:49:25 +0000 Received: from localhost.localdomain (p200300e53f06820029112db9632db604.dip0.t-ipconnect.de [IPv6:2003:e5:3f06:8200:2911:2db9:632d:b604]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.blocktrron.ovh (Postfix) with ESMTPSA id 4E0F523380; Wed, 3 Mar 2021 10:49:07 +0100 (CET) From: David Bauer To: tudor.ambarus@microchip.com, miquel.raynal@bootlin.com, richard@nod.at, vigneshr@ti.com, linux-mtd@lists.infradead.org Subject: [PATCH 1/2] mtd: spi-nor: add block protection flags to macronix Date: Wed, 3 Mar 2021 10:48:32 +0100 Message-Id: <20210303094833.139221-1-mail@david-bauer.net> X-Mailer: git-send-email 2.30.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210303_094925_024189_13A1CDD8 X-CRM114-Status: GOOD ( 11.27 ) X-Spam-Note: SpamAssassin invocation failed 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 Macronix flash chips support block protection by using BP bits in the read status register. Add the corresponding flag to indicate block protection support. Otherwise, locked blocks are not unlocked when requested. Signed-off-by: David Bauer --- drivers/mtd/spi-nor/macronix.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/mtd/spi-nor/macronix.c b/drivers/mtd/spi-nor/macronix.c index 9203abaac229..2d39dd32a64e 100644 --- a/drivers/mtd/spi-nor/macronix.c +++ b/drivers/mtd/spi-nor/macronix.c @@ -94,6 +94,7 @@ static const struct flash_info macronix_parts[] = { static void macronix_default_init(struct spi_nor *nor) { + nor->flags |= SNOR_F_HAS_LOCK; nor->params->quad_enable = spi_nor_sr1_bit6_quad_enable; nor->params->set_4byte_addr_mode = spi_nor_set_4byte_addr_mode; }