Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752713AbcDVGtX (ORCPT ); Fri, 22 Apr 2016 02:49:23 -0400 Received: from mail-bn1on0131.outbound.protection.outlook.com ([157.56.110.131]:3296 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752245AbcDVGtT (ORCPT ); Fri, 22 Apr 2016 02:49:19 -0400 Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=freescale.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=none action=none header.from=freescale.com; From: Yunhui Cui To: , , CC: , , , , Yunhui Cui Subject: [PATCH v2 3/9] mtd: spi-nor: fsl-quadspi: add fast-read mode support Date: Fri, 22 Apr 2016 14:39:46 +0800 Message-ID: <1461307192-866-3-git-send-email-B56489@freescale.com> X-Mailer: git-send-email 2.1.0.27.g96db324 In-Reply-To: <1461307192-866-1-git-send-email-B56489@freescale.com> References: <1461307192-866-1-git-send-email-B56489@freescale.com> X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:192.88.158.2;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10019020)(6009001)(2980300002)(1109001)(1110001)(339900001)(189002)(199003)(81166005)(189998001)(105606002)(48376002)(4001450100002)(50466002)(229853001)(2201001)(50226001)(76176999)(2950100001)(19580405001)(5003940100001)(50986999)(19580395003)(92566002)(106466001)(586003)(85426001)(2906002)(47776003)(87936001)(36756003)(5001770100001)(5008740100001)(6806005)(104016004)(86362001)(77096005)(4326007)(1220700001)(1096002)(11100500001)(7059030);DIR:OUT;SFP:1102;SCL:1;SRVR:SN2PR03MB080;H:az84smr01.freescale.net;FPR:;SPF:Fail;MLV:sfv;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;BY2FFO11FD021;1:wS0RoKpTHFSZ/MADaiifRoup4gL/64VuGOiO26Bwl5QtrO8l7oQvpQdxMlIC1CabGYBsjpj4RKPkNjS6l/RXylPttX8ba1si7QNrJquHE+z34VJJq9aP5TaImkHECK19H5YqDRHVz3HZaxiq27UB3/zBi9JVn269/bsUIJl9DbShzpocDc1VrlU26L1JNtneMw3KvcUeCaOUDrV5e3HkYPkM1paoniJQhFnSD3lJTuZyicLxHlYzqtkJ0CayZ2P8anRYfEnNaNa0uRl7wPAs0blvh85PSwqixVxRfiAsbmyw6AKGUtv0uKU5aQbSBgSI6h1aGIdvuo+otLk4ftrhP94/rTyk3Yesg/tFrKB8zGpwYVn2P7RBrSG3H3Tons1A5Jt7p6Wv2BdXYeEb+yp1gl1QQ6hQnk5HCFJXu0Ieq/Xo+geeDjx5vvMg6uLMUCc5EfylbjrYuh21QuYXSJl9Gk1K7rmvYR6NoArV6Id6cC/+jsWK1zbs4wBt+qMuWKToEmi5bkm+U/bAguQ/qJokwyJfGaCUs00SM/1TJzKhKaExQNYMx1yZnP/HJb8jQNz7MwMf9fSXnQjC7iE4/gpVDg== MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 822fae70-e75f-4254-7464-08d36a7a38eb X-Microsoft-Exchange-Diagnostics: 1;SN2PR03MB080;2:nX5GHMCJjYU+yXO+xG/9UmwGAX9pWFeHstkIift4GmRSdz9RV/M9vPrSRknGytnoCIVPq/SMbH2TkG1NCYbglu0pmREzUsbn51aHPMBiUf+zMzxZRxG44aDRupmO5n3MfnyNo1PmyiK5bMO9OzLHf/LinCYFmODlDdC533upxfcJQymKYUxk1s9qeijF+AYt;3:zlngLU+PJucxH0ix9/SbCXO8l+CqjtfibKVVGGm+Csgxo2Ym/GDxQenmp/r1a0tjfnD6N83B8Jg8dJFyDQNrl2q1NeZOXc4X8VHq4aEPUyRPcIWFSoqr+l65HsNorzulg85D7xit9JMnISbDXFB4Gv6IT9kTBKjD9Ki61DR89bBccYVl1MfKbq3LciiPEi8v6z4pkTAz7csbiK9id7dZ1iHwuXOVIbnh+oQyYl7eIQ8= X-Microsoft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ucCH1NsYreBiVhH2inCugadkSC9A0XnV9C1K5a77fJn+0ip9lF+pV34EQn8FDelm7a39fdcF5151P7IHvcyVoj6V4fPlJrV+5ylnj9HU6WZeOSgxgSOj/xlGKyuxSncwOA6FCUGfFjwM9JdfrPPBAB8cDsP9wYP9RToXRVdAV6/Bmk6ZhsyyY;4:mMQJggy/SqzH3GdQKpJo3m7RetVwVrjpghcHmP4L5mIeldPSikH4K/UkLNm/lFP45gT94WK4KJgzGpi3hF+gPGGSfCDXDdQP0Ql0zz1Xy2AqLry8pKhiT3NxVTaoDr89i8Y9vM0qL46vw/7PK0Deg2f8m4XATXUBy9XWjoq8HPptulM4JUT9o4HvlFPUHyd+BIvQ2M1V8p2xhrjJ3Y7mp1Z6VygoaQtO3w3Asa2LpQtdDudmMjMdKr4FgLTCSi2NIOgH09OFa6izICzV1XceQC+KszmANNoQO6StaQks9apELdMgdQhn+e2UuIfGtGJxzXhjawaWt01B1wVQ9jwihsHMWeLttL5jXuG4x1DRwpEB3VZMJNcxf9TpX86SLWtomoej/C1SFsqFPKWUsYGBpiXtipAzvSd0wNvoLVW4/YB1Thkxe5CLTiW4wR0K8398y63AjRCm98UNG8/icd3b8YWm8d5qZ91E3JyS0Yh5dPoZho2a5+6/W4R+PPL6QOsG X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(9101521026)(601004)(2401047)(13023025)(13018025)(13015025)(13017025)(13024025)(5005006)(8121501046)(10201501046)(3002001)(6055026);SRVR:SN2PR03MB080;BCL:0;PCL:0;RULEID:;SRVR:SN2PR03MB080; X-Forefront-PRVS: 0920602B08 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;SN2PR03MB080;23:suCWImWMLWY48gFT7V16rqBAg9qfbu8OenqBFQ5JIM?= =?us-ascii?Q?HDvmSVUpJObl4ymjhXWzYw0uuPIVqbL/MtjBnWYO/U0u5USzuICAY+dnT6ie?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fJeePY+kEV4hj5LHPfr6+i1QsXZhaNq?= =?us-ascii?Q?RGBQ+7aZSCCvIbESvJKJ+HUdxf3DbFT/1uPfhpG+ryRwoUR7IiI57bb6+/ib?= =?us-ascii?Q?DLdKPnynB6oHft2+qDajwRofaI?= X-Microsoft-Exchange-Diagnostics: 1;SN2PR03MB080;5:J3187ftErVPtXy+WAp6to9oMIjdVaEI046j3s0ZoC3ynhlOumoNwpkEeCJoTukEsgKSx2CZoUlky6Vc0mL1RhV4zKK0cc5LdpV6BXcpBwIJlX7gPuAsmuhKPvLrnz1ivCX0xohgG4tAMIYnTszHld0CHKpg4tgCaxKpyJ3D6TsuezHSsjr1rVRkM4XHkVM4C;24:rAFYNA/6SGhp7hCyj2SzUbqjUwdTfx6AuDLTOGg/MD4GYr1SruSEcUr1Ra2Bg9Q9x4QvoPcaK1a6uNAYdgQI1IGf+QmX0Udswq37OHz/KFc=;7:OVmm/QN86jr+xtutJIXuG6bkd9L4d1SnbbK8+637egjT7QA6ESZufh1eOe47ezYBVzbHmNblmOPdOQ2LbYkDqpIXr5fpYU0ADGJhUC+HgD3xxgF0cyRdgU9O0WzDyklHd4BvxiK55ElwFd5QZ1H7izmNIKL+VHUlhyri1PsGhCg73WcI3phKdkPBl8S6PkS8tOZMjrBh5vSXPzqaIgsh0Q== X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Apr 2016 06:49:16.1633 (UTC) X-MS-Exchange-CrossTenant-Id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=710a03f5-10f6-4d38-9ff4-a80b81da590d;Ip=[192.88.158.2];Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN2PR03MB080 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1773 Lines: 52 From: Yunhui Cui The qspi driver add generic fast-read mode for different flash venders. There are some different board flash work on different mode, such fast-read, quad-mode. Signed-off-by: Yunhui Cui --- drivers/mtd/spi-nor/fsl-quadspi.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/drivers/mtd/spi-nor/fsl-quadspi.c b/drivers/mtd/spi-nor/fsl-quadspi.c index 9861290..09adaa4 100644 --- a/drivers/mtd/spi-nor/fsl-quadspi.c +++ b/drivers/mtd/spi-nor/fsl-quadspi.c @@ -389,11 +389,21 @@ static void fsl_qspi_init_lut(struct fsl_qspi *q) /* Read */ lut_base = SEQID_READ * 4; - qspi_writel(q, LUT0(CMD, PAD1, read_op) | LUT1(ADDR, PAD1, addrlen), - base + QUADSPI_LUT(lut_base)); - qspi_writel(q, LUT0(DUMMY, PAD1, read_dm) | - LUT1(FSL_READ, PAD4, rxfifo), - base + QUADSPI_LUT(lut_base + 1)); + if (nor->flash_read == SPI_NOR_FAST) { + qspi_writel(q, LUT0(CMD, PAD1, read_op) | + LUT1(ADDR, PAD1, addrlen), + base + QUADSPI_LUT(lut_base)); + qspi_writel(q, LUT0(DUMMY, PAD1, read_dm) | + LUT1(FSL_READ, PAD1, rxfifo), + base + QUADSPI_LUT(lut_base + 1)); + } else if (nor->flash_read == SPI_NOR_QUAD) { + qspi_writel(q, LUT0(CMD, PAD1, read_op) | + LUT1(ADDR, PAD1, addrlen), + base + QUADSPI_LUT(lut_base)); + qspi_writel(q, LUT0(DUMMY, PAD1, read_dm) | + LUT1(FSL_READ, PAD4, rxfifo), + base + QUADSPI_LUT(lut_base + 1)); + } /* Write enable */ lut_base = SEQID_WREN * 4; @@ -468,6 +478,7 @@ static int fsl_qspi_get_seqid(struct fsl_qspi *q, u8 cmd) { switch (cmd) { case SPINOR_OP_READ_1_1_4: + case SPINOR_OP_READ_FAST: return SEQID_READ; case SPINOR_OP_WREN: return SEQID_WREN; -- 2.1.0.27.g96db324