From patchwork Fri Aug 31 10:29:58 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: 10583543 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 95AE45A4 for ; Fri, 31 Aug 2018 10:32:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 71D032B60F for ; Fri, 31 Aug 2018 10:32:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 64CB52B61F; Fri, 31 Aug 2018 10:32:10 +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 D0CA22B60F for ; Fri, 31 Aug 2018 10:32:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727446AbeHaOix (ORCPT ); Fri, 31 Aug 2018 10:38:53 -0400 Received: from mail-eopbgr30057.outbound.protection.outlook.com ([40.107.3.57]:60224 "EHLO EUR03-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726493AbeHaOix (ORCPT ); Fri, 31 Aug 2018 10:38:53 -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=kGHasaR5g3WpOQjTgENxMdhTIk7CmIBT1snjoOPzrJA=; b=MS97uu7N6CxIooUZfKz2UbYJVDdZPDzmFqKXO9za0cn8CezBIPFop/7RsK14OhocoqacvJNVVjeadoa/bvWCnpQyUvCtQNhI90TEmCmnbLP6+ClAxPevCxPTaYfRgYIo6sLO3q0AsmhAv0GaoeQQfI0J7jbh60Uw4rpcR4/s0Ig= 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:54 +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 1/7] spi: add slave device size in spi_device struct Date: Fri, 31 Aug 2018 15:59:58 +0530 Message-Id: <1535711404-29528-2-git-send-email-yogeshnarayan.gaur@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1535711404-29528-1-git-send-email-yogeshnarayan.gaur@nxp.com> References: <1535711404-29528-1-git-send-email-yogeshnarayan.gaur@nxp.com> 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: 49757ddc-4756-4f89-c5ea-08d60f2cfbab 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:UC9hQKX3ihY/+qKJ0Mw999baZzIssmO+7aBxugJtse/CRsfCN7p9bMEmhK2FJemca3SKb8KmovdnuEABwvLRlWU9ZZLvgDQ0RFIGVeu+qtHJ4ZTvxhFtFH/PQYYAFO+NHKmIS45xyRt4AebL2XFM47IAd7Qt7blWIh5Uk/LIzqfhzJC1hiPC5/KVFaA6p3eurfc921EA4bm2uh+TxQOlF1YESD/zBUzIKhXp8sVXGsj8bODdVQDEQGiXLYdTBzGK;25:F1crNceLY1S1+5mvcOYocKWJwMVK0mE52L3run10rO8BsXt9KGIYmfjt9SnaqfkgWebbe3xHiAUneAld9gtXVmb+oHCENXeAFVT7/2yZLgm7y40zvsn4dwiXgd66g/+jVsbDbXwkx4yjeNeIJNRnIOzKmjJWAMKSL8nXj671fyvqgKAtX+IQI9E3BZHPtga3NfqDUzOFJrHLrnqCafv19v/p4Kh/SHgtfqMWWcC2Vgl+0fyycFwLFSg+CW4+Okdsc8w6BvzxjmTzgh64ToJZiY2pom9l4UgKWY8n8DPlY5DFxZzOdMn7hbI7IoE9kf4U+0TrKq036J6lWGlrMWyDOA==;31:nl6qxbYjbm3XZv02osruH3LFSTcnJpCaTq8gQ9taqHAZQb3lA2c8hBARk5G6pMdAPPs0ynuXlAQviWm3bCuW9kzbijA1p6gIyC6TWmOtigE+8LTs/+A4j9P0SXCby229tOFve38dPIMO4d62tUhsY2hL2MJbfHjUaunqyM1sAy3hT8wam8z88CuX/A42GbUi6l8tIQW64OnONre0akJc6HkkmtJT+Ph/voc6iEvc7tE= X-MS-TrafficTypeDiagnostic: HE1PR04MB1034: X-Microsoft-Exchange-Diagnostics: 1;HE1PR04MB1034;20:0zjGdKr47bhau3okowKvDk53x6TMiyrEgq4rg0h8CJhf3VPVHGTsTOtiLRFcfYeEk6gaZF3xESLSPg0WpTOjdEPfOHgH4zuWTdHdGZ5Yw7pAk3nyAqXVsbcn1Gqe+EPZxoydh5etV79Cl5MjY3Pre8IRh4EqRXIRGaBJ3EP74igPPShmPAbehin9VBuZjvEOrcKtVQ/cgrUp/9TtUwj2JUgjhGAFblkuPQeo7iRwpddwCzvxCD5GZlhHuQF6dsxNyZQAZ2q6DeEzAyaja1UnhoxYvx5JT2VSpDkK0Q1BC/1o0PPxS78iP9g8rYEUN6EhQkQ85Gr13LEvTaJrL/1GKw2ERNsRkbID8RI1R1aVzqXncB9/O2HbnlD6HSCL59jPg54Y5NOjNYCRPhUkJkareZSi7d7QZHw/wcsNPK6N1Hr8bNA9/8ZyiZJtFe+dFiE+WvE5ov0QFj+X+8umDCtaLx0nldWw0gS+0y/8JgIE3qLwgb9cmrFqy8f9Mnvz8pId;4:vruKJuV1y6+ebkAMgTV4VAXICYUXKzOVdtClFJ6xO5CQ8fXHwSWt4yb0J1MhX8ZDOGJ2WBKIqwmT9DhKHvGkBLbeoilU3pfqm7Mi26A9pSC4pX4AiG68Zc7+WydkI5wOSV+YDp4fvYkE8eRpzjtlu6GeK8AN6v+DjNf95R2uCnwIz+/3zr1WwpXf3LKcILAo4dUpwVIT6nbpQtKbalcyiyHX3F1zmjW8DQ4YuDSa0vXw+sRU7eQMgib7gy7+FlkMQcIBWEiwG9X6GjPanXroGChNKd0QtaGNoQ86JAPJcPVkZUvNrS5rJexzBav4WUMh X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); 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)(76176011)(2906002)(86362001)(3846002)(186003)(50466002)(16526019)(6116002)(305945005)(26005)(6486002)(66066001)(47776003)(25786009)(36756003)(5660300001)(97736004)(8676002)(53936002)(6512007)(50226002)(14444005)(316002)(39060400002)(68736007)(486006)(4326008)(16586007)(11346002)(478600001)(446003)(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:li6vmjADdXr3zBWzy4CNL+uxONRwrmlLS6xAopXWY+ESYc5Otk87hUDwp07TQ+XoSG4uSQnfRcwz6/4Olsr6Mi/7I2Z906CHkhb/bmaPmZKMxN10EQkMRux7cNd3uLop2In9upg8eoSJzof3B1FK4MNfkYXdI+ee/2ka0BaDpE8iJjA5E8V2eEkJNqE+bUmgSU38MRuP8kj2UScvJL9VCk4be/o8dhFZplSXBdfvMrYKUzp9TcpQamqADPdD8cTpCojQdYBxnIqcmusISQl2YEqw21BM6UoptfIZvsqVw2x17z/gIFxgNRuRporuB3Qq1xHaom3ys9U/PFhFo/hAeBon1oRH9mY5/ZZw8C3imO3he+v7zeq4oRYtmETSr2R8MBz00VufYxB+NPWt1DguePDEuV1IEP7b2flZ//G7TCKTn11XyeTd1QVOYv0w1jngs8N25m2czY8YGjEdc8IRDaIse0L5KGD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ticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Aug 2018 10:31:54.9195 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 49757ddc-4756-4f89-c5ea-08d60f2cfbab 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 'size' data variable in spi_device struct. This is to save the size of the connected slave device. After slave device scan, spi_nor_scan, size being assigned to this from MTD layer. SFDP read is being requested before completion of spi_nor_scan() routine, thus populate device size before making read request to the SPI controller. Signed-off-by: Yogesh Gaur --- drivers/mtd/devices/m25p80.c | 6 ++++++ drivers/mtd/spi-nor/spi-nor.c | 2 ++ include/linux/spi/spi.h | 2 ++ 3 files changed, 10 insertions(+) diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c index fe260cc..6c7ad86 100644 --- a/drivers/mtd/devices/m25p80.c +++ b/drivers/mtd/devices/m25p80.c @@ -124,6 +124,10 @@ static ssize_t m25p80_read(struct spi_nor *nor, loff_t from, size_t len, /* convert the dummy cycles to the number of bytes */ op.dummy.nbytes = (nor->read_dummy * op.dummy.buswidth) / 8; + /* for case of SFDP header read commands, populate spi device size */ + if (flash->spimem->spi->size == 0) + flash->spimem->spi->size = nor->mtd.size; + while (remaining) { op.data.nbytes = remaining < UINT_MAX ? remaining : UINT_MAX; ret = spi_mem_adjust_op_size(flash->spimem, &op); @@ -215,6 +219,8 @@ static int m25p_probe(struct spi_mem *spimem) if (ret) return ret; + spi->size = nor->mtd.size; + return mtd_device_register(&nor->mtd, data ? data->parts : NULL, data ? data->nr_parts : 0); } diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c index 6042df8..b066bed 100644 --- a/drivers/mtd/spi-nor/spi-nor.c +++ b/drivers/mtd/spi-nor/spi-nor.c @@ -2864,6 +2864,8 @@ int spi_nor_scan(struct spi_nor *nor, const char *name, if (info->flags & SPI_S3AN) nor->flags |= SNOR_F_READY_XSR_RDY; + mtd->size = info->sector_size * info->n_sectors; + /* Parse the Serial Flash Discoverable Parameters table. */ ret = spi_nor_init_params(nor, info, ¶ms); if (ret) diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h index a64235e..558aeed 100644 --- a/include/linux/spi/spi.h +++ b/include/linux/spi/spi.h @@ -127,6 +127,7 @@ void spi_statistics_add_transfer_stats(struct spi_statistics *stats, * for driver coldplugging, and in uevents used for hotplugging * @cs_gpio: gpio number of the chipselect line (optional, -ENOENT when * not using a GPIO line) + * @size: size of the connected slave device * * @statistics: statistics for the spi_device * @@ -168,6 +169,7 @@ struct spi_device { void *controller_data; char modalias[SPI_NAME_SIZE]; int cs_gpio; /* chip select gpio */ + u32 size; /* size of slave device */ /* the statistics */ struct spi_statistics statistics; From patchwork Fri Aug 31 10:29:59 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: 10583545 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 D003D5A4 for ; Fri, 31 Aug 2018 10:32:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AD28E2B60F for ; Fri, 31 Aug 2018 10:32:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A0ED92B61F; Fri, 31 Aug 2018 10:32:16 +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 3E1152B60F for ; Fri, 31 Aug 2018 10:32:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728339AbeHaOjA (ORCPT ); Fri, 31 Aug 2018 10:39:00 -0400 Received: from mail-eopbgr30078.outbound.protection.outlook.com ([40.107.3.78]:23484 "EHLO EUR03-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726493AbeHaOi7 (ORCPT ); Fri, 31 Aug 2018 10:38:59 -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=bgiYf2Ur7sJwKj9pmaYJQNRh6lgiVq7M/phBgQs+oHE=; b=RZZgGP9QVTY3aMHEqTRNi8YhZFZfwIgi3jCh5sovJw5qMnnIhrBN7R4tuVKD/2oWz813w3pQmkwDqcWmiJUUWs9fbMLiC/Q/LT5mZi3kg7NNmOO3LaeEXziNhvmqvn9ZZZy8AvQkdw94GQgWoAiDT/QytwGBwOh8iGK9oyEK8nM= 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:32:00 +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 2/7] spi: add flags for octal I/O data transfer Date: Fri, 31 Aug 2018 15:59:59 +0530 Message-Id: <1535711404-29528-3-git-send-email-yogeshnarayan.gaur@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1535711404-29528-1-git-send-email-yogeshnarayan.gaur@nxp.com> References: <1535711404-29528-1-git-send-email-yogeshnarayan.gaur@nxp.com> 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: 28f5055d-a3d1-4470-c67b-08d60f2cfed8 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:yzveqPQgFV/4hPNWxbRBg+eE+vZdLINw/qxVDUKnnozS2tgsEzHCUIVq4wCBu4cMlv3HiRFLZ9DWkMFkl9382Lfgr6aWyexURO4Zmd8vWd+rPjIdBN67TAbBFCP+ms7FqVH4umSCOBQtJFhysy++3oaXf0Fk4MCkJz37kzuxzvLmVHPWykavH0lfeTBDvSXZtFDj91arIuuvkP74/2v9UO3LVdaEkQ2QgqLsr6+yKoTopwxlX+Z4mX5B2WfV4DnM;25:B8ql4o5cWOtijTyo6eA2+SpvDG0Q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5AMPYS2GsMjXc7hUXMlTrhSQEgg5h5YPiEwXpjPKXiYcOq2voMi3nScEO2SCfXRHpEqg3tJMRcf5DX;4:kBLVYf15sWuJEjKIsKCTGw8gcSOnEQ2q07iUUSHLCVuE6MWqWj3U/4IsKPhYYZ708dedn20Wl2yXMD6HFPXmbsfZx735FmMrE/tnA4GhIaBtn+KJcvbJGTOG/fPI3wj8M48+IbywxXKSDRwsoX+Yu8rUU3R5av1AAztnmjuF33tzBE2I349u5RIPk48iN+kE6gYGcE7wfo6/vtZMZMLjtuCPGI/IPIg3cHKkmOmXpwIH4jwunydyVqyNcK0rNNMGoq2rzgYbPTFK/9zKvYM3xi13PXJabxYWA8G0M5FOApI6GmGE+H7b/SGpgqYtWK2D X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); 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)(76176011)(2906002)(86362001)(3846002)(186003)(50466002)(16526019)(6116002)(305945005)(26005)(6486002)(66066001)(47776003)(25786009)(36756003)(5660300001)(97736004)(8676002)(53936002)(6512007)(50226002)(316002)(39060400002)(68736007)(486006)(4326008)(16586007)(11346002)(478600001)(446003)(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:bToh7JCqZ/zB4nvLXHWp5Y67E6REXyxTkUvDif2mpLPSztsheTbENbQRUOCy2owAnq6OHskXuHpbnY6dVAYHGzEdjd6FPLQrLdmCmyghUO8wxOUeDNic33FEbyjViwK4FYJf/XlKXjbG0UagZVJ+8BFHGeDldDFIPSxjers7tyw3oaXMDYmIvlZvkaiMy34l9ldb9U/5dsq2Ulkp3p8nboBVq7CdF0BnacC/dzy8Mu3gISFC35RdjEKyci/Khh34w3KgFDWrBxiLnMUxI0Q45t+7eONpAQH+KFssLjE4uvKB4qpR9I07KUTqMP7NLfzJBIy3IiTOFzJ9mHwiYnDPZ+udUlsr7jBAeLbPqMBUc1oM4CeLQcAzuRPc68QkYiT8G51J8XUPY5RhrO+ilA4OTy8BLwtLf8aOxQ61oKk4khcRNI9IMUG5XBXJFPwKAJnhDEuQYRRbZ829YY07yr5E+GM2z9IwAx60B7RyJrsUmIIZpAHDc3hgezmlbBuhMMUfsaiVu6Md57wajFYSDokIXn2rmeTD/T/rYSBE/wA1UQpK+kBjgYgY80lVmOVndivk6gL+mmIiF5aA/g/KWXSydxkDEfokSg52p4n4/Kr4zeQUcs4GB3xuLmrA/xp9ztrnOtGA+Btj+/6ztHdVkSio/HIY25DLI8Fwujs1D8n381fA33ChpTfsNOSmF06epT7aG2V0rHmawvdgjpO4oKJkjRFrCVqqU98Hux8h+1BuDXKUfydKgQT7Yo3ZMKFrjUFngDWHkfwWSkk8H4tgyhm2hF+xD0xriHK27ddIrYfyfyxpnU49zjz+ijye831UzU784KQVWlWyaK7aghGP16GtZIJeMbfzkZnmf2zhsAinq9RtcHMyAroTrN9La8OjUWFkSKX/6tCRZYzrV6P5z2iY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CTLqeYyvu1YNNJPpbufQX+qVPwwB29AzXJvAPkp1SeX+XCB6P6KdrKIoLRPLppoGTCZQgJhPug8P0o0piSY8F2PeDRoNLsxJgPPcQu06Toy/ipPmL29q533plcty8ux/13zZMGnNzbOSE5zqLo5s73OCqVZsOd765Ox+w==;5:Z46RsOtVrisw1FaSl0DXtzvVpEg4bn4325JyKg2swcZnYfU35gMbU52jsLWJrFKM+EzfNgkfCpPiPXkH9W1BwxMQCKA5tNSa6BKbfzI5nR6APkloVSNicczUivXgsXKOi03TZlSnkzy3IJrOFFNRKli+19cV2SXZ2tM8A7hGGD8=;7:oLkwGD3fWEL7PzQOgVe9RRBaxzvGJ8ZHhBUHliPeWCLth1XXNaJcbKTSRDQppQvcJgtdK/qsnvbJMy2iHPpAXj3iYDUDpNY3ReLvSpZesrWlj2m+oghiojY2tgrvG4JipSG2bhXS5NU/DFtsemh5SlYRuK0ePDgLDnj/bLLxsXxAto4zsNgyhMcejQ5GR4hIHWyptvO3bEA5lB6qALn+GL5CGY/+s/8p+kTP47OzxH3Wn7b4r3z1FGZTIN6rgLDo SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Aug 2018 10:32:00.2476 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 28f5055d-a3d1-4470-c67b-08d60f2cfed8 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 flags for Octal I/O data transfer Required for the SPI controller which can do 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 --- include/linux/spi/spi.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h index 558aeed..180f277 100644 --- a/include/linux/spi/spi.h +++ b/include/linux/spi/spi.h @@ -164,6 +164,8 @@ 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_TX_OCTAL 0x1000 /* transmit with 8 wires */ +#define SPI_RX_OCTAL 0x2000 /* receive with 8 wires */ int irq; void *controller_state; void *controller_data; From patchwork Fri Aug 31 10:30: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: 10583549 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 51A115A4 for ; Fri, 31 Aug 2018 10:32:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2AF3D2B61F for ; Fri, 31 Aug 2018 10:32:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1E2CB2B6AF; Fri, 31 Aug 2018 10:32: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 958402B61F for ; Fri, 31 Aug 2018 10:32:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728099AbeHaOjJ (ORCPT ); Fri, 31 Aug 2018 10:39:09 -0400 Received: from mail-eopbgr30073.outbound.protection.outlook.com ([40.107.3.73]:60160 "EHLO EUR03-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726493AbeHaOjJ (ORCPT ); Fri, 31 Aug 2018 10:39:09 -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=HGH0i/buvBOUv7N56EUs0rnohM8tK2S3aekrXoTugmA=; b=wdbqkgzbojreOSsZEqSGYRyjG6qpGPO9CTMcAPlSaPiUmOR5WPwdo/aiDCetZaL2ovcOSq0bwbfxtNSgn6YJU5Jj7iIFgBiFaKipHWdE3tNk0L1y0g+aYqjoxLmPgIQr4b+cfu76TRGOZ+saQPbD6BEwwK3jtlIBVyx+tMHB19w= 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:32:05 +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 3/7] spi: spi-mem: Add a driver for NXP FlexSPI controller Date: Fri, 31 Aug 2018 16:00:00 +0530 Message-Id: <1535711404-29528-4-git-send-email-yogeshnarayan.gaur@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1535711404-29528-1-git-send-email-yogeshnarayan.gaur@nxp.com> References: <1535711404-29528-1-git-send-email-yogeshnarayan.gaur@nxp.com> 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: 1c636fcc-a14a-4fae-5075-08d60f2d020f 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:zRsoSZISVKmmBu4N2hS6TlS3XABnadozHiOmgK4IxL1uGbXd9WZe1y/LoKu4qyeqh+JbvzJZdLh3NaYfTg1JNNFRJu/DvDrjJ9kncDEkl0QMPyAHiV9T989+eB2yBAJzYfB9bJMuIhfNxFV6x8gzbzwYAJsoLSyBBYaG1iQeiygFGMH9MUwAqkAGYWCzpE98Hn4WDbmrzveTa7RTQOWxipmqM9AA1pIYo4d0LDBVU/mCJKk02eEJIcs8ZfERnEk2;25:SmVdsrOro+vd71Iteg2Jy7CfkyMTRrE22sTDnallX6OmDqKwGtCIujnZREj/WVYFM96uOXtUVl7EDeok9APbm73nkzeuYX6TUfeOD6R5rJhZXxXeLhOvbzTipVP+ExRrmZ9RY2J9dphjke+tyCchHgv4nvkAXLrx0eVgrts1Lr3dZPNEsXMn9w478c4xM8GUflz2FsMRgKl+oOon8olx87CeFVD9F3XtgJ4XJ2RqnU1lr/Yi5QXy5x5YjBb66hGgPyGBCyoH5LS/Y4dfO0eQ7anPcGC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7vstFcVOQwltQTt0TIE5iN6yzR337B+uUxOtkrgIiil90vetO+h5Mom4q08N05bQhf/AFxM4xJyCbrZ9Umu6yN291PfBgtTJdOMp7/iUVPF31BreWv1SO3ukFuieUQyYESgK5IEubzG1 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); 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)(76176011)(2906002)(86362001)(3846002)(575784001)(186003)(50466002)(16526019)(6116002)(305945005)(26005)(6486002)(66066001)(47776003)(25786009)(36756003)(5660300001)(97736004)(8676002)(53936002)(6512007)(50226002)(14444005)(53946003)(316002)(6666003)(39060400002)(68736007)(486006)(4326008)(16586007)(11346002)(478600001)(446003)(2616005)(476003)(956004)(110426005)(579004);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:2VRcvN582CyJ8oIyulJ43hKQpqBOV0jmS+nuU7nHU9JsoqJxiL79zzTpdMBMpf5PoeyOY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3v21e9NYE8HX43LicAuvqzRjUP51iFVC68OO2/0GtNHvODvgx/2rBMGRs5qy1+72uTf6Q/4W7xMODnExq2ITn39k/55Ut85TowsjswmpEGMbMR65zag96qsu0f8Nc7Y/xEJbktBV+FXom1krq1Ul4yxexXrpmEiQLFpxiwJMKS5BlZLySs3ai4P3Myk0kJWphVCvEiX4ce9VgiO+1vw== X-Microsoft-Antispam-Message-Info: WWOjYWYe1kYCldL8MZ81fUo46tKbXvV9RdGt4iM7t3GM8DOVUoJFtClfNT6WBx1STRL+8v6ApIhIaykxSDHMrM0/AdXKuPB7op5unn1qbTne+ypmJnFfOGkuHJQCXNDAqrAah7N1SEy3wpFNsLQuYbevq1u//0w/yRk2ThYEQNA727A4zKJfkmDse6WfYvvMdMYoDCVd3p2kYDEzRjcws7n4gux36vyalSODF9G4nEkJBL9NSR7A3uj+BfloM7QPkKdoe+mWmU+4bJ4iG/EbE2Hlqkr4FOnooC7FN/I/34c5Cl/5rW6+e1zWbNcVIljnfYyq2uITrMJrZ10ZZbIBgs/z+Azb9PABjLK/9h9hmDU= X-Microsoft-Exchange-Diagnostics: 1;HE1PR04MB1034;6:lSAbXW4xmjLcGzg8CsVwoZu693YKwkkBfLSw9UbbLbF5Lk3BKedL184tegk39F+Hye7hRasIqOKLbXmTCDCE69DEkHlPplopAeULq3mRfgigyyDjWjKLTZUtq8N35+L01pL2829rK1trN5MloIuMxYNIecz/Jo8FwvUIbK9bwTBPMAzaEpBo7M1f/vT1Qqe5J0Uj5MtYK6XsQbU2zOdQVqX2uCwsUSDnOvcYCXH1qhU/bVTNr2LhwVwCW5qseF0YUh+pmvaFJUFbDMSzIQXjRkzTpKOGXc33GUL56zIHM8mnnqbIYqCpxIHtjqjtFjDW9muS8PIBTcZSvK8/l8hXrLpLPKuwTh7MjatKOt127yV1sfm14TGsB+Yhzez8dYEiwkJTDWlTDD901/t4CTYPCLNfF94XmdtOEszrV8drA6H+1RfWkYECQsYiKgHmJqI3z9GQwgl8r7MFRkbuAlp15w==;5:jY7vld5DFcpxw+rDqRYmWUNOa41Hjc7VWtMs33HbdPgLN/B/l8+g4OcP8n+OPcPdLZx/StGL9nmhiTm2EelMpsjCQAM9n/mMVGQkXBRZHYHBMLs4TbShD/+WJhP+gcGvcdkDBFT1ryolQItrKL9dCpmSy3PRbpgBMeniXU5eRlg=;7:7c3JdCGccU9Y6noiv0J2YInEo6CcbX08XZCoAU85VcGVb8h5Hg4xTG1RybK4FOWBsWShYryWAvlwPRonxLQX19o631iK12mhXUtaUPexZj5mI9Dxr/9k+6TjfomnyVhQfK4EeROqfJZyd3ZCmtHZtIR1ooRb1+KcWknYDHtjXfw8TqHneTJw6jqopvMda28v9ZUb5hJI3XVigYAoV8Z0s+xJsVyDyqWGUzmkQf/+YznSZrreXLuo4wm61Q3qJPd+ SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Aug 2018 10:32:05.5600 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1c636fcc-a14a-4fae-5075-08d60f2d020f 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 (0) What is the FlexSPI controller? FlexSPI is a flexsible SPI host controller 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. It uses new SPI memory interface of the SPI framework to issue flash memory operations to up to four connected flash chips (2 buses with 2 CS each). Chipselect for each flash can be selected as per address assigned in controller specific registers. FlexSPI controller is similar to the existing Freescale/NXP QuadSPI controller with advanced features. (1) The FlexSPI controller is driven by the LUT(Look-up Table) registers. The LUT registers are a look-up-table for sequences of instructions. A valid sequence consists of four LUT registers. Maximum 32 LUT sequences can be programmed simultaneously. (2) The definition of the LUT register shows below: --------------------------------------------------- | INSTR1 | PAD1 | OPRND1 | INSTR0 | PAD0 | OPRND0 | --------------------------------------------------- There are several types of INSTRx, such as: CMD : the SPI NOR command. ADDR : the address for the SPI NOR command. DUMMY : the dummy cycles needed by the SPI NOR command. .... There are several types of PADx, such as: PAD1 : use a singe I/O line. PAD2 : use two I/O lines. PAD4 : use quad I/O lines. PAD8 : use octal I/O lines. .... (3) LUTs are being created at run-time based on the commands passed from the spi-mem framework. Thus, using single LUT index. (4) Software triggered Flash read/write access by IP Bus. (5) Memory mapped read access by AHB Bus. (6) Tested this driver with the mtd_debug and JFFS2 filesystem utility on NXP LX2160ARDB 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, mt35xu512ab, [Read - 1 bit mode] Cypress, s25fl512s, [Read - 1/2/4 bit mode] - Add config option entry in 'spi-nor/Kconfig' for FlexSPI driver. - Add entry in the 'spi-nor/Makefile'. Signed-off-by: Yogesh Gaur --- drivers/spi/Kconfig | 10 + drivers/spi/Makefile | 1 + drivers/spi/spi-nxp-fspi.c | 1242 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 1253 insertions(+) create mode 100644 drivers/spi/spi-nxp-fspi.c diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig index ad5d68e..68da874 100644 --- a/drivers/spi/Kconfig +++ b/drivers/spi/Kconfig @@ -251,6 +251,16 @@ config SPI_FSL_LPSPI help This enables Freescale i.MX LPSPI controllers in master mode. +config SPI_NXP_FLEXSPI + tristate "NXP Flex SPI controller" + depends on ARCH_LAYERSCAPE || HAS_IOMEM + help + This enables support for the Flex SPI controller in master mode. + Up to four slave devices can be connected on two buses with two + chipselects each. + This controller does not support generic SPI messages and only + supports the high-level SPI memory interface. + config SPI_GPIO tristate "GPIO-based bitbanging SPI Master" depends on GPIOLIB || COMPILE_TEST diff --git a/drivers/spi/Makefile b/drivers/spi/Makefile index cb1f437..52c9f18 100644 --- a/drivers/spi/Makefile +++ b/drivers/spi/Makefile @@ -59,6 +59,7 @@ obj-$(CONFIG_SPI_MPC52xx) += spi-mpc52xx.o obj-$(CONFIG_SPI_MT65XX) += spi-mt65xx.o obj-$(CONFIG_SPI_MXS) += spi-mxs.o obj-$(CONFIG_SPI_NUC900) += spi-nuc900.o +obj-$(CONFIG_SPI_NXP_FLEXSPI) += spi-nxp-fspi.o obj-$(CONFIG_SPI_OC_TINY) += spi-oc-tiny.o spi-octeon-objs := spi-cavium.o spi-cavium-octeon.o obj-$(CONFIG_SPI_OCTEON) += spi-octeon.o diff --git a/drivers/spi/spi-nxp-fspi.c b/drivers/spi/spi-nxp-fspi.c new file mode 100644 index 0000000..677401b --- /dev/null +++ b/drivers/spi/spi-nxp-fspi.c @@ -0,0 +1,1242 @@ +// SPDX-License-Identifier: GPL-2.0+ + +/* + * NXP FlexSPI(FSPI) controller driver. + * + * Copyright 2018 NXP + * + * Based on SPI MEM interface: + * Author: + * Yogesh Gaur + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +/* + * The driver only uses one single LUT entry, that is updated on + * each call of exec_op(). Index 0 is preset at boot with a basic + * read operation, so let's use the last entry (31). + */ +#define SEQID_LUT 31 + +/* Registers used by the driver */ +#define FSPI_MCR0 0x00 +#define FSPI_MCR0_AHB_TIMEOUT_SHIFT 24 +#define FSPI_MCR0_AHB_TIMEOUT_MASK (0xFF << FSPI_MCR0_AHB_TIMEOUT_SHIFT) +#define FSPI_MCR0_IP_TIMEOUT_SHIFT 16 +#define FSPI_MCR0_IP_TIMEOUT_MASK (0xFF << FSPI_MCR0_IP_TIMEOUT_SHIFT) +#define FSPI_MCR0_LEARN_EN_SHIFT 15 +#define FSPI_MCR0_LEARN_EN_MASK (1 << FSPI_MCR0_LEARN_EN_SHIFT) +#define FSPI_MCR0_SCRFRUN_EN_SHIFT 14 +#define FSPI_MCR0_SCRFRUN_EN_MASK (1 << FSPI_MCR0_SCRFRUN_EN_SHIFT) +#define FSPI_MCR0_OCTCOMB_EN_SHIFT 13 +#define FSPI_MCR0_OCTCOMB_EN_MASK (1 << FSPI_MCR0_OCTCOMB_EN_SHIFT) +#define FSPI_MCR0_DOZE_EN_SHIFT 12 +#define FSPI_MCR0_DOZE_EN_MASK (1 << FSPI_MCR0_DOZE_EN_SHIFT) +#define FSPI_MCR0_HSEN_SHIFT 11 +#define FSPI_MCR0_HSEN_MASK (1 << FSPI_MCR0_HSEN_SHIFT) +#define FSPI_MCR0_SERCLKDIV_SHIFT 8 +#define FSPI_MCR0_SERCLKDIV_MASK (7 << FSPI_MCR0_SERCLKDIV_SHIFT) +#define FSPI_MCR0_ATDF_EN_SHIFT 7 +#define FSPI_MCR0_ATDF_EN_MASK (1 << FSPI_MCR0_ATDF_EN_SHIFT) +#define FSPI_MCR0_ARDF_EN_SHIFT 6 +#define FSPI_MCR0_ARDF_EN_MASK (1 << FSPI_MCR0_ARDF_EN_SHIFT) +#define FSPI_MCR0_RXCLKSRC_SHIFT 4 +#define FSPI_MCR0_RXCLKSRC_MASK (3 << FSPI_MCR0_RXCLKSRC_SHIFT) +#define FSPI_MCR0_END_CFG_SHIFT 2 +#define FSPI_MCR0_END_CFG_MASK (3 << FSPI_MCR0_END_CFG_SHIFT) +#define FSPI_MCR0_MDIS_SHIFT 1 +#define FSPI_MCR0_MDIS_MASK (1 << FSPI_MCR0_MDIS_SHIFT) +#define FSPI_MCR0_SWRST_SHIFT 0 +#define FSPI_MCR0_SWRST_MASK (1 << FSPI_MCR0_SWRST_SHIFT) + +#define FSPI_MCR1 0x04 +#define FSPI_MCR1_SEQ_TIMEOUT_SHIFT 16 +#define FSPI_MCR1_SEQ_TIMEOUT_MASK (0xFFFF << FSPI_MCR1_SEQ_TIMEOUT_SHIFT) +#define FSPI_MCR1_AHB_TIMEOUT_SHIFT 0 +#define FSPI_MCR1_AHB_TIMEOUT_MASK (0xFFFF << FSPI_MCR1_AHB_TIMEOUT_SHIFT) + +#define FSPI_MCR2 0x08 +#define FSPI_MCR2_IDLE_WAIT_SHIFT 24 +#define FSPI_MCR2_IDLE_WAIT_MASK (0xFF << FSPI_MCR2_IDLE_WAIT_SHIFT) +#define FSPI_MCR2_SAMEDEVICEEN_SHIFT 15 +#define FSPI_MCR2_SAMEDEVICEEN_MASK (1 << FSPI_MCR2_SAMEDEVICEEN_SHIFT) +#define FSPI_MCR2_CLRLRPHS_SHIFT 14 +#define FSPI_MCR2_CLRLRPHS_MASK (1 << FSPI_MCR2_CLRLRPHS_SHIFT) +#define FSPI_MCR2_ABRDATSZ_SHIFT 8 +#define FSPI_MCR2_ABRDATSZ_MASK (1 << FSPI_MCR2_ABRDATSZ_SHIFT) +#define FSPI_MCR2_ABRLEARN_SHIFT 7 +#define FSPI_MCR2_ABRLEARN_MASK (1 << FSPI_MCR2_ABRLEARN_SHIFT) +#define FSPI_MCR2_ABR_READ_SHIFT 6 +#define FSPI_MCR2_ABR_READ_MASK (1 << FSPI_MCR2_ABR_READ_SHIFT) +#define FSPI_MCR2_ABRWRITE_SHIFT 5 +#define FSPI_MCR2_ABRWRITE_MASK (1 << FSPI_MCR2_ABRWRITE_SHIFT) +#define FSPI_MCR2_ABRDUMMY_SHIFT 4 +#define FSPI_MCR2_ABRDUMMY_MASK (1 << FSPI_MCR2_ABRDUMMY_SHIFT) +#define FSPI_MCR2_ABR_MODE_SHIFT 3 +#define FSPI_MCR2_ABR_MODE_MASK (1 << FSPI_MCR2_ABR_MODE_SHIFT) +#define FSPI_MCR2_ABRCADDR_SHIFT 2 +#define FSPI_MCR2_ABRCADDR_MASK (1 << FSPI_MCR2_ABRCADDR_SHIFT) +#define FSPI_MCR2_ABRRADDR_SHIFT 1 +#define FSPI_MCR2_ABRRADDR_MASK (1 << FSPI_MCR2_ABRRADDR_SHIFT) +#define FSPI_MCR2_ABR_CMD_SHIFT 0 +#define FSPI_MCR2_ABR_CMD_MASK (1 << FSPI_MCR2_ABR_CMD_SHIFT) + +#define FSPI_AHBCR 0x0c +#define FSPI_AHBCR_RDADDROPT_SHIFT 6 +#define FSPI_AHBCR_RDADDROPT_MASK (1 << FSPI_AHBCR_RDADDROPT_SHIFT) +#define FSPI_AHBCR_PREF_EN_SHIFT 5 +#define FSPI_AHBCR_PREF_EN_MASK (1 << FSPI_AHBCR_PREF_EN_SHIFT) +#define FSPI_AHBCR_BUFF_EN_SHIFT 4 +#define FSPI_AHBCR_BUFF_EN_MASK (1 << FSPI_AHBCR_BUFF_EN_SHIFT) +#define FSPI_AHBCR_CACH_EN_SHIFT 3 +#define FSPI_AHBCR_CACH_EN_MASK (1 << FSPI_AHBCR_CACH_EN_SHIFT) +#define FSPI_AHBCR_CLRTXBUF_SHIFT 2 +#define FSPI_AHBCR_CLRTXBUF_MASK (1 << FSPI_AHBCR_CLRTXBUF_SHIFT) +#define FSPI_AHBCR_CLRRXBUF_SHIFT 1 +#define FSPI_AHBCR_CLRRXBUF_MASK (1 << FSPI_AHBCR_CLRRXBUF_SHIFT) +#define FSPI_AHBCR_PAR_EN_SHIFT 0 +#define FSPI_AHBCR_PAR_EN_MASK (1 << FSPI_AHBCR_PAR_EN_SHIFT) + +#define FSPI_INTEN 0x10 +#define FSPI_INTEN_SCLKSBWR_SHIFT 9 +#define FSPI_INTEN_SCLKSBWR_MASK (1 << FSPI_INTEN_SCLKSBWR_SHIFT) +#define FSPI_INTEN_SCLKSBRD_SHIFT 8 +#define FSPI_INTEN_SCLKSBRD_MASK (1 << FSPI_INTEN_SCLKSBRD_SHIFT) +#define FSPI_INTEN_DATALRNFL_SHIFT 7 +#define FSPI_INTEN_DATALRNFL_MASK (1 << FSPI_INTEN_DATALRNFL_SHIFT) +#define FSPI_INTEN_IPTXWE_SHIFT 6 +#define FSPI_INTEN_IPTXWE_MASK (1 << FSPI_INTEN_IPTXWE_SHIFT) +#define FSPI_INTEN_IPRXWA_SHIFT 5 +#define FSPI_INTEN_IPRXWA_MASK (1 << FSPI_INTEN_IPRXWA_SHIFT) +#define FSPI_INTEN_AHBCMDERR_SHIFT 4 +#define FSPI_INTEN_AHBCMDERR_MASK (1 << FSPI_INTEN_AHBCMDERR_SHIFT) +#define FSPI_INTEN_IPCMDERR_SHIFT 3 +#define FSPI_INTEN_IPCMDERR_MASK (1 << FSPI_INTEN_IPCMDERR_SHIFT) +#define FSPI_INTEN_AHBCMDGE_SHIFT 2 +#define FSPI_INTEN_AHBCMDGE_MASK (1 << FSPI_INTEN_AHBCMDGE_SHIFT) +#define FSPI_INTEN_IPCMDGE_SHIFT 1 +#define FSPI_INTEN_IPCMDGE_MASK (1 << FSPI_INTEN_IPCMDGE_SHIFT) +#define FSPI_INTEN_IPCMDDONE_SHIFT 0 +#define FSPI_INTEN_IPCMDDONE_MASK (1 << FSPI_INTEN_IPCMDDONE_SHIFT) + +#define FSPI_INTR 0x14 +#define FSPI_INTR_SCLKSBWR_SHIFT 9 +#define FSPI_INTR_SCLKSBWR_MASK (1 << FSPI_INTR_SCLKSBWR_SHIFT) +#define FSPI_INTR_SCLKSBRD_SHIFT 8 +#define FSPI_INTR_SCLKSBRD_MASK (1 << FSPI_INTR_SCLKSBRD_SHIFT) +#define FSPI_INTR_DATALRNFL_SHIFT 7 +#define FSPI_INTR_DATALRNFL_MASK (1 << FSPI_INTR_DATALRNFL_SHIFT) +#define FSPI_INTR_IPTXWE_SHIFT 6 +#define FSPI_INTR_IPTXWE_MASK (1 << FSPI_INTR_IPTXWE_SHIFT) +#define FSPI_INTR_IPRXWA_SHIFT 5 +#define FSPI_INTR_IPRXWA_MASK (1 << FSPI_INTR_IPRXWA_SHIFT) +#define FSPI_INTR_AHBCMDERR_SHIFT 4 +#define FSPI_INTR_AHBCMDERR_MASK (1 << FSPI_INTR_AHBCMDERR_SHIFT) +#define FSPI_INTR_IPCMDERR_SHIFT 3 +#define FSPI_INTR_IPCMDERR_MASK (1 << FSPI_INTR_IPCMDERR_SHIFT) +#define FSPI_INTR_AHBCMDGE_SHIFT 2 +#define FSPI_INTR_AHBCMDGE_MASK (1 << FSPI_INTR_AHBCMDGE_SHIFT) +#define FSPI_INTR_IPCMDGE_SHIFT 1 +#define FSPI_INTR_IPCMDGE_MASK (1 << FSPI_INTR_IPCMDGE_SHIFT) +#define FSPI_INTR_IPCMDDONE_SHIFT 0 +#define FSPI_INTR_IPCMDDONE_MASK (1 << FSPI_INTR_IPCMDDONE_SHIFT) + +#define FSPI_LUTKEY 0x18 +#define FSPI_LUTKEY_VALUE 0x5AF05AF0 + +#define FSPI_LCKCR 0x1C + +#define FSPI_LCKER_LOCK 0x1 +#define FSPI_LCKER_UNLOCK 0x2 + +#define FSPI_BUFXCR_INVALID_MSTRID 0xE +#define FSPI_AHBRX_BUF0CR0 0x20 +#define FSPI_AHBRX_BUF1CR0 0x24 +#define FSPI_AHBRX_BUF2CR0 0x28 +#define FSPI_AHBRX_BUF3CR0 0x2C +#define FSPI_AHBRX_BUF4CR0 0x30 +#define FSPI_AHBRX_BUF5CR0 0x34 +#define FSPI_AHBRX_BUF6CR0 0x38 +#define FSPI_AHBRX_BUF7CR0 0x3C +#define FSPI_AHBRXBUF0CR7_PREF_SHIFT 31 +#define FSPI_AHBRXBUF0CR7_PREF_MASK (1 << FSPI_AHBRXBUF0CR7_PREF_SHIFT) + +#define FSPI_AHBRX_BUF0CR1 0x40 +#define FSPI_AHBRX_BUF1CR1 0x44 +#define FSPI_AHBRX_BUF2CR1 0x48 +#define FSPI_AHBRX_BUF3CR1 0x4C +#define FSPI_AHBRX_BUF4CR1 0x50 +#define FSPI_AHBRX_BUF5CR1 0x54 +#define FSPI_AHBRX_BUF6CR1 0x58 +#define FSPI_AHBRX_BUF7CR1 0x5C +#define FSPI_BUFXCR1_MSID_SHIFT 0x0 +#define FSPI_BUFXCR1_MSID_MASK (0xF << FSPI_BUFXCR1_MSID_SHIFT) +#define FSPI_BUFXCR1_PRIO_SHIFT 0x8 +#define FSPI_BUFXCR1_PRIO_MASK (0x7 << FSPI_BUFXCR1_PRIO_SHIFT) + +#define FSPI_FLSHA1CR0 0x60 +#define FSPI_FLSHA2CR0 0x64 +#define FSPI_FLSHB1CR0 0x68 +#define FSPI_FLSHB2CR0 0x6C +#define FSPI_FLSHXCR0_SZ_SHIFT 10 +#define FSPI_FLSHXCR0_SZ_MASK (0x3FFFFF << FSPI_FLSHXCR0_SZ_SHIFT) + +#define FSPI_FLSHA1CR1 0x70 +#define FSPI_FLSHA2CR1 0x74 +#define FSPI_FLSHB1CR1 0x78 +#define FSPI_FLSHB2CR1 0x7C +#define FSPI_FLSHXCR1_CSINTR_SHIFT 16 +#define FSPI_FLSHXCR1_CSINTR_MASK \ + (0xFFFF << FSPI_FLSHXCR1_CSINTR_SHIFT) +#define FSPI_FLSHXCR1_CAS_SHIFT 11 +#define FSPI_FLSHXCR1_CAS_MASK (0xF << FSPI_FLSHXCR1_CAS_SHIFT) +#define FSPI_FLSHXCR1_WA_SHIFT 10 +#define FSPI_FLSHXCR1_WA_MASK (1 << FSPI_FLSHXCR1_WA_SHIFT) +#define FSPI_FLSHXCR1_TCSH_SHIFT 5 +#define FSPI_FLSHXCR1_TCSH_MASK (0x1F << FSPI_FLSHXCR1_TCSH_SHIFT) +#define FSPI_FLSHXCR1_TCSS_SHIFT 0 +#define FSPI_FLSHXCR1_TCSS_MASK (0x1F << FSPI_FLSHXCR1_TCSS_SHIFT) + +#define FSPI_FLSHA1CR2 0x80 +#define FSPI_FLSHA2CR2 0x84 +#define FSPI_FLSHB1CR2 0x88 +#define FSPI_FLSHB2CR2 0x8C +#define FSPI_FLSHXCR2_CLRINSP_SHIFT 24 +#define FSPI_FLSHXCR2_CLRINSP_MASK (1 << FSPI_FLSHXCR2_CLRINSP_SHIFT) +#define FSPI_FLSHXCR2_AWRWAIT_SHIFT 16 +#define FSPI_FLSHXCR2_AWRWAIT_MASK (0xFF << FSPI_FLSHXCR2_AWRWAIT_SHIFT) +#define FSPI_FLSHXCR2_AWRSEQN_SHIFT 13 +#define FSPI_FLSHXCR2_AWRSEQN_MASK (0x7 << FSPI_FLSHXCR2_AWRSEQN_SHIFT) +#define FSPI_FLSHXCR2_AWRSEQI_SHIFT 8 +#define FSPI_FLSHXCR2_AWRSEQI_MASK (0xF << FSPI_FLSHXCR2_AWRSEQI_SHIFT) +#define FSPI_FLSHXCR2_ARDSEQN_SHIFT 5 +#define FSPI_FLSHXCR2_ARDSEQN_MASK (0x7 << FSPI_FLSHXCR2_ARDSEQN_SHIFT) +#define FSPI_FLSHXCR2_ARDSEQI_SHIFT 0 +#define FSPI_FLSHXCR2_ARDSEQI_MASK (0xF << FSPI_FLSHXCR2_ARDSEQI_SHIFT) + +#define FSPI_IPCR0 0xA0 + +#define FSPI_IPCR1 0xA4 +#define FSPI_IPCR1_IPAREN_SHIFT 31 +#define FSPI_IPCR1_IPAREN_MASK (1 << FSPI_IPCR1_IPAREN_SHIFT) +#define FSPI_IPCR1_SEQNUM_SHIFT 24 +#define FSPI_IPCR1_SEQNUM_MASK (0xF << FSPI_IPCR1_SEQNUM_SHIFT) +#define FSPI_IPCR1_SEQID_SHIFT 16 +#define FSPI_IPCR1_SEQID_MASK (0xF << FSPI_IPCR1_SEQID_SHIFT) +#define FSPI_IPCR1_IDATSZ_SHIFT 0 +#define FSPI_IPCR1_IDATSZ_MASK (0xFFFF << FSPI_IPCR1_IDATSZ_SHIFT) + +#define FSPI_IPCMD 0xB0 +#define FSPI_IPCMD_TRG_SHIFT 0 +#define FSPI_IPCMD_TRG_MASK (1 << FSPI_IPCMD_TRG_SHIFT) + +#define FSPI_DLPR 0xB4 + +#define FSPI_IPRXFCR 0xB8 +#define FSPI_IPRXFCR_CLR_SHIFT 0 +#define FSPI_IPRXFCR_CLR_MASK (1 << FSPI_IPRXFCR_CLR_SHIFT) +#define FSPI_IPRXFCR_DMA_EN_SHIFT 1 +#define FSPI_IPRXFCR_DMA_EN_MASK (1 << FSPI_IPRXFCR_DMA_EN_SHIFT) +#define FSPI_IPRXFCR_WMRK_SHIFT 2 +#define FSPI_IPRXFCR_WMRK_MASK (0x1F << FSPI_IPRXFCR_WMRK_SHIFT) + +#define FSPI_IPTXFCR 0xBC +#define FSPI_IPTXFCR_CLR_SHIFT 0 +#define FSPI_IPTXFCR_CLR_MASK (1 << FSPI_IPTXFCR_CLR_SHIFT) +#define FSPI_IPTXFCR_DMA_EN_SHIFT 1 +#define FSPI_IPTXFCR_DMA_EN_MASK (1 << FSPI_IPTXFCR_DMA_EN_SHIFT) +#define FSPI_IPTXFCR_WMRK_SHIFT 2 +#define FSPI_IPTXFCR_WMRK_MASK (0x1F << FSPI_IPTXFCR_WMRK_SHIFT) + +#define FSPI_DLLACR 0xC0 +#define FSPI_DLLACR_OVRDEN_SHIFT 8 +#define FSPI_DLLACR_OVRDEN_MASK (1 << FSPI_DLLACR_OVRDEN_SHIFT) + +#define FSPI_DLLBCR 0xC4 +#define FSPI_DLLBCR_OVRDEN_SHIFT 8 +#define FSPI_DLLBCR_OVRDEN_MASK (1 << FSPI_DLLBCR_OVRDEN_SHIFT) + +#define FSPI_STS0 0xE0 +#define FSPI_STS0_DLPHA_SHIFT 9 +#define FSPI_STS0_DLPHA_MASK (0x1F << FSPI_STS0_DLPHA_SHIFT) +#define FSPI_STS0_DLPHB_SHIFT 4 +#define FSPI_STS0_DLPHB_MASK (0x1F << FSPI_STS0_DLPHB_SHIFT) +#define FSPI_STS0_CMD_SRC_SHIFT 2 +#define FSPI_STS0_CMD_SRC_MASK (3 << FSPI_STS0_CMD_SRC_SHIFT) +#define FSPI_STS0_ARB_IDLE_SHIFT 1 +#define FSPI_STS0_ARB_IDLE_MASK (1 << FSPI_STS0_ARB_IDLE_SHIFT) +#define FSPI_STS0_SEQ_IDLE_SHIFT 0 +#define FSPI_STS0_SEQ_IDLE_MASK (1 << FSPI_STS0_SEQ_IDLE_SHIFT) + +#define FSPI_STS1 0xE4 +#define FSPI_STS1_IP_ERRCD_SHIFT 24 +#define FSPI_STS1_IP_ERRCD_MASK (0xF << FSPI_STS1_IP_ERRCD_SHIFT) +#define FSPI_STS1_IP_ERRID_SHIFT 16 +#define FSPI_STS1_IP_ERRID_MASK (0xF << FSPI_STS1_IP_ERRID_SHIFT) +#define FSPI_STS1_AHB_ERRCD_SHIFT 8 +#define FSPI_STS1_AHB_ERRCD_MASK (0xF << FSPI_STS1_AHB_ERRCD_SHIFT) +#define FSPI_STS1_AHB_ERRID_SHIFT 0 +#define FSPI_STS1_AHB_ERRID_MASK (0xF << FSPI_STS1_AHB_ERRID_SHIFT) + +#define FSPI_AHBSPNST 0xEC +#define FSPI_AHBSPNST_DATLFT_SHIFT 16 +#define FSPI_AHBSPNST_DATLFT_MASK \ + (0xFFFF << FSPI_AHBSPNST_DATLFT_SHIFT) +#define FSPI_AHBSPNST_BUFID_SHIFT 1 +#define FSPI_AHBSPNST_BUFID_MASK (7 << FSPI_AHBSPNST_BUFID_SHIFT) +#define FSPI_AHBSPNST_ACTIVE_SHIFT 0 +#define FSPI_AHBSPNST_ACTIVE_MASK (1 << FSPI_AHBSPNST_ACTIVE_SHIFT) + +#define FSPI_IPRXFSTS 0xF0 +#define FSPI_IPRXFSTS_RDCNTR_SHIFT 16 +#define FSPI_IPRXFSTS_RDCNTR_MASK \ + (0xFFFF << FSPI_IPRXFSTS_RDCNTR_SHIFT) +#define FSPI_IPRXFSTS_FILL_SHIFT 0 +#define FSPI_IPRXFSTS_FILL_MASK (0xFF << FSPI_IPRXFSTS_FILL_SHIFT) + +#define FSPI_IPTXFSTS 0xF4 +#define FSPI_IPTXFSTS_WRCNTR_SHIFT 16 +#define FSPI_IPTXFSTS_WRCNTR_MASK \ + (0xFFFF << FSPI_IPTXFSTS_WRCNTR_SHIFT) +#define FSPI_IPTXFSTS_FILL_SHIFT 0 +#define FSPI_IPTXFSTS_FILL_MASK (0xFF << FSPI_IPTXFSTS_FILL_SHIFT) + +#define FSPI_RFDR 0x100 +#define FSPI_TFDR 0x180 + +#define FSPI_LUT_BASE 0x200 +#define FSPI_LUT_OFFSET (SEQID_LUT * 4 * 4) +#define FSPI_LUT_REG(idx) \ + (FSPI_LUT_BASE + FSPI_LUT_OFFSET + (idx) * 4) + +/* register map end */ + +/* Instruction set for the LUT register. */ +#define LUT_STOP 0x00 +#define LUT_CMD 0x01 +#define LUT_ADDR 0x02 +#define LUT_CADDR_SDR 0x03 +#define LUT_MODE 0x04 +#define LUT_MODE2 0x05 +#define LUT_MODE4 0x06 +#define LUT_MODE8 0x07 +#define LUT_NXP_WRITE 0x08 +#define LUT_NXP_READ 0x09 +#define LUT_LEARN_SDR 0x0A +#define LUT_DATSZ_SDR 0x0B +#define LUT_DUMMY 0x0C +#define LUT_DUMMY_RWDS_SDR 0x0D +#define LUT_JMP_ON_CS 0x1F +#define LUT_CMD_DDR 0x21 +#define LUT_ADDR_DDR 0x22 +#define LUT_CADDR_DDR 0x23 +#define LUT_MODE_DDR 0x24 +#define LUT_MODE2_DDR 0x25 +#define LUT_MODE4_DDR 0x26 +#define LUT_MODE8_DDR 0x27 +#define LUT_WRITE_DDR 0x28 +#define LUT_READ_DDR 0x29 +#define LUT_LEARN_DDR 0x2A +#define LUT_DATSZ_DDR 0x2B +#define LUT_DUMMY_DDR 0x2C +#define LUT_DUMMY_RWDS_DDR 0x2D + +/* + * Calculate number of required PAD bits for LUT register. + * + * The pad stands for the number of IO lines [0:7]. + * For example, the octal read needs eight IO lines, + * so you should use LUT_PAD(8). This macro + * returns 3 i.e. use eight (2^3) IP lines for read. + */ +#define LUT_PAD(x) (fls(x) - 1) + +/* + * Macro for constructing the LUT entries with the following + * register layout: + * + * --------------------------------------------------- + * | INSTR1 | PAD1 | OPRND1 | INSTR0 | PAD0 | OPRND0 | + * --------------------------------------------------- + */ +#define PAD_SHIFT 8 +#define INSTR_SHIFT 10 +#define OPRND_SHIFT 16 + +/* Macros for constructing the LUT register. */ +#define LUT_DEF(idx, ins, pad, opr) \ + ((((ins) << INSTR_SHIFT) | ((pad) << PAD_SHIFT) | \ + (opr)) << (((idx) % 2) * OPRND_SHIFT)) + +/* Oprands for the LUT register. */ +#define ADDR24BIT 0x18 +#define ADDR32BIT 0x20 + +enum nxp_fspi_devtype { + NXP_FSPI_LX2160A, +}; + +struct nxp_fspi_devtype_data { + enum nxp_fspi_devtype devtype; + unsigned int rxfifo; + unsigned int txfifo; + unsigned int ahb_buf_size; + unsigned int quirks; +}; + +static const struct nxp_fspi_devtype_data lx2160a_data = { + .devtype = NXP_FSPI_LX2160A, + .rxfifo = SZ_512, /* (64 * 64 bits) */ + .txfifo = SZ_1K, /* (128 * 64 bits) */ + .ahb_buf_size = SZ_2K, /* (256 * 64 bits) */ + .quirks = 0, +}; + +#define NXP_FSPI_MAX_CHIPSELECT 4 + +struct nxp_fspi_slave { + u32 slave_size; + u32 slave_base_addr; +}; + +struct nxp_fspi { + void __iomem *iobase; + void __iomem *ahb_addr; + u32 memmap_phy; + struct clk *clk, *clk_en; + struct device *dev; + struct completion c; + const struct nxp_fspi_devtype_data *devtype_data; + struct mutex lock; + struct pm_qos_request pm_qos_req; + struct nxp_fspi_slave slave[NXP_FSPI_MAX_CHIPSELECT]; + int selected; + u8 seq; + u32 start_addr; + u32 memmap_offs; + u32 memmap_len; + void (*write)(u32 val, void __iomem *addr); + u32 (*read)(void __iomem *addr); +}; + +static void fspi_writel_be(u32 val, void __iomem *addr) +{ + iowrite32be(val, addr); +} + +static void fspi_writel(u32 val, void __iomem *addr) +{ + iowrite32(val, addr); +} + +static u32 fspi_readl_be(void __iomem *addr) +{ + return ioread32be(addr); +} + +static u32 fspi_readl(void __iomem *addr) +{ + return ioread32(addr); +} + +static irqreturn_t nxp_fspi_irq_handler(int irq, void *dev_id) +{ + struct nxp_fspi *f = dev_id; + u32 reg; + + /* clear interrupt */ + reg = f->read(f->iobase + FSPI_INTR); + f->write(FSPI_INTR_IPCMDDONE_MASK, f->iobase + FSPI_INTR); + + if (reg & FSPI_INTR_IPCMDDONE_MASK) + complete(&f->c); + + return IRQ_HANDLED; +} + +static int nxp_fspi_check_buswidth(struct nxp_fspi *f, u8 width) +{ + switch (width) { + case 1: + case 2: + case 4: + case 8: + return 0; + } + + return -ENOTSUPP; +} + +static bool nxp_fspi_supports_op(struct spi_mem *mem, + const struct spi_mem_op *op) +{ + struct nxp_fspi *f = spi_controller_get_devdata(mem->spi->master); + int ret; + + ret = nxp_fspi_check_buswidth(f, op->cmd.buswidth); + + if (op->addr.nbytes) + ret |= nxp_fspi_check_buswidth(f, op->addr.buswidth); + + if (op->dummy.nbytes) + ret |= nxp_fspi_check_buswidth(f, op->dummy.buswidth); + + if (op->data.nbytes) + ret |= nxp_fspi_check_buswidth(f, op->data.buswidth); + + if (ret) + return false; + + /* + * The number of instructions needed for the op, needs + * to fit into a single LUT entry. + */ + if (op->addr.nbytes + + (op->dummy.nbytes ? 1:0) + + (op->data.nbytes ? 1:0) > 6) + return false; + + /* Max 64 dummy clock cycles supported */ + if (op->dummy.nbytes * 8 / op->dummy.buswidth > 64) + return false; + + /* Max data length, check controller limits and alignment */ + if (op->data.dir == SPI_MEM_DATA_IN && + (op->data.nbytes > f->devtype_data->ahb_buf_size || + (op->data.nbytes > f->devtype_data->rxfifo - 4 && + !IS_ALIGNED(op->data.nbytes, 8)))) + return false; + + if (op->data.dir == SPI_MEM_DATA_OUT && + op->data.nbytes > f->devtype_data->txfifo) + return false; + + return true; +} + +/* + * If the slave device content being changed by Write/Erase, need to + * invalidate the AHB buffer. This can be achieved by doing reset of the + * controller using setting SWRESET bit for MCR0 register. + */ +static inline void nxp_fspi_invalid(struct nxp_fspi *f) +{ + u32 reg; + + reg = f->read(f->iobase + FSPI_MCR0); + f->write(reg | FSPI_MCR0_SWRST_MASK, f->iobase + FSPI_MCR0); + + while (f->read(f->iobase + FSPI_MCR0) & FSPI_MCR0_SWRST_MASK) + ; +} + +static void nxp_fspi_prepare_lut(struct nxp_fspi *f, + const struct spi_mem_op *op) +{ + void __iomem *base = f->iobase; + u32 lutval[4] = {}; + int lutidx = 1, i; + + /* cmd */ + lutval[0] |= LUT_DEF(0, LUT_CMD, LUT_PAD(op->cmd.buswidth), + op->cmd.opcode); + + /* addr bus width */ + if (op->addr.nbytes) { + u32 addrlen = (op->addr.nbytes == 3) ? ADDR24BIT : ADDR32BIT; + + lutval[lutidx / 2] |= LUT_DEF(lutidx, LUT_ADDR, + LUT_PAD(op->addr.buswidth), + addrlen); + lutidx++; + } + + /* dummy bytes, if needed */ + if (op->dummy.nbytes) { + lutval[lutidx / 2] |= LUT_DEF(lutidx, LUT_DUMMY, + LUT_PAD(op->dummy.buswidth), + op->dummy.nbytes * 8 / + op->dummy.buswidth); + lutidx++; + } + + /* read/write data bytes */ + if (op->data.nbytes) { + lutval[lutidx / 2] |= LUT_DEF(lutidx, + op->data.dir == SPI_MEM_DATA_IN ? + LUT_NXP_READ : LUT_NXP_WRITE, + LUT_PAD(op->data.buswidth), + 0); + lutidx++; + } + + /* stop condition. */ + lutval[lutidx / 2] |= LUT_DEF(lutidx, LUT_STOP, 0, 0); + + /* unlock LUT */ + f->write(FSPI_LUTKEY_VALUE, f->iobase + FSPI_LUTKEY); + f->write(FSPI_LCKER_UNLOCK, f->iobase + FSPI_LCKCR); + + /* fill LUT */ + for (i = 0; i < ARRAY_SIZE(lutval); i++) + f->write(lutval[i], base + FSPI_LUT_REG(i)); + + dev_dbg(f->dev, "CMD[%x] lutval[0:%x \t 1:%x \t 2:%x \t 3:%x]\n", + op->cmd.opcode, lutval[0], lutval[1], lutval[2], lutval[3]); + + /* lock LUT */ + f->write(FSPI_LUTKEY_VALUE, f->iobase + FSPI_LUTKEY); + f->write(FSPI_LCKER_LOCK, f->iobase + FSPI_LCKCR); +} + +static int nxp_fspi_clk_prep_enable(struct nxp_fspi *f) +{ + int ret; + + ret = clk_prepare_enable(f->clk_en); + if (ret) + return ret; + + ret = clk_prepare_enable(f->clk); + if (ret) { + clk_disable_unprepare(f->clk_en); + return ret; + } + + return 0; +} + +static void nxp_fspi_clk_disable_unprep(struct nxp_fspi *f) +{ + clk_disable_unprepare(f->clk); + clk_disable_unprepare(f->clk_en); +} + +#define FSPI_SLAVE_MIN_SIZE SZ_2K /* ahb_buf_size */ + +/* + * In FlexSPI controller, flash access is based on value of FSPI_FLSHXXCR0 + * register and start base address of the slave device. + * + * (Higher address) + * -------- <-- FLSHB2CR0 + * | B2 | + * | | + * B2 start address --> -------- <-- FLSHB1CR0 + * | B1 | + * | | + * B1 start address --> -------- <-- FLSHA2CR0 + * | A2 | + * | | + * A2 start address --> -------- <-- FLSHA1CR0 + * | A1 | + * | | + * A1 start address --> -------- (Lower address) + * + * + * Start base address defines the starting address range for given CS and + * FSPI_FLSHXXCR0 defines the size of the slave device connected at given CS. + * For e.g. to access CS3 (B2), start base address is sum of size of the slave + * devices connected at A1, A2 and B1. + * FLSHB2CR0 register would have the value of the slave device size connected + * at CS3. + * + * Before slave device probe, slave size is programmed as 0. + * ReadId cmd (NOR slave devices) is being requested for slave device before + * device probe. For such cases, when slave size is 0, program default slave + * device size, only for the connected slave device, as + * FlexSPI controller's ahb_buf_size. + */ +static void nxp_fspi_select_mem(struct nxp_fspi *f, struct spi_device *spi) +{ + unsigned long rate = spi->max_speed_hz; + int ret; + uint64_t size_kb; + + /* + * Return, + * if previously selected slave device is same as current requested + * slave device. + * and if, slave device size has been configured correctly and is + * greater than default set size, FSPI_SLAVE_MIN_SIZE. + */ + if ((f->selected == spi->chip_select) && + (f->slave[spi->chip_select].slave_size > FSPI_SLAVE_MIN_SIZE)) + return; + + if (spi->size == 0) /* e.g. in NOR slave device for 9F (ReadId) cmd */ + size_kb = FSPI_SLAVE_MIN_SIZE >> FSPI_FLSHXCR0_SZ_SHIFT; + else + size_kb = spi->size >> FSPI_FLSHXCR0_SZ_SHIFT; + + switch (spi->chip_select) { + case 0: + f->write(size_kb, f->iobase + FSPI_FLSHA1CR0); + f->slave[0].slave_size = size_kb << FSPI_FLSHXCR0_SZ_SHIFT; + f->slave[0].slave_base_addr = 0; + break; + case 1: + f->write(size_kb, f->iobase + FSPI_FLSHA2CR0); + f->slave[1].slave_size = size_kb << FSPI_FLSHXCR0_SZ_SHIFT; + f->slave[1].slave_base_addr = f->slave[0].slave_size; + break; + case 2: + f->write(size_kb, f->iobase + FSPI_FLSHB1CR0); + f->slave[2].slave_size = size_kb << FSPI_FLSHXCR0_SZ_SHIFT; + f->slave[2].slave_base_addr = f->slave[0].slave_size + + f->slave[1].slave_size; + break; + case 3: + f->write(size_kb, f->iobase + FSPI_FLSHB2CR0); + f->slave[3].slave_size = size_kb << FSPI_FLSHXCR0_SZ_SHIFT; + f->slave[3].slave_base_addr = f->slave[0].slave_size + + f->slave[1].slave_size + + f->slave[2].slave_size; + break; + default: + return; + } + + f->start_addr = f->slave[spi->chip_select].slave_base_addr; + + dev_dbg(f->dev, "Slave device [CS:%x size:%x start_addr:0x%08x]\n", + spi->chip_select, spi->size, f->start_addr); + + nxp_fspi_clk_disable_unprep(f); + + ret = clk_set_rate(f->clk, rate); + if (ret) + return; + + ret = nxp_fspi_clk_prep_enable(f); + if (ret) + return; + f->selected = spi->chip_select; +} + +#define FSPI_MIN_IOMAP SZ_4M + +static void nxp_fspi_read_ahb(struct nxp_fspi *f, const struct spi_mem_op *op) +{ + u32 len = op->data.nbytes; + + /* if necessary, ioremap buffer before AHB read . */ + if (!f->ahb_addr) { + f->memmap_offs = f->start_addr + op->addr.val; + f->memmap_len = len > FSPI_MIN_IOMAP ? len : FSPI_MIN_IOMAP; + f->ahb_addr = ioremap_nocache(f->memmap_phy + f->memmap_offs, + f->memmap_len); + if (!f->ahb_addr) { + dev_err(f->dev, "ioremap failed\n"); + return; + } + } else if (f->start_addr + op->addr.val < f->memmap_offs + || f->start_addr + op->addr.val + len > + f->memmap_offs + f->memmap_len) { + + iounmap(f->ahb_addr); + + f->memmap_offs = f->start_addr + op->addr.val; + f->memmap_len = len > FSPI_MIN_IOMAP ? len : FSPI_MIN_IOMAP; + f->ahb_addr = ioremap_nocache(f->memmap_phy + f->memmap_offs, + f->memmap_len); + if (!f->ahb_addr) { + dev_err(f->dev, "ioremap failed\n"); + return; + } + } + memcpy_fromio(op->data.buf.in, (f->ahb_addr + f->start_addr + + op->addr.val - f->memmap_offs), len); +} + +static void nxp_fspi_fill_txfifo(struct nxp_fspi *f, + const struct spi_mem_op *op) +{ + void __iomem *base = f->iobase; + int i, j; + int size, tmp_size; + u32 data = 0; + u32 *txbuf = (u32 *) op->data.buf.out; + + /* clear the TX FIFO. */ + f->write(FSPI_IPTXFCR_CLR_MASK, base + FSPI_IPTXFCR); + + size = op->data.nbytes / 8; + for (i = 0; i < size; i++) { + /* Wait for TXFIFO empty */ + while (!(f->read(base + FSPI_INTR) & FSPI_INTR_IPTXWE_MASK)) + ; + + j = 0; + tmp_size = 8; + while (tmp_size > 0) { + data = 0; + memcpy(&data, txbuf, 4); + f->write(data, base + FSPI_TFDR + j * 4); + tmp_size -= 4; + j++; + txbuf += 1; + } + f->write(FSPI_INTR_IPTXWE_MASK, base + FSPI_INTR); + } + + size = op->data.nbytes % 8; + if (size) { + /* Wait for TXFIFO empty */ + while (!(f->read(base + FSPI_INTR) & FSPI_INTR_IPTXWE_MASK)) + ; + j = 0; + tmp_size = 0; + while (size > 0) { + data = 0; + tmp_size = (size < 4) ? size : 4; + memcpy(&data, txbuf, tmp_size); + f->write(data, base + FSPI_TFDR + j * 4); + size -= tmp_size; + j++; + txbuf += 1; + } + f->write(FSPI_INTR_IPTXWE_MASK, base + FSPI_INTR); + } +} + +static void nxp_fspi_read_rxfifo(struct nxp_fspi *f, + const struct spi_mem_op *op) +{ + void __iomem *base = f->iobase; + int i, j; + int size, tmp_size; + u32 tmp = 0; + u8 *buf = op->data.buf.in; + u32 len = op->data.nbytes; + + while (len > 0) { + size = len / 8; + + for (i = 0; i < size; i++) { + /* Wait for RXFIFO available */ + while (!(f->read(base + FSPI_INTR) + & FSPI_INTR_IPRXWA_MASK)) + ; + + j = 0; + tmp_size = 8; + while (tmp_size > 0) { + tmp = 0; + tmp = f->read(base + FSPI_RFDR + j * 4); + memcpy(buf, &tmp, 4); + tmp_size -= 4; + j++; + buf += 4; + } + /* move the FIFO pointer */ + f->write(FSPI_INTR_IPRXWA_MASK, base + FSPI_INTR); + len -= 8; + } + + size = len % 8; + + j = 0; + if (size) { + /* Wait for RXFIFO available */ + while (!(f->read(base + FSPI_INTR) + & FSPI_INTR_IPRXWA_MASK)) + ; + + while (len > 0) { + tmp = 0; + size = (len < 4) ? len : 4; + tmp = f->read(base + FSPI_RFDR + j * 4); + memcpy(buf, &tmp, size); + len -= size; + j++; + buf += size; + } + } + + /* invalid the RXFIFO */ + f->write(FSPI_IPRXFCR_CLR_MASK, base + FSPI_IPRXFCR); + /* move the FIFO pointer */ + f->write(FSPI_INTR_IPRXWA_MASK, base + FSPI_INTR); + } +} + +static int nxp_fspi_do_op(struct nxp_fspi *f, const struct spi_mem_op *op) +{ + void __iomem *base = f->iobase; + int seqnum = 0; + int err = 0; + u32 reg; + + reg = f->read(base + FSPI_IPRXFCR); + /* invalid RXFIFO first */ + reg &= ~FSPI_IPRXFCR_DMA_EN_MASK; + reg = reg | FSPI_IPRXFCR_CLR_MASK; + f->write(reg, base + FSPI_IPRXFCR); + + init_completion(&f->c); + + f->write(f->start_addr + op->addr.val, base + FSPI_IPCR0); + /* + * Always start the sequence at the same index since we update + * the LUT at each exec_op() call. And also specify the DATA + * length, since it's has not been specified in the LUT. + */ + f->write(op->data.nbytes | + (SEQID_LUT << FSPI_IPCR1_SEQID_SHIFT) | + (seqnum << FSPI_IPCR1_SEQNUM_SHIFT), + base + FSPI_IPCR1); + + /* trigger the LUT now */ + f->write(FSPI_IPCMD_TRG_MASK, base + FSPI_IPCMD); + + /* Wait for the interrupt. */ + if (!wait_for_completion_timeout(&f->c, msecs_to_jiffies(1000))) + err = -ETIMEDOUT; + + if (!err && op->data.nbytes && op->data.dir == SPI_MEM_DATA_IN) + nxp_fspi_read_rxfifo(f, op); + + return err; +} + +static int nxp_fspi_exec_op(struct spi_mem *mem, const struct spi_mem_op *op) +{ + struct nxp_fspi *f = spi_controller_get_devdata(mem->spi->master); + void __iomem *base = f->iobase; + int err = 0; + unsigned int timeout = 1000; + + mutex_lock(&f->lock); + + /* wait for the controller being ready */ + do { + u32 status; + + status = f->read(base + FSPI_STS0); + if ((status & FSPI_STS0_ARB_IDLE_MASK) && + (status & FSPI_STS0_SEQ_IDLE_MASK)) + break; + udelay(1); + dev_dbg(f->dev, "The controller is busy, 0x%x\n", status); + } while (--timeout); + + nxp_fspi_select_mem(f, mem->spi); + + nxp_fspi_prepare_lut(f, op); + /* + * If we have large chunks of data, we read them through the AHB bus + * by accessing the mapped memory. In all other cases we use + * IP commands to access the flash. + */ + if (op->data.nbytes > (f->devtype_data->rxfifo - 4) && + op->data.dir == SPI_MEM_DATA_IN) { + nxp_fspi_read_ahb(f, op); + } else { + if (op->data.nbytes && op->data.dir == SPI_MEM_DATA_OUT) + nxp_fspi_fill_txfifo(f, op); + + err = nxp_fspi_do_op(f, op); + + /* Invalidate the data in the AHB buffer. */ + if (op->data.nbytes && op->data.dir == SPI_MEM_DATA_OUT) + nxp_fspi_invalid(f); + } + + mutex_unlock(&f->lock); + + return err; +} + +static int nxp_fspi_adjust_op_size(struct spi_mem *mem, struct spi_mem_op *op) +{ + struct nxp_fspi *f = spi_controller_get_devdata(mem->spi->master); + + if (op->data.dir == SPI_MEM_DATA_OUT) { + if (op->data.nbytes > f->devtype_data->txfifo) + op->data.nbytes = f->devtype_data->txfifo; + } else { + if (op->data.nbytes > f->devtype_data->ahb_buf_size) + op->data.nbytes = f->devtype_data->ahb_buf_size; + else if (op->data.nbytes > (f->devtype_data->rxfifo - 4)) + op->data.nbytes = ALIGN_DOWN(op->data.nbytes, 8); + } + + return 0; +} + +static int nxp_fspi_default_setup(struct nxp_fspi *f) +{ + void __iomem *base = f->iobase; + int ret, i; + u32 reg; + + /* disable and unprepare clock to avoid glitch pass to controller */ + nxp_fspi_clk_disable_unprep(f); + + /* the default frequency, we will change it later if necessary. */ + ret = clk_set_rate(f->clk, 20000000); + if (ret) + return ret; + + ret = nxp_fspi_clk_prep_enable(f); + if (ret) + return ret; + + /* Reset the module */ + f->write(FSPI_MCR0_SWRST_MASK, base + FSPI_MCR0); + do { + udelay(1); + } while (f->read(f->iobase + FSPI_MCR0) & FSPI_MCR0_SWRST_MASK); + + /* Disable the module */ + f->write(FSPI_MCR0_MDIS_MASK, base + FSPI_MCR0); + + /* Reset the DLL register to default value */ + f->write(FSPI_DLLACR_OVRDEN_MASK, base + FSPI_DLLACR); + f->write(FSPI_DLLBCR_OVRDEN_MASK, base + FSPI_DLLBCR); + + /* enable module */ + f->write(FSPI_MCR0_AHB_TIMEOUT_MASK | FSPI_MCR0_IP_TIMEOUT_MASK, + base + FSPI_MCR0); + + /* + * Disable same device enable bit and configure all slave devices + * independently. + */ + reg = f->read(f->iobase + FSPI_MCR2); + reg = reg & ~(1 << (FSPI_MCR2_SAMEDEVICEEN_SHIFT)); + f->write(reg, base + FSPI_MCR2); + + /* AHB configuration for access buffer 0~7. */ + for (i = 0; i < 7; i++) + f->write(0, base + FSPI_AHBRX_BUF0CR0 + 4 * i); + + /* + * Set ADATSZ with the maximum AHB buffer size to improve the read + * performance. + */ + f->write((f->devtype_data->ahb_buf_size / 8 | + FSPI_AHBRXBUF0CR7_PREF_MASK), base + FSPI_AHBRX_BUF7CR0); + + /* prefetch and no start address alignment limitation */ + f->write(FSPI_AHBCR_PREF_EN_MASK | FSPI_AHBCR_RDADDROPT_MASK, + base + FSPI_AHBCR); + + /* Set lut sequence ID for AHB Read. */ + f->write(SEQID_LUT, base + FSPI_FLSHA1CR2); + + f->selected = -1; + f->seq = 0; + + /* enable the interrupt */ + f->write(FSPI_INTEN_IPCMDDONE_MASK, base + FSPI_INTEN); + + return 0; +} + +static const struct spi_controller_mem_ops nxp_fspi_mem_ops = { + .adjust_op_size = nxp_fspi_adjust_op_size, + .supports_op = nxp_fspi_supports_op, + .exec_op = nxp_fspi_exec_op, +}; + +static int nxp_fspi_probe(struct platform_device *pdev) +{ + struct spi_controller *ctlr; + struct device *dev = &pdev->dev; + struct device_node *np = dev->of_node; + struct resource *res; + struct nxp_fspi *f; + int ret; + + ctlr = spi_alloc_master(&pdev->dev, sizeof(*f)); + if (!ctlr) + return -ENOMEM; + + 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; + f->devtype_data = of_device_get_match_data(dev); + if (!f->devtype_data) { + ret = -ENODEV; + goto err_put_ctrl; + } + + platform_set_drvdata(pdev, f); + + /* find the resources - configuration register address space */ + res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "fspi_base"); + f->iobase = devm_ioremap_resource(dev, res); + if (IS_ERR(f->iobase)) { + ret = PTR_ERR(f->iobase); + goto err_put_ctrl; + } + + /* + * R/W functions for big- or little-endian registers: + * The FSPI controller's endianness is independent of + * the CPU core's endianness. So far, although the CPU + * core is little-endian the FSPI controller can use + * big-endian or little-endian. + */ + if (of_property_read_bool(np, "big-endian")) { + f->write = fspi_writel_be; + f->read = fspi_readl_be; + } else { + f->write = fspi_writel; + f->read = fspi_readl; + } + + /* find the resources - controller memory mapped space */ + res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "fspi_mmap"); + + if (!devm_request_mem_region(dev, res->start, resource_size(res), + res->name)) { + dev_err(dev, "can't request region for resource %pR\n", res); + ret = -EBUSY; + goto err_put_ctrl; + } + + f->memmap_phy = res->start; + + /* find the clocks */ + f->clk_en = devm_clk_get(dev, "fspi_en"); + if (IS_ERR(f->clk_en)) { + ret = PTR_ERR(f->clk_en); + goto err_put_ctrl; + } + + f->clk = devm_clk_get(dev, "fspi"); + if (IS_ERR(f->clk)) { + ret = PTR_ERR(f->clk); + goto err_put_ctrl; + } + + ret = nxp_fspi_clk_prep_enable(f); + if (ret) { + dev_err(dev, "can not enable the clock\n"); + goto err_put_ctrl; + } + + /* find the irq */ + ret = platform_get_irq(pdev, 0); + if (ret < 0) { + dev_err(dev, "failed to get the irq: %d\n", ret); + goto err_disable_clk; + } + + ret = devm_request_irq(dev, ret, + nxp_fspi_irq_handler, 0, pdev->name, f); + if (ret) { + dev_err(dev, "failed to request irq: %d\n", ret); + goto err_disable_clk; + } + + mutex_init(&f->lock); + + ctlr->bus_num = -1; + ctlr->num_chipselect = NXP_FSPI_MAX_CHIPSELECT; + ctlr->mem_ops = &nxp_fspi_mem_ops; + + nxp_fspi_default_setup(f); + + ctlr->dev.of_node = np; + + ret = spi_register_controller(ctlr); + if (ret) + goto err_destroy_mutex; + + return 0; + +err_destroy_mutex: + mutex_destroy(&f->lock); + +err_disable_clk: + nxp_fspi_clk_disable_unprep(f); + +err_put_ctrl: + spi_controller_put(ctlr); + + dev_err(dev, "NXP FSPI probe failed\n"); + return ret; +} + +static int nxp_fspi_remove(struct platform_device *pdev) +{ + struct nxp_fspi *f = platform_get_drvdata(pdev); + + /* disable the hardware */ + f->write(FSPI_MCR0_MDIS_MASK, f->iobase + FSPI_MCR0); + + nxp_fspi_clk_disable_unprep(f); + + mutex_destroy(&f->lock); + + if (f->ahb_addr) + iounmap(f->ahb_addr); + + return 0; +} + +static int nxp_fspi_suspend(struct device *dev) +{ + return 0; +} + +static int nxp_fspi_resume(struct device *dev) +{ + struct nxp_fspi *f = dev_get_drvdata(dev); + + nxp_fspi_default_setup(f); + + return 0; +} + +static const struct of_device_id nxp_fspi_dt_ids[] = { + { .compatible = "nxp,lx2160a-fspi", .data = (void *)&lx2160a_data, }, + { /* sentinel */ } +}; +MODULE_DEVICE_TABLE(of, nxp_fspi_dt_ids); + +static const struct dev_pm_ops nxp_fspi_pm_ops = { + .suspend = nxp_fspi_suspend, + .resume = nxp_fspi_resume, +}; + +static struct platform_driver nxp_fspi_driver = { + .driver = { + .name = "nxp-fspi", + .of_match_table = nxp_fspi_dt_ids, + .pm = &nxp_fspi_pm_ops, + }, + .probe = nxp_fspi_probe, + .remove = nxp_fspi_remove, +}; +module_platform_driver(nxp_fspi_driver); + +MODULE_DESCRIPTION("NXP FSPI Controller Driver"); +MODULE_AUTHOR("NXP Semiconductors"); +MODULE_LICENSE("GPL v2"); From patchwork Fri Aug 31 10:30:01 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: 10583547 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 B95D15A4 for ; Fri, 31 Aug 2018 10:32:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8FD4B2B61F for ; Fri, 31 Aug 2018 10:32:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 820092B68E; Fri, 31 Aug 2018 10:32:29 +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 1274F2B61F for ; Fri, 31 Aug 2018 10:32:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727586AbeHaOjN (ORCPT ); Fri, 31 Aug 2018 10:39:13 -0400 Received: from mail-eopbgr30073.outbound.protection.outlook.com ([40.107.3.73]:60160 "EHLO EUR03-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728370AbeHaOjL (ORCPT ); Fri, 31 Aug 2018 10:39:11 -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=b4kUtPczqq2ArRXHgp9TXPrxHOz33HfNwbLq0uZ1AI8=; b=aw9q9TiHHxAn1dPLAJYlGTzqLo93r0ukYhXTVE3lXsygcAijk+yisoXi6Rz1j5iftFo/TNYPLo6H992UCAWibfsy4qfxXWM1J1EOlnavCdmvG5O/WhaMNx6yF+bW8RJ9Ie6fpL5TO6/SQORhgmnjKibIjo/KygNfW1ZT67ym/Lc= 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:32:10 +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 4/7] dt-bindings: spi: add binding file for NXP FlexSPI driver Date: Fri, 31 Aug 2018 16:00:01 +0530 Message-Id: <1535711404-29528-5-git-send-email-yogeshnarayan.gaur@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1535711404-29528-1-git-send-email-yogeshnarayan.gaur@nxp.com> References: <1535711404-29528-1-git-send-email-yogeshnarayan.gaur@nxp.com> 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: 993dc838-ea78-44e6-8c60-08d60f2d0537 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:rNG/KLjwSKI4PEVRxsu6Zf3ZYYwYiOkuAv0pDgBlConr6KoksdCX35SPe/CJojl10jcWyZ4YjaWkPZt6GyWEu/KHjh2RJoOVezju7DRAxegYzF1RiiRYJCu/NrJmJIgHp2qlXr24orN2DimDYjiQYVpdXfNHihAt4wDPIya3OlSjX6WQtC/Qh7W88eDDm7Gz0ioLCuGdMfQtJqwa+xPqYwb4Yu4RBoX11JrUTCVirqqkeTxYgGlhg2qr++Zcpo0r;25:Qubxju0pBS2LUIr+Fp0s92v1CE5nwo45oHTGTPq4+hwlNpAbwLtvwwy5zs2chof/M9WRBOvl9vOZEea6frPqDEYIOLj5zNGP1O+ezUVecOnkgWuZe0Y/sZPdZbH1hBPQAk9E57UbEjz0k4yNsUvhjGU82tE5lEkFg8729GOVOIIxt0rdVMcUkv1sLUanqSZbiiCBaoNDUKy5iE46ZG8MoIkIG+nSlOO8aWx4k4ejXMFWdvKyAajxf9IHApdeWX/y3pnIwbYi985aBEZLay8TSyooYD1u7nQuGDWqYRzWbZwWLxL0U1H3BPMHqr4Gm1vtnuoZXQo+SA1MlGm9XMaNSw==;31:bmlNOcubUbgjdqjdVBSEG7Br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/0Yhp7hXeOHPG3iIoGv69KCEl8//7zH6MWT5 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); 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)(979002)(396003)(39850400004)(376002)(346002)(366004)(136003)(199004)(189003)(48376002)(7736002)(7416002)(8936002)(105586002)(5009440100003)(52116002)(106356001)(51416003)(55236004)(386003)(6506007)(81156014)(81166006)(76176011)(2906002)(86362001)(3846002)(186003)(50466002)(16526019)(6116002)(305945005)(26005)(6486002)(66066001)(47776003)(25786009)(36756003)(5660300001)(97736004)(8676002)(53936002)(6512007)(50226002)(316002)(6666003)(39060400002)(68736007)(486006)(4326008)(16586007)(11346002)(478600001)(446003)(2616005)(476003)(956004)(110426005)(969003)(989001)(999001)(1009001)(1019001);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:eXz8Rpaw3LOhL4rIE93ROFtnPYuL9gbTYiOsUfG2x7woemzf3XquGURsCgYeN1/PlbhjOaAay3AgQ4vOIc4w9fZaDGeN3G35KDRK+jhRU2R1adGl1ZPVlrvY/vXYo94LlF2jFxdp/f2G9BYzXjpVSIM6COj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engyJ4TE0xHMq8wBmoERTTGb4IT5lm22VJW2mbSvPjy9AN69Rq9hn3tuxT54CpBzLW/cxPyGS9m/+2iICW+EnpGD5tvQDLy5odpeX63K5tzd+oILTKIymFHMNFkBXDyRFEHcZy9OnFZwijDhacW8jkiNE3fY=;7:jXkmCqOdEhDG7lcxvwFxBL5z44RheY87+3halvjJ8Zh1bMlVxfDcqM3IKFD/rIoGaZqLF3aLvQqF/JMpbr7tkP6JRmUhT0xM7gDi2DO6wpvnMcne4X/W84U9Bcc8zsWJUrZTvreX6GX3ek0fRJ4Nuzaf+Qel++SIIXm8Aly1lDtvJCoNCakG3TQW6wgeliUwZ17XvDImr/hcM94SSNmMT5w/+ClqRnimhtLr+XedCU1bgcIFC9ffUgaNDlmTJaMm SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Aug 2018 10:32:10.9350 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 993dc838-ea78-44e6-8c60-08d60f2d0537 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 binding file for NXP FlexSPI driver. Signed-off-by: Yogesh Gaur --- .../devicetree/bindings/spi/spi-nxp-fspi.txt | 42 ++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 Documentation/devicetree/bindings/spi/spi-nxp-fspi.txt diff --git a/Documentation/devicetree/bindings/spi/spi-nxp-fspi.txt b/Documentation/devicetree/bindings/spi/spi-nxp-fspi.txt new file mode 100644 index 0000000..9f07116 --- /dev/null +++ b/Documentation/devicetree/bindings/spi/spi-nxp-fspi.txt @@ -0,0 +1,42 @@ +* NXP Flex Serial Peripheral Interface (FSPI) + +Required properties: + - compatible : Should be "nxp,lx2160a-fspi" + - reg : First contains the register location and length, + Second contains the memory mapping address and length + - reg-names : Should contain the resource reg names: + - fspi_base: iconfiguration register address space + - fspi_mmap: memory mapped address space + - interrupts : Should contain the interrupt for the device + +Optional properties: + - big-endian : See common-properties.txt. + +Required SPI slave node properties: + - reg : There are two buses (A and B) with two chip selects each. + This encodes to which bus and CS the flash is connected: + - <0>: Bus A, CS 0 + - <1>: Bus A, CS 1 + - <2>: Bus B, CS 0 + - <3>: Bus B, CS 1 + +Example showing the usage of two SPI NOR slave devices on bus A: + +fspi0: flexspi@20c0000 { + compatible = "nxp,lx2160a-fspi"; + reg = <0x0 0x20c0000 0x0 0x10000>, <0x0 0x20000000 0x0 0x10000000>; + reg-names = "fspi_base", "fspi_mmap"; + interrupts = <0 25 0x4>; /* Level high type */ + clocks = <&clockgen 4 3>, <&clockgen 4 3>; + clock-names = "fspi_en", "fspi"; + + flash0: mt35xu512aba@0 { + reg = <0>; + .... + }; + + flash1: mt35xu512aba@1 { + reg = <1>; + .... + }; +}; From patchwork Fri Aug 31 10:30:02 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: 10583551 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 06BB1175A for ; Fri, 31 Aug 2018 10:32:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D69DC2B61F for ; Fri, 31 Aug 2018 10:32:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CA8DC2B6AF; Fri, 31 Aug 2018 10:32:42 +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 636EE2B61F for ; Fri, 31 Aug 2018 10:32:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727630AbeHaOjb (ORCPT ); Fri, 31 Aug 2018 10:39:31 -0400 Received: from mail-eopbgr30049.outbound.protection.outlook.com ([40.107.3.49]:45696 "EHLO EUR03-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728370AbeHaOjb (ORCPT ); Fri, 31 Aug 2018 10:39:31 -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=i53RJaXwfe0j+/MkFWaIKnsOteyq20ut+x2xIp3laPg=; b=X8Y2zdHg2DYHoXfaUt7KW9AWpWHSeq2xzyr9xsM/KF3i6ybKPyfn6N3RyKVBC841BLildyFFJ27cVN7a3y+s1zWWqTL8o8qDkdqGuIvorO0OwY9a30cIR+aOd6EOaMS4IR9W2xQE4GS3BqhlCUo4DZG35eir9awyTDNPsOCyT5o= 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:32:16 +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 5/7] arm64: dts: lx2160a: add fspi node property Date: Fri, 31 Aug 2018 16:00:02 +0530 Message-Id: <1535711404-29528-6-git-send-email-yogeshnarayan.gaur@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1535711404-29528-1-git-send-email-yogeshnarayan.gaur@nxp.com> References: <1535711404-29528-1-git-send-email-yogeshnarayan.gaur@nxp.com> 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: a232d2fc-ae4a-46f2-1655-08d60f2d086e 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:MYvWDqV+9rRF73jonYfkPUGw/DQJ5ObcDbn5AHI8fVLWFLIqhPXKkMd6frPfPBKjYR5ru+ZSyUVQIgawh0h2q2tWRr1veEv47hSkjiojcyoPf/7KMo1nHggn/2pvrZWMhCrHRLQnxqhLogfr7bDvAouvS0BbBGueZFLDXmjgSFqX3iMIyXMjV1XOJycgiRUSW67p2jon4SePs0x/n0Nu0boxJC0cACfrkLRsEE4B6d//VinpgWC1uDOADWQ+Hgxl;25:QiMeY1LDUEKgwbhc47D8TG+tXodNAKTK0s94+PE90Dh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T2Mc45QvLnCxXsELBu7ptQzgbnzFgDJ2ct4epPEez8w4w+Chvp2e3TCfK0tIDP3;4:BxypalvYD0BDQRIoEfNF3xGhSz/1E5RqvaRNUcR14KrF6BqwRfj6L5oTAejluFwi14d1wRh6mOeOCfV3eLLB8kN+O95S8XVkIOXYCEK6F0NoOMEeWkjTK/kja4heamQZzLtbswyXMt8h0yFWYp9rQpjIFB3I3cpusrBiMO94dylIh/1FW9vcW/gVABvZjPHZCCzWyUhZAs1s3hK7DfOCcxFTmwCPcgWH/iEe8yL9H+WssWmPr1+dzcc32rdfHJyqACL1Psj3cLf01sd8DkWSRoj4WkWx24dGwujfoaset64iZ0DJITI3+a/LClIaeOMt X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); 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)(76176011)(2906002)(86362001)(3846002)(186003)(50466002)(16526019)(6116002)(305945005)(26005)(6486002)(66066001)(47776003)(25786009)(36756003)(5660300001)(97736004)(8676002)(53936002)(6512007)(50226002)(14444005)(316002)(6666003)(39060400002)(68736007)(486006)(4326008)(16586007)(11346002)(478600001)(446003)(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:1EW3TzIbo14W6Lp+xCe8xlc/gcoxCYqGb5xQqAHZcCahmslkg4tQt0wuCSwYJH2Qk554DwdolWaeyxykr2yEAc+937BlXb+fYEcrbmqXI1yVN0vknufwTeb9tdrztFTjkNqdhV9KFMr8nM0OjLSMrZh6Vhx2pFos499rQHs4LoZi9CPT0aeuJJNFNlHW95yb/LKgzxKA1R9znDC18Lmw6/quzN3/p4bcQwh4ueyjGtVRbKHHhuF6CG1wu/VvWPvvdtP5Q1dB0ECtr7MaxZYp6hDhaVXEZwE1wyG3DkTJpUNW0lTnYeKEF1wpfFDfVTf1GvGhYKW2FZzDxnfnev2/5Sz7TcCWPg5MpixKDu9El5ivPwtY7kdWlgf//2Z4jq6J9u5b9I/Z52ZPT2umtlUeTlpzCK4gelYqtovTSuE2xHPmbhyJtvmZRYqHKUIGZSTC0sNfxgmrbRb6P6Eku1TGIdTWhssv8+uipCrBrtR09ktpoLKjj1NGTD2AAhsCJvBHYUZY0k0e5g9XSmGe4jBj5yhtrJGksS9DIGwKYAQdUzLa3JGuKso7Rl8/UsV7PhJzD0y2DiFsT/tPGu+haTyejr602Fpr3HV2OXTx1PRNL+6i8nCUmf2qi0pJq8BRSUW9/BkPFjyhjF/obX3bD5joHdUiXYcW1P9G5b4qMMZwuOimnBBeKXcsmwdYSxISgtAzCojxth7VWz8GKeExcIPa7sTEd7DS8sFgq8TEAq2lJpiFB97QN/JXIzunrtBQ97sPGDuThev579j0VIdTqq+g69oA+CZwUlo+t/jkXiA5d92i3pLCwtAqMtbtBFYofsfX+dkgl6nRoVKRGJ6C/M5FCfcECD5lNzbc+U/gVGuxNu2iiY88X1yej2b/FHGiHqKzrV8QgObf5rXIlcZjzFP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fyTUYNcSRxDaO9Fqr0hc0H4Z29IDaFVC/Bs+7kZpQp5B5FALk0Yz1ZgmmyoeDKURGoEvuFsWL7bovkANZQcTWKkL8sFVRAtEg35jhxDSVz72aDytQo9Y5gUQd5FCwRqKgrYZrL+m2Cb5UPGOCB6op4JABXXPRTioGSxW6zIHDCno7dCOuxIYoTzrKiRJMrCPOHI2ULwg==;5:WYLV5HO0Not3jRa+tQpUT/tNQoh5CFqSCJofR8SxFx91Z90mNHWn0CZSj1gNCJJMeEO82RZDbUfnRrBX0xJyuGh/sbDj7gdax9+6bc/HrHVFz+oEr6bWcMCLjOan7PjzDIFlNxGHH+/MBIXtvzYFWUIgJo3kqADUmGBYRq+/aKU=;7:R26iZRlJljtbqoScZspRZfWO0YRkLyX8RWxvS5HK1qjJyMsGTrk+BZJ2JqhqEfc6Pmn65QhZrbvX73aeusHbc4Z8N9Weu01PuoyGMY001NX7J2lb1o2xs/DAeVRtRflVtv+X0DAdUhLZpXJoatPVWyFS/yt7WUBeqe4zj4AzgMndLguM7nP0AGWTkR3GiMwgAvt5qJxnky3fJxEnpyVc67xYkuFf9C1DGN5FtEH9TuM6xH4BNHObuMvmbRlDsGVn SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Aug 2018 10:32:16.3412 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a232d2fc-ae4a-46f2-1655-08d60f2d086e 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 fspi node property for LX2160A SoC for FlexSPI driver. Property added for the FlexSPI controller and for the connected slave device for the LX2160ARDB target. This is having two SPI-NOR flash device, mt35xu512aba, connected at CS0 and CS1. Signed-off-by: Yogesh Gaur --- arch/arm64/boot/dts/freescale/fsl-lx2160a-rdb.dts | 21 +++++++++++++++++++++ arch/arm64/boot/dts/freescale/fsl-lx2160a.dtsi | 12 ++++++++++++ 2 files changed, 33 insertions(+) diff --git a/arch/arm64/boot/dts/freescale/fsl-lx2160a-rdb.dts b/arch/arm64/boot/dts/freescale/fsl-lx2160a-rdb.dts index 70fad20..3646315 100644 --- a/arch/arm64/boot/dts/freescale/fsl-lx2160a-rdb.dts +++ b/arch/arm64/boot/dts/freescale/fsl-lx2160a-rdb.dts @@ -32,6 +32,27 @@ status = "okay"; }; +&fspi { + status = "okay"; + flash0: mt35xu512aba@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "m25p80"; + m25p,fast-read; + spi-max-frequency = <20000000>; + reg = <0>; + }; + + flash1: mt35xu512aba@1 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "m25p80"; + m25p,fast-read; + spi-max-frequency = <20000000>; + reg = <1>; + }; +}; + &i2c0 { status = "okay"; pca9547@77 { diff --git a/arch/arm64/boot/dts/freescale/fsl-lx2160a.dtsi b/arch/arm64/boot/dts/freescale/fsl-lx2160a.dtsi index e35e494..031eb26 100644 --- a/arch/arm64/boot/dts/freescale/fsl-lx2160a.dtsi +++ b/arch/arm64/boot/dts/freescale/fsl-lx2160a.dtsi @@ -568,5 +568,17 @@ timeout-sec = <30>; }; + fspi: flexspi@20c0000 { + status = "disabled"; + compatible = "nxp,lx2160a-fspi"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x0 0x20c0000 0x0 0x10000>, + <0x0 0x20000000 0x0 0x10000000>; + reg-names = "fspi_base", "fspi_mmap"; + interrupts = <0 25 0x4>; /* Level high type */ + clocks = <&clockgen 4 3>, <&clockgen 4 3>; + clock-names = "fspi_en", "fspi"; + }; }; }; From patchwork Fri Aug 31 10:30:03 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: 10583555 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 B28FA5A4 for ; Fri, 31 Aug 2018 10:33:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8F8BE28724 for ; Fri, 31 Aug 2018 10:33:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 826D928972; Fri, 31 Aug 2018 10:33:02 +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 6A92428724 for ; Fri, 31 Aug 2018 10:33:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728390AbeHaOje (ORCPT ); Fri, 31 Aug 2018 10:39:34 -0400 Received: from mail-eopbgr30049.outbound.protection.outlook.com ([40.107.3.49]:45696 "EHLO EUR03-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728370AbeHaOjd (ORCPT ); Fri, 31 Aug 2018 10:39:33 -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=G2W4VVB0B+4waA1W1wQAUGAO85Yiopo+YyUr/fo4768=; b=cn/h1biMrz/AKSojQeWMrMYk8BnHQYtGRTFcyARpAVasVCwrcdOon23cvJNJ3voDTNV68p3/rz//+LDzuiRfVcdCao3wz3gVVoDlnWl8LdAvtUabjhadPMYXtZQtkFVhsUUoXkvRGi3D2rdcQbCxz6GVU2IJ08zC9wN/1IDEOjg= 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:32:21 +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 6/7] arm64: defconfig: enable NXP FlexSPI driver Date: Fri, 31 Aug 2018 16:00:03 +0530 Message-Id: <1535711404-29528-7-git-send-email-yogeshnarayan.gaur@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1535711404-29528-1-git-send-email-yogeshnarayan.gaur@nxp.com> References: <1535711404-29528-1-git-send-email-yogeshnarayan.gaur@nxp.com> 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: f6b701a8-e549-4c11-522e-08d60f2d0b96 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:40iYj0gJRjS6MFvDDls6Z6Jfk0L6++csjJHuxJU57V2DQNNxrTP/MvzK5vorqMZqpQENlozasmCIN9U598KB5ijYbxEKKxK1MKGa3zQAPouwIIRg9435nhkSK1i7chDocQn9CLxkffcOgrnXmQQ5FDhjpLbmyA1PtYe/EADcA/MjcZZ6Se3BD8SOrn6+afF0aPMb9CV+j97TM5z2yvCpua1bevUw0m6V6MTdGMqQhQZXI/MRvblFVsjuup4b9lvJ;25:ga4jEMHmych/qSp4PIMBtDjlaY+L6o2dqKGupX+g5hl6EctEoT1r9BmkcaHGAV61e9f2636bJbj48oAGAiufHDhSS7dNChRo1vM9XT9ttpXWeYSK45ESf9egeP8I8h0oREx8CvAxf37X7L9kHp78YYcx7uibwOjX4RnCAzMeydQwPmlWiyaHilOWInTK8vYtXUtPTWzeF55G0JDNFhIfXpR5tNjwWbdwzlFDT/PHI05jd3k/BWw30nZt4RlWsK2SsfEDC94S93uUhQd7CI6I+V0izJ+vuuOIS5KA3qHlGDq6dGV59euimeNRq7GC4NTVB4j4lPngrL2GFCsEMiI4EJZx1u84Xu+fJHDgKGLBVsk=;31:LAaVU7k+PyEzFxenN1+EtohBq02DvzjKJ462opfVnhzleRfyedeFwIRJqOg8BqRSyJXgeEmawu7gsQMrACvHNyP74ni9+1UVV67I5nePPTEocJShhpqkjqWNfN0VpSBGv8V1m0/eS1fJPOGNgzW0z8JpbiyAKKAysmC+YoBYEkTDuj8Y2RQmiyG0nZoQFsqeextXN+XbddDa3O2iuVWaJFo13Kaxg7kUpt21M6aKVUs= X-MS-TrafficTypeDiagnostic: HE1PR04MB1034: X-Microsoft-Exchange-Diagnostics: 1;HE1PR04MB1034;20:abxR7GyV1d2lCgEzBonnK9TJFFRDNbggSQF+3rApSLbVvuKkkvyt+qpLzJY6xfLO7L5fx424QtnQpp6/bt+MaYTTrkFiXX3ePiwWqaEJyo4euSb+OwNQY91QV1dJ4SPtpc1fPsjVfwavCvp7DhTR1A0KN6LyycFSU4NzIWY/BljwV+djTQuxTqS63p/AmywJfqLNnmGnR3mjaMzzsVBayJhB32itNKn2QEbSOGp3AOxmeNAgcIaX70AcD86vK8xvNxMGSB0+qz5bWQlNH6TsuRUUjWFATtU2KeffcYSMTZZZKHcmW/Osu1VA8oxqrFiZnMdQ16b99EVy5F3h8dUYPt96xuZNOeCFLgamIhTFq6jDjvhsludVP+ey7V4anr9cXezZ1Cah/+5th93eG1NY6ILfqhpe9bRS2EvHkMjev4EYOPdTDP1q1mETL584NwzJ3jUm90MSebugxSEpM7vEsxXU2Px3qQLu90ZDYGUwics0ax72mv9AbiGKV5PUyr3w;4:Id/zv/Q04kdqcLTAv/YHHqNxHnSMTImOj4LFZb/DsGIE6Z9O1Iu+9UOeg77SPLODxY5r+e8kPgrbfLkdKYRSDAL7UNneZItFrtcGz1m3M21owUBIepkzKohX20iRjOsF7B7gbKD7+gPfDrhtL8cPm4BXjFRxSiTdTzVI7rT8y39E0BgSFt5zfK8Cv/sWDMJZHaMWqKgvJ4lYptPbHuzzNbOVWvKi1EheoH2WhpybOBCf82IZeYm6VDC5lz4FT5ooUWSUoTZTvWbdooTjca4zHRWwbcoAjHx+J8PnD6PT9MxFZzqyQaG02Kle1nqfcNUY X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); 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)(76176011)(2906002)(86362001)(3846002)(186003)(50466002)(16526019)(6116002)(305945005)(26005)(6486002)(66066001)(47776003)(25786009)(36756003)(5660300001)(97736004)(8676002)(53936002)(6512007)(50226002)(316002)(6666003)(39060400002)(68736007)(486006)(4326008)(16586007)(11346002)(478600001)(446003)(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:5hvhiwn9DdvaBNY0TrR7diEaTWFBRRGeGYGM7kG5/vRCRMHtSrMfjuSnbjXivf7rThiUllIm4/Vrz30ayvlce38X5yzj3nQQnAa7Yhu/8fVejwLerq7eoyn9oFTei5oHRpfLuM9TbsmhCrS4CoOQOOmzqHZJ7a4cGU7pbuY+7qrYp3ldn3JfcW0Zc1F3NbDy+Qh3QFtYMC9O+gQVX3FOwwmSX1QGCwlvOhDtRopGcJcA1jAJQKaWL/+AC31egdYkk2fP00w1rpB1U7vG4k8Zs6kqFzkc7MPLfXqBc478RmohkA3x1pD7ZWzZBPKhvLQcyXWD7RAJX53jIro4rQGQUxprxWVDbLYg5mWhH3niXDY5skN3he7u1w+LudjLfhM76sAtic8zm9ohmTJmWB6U7R6l0wcw97uJ36yzdu+sZXyveMzW8doJ8Q58EacncHW3YJle+icLybjILLlVez7d2WgWe0SnvxYNi8ygZP8E1XzGRiWfAS2b66BL6eVSrGCNNuYaMrnFg3fronyJYel3+YdcXRDV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ime: 31 Aug 2018 10:32:21.6381 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f6b701a8-e549-4c11-522e-08d60f2d0b96 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 Enable driver support of NXP FlexSPI controller. Signed-off-by: Yogesh Gaur --- arch/arm64/configs/defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig index 3cfa8ca..75ceddf 100644 --- a/arch/arm64/configs/defconfig +++ b/arch/arm64/configs/defconfig @@ -335,6 +335,7 @@ CONFIG_SPI_QUP=y CONFIG_SPI_ROCKCHIP=y CONFIG_SPI_S3C64XX=y CONFIG_SPI_SPIDEV=m +CONFIG_SPI_NXP_FLEXSPI=y CONFIG_SPMI=y CONFIG_PINCTRL_IPQ8074=y CONFIG_PINCTRL_SINGLE=y From patchwork Fri Aug 31 10:30:04 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: 10583553 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 EA1D9175A for ; Fri, 31 Aug 2018 10:32:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C11CE28619 for ; Fri, 31 Aug 2018 10:32:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B47E728646; Fri, 31 Aug 2018 10:32:53 +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 429F12808F for ; Fri, 31 Aug 2018 10:32:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728388AbeHaOjg (ORCPT ); Fri, 31 Aug 2018 10:39:36 -0400 Received: from mail-eopbgr30049.outbound.protection.outlook.com ([40.107.3.49]:45696 "EHLO EUR03-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728389AbeHaOjg (ORCPT ); Fri, 31 Aug 2018 10:39:36 -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=Q/PQ7mhCAp9mxFIccVuPuy8CNPGZfcjAkEMqPV8IW6c=; b=FcYs1N/TtJ7fyBISYnpdoLVBSFJj7gAOlQaDtDlPX98QdIj49FHb++0bCGV7jNzxk1k5KrbRu/1NxYeFYWcnvdqBZfSFjFPPvx3leVcA0Vria9QJLrRjTfEtCcjiAjunU+vZgaN9jJYXsJZwMqIG64DhNHcXG2MUk/dm8Kh9d5g= 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:32:26 +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 7/7] MAINTAINERS: add maintainers for the NXP FlexSPI driver Date: Fri, 31 Aug 2018 16:00:04 +0530 Message-Id: <1535711404-29528-8-git-send-email-yogeshnarayan.gaur@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1535711404-29528-1-git-send-email-yogeshnarayan.gaur@nxp.com> References: <1535711404-29528-1-git-send-email-yogeshnarayan.gaur@nxp.com> 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: 7dd9aa86-1b8c-41ea-25d1-08d60f2d0f38 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:tUJillqLz8TDLZ5BM9gLozurJuCN4EbQNIuBIpq7nmvr9UOuIQ/zwEllObkHJxbCqKv8r2uILYC8/UJk6zrAvpO058W1tP4tvff8HfyFqS0ag9uSIdqG5p+Nh6aLsQPbOScfCoe3CpEo+NUgIhMuxEgfqgmLvyklPd6dvfMkj6Ybw7CIbtKgqwSoy39EDYeAZC8qPsgM5ncvCa1J6foEDag9gik/79HY3aJo0ejXpnkjII7icavwZfEuZkbhrmHL;25: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86ED+6l4SiVNpAFmPZoO4aRC2icXLIHltG7f1JgNTSEndLRQMViFYDq/AyzUdEFlf9U73b4XcvVu6sf1W9oFqvU3X2VN+3iz/4stU4a0KR2DC+zZdZe4K73Wm;4:4MU6N/xaiEWUTKTqABREXMYUzWdRqyWkMdXAvDXC7Z82qBcK7gqVHWoygDMHrkJxXfxEK7anPiGSAy37bfFK8ac9f2v5xR9qxEfzV8lcyQ6DEY/pcDBUfVYFHWGQaJAkLGekmZObd9uTHyoWieejsdsbDmstYkb+7qr1D04Mag+sE8OCx2oUs355MC18R/47A9UY/ryisOOF6+WrzkVCb35+mAkNAhQmQbI0zvB6+B1vNu+9wjpnLMUsl6cfB9YC6rtcm20ShgDIvmvIYXZNSxwwaNpM9CkalRc8K2hDa3uVGwNN1rbKu9uF8dDmnaYHUV7rZzKtVCavIl8OrKUIgGSLmYBMMQiA9dtQYX3UhKCel6pNoIKPXL3FVUj73erz X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(9452136761055)(185117386973197)(162533806227266); 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)(76176011)(2906002)(86362001)(3846002)(186003)(50466002)(16526019)(6116002)(305945005)(26005)(6486002)(66066001)(47776003)(25786009)(36756003)(5660300001)(97736004)(8676002)(53936002)(6512007)(50226002)(316002)(6666003)(39060400002)(68736007)(486006)(4326008)(16586007)(11346002)(478600001)(446003)(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:FG4Dsvk9BWfWviwXuoED+GILNR3hX1Ngbx18nnnkEx9ElFCqgTq/vvhI/QkPuuzP3j4qfFEYoDnDJ6O/r1KfTdvYhwsIhqykvCbw+zwVIRbdddCi6+rz9UezznUlmZICr3GOM/nDk+YTd+uOvNH6MsaRv0Qn/5o2PbKy+syFa2WEmH2drU3Mve9HZRSTS1sb2hZDh9UPQkP8gKj7pT7R+eduDmpYrRK/3i8xjKDOQzlpE15c7/xEHnbEH+MsqJ/LW1Kj5NoTsbh3riso4OxSON8QIK0Vc9090jHVmTtNYOoDowvS7crX8aAN5esVdFj7/6F9JmS98VpdyxwPZeI+i2+NdXXdGqh/1jkuDtJzjUPRpiu9KpobLEzJkc2su8KtxtwXOjTCLAVsyjWxKhr5r3Nx9dO8+0QnlaeHSxfQYwBUIsEZLKWpxLmk1eAZI8Y5h5u6S/aOymjMIwmtRmNGMArHyPMaK+8KBss/CnTvw2+hFWj0jX5J5qgFgTh9QvxjfAGW/Ag3ptIn4leUaRPqyVZnHAmu2kpponv4zod7VC9OpfXWqvzVQ980mOwYe8/GtzX9iOz53jmHxQoXeJHpCifn+Tg2mF4XY4Gl4yd7sRkMDe5YFFhWYEAEeeSNeq+R9i27d8ZVGzajI1Wyk08+Oud9e9YufOH8kNUOMM/mAPzbiuzCEY5STzpPIgzWYp2ympAIA8iWL9zfO44GorJ3CsF+2/gqDc7l7tWhb3eRgoqy7XFTe33cJf9fj5cSLXkqKb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3aEUtLfi5uM00kb/FlCrY430kYLPa/nxykUvKxV5UaY+Xj7/uQd3Nn81Kf+8WH8e+AHZTm3iTdCJ5e95ZyeMcJzPiUJre1i2j7Yps+9bSwYyU8qP/iZrmOXasRKuFombWgE0nLzewlPomLD/Y0gVAkahTMdjODycxm4RiphVPVFW6CGUpmRG7QEiKudf575rO8ko7OwaDgc5lLJt6pf2VwUK7DC5zHQJReX88ehmqdIKqaJVc1hlm/2XOAapVGuDFB4NwzaVNPDj9gge5nj9dL1QS9/rUeCVf1Zz+nIacO3d97IB+o5tWf/xN+fhox8zAA==;5:0NMtzqPZodsTJOv1Vt8M7kQDJXtqfpnx6Eznmh6o1QZcfnRugWz5vfAiiORVQspbjODv92GdEdFu7c5pcnQ7QKLBs58uFLQCLi2UMPMJz+rezGzYlEC93SsiptNjZvJ/wNAJ+24KK9463QiQDhkublkaUjHBu0eTraL02Bnbr6M=;7:4QLjWyF7S7/GOzLL1I/gpaRCkrlEKS/iLuuchoSKhT4iQ1uodyvgJonVl6ehMq6F4U9QOHuXyuBXQtu8XoSEU75cSZ1HxyN/ZyZCRgnF+JFwC8PSzq3jrj1E2sbAGcowJZDSkR7LrXtzutg0sSd6j1d6VlEsjghKPY5ItOWkigR3la9I7CxESskaMVPFETv/6F0zB1Nq8ivyjJ3eAwWnKWo6LrJqfr+W/rchLC/Ioz8AxaWFxPC6Bottp3O/dK5Z SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Aug 2018 10:32:26.9505 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7dd9aa86-1b8c-41ea-25d1-08d60f2d0f38 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 maintainers for the NXP FlexSPI driver Signed-off-by: Yogesh Gaur --- MAINTAINERS | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 9d5eeff..2696898 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -10228,6 +10228,12 @@ L: linux-nfc@lists.01.org (moderated for non-subscribers) S: Supported F: drivers/nfc/nxp-nci +NXP FSPI DRIVER +M: Yogesh Gaur +L: linux-spi@vger.kernel.org +S: Maintained +F: drivers/spi/spi-nxp-fspi.c + OBJTOOL M: Josh Poimboeuf M: Peter Zijlstra