From patchwork Thu Nov 22 05:14: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: 10693507 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 CF27013BF for ; Thu, 22 Nov 2018 05:14:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B9D652BD1A for ; Thu, 22 Nov 2018 05:14:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AD2AE2BCF9; Thu, 22 Nov 2018 05:14:38 +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 290832BCF9 for ; Thu, 22 Nov 2018 05:14:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392155AbeKVPwT (ORCPT ); Thu, 22 Nov 2018 10:52:19 -0500 Received: from mail-eopbgr20078.outbound.protection.outlook.com ([40.107.2.78]:9280 "EHLO EUR02-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728351AbeKVPwS (ORCPT ); Thu, 22 Nov 2018 10:52:18 -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=vQ81MyWrWwMfzrt0qU8DpB4GJKsOk/+I3YoXTbzRq6s=; b=oU8G7U+BvaDn9rl/i3S/0FLCngz8Lsz7hrzqLmzD89ltwJedwgvsqE1nO157TyExjpLQm9b8kok8VQLtjS5jk6bD1m0sWn9CVdNe5TJK2zVVjEPLGHXKbNA0ps+Wgt+iivZECVnT6vOeCu2wI/EctGdnIbxUcsgpcviojkRfunI= Received: from VI1PR04MB5726.eurprd04.prod.outlook.com (20.178.127.24) by VI1PR04MB3055.eurprd04.prod.outlook.com (10.170.228.153) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1361.15; Thu, 22 Nov 2018 05:14: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%3]) with mapi id 15.20.1361.016; Thu, 22 Nov 2018 05:14: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 v4 1/7] spi: add support for octo mode I/O data transfer Thread-Topic: [PATCH v4 1/7] spi: add support for octo mode I/O data transfer Thread-Index: AQHUgiJAcEpOMRHFo0C5hsFrjEN72A== Date: Thu, 22 Nov 2018 05:14:31 +0000 Message-ID: <1542863544-21257-2-git-send-email-yogeshnarayan.gaur@nxp.com> References: <1542863544-21257-1-git-send-email-yogeshnarayan.gaur@nxp.com> In-Reply-To: <1542863544-21257-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: SG2PR01CA0106.apcprd01.prod.exchangelabs.com (2603:1096:3:15::32) 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;VI1PR04MB3055;6:PeVD9N95CZCoTFYNaSD+deWvwcNc1h0Ld+eMCgelvySfoCOsVITzlloITAoUNvNd9QqQNJEpbZCf9wrfm46GNQlrtp+UIC/UORdbQhBCXID1kTrS9lM+CHUKNEjYsTd2PgoU/FSz8VyIF85vOtclT/ER+P//CrQIzUxjxLFV+YyVBokA3/A1Q1kt0D1zLJ9qT5V2sVGm6SqkqoOx2SJ41lsgwQ09p8oxs73VCPLuv+q6UINkYs7Gt6efLXA/32HTYBqNrRZHzLHVOCkR77XqoaBrMm2JDI2asBAFZcER6zuLksfjmfrQ1AyUt3zYOnwdzdIUNizRlq8yf9WKHnhLdBAtPP48YHSVJ4acgSmeeHtqpTtoWY8N7Aa6ZEAvKgyYmfbVlylJgKywxRGqHKX0w1orZ4uSRmTu2Rm0tRpTsc479mwrZhSX7KttAfrxb3PxMtGzOT+IQAw6HWd8QXpqgA==;5:6cAERYt82UkqcQL08QknpWnGdxQTZs/cOpRu6EHnXpE7MKuNka37F7kVZeEXqS1i741V701R0vvJyYWOkmxsO4EkEAQj37O2OUnxIpTD9arGWta/4+nHY+GE/wvmI3EOBwNmlBM+ILfnnte51ijBC5EaZEh7quRUTc+E/UhYtZs=;7:4YqK3nPpUyXbpV+FtI2hFbPfP4314ZiJWDVmtCUOO2PVK44BIMVKeT5bMM8mNKzM/n6JraYkda0t4qJzqwc/OGxbfTG1rqnOxS1sqyDTYpVIleJvAX7+SmpV0lT0NsCTP7TKB56i0aGkrN7pXJLDhQ== x-ms-office365-filtering-correlation-id: abb0a8b4-20b1-439c-e69c-08d650396227 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:VI1PR04MB3055; x-ms-traffictypediagnostic: VI1PR04MB3055: 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)(3002001)(10201501046)(3231442)(944501410)(52105112)(93006095)(93001095)(6055026)(148016)(149066)(150057)(6041310)(20161123564045)(20161123558120)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991095);SRVR:VI1PR04MB3055;BCL:0;PCL:0;RULEID:;SRVR:VI1PR04MB3055; x-forefront-prvs: 0864A36BBF x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(979002)(346002)(396003)(136003)(366004)(39860400002)(376002)(189003)(199004)(8936002)(25786009)(105586002)(316002)(2906002)(106356001)(52116002)(76176011)(4326008)(14454004)(6436002)(6512007)(6486002)(53936002)(39060400002)(68736007)(2616005)(476003)(486006)(99286004)(478600001)(11346002)(446003)(36756003)(102836004)(54906003)(71190400001)(71200400001)(386003)(6506007)(66066001)(6116002)(3846002)(110136005)(26005)(256004)(186003)(5660300001)(55236004)(81156014)(78486014)(97736004)(2900100001)(81166006)(8676002)(2201001)(2501003)(575784001)(305945005)(86362001)(7736002)(7416002)(969003)(989001)(999001)(1009001)(1019001);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR04MB3055;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: vF7B61F93YkeZQ4Hyg3BZkAaYvMFSpjw3u4v5/iKy/nbaJJ7iRuPWNpaFmgMDulp2pkPDoGI1lbqRjAzHP4SzdFAzSL6x2cY9in+AdD7P52JzFjm32+qHsI3XHRsU5HauoCj1HtkqW/oV68GGAQGSDek0qpQciAG7Hep805zAizgdIcDr0AyNydji27IvkaY9gb4Ft6k5o1l0G/cm1LU6d2WBsIloDBCgU5tbxv0h0myelJL/vDRSwYMGDddhPTqaFC8szctE1FhQVD5EdKhB70URGkYpcYEpkEPYSd51ic14L1m+uOKX4KKTDmoaK3ghbySQ1ZrPUgPPpIZU6xfR/S1dVkLpFAPOHUI5swFaIY= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: abb0a8b4-20b1-439c-e69c-08d650396227 X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Nov 2018 05:14:31.6362 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB3055 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 Octo 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_OCTO: transmit with 8 wires SPI_RX_OCTO: receive with 8 wires Signed-off-by: Yogesh Gaur Reviewed-by: Boris Brezillon --- 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..af4e4c6 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_OCTO; + 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_OCTO; + 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_OCTO | + SPI_RX_DUAL | SPI_RX_QUAD | SPI_RX_OCTO))) 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_OCTO | + SPI_RX_DUAL | SPI_RX_QUAD | SPI_RX_OCTO); 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..e2d69eb 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_OCTO 0x2000 /* transmit with 8 wires */ +#define SPI_RX_OCTO 0x4000 /* receive with 8 wires */ int irq; void *controller_state; void *controller_data; From patchwork Thu Nov 22 05:14: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: 10693509 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 992A013BF for ; Thu, 22 Nov 2018 05:14:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8901A2BCF9 for ; Thu, 22 Nov 2018 05:14:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7BE682BD21; Thu, 22 Nov 2018 05:14:49 +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 12A902BCF9 for ; Thu, 22 Nov 2018 05:14:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392158AbeKVPwY (ORCPT ); Thu, 22 Nov 2018 10:52:24 -0500 Received: from mail-eopbgr20057.outbound.protection.outlook.com ([40.107.2.57]:36633 "EHLO EUR02-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728351AbeKVPwX (ORCPT ); Thu, 22 Nov 2018 10:52:23 -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=g77+c0OWftWLAiih6FN11rLnuHLZQdqRCaErV3JZbsw=; b=ChauO0HmoyJuaosw72rMoznG/BnZfb8DNF+R9Rrzung2HhSpRDPM/5JGBL0jMEfh/4zbtfaQkqaNJIcV8Jx8woeh0CxTnDw4Oz8kiLQgkvHEjrD7NR8mSXbDmj/q8MA9xKMB4mw7Q2XTqHjIntAIFTdtBFbRod5/FbvjiYg/fdo= Received: from VI1PR04MB5726.eurprd04.prod.outlook.com (20.178.127.24) by VI1PR04MB3055.eurprd04.prod.outlook.com (10.170.228.153) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1361.15; Thu, 22 Nov 2018 05:14: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%3]) with mapi id 15.20.1361.016; Thu, 22 Nov 2018 05:14: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 v4 2/7] spi: spi-mem: add support for octo mode I/O data transfer Thread-Topic: [PATCH v4 2/7] spi: spi-mem: add support for octo mode I/O data transfer Thread-Index: AQHUgiJDzVTsDPXnB0mQxujUB5Eyqg== Date: Thu, 22 Nov 2018 05:14:37 +0000 Message-ID: <1542863544-21257-3-git-send-email-yogeshnarayan.gaur@nxp.com> References: <1542863544-21257-1-git-send-email-yogeshnarayan.gaur@nxp.com> In-Reply-To: <1542863544-21257-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: SG2PR01CA0106.apcprd01.prod.exchangelabs.com (2603:1096:3:15::32) 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;VI1PR04MB3055;6:IVXVeG6pixivckQKjD2u5rQ1qorKblnMYtN+ug71p9JRDG0rVdgx9kO3SLsPkOOfUeCziZONkhywY+lrqUYlCKoqWMcWN57i1pdN30MXdyEy4cpoQLcuGe78PYdgg4CI20MUKAx3I9wA/BWWDiOLWtJVgBExusPGxjD0caj8MorF8BAmVKMWSYiGsxBN9mz8r+Klm3hHM8NIRTrpE5t+SzmkkDZps0DuUIlNPC4iiSEvRTqrovJjM517mswhjbCQbV/jPH+mYYxO6WwPL+tAcwx5E0WlB6TR6goA8DaYFY3d2dz5Hk2Eh78ICiHLd3D8nkFBdkWkXGS3HNHkxAz+SegRAk+sOa5cHSKUWEG2fs3289qNciACO41Bmbl6td0M3zbbHM+sjzeCNw3wq5Qp+VFyq/Sk0ZYPR8fk71o2bdr/rbkg6w8iW+Am96aCd2Z5NDYw/hl4vFbrSewScLqXXQ==;5:bUBV+ypGyDiZi1UOacTNNoim+AypSw/9NQmE7R2ktNJcS6ymlgjAoqGKecgaQck0KxszWDoToKGD5Ehg2JtHnEBrG4yGTwBZUcuLkKErv4NXpfXY4RkTWFOR316kS1gA7jGbG7MRtmbg7oWJWavKTa8AElvVVe3MLy7IiSuuT+I=;7:51M67rZf/WUZlGAUme3d+k4IZ/RGviSqnLaaefh8ajAx/pY8gha1ffK8OKX6BTzIBaaQyI+hth4ZqLXOzm2iOYAXaLouOgmsf9dMtF7ev5I8Y6kuFYIzCT3M7MOc6DUSE0K5eQjrAgDa6MR693qptg== x-ms-office365-filtering-correlation-id: 96b39f25-1999-4cd3-bdba-08d6503965c9 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:VI1PR04MB3055; x-ms-traffictypediagnostic: VI1PR04MB3055: 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)(3002001)(10201501046)(3231442)(944501410)(52105112)(93006095)(93001095)(6055026)(148016)(149066)(150057)(6041310)(20161123564045)(20161123558120)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991095);SRVR:VI1PR04MB3055;BCL:0;PCL:0;RULEID:;SRVR:VI1PR04MB3055; x-forefront-prvs: 0864A36BBF x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(346002)(396003)(136003)(366004)(39860400002)(376002)(189003)(199004)(8936002)(25786009)(105586002)(316002)(2906002)(106356001)(52116002)(76176011)(4326008)(14454004)(6436002)(6512007)(6486002)(53936002)(39060400002)(68736007)(2616005)(476003)(486006)(99286004)(478600001)(11346002)(446003)(36756003)(102836004)(54906003)(71190400001)(71200400001)(386003)(6506007)(66066001)(6116002)(3846002)(110136005)(26005)(256004)(186003)(5024004)(14444005)(5660300001)(55236004)(81156014)(78486014)(97736004)(2900100001)(81166006)(8676002)(2201001)(2501003)(305945005)(86362001)(7736002)(7416002);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR04MB3055;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: UzbpL3bxVnjA4sRp4Fa6Pf6dlta14HAz739gxg7L0lfWyP3zeWF+48OdkIBSjMxooiuf03p7mTRDnIPFLAcwzlBJMRLC4QYOYsGzFJ1FBJDAiHUCg+z8CETaQAa0DaVsPd6dn3FVUEiwCcsbAD3jyYE7Hk7vzYEReQf2kqJK76D3mOo5MzCPVBDIphyvwWZK+Z42NNoOdxtg+IY4R7HqcsWshTNEh9pebJs3jyDKoxvRZ27N93g0gvUBM72OaX21DTZMMMcvu0gnlxCLzCsx2UP0zQPex98ZnYfFy4J8lKc9ieYXSwwei5kaBMtMBZY9g119VHbwvIjS9Zb6JtHojy297BrUVX0EKEx2xAi7vKw= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 96b39f25-1999-4cd3-bdba-08d6503965c9 X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Nov 2018 05:14:37.4331 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB3055 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 octo mode I/O data transfer in spi-mem framework. Signed-off-by: Yogesh Gaur Reviewed-by: Boris Brezillon --- 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..388f849 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_OCTO)) || + (!tx && (mode & SPI_RX_OCTO))) + return 0; + + break; + default: break; } From patchwork Thu Nov 22 05:14: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: 10693521 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 32FC21709 for ; Thu, 22 Nov 2018 05:15:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 226F62BDAA for ; Thu, 22 Nov 2018 05:15:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 160512C08B; Thu, 22 Nov 2018 05:15:22 +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 7AA412C018 for ; Thu, 22 Nov 2018 05:15:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389272AbeKVPwb (ORCPT ); Thu, 22 Nov 2018 10:52:31 -0500 Received: from mail-eopbgr20053.outbound.protection.outlook.com ([40.107.2.53]:7680 "EHLO EUR02-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728351AbeKVPwa (ORCPT ); Thu, 22 Nov 2018 10:52:30 -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=qrG1FcxOhIOOKh4I9G7mQAfx2MqB2CJ4iZ/CqtAgKfQ=; b=pNGX3APq8uKurVkuQC+LiIT9YCFs9pdQ55RcgT7Q5ADiQus5dcrkP2m0ISzoDnTVRv1FzBv4rV3IxpgVcWL+Z8sXAPiRsVpS1llGcrM8NtfDJf+5bW8P4huYO7Eo1AoVhEpTmw8s00xgJkYRZfRtGRwkWSJRYIQ8CP67ByV6Kvs= Received: from VI1PR04MB5726.eurprd04.prod.outlook.com (20.178.127.24) by VI1PR04MB3055.eurprd04.prod.outlook.com (10.170.228.153) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1361.15; Thu, 22 Nov 2018 05:14: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%3]) with mapi id 15.20.1361.016; Thu, 22 Nov 2018 05:14: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 v4 3/7] mtd: spi-nor: add opcodes for octo Read/Write commands Thread-Topic: [PATCH v4 3/7] mtd: spi-nor: add opcodes for octo Read/Write commands Thread-Index: AQHUgiJGD5XQNtWIwEObW7mzq+FeDA== Date: Thu, 22 Nov 2018 05:14:43 +0000 Message-ID: <1542863544-21257-4-git-send-email-yogeshnarayan.gaur@nxp.com> References: <1542863544-21257-1-git-send-email-yogeshnarayan.gaur@nxp.com> In-Reply-To: <1542863544-21257-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: SG2PR01CA0106.apcprd01.prod.exchangelabs.com (2603:1096:3:15::32) 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;VI1PR04MB3055;6:sq7E7ppVetYdo9Rlu8rsrtgGi4iRZA0wk0rm77Nraz0Nhsls4y+y1VqSdfZh6jjOR/fERFJ2mTP2VTKmZadb83ro8TG4kofx32FOdrBGupqgDZpQwzZKXuBdvnQE8EbkpI+hcwPrRoug2VTwz4ByAns8mLX5LgtTwpeSEe7R4aK+lComfTqIxAbZUve0G2vRmebPii51nMNk/lq41cmP1JavdbJXwDxpj/X1srQvZDP3uWZk9b6JUlMeIYwh6r5O2BMK5kaiea5BwRyn6PmlJ8OQkueUJXdsPoH6RGuCNqAjmRrlHLmLs4z5rLF2ME2COY0kJBvdDyAubXvq9yKowWz0cI+9WMXVj0k1zI+lsOFLnqc/EnMn9b6ou8JvTLZPvO6LxZyqluHRg0IskTS4GrifVIiuyAbhPi03JjfXXf1SB5F7I1lS/lmz/t949aO0VkKLkdeR4/DTKX6qByITWw==;5:YpfS5Y8vdv3GFj8d1hOwB2Tj3cQssBOHVJ0KhYym6XbPYkCnS8lw792/3EllyE1bxT6bku3i3rH0O0UAO2x+QEIiWQn3WyWjlqzN4cXOX2yK+QAloivbZe76kCZS0gxepIrbb3YZeQZBQlsIS8vczjWPMCtCeiidp0zo6HHaAKo=;7:D11aYUHs3RvnpVbUzsq7nMGu6N11Orni1ncH6b/vrr4xkQuBHDO1MOe+VXx1rWYQt7j568Xjcij+lapVWNyKDDRkicLfkhz0FvqaFHRq71d3ORB009LNzLtlQ2FpQyK01+OO5o8LHqieTK7vI5xXSw== x-ms-office365-filtering-correlation-id: f7cbc696-ad09-4441-e5b7-08d65039693b 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:VI1PR04MB3055; x-ms-traffictypediagnostic: VI1PR04MB3055: 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)(3002001)(10201501046)(3231442)(944501410)(52105112)(93006095)(93001095)(6055026)(148016)(149066)(150057)(6041310)(20161123564045)(20161123558120)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991095);SRVR:VI1PR04MB3055;BCL:0;PCL:0;RULEID:;SRVR:VI1PR04MB3055; x-forefront-prvs: 0864A36BBF x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(346002)(396003)(136003)(366004)(39860400002)(376002)(189003)(199004)(8936002)(25786009)(105586002)(316002)(2906002)(106356001)(52116002)(76176011)(4326008)(14454004)(6436002)(6512007)(6486002)(53936002)(39060400002)(68736007)(2616005)(476003)(486006)(99286004)(478600001)(11346002)(446003)(36756003)(102836004)(54906003)(71190400001)(71200400001)(386003)(6506007)(66066001)(6116002)(3846002)(110136005)(26005)(256004)(186003)(5660300001)(55236004)(81156014)(78486014)(97736004)(2900100001)(81166006)(8676002)(2201001)(2501003)(575784001)(305945005)(86362001)(7736002)(7416002)(21314003);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR04MB3055;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: OqpzdqS4FZdP6mezQzqRivnGO45eaIn781yyAbmqlQi5QxrQaH/fXdufILfmoAicHErQeC4UDemW/LtRNxHu5DPRMmt1H7T5cdlDtMHJloUC57tIo2zXJczxfDKZGdyNxbkXgOPMD5PdGCzhpbw2PcTmyv8mwCOmcd2r1+RZZFbUAsJA37k0LwtGoHS5zBKpXTa3frG/fXI/OvbbEH6d38WaEPKVU5vwkVVUswui6EMblC2ZgInr5WDebxafA2ZSvJ+KUkzVEzguqpnWXV9md9XG3bE3IuysfXDNmjRQeWFH3YQdeeFp9AdXSnSI/jTfhQyZ+V7CObo3jFymc6JQUOpKhUBJ8XGDzGmHtoLfySM= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: f7cbc696-ad09-4441-e5b7-08d65039693b X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Nov 2018 05:14:43.2301 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB3055 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 octo 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 octo read commands. Signed-off-by: Vignesh R Signed-off-by: Yogesh Gaur --- 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 | 12 ++++++++++++ include/linux/mtd/spi-nor.h | 8 ++++++++ 2 files changed, 20 insertions(+) diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c index 398d273..356ac5d 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_OCTO_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, @@ -3195,6 +3200,13 @@ static int spi_nor_init_params(struct spi_nor *nor, SNOR_PROTO_1_1_4); } + if (info->flags & SPI_NOR_OCTO_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 Thu Nov 22 05:14:48 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: 10693519 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 21BB214DE for ; Thu, 22 Nov 2018 05:15:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 121462BDAA for ; Thu, 22 Nov 2018 05:15:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 061BF2C08B; Thu, 22 Nov 2018 05:15:20 +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 929F32BDAA for ; Thu, 22 Nov 2018 05:15:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392185AbeKVPwg (ORCPT ); Thu, 22 Nov 2018 10:52:36 -0500 Received: from mail-eopbgr20072.outbound.protection.outlook.com ([40.107.2.72]:30147 "EHLO EUR02-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728351AbeKVPwf (ORCPT ); Thu, 22 Nov 2018 10:52:35 -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=5yIqAzmWTLrc5faxXlepvYMcRmo08ToVkh/EJqvgn2s=; b=f7qWJ3vnmEc6HAGNDRtsuYAaRmuVeg3QeFCpJxblKDKi4X+lWeJvG2NsFbF24XigygRRUQi6zjOERu0D9D2B8zPST60txuA6qkNXDC3jMrA9ORaoOGEsLigTcOLhfiHsQNjfI/rjn8roSZyH9fefBDw1wQkXHRCd10XeAJZjPOQ= Received: from VI1PR04MB5726.eurprd04.prod.outlook.com (20.178.127.24) by VI1PR04MB3055.eurprd04.prod.outlook.com (10.170.228.153) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1361.15; Thu, 22 Nov 2018 05:14:49 +0000 Received: from VI1PR04MB5726.eurprd04.prod.outlook.com ([fe80::595a:9890:8397:5d51]) by VI1PR04MB5726.eurprd04.prod.outlook.com ([fe80::595a:9890:8397:5d51%3]) with mapi id 15.20.1361.016; Thu, 22 Nov 2018 05:14:49 +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 v4 4/7] mtd: spi-nor: add octo read flag for flash mt35xu512aba Thread-Topic: [PATCH v4 4/7] mtd: spi-nor: add octo read flag for flash mt35xu512aba Thread-Index: AQHUgiJKOabH5QrebUa55cHJjfKX3g== Date: Thu, 22 Nov 2018 05:14:48 +0000 Message-ID: <1542863544-21257-5-git-send-email-yogeshnarayan.gaur@nxp.com> References: <1542863544-21257-1-git-send-email-yogeshnarayan.gaur@nxp.com> In-Reply-To: <1542863544-21257-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: SG2PR01CA0106.apcprd01.prod.exchangelabs.com (2603:1096:3:15::32) 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;VI1PR04MB3055;6:tphQAewlkq1eOcdzGonzEZqTCOkBIQCYwzknNJMiq/twmEx8bk6aDSAf0dh8AYdlQY9nFdJL3ZROUt7uQcV4yKoup5j65VvnPtfh0lGYSpZjOk4rNWdYs6OwxnBPfOvgUKZE8QTLw9dCI8DKWhFxcvfbgQv0QstwbBSE7I9HH4+gFries22bunbMpwpuxeFzipPn+SkEMWjbf6duw/ef9AQEHGEusoFsbfBzWSIhOTvn3jETOPTpe/sqetadVdiFle90MVSDmYOSEAkgHKN+7vkkHN0v4SNo4DSP2cwM4tf2IY6XWL+xE7rxwkKkA97I9J3VyJPVQc5ym2043rifd968lljAGObjV3KnMVyjllfpXTBav0F5T002NhUEmbED/95TWNbyDIoLxTWKl1/CHmQ4+QctUBkjnV9X62zc4Wmz6NzWSe/Nzm0EksNGPzCn/j4/mnO9Vb4g06wpKlL2gQ==;5:Q/VPIK69aFdZU1ISF881T4FmugcWRKUI5YrxBt8cfPAk3idvBNBO7e7ZD9t/qPn40KXc6Gs958NJ9rB9nimdTIrW4wIz91+osDXtk6SdT2eTo2S48im0EM5LzgngVsTkKOaPbonLgpYgIQAGEHRkEQ/Nm5T7sRpQ+6Z2MdKHP9I=;7:qAcYr/uJnazgmlx5ks7jErV+A0o+x8CEPOw5ujf0zmtqZ4XROJSYlIM9El4qRSCLGA+6ZRhBTflpulvf0Q21IDimF6stSMf0/J1dr4NHy0l0TT63VVsL7vQwuZLlVNDhGYyBN3s4e4zMS/vE+Zz+tg== x-ms-office365-filtering-correlation-id: 4a2e78a6-1e7b-4841-7015-08d650396cb0 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:VI1PR04MB3055; x-ms-traffictypediagnostic: VI1PR04MB3055: 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)(3002001)(10201501046)(3231442)(944501410)(52105112)(93006095)(93001095)(6055026)(148016)(149066)(150057)(6041310)(20161123564045)(20161123558120)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991095);SRVR:VI1PR04MB3055;BCL:0;PCL:0;RULEID:;SRVR:VI1PR04MB3055; x-forefront-prvs: 0864A36BBF x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(346002)(396003)(136003)(366004)(39860400002)(376002)(189003)(199004)(8936002)(25786009)(105586002)(316002)(2906002)(106356001)(52116002)(76176011)(4326008)(14454004)(6436002)(6512007)(6486002)(53936002)(39060400002)(68736007)(2616005)(476003)(486006)(99286004)(478600001)(11346002)(446003)(36756003)(102836004)(54906003)(71190400001)(71200400001)(386003)(6506007)(66066001)(6116002)(3846002)(110136005)(26005)(256004)(186003)(14444005)(5660300001)(55236004)(81156014)(78486014)(97736004)(2900100001)(81166006)(8676002)(2201001)(2501003)(305945005)(86362001)(7736002)(7416002);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR04MB3055;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: izWiJkqOvb/tDY6OFGlRFgDUp9XgrP0GGqAzr6DxGQCoVPEaGwzwJzfr+IEAKuBOFISAg6JrPahnSc5rJsfliGJe1mBMZANL3k5TwyFCmaQpEh5V/rwC/EQHmyGUDmfmZq4MREXEV1JOzeCxiM82NRywNbwdhHGFcdXSycvsHsq1Faz3Exce+Ta75J97lHusz0DmWLhknn4QnaEF8JxczOr0u8ZYy1REnrbBJ5L4ienjaXBI3aHBh9q2b55M+jpeNJK5a9VeEfzz3idfQZfDhBrGnMfphHI8+UN3Ftzz/gFvShXyuSOEJ7gI2OavoXDWkIEVeo9AWWUS0JHitMXyRY7hHGSHjY3OHpKhcnzbZZ0= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4a2e78a6-1e7b-4841-7015-08d650396cb0 X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Nov 2018 05:14:49.0114 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB3055 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 octo 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_OCTO_READ flag. Signed-off-by: Vignesh R Signed-off-by: Yogesh Gaur --- 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 356ac5d..347f17f 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_OCTO_READ | + SPI_NOR_4B_OPCODES) }, /* PMC */ From patchwork Thu Nov 22 05:14:54 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: 10693511 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 2998A1734 for ; Thu, 22 Nov 2018 05:15:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1A23A2BCF9 for ; Thu, 22 Nov 2018 05:15:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0E9132BDAA; Thu, 22 Nov 2018 05:15:01 +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 A05B12BD1A for ; Thu, 22 Nov 2018 05:15:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392214AbeKVPwl (ORCPT ); Thu, 22 Nov 2018 10:52:41 -0500 Received: from mail-eopbgr20043.outbound.protection.outlook.com ([40.107.2.43]:1281 "EHLO EUR02-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728351AbeKVPwl (ORCPT ); Thu, 22 Nov 2018 10:52: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=iha3/v8Unuz6gsDMk51ecqOZOKXxD/Kl3uHaX/5n508=; b=QJJ7DyCwVw2bU6A+ICxsuXDsVX4be6wZ3AX5nSjSnXDBka87iY8E59lOlBsSTQLAyCKVAfGnFStp4ylXIv1WG5G/akgp0+Vd4ggmIyYEHvOuo6xqmY7dAGs9XRgubUYtgp/ClRuboF+/UkFM9vOOBhDWWebx/IGyIH1b10oeYH8= Received: from VI1PR04MB5726.eurprd04.prod.outlook.com (20.178.127.24) by VI1PR04MB3055.eurprd04.prod.outlook.com (10.170.228.153) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1361.15; Thu, 22 Nov 2018 05:14:54 +0000 Received: from VI1PR04MB5726.eurprd04.prod.outlook.com ([fe80::595a:9890:8397:5d51]) by VI1PR04MB5726.eurprd04.prod.outlook.com ([fe80::595a:9890:8397:5d51%3]) with mapi id 15.20.1361.016; Thu, 22 Nov 2018 05:14:54 +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 v4 5/7] mtd: m25p80: add support of octo mode I/O transfer Thread-Topic: [PATCH v4 5/7] mtd: m25p80: add support of octo mode I/O transfer Thread-Index: AQHUgiJNSdkh7a1cb0+RXLQlwhw+uw== Date: Thu, 22 Nov 2018 05:14:54 +0000 Message-ID: <1542863544-21257-6-git-send-email-yogeshnarayan.gaur@nxp.com> References: <1542863544-21257-1-git-send-email-yogeshnarayan.gaur@nxp.com> In-Reply-To: <1542863544-21257-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: SG2PR01CA0106.apcprd01.prod.exchangelabs.com (2603:1096:3:15::32) 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;VI1PR04MB3055;6:a69qq/RqxVwIgXtz/vdmAQBWHxyNkOk98W/FkRVZzQhFhVSNEvP4VF8s+YTFyEqkLNG0Xj0D6MCd9G33bD2GMNdm0HzRebiyRCmSWFtfjH9K9Kk3TOcPUmcdQ7F5bgjfWXQPK3AP/gI6fPSncQwy5oz8i7guKGSZ3gdhR/V19xFTp55YUaBMhL2Q68vnP3zq43I+kQyvm8C/K14deU2ACodHPMZsikjuFnVl3D8kxkOPMo4iPQZrWGKKr6aCDBX3Ioj9r1fJcAzMWKCmjkxLG2TPTisbpDdybRbGSC1R8WzqjrzvyLPpazFPIcFEHJBWew7M/rIt9nvLFKxqOypk1JDYSCaKi0UYxaYI173/2378OTny2RxvMeA0DONn/a5EE4eZl3kSx/dk32nKWZoSVmacbX4qTBU3ibV/NIGZNckwY+CzJv2v2nB8c99lePqpkUmwxVeEpky76jR1B+reJA==;5:pYLfACefKkHWhtoQUb3eN7/i3xKBl3u+ILRLqO9nQUH9Lcw6gaKDn2PQ6vQQ/uoyaLjPsWqJsWnl+cXa7elUjp1vswjZR7TU04zSlCaKlNznL2t2bxm2YUEQgJ4JQfm35iuK2ectc+aosaMSMMArxkc+Iqsje8Q1AhJ+6pDk3Tw=;7:8+mSkVFdGU97+ZAJ0NLQf0+2kTnnyBiKY6FW+aYxSOfV54tvhQI72AMttKlO7Xch/9N0+6uDSVYHKEkMWOP4deiHyU3USFsXmSdVuVH5K7Tq3kc+YRvtBljgZfSk5q1ktthwV3ndN/JaCn1p4s1P5g== x-ms-office365-filtering-correlation-id: 45aa75b9-b85f-476e-fa6b-08d650397024 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:VI1PR04MB3055; x-ms-traffictypediagnostic: VI1PR04MB3055: 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)(3002001)(10201501046)(3231442)(944501410)(52105112)(93006095)(93001095)(6055026)(148016)(149066)(150057)(6041310)(20161123564045)(20161123558120)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991095);SRVR:VI1PR04MB3055;BCL:0;PCL:0;RULEID:;SRVR:VI1PR04MB3055; x-forefront-prvs: 0864A36BBF x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(346002)(396003)(136003)(366004)(39860400002)(376002)(189003)(199004)(8936002)(25786009)(105586002)(316002)(2906002)(106356001)(52116002)(76176011)(4326008)(14454004)(6436002)(6512007)(6486002)(53936002)(39060400002)(68736007)(2616005)(476003)(486006)(99286004)(478600001)(11346002)(446003)(36756003)(102836004)(54906003)(71190400001)(71200400001)(386003)(6506007)(66066001)(6116002)(3846002)(110136005)(26005)(256004)(186003)(14444005)(5660300001)(55236004)(81156014)(78486014)(97736004)(2900100001)(81166006)(8676002)(2201001)(2501003)(305945005)(86362001)(7736002)(7416002);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR04MB3055;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: 4cFXj5D5CtwPhzVPtuLdEsheehFCAcrwfa2ekLnxy6KA2BgAThyPFSCqpnOiRyX24bj4s6+51oULvDsK4fH+jHXvdek8qbNfzAlYTLgAatQ4jJqBAReK+f8+mEr8nT4kLqFXutNvaQY8BNDRR9Wafsg69+dAbrRJGepKv8DAIWuDNIX7mPDugJILE9O9zieIxSkTSEQCXT25I9LZkGOY8DV661ZCBS1Nj1MDp9xAM6ym+S2onUeCcEO2O/uIvARA6Mxg8zWbX/ij7R35Z/IAwSzZMgfC9kXM9ogpgmf795KZsAFufjgBAUGEzpRebvnVOwVkaeQ4j6QH2bUuYPwEXXXKrUfXoc9Q0aZmkG+cu90= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 45aa75b9-b85f-476e-fa6b-08d650397024 X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Nov 2018 05:14:54.8083 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB3055 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 octo mode I/O data transfer based on the controller (spi) mode. Assign hw-capability mask bits for octo transfer. Signed-off-by: Yogesh Gaur --- 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..6f3c280 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_OCTO) { + hwcaps.mask |= SNOR_HWCAPS_READ_1_1_8; + + if (spi->mode & SPI_TX_OCTO) + 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 Thu Nov 22 05:15:00 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: 10693517 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 014781734 for ; Thu, 22 Nov 2018 05:15:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E40BF2C018 for ; Thu, 22 Nov 2018 05:15:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D7A562CB96; Thu, 22 Nov 2018 05:15:17 +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 889802C018 for ; Thu, 22 Nov 2018 05:15:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392216AbeKVPwr (ORCPT ); Thu, 22 Nov 2018 10:52:47 -0500 Received: from mail-eopbgr20044.outbound.protection.outlook.com ([40.107.2.44]:31712 "EHLO EUR02-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2392215AbeKVPwq (ORCPT ); Thu, 22 Nov 2018 10:52:46 -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=tGntyyAunM0d0633GY9h0hyYQf+tv+Cm5+5g8AMlrPk=; b=orptZcsNSkcsR6xFVPGJleXpPXuTUjL+Hj819wSqDjH8OqbnbMk/jHAe6ImTER5U9KNVsGNevKf8IgTUlIgn4qF3swS3IsIiXystSqoNJWyLilYSAcXK3s+nAsStfhhHlfXjXoRa4gWwh8Py/cZ1bqianwriEpX1Ujljvr0gu9I= Received: from VI1PR04MB5726.eurprd04.prod.outlook.com (20.178.127.24) by VI1PR04MB3055.eurprd04.prod.outlook.com (10.170.228.153) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1361.15; Thu, 22 Nov 2018 05:15:00 +0000 Received: from VI1PR04MB5726.eurprd04.prod.outlook.com ([fe80::595a:9890:8397:5d51]) by VI1PR04MB5726.eurprd04.prod.outlook.com ([fe80::595a:9890:8397:5d51%3]) with mapi id 15.20.1361.016; Thu, 22 Nov 2018 05:15:00 +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 v4 6/7] spi: nxp-fspi: add octo mode flag bit for octal support Thread-Topic: [PATCH v4 6/7] spi: nxp-fspi: add octo mode flag bit for octal support Thread-Index: AQHUgiJRv9f2hn+ys0KIBM6v8T69Mg== Date: Thu, 22 Nov 2018 05:15:00 +0000 Message-ID: <1542863544-21257-7-git-send-email-yogeshnarayan.gaur@nxp.com> References: <1542863544-21257-1-git-send-email-yogeshnarayan.gaur@nxp.com> In-Reply-To: <1542863544-21257-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: SG2PR01CA0106.apcprd01.prod.exchangelabs.com (2603:1096:3:15::32) 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;VI1PR04MB3055;6:kFvBiOzxazhlr0L+RdPYJmQylXT4Z5T42Zo+htfXsOImLxND5q9/1JOu6MIu1EFqGvclsEhw9Gh1xrmYMYr5shg1+EKEPCsmXAH7bdpj+gVI70Di7BfqS4wfyee2WUiWVxiDdWJUiaQGVxWK/xaEM8Od5IQzzuY/1WWXjwyjLASgWcH1gYHZuux7it/SkaXgIK3Fpm983VHHv/i/QonkJI6AUV+YiDNLe6VjOWXAZgerN6xrJl0PmJm5PShjRhKGUh7FabdSTAJEvDOkP0fY0muXtqOfxGYeajpd0PkSKj+47L3feVS9ny2lpA5gd4YwHQFHz4J3qv7E3cJERZFNlqp2YAyK0Yx1zPYT7jK9KJzyIf0dEh3fonEBJbgf+0HRUyT3NUUIs56bZWNdp6tu3xn0fqgihg98pjmomTvJ1U0G5NMbrTi+ujSrZBa6JXt7QNB7V9xvwRo/gD7ElkO0zA==;5:1ASzz8KvkyoPDKhBK9FrST+enfCtPAZyI1RDG1j1INgbRy72404f3YId/YFfve6StoelCG+sJDPOHJZuuquwxHJV/q4eh/fu0XOMfuE3PssIP3X80GuvJFLfvEulH2SDsmIfDtJIGPiEkW0LndPh0GexQDwBTwgONBnnvPAnx74=;7:nhEPSd+6OIKjLXRFp2iaEUHf8h9fHXRBqPVALewOa8y7ZGtWWrPt+ijTlEm2mZrXIsSQKjgrQBGfkSYGhYz+ev8LEyPDW57TGLJNpNGt9SAvbPbh/ci4POeJWHQKApxQzf74R0R403Quch3nffcyTQ== x-ms-office365-filtering-correlation-id: 98c285a1-1e0a-4145-c00b-08d650397394 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:VI1PR04MB3055; x-ms-traffictypediagnostic: VI1PR04MB3055: 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)(3002001)(10201501046)(3231442)(944501410)(52105112)(93006095)(93001095)(6055026)(148016)(149066)(150057)(6041310)(20161123564045)(20161123558120)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991095);SRVR:VI1PR04MB3055;BCL:0;PCL:0;RULEID:;SRVR:VI1PR04MB3055; x-forefront-prvs: 0864A36BBF x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(346002)(396003)(136003)(366004)(39860400002)(376002)(189003)(199004)(8936002)(25786009)(105586002)(316002)(2906002)(106356001)(52116002)(76176011)(4326008)(14454004)(6436002)(6512007)(6486002)(53936002)(39060400002)(68736007)(2616005)(476003)(486006)(99286004)(478600001)(11346002)(446003)(36756003)(102836004)(54906003)(71190400001)(71200400001)(386003)(6506007)(66066001)(6116002)(3846002)(110136005)(26005)(256004)(186003)(5660300001)(55236004)(81156014)(78486014)(97736004)(2900100001)(81166006)(8676002)(2201001)(2501003)(575784001)(305945005)(86362001)(7736002)(7416002);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR04MB3055;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: HlIk4O87X7zK0/iwZ3IjrKbanyDhyBeTcxLbUyUliqAIYCswXld67WJEKXSnxlgEQo5HgFTSsDiREIelY+GLtFfruj94lzE4xvYOBkayyAgUjdiLIo2zRPktxDm+hare11x/j+WNC1h08jiwyCGNoNT8ihhLpHXCMyH5fmXVpfh93jd/5o/pK9jEgPbj/75IjPbtpcc18ZMGk5CoqYH8Z+bhJxfK2fvHX0tLiIUKJUFKLxdvKjPplX63qPA5rj6fib5F84XbqaDCqmOSSe8cpc37OPsORrhH1pgDHlJnBMT1TyptEovuTcBXF4X7gQ+EYPzMNPlS03fnGOd+E6kRq0kNh4NCF1MxxcuFVG4/3S4= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 98c285a1-1e0a-4145-c00b-08d650397394 X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Nov 2018 05:15:00.5583 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB3055 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 octo 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 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..f0d37e0 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_OCTO | + SPI_TX_DUAL | SPI_TX_QUAD | SPI_TX_OCTO; f = spi_controller_get_devdata(ctlr); f->dev = dev; From patchwork Thu Nov 22 05:15: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: 10693515 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 D990E1709 for ; Thu, 22 Nov 2018 05:15:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C8A132C08B for ; Thu, 22 Nov 2018 05:15:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BBFEA2C10A; Thu, 22 Nov 2018 05:15:17 +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 57C782BDAA for ; Thu, 22 Nov 2018 05:15:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392230AbeKVPww (ORCPT ); Thu, 22 Nov 2018 10:52:52 -0500 Received: from mail-eopbgr20076.outbound.protection.outlook.com ([40.107.2.76]:37632 "EHLO EUR02-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2392215AbeKVPww (ORCPT ); Thu, 22 Nov 2018 10:52:52 -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=cdvvLPq7cPVFANa4Why9qGDsUoiMNrIwZ/JtRskiQEc=; b=XJ9NOVzdVWcgQBUS7rYlgzZOhEWOhkzgGnrtNkxt94fZZHtg6sEc8377D7HLy951yMVJRseEqm2VN213l/sZZlaK0ZuyJiexZh8/nmUIW7VyEUbBilbmrhOLwerU1wZq0kWaaCyHBu5IDcWoY7HZ9DB6KMQa9EqnN/TncFGY1m8= Received: from VI1PR04MB5726.eurprd04.prod.outlook.com (20.178.127.24) by VI1PR04MB3055.eurprd04.prod.outlook.com (10.170.228.153) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1361.15; Thu, 22 Nov 2018 05:15: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%3]) with mapi id 15.20.1361.016; Thu, 22 Nov 2018 05:15: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 v4 7/7] arm64: dts: lx2160a: update fspi node Thread-Topic: [PATCH v4 7/7] arm64: dts: lx2160a: update fspi node Thread-Index: AQHUgiJUXC1eycPwL0i53LplGbKuaQ== Date: Thu, 22 Nov 2018 05:15:06 +0000 Message-ID: <1542863544-21257-8-git-send-email-yogeshnarayan.gaur@nxp.com> References: <1542863544-21257-1-git-send-email-yogeshnarayan.gaur@nxp.com> In-Reply-To: <1542863544-21257-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: SG2PR01CA0106.apcprd01.prod.exchangelabs.com (2603:1096:3:15::32) 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;VI1PR04MB3055;6:cq43ovNDsoqXxp1cbvy58+weHkXaJWIojMcmXj5CAaze3UyjFB83e79wjCYrpaORvrfQhc9qE+E0Ki+Bsr4B1E5NKndv2DMgVz8YlBFaUDuzedO9v0+lqS6kKOLhUxDC1SikU3tfY8Bce0CWxD36sqcGXmRsvEQrdWa+Xr7zrGDELNmnGt7LYbTe9Pgdk8D5gSHdIGdDR29vxRvFGt/ejzxWwozWo8MEadoAEXVfz97naIdKyQKVzxpzu4oGVku16yn6oihk/3W3fp7IS8KKq1whVXRnQVRP820pfzXuh9fkiI0S87PM8TxMKDtNJXzb+oMpOs0RjRBYvgpvOLMhJBYMSDcQzJ2+4/SPwNIBOHa5ooBFZGHqwM/FG2ckLHdcqurqWAPQjUk5PJyKcTgA0UFuyhs7gKeFz1GwWVropDlFE+ex+Har/cOiHrptIUxd0/IusoeufjELoQwH/ewHwg==;5:wYNOQDWqMMp0Wbu0sMWac9wpvdoqC8k8Iro5N8TI4NT1ojz+xaZQL4XfldDjokrRLRY73GnJqOX7W8Ohyyuun6pIYuMt7HoKoLpV/cG3SSCZR0z4pMDzXr7tQPWmx1r1SErZUIO4TTp6O9l/re9zcGMrU/KDq0yXu5/mM2BddXU=;7:cp2ZNFBQycpqOIreC1TiJJ5nej2uzFraJgAfxe2n8YMZ4JL0uOZPE08gAp7DA8FfsplD+l/zBCHhSZAKgc2WoucksuLijrDnPgYMp6Drate4K/BAuBLW0TMhdWQPGUPiuoFABhZyqy+//U3K+tqWpQ== x-ms-office365-filtering-correlation-id: 71fe3128-614c-499e-85b8-08d650397704 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:VI1PR04MB3055; x-ms-traffictypediagnostic: VI1PR04MB3055: 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)(3002001)(10201501046)(3231442)(944501410)(52105112)(93006095)(93001095)(6055026)(148016)(149066)(150057)(6041310)(20161123564045)(20161123558120)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991095);SRVR:VI1PR04MB3055;BCL:0;PCL:0;RULEID:;SRVR:VI1PR04MB3055; x-forefront-prvs: 0864A36BBF x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(346002)(396003)(136003)(366004)(39860400002)(376002)(189003)(199004)(8936002)(25786009)(105586002)(316002)(2906002)(106356001)(52116002)(76176011)(4326008)(14454004)(6436002)(6512007)(6486002)(53936002)(39060400002)(68736007)(2616005)(476003)(486006)(99286004)(478600001)(11346002)(446003)(36756003)(102836004)(54906003)(71190400001)(71200400001)(386003)(6506007)(66066001)(6116002)(3846002)(110136005)(26005)(256004)(186003)(5660300001)(55236004)(81156014)(78486014)(97736004)(2900100001)(81166006)(8676002)(2201001)(2501003)(305945005)(86362001)(7736002)(7416002);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR04MB3055;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: L95/OZvekS7WJ1YLCfRbVF7nEbTqHkC77dkamJ2sfNufVaVKRq749e3jkYEoa7RfFy8Gwb1iDFqsn+M8YF/QIn0wqijAAYgc45daSoH9xk7Z2MvH61Wfw5/PAiIjw2bz442VciCQ4B/4ioQiELQGqmLueLGdZDlMuMT6FM2rEFcprpncWPC2AdC0mgBQI+TBNLQa0yR7Uv5sPAvkGFAqmOdItOxBwQ3HwMYpj7uZvbaa1HdJwLjcsHwceEOKiiXdIgGrvKeoWRN1TPaz7zo4ZWhJBIaOliTtUo3CgjcWAHeriBrTIvxINyUAZuUoZpLGHH1WtUJnZjZaPTugq0LhHcKogTTW4S3luIWPJr8YIF4= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 71fe3128-614c-499e-85b8-08d650397704 X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Nov 2018 05:15:06.3240 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB3055 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 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>; }; };