From patchwork Fri Apr 26 08:05:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Gong X-Patchwork-Id: 10918843 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 5796192A for ; Fri, 26 Apr 2019 08:07:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4468128AE0 for ; Fri, 26 Apr 2019 08:07:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3599228AB0; Fri, 26 Apr 2019 08:07:57 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D367F28AB0 for ; Fri, 26 Apr 2019 08:07:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=c9q7CEXXBmMC+wNdiLT+xtAG5Y/Rx9YDcdxBSFD2FFQ=; b=E8+i1/jnIij9H1 6296K/hdHCmVshUAGD0WFJXUuAVCni/6wxwZ8bQZnVjdhZPCbuOCFwP2ET0AzBtFnqAjPp3a1NVN1 PfAogFwwiA3E80ZHttOA/KCfwv6pIpOovVZZWs1w5gNEjO7L12H3Dym2NaxFS7jTVhZptBcwOfvSA 9y38bV7urEtiMbkFATD1JRKZK17+5otgJtpR+VKIy6HMcRJvX+FZe0c38CiNFlLbjnMTgqSSvUB80 3qyaZecjJax8qlIAor8Lmogfvm3wDW7pplb8ij8uiqD9L6Qy10W940VQy3RwUoZ9LxfURl4tUOdcT 2ypu1Mv/HRsxk0I/DSfg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hJvte-0000fb-VL; Fri, 26 Apr 2019 08:07:50 +0000 Received: from mail-eopbgr20062.outbound.protection.outlook.com ([40.107.2.62] helo=EUR02-VE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hJvrc-0006ss-AN for linux-arm-kernel@lists.infradead.org; Fri, 26 Apr 2019 08:05:46 +0000 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=SDxScm3988Q5Xz4COHRAzEVgZOh7qs8DggdvCKAjv2w=; b=iYcnVm1+kdZq5dOct6EaNNFwBbGd2JBhp01rCYnIx1paT5Y9bvO3v46TyfwkrJipyqneeLTVgHok6xcmH/9d6pKoDJCwzDN9+1n/GVOqQ+ahjQ7WEFttlu2pU3I9w0VrfxYrIz9Kz4EsRc/kJC7QCp4ND/q59ns2VNr11k97O6E= Received: from VI1PR04MB4543.eurprd04.prod.outlook.com (20.177.55.90) by VI1PR04MB4830.eurprd04.prod.outlook.com (20.177.49.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1835.13; Fri, 26 Apr 2019 08:05:40 +0000 Received: from VI1PR04MB4543.eurprd04.prod.outlook.com ([fe80::5d07:911b:18e1:1525]) by VI1PR04MB4543.eurprd04.prod.outlook.com ([fe80::5d07:911b:18e1:1525%4]) with mapi id 15.20.1835.010; Fri, 26 Apr 2019 08:05:40 +0000 From: Robin Gong To: "broonie@kernel.org" , "shawnguo@kernel.org" , "s.hauer@pengutronix.de" , "festevam@gmail.com" , "robh+dt@kernel.org" , "mark.rutland@arm.com" , "u.kleine-koenig@pengutronix.de" , "plyatov@gmail.com" , "dan.j.williams@intel.com" , "catalin.marinas@arm.com" , "will.deacon@arm.com" Subject: [PATCH v2 06/15] spi: imx: fix ERR009165 Thread-Topic: [PATCH v2 06/15] spi: imx: fix ERR009165 Thread-Index: AQHU/AbWhmFw/8q/U0K0862nrKFDRQ== Date: Fri, 26 Apr 2019 08:05:40 +0000 Message-ID: <1556265512-9130-7-git-send-email-yibin.gong@nxp.com> References: <1556265512-9130-1-git-send-email-yibin.gong@nxp.com> In-Reply-To: <1556265512-9130-1-git-send-email-yibin.gong@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.7.4 x-clientproxiedby: HK0PR01CA0024.apcprd01.prod.exchangelabs.com (2603:1096:203:92::36) To VI1PR04MB4543.eurprd04.prod.outlook.com (2603:10a6:803:6d::26) authentication-results: spf=none (sender IP is ) smtp.mailfrom=yibin.gong@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [119.31.174.66] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: a89fbb38-8aa2-4e67-5c45-08d6ca1df8e4 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(4618075)(2017052603328)(7193020); SRVR:VI1PR04MB4830; x-ms-traffictypediagnostic: VI1PR04MB4830: x-ms-exchange-purlcount: 1 x-microsoft-antispam-prvs: x-forefront-prvs: 001968DD50 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(136003)(346002)(366004)(396003)(376002)(189003)(199004)(36756003)(54906003)(81156014)(50226002)(8676002)(81166006)(8936002)(386003)(26005)(97736004)(2501003)(6506007)(4326008)(316002)(86362001)(3846002)(110136005)(6116002)(14444005)(11346002)(966005)(6436002)(446003)(256004)(66066001)(2906002)(99286004)(52116002)(476003)(5660300002)(186003)(71190400001)(2616005)(25786009)(14454004)(7416002)(53936002)(71200400001)(486006)(305945005)(64756008)(66556008)(6512007)(73956011)(6306002)(66446008)(478600001)(66476007)(2201001)(102836004)(68736007)(66946007)(76176011)(6486002)(7736002)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR04MB4830; H:VI1PR04MB4543.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: BteiJtzn7m3ZdSaHpuHFQAq4UDw6BksYH7ytUzDrzTadJ1ZNSCzc+RwR6d8OPlgzU7Pd8JAiYbvTDnfEORCfgJLghXxpD4D2d70GNEsmP+VzgeRx7tETPYzB70cRCsQ5kqCt7nPH8rs5Nl7mWdNnRLj9nhRAVESxkZGmcWcYsO75aYJ2r+3Vd1WvlCBSW5IsD7l6PMgWA3lwiMDrnY1wufd1zO+EaqGnS1OVaIkAepqm+q2kEixUGs2hB75IR5gMSubc2oH6JudFST1yd6Wont8aOBGqAYbaE95NswMBPTvbveY67h/bPqRycOn9AhSKPXl+St6mI/iRUrfCnPCjhjx2uU6N8/iXgF/7mG0He4NQ7C3HmgGEo4DY/HaqfjZlUENHGTP6fQbX9h2bXTazQQTM0h0TpIs+nhlaF2BSEbw= MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: a89fbb38-8aa2-4e67-5c45-08d6ca1df8e4 X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Apr 2019 08:05:40.1924 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB4830 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190426_010544_420442_6CEBBB5B X-CRM114-Status: GOOD ( 15.06 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-spi@vger.kernel.org" , dl-linux-imx , "kernel@pengutronix.de" , "dmaengine@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" 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 Change to XCH mode even in dma mode, please refer to the below errata: https://www.nxp.com/docs/en/errata/IMX6DQCE.pdf Signed-off-by: Robin Gong --- drivers/spi/spi-imx.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c index 09c9a1e..eb56eac 100644 --- a/drivers/spi/spi-imx.c +++ b/drivers/spi/spi-imx.c @@ -585,8 +585,9 @@ static int mx51_ecspi_prepare_transfer(struct spi_imx_data *spi_imx, ctrl |= mx51_ecspi_clkdiv(spi_imx, t->speed_hz, &clk); spi_imx->spi_bus_clk = clk; + /* ERR009165: work in XHC mode as PIO */ if (spi_imx->usedma) - ctrl |= MX51_ECSPI_CTRL_SMC; + ctrl &= ~MX51_ECSPI_CTRL_SMC; writel(ctrl, spi_imx->base + MX51_ECSPI_CTRL); @@ -612,12 +613,14 @@ static int mx51_ecspi_prepare_transfer(struct spi_imx_data *spi_imx, static void mx51_setup_wml(struct spi_imx_data *spi_imx) { + u32 tx_wml = 0; + /* * Configure the DMA register: setup the watermark * and enable DMA request. */ writel(MX51_ECSPI_DMA_RX_WML(spi_imx->wml - 1) | - MX51_ECSPI_DMA_TX_WML(spi_imx->wml) | + MX51_ECSPI_DMA_TX_WML(tx_wml) | MX51_ECSPI_DMA_RXT_WML(spi_imx->wml) | MX51_ECSPI_DMA_TEDEN | MX51_ECSPI_DMA_RXDEN | MX51_ECSPI_DMA_RXTDEN, spi_imx->base + MX51_ECSPI_DMA); @@ -1265,10 +1268,6 @@ static int spi_imx_sdma_init(struct device *dev, struct spi_imx_data *spi_imx, { int ret; - /* use pio mode for i.mx6dl chip TKT238285 */ - if (of_machine_is_compatible("fsl,imx6dl")) - return 0; - spi_imx->wml = spi_imx->devtype_data->fifo_size / 2; /* Prepare for TX DMA: */