Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755678AbcCCHDL (ORCPT ); Thu, 3 Mar 2016 02:03:11 -0500 Received: from mail-bl2on0136.outbound.protection.outlook.com ([65.55.169.136]:10240 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755352AbcCCHDJ (ORCPT ); Thu, 3 Mar 2016 02:03:09 -0500 X-Greylist: delayed 90116 seconds by postgrey-1.27 at vger.kernel.org; Thu, 03 Mar 2016 02:03:08 EST Authentication-Results: spf=fail (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 v3 3/4] mtd: spi-nor: fsl-quadspi: add fast-read mode support Date: Thu, 3 Mar 2016 14:54:03 +0800 Message-ID: <1456988044-37061-3-git-send-email-B56489@freescale.com> X-Mailer: git-send-email 2.1.0.27.g96db324 In-Reply-To: <1456988044-37061-1-git-send-email-B56489@freescale.com> References: <1456988044-37061-1-git-send-email-B56489@freescale.com> X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CPI:192.88.168.50;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10019020)(6009001)(2980300002)(1109001)(1110001)(339900001)(199003)(189002)(106466001)(92566002)(47776003)(4326007)(1220700001)(19580405001)(229853001)(1096002)(50466002)(5001770100001)(19580395003)(189998001)(2950100001)(586003)(5001960100004)(85426001)(2906002)(77096005)(6806005)(104016004)(5008740100001)(86362001)(48376002)(11100500001)(2201001)(50226001)(87936001)(36756003)(50986999)(76176999)(105606002)(4001450100002)(5003940100001)(7059030);DIR:OUT;SFP:1102;SCL:1;SRVR:BN1PR03MB069;H:tx30smr01.am.freescale.net;FPR:;SPF:Fail;MLV:sfv;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;BY2FFO11FD046;1:EJXBKvMm3+8E+cqDLgj2VrZzRfqkZJ29vY8e2uSURPgxMHZb7qolbX+mql4qoEuHDitHODC131CU72f7uEUa7rl/ldJM6CcbrFn8d2csf2qoYrgmm/2tc0vFRVKGwGmY0M08kZi6+fZOEqwhHYtuljR3Y4x9B23UWYqqbZLu1P0KQgdHFn8geMAU5Qjni2VdLvpQN3OTPbR4NAJuae+8lfHVs7oSRMKCQXXm20MRUpWqC6suZ54CX5lXoZfZws4cod4N4qfLnJC4wclSSN3pKb9TJiK7goY7nYgzfd4bLa9VnkgAOuFYhiPgx+8XhUILON2609u90Fi4NVV7hHdxrCvD6IWzkbgw9ffLvVsmtvQlQNybu/cHTqy+hsRem921EJn2xi0+QBBBMiJZxb6cy7Ogl26q6d5Sdv1U4lxl3+27d4fms1VNUWHsRYFNpg/DXlmjql6gRZx5Z2zCjPZys0b28RJ3Sfnd0OCwFMoDpZJMplq3VPyEVkUVGZ2HN3iv MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 0a9d8260-15b7-4518-567b-08d34331de50 X-Microsoft-Exchange-Diagnostics: 1;BN1PR03MB069;2:grP21/4qmo+CXWdE6t3CDAzUHWS5/mxsbkGSEpfAmHBAkr1yhee3itThZ/R/OzJM7/amkIzOY7DNJaAJuv+aGNQK/95K9Hp88+oL1mhx+2vzKTpfgkwMj/Q+b2JKRRmbk5+rD7q8K6xsHvUWV+ebTrJhfng3ViT0bUPksm6pFnDLlo/j9N66TbeEHKIeEuVt;3:zVHe05+48NAnFX6UawkxsnfyEkPe02FHuChJhmn6t2MvpsSSX9+s/2VX8hfocBnkVe2yChPVcjAa9QAQ35XmzTbQ7j90Dh/Ww3fngP802vUZcLDvPk3PNY0Ld4Wc80yMvssk7CQ0ah6gGevKv4WYa36M2TDZPRrYoL+RWncGk9S+aumcN1yDahsoEttDZRaY;25:jeSrPiZVmubF7ucHpjExrZBzb/nf34jxpp4+86GSj/kQEg91470Q3YjBONv8hleIJrJ+sayUSu86Ing1on5hIGjfb8CY7MZXIkpFj2Fu50qn98P3xjS8ORzjMS02J0UDr6KnONnx252alM25FF/x5Lyia2Da8klGIt1070D1LhbeZsM6qkKCjmWrtUMUrstSXEs4SKPbKL6CtRwGeTSjmfemzboI/s8bGGbZVPplx++6CVp+YVzLCheQ42XdG3ITlL01r07Ag1cU8QayznMRsuTbF+BrLYFKlyyAiAsFXDAH8JFvQrB/DVIyQK3hGnMzWZ4niSGTmOUXPvGkcy8png== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN1PR03MB069; X-Microsoft-Exchange-Diagnostics: 1;BN1PR03MB069;20:2vFHzhlMZqs5aBnyRMffm/YtDy7QcnTKmK8GfMZzGWNza7ZpcheBfuXoNZNKsWGyaUuWsasf3M6/9832wiS460XdCQFP1pqUveV7gXFOUaWBgZgNlCriBq7NdU0E00XCzxo9rkW994MlVtHak96itOnnqeTZKQSZ83NXEsyeYE/D91BguXEsnZMKd3B1plq3kaDNuS7zY92V6o8DkSA2npCIHVyrsZ+IYJHqiq2IDhsWPSCHhxUF/nvHCZWwX0h5l4IXygMpxp0NsASPafn6ANyGLKmMTaiwcGlVgz2rRVEPM/rStjPxBnKT651kZ7I7KOp78K5ZwVYLz7wt7817OQa53KU3V2DiRMXdLyeNeAqzJso4M1AK80+JIqR97DD2QfsHZh9ug13HJClsuLBacnXQ2V4l+61zqcs6lmX4aeQqqUX44j85z8FsAW1PjLHq;4:maLrASfTAyEtOy3SyuSuFzx6XWdPZeZnv3PDk+PaF2hobKgrl1c2UiKxy1qMV61ACNF0NdiklWaEoqoBpURfQHRVVogUdEqS1qw+BgH4Zdh9feBBSN2eKyzsGQWUtxYzUEHY7kZ+YalJGC2vWXC1g29ZWPKecNPac+TEiJIMvF4KIzvvGx6lR0BQCI+6qoEInXtK77Nz+GdeKJVS+VW33Bl13UcQfz1ZyNmRggnfMzaRnIXt9I6ZUOVhIlKNP97BaDTZqmWjJzeA37ZsGByAUSho5sSeLBpg03pePWXt0e1g72Fn+0KOKN9bigT93r6xFSAQcRG0wOgbKTh+txgkG4tQRT7BmARCgU8bGGEAMZj6nO1JAI3y2Eu064FbF5HkG7sK2+lJ/VRDlFGBfMvcAoJic9U0KP8sYUUOMGk214RLHFpNsZkML5FIGzA2yhF/mv64kq031hQXlOJL11hI1g== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401047)(5005006)(13018025)(13017025)(13015025)(13024025)(13023025)(8121501046)(3002001)(10201501046);SRVR:BN1PR03MB069;BCL:0;PCL:0;RULEID:;SRVR:BN1PR03MB069; X-Forefront-PRVS: 0870212862 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BN1PR03MB069;23:06dnZukZUe0yJY41YqkzKrWT2HnuDIupCkaeb5s5zZ?= =?us-ascii?Q?AoaIJ2txzxpOkRTIo1TGn366CyIPfUh5L/mROuzR3Q2YM/64guyzp/qQMKyu?= =?us-ascii?Q?46eiRg0XzsqLIjRZ38gzq7dkV2D842TmDrGh13KXgrmOSoXmGO3dxDv0RYVW?= =?us-ascii?Q?i+JjPYhMbiZzIMsAQOuKp0tZP2sRJAnPPG3nuDr99z4rll6bekjz2EaSwZk8?= =?us-ascii?Q?OQHooUND/SKeqkDn1y1cRDgbrkkT19gFis86UzfAT/tJXZbbnIPxkYRIwuDp?= =?us-ascii?Q?RnIOrSJQW1Pxrmhqwz41Gfela8ad8ktz5SJLoGCJaS8vPPJzzechgveOFdxr?= =?us-ascii?Q?3M2EArvqG/ra9bgSiHHtkem/+m8QnYaoZN0tUKFTHPW0rQ3/0AxwHy7B/2eN?= =?us-ascii?Q?j5KEEN+u/ySwZ8ojwrV2dTOJYqR3PGPRznjtL/fWaicXHZylqHbkrMeRPzsg?= =?us-ascii?Q?/oCkag7zI9t15cz7F8YuLwJ0+lb6nFfSlPwDC3TJe4cRuVir7EvijJGzlPHo?= =?us-ascii?Q?ZefzEMrHewJrHWgEu7ABKQhN/lZ4ymxPi+IULVpfoHqC7noOl0UmawWN/eU2?= =?us-ascii?Q?R3dhDUzx1RFsASSyNciuRgAdcvhUXGnRCTjRUNn0hfz1bdO6MIjPX8EFoQky?= =?us-ascii?Q?A2j6N3Sv+F1eo9nUTZBtbWWf4w2OIFdbwVedWfOseCnqheq8NKp5JKvasUHC?= =?us-ascii?Q?R6JImzBeN3oock6PWKh80vwt1tEcVCCBiP5X9dAf7Hkz1F+svtE4VCmZ34yA?= =?us-ascii?Q?U/F16oQT1JPWke2WLl8OVyDpIj23h0PtOX4EDJho2Zg0f/eCid8b45x0QGAT?= =?us-ascii?Q?QZvsIMWagpgxNkEjNxCqmkZsGN7Iqzq4qddrdwU1oFoVPDC4ESrR979dh6L4?= =?us-ascii?Q?UH1jFz3nL9LOh+2Zs+vg3Q+3I5scPNqo335wxT+lH6M73S5+hm93BP57qQRT?= =?us-ascii?Q?kJ57qnlNCt+RgMtbsk84qLy0ttmg0i6k++TchgZStuBbNU/0UfgnCX7gUYQE?= =?us-ascii?Q?Ov5hTxAwd/52uMTC3mKpE0mxNxhaqYLjvUNVKgLyO5+FpjMF5ciTv+N67DVi?= =?us-ascii?Q?FC1JWqQG9vjIffkf6Ick2gAAP6a3jlh2u6+4jw8y0I4d1WKA=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1;BN1PR03MB069;5:6yhUgFEPTo6yoF5v7ANrgWcOoJewZZ18fCdk28WAhNT8qxTruafQj6HollPtn4dXY0jMex38mQ8YQiekwhZJIctcb9qyo8iPbjCqiSrb6MhOq8Wln57Y8qRYtKjnHmOROkUAV9Zz/sOnSbME1cbXag==;24:6vQJSRW2km+iEPqj592wyX7/ZxCb1P2wiajuKDOfCzjVHtC6y/vL1UOst/AL5uGN4WLkZR6iWNs8eW+gG3pMYALtbhSQfJsjUGl+Gy1EKqY= X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Mar 2016 07:03:04.9609 (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: BN1PR03MB069 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