From patchwork Thu Aug 18 07:37:58 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yunhui Cui X-Patchwork-Id: 9286969 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 02B7660574 for ; Thu, 18 Aug 2016 07:53:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E9C3028FFF for ; Thu, 18 Aug 2016 07:53:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DE67A29002; Thu, 18 Aug 2016 07:53:09 +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=-4.1 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 085DD28FFF for ; Thu, 18 Aug 2016 07:53:09 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1baI6t-00064m-Eb; Thu, 18 Aug 2016 07:51:31 +0000 Received: from mail-bn3nam01on0090.outbound.protection.outlook.com ([104.47.33.90] helo=NAM01-BN3-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1baI5W-0003yl-Fz; Thu, 18 Aug 2016 07:50:09 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freescale.onmicrosoft.com; s=selector1-freescale-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=PCyi0Sxs7MrC21I5BFw0ApVt9cb4mD7NVBnZ9oqzoYk=; b=K2Q90GJHMsWbUn5zu5XpJOYuFLNEaoU9XIj0EjUoP0rUI6lcUDnlApA1v3ECV2ibezMfbxbSVJPdwciLNl/ssFHSGwM9j0Z5XzX7WrR2gviPjp9MFHyrj9yh/7Pj0ie1crh5lCc+iTtUQFNJzbWCoiTuN4YPEhAh8Apl+o1+e5s= Received: from BY2PR03CA062.namprd03.prod.outlook.com (10.141.249.35) by BY2PR0301MB1973.namprd03.prod.outlook.com (10.163.196.19) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.587.9; Thu, 18 Aug 2016 07:49:42 +0000 Received: from BL2FFO11FD014.protection.gbl (2a01:111:f400:7c09::121) by BY2PR03CA062.outlook.office365.com (2a01:111:e400:2c5d::35) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.587.9 via Frontend Transport; Thu, 18 Aug 2016 07:49:42 +0000 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;nxp.com; dkim=none (message not signed) header.d=none; Received-SPF: Neutral (protection.outlook.com: 192.88.168.50 is neither permitted nor denied by domain of freescale.com) Received: from tx30smr01.am.freescale.net (192.88.168.50) by BL2FFO11FD014.mail.protection.outlook.com (10.173.160.222) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.567.7 via Frontend Transport; Thu, 18 Aug 2016 07:49:43 +0000 Received: from titan.ap.freescale.net ([10.192.208.233]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id u7I7nW4Y012341; Thu, 18 Aug 2016 00:49:39 -0700 From: Yunhui Cui To: , , , Subject: [PATCH v3 3/9] mtd: spi-nor: fsl-quadspi: add fast-read mode support Date: Thu, 18 Aug 2016 15:37:58 +0800 Message-ID: <1471505884-33996-3-git-send-email-B56489@freescale.com> X-Mailer: git-send-email 2.1.0.27.g96db324 In-Reply-To: <1471505884-33996-1-git-send-email-B56489@freescale.com> References: <1471505884-33996-1-git-send-email-B56489@freescale.com> X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(7916002)(2980300002)(189002)(199003)(105606002)(47776003)(5003940100001)(229853001)(81156014)(81166006)(575784001)(50986999)(8676002)(106466001)(19580405001)(2201001)(76176999)(97736004)(87936001)(5001770100001)(2950100001)(50466002)(77096005)(48376002)(19580395003)(92566002)(8936002)(4326007)(586003)(189998001)(2906002)(68736007)(50226002)(356003)(7846002)(626004)(8666005)(305945005)(36756003)(11100500001)(104016004)(7059030); DIR:OUT; SFP:1102; SCL:1; SRVR:BY2PR0301MB1973; H:tx30smr01.am.freescale.net; FPR:; SPF:Neutral; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD014; 1:q1LTiG4RBXd3x2Jb/VbFFAZ+X0KFDBPe8JfB9GtTCB0REG0TrXMxI1BswPC+lB6sYRbN7RKred2ACB3A6U5fcZ0JWyjGYgVhZw2gycRfL98Q6sGCxgSm6lKOj/6IbT7T4yHTgowza9AqRb5SAa/bqh1If/XK/5u5/lZ9EebORglzO7cXj54ZdgEbFgzkOjJbqci14dUfVE5AVj0OnxnbdIeMT0kUrIk4ZmdrZUf5AQkwQSpMiQsTOWIKuwsWb/yNa0SzvIJv4dfSt/cCWrCSYUnsPpf5icDR2iPQjj6agEWVZi6/YdIHOx3GWNC91dkFXwZBnkD4QQYRlmVqyErxzV9GuJWifmFP/ehg3P3SjZxntbbZyxQplqNSzRmco9yqt+Htw4qmfu3gpXrXIqYpSPSQXNlJD1rK/y2kQve29uYD9FcTBe9xEA+h6ejkSAOepqEp01V5fklk+57miv9V03VGHd2mEAnIG+l+Gs/T02aUWv3hMunyxFqkWfDNTqXk3SCXtNr2Tp9raVHX3lfvUO6VWlaAxQgptYAioTxze8WGOnf55lfecWV/jSLUxwTb MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 889f7f8f-19ae-4147-bb98-08d3c73c378d X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB1973; 2:skgzcWhq53vMLZ8LIVx2WkNbpAa3atgG3dkKD3WovigjKdVyuf/DwJzOLnvzBAWTGOc4MBz1r17+ra8thI3w6eMiS61EOhvFBF+A31PEWtLJpcYCAiT32Ps7lxJUfZ9Ciz8v8G4YI109C1gVhlcf0lPKVJ8BGYHVcmywJlZDp5Iw8YUShka9yxm+L+f5OKJm; 3:+kNXLsn8KyiIhSyctX628U79lj6DElZZ9iIBdI+cOoUvR0LOWSWKuqTgNhK4SNOCPF0l5vi0UAPsgukS9fEoqdzSp7imyqCnbIalez/S5C49ZBw5+OVBWoZ+3DhWd2o1liOgVEyyXbQ9GnQgTFGyWSRt6+Ir34OR9msRiJuqqHxsGZXQcp0YAAlNv8b9X+LCZ5+Vn3jcKjBTl/U+4Ir5+VlsAeUSb+HWZSxDR1gs8sg=; 25:OsMaaSWrmbq90qnw1VTOFNe7qZHuo1wizFN32//bckhToq5pl/STzDKXNfTMVXII7HMcLMfJAX0Y4h76GsVCd+lcmchPfeXYAVBIQm/QnPUFoVYQt67FmlcxUqsMuj//Eiwy9DQykjKjDjzMgCIAKWv0R4TCipOWb/wKpDHWK/CP9b7AgfMpog4OahusB3x0+fJj4ZEBeCiNWokUMhB2vdLBGsHBh0lzfbBii/5mbKTRenlwBrCoBluebt7fLrEqXvzErjXL0srgZveKej/dfprmLDia2OFZ8EdxxWjXvAhAzvyh9OZ1HzaARWP33cGs4fYB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XT7+tocMts5qWNKTu/PO5PwfBrkTBABxhL81A= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(8121501046)(5005006)(13018025)(13015025)(13023025)(13017025)(13024025)(3002001)(10201501046)(6055026); SRVR:BY2PR0301MB1973; BCL:0; PCL:0; RULEID:; SRVR:BY2PR0301MB1973; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB1973; 4:afFx6sHwbaIMukBmSqeh8SbypXOJZZy8pbyLpTl7ndXrnQTE5qeFkmv+E3CjtK36xPIvCsYR2G52bHbtccl372S6ujQt130p2LPJhGZcxxTLuabzHO2/9dzl1XEdhmzmgiGTNRgILQrhwPJ8TKVGguTVLyKLYgMi+cGay7Pi3EYWoECrUk5Nz6tnukJFd9jSdxCuzzBZWvHCDYE+sggyiU6KYw2sqn9kBJ8x7QAGTOE6HoD0kLXnZwhuiwOUcmSwxDtpypYV7h15nGFIfQBJ7sf11jpsQW9ri/5DmPswzoBdxqA8xSz/cjjKsxl63ODEWYxRy8zeLTmGAPJDGJOsQxziaxxsof1VRTKODtd6vnWl7hjjxpmvzu63YSgZD2r5m4mHibLtErHFqvtqARoF2PUzhO6atgZpQKOOnryfvyH/m9WUJSU3g4Nl7JEfdgFlH9f4zspgaZzqYscdSRkBZ523tm89ijSC+8PJbM5EeWXgOR/AqizQU7b1B1miYW3Pu9YYPYRxEOWp0o2kmxBF1JW++aWdmAFe5De60hG2yWs= X-Forefront-PRVS: 0038DE95A2 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR0301MB1973; 23:juCZhkAT0Cm82aLatWyIKCUQ3tXpOPXZEpJkjUa?= =?us-ascii?Q?eFEmM87b3dpOf3xAze759amS1l496cvuUr+tShk1ypjsAx79IQU0eNNZihR2?= =?us-ascii?Q?JmigpekH086wWnwPK+0MG/bBEnLeUGMaEL6VndHZMXQatn9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?I5oqVilSGiuInJ2pUOjxWNC39Qal7G7W/zW34yNYcYas68/avGvPI+rrCQKD?= =?us-ascii?Q?SJT4kTTU=3D?= X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB1973; 6:3ZUzK1/jRgnkEURWcP7wLqhxoXknKNupQ2vIqYPpVECocVZ0L2PzlWx/+OurjEoDaiBXI21Yo/K5ge3ObhLWxqyRh91C5bg5gK4qUjStkqIQRqcL4g0z57GFNV2g9mYBZ6VHWD8t7O+A/TPK87S227dptfFGg2CK8uGMu9txy8ZibdIG3aWRvbKIAFdo3RTL0sn2e5BR1eYTgj0g/u+iudd+S+DGsjr8f/jcNJq43gUCuF0IfFa5amfhfaDvxAVZOT7BXNasKYoiRxUTJedasOoPZd1csKbHKd7FVfjGGobH4zp3toNkVOYanBdGy9OfkyzJhQYKRyi1qtmizwkeeg==; 5:L/5bKNIdXZKiwHjUCRksdBafX2o1c/fMTpAlD0tmaGo0wYQXqngNpIDEPaNsp9BFbx0pZq1uGu3Yx8lLWqLVunqaJYIJauig7P1V3PG+sSOpdSrI7kVZZMAZxvRUPnLbtMc4vu6CqaLvhd0z7/ncRA==; 24:CZuaW1uwQcQEouOm+wLzsetGgzTFN2Tk1m1UNM8lqamXI5ZkIrmSjdc8P3mwt0ywKWiUjda35fJytz+p7cVRES0QTe3lMbltwn9lF9CSCCQ=; 7:rP4E5kQ9AcAjAcT83bZ/5J+RJdtK5OWw5lwzY5DwglcHry+t+TwBsm6z69JZ4BaRMK2BNGmozHBwwLr4ynmbnh4RBNvPGEGdWCtD9B2xlmOGAGA2+CRLPC5wmjpCHJ6i9sckq3UAWjE5HP8tNo3s4xBgYidp+CL7kXPSLaWucqFKgKW8sd8QTEvC4404l6TAvmm3FGwE5Ta/vkaMuOskGyzhZS+nWlAy7n1cQmT4Y2SGLmhpElEKR5jUZYyPMV4I SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Aug 2016 07:49:43.1500 (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: BY2PR0301MB1973 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160818_005006_947228_D3E5CCBC X-CRM114-Status: GOOD ( 12.56 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Yunhui Cui , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, yao.yuan@nxp.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Acked-by: Han xu --- 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 21c77e8..b0a74b8 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;