From patchwork Mon Dec 3 08:39:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yogesh Narayan Gaur X-Patchwork-Id: 10708847 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 608AD13BF for ; Mon, 3 Dec 2018 08:39:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 520A82A967 for ; Mon, 3 Dec 2018 08:39:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 443442A98D; Mon, 3 Dec 2018 08:39:19 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B38B02A967 for ; Mon, 3 Dec 2018 08:39:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725933AbeLCIjO (ORCPT ); Mon, 3 Dec 2018 03:39:14 -0500 Received: from mail-eopbgr40047.outbound.protection.outlook.com ([40.107.4.47]:21654 "EHLO EUR03-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725851AbeLCIjO (ORCPT ); Mon, 3 Dec 2018 03:39:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JwpmnhJYKSxWI/smX6DS9cVPW0aQ+K6nMhBM1K8RUjc=; b=XSSC8sMiZnjPIrKzuNm4HPkvHn6JeYlBYrVRYq52368+CKXw/xfLEj8A5hsVTTGLM8MDnQssAMRQ6Gpvvj+Tu+ukFRqUBvLUwlxXwr8Gql5tVmSur6/LeQdr/jrivFscn7XgNSh3LwNMInk5bWPzZkgVpCrrK5X3IAvfCrNStPc= Received: from VI1PR04MB5726.eurprd04.prod.outlook.com (20.178.127.24) by VI1PR04MB4718.eurprd04.prod.outlook.com (20.177.48.159) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1382.22; Mon, 3 Dec 2018 08:39:06 +0000 Received: from VI1PR04MB5726.eurprd04.prod.outlook.com ([fe80::595a:9890:8397:5d51]) by VI1PR04MB5726.eurprd04.prod.outlook.com ([fe80::595a:9890:8397:5d51%4]) with mapi id 15.20.1382.020; Mon, 3 Dec 2018 08:39:06 +0000 From: Yogesh Narayan Gaur To: "linux-mtd@lists.infradead.org" , "boris.brezillon@bootlin.com" , "broonie@kernel.org" , "marek.vasut@gmail.com" , "vigneshr@ti.com" , "linux-spi@vger.kernel.org" , "devicetree@vger.kernel.org" CC: "robh@kernel.org" , "mark.rutland@arm.com" , "shawnguo@kernel.org" , "linux-arm-kernel@lists.infradead.org" , "computersforpeace@gmail.com" , "frieder.schrempf@exceet.de" , "linux-kernel@vger.kernel.org" , Yogesh Narayan Gaur Subject: [PATCH v5 1/7] spi: add support for octal mode I/O data transfer Thread-Topic: [PATCH v5 1/7] spi: add support for octal mode I/O data transfer Thread-Index: AQHUiuOnnN1e2/pCsEWSJd8HL2GM2A== Date: Mon, 3 Dec 2018 08:39:06 +0000 Message-ID: <1543826226-30898-2-git-send-email-yogeshnarayan.gaur@nxp.com> References: <1543826226-30898-1-git-send-email-yogeshnarayan.gaur@nxp.com> In-Reply-To: <1543826226-30898-1-git-send-email-yogeshnarayan.gaur@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: SG2PR04CA0143.apcprd04.prod.outlook.com (2603:1096:3:16::27) To VI1PR04MB5726.eurprd04.prod.outlook.com (2603:10a6:803:e4::24) authentication-results: spf=none (sender IP is ) smtp.mailfrom=yogeshnarayan.gaur@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [14.143.30.134] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;VI1PR04MB4718;6:77AOlIlifkJa2jxl+u29EB6V8uewPQP5yKENK5Jfa6jhKpl2MCHcMxoecpdfLvFaWD18ed8P/RvTfsMd6zZXMlztpd/X10/9xj/zUqIMdp6foR00/JJa/iRhTWaNoxCpNunJffjCWTatRT7/K8OWJpHwBO2H3TQvNsZPfS7IidglK7f4R34QguPBIJoXHQvHNuUUX3Rm7Z3lsvR9Dc/Ykcwtf9N/ZJpicLWW8g+Ba7aVnKje5DmgfXqjj7Uvv0ntP1RcIIhJ+1/0IpEyqGdnJoSYMnP0MYrrPCI0IvNs1bXYtUZW60AclS5i+h5E1Va1oaPboI/10KS4d7sd80ltelCp/qvf2O9zTccWuB1AWKHniRXmmdx50H60BXdvnKx4WedaWFZscaUwGG9554ZbQ6e69X36nCkpc8UwkYq5+TddPfXs4O4Ds9eiFiEecbKxs6KquescT0GUK+P27+CfZQ==;5:prAfx4itjM9ov4NNSKXOH+3qvYnUzpOCLnQ/1oUP67bQX1CPqcYa/cRV9PUDSlBxjLWpAz0cVkkWW7OeGi9APNP6CcyISpZfuZAUWej1VzC5acYDvLLoHhYr0e2L+gF8at1Vht3gLBOXn42vmuMcHtWAGSV5QcDGGA1kr0dk/CM=;7:P8AjbGMtlytgYBgrUOA5INsGWv6YsG3HApC69lSFfcKAXz58wep13xxumuaZy6CFLlEhFcNuOyigG3t7dEsr3XJCQK+17/knJr89l9ylTqvBI9hr2jcGLIC/o4vWQeQNG/+JMfsXOGjxSr/rdITr0A== x-ms-office365-filtering-correlation-id: 0f4eb8d1-26e6-406e-dfff-08d658fac930 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390098)(7020095)(4652040)(8989299)(5600074)(711020)(4618075)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020);SRVR:VI1PR04MB4718; x-ms-traffictypediagnostic: VI1PR04MB4718: x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(3231455)(999002)(944501493)(52105112)(3002001)(10201501046)(6055026)(148016)(149066)(150057)(6041310)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123560045)(20161123558120)(201708071742011)(7699051)(76991095);SRVR:VI1PR04MB4718;BCL:0;PCL:0;RULEID:;SRVR:VI1PR04MB4718; x-forefront-prvs: 08756AC3C8 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(346002)(376002)(396003)(136003)(366004)(39860400002)(199004)(189003)(7736002)(99286004)(6486002)(76176011)(305945005)(6512007)(6506007)(53936002)(66066001)(386003)(105586002)(106356001)(68736007)(256004)(71190400001)(71200400001)(5660300001)(110136005)(55236004)(54906003)(7416002)(14454004)(86362001)(478600001)(575784001)(6116002)(3846002)(25786009)(186003)(2201001)(2501003)(97736004)(2906002)(81156014)(81166006)(6436002)(8676002)(4326008)(486006)(78486014)(36756003)(102836004)(52116002)(26005)(39060400002)(2616005)(8936002)(446003)(11346002)(316002)(476003);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR04MB4718;H:VI1PR04MB5726.eurprd04.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: mbX1AN693ki/aVaHhyAfXzQ/xc5AdtKpRGnfzkZYlBBQjVmNko9TlbX6XDtsY3KMJ0+JYIUwXStFJ8RnqEr9UojdvFduiqt7XUf3QvTRCxsNHKaMG9D882Dik8K8BcpqKezVGSpLzbAYzPPoylvcnZWcu/ScQxXWvM0WRyfgcf4QhhbF8xFChHebirWKnBChX1S+02wYo1B6CGuCuZhbfVhhAgadSSjFCxc1jDNuaVjSAzsVSucCcIYR9D2zPL6zFwBCGpgnL2KpxPMCOrwDFh+8HDFpdmvF+XhKWP12YwJBVA6ySanHlTDNe0AqqqZkNYAERlVMANdtkTk9/G0ei6OTVFo77Z3+exyK2srByuc= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0f4eb8d1-26e6-406e-dfff-08d658fac930 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Dec 2018 08:39:06.6280 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB4718 Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add flags for Octal mode I/O data transfer Required for the SPI controller which can do the data transfer (TX/RX) on 8 data lines e.g. NXP FlexSPI controller. SPI_TX_OCTAL: transmit with 8 wires SPI_RX_OCTAL: receive with 8 wires Signed-off-by: Yogesh Gaur Reviewed-by: Boris Brezillon --- Changes for v5: - Modified string 'octo' with 'octal'. Changes for v4: - Rebase on top of v4.20-rc2 Changes for v3: - Modified string 'octal' with 'octo'. - Add octo mode support in spi_setup(). Changes for v2: - Incorporated review comments of Boris. --- drivers/spi/spi.c | 12 ++++++++++-- include/linux/spi/spi.h | 4 +++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index 6ca5940..95249b8 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -1617,6 +1617,9 @@ static int of_spi_parse_dt(struct spi_controller *ctlr, struct spi_device *spi, case 4: spi->mode |= SPI_TX_QUAD; break; + case 8: + spi->mode |= SPI_TX_OCTAL; + break; default: dev_warn(&ctlr->dev, "spi-tx-bus-width %d not supported\n", @@ -1635,6 +1638,9 @@ static int of_spi_parse_dt(struct spi_controller *ctlr, struct spi_device *spi, case 4: spi->mode |= SPI_RX_QUAD; break; + case 8: + spi->mode |= SPI_RX_OCTAL; + break; default: dev_warn(&ctlr->dev, "spi-rx-bus-width %d not supported\n", @@ -2823,7 +2829,8 @@ int spi_setup(struct spi_device *spi) /* if it is SPI_3WIRE mode, DUAL and QUAD should be forbidden */ if ((spi->mode & SPI_3WIRE) && (spi->mode & - (SPI_TX_DUAL | SPI_TX_QUAD | SPI_RX_DUAL | SPI_RX_QUAD))) + (SPI_TX_DUAL | SPI_TX_QUAD | SPI_TX_OCTAL | + SPI_RX_DUAL | SPI_RX_QUAD | SPI_RX_OCTAL))) return -EINVAL; /* help drivers fail *cleanly* when they need options * that aren't supported with their current controller @@ -2832,7 +2839,8 @@ int spi_setup(struct spi_device *spi) */ bad_bits = spi->mode & ~(spi->controller->mode_bits | SPI_CS_WORD); ugly_bits = bad_bits & - (SPI_TX_DUAL | SPI_TX_QUAD | SPI_RX_DUAL | SPI_RX_QUAD); + (SPI_TX_DUAL | SPI_TX_QUAD | SPI_TX_OCTAL | + SPI_RX_DUAL | SPI_RX_QUAD | SPI_RX_OCTAL); if (ugly_bits) { dev_warn(&spi->dev, "setup: ignoring unsupported mode bits %x\n", diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h index 6be77fa..0c1ca5d 100644 --- a/include/linux/spi/spi.h +++ b/include/linux/spi/spi.h @@ -154,7 +154,9 @@ struct spi_device { #define SPI_TX_QUAD 0x200 /* transmit with 4 wires */ #define SPI_RX_DUAL 0x400 /* receive with 2 wires */ #define SPI_RX_QUAD 0x800 /* receive with 4 wires */ -#define SPI_CS_WORD 0x1000 /* toggle cs after each word */ +#define SPI_CS_WORD 0x1000 /* toggle cs after each word */ +#define SPI_TX_OCTAL 0x2000 /* transmit with 8 wires */ +#define SPI_RX_OCTAL 0x4000 /* receive with 8 wires */ int irq; void *controller_state; void *controller_data; From patchwork Mon Dec 3 08:39:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yogesh Narayan Gaur X-Patchwork-Id: 10708859 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 987311923 for ; Mon, 3 Dec 2018 08:39:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 897B12A967 for ; Mon, 3 Dec 2018 08:39:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7E0A72A98D; Mon, 3 Dec 2018 08:39:34 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2737F2A967 for ; Mon, 3 Dec 2018 08:39:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726006AbeLCIjf (ORCPT ); Mon, 3 Dec 2018 03:39:35 -0500 Received: from mail-eopbgr40048.outbound.protection.outlook.com ([40.107.4.48]:28530 "EHLO EUR03-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725972AbeLCIje (ORCPT ); Mon, 3 Dec 2018 03:39:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=f41rnt96SvdthS7O5jlUA/vrvi9zMYYN/scOWbrhfgE=; b=HLGIgAs9aLe7bmaEat013P7r9NuEvUIuWfXbArGaLElB7kE+vSrsQ1BT2d+4BZYtb6Y/59sCgk1Lp90Wfq6BkPQ9kWM5WhjK3Xyw85LlS1PeMeJx0P7oLyVtf7AwVAlRGnNqnXVRfIaeGtu6lv0cMgAxZtMzxrBpNJEXaz7osTs= Received: from VI1PR04MB5726.eurprd04.prod.outlook.com (20.178.127.24) by VI1PR04MB4718.eurprd04.prod.outlook.com (20.177.48.159) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1382.22; Mon, 3 Dec 2018 08:39:12 +0000 Received: from VI1PR04MB5726.eurprd04.prod.outlook.com ([fe80::595a:9890:8397:5d51]) by VI1PR04MB5726.eurprd04.prod.outlook.com ([fe80::595a:9890:8397:5d51%4]) with mapi id 15.20.1382.020; Mon, 3 Dec 2018 08:39:12 +0000 From: Yogesh Narayan Gaur To: "linux-mtd@lists.infradead.org" , "boris.brezillon@bootlin.com" , "broonie@kernel.org" , "marek.vasut@gmail.com" , "vigneshr@ti.com" , "linux-spi@vger.kernel.org" , "devicetree@vger.kernel.org" CC: "robh@kernel.org" , "mark.rutland@arm.com" , "shawnguo@kernel.org" , "linux-arm-kernel@lists.infradead.org" , "computersforpeace@gmail.com" , "frieder.schrempf@exceet.de" , "linux-kernel@vger.kernel.org" , Yogesh Narayan Gaur Subject: [PATCH v5 2/7] spi: spi-mem: add support for octal mode I/O data transfer Thread-Topic: [PATCH v5 2/7] spi: spi-mem: add support for octal mode I/O data transfer Thread-Index: AQHUiuOqs754sHK/OUuJcru4Pd1jiw== Date: Mon, 3 Dec 2018 08:39:12 +0000 Message-ID: <1543826226-30898-3-git-send-email-yogeshnarayan.gaur@nxp.com> References: <1543826226-30898-1-git-send-email-yogeshnarayan.gaur@nxp.com> In-Reply-To: <1543826226-30898-1-git-send-email-yogeshnarayan.gaur@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: SG2PR04CA0143.apcprd04.prod.outlook.com (2603:1096:3:16::27) To VI1PR04MB5726.eurprd04.prod.outlook.com (2603:10a6:803:e4::24) authentication-results: spf=none (sender IP is ) smtp.mailfrom=yogeshnarayan.gaur@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [14.143.30.134] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;VI1PR04MB4718;6:Qx+cV9ne6KQA2sf6U1Hp5Eo74OJmBsiQT9+0yTvRaFD1Pg8DRX/UJgN2NfoapLwJu+sggqCtA2dzD3pC9B4GI/88XfLnyj7i8TxV8L6ioriBu30umurLv/+PMImvM7P4SmfkmICwrKWKdy/uGF37WoaMw5iRVYthlcIjXe5WZR4ID2GoCNkM2XtOkzRod2WEXgp/Ao+LbQN4blYCxag/36koeeo6Q2jx3dLaUwIcp9U05tZO4x8oeHxPPfc2K8INycjF+G3zewDRAM9luNS3ZgZXh113N4T/cvzK2BPKLsVzluHMPsDdR9wmoHv2t3cQrNzWv3RBPV2avPj4Xp2rAehbmfvRjDew5TMfzzshQ6x+25KTN2u9+LZfFZErYYvPTUesX87zQ53g3zVB0ffnib5Buq4B2p/LgXR0wXDmkjGfoISkuXE8ZuijfdX414M/Q2aBdAvJzfJS8hbtAQYWWw==;5:Wa8h98BENLIXRZsHtfvRi+4E0ZKAn4I67E/nnlYm55/IOB9k6rPGtJ1Y6MVfPyviJe087AIqLVZbRdVE3MZpnD9bZ0wFp9bHS6+sjZo9jUiIzOFlNGCXlPhnfbi3FDHi4fQ3vOYrb5biExveqvKO5J/Qi4EwfIjGA+32VC1Gfm4=;7:hSQrowTCPOUKVJvZZ0DZ9YfHxsBYHCahuc4LtL/7+4oaTKdoa/6VYHsvNQ8Vf/Tb8lZQx+c6EUhsec2+vrT0tS9DagwGaqgZMAYogRneH5wQEpDoeiOqI0xr6BO7Bhogaw3KQbqT3MtUlhuN/G/elA== x-ms-office365-filtering-correlation-id: 046d275f-e531-4ae5-708c-08d658facce3 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390098)(7020095)(4652040)(8989299)(5600074)(711020)(4618075)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020);SRVR:VI1PR04MB4718; x-ms-traffictypediagnostic: VI1PR04MB4718: x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(3231455)(999002)(944501493)(52105112)(3002001)(10201501046)(6055026)(148016)(149066)(150057)(6041310)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123560045)(20161123558120)(201708071742011)(7699051)(76991095);SRVR:VI1PR04MB4718;BCL:0;PCL:0;RULEID:;SRVR:VI1PR04MB4718; x-forefront-prvs: 08756AC3C8 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(346002)(376002)(396003)(136003)(366004)(39860400002)(199004)(189003)(7736002)(99286004)(6486002)(76176011)(305945005)(6512007)(6506007)(53936002)(66066001)(386003)(105586002)(106356001)(68736007)(256004)(71190400001)(71200400001)(5660300001)(5024004)(110136005)(55236004)(14444005)(54906003)(7416002)(14454004)(86362001)(478600001)(6116002)(3846002)(25786009)(186003)(2201001)(2501003)(97736004)(2906002)(81156014)(81166006)(6436002)(8676002)(4326008)(486006)(78486014)(36756003)(102836004)(52116002)(26005)(39060400002)(2616005)(8936002)(446003)(11346002)(316002)(476003);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR04MB4718;H:VI1PR04MB5726.eurprd04.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: EpIN1i1cKiXAcYZrEm1wX+XfNHKAGtaq+M+4gJxEJP//HQO8DjM9G1TnuWLxP2JfqboKfoY4NvwV04T5SQborFDz8FmGIh3JH2g3gB1z1Kz3+AkGcLYO2+W0nxGOY4/OdT7tufWidgdrhB+wMJktfr7QFvh6M18Gasr1l1WhfhtO2Hw09yB7RTN/TeQlQYd700989pWI1luk+lT1enFawUhiIa54379ONz8qgwgbOzXkP+opUc2JQXF1Zn7Ryzd9MgUmSiYUl+oqrayL274CSZL8zR4r/oeCKwGzdM4llz6F+QpFRR2ENDLxAc7VajV3nbwl7/ZvbvSSDNKyPpTu/ewaY5PjVxMYWytPU3S/ick= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 046d275f-e531-4ae5-708c-08d658facce3 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Dec 2018 08:39:12.5942 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB4718 Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add support for octal mode I/O data transfer in spi-mem framework. Signed-off-by: Yogesh Gaur Reviewed-by: Boris Brezillon --- Changes for v5: - Modified string 'octo' with 'octal'. Changes for v4: - None Changes for v3: - Modified string 'octal' with 'octo'. Changes for v2: - Patch added in v2 version. drivers/spi/spi-mem.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/spi/spi-mem.c b/drivers/spi/spi-mem.c index 62a7b80..5e15d62 100644 --- a/drivers/spi/spi-mem.c +++ b/drivers/spi/spi-mem.c @@ -12,7 +12,7 @@ #include "internals.h" -#define SPI_MEM_MAX_BUSWIDTH 4 +#define SPI_MEM_MAX_BUSWIDTH 8 /** * spi_controller_dma_map_mem_op_data() - DMA-map the buffer attached to a @@ -121,6 +121,13 @@ static int spi_check_buswidth_req(struct spi_mem *mem, u8 buswidth, bool tx) break; + case 8: + if ((tx && (mode & SPI_TX_OCTAL)) || + (!tx && (mode & SPI_RX_OCTAL))) + return 0; + + break; + default: break; } From patchwork Mon Dec 3 08:39:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yogesh Narayan Gaur X-Patchwork-Id: 10708887 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 907D513BF for ; Mon, 3 Dec 2018 08:40:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7FF7A2A967 for ; Mon, 3 Dec 2018 08:40:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 740962A98D; Mon, 3 Dec 2018 08:40:18 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D65CE2A967 for ; Mon, 3 Dec 2018 08:40:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726013AbeLCIjh (ORCPT ); Mon, 3 Dec 2018 03:39:37 -0500 Received: from mail-eopbgr40048.outbound.protection.outlook.com ([40.107.4.48]:28530 "EHLO EUR03-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725981AbeLCIjg (ORCPT ); Mon, 3 Dec 2018 03:39:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=SUFIqMUmU7aVctiSrOoJnSAVup/dBqZmvL17Uyu0wD4=; b=XF6mRQakO2MnxJVLEusg0aNfmjN8JRifes0+FHJ0gWJXsDzKKVHMPDfZJteKpL7x0y2ZoWpid0iB+YhXoh5iyPbtO7EWTF3ciUo80LgZF6hUJcOeDNjnH8yFPVPq+RqKjrhGuz43H/soUXFZvxc4uhnr8UOGfNAK7QJ6teSsFtA= Received: from VI1PR04MB5726.eurprd04.prod.outlook.com (20.178.127.24) by VI1PR04MB4718.eurprd04.prod.outlook.com (20.177.48.159) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1382.22; Mon, 3 Dec 2018 08:39:29 +0000 Received: from VI1PR04MB5726.eurprd04.prod.outlook.com ([fe80::595a:9890:8397:5d51]) by VI1PR04MB5726.eurprd04.prod.outlook.com ([fe80::595a:9890:8397:5d51%4]) with mapi id 15.20.1382.020; Mon, 3 Dec 2018 08:39:29 +0000 From: Yogesh Narayan Gaur To: "linux-mtd@lists.infradead.org" , "boris.brezillon@bootlin.com" , "broonie@kernel.org" , "marek.vasut@gmail.com" , "vigneshr@ti.com" , "linux-spi@vger.kernel.org" , "devicetree@vger.kernel.org" CC: "robh@kernel.org" , "mark.rutland@arm.com" , "shawnguo@kernel.org" , "linux-arm-kernel@lists.infradead.org" , "computersforpeace@gmail.com" , "frieder.schrempf@exceet.de" , "linux-kernel@vger.kernel.org" , Yogesh Narayan Gaur Subject: [PATCH v5 3/7] mtd: spi-nor: add opcodes for octal Read/Write commands Thread-Topic: [PATCH v5 3/7] mtd: spi-nor: add opcodes for octal Read/Write commands Thread-Index: AQHUiuOuxIvwGhR/Ik2nR/UOeUIxtQ== Date: Mon, 3 Dec 2018 08:39:18 +0000 Message-ID: <1543826226-30898-4-git-send-email-yogeshnarayan.gaur@nxp.com> References: <1543826226-30898-1-git-send-email-yogeshnarayan.gaur@nxp.com> In-Reply-To: <1543826226-30898-1-git-send-email-yogeshnarayan.gaur@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: SG2PR04CA0143.apcprd04.prod.outlook.com (2603:1096:3:16::27) To VI1PR04MB5726.eurprd04.prod.outlook.com (2603:10a6:803:e4::24) authentication-results: spf=none (sender IP is ) smtp.mailfrom=yogeshnarayan.gaur@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [14.143.30.134] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;VI1PR04MB4718;6:ScpS29w2hKBbO10PnIp1nMXhUmCILlOkcmfelVtcgkBS7peX+/Fqoj2jhoZyWQbvcRTXR2alN9HWOzm21+kaXlDK3UQo3NJKtmrVNdkxybx2JpbCeZdM/iEqPUQyxx9DWFKa4/ZbggRCan8CLtzkerYrORjh/Jp+RdymGOPwWoUFwsIKeCLdjNIqsOBFHj6oEhOyRIv36Z7KSKMMzK54ONF20qG6Lfc1i7slIsUl7PwSVYDyu6g0WiwvkUsU/e8IRrauD0F9s+xqJf+tqhlfFsLSddUdpC9yMYMEj+U6l6GgFudydS+1BGTw06hQdKB8/CYK/JZJdiigm1DPVC5JrbRj9DA/b7YaisYiX4aMIxvjk6frLgAXtv2YTPfLUBT5W8L9pu/k04URWAuBe+BU6Xl9BVb3mbtJZ0YAb+x1NX05fpQy1KNjT7TCxuUSqVmaRnlcNrII98UT4S3Od1ICrw==;5:hQAiWoI7eFgohmjOpYH5nPsPdv1LeFIt34i42B2g8MHT7eOswOENrVTyyllQOafpbqxpjWXiXVKTB1obaI2TjNuz/ICF+60qjVWHQdZkw2TEgGHYA6gIu8+COjOoJxXn1/9cepjL5UwcEsvXtlcdq1v+JbQbx8HWs4FQ9DMj8cI=;7:17BgCgL1NhdR2HuQlRuiicwrcanqG2Ko5K5eAas76bhlTB2efhqpypQE9RmSPQ0JpgfAAwNzp2pQn7l8ToYewcZBOvi+oVu8zIeI+kkLK4WIE8LV7qJB3x06tzCRhHWahxQ2vnZGZPqveI+NeJ568A== x-ms-office365-filtering-correlation-id: 1e4d7252-0144-4f82-a31a-08d658fad073 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390098)(7020095)(4652040)(8989299)(5600074)(711020)(4618075)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020);SRVR:VI1PR04MB4718; x-ms-traffictypediagnostic: VI1PR04MB4718: x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(3231455)(999002)(944501493)(52105112)(3002001)(10201501046)(6055026)(148016)(149066)(150057)(6041310)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123560045)(20161123558120)(201708071742011)(7699051)(76991095);SRVR:VI1PR04MB4718;BCL:0;PCL:0;RULEID:;SRVR:VI1PR04MB4718; x-forefront-prvs: 08756AC3C8 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(346002)(376002)(396003)(136003)(366004)(39860400002)(199004)(189003)(7736002)(99286004)(6486002)(76176011)(305945005)(6512007)(6506007)(53936002)(66066001)(386003)(105586002)(106356001)(68736007)(256004)(71190400001)(71200400001)(5660300001)(110136005)(55236004)(54906003)(7416002)(14454004)(86362001)(478600001)(575784001)(6116002)(3846002)(25786009)(186003)(6666004)(2201001)(2501003)(97736004)(2906002)(81156014)(81166006)(6436002)(8676002)(4326008)(486006)(78486014)(36756003)(102836004)(52116002)(26005)(39060400002)(2616005)(8936002)(446003)(11346002)(316002)(476003)(21314003);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR04MB4718;H:VI1PR04MB5726.eurprd04.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: wEpH0U5EPJS0Ssdp4h0uT0wSHgqEu+FAocipzTYiKoCMnwXFjGewZ63oI+e3gTNxtIYNqDYgg/RppdkKC4LzEyCCUC6sH+tZ5Lg0GqMgrfp42KSwRhsL+DToJ910NDF3955fv8xYVKzqarictNq5rix/LhSqcI3zmsjCX+lUEWBOmsuZMgWSBd2rwlnIOEnqsG3BGmC2ggYItWI8jUQyQ6tGJYT6K1jgdGuCMFJJsYRO3OM6GBP48cHJiAxChbeTb+3koUkPkV3+QxPbcPRGUIcTccWm+SrkuWuhQ5depj7PwydZBJSSdJPYCgFTaNDggQXNMX39DOjYX6opt0yAPX8R6GpSDDJSCZEDsbG1lWY= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1e4d7252-0144-4f82-a31a-08d658fad073 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Dec 2018 08:39:18.5784 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB4718 Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP - Add opcodes for octal I/O commands * Read : 1-1-8 and 1-8-8 protocol * Write : 1-1-8 and 1-8-8 protocol * opcodes for 4-byte address mode command - Entry of macros in _convert_3to4_xxx function - Add flag specifying flash support octal read commands. Signed-off-by: Vignesh R Signed-off-by: Yogesh Gaur --- Changes for v5: - Modified string 'octo' with 'octal'. Changes for v4: - None Changes for v3: - Modified string 'octal' with 'octo'. Changes for v2: - Incorporated review comments of Boris and Vignesh drivers/mtd/spi-nor/spi-nor.c | 16 ++++++++++++++-- include/linux/mtd/spi-nor.h | 8 ++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c index 398d273..7a2176d 100644 --- a/drivers/mtd/spi-nor/spi-nor.c +++ b/drivers/mtd/spi-nor/spi-nor.c @@ -90,6 +90,7 @@ struct flash_info { #define NO_CHIP_ERASE BIT(12) /* Chip does not support chip erase */ #define SPI_NOR_SKIP_SFDP BIT(13) /* Skip parsing of SFDP tables */ #define USE_CLSR BIT(14) /* use CLSR command */ +#define SPI_NOR_OCTAL_READ BIT(15) /* Flash supports Octal Read */ int (*quad_enable)(struct spi_nor *nor); }; @@ -209,6 +210,8 @@ static inline u8 spi_nor_convert_3to4_read(u8 opcode) { SPINOR_OP_READ_1_2_2, SPINOR_OP_READ_1_2_2_4B }, { SPINOR_OP_READ_1_1_4, SPINOR_OP_READ_1_1_4_4B }, { SPINOR_OP_READ_1_4_4, SPINOR_OP_READ_1_4_4_4B }, + { SPINOR_OP_READ_1_1_8, SPINOR_OP_READ_1_1_8_4B }, + { SPINOR_OP_READ_1_8_8, SPINOR_OP_READ_1_8_8_4B }, { SPINOR_OP_READ_1_1_1_DTR, SPINOR_OP_READ_1_1_1_DTR_4B }, { SPINOR_OP_READ_1_2_2_DTR, SPINOR_OP_READ_1_2_2_DTR_4B }, @@ -225,6 +228,8 @@ static inline u8 spi_nor_convert_3to4_program(u8 opcode) { SPINOR_OP_PP, SPINOR_OP_PP_4B }, { SPINOR_OP_PP_1_1_4, SPINOR_OP_PP_1_1_4_4B }, { SPINOR_OP_PP_1_4_4, SPINOR_OP_PP_1_4_4_4B }, + { SPINOR_OP_PP_1_1_8, SPINOR_OP_PP_1_1_8_4B }, + { SPINOR_OP_PP_1_8_8, SPINOR_OP_PP_1_8_8_4B }, }; return spi_nor_convert_opcode(opcode, spi_nor_3to4_program, @@ -2093,7 +2098,7 @@ enum spi_nor_read_command_index { SNOR_CMD_READ_4_4_4, SNOR_CMD_READ_1_4_4_DTR, - /* Octo SPI */ + /* Octal SPI */ SNOR_CMD_READ_1_1_8, SNOR_CMD_READ_1_8_8, SNOR_CMD_READ_8_8_8, @@ -2110,7 +2115,7 @@ enum spi_nor_pp_command_index { SNOR_CMD_PP_1_4_4, SNOR_CMD_PP_4_4_4, - /* Octo SPI */ + /* Octal SPI */ SNOR_CMD_PP_1_1_8, SNOR_CMD_PP_1_8_8, SNOR_CMD_PP_8_8_8, @@ -3195,6 +3200,13 @@ static int spi_nor_init_params(struct spi_nor *nor, SNOR_PROTO_1_1_4); } + if (info->flags & SPI_NOR_OCTAL_READ) { + params->hwcaps.mask |= SNOR_HWCAPS_READ_1_1_8; + spi_nor_set_read_settings(¶ms->reads[SNOR_CMD_READ_1_1_8], + 0, 8, SPINOR_OP_READ_1_1_8, + SNOR_PROTO_1_1_8); + } + /* Page Program settings. */ params->hwcaps.mask |= SNOR_HWCAPS_PP; spi_nor_set_pp_settings(¶ms->page_programs[SNOR_CMD_PP], diff --git a/include/linux/mtd/spi-nor.h b/include/linux/mtd/spi-nor.h index 8b1acf6..019f534 100644 --- a/include/linux/mtd/spi-nor.h +++ b/include/linux/mtd/spi-nor.h @@ -50,9 +50,13 @@ #define SPINOR_OP_READ_1_2_2 0xbb /* Read data bytes (Dual I/O SPI) */ #define SPINOR_OP_READ_1_1_4 0x6b /* Read data bytes (Quad Output SPI) */ #define SPINOR_OP_READ_1_4_4 0xeb /* Read data bytes (Quad I/O SPI) */ +#define SPINOR_OP_READ_1_1_8 0x8b /* Read data bytes (Octal Output SPI) */ +#define SPINOR_OP_READ_1_8_8 0xcb /* Read data bytes (Octal I/O SPI) */ #define SPINOR_OP_PP 0x02 /* Page program (up to 256 bytes) */ #define SPINOR_OP_PP_1_1_4 0x32 /* Quad page program */ #define SPINOR_OP_PP_1_4_4 0x38 /* Quad page program */ +#define SPINOR_OP_PP_1_1_8 0x82 /* Octal page program */ +#define SPINOR_OP_PP_1_8_8 0xc2 /* Octal page program */ #define SPINOR_OP_BE_4K 0x20 /* Erase 4KiB block */ #define SPINOR_OP_BE_4K_PMC 0xd7 /* Erase 4KiB block on PMC chips */ #define SPINOR_OP_BE_32K 0x52 /* Erase 32KiB block */ @@ -73,9 +77,13 @@ #define SPINOR_OP_READ_1_2_2_4B 0xbc /* Read data bytes (Dual I/O SPI) */ #define SPINOR_OP_READ_1_1_4_4B 0x6c /* Read data bytes (Quad Output SPI) */ #define SPINOR_OP_READ_1_4_4_4B 0xec /* Read data bytes (Quad I/O SPI) */ +#define SPINOR_OP_READ_1_1_8_4B 0x7c /* Read data bytes (Octal Output SPI) */ +#define SPINOR_OP_READ_1_8_8_4B 0xcc /* Read data bytes (Octal I/O SPI) */ #define SPINOR_OP_PP_4B 0x12 /* Page program (up to 256 bytes) */ #define SPINOR_OP_PP_1_1_4_4B 0x34 /* Quad page program */ #define SPINOR_OP_PP_1_4_4_4B 0x3e /* Quad page program */ +#define SPINOR_OP_PP_1_1_8_4B 0x84 /* Octal page program */ +#define SPINOR_OP_PP_1_8_8_4B 0x8e /* Octal page program */ #define SPINOR_OP_BE_4K_4B 0x21 /* Erase 4KiB block */ #define SPINOR_OP_BE_32K_4B 0x5c /* Erase 32KiB block */ #define SPINOR_OP_SE_4B 0xdc /* Sector erase (usually 64KiB) */ From patchwork Mon Dec 3 08:39:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yogesh Narayan Gaur X-Patchwork-Id: 10708863 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 491BE13BF for ; Mon, 3 Dec 2018 08:39:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 39A342A967 for ; Mon, 3 Dec 2018 08:39:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2D23E2A98D; Mon, 3 Dec 2018 08:39:40 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BE0472A967 for ; Mon, 3 Dec 2018 08:39:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726061AbeLCIjk (ORCPT ); Mon, 3 Dec 2018 03:39:40 -0500 Received: from mail-eopbgr40048.outbound.protection.outlook.com ([40.107.4.48]:28530 "EHLO EUR03-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725968AbeLCIjj (ORCPT ); Mon, 3 Dec 2018 03:39:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ba50Ajsom308Fg+wGmvSmyjyiBF/sabuHpSIY8OQ4rk=; b=Gb/GQkcpTf+8xIoxW4IUCWmYfPInjIzcqbv6XKU/2vmjbExnOFrD5Krg1msq/jkQ7WlTEi3PETWNu4RAaznIywtYbdN7V54DQj4n85zCC1/unCwZ/qlmFIvIOt4nc9NPmAyqLyswVJM0KN0If2ZA/Dk1Btx6yRW72k+zNbQLlhM= Received: from VI1PR04MB5726.eurprd04.prod.outlook.com (20.178.127.24) by VI1PR04MB4718.eurprd04.prod.outlook.com (20.177.48.159) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1382.22; Mon, 3 Dec 2018 08:39:29 +0000 Received: from VI1PR04MB5726.eurprd04.prod.outlook.com ([fe80::595a:9890:8397:5d51]) by VI1PR04MB5726.eurprd04.prod.outlook.com ([fe80::595a:9890:8397:5d51%4]) with mapi id 15.20.1382.020; Mon, 3 Dec 2018 08:39:29 +0000 From: Yogesh Narayan Gaur To: "linux-mtd@lists.infradead.org" , "boris.brezillon@bootlin.com" , "broonie@kernel.org" , "marek.vasut@gmail.com" , "vigneshr@ti.com" , "linux-spi@vger.kernel.org" , "devicetree@vger.kernel.org" CC: "robh@kernel.org" , "mark.rutland@arm.com" , "shawnguo@kernel.org" , "linux-arm-kernel@lists.infradead.org" , "computersforpeace@gmail.com" , "frieder.schrempf@exceet.de" , "linux-kernel@vger.kernel.org" , Yogesh Narayan Gaur Subject: [PATCH v5 4/7] mtd: spi-nor: add octal read flag for flash mt35xu512aba Thread-Topic: [PATCH v5 4/7] mtd: spi-nor: add octal read flag for flash mt35xu512aba Thread-Index: AQHUiuOxFPwCvKBFZESsU4tLrDaSzQ== Date: Mon, 3 Dec 2018 08:39:24 +0000 Message-ID: <1543826226-30898-5-git-send-email-yogeshnarayan.gaur@nxp.com> References: <1543826226-30898-1-git-send-email-yogeshnarayan.gaur@nxp.com> In-Reply-To: <1543826226-30898-1-git-send-email-yogeshnarayan.gaur@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: SG2PR04CA0143.apcprd04.prod.outlook.com (2603:1096:3:16::27) To VI1PR04MB5726.eurprd04.prod.outlook.com (2603:10a6:803:e4::24) authentication-results: spf=none (sender IP is ) smtp.mailfrom=yogeshnarayan.gaur@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [14.143.30.134] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;VI1PR04MB4718;6:VnZjg6QPTpyxHX2ok7qXWy9il1KqKdYYK0kPEv3vsyuc9BkgZQwon/jwGmTNZcI+VtMoJKsOkaLbivLDUC5UHKOtpAcewBjBWSfzj+GTnJae8olwZuk9fc3ajAPHxRmgXGcrOoaTmaXO+A0C2CpLe3BwIRsSwtb02j1jcOb4YiEm/uZz3hekpSOwcCM/qRWxLrP7byVpFEh8O4ZhogotZJow7CGMqnUF0C6g7rzXNKolZhEHjKPdxB8nOMu3RsoGkT5tjRnBerqN0i5e81KEpE9ACr8VPRwEnxTNls8s9DCvSZRmazA+fTyPTULSJFjQvZMGU/AHW1hX2TtC+NHNkupVcI1vUDjG4WsCh8GHOj21TngeqMR7yyNt5tcsP70eOoQvb95X3g+uCk62Spz+h0nkT8JF+xw7Ezc18lYhtbsG7gogSze1Qh2HXrEs6jDWvjLX85jPm0XGqNnjaqTpOw==;5:pCmNL92N4r1kx3jbekIYmixOgEdTFUSeVHnx0nlsodxQbIaLbiYnTMx/wWhfGw3XFlUJhPnf1ToyEmbBV+nNQKWXTYhQ0mzlP75GwXmd+rnAVdwN6lyCJdLF+F3fC6uCoZKIH0//KLCoagdjArGfSH/SxVWprk/61ZGCkdEfU4E=;7:m2ld70cdQK15U5SovBy0FWdgq0a9VCjN9cxKVQZzt7HPgg+OvHeIOuZ/C/r9bTh4tBUk3xi2K6ckPPLa3vL4DkNEkE1kRoQNVApR2Ig+tvdG0CJP3fsMknsKyarWLe0t8eCVKCZk42Z0F2mzfOIMwQ== x-ms-office365-filtering-correlation-id: 16318705-d4e6-4aa4-d5a3-08d658fad403 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390098)(7020095)(4652040)(8989299)(5600074)(711020)(4618075)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020);SRVR:VI1PR04MB4718; x-ms-traffictypediagnostic: VI1PR04MB4718: x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(3231455)(999002)(944501493)(52105112)(3002001)(10201501046)(6055026)(148016)(149066)(150057)(6041310)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123560045)(20161123558120)(201708071742011)(7699051)(76991095);SRVR:VI1PR04MB4718;BCL:0;PCL:0;RULEID:;SRVR:VI1PR04MB4718; x-forefront-prvs: 08756AC3C8 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(346002)(376002)(396003)(136003)(366004)(39860400002)(199004)(189003)(7736002)(99286004)(6486002)(76176011)(305945005)(6512007)(6506007)(53936002)(66066001)(386003)(105586002)(106356001)(68736007)(256004)(71190400001)(71200400001)(5660300001)(110136005)(55236004)(14444005)(54906003)(7416002)(14454004)(86362001)(478600001)(6116002)(3846002)(25786009)(186003)(6666004)(2201001)(2501003)(97736004)(2906002)(81156014)(81166006)(6436002)(8676002)(4326008)(486006)(78486014)(36756003)(102836004)(52116002)(26005)(39060400002)(2616005)(8936002)(446003)(11346002)(316002)(476003);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR04MB4718;H:VI1PR04MB5726.eurprd04.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: 8NdIX4mKYmczFGmNl67NTebkLGS302lH4ymOy7ho1bj9kd+f+8yYpeV8aqoaKA7dBjXlEuSqweqHwWiViO3EGbo//S/X13SFpJXw2V0hIRB3kSiXlrAYZA6ChEhrxLgYvpZr1tu+9Vef6dnal/QPqaBX0rEzJZHoqpWp4/wqzxLLaEiieKPfSxhhoFM+sT4NcLHLLTYiWARc9x1GEZd0Ij/mJ1t47Lz/r78ilAS/bN0zsNxHUFPtkqvBUnrz1PGEA3OXOSTHuTbK1PmkKAUNs94hxB3KCjqw3uidPNqKBoSYFj+wAurhOIr2IGFE/oEsWh/2TfJRdWquQcgdwD39FqVb9KXuj2LcVqgbT1InT3k= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 16318705-d4e6-4aa4-d5a3-08d658fad403 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Dec 2018 08:39:25.0379 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB4718 Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add octal read flag for flash mt35xu512aba. This flash, mt35xu512aba, is only complaint to SFDP JESD216B and does not seem to support newer JESD216C standard that provides auto detection of Octal mode capabilities and opcodes. Therefore, this capability is manually added using new SPI_NOR_OCTAL_READ flag. Signed-off-by: Vignesh R Signed-off-by: Yogesh Gaur --- Changes for v5: - Modified string 'octo' with 'octal'. Changes for v4: - None Changes for v3: - Modified string 'octal' with 'octo'. Changes for v2: - Incorporated review comments of Boris and Vignesh drivers/mtd/spi-nor/spi-nor.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c index 7a2176d..41ba90b 100644 --- a/drivers/mtd/spi-nor/spi-nor.c +++ b/drivers/mtd/spi-nor/spi-nor.c @@ -1413,7 +1413,8 @@ static const struct flash_info spi_nor_ids[] = { /* Micron */ { "mt35xu512aba", INFO(0x2c5b1a, 0, 128 * 1024, 512, - SECT_4K | USE_FSR | SPI_NOR_4B_OPCODES) + SECT_4K | USE_FSR | SPI_NOR_OCTAL_READ | + SPI_NOR_4B_OPCODES) }, /* PMC */ From patchwork Mon Dec 3 08:39:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yogesh Narayan Gaur X-Patchwork-Id: 10708879 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AFE6F13AF for ; Mon, 3 Dec 2018 08:40:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A029A2A97B for ; Mon, 3 Dec 2018 08:40:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 940FF2AC67; Mon, 3 Dec 2018 08:40:07 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 43A132A97B for ; Mon, 3 Dec 2018 08:40:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726065AbeLCIjm (ORCPT ); Mon, 3 Dec 2018 03:39:42 -0500 Received: from mail-eopbgr140071.outbound.protection.outlook.com ([40.107.14.71]:46500 "EHLO EUR01-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726016AbeLCIjl (ORCPT ); Mon, 3 Dec 2018 03:39:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kVb917QJ421eqGqalMUSYshHGI+tMy1pGRkQ0aFbBQA=; b=tBwy2PKW2SdXoN12djdMAbF0OLkD2o9advJK3PPPa5RhShUzIvEfVNo65TOGkK+x9mssANQF5eJ+geDfPlO7iJt13eXkb69I+HnMnNIlTMysBThAj53gowQhGuryw1SrHJimgn9OkbNUcXv4DJzb2jtMktQfCFKuZ94396GqNPM= Received: from VI1PR04MB5726.eurprd04.prod.outlook.com (20.178.127.24) by VI1PR04MB1470.eurprd04.prod.outlook.com (10.163.166.150) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1361.19; Mon, 3 Dec 2018 08:39:31 +0000 Received: from VI1PR04MB5726.eurprd04.prod.outlook.com ([fe80::595a:9890:8397:5d51]) by VI1PR04MB5726.eurprd04.prod.outlook.com ([fe80::595a:9890:8397:5d51%4]) with mapi id 15.20.1382.020; Mon, 3 Dec 2018 08:39:31 +0000 From: Yogesh Narayan Gaur To: "linux-mtd@lists.infradead.org" , "boris.brezillon@bootlin.com" , "broonie@kernel.org" , "marek.vasut@gmail.com" , "vigneshr@ti.com" , "linux-spi@vger.kernel.org" , "devicetree@vger.kernel.org" CC: "robh@kernel.org" , "mark.rutland@arm.com" , "shawnguo@kernel.org" , "linux-arm-kernel@lists.infradead.org" , "computersforpeace@gmail.com" , "frieder.schrempf@exceet.de" , "linux-kernel@vger.kernel.org" , Yogesh Narayan Gaur Subject: [PATCH v5 5/7] mtd: m25p80: add support of octal mode I/O transfer Thread-Topic: [PATCH v5 5/7] mtd: m25p80: add support of octal mode I/O transfer Thread-Index: AQHUiuO17akHSyxjLkG7oUtpm1hInw== Date: Mon, 3 Dec 2018 08:39:31 +0000 Message-ID: <1543826226-30898-6-git-send-email-yogeshnarayan.gaur@nxp.com> References: <1543826226-30898-1-git-send-email-yogeshnarayan.gaur@nxp.com> In-Reply-To: <1543826226-30898-1-git-send-email-yogeshnarayan.gaur@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: SG2PR04CA0143.apcprd04.prod.outlook.com (2603:1096:3:16::27) To VI1PR04MB5726.eurprd04.prod.outlook.com (2603:10a6:803:e4::24) authentication-results: spf=none (sender IP is ) smtp.mailfrom=yogeshnarayan.gaur@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [14.143.30.134] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;VI1PR04MB1470;6:/0VRiW/IjdpPKECuDYGm4K8s0vRstHfK4l7LMCgcqGqp1xxRQcspjxfAwoSw5fuPAzrs2++e7pHSoItmYIjLMgoYDLCgbpx1IO/dlGs38hJEWSyoyx/VL+m744g9BZ+TIaEIcRupGlfmMzt8UsHjLiha7D682ydVj7N+VStzwYQdWfTvEQa9uoRI7JuBijMfb+IF/Tt6BFXAfM8eopc3ELwrL6dNdFp9sg1l+zCqMxVZLrwimOUuIUnIYoON8HhBScktFU1ePIf4SDAKs9Cj356JhDKuDjd/8FOANB2MwlobbSrhuWDCs78JORnFaKWM0pqELuWkXIHsM5rvwMgPQxPLM047k3Rs3ygWGwgWKetIQ+uDcc+5a5S/2fBucWWUutVeDU2/Xku9RVAnBRFsIfyjFYhPqZiqi3mydXQ8PZx8t7+XW0D3+sTcRwmn/DpGdPTZT0qp1I7uzpOEbuKXeQ==;5:DaYsxwCmqwXymW903NyVmnEMljcHOYCT2hFdx5UUtqWYJU8poh+va4aP25PpjxA0ua5OWwpvm3Dfrnn9wo8PpMP3HHYB3Z2hLxK4eCH8+f4p2ngFtkC1pz7ow10Mhw5F6ejrnqBEH1T0YmGUV9Qg0YrAHE3EVrVKXfOlD8RgYeE=;7:OxVGbq7a38koMzjKtPIKCsb0hOY2DKjN7d6iJGLTVY9K+dJoGSmL9nJigwCMj+P7+gR3Y6w7TnKwSna2wJM1Xax1QqACSepheSvghX/zTiIpf1qsCZ2AYotD06SYWCh6pkBW1RQE5cwG2fd6YgLMZg== x-ms-office365-filtering-correlation-id: aab57540-8599-4c36-68c8-08d658fad7dc x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390098)(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020);SRVR:VI1PR04MB1470; x-ms-traffictypediagnostic: VI1PR04MB1470: x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(3002001)(3231455)(999002)(944501493)(52105112)(10201501046)(6055026)(148016)(149066)(150057)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123564045)(20161123560045)(20161123558120)(201708071742011)(7699051)(76991095);SRVR:VI1PR04MB1470;BCL:0;PCL:0;RULEID:;SRVR:VI1PR04MB1470; x-forefront-prvs: 08756AC3C8 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(979002)(346002)(376002)(39860400002)(366004)(396003)(136003)(189003)(199004)(55236004)(2501003)(105586002)(76176011)(5660300001)(7736002)(54906003)(14454004)(6116002)(110136005)(386003)(6506007)(99286004)(2906002)(52116002)(7416002)(316002)(3846002)(305945005)(68736007)(25786009)(2201001)(478600001)(97736004)(86362001)(14444005)(256004)(36756003)(66066001)(81156014)(81166006)(8676002)(78486014)(8936002)(6512007)(53936002)(6486002)(6436002)(476003)(446003)(106356001)(486006)(2616005)(186003)(11346002)(71200400001)(26005)(102836004)(4326008)(71190400001)(39060400002)(969003)(989001)(999001)(1009001)(1019001);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR04MB1470;H:VI1PR04MB5726.eurprd04.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: VLzuT13e0+XwLU+f1EJPbltVLxKBrOOLQakWZC2a6t32LeWhWsBOaln0yXY6BBewVsvu0l7xJ0Ae3hIfoJvW2cOBY9ep07vF6meC6sVC+yJZ+xhmhXKKHLQ1bd2R9IW5i4wRrCsJ05RLL+BtSa9igHckS7VPgQXZac8cES7PxwFJ87d8MWBMJpizGYfHNuwAsE043FDC4ltIAI5BQXxHoj3qIFuewX1Cl31wP6QORa9x3vi2h0EitsRxy2JWegDh0pofbFO0v0kJ5hoyEh0zoZLJ0J5rDpMaFcY9o52Onr/bcMWvJbp+jnDcKe8fJOCRScBkcZhpaEn5YIGC+n6NyJeWcydx1IlVP5z9Lp/RWzc= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: aab57540-8599-4c36-68c8-08d658fad7dc X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Dec 2018 08:39:31.0931 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB1470 Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add support for octal mode I/O data transfer based on the controller (spi) mode. Assign hw-capability mask bits for octal transfer. Signed-off-by: Yogesh Gaur --- Changes for v5: - Modified string 'octo' with 'octal'. Changes for v4: - None Changes for v3: - Modified string 'octal' with 'octo'. Changes for v2: - Incorporated review comments of Boris. drivers/mtd/devices/m25p80.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c index c4a1d04..651bab6 100644 --- a/drivers/mtd/devices/m25p80.c +++ b/drivers/mtd/devices/m25p80.c @@ -195,7 +195,14 @@ static int m25p_probe(struct spi_mem *spimem) spi_mem_set_drvdata(spimem, flash); flash->spimem = spimem; - if (spi->mode & SPI_RX_QUAD) { + if (spi->mode & SPI_RX_OCTAL) { + hwcaps.mask |= SNOR_HWCAPS_READ_1_1_8; + + if (spi->mode & SPI_TX_OCTAL) + hwcaps.mask |= (SNOR_HWCAPS_READ_1_8_8 | + SNOR_HWCAPS_PP_1_1_8 | + SNOR_HWCAPS_PP_1_8_8); + } else if (spi->mode & SPI_RX_QUAD) { hwcaps.mask |= SNOR_HWCAPS_READ_1_1_4; if (spi->mode & SPI_TX_QUAD) From patchwork Mon Dec 3 08:39:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yogesh Narayan Gaur X-Patchwork-Id: 10708877 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 947E213AF for ; Mon, 3 Dec 2018 08:40:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 868A52A967 for ; Mon, 3 Dec 2018 08:40:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 79D352A98D; Mon, 3 Dec 2018 08:40:04 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 26B892A967 for ; Mon, 3 Dec 2018 08:40:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726080AbeLCIjp (ORCPT ); Mon, 3 Dec 2018 03:39:45 -0500 Received: from mail-eopbgr140071.outbound.protection.outlook.com ([40.107.14.71]:46500 "EHLO EUR01-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725968AbeLCIjo (ORCPT ); Mon, 3 Dec 2018 03:39:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RTcTKNAGT+ckD6PO5lLSse/nX/ZfHtEVm2DrqUcW5KE=; b=W/vB2amz4BAF/bgrhZzPjpSAMXnhZvlAYzjX7YeCl4eZfHlfaibDG8dmrLrHMao+UYDtCX0b9qN9S12lfAUztnaIepcWe0TYeigmE1VCHq5f1O0F0soyRFcwmpFiZklDocOg10tGc9wXJXoIrfGuK6paiDMdLVBn7i2GLAg/ch4= Received: from VI1PR04MB5726.eurprd04.prod.outlook.com (20.178.127.24) by VI1PR04MB1470.eurprd04.prod.outlook.com (10.163.166.150) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1361.19; Mon, 3 Dec 2018 08:39:37 +0000 Received: from VI1PR04MB5726.eurprd04.prod.outlook.com ([fe80::595a:9890:8397:5d51]) by VI1PR04MB5726.eurprd04.prod.outlook.com ([fe80::595a:9890:8397:5d51%4]) with mapi id 15.20.1382.020; Mon, 3 Dec 2018 08:39:37 +0000 From: Yogesh Narayan Gaur To: "linux-mtd@lists.infradead.org" , "boris.brezillon@bootlin.com" , "broonie@kernel.org" , "marek.vasut@gmail.com" , "vigneshr@ti.com" , "linux-spi@vger.kernel.org" , "devicetree@vger.kernel.org" CC: "robh@kernel.org" , "mark.rutland@arm.com" , "shawnguo@kernel.org" , "linux-arm-kernel@lists.infradead.org" , "computersforpeace@gmail.com" , "frieder.schrempf@exceet.de" , "linux-kernel@vger.kernel.org" , Yogesh Narayan Gaur Subject: [PATCH v5 6/7] spi: nxp-fspi: add octal mode flag bit for octal support Thread-Topic: [PATCH v5 6/7] spi: nxp-fspi: add octal mode flag bit for octal support Thread-Index: AQHUiuO59OgZ8ZoaJkiQyASI9cR2GQ== Date: Mon, 3 Dec 2018 08:39:37 +0000 Message-ID: <1543826226-30898-7-git-send-email-yogeshnarayan.gaur@nxp.com> References: <1543826226-30898-1-git-send-email-yogeshnarayan.gaur@nxp.com> In-Reply-To: <1543826226-30898-1-git-send-email-yogeshnarayan.gaur@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: SG2PR04CA0143.apcprd04.prod.outlook.com (2603:1096:3:16::27) To VI1PR04MB5726.eurprd04.prod.outlook.com (2603:10a6:803:e4::24) authentication-results: spf=none (sender IP is ) smtp.mailfrom=yogeshnarayan.gaur@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [14.143.30.134] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;VI1PR04MB1470;6:avnGBBtZX31Mc1m2oKeXiAbawzCxX9eAsNwdnvJshH6Xqbnnqx5nWFKYOcld2mTQ1DLC73EZKVuxDbbP4vCUfGRyAlBD9RHqsMi9sJWDkEGZUBjwwxhM917V9X4NfrUMucp457A+1N97sMiO89effQClB33anRFaHfQTl8Fl17VfSCWIdiqE+vlJluEOHhvmSvy+0O1PJuT6z+VzOQxELvMFPFELMiDTy0Joxu6AppdZCsH9d+MRWRLQFVXEsoSSQePAG9ubCRTfNT08jXCzw80+0PCVKJt0Ts6bB85GBjPoQGsFyTLwQmVhKgXkef5FVd0FsR9gjovU88Zea8LS+Vif5b4VjdedQdq4A26Ew/NPNS+5c0n0137SEF2KuhNmTzLPQn9gcEEYmLFaE+1y+u0DBlSAA/SDbZcRQ8OzmQbZl1o5irrI1DZ/2utSjht+FJ+7WBUaEuWx5NeRrs995g==;5:ERt/7mgNcvY3eIqMMw1pDjMSjIM0cXtb6kUh9todqAVrk2rTJqnpP2eQsb+eyReLynQNyP1Be645tgdztL9s2nR+jDuI9lvHYmActv202KqK96zesVjJvhcQjB55CYAuzln+OcKcfmxf2MFEIFpOqNDxjCaz3b3mg3vY/0wYrVA=;7:IyxQJZqHq2t+nyNRC2GWZlkkjczaXsjlnyILU5aTLhFooD6NUKGex8jd3l0dK2qNMWbC+J7IY/JAJBw9tx/cxBhTw/RmetRqL7hcxuYQGf93nTHC8oidmJPHTaJu9Xn5I9p6aPmMHfBRRknDTHeF4g== x-ms-office365-filtering-correlation-id: 855e028f-280c-473e-8085-08d658fadb7a x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390098)(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020);SRVR:VI1PR04MB1470; x-ms-traffictypediagnostic: VI1PR04MB1470: x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(3002001)(3231455)(999002)(944501493)(52105112)(10201501046)(6055026)(148016)(149066)(150057)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123564045)(20161123560045)(20161123558120)(201708071742011)(7699051)(76991095);SRVR:VI1PR04MB1470;BCL:0;PCL:0;RULEID:;SRVR:VI1PR04MB1470; x-forefront-prvs: 08756AC3C8 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(346002)(376002)(39860400002)(366004)(396003)(136003)(189003)(199004)(55236004)(2501003)(105586002)(76176011)(5660300001)(7736002)(54906003)(14454004)(6116002)(110136005)(386003)(6506007)(99286004)(2906002)(52116002)(7416002)(316002)(3846002)(305945005)(68736007)(25786009)(2201001)(478600001)(97736004)(86362001)(256004)(36756003)(66066001)(81156014)(81166006)(8676002)(78486014)(8936002)(6512007)(53936002)(6486002)(6436002)(476003)(446003)(106356001)(486006)(2616005)(186003)(11346002)(71200400001)(26005)(102836004)(4326008)(71190400001)(39060400002);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR04MB1470;H:VI1PR04MB5726.eurprd04.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: wmqQcHurHgyMsXGCBhPspMcZvd1AKpkP1sHrje3OMw0TVkjcos719YiwWCErecTBrDGcIfn58Gi06JMnhNCtaJBUPC8u6vL2MwQJIwZfHO2eju1e2FK+Q7FX26TF778dDzF+bUphV9hZy3yD3m2wDBxzkNreoalGvcG/dhzcXoQnfJAocTIXoGDrgnv8Yx1DU22lHbE/gdqHYBOIGo4C65Ozm674fX2rb7HzsU3Dtxk3nvArOWkngfTvqnNDqbou+REmVx8fEM6F/D6UiUGkWVj7lZO5nSkUnmIfQzQrmKl2oocKvUHyLzD0m0gGEwPAiQ4cv+Vak4IGgDsWFmFH+Yt0rTxeN3eJ+cIq17nLFXo= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 855e028f-280c-473e-8085-08d658fadb7a X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Dec 2018 08:39:37.0713 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB1470 Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add octal mode flags for octal I/O data transfer support. NXP FlexSPI controller supports 8 lines Rx/Tx data transfer. Signed-off-by: Yogesh Gaur --- Changes for v5: - Modified string 'octo' with 'octal'. Changes for v4: - None Changes for v3: - Modified string 'octal' with 'octo'. Changes for v2: - None drivers/spi/spi-nxp-fspi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-nxp-fspi.c b/drivers/spi/spi-nxp-fspi.c index a35013b..b65f27c 100644 --- a/drivers/spi/spi-nxp-fspi.c +++ b/drivers/spi/spi-nxp-fspi.c @@ -995,8 +995,8 @@ static int nxp_fspi_probe(struct platform_device *pdev) if (!ctlr) return -ENOMEM; - ctlr->mode_bits = SPI_RX_DUAL | SPI_RX_QUAD | - SPI_TX_DUAL | SPI_TX_QUAD; + ctlr->mode_bits = SPI_RX_DUAL | SPI_RX_QUAD | SPI_RX_OCTAL | + SPI_TX_DUAL | SPI_TX_QUAD | SPI_TX_OCTAL; f = spi_controller_get_devdata(ctlr); f->dev = dev; From patchwork Mon Dec 3 08:39:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yogesh Narayan Gaur X-Patchwork-Id: 10708865 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3297D13BF for ; Mon, 3 Dec 2018 08:39:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 208232A97B for ; Mon, 3 Dec 2018 08:39:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0FCA22A967; Mon, 3 Dec 2018 08:39:56 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A122E2A967 for ; Mon, 3 Dec 2018 08:39:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726106AbeLCIjv (ORCPT ); Mon, 3 Dec 2018 03:39:51 -0500 Received: from mail-eopbgr70072.outbound.protection.outlook.com ([40.107.7.72]:14962 "EHLO EUR04-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726016AbeLCIju (ORCPT ); Mon, 3 Dec 2018 03:39:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=48EaeEOjL/bixPEO734Ami99KOx/9DFIBEMyD3uEDck=; b=CWiMZMjfbihMqNaCeCCNbOlu167QrJHwxqbbLXggJWKW5kf1XrIrSTr/bNJ+/OrHziJmT3DCpzkkda1NL653Ixc+wZySOpYG8c3UPACd01D/a+Ipp5g1tCuFIrMLPLdkqxJvIZQsFQMosEPdMljnjZdqMFaWVkAJRXBrMKS5P5k= Received: from VI1PR04MB5726.eurprd04.prod.outlook.com (20.178.127.24) by VI1PR04MB5631.eurprd04.prod.outlook.com (20.178.125.160) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1382.22; Mon, 3 Dec 2018 08:39:43 +0000 Received: from VI1PR04MB5726.eurprd04.prod.outlook.com ([fe80::595a:9890:8397:5d51]) by VI1PR04MB5726.eurprd04.prod.outlook.com ([fe80::595a:9890:8397:5d51%4]) with mapi id 15.20.1382.020; Mon, 3 Dec 2018 08:39:43 +0000 From: Yogesh Narayan Gaur To: "linux-mtd@lists.infradead.org" , "boris.brezillon@bootlin.com" , "broonie@kernel.org" , "marek.vasut@gmail.com" , "vigneshr@ti.com" , "linux-spi@vger.kernel.org" , "devicetree@vger.kernel.org" CC: "robh@kernel.org" , "mark.rutland@arm.com" , "shawnguo@kernel.org" , "linux-arm-kernel@lists.infradead.org" , "computersforpeace@gmail.com" , "frieder.schrempf@exceet.de" , "linux-kernel@vger.kernel.org" , Yogesh Narayan Gaur Subject: [PATCH v5 7/7] arm64: dts: lx2160a: update fspi node Thread-Topic: [PATCH v5 7/7] arm64: dts: lx2160a: update fspi node Thread-Index: AQHUiuO8mtyO3semSU+OB8iNhPsmgQ== Date: Mon, 3 Dec 2018 08:39:43 +0000 Message-ID: <1543826226-30898-8-git-send-email-yogeshnarayan.gaur@nxp.com> References: <1543826226-30898-1-git-send-email-yogeshnarayan.gaur@nxp.com> In-Reply-To: <1543826226-30898-1-git-send-email-yogeshnarayan.gaur@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: SG2PR04CA0143.apcprd04.prod.outlook.com (2603:1096:3:16::27) To VI1PR04MB5726.eurprd04.prod.outlook.com (2603:10a6:803:e4::24) authentication-results: spf=none (sender IP is ) smtp.mailfrom=yogeshnarayan.gaur@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [14.143.30.134] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;VI1PR04MB5631;6:GexwQnmwoRUobgKR1SM4ucWyFmNPl/rwPFAZAxD2aJ05SZanmspF983OvuERp0GAZTtvVc8Qo7TfTEx32qFvSWEF3lPOCDaPxPry+V5/XUjkcudprJRLgHZr+rUhaFphThUqlndj7kNnJoNEO4OpdQbaBhniyOq6KfEFFwjjNMtxFRQZcv7CqLZq+zbbJNeXnn3ya5ngTJv7ymLn9oW4BB0dBG53jMlX++kP5538xN7JYbSohWLGYkAC+TsoqaoXhCkCvU43/njftGwGyC57l7z5MteWIQTK48dWBViSbxGbnxbkCBBtMlpvuaIrMWPdo3l8sBf8XWYNwPvaJ06RnbcWNZytklxXiT2OyYCtP93mBmQVpZtCqqx8708UycLyDua/MtZ1X6tkqGRxHH+R5D1/7bJQ5dmFIex4CwlbR/PNxHU74LXu6MzB3GBZZdKHMTFgTBrWH73VBRCBu09YOg==;5:gAmbO9FON1BvL/q+ofiT6kH2x390wk7ykYs3WALHQ9Ldu6VQVgS9IyIhEYoJkl+ipxJaxjyZYb6CNgMJCbrCxbrw+0jcShVGGRC7YzEaoOzzLorMMBxnFFSBsSoOQtfPIzTXbfJCGGriHiqFP/w70FSyPY3Sp68q7qttu/scxZ4=;7:WynQDMpcbMG3ro3kOPetbYuq0oJNiN/GFS1V8cDVVIOAasnvtRuUQnMfkIr/kXjmjbAc3dcPeFyBynqYqt2QGj0nLWAEl20gy6siJIq4Va66qPXzqVKKCNn/0Tz7llbxt2HX1QbnfURfe612OUpDDA== x-ms-office365-filtering-correlation-id: 0b0e485a-b07f-419a-4f6a-08d658fadf0b x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390098)(7020095)(4652040)(8989299)(5600074)(711020)(4618075)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020);SRVR:VI1PR04MB5631; x-ms-traffictypediagnostic: VI1PR04MB5631: x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231455)(999002)(944501493)(52105112)(93006095)(93001095)(10201501046)(3002001)(6055026)(148016)(149066)(150057)(6041310)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991095);SRVR:VI1PR04MB5631;BCL:0;PCL:0;RULEID:;SRVR:VI1PR04MB5631; x-forefront-prvs: 08756AC3C8 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(39860400002)(136003)(346002)(366004)(376002)(396003)(189003)(199004)(78486014)(256004)(110136005)(86362001)(6486002)(71200400001)(71190400001)(54906003)(6436002)(4326008)(39060400002)(14454004)(53936002)(5660300001)(2201001)(8936002)(99286004)(8676002)(81156014)(81166006)(6506007)(76176011)(386003)(55236004)(2501003)(52116002)(102836004)(7736002)(26005)(2616005)(66066001)(478600001)(7416002)(186003)(68736007)(305945005)(6512007)(25786009)(476003)(11346002)(486006)(36756003)(3846002)(97736004)(6116002)(105586002)(2906002)(106356001)(446003)(316002);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR04MB5631;H:VI1PR04MB5726.eurprd04.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: b7onnGHOOrO47YTKGRqQ5S93T47AB9OYeiTUthvVM3P8RZhimwWJjCvmrGrbMUJnMYKlFLbQADPFmEExX9mWmct4+AUnxfisySR6GW9ppxFEy1Ef6xJNEsjbJj+qRV6zAocKUBHzDMbHyqWvj6H/zSzGOCqMCjMpGf3MDAIe0+TdgYRtRbkAPZET9w9MDlv0t0i9EnMiPjXZasQ9FQ64dlpYePckjFKGkDTuMoThZ8pGg11BYQv7cTAbbACmLz5re+cFJGAv9BZ+DmN6qGLNT41ToUKAbNV6YeVmVRZW0msaLr/AEn2KokmVZbngCP1Qg3bAdCbCWqZNVi31DKmG/ZlLb9wyBtCmfRBWKjmYqZ0= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0b0e485a-b07f-419a-4f6a-08d658fadf0b X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Dec 2018 08:39:43.0605 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB5631 Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Flash mt35xu512aba connected to FlexSPI controller supports 1-1-8/1-8-8 protocol. Added flag spi-rx-bus-width and spi-tx-bus-width with values as 8 and 8 respectively for both flashes connected at CS0 and CS1. Signed-off-by: Yogesh Gaur --- Changes for v5: - None Changes for v4: - None Changes for v3: - None Changes for v2: - None arch/arm64/boot/dts/freescale/fsl-lx2160a-rdb.dts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/arm64/boot/dts/freescale/fsl-lx2160a-rdb.dts b/arch/arm64/boot/dts/freescale/fsl-lx2160a-rdb.dts index 3b20c97..24cc41c 100644 --- a/arch/arm64/boot/dts/freescale/fsl-lx2160a-rdb.dts +++ b/arch/arm64/boot/dts/freescale/fsl-lx2160a-rdb.dts @@ -45,6 +45,8 @@ m25p,fast-read; spi-max-frequency = <20000000>; reg = <0>; + spi-rx-bus-width = <8>; + spi-tx-bus-width = <8>; }; mt35xu512aba1: flash@1 { @@ -54,6 +56,8 @@ m25p,fast-read; spi-max-frequency = <20000000>; reg = <1>; + spi-rx-bus-width = <8>; + spi-tx-bus-width = <8>; }; };