From patchwork Tue Jul 17 16:28:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 10530115 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6B3E560247 for ; Tue, 17 Jul 2018 16:29:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 543CE2966A for ; Tue, 17 Jul 2018 16:29:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 47B9C29675; Tue, 17 Jul 2018 16:29:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id F1F042966A for ; Tue, 17 Jul 2018 16:29:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=R+IL7NMHmOlo47OJ0tRAds4aHLcaieTBnIUILE4Ke9g=; b=IaONrp7wjkBZWj F1cOGWFn+zubxYoeCaWNDOxIE6Ls6o09lEYYmFpsRSdukymSb+SNaeC/Gvr0BiWdipFiuRPxX/gli 8w8FbzlJgGy05jmFmb0LDImcSOvFsfRaHkmWDY7/BlvOEI2IpM9b+fG3Jxqw3GYMVmfpgS3XimsgA nJlD+vky8jTcysIpPFYv3dFmdVnzj43SnIEDyBBJ9npuYZEf+ExPcPK3vP8aB6qFA3AbzZlnJwbS9 OmNm4bCFRtJJlv/21uKb1leoM7kLHChwycA2i1ecv3stn2He0Y48/mb54T++0A5aylOVdC0VorOxS 9Jt51JTE2HSXQpNWg4xg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1ffSrK-0006Iu-7i; Tue, 17 Jul 2018 16:29:54 +0000 Received: from esa6.microchip.iphmx.com ([216.71.154.253]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1ffSqO-00054T-H2; Tue, 17 Jul 2018 16:28:57 +0000 X-IronPort-AV: E=Sophos;i="5.51,366,1526367600"; d="scan'208";a="13669940" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa6.microchip.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 17 Jul 2018 09:28:44 -0700 Received: from localhost.localdomain.com (10.10.76.4) by chn-sv-exch02.mchp-main.com (10.10.76.38) with Microsoft SMTP Server id 14.3.352.0; Tue, 17 Jul 2018 09:28:44 -0700 From: Tudor Ambarus To: , , , , Subject: [PATCH 2/3] mtd: spi-nor: unlock global block protection on sst26vf064b Date: Tue, 17 Jul 2018 19:28:30 +0300 Message-ID: <20180717162831.17947-2-tudor.ambarus@microchip.com> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20180717162831.17947-1-tudor.ambarus@microchip.com> References: <20180717162831.17947-1-tudor.ambarus@microchip.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180717_092856_600900_797F1421 X-CRM114-Status: UNSURE ( 8.33 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tudor Ambarus , anuragku@xilinx.com, linux-kernel@vger.kernel.org, cyrille.pitchen@microchip.com, linux-mtd@lists.infradead.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP To avoid inadvertent writes during power-up, sst26vf064b is write-protected by default after a power-on reset cycle. Unlock the serial flash memory by using the Global Block Protection Unlock command - it offers a single command cycle that unlocks the entire memory array. Signed-off-by: Tudor Ambarus --- drivers/mtd/spi-nor/spi-nor.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c index 6648251..eddf09f 100644 --- a/drivers/mtd/spi-nor/spi-nor.c +++ b/drivers/mtd/spi-nor/spi-nor.c @@ -1163,7 +1163,11 @@ static const struct flash_info spi_nor_ids[] = { { "sst25wf040b", INFO(0x621613, 0, 64 * 1024, 8, SECT_4K) }, { "sst25wf040", INFO(0xbf2504, 0, 64 * 1024, 8, SECT_4K | SST_WRITE) }, { "sst25wf080", INFO(0xbf2505, 0, 64 * 1024, 16, SECT_4K | SST_WRITE) }, - { "sst26vf064b", INFO(0xbf2643, 0, 64 * 1024, 128, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) }, + { + "sst26vf064b", INFO(0xbf2643, 0, 64 * 1024, 128, + SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | + UNLOCK_GLOBAL_BLOCK) + }, /* ST Microelectronics -- newer production may have feature updates */ { "m25p05", INFO(0x202010, 0, 32 * 1024, 2, 0) },