From patchwork Fri Aug 31 10:29:57 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: 10583541 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 76DF65A4 for ; Fri, 31 Aug 2018 10:32:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 532822B60F for ; Fri, 31 Aug 2018 10:32:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 453992B61F; Fri, 31 Aug 2018 10:32:03 +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 F17822B60F for ; Fri, 31 Aug 2018 10:32:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727727AbeHaOiv (ORCPT ); Fri, 31 Aug 2018 10:38:51 -0400 Received: from mail-eopbgr30055.outbound.protection.outlook.com ([40.107.3.55]:51264 "EHLO EUR03-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726493AbeHaOiu (ORCPT ); Fri, 31 Aug 2018 10:38:50 -0400 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=HVJYJByjbRmFg5/E79vwlz8FXMJO1aWss5f5vpPCN9o=; b=EODYBmoYp0x3OKNk+gbaeAxeHYixv0NhK+XBX6Gs66yHGduigN9md2RpAVWPPuSB5Ub/+SzdvyMe0747BAeAoLeEFdESnWGo8CMVJzggnIDi0ZbIgs/28j+bcbniCv5/sZN5+axwZRqOdEUk7IQdzkIqh+X4JsX12cTUU70hir4= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=yogeshnarayan.gaur@nxp.com; Received: from idcbfarm.ap.freescale.net (14.143.30.134) by HE1PR04MB1034.eurprd04.prod.outlook.com (2a01:111:e400:581a::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1101.16; Fri, 31 Aug 2018 10:31:49 +0000 From: Yogesh Gaur To: linux-mtd@lists.infradead.org, boris.brezillon@bootlin.com, marek.vasut@gmail.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 Gaur Subject: [PATCH 0/7] spi: spi-mem: Add a driver for NXP FlexSPI controller Date: Fri, 31 Aug 2018 15:59:57 +0530 Message-Id: <1535711404-29528-1-git-send-email-yogeshnarayan.gaur@nxp.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-Originating-IP: [14.143.30.134] X-ClientProxiedBy: SG2PR01CA0100.apcprd01.prod.exchangelabs.com (2603:1096:3:15::26) To HE1PR04MB1034.eurprd04.prod.outlook.com (2a01:111:e400:581a::15) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3bd751a7-7223-40e6-62f7-08d60f2cf87c X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020);SRVR:HE1PR04MB1034; X-Microsoft-Exchange-Diagnostics: 1;HE1PR04MB1034;3:7ESH/ngxyWItmlJsan3/ABUEIjGvv6MOKw5ByQfJD3+UOkReN+FGQYBMWajwyMgOx520Ia90vdjMYCdX3rgMrxvz2NKxoKQY8esNcP4UfhhrvxxnHcSEYOZmPKLGhmXezD1kxj0Oo04O0mXlsrceneDQ3sSp6pcE56pxKQHDZEAOo+SsfMl0MTDFzA71Kyx1TMH7WYyR5odJFKWYyYlI8LLvCjObsh7cpR4dhrbuVr7ZDhx9u4B6hw1eCev9y+Z2;25:tL7gJGCVdE4E4Y1nKce1JrdYfUU4LLgBogEFMN6v+EevGfmBPiWk3MHyDMfROKOQ6P8VU98B0SjVLooceH/EeEBwVsJwOJt8tvpzVXPvbiyvE5Gr/Qj2ZUKBAuylPGq6nJ8G5nWHS4GTWsELPYkWMojdaab+CyJFMCec5Wht48BSrE3WNyzqHkcsW72p6oqclcfH490zsLuDl51Fh8jgDeyrVNdITjRihnSBjNU1YkYquu8VMdyBtsrpLW+RzcEXsVWHuQPJI9F8eOI1QsEr/JLt1oPTP6TUlg9P7r2ljoXtzVovKGpdzCsl/nQPvdCy19XRxfsVvvkeJjyK2wr7L966QI3iEBNNSp8YvE3nPcY=;31:C+1RYWHInXWm5bM1dUZtWCKTpcuwxiOJ5+4ITTD+wzgA0jMAoWtcWMhGxPxK2NPnMP0TP5h+Qx+wra1hoRyXWZ+rbPhTvmitDaHV+U8alu2vZlNKwUXRybDOo3b6iqBXjL5oOgzbrjCN/QxWhzsRL09Gsy1dGJ/Xt5ccQIdc8YsLcdlmnVbXdI25SGx8MX9sbbZ+Q4GtRx4lCJZNdhGtdG9avhyXVYzNFGGHg28A1Pg= X-MS-TrafficTypeDiagnostic: HE1PR04MB1034: X-Microsoft-Exchange-Diagnostics: 1;HE1PR04MB1034;20:Ib7QJ45ioGnj9QjIz9owR5XDIw8Flw6FuRQ3FuXMpeaPtTe1+f5Cg20SlM1fHq1qclm3YF3nthwzJ55/Y6uzHnVuu1ha5Cuv2sDBHc/kC6P5sGrkQ/iHJSWAuBh/r+Wi30Jjp89QSCyz14iruBBnaaOhgLGWIc39PX6sD0bF63c3n8C+mlJyCQifV9ACHJfCSIL/O8iAvcbv0KXzw36VePnHhvAgSXtxx3IYYNQMkbH/+gdJAOXzZzHjl9UyeZnF7dhx161hFTvocZlq8QXT9qMz2GsXCHYeXexiDBQZWotD8UWJ9eoZXYupG7fu64AyNnHM/XAyZRK/e62IN2mn4QyDNxsemHyHCRMl6bp23PO+yPbIKZ8cQnCv6rsWteu2VE+Is7VvoPV1IdaCGq16jJIZrpb/xvqu1cj2+fGLvTE1WN2NLjGlQATHdmTh7CCNbG6zE14ZMELbAcUIWNRmeZFyiqFJWVEeCOeB4lBDu/vUuBw1olpU7NDR4UhahzwH;4:4dTaWDu4hsluPKQSLDtDVEX2tqy2QoX1tc7F5ij87P19YEYmJ/eyys2X1S7dBEjnWUM8qd/MzNK1faC+rE/i+96UbBAwRgdKOTCCEyXgwNVT0XFR6xgBB2As0V9dQcjJKQnaLQ3mObQeAJNxICyeE3J6MQ5CqrynSGLH/9dKiycvuptn4Hu9LsyzWFTgvb/LobrBydniT628/n/Jc5kcqTajoWcMrOnqaZiYywEaxCriA8K8dRCWFkNuBC9BzSG0clwUqpu8HmHlS0am5qAOCOkMW+zTLw+5+ZDqZR3XaoVlRq+RNiLmsl9Ca8ErBIeNpyDJO2tMrYumBgnRa05tgZOO8lmPgRimbViro6RfS+k= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(264314650089876); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(823301075)(10201501046)(3002001)(3231311)(944501410)(52105095)(93006095)(93001095)(6055026)(149027)(150027)(6041310)(20161123560045)(20161123558120)(20161123564045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699016);SRVR:HE1PR04MB1034;BCL:0;PCL:0;RULEID:;SRVR:HE1PR04MB1034; X-Forefront-PRVS: 07817FCC2D X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(396003)(39850400004)(376002)(346002)(366004)(136003)(199004)(189003)(48376002)(7736002)(7416002)(8936002)(105586002)(5009440100003)(52116002)(106356001)(51416003)(55236004)(386003)(6506007)(81156014)(81166006)(2906002)(86362001)(3846002)(186003)(50466002)(16526019)(6116002)(305945005)(26005)(6486002)(66066001)(47776003)(25786009)(36756003)(5660300001)(97736004)(8676002)(53936002)(6512007)(6306002)(50226002)(316002)(6666003)(39060400002)(68736007)(486006)(4326008)(966005)(16586007)(478600001)(2616005)(476003)(956004)(110426005);DIR:OUT;SFP:1101;SCL:1;SRVR:HE1PR04MB1034;H:idcbfarm.ap.freescale.net;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-Exchange-Diagnostics: 1;HE1PR04MB1034;23:5xRuJJULWzwVORPRmyHcRz3+OhdUdpc5AwUghh4C1O5nx0uFz1iw90gN8Fhi3ZHSpKPyGq8ZQslnQnG1FmYIu8no+21hIOcTDeN8Oq1hcp7sr7Cl9J3FtC2BsE2C461b5f227GVeOj3Jup+01kHvYtpvD4LNsxEYQRie59n6PBcd7+OLy10pMa0l0qx2sMLmxvXvRxCDK/oeSrkWbxCsW5lIT69oq4k+xYWXo6kyp333L60UM8WECvxWu+wt9j0Dh6bKVBkA3bx30vIkDDv+HPJywNjlIF7UR5UytHdDUA5+CsHtYaft5ZTRUIOOa0JVjVYTJGetxkQ1Un+Wxa4gCXjViDWhRe8opy6T1sOCw0K4AQqndYyfwY6kprRSiXqb99UyTEPDLyBcygP1eQESh/nQ30P9Ru0VdunkiYffg6s2AgQb/EQQj9QNAd2keVickJ0FSMT3UtHW6uqZa273enp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DiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Aug 2018 10:31:49.5289 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3bd751a7-7223-40e6-62f7-08d60f2cf87c X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR04MB1034 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 a driver for NXP FlexSPI host controller FlexSPI is a flexsible SPI host controller [1], Chapter 30 page 1475, which supports two SPI channels and up to 4 external devices. Each channel supports Single/Dual/Quad/Octal mode data transfer (1/2/4/8 bidirectional data lines) i.e. FlexSPI acts as an interface to external devices, maximum 4, each with up to 8 bidirectional data lines. FlexSPI controller is similar to the existing Freescale/NXP QuadSPI controller with advanced features. - Tested this driver with mtd_debug(Erase/Write/Read) utility and JFFS2 filesystem mounting and booting on NXP LX2160ARDB[2] and LX2160AQDS targets. LX2160ARDB is having two NOR slave device connected on single bus A i.e. A0 and A1 (CS0 and CS1). LX2160AQDS is having two NOR slave device connected on separate buses one flash on A0 and second on B1 i.e. (CS0 and CS3). Verified this driver on following SPI NOR flashes: Micron, mt35xu512aba[3], [Read - 1 bit mode] Cypress, s25fl512s, [Read - 1/2/4 bit mode] Patch 1 adds variable size in spi_device struct, to save the size of connected slave device. Patch 2 adds flags for octal I/O data transfer. Support for octal flash commands and other framework changes would going to be done in different patch set. Patch 3 adds a driver for the NXP FlexSPI controller, driver is based on new spi-mem framework. Patch 4 add binding file for this driver. Patch 5 add device node property for FlexSPI driver for lx2160 SoC. Patch 6 enables the config option. Patch 7 add MAINTAINERS file. [1] https://www.nxp.com/docs/en/reference-manual/IMXRT1050RM.pdf [2] https://patchwork.kernel.org/project/linux-arm-kernel/list/?series=9721 [3] https://patchwork.ozlabs.org/project/linux-mtd/list/?series=63445 This series adds below patches: Yogesh Gaur (7): spi: add slave device size in spi_device struct spi: add flags for octal I/O data transfer spi: spi-mem: Add a driver for NXP FlexSPI controller dt-bindings: spi: add binding file for NXP FlexSPI driver arm64: dts: lx2160a: add fspi node property arm64: defconfig: enable NXP FlexSPI driver MAINTAINERS: add maintainers for the NXP FlexSPI driver .../devicetree/bindings/spi/spi-nxp-fspi.txt | 42 + MAINTAINERS | 6 + arch/arm64/boot/dts/freescale/fsl-lx2160a-rdb.dts | 21 + arch/arm64/boot/dts/freescale/fsl-lx2160a.dtsi | 12 + arch/arm64/configs/defconfig | 1 + drivers/mtd/devices/m25p80.c | 6 + drivers/mtd/spi-nor/spi-nor.c | 2 + drivers/spi/Kconfig | 10 + drivers/spi/Makefile | 1 + drivers/spi/spi-nxp-fspi.c | 1242 ++++++++++++++++++++ include/linux/spi/spi.h | 4 + 11 files changed, 1347 insertions(+) create mode 100644 Documentation/devicetree/bindings/spi/spi-nxp-fspi.txt create mode 100644 drivers/spi/spi-nxp-fspi.c