Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752797AbcDNEQW (ORCPT ); Thu, 14 Apr 2016 00:16:22 -0400 Received: from mail-bn1bn0108.outbound.protection.outlook.com ([157.56.110.108]:58848 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752030AbcDNEQS (ORCPT ); Thu, 14 Apr 2016 00:16:18 -0400 X-Greylist: delayed 955 seconds by postgrey-1.27 at vger.kernel.org; Thu, 14 Apr 2016 00:16:18 EDT Authentication-Results: spf=neutral (sender IP is 192.88.168.50) 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 3/9] mtd: spi-nor: fsl-quadspi: add fast-read mode support Date: Thu, 14 Apr 2016 11:50:49 +0800 Message-ID: <1460605855-6689-4-git-send-email-B56489@freescale.com> X-Mailer: git-send-email 2.1.0.27.g96db324 In-Reply-To: <1460605855-6689-1-git-send-email-B56489@freescale.com> References: <1460605855-6689-1-git-send-email-B56489@freescale.com> X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:192.88.168.50;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10019020)(6009001)(2980300002)(189002)(199003)(92566002)(48376002)(5008740100001)(36756003)(104016004)(6806005)(76176999)(229853001)(106466001)(50466002)(11100500001)(105586002)(2201001)(189998001)(2906002)(50986999)(1220700001)(1096002)(586003)(19580405001)(19580395003)(4001450100002)(50226001)(5001770100001)(47776003)(87936001)(81166005)(4326007)(5003940100001)(2950100001)(77096005)(86362001)(7059030);DIR:OUT;SFP:1102;SCL:1;SRVR:BN1PR03MB071;H:tx30smr01.am.freescale.net;FPR:;SPF:Neutral;MLV:sfv;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;BL2FFO11FD021;1:4zoLLB53hyZmWP5hrPYYjS2/YWHuoHBQisKiTsIzHfMwG6H/Bz/pADO/73PwRrYBhesbt/CPOYwIRww8uqTleD2XoidClBp9nVJt6/JrhCCUvB+Ctaa3V/SccQ2gHrnOguy8HskS2GeCcGGN0q8GFYbzmlDIOZZ0QupZdumaAo9RmPiOEY7wgvN/hsHqSGozdTw6F8nf57SNRE32JenXE52VNFFCkOK6pAg7MOqjAPXOAC0IfW9eeUONVYRGJulpV5kyQtm4e4Ie0kX9I5TGvWZhQtFqkYAS179xu+qLgUgtvP2BIcE11Np9qsr1bg2XvG1f89JzOrFVwtgKfN4hY/iTOnPwzs/omB7R2WYH+o2LdMaoEydo3zDLnwxBKdKTULzy4Cpoq8EHa1iX5tQyZK45FPiJaiYSS6k6kSWRdT2awkPepP4JJJ8AjcnYI8juqYOdnt6GyW3dqwQcwQr0Yo/T07CrsYUtodnTWTtyIFizm7hfv1TfA2YuyM0mVDnQ5wbA2DqrN7cMTjrJCQe6HvX6jUELsuCqi3ff4i804l+HkplFFFr+UTDyX0+Gm0VRP7DmrkfaB6lv42/ktw8b1w== MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 758a4a67-1bba-45cc-5c1b-08d364194bbe X-Microsoft-Exchange-Diagnostics: 1;BN1PR03MB071;2:l8cPYDEJlkKsvJ70JfHcGe9LP13WlR1zotXzm+HcOFHrxbJupdgo/hoElsF9ALP82KMYn62yg8SeiaWdF0l8zjWmEFpa0n3GcxZ86xVtpNNPAdCENHxOv5stH3bymJ1FL6xI4kj9UhRO6uq/Rk5zA+1rbEJl51J6ajTj3ayDg3ACUJJE0THwA1aWxETcY43B;3:gR+F+Y/YWZEslgytwHejTVuH473wNzdd6eGK4LiYiCbh0bWaK3otJ+ezSVZfDkDCZBcIu2GMxYGoslLz9SFcJ2OWN4TI5sbR5Qg2LPJ2zIoH6eqiE+26rhdBZTg/RvEWJY6aiTTsV7vf4PiRZ/Ef86dQTDDyZ5JMEe770A66TzrrOe0pEU/rOK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aFpHSmMhKTyIhUItZK5AWe0wVC7GHXV+SoR65CBUDqv9ziBrjFVGigIr7amd1CXEzfTLe6fbl4PKOWhTIK73aJ934Ob7hXCsY9yxXPIgxVl0KXCib659sktJp/oD5SQ4C8Ep6w9LG5JSJCvgP84r++oPt+JEFKWBoaFSjwAOf9Dj4LnOKHyOaxzjnsdqhFcfiEAdfS6G70VNwk32ekK5EBjxMi4KnBbczPqjOClnutL73SPE25TMNO8XuofntgOYPKWAbt3o19YHa0ylAzoEmJkFXdKmyeN+5BufXxuCTViPAsNCo7IlSrLXiveqzIV+ExJkS+bA2CIjU1HfggNCHxTOcIuw= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401047)(13023025)(8121501046)(13024025)(5005006)(13018025)(13017025)(13015025)(10201501046)(3002001)(6055026);SRVR:BN1PR03MB071;BCL:0;PCL:0;RULEID:;SRVR:BN1PR03MB071; X-Forefront-PRVS: 0912297777 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BN1PR03MB071;23:dmaz4t8quEN2xHZMSGM8o3zOP3BLku7XxR8JGqYf5M?= =?us-ascii?Q?I9OqChoCFbtKeMra3hJz96OmpzJjA/DEleYVnicF7U4gNGnRVilBXuT1dDh9?= =?us-ascii?Q?smHFwkTrBGVxeyGG5l57golFJA3KmdUExTXcngV5CWXkWKlg68qUC1LROJjt?= =?us-ascii?Q?zMFcsGXLOGqTS2FIW3jry+n2pjMmItRyrLM1t6Z3v4nfGG7tkWzjvwKi/Twi?= =?us-ascii?Q?NyeFFmy2/AeVuffkAj7rCLoDYV/96PnHw29JcDLRSU3Jb7buR8Q+E5K4O3t7?= =?us-ascii?Q?41H2xcDmwSq5/GH2wuTNFqKpso6LYjIFRt1RhAUsgNfQmWIGhnOWG2omRrka?= =?us-ascii?Q?gxW8OrNIIKdFMBZd7AKoh2Zq6xwGvLmuT/FtAo68uIBHFX68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3b5yQWCiTfI= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Apr 2016 04:00:19.5382 (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.168.50];Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN1PR03MB071 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