Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp4439814ybz; Tue, 21 Apr 2020 00:10:07 -0700 (PDT) X-Google-Smtp-Source: APiQypLU0Ikr7wOp18F3qjEvMZgbNwOQgIR4FgoJJRv4ssBDSMl6FUadzpYlDkpP2izLtRzVsVlh X-Received: by 2002:a17:906:130e:: with SMTP id w14mr20266642ejb.155.1587453006830; Tue, 21 Apr 2020 00:10:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587453006; cv=none; d=google.com; s=arc-20160816; b=bax2HGIWpQEgunKJQ/Hjj1iRz1g6CagfDGogdWTSlCxA8I9T5s07jxZjCkB3NkyFOw 4ol//2rpY/yX+8DIsdMBm3+kDRPOhd8eASDgQ4gKv/30IvhpRmrDHPyRn9alY3wzDwYG pvCBgmDvgWSZ9L2qSieuWCfauQxfNWQHv/9JTQ3in4wcwqJGCeuRuUnhlQAatWxVBGtM S8T+Al7KoyahQ+zmLQX2JptrJRe/28pQsmXk8m6ID7hgJqPh46Ri3TinY5GjpvE1LISr ++yar44096QTGGTNaqorH0LGwwr45NNd2IULo7Qa6IBdbwGYXiTYATllpQBL0xqrBclJ C6lA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=4IVtgm0YWVymy+ZS0oMV3lDVZn9M1vWthlwQl8UZZDs=; b=FgBkaR54s1Ra4N42x34KSZjXandiFAQvmITv9Mkz7DZj0jraLu9+WEuLLguMnsrbSj zYsJSdJDYwdHB0LvnQSFZpdX9efdlref/5FuD4SaAqOJXHKuDzb1PvXkz0UrG9KZNiHc 3RQ5Q6fQplTSCKI4y8dPmywCxiC3tdKdw8fKV8GAcP9EiN9mWcmji/lG3eOZtHtYdYei eFRheXq5orRO6WQxz/rIL6eChuTTDMNDIAjI3A1H77jAndvbiJbbG9wLHODptmkJn3Ug DOyAkvzbjfspIca9G1mJ7UXhxZ7h6jo0c9T7iXUXAzDEQbybzQgdmTU8F8UI8GCQgBwA IYDg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c19si1037555ejk.126.2020.04.21.00.09.43; Tue, 21 Apr 2020 00:10:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727048AbgDUHIm (ORCPT + 99 others); Tue, 21 Apr 2020 03:08:42 -0400 Received: from twhmllg3.macronix.com ([122.147.135.201]:50562 "EHLO TWHMLLG3.macronix.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725926AbgDUHIm (ORCPT ); Tue, 21 Apr 2020 03:08:42 -0400 X-Greylist: delayed 1726 seconds by postgrey-1.27 at vger.kernel.org; Tue, 21 Apr 2020 03:08:41 EDT Received: from TWHMLLG3.macronix.com (localhost [127.0.0.2] (may be forged)) by TWHMLLG3.macronix.com with ESMTP id 03L6dtoH045542 for ; Tue, 21 Apr 2020 14:39:55 +0800 (GMT-8) (envelope-from masonccyang@mxic.com.tw) Received: from localhost.localdomain ([172.17.195.96]) by TWHMLLG3.macronix.com with ESMTP id 03L6dnMW045498; Tue, 21 Apr 2020 14:39:49 +0800 (GMT-8) (envelope-from masonccyang@mxic.com.tw) From: Mason Yang To: broonie@kernel.org, tudor.ambarus@microchip.com, miquel.raynal@bootlin.com, richard@nod.at, vigneshr@ti.com, boris.brezillon@collabora.com Cc: juliensu@mxic.com.tw, linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, linux-spi@vger.kernel.org, Mason Yang Subject: [PATCH v2 0/5] mtd: spi-nor: Add support for Octal 8D-8D-8D mode Date: Tue, 21 Apr 2020 14:39:42 +0800 Message-Id: <1587451187-6889-1-git-send-email-masonccyang@mxic.com.tw> X-Mailer: git-send-email 1.9.1 X-MAIL: TWHMLLG3.macronix.com 03L6dnMW045498 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, This is repost of patchset from Boris Brezillon's [RFC,00/18] mtd: spi-nor: Proposal for 8-8-8 mode support [1]. Background from cover letter for RFC[1]. The trend has been around Octal NOR Flash lately and the latest mainline already supports 1-1-8 and 1-8-8 modes. Boris opened a discussion on how we should support stateful modes (X-X-X and XD-XD-XD, where X is the bus width and D means Double Transfer Rate). JESD216C has defined specification for Octal 8S-8S-8S and 8D-8D-8D. Based on JEDEC216C Basic Flash Parameter Table (BFPT) driver extract: DWORD-18: command and command extension type. DWORD-19: enable 8S-8S-8S/8D-8D-8D mode sequences by two instructions or write CFG Reg 2. DWORD-20: Maximum operation speed of device in Octal mode. and xSPI profile 1.0 table: DWORD-1: Read Fast command, the number of dummy cycles and address nbytes for Read Status Register command. DWORD-2: Read/Write volatile Register command for CFG Reg2. DWORD-4 and DWORD-5: dummy cycles used for various frequencies. The first set of patches is according to JESD216C adding Double Transfer Rate(DTR) fields, extension command and command bytes number to the spi_mem_op struct. This is from Boris patchset. The second set of patches parse the xSPI profile 1.0 table for parameters needed in Octal 8D-8D-8D mode. The third set of patches extract BFPT DWORD018,19,20 and define the relevant macros and enum in spi-nor layer for Octal 8S-8S-8S and 8D-8D-8D mode operation. Parts of these are refer to Boris patchset but we enable Octal 8D-8D-8D mode in spi_nor_late_init_params() rather than Boris's adding a change_mode() call-back function. The last set of patches in the series support Macronix mx25uw51245g to tweak flash parameters a correct dummy cycles set for various frequency. Also patched spi-mxic driver for testing on Macronix's Zynq PicoZed board with Macronix's SPI controller (spi-mxic.c) and mx25uw51245g Octal flash. [1] https://patchwork.ozlabs.org/cover/982926/ Summary of change log --------------------- v2: Parse BFPT & xSPI table for Octal 8D-8D-8D mode parameters and enable Octal mode in spi_nor_late_init_params(). Using Macros in spi_nor_spimem_read_data, spi_nor_spimem_write_data and so on by Vignesh comments. v1: Without parsing BFPT & xSPI profile 1.0 table and enter Octal 8D-8D-8D mode directly in spi_nor_fixups hooks. thnaks for your time and review. best regards, Mason Mason Yang (5): mtd: spi-nor: Add support for Octal 8D-8D-8D mode mtd: spi-nor: sfdp: Add support for xSPI profile 1.0 table mtd: spi-nor: Parse BFPT DWORD-18,19 and 20 for Octal 8D-8D-8D mode mtd: spi-nor: macronix: Add Octal 8D-8D-8D supports for Macronix mx25uw51245g spi: mxic: Patch for Octal 8D-8D-8D mode support drivers/mtd/spi-nor/core.c | 220 ++++++++++++++++++++++++++++++++++++++-- drivers/mtd/spi-nor/core.h | 31 ++++++ drivers/mtd/spi-nor/macronix.c | 41 ++++++++ drivers/mtd/spi-nor/sfdp.c | 222 ++++++++++++++++++++++++++++++++++++++++- drivers/mtd/spi-nor/sfdp.h | 16 ++- drivers/spi/spi-mem.c | 8 +- drivers/spi/spi-mxic.c | 101 +++++++++++++------ include/linux/mtd/spi-nor.h | 51 +++++++++- include/linux/spi/spi-mem.h | 13 +++ 9 files changed, 654 insertions(+), 49 deletions(-) -- 1.9.1