From patchwork Tue Jul 27 04:52:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 12401861 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 98447C4338F for ; Tue, 27 Jul 2021 06:47:22 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6341360FC0 for ; Tue, 27 Jul 2021 06:47:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 6341360FC0 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=microchip.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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: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=FWc+jQfeXOYDf07mpjhRxy4M9hAoCV6heD9ysx1xuyc=; b=tpnlFnH6OFX+a/ Ct98k/sRBwF5vvjqfG4gvMqKfNRDELTRKpEbB+DePFCnUL4R/u0mPOTG7x5I0fjx3sL1boUBqigcK qoP7mxv9/Ldt4Vkop9CU9Fw/GYqKhZT3JSP/mfh/mXtYu+StCyViG8rTTBC1hMztaJARRhGusJR9G 6SjO1ySyVIJDIWlmr5w5iHc18JlpCd4ZRCPLLKvHI8JnGdGl0zYrK39Shg9xh/sGqgEWXr1Arl1xR Uprbsy8rpZY6W1XLPIhoPxsxnQ49DS+ivbeMKe81PGwr4hoW6I2EaftlPLmnu3BeD+8YL9ujax5Pm K0XV73H0+RZmJCwUEVaQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m8GpI-00DfIj-3Q; Tue, 27 Jul 2021 06:44:29 +0000 Received: from esa.microchip.iphmx.com ([68.232.153.233]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1m8F7K-00DI0Z-8a; Tue, 27 Jul 2021 04:54:59 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1627361698; x=1658897698; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=VMsCu8WSS1vN1wUh9GVosLaMJS+kLC64LCe6S8YxOQE=; b=OwvU36bQuYDRzS2UfwEZOE4ILStH6DsUO55tjgQLD3DnjUpSjgwpTEoG 3q7XOquCILRRVJE+IFQOxw62SN385nuQFwoasFkN7sUlimmFjEA1lb3fI Jg9YD7QAEpFf1QQVoU1m8hlJbLBthsjeKSqTHJU7oYPCz9tXt7Zf6G/73 lxdeeBdRA8PkRB6ziNy8VEXwsKyohzqJBmz+re4Uyz668CWyWwggOb+VV 4izRQ+3IrX459WNHMS0XgtjC4nc2hE0a/ZpFBJDQEAe/WlMjbpEofHSLH qwGjnQhzkAvWT3nKjaRbqqmbb3wiPU+ys+1oVTm9MzmZ8NHDpWeywKsWB A==; IronPort-SDR: bchJ2rVmEuQfYqV8D48OrWy7V58pOq1SptACrgfxtgfqPNmyYdtSlB9AdnMpoWiFoWGSx5gw87 arhpLKLm4LmQUzvtO5oO5GvD5EGsFnUvVM+ODwwUhiO7zS5+UZsE8Y1oW1lC0tFHkdv8oriKZs YBi2jU4MgAR1HzcCuQ6yxe3SO9VOwMRmERJzaO7U5LN2SiL464xdqHyh0PbS9uFZkGcss5QLaD LD9EDWgz6V4VfkzJ5YWGhfpxZTDcdSJ396mTHenvUSWJ1k3Wqv1yXRi+InBOeqqBhKMWVZ0TwJ xVx+GvVHQW2gtIe9lLe2H5Wq X-IronPort-AV: E=Sophos;i="5.84,272,1620716400"; d="scan'208";a="129935559" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa5.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 26 Jul 2021 21:54:57 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Mon, 26 Jul 2021 21:54:56 -0700 Received: from ROB-ULT-M18064N.mchp-main.com (10.10.115.15) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.2176.2 via Frontend Transport; Mon, 26 Jul 2021 21:54:52 -0700 From: Tudor Ambarus To: , , Subject: [PATCH v2 29/35] mtd: spi-nor: winbond: w25q256jvm: Use SPI_NOR_PARSE_SFDP Date: Tue, 27 Jul 2021 07:52:16 +0300 Message-ID: <20210727045222.905056-30-tudor.ambarus@microchip.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210727045222.905056-1-tudor.ambarus@microchip.com> References: <20210727045222.905056-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-20210726_215458_369215_A608F121 X-CRM114-Status: GOOD ( 12.09 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: macromorgan@hotmail.com, jaimeliao@mxic.com.tw, Tudor Ambarus , richard@nod.at, esben@geanix.com, linux@rasmusvillemoes.dk, knaerzche@gmail.com, linux-mtd@lists.infradead.org, linux-arm-kernel@lists.infradead.org, code@reto-schneider.ch, miquel.raynal@bootlin.com, heiko.thiery@gmail.com, sr@denx.de, figgyc@figgyc.uk, mail@david-bauer.net, zhengxunli@mxic.com.tw Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Get rid of the static initialization of the flash parameters and init them when parsing SFDP. Generated a 256 Kbyte random data and did an erase, write, read back and compare test. The flash uses for reads SPINOR_OP_READ_1_4_4 0xeb, for erases SPINOR_OP_BE_4K 0x20, and for writes SPINOR_OP_PP 0x02. Signed-off-by: Tudor Ambarus --- root@sama5d2-xplained:~# find / -iname spi-nor find: '/proc/383': No such file or directory /sys/devices/platform/ahb/ahb:apb/f0020000.spi/spi_master/spi1/spi1.0/spi-nor /sys/devices/platform/ahb/ahb:apb/f8000000.spi/spi_master/spi0/spi0.0/spi-nor /sys/bus/spi/drivers/spi-nor root@sama5d2-xplained:~# ls -al /sys/devices/platform/ahb/ahb:apb/f0020000.spi/spi_master/spi1/spi1.0/spi-nor total 0 drwxr-xr-x 2 root root 0 Mar 9 14:16 . drwxr-xr-x 6 root root 0 Mar 9 14:15 .. -r--r--r-- 1 root root 4096 Mar 9 14:17 jedec_id -r--r--r-- 1 root root 4096 Mar 9 14:17 manufacturer -r--r--r-- 1 root root 4096 Mar 9 14:17 partname -r--r--r-- 1 root root 0 Mar 9 14:17 sfdp root@sama5d2-xplained:~# cat /sys/devices/platform/ahb/ahb:apb/f0020000.spi/spi_master/spi1/spi1.0/spi-nor/jedec_id ef7019 root@sama5d2-xplained:~# cat /sys/devices/platform/ahb/ahb:apb/f0020000.spi/spi_master/spi1/spi1.0/spi-nor/manufacturer winbond root@sama5d2-xplained:~# cat /sys/devices/platform/ahb/ahb:apb/f0020000.spi/spi_master/spi1/spi1.0/spi-nor/partname w25q256jvm root@sama5d2-xplained:~# cat /sys/devices/platform/ahb/ahb:apb/f0020000.spi/spi_master/spi1/spi1.0/spi-nor/sfdp > sfdp-w25q256jvm root@sama5d2-xplained:~# hexdump sfdp-w25q256jvm 0000000 4653 5044 0105 ff00 0500 1001 0080 ff00 0000010 ffff ffff ffff ffff ffff ffff ffff ffff * 0000080 20e5 fffb ffff 0fff eb44 6b08 3b08 bb42 0000090 fffe ffff ffff 0000 ffff eb40 200c 520f 00000a0 d810 0000 0236 00a6 ea82 d314 63e9 3376 00000b0 757a 757a a2f7 5cd5 f719 ff4d 70e9 a5f9 00000c0 drivers/mtd/spi-nor/winbond.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mtd/spi-nor/winbond.c b/drivers/mtd/spi-nor/winbond.c index 6be45d2291c6..cbfc41b261d7 100644 --- a/drivers/mtd/spi-nor/winbond.c +++ b/drivers/mtd/spi-nor/winbond.c @@ -95,7 +95,7 @@ static const struct flash_info winbond_parts[] = { SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) .fixups = &w25q256_fixups }, { "w25q256jvm", INFO(0xef7019, 0, 64 * 1024, 512, - SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) }, + SPI_NOR_PARSE_SFDP) }, { "w25q256jw", INFO(0xef6019, 0, 64 * 1024, 512, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) }, { "w25m512jv", INFO(0xef7119, 0, 64 * 1024, 1024,