From patchwork Sat Jun 6 23:21:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Gong X-Patchwork-Id: 214457 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DATE_IN_FUTURE_06_12, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B143AC433E1 for ; Sat, 6 Jun 2020 15:21:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 87C6C207BC for ; Sat, 6 Jun 2020 15:21:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="CC0v6BP0" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728824AbgFFPVZ (ORCPT ); Sat, 6 Jun 2020 11:21:25 -0400 Received: from mail-eopbgr70048.outbound.protection.outlook.com ([40.107.7.48]:33664 "EHLO EUR04-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728796AbgFFPVX (ORCPT ); Sat, 6 Jun 2020 11:21:23 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OvjRqF84BHhlD4myl9vwMxdZONqzTufRkf1UWeggu1tCpD8tXOpKLwKYUzh9cF5xYoUp3yVLgZl24SShqxDx6/Gb8u8c+rc9pNTIfBW89J6HUSJ9nppooKXGHgyNC7fPfphPH2wIgITORT9/LI7/Ktc137b/6Fjib+Mt/hknnegB7AIxJwKlU3hMU1pX704QbJpqs3SdikX2EIgaF7lsAmapQyyF4NH17GUlSxDv9hbG34mJpOor3bk8X05govJIjWpL1PGtqAFaO9Ug3+g8P7whKcRp74Zj1umyMUESbMWZeoANsc45PtNnD8lMgFpAuz5MpwFTz9C0eaiFnqFArA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0izcWiIsFhbVumJfO4SdrrpucrmDe3nP9In+ncyqnZw=; b=bVe8ls7trSVQOexh4uuEzvCrYynoGtjDNvq83qBkVGAr5sQQDxxuni0OqI8zLxcoB9vBkDzGjefLUwU4le220BxWTSzzBpOE6YqEGX098lZNaRlDGiKqfKoSomvYAuYZGQeOUISwfmTHgh9XxCIxmNGciI3CTjL1d5MGWDbA9VXy92eMzoc6+mWnC7RC0rOHnSoKBZE4zLE4OofTqiBNYUDDlSS6Vl80egt76xaxjohxLbXlmViP92yJs/Ww0BYhPADrEilJnQUuUpblYt4jM5CvCVsVO/FNh1eYT77P13Eh6fExS0ih6OrWcrvCnWm9J7flo/OusUE5iXDk0aHYyg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0izcWiIsFhbVumJfO4SdrrpucrmDe3nP9In+ncyqnZw=; b=CC0v6BP00/VwKEslY95Fyw4GEBJ0ynOZMidq0VaSZiE2YqtvI//QACkUny81BUpiU7mCfA5gro+bg1M4bfLPl4PLxftnEYlS6pU0dOH1VNI5soOVryxLyO6ShNYdMJKR0ir9A18SBdgMfCn7bSX9BX8EE/LmeN/w23/G63HDkiw= Authentication-Results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=nxp.com; Received: from VE1PR04MB6638.eurprd04.prod.outlook.com (2603:10a6:803:119::15) by VE1PR04MB6511.eurprd04.prod.outlook.com (2603:10a6:803:11f::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3066.20; Sat, 6 Jun 2020 15:21:17 +0000 Received: from VE1PR04MB6638.eurprd04.prod.outlook.com ([fe80::5cc4:23a5:ca17:da7d]) by VE1PR04MB6638.eurprd04.prod.outlook.com ([fe80::5cc4:23a5:ca17:da7d%6]) with mapi id 15.20.3066.019; Sat, 6 Jun 2020 15:21:17 +0000 From: Robin Gong To: mark.rutland@arm.com, broonie@kernel.org, robh+dt@kernel.org, catalin.marinas@arm.com, vkoul@kernel.org, will.deacon@arm.com, shawnguo@kernel.org, festevam@gmail.com, s.hauer@pengutronix.de, martin.fuzzey@flowbird.group, u.kleine-koenig@pengutronix.de, dan.j.williams@intel.com, matthias.schiffer@ew.tq-group.com Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de, linux-imx@nxp.com, dmaengine@vger.kernel.org Subject: [PATCH v9 RESEND 02/13] Revert "ARM: dts: imx6q: Use correct SDMA script for SPI5 core" Date: Sun, 7 Jun 2020 07:21:06 +0800 Message-Id: <1591485677-20533-3-git-send-email-yibin.gong@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1591485677-20533-1-git-send-email-yibin.gong@nxp.com> References: <1591485677-20533-1-git-send-email-yibin.gong@nxp.com> X-ClientProxiedBy: SG2PR04CA0184.apcprd04.prod.outlook.com (2603:1096:4:14::22) To VE1PR04MB6638.eurprd04.prod.outlook.com (2603:10a6:803:119::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from robin-OptiPlex-790.ap.freescale.net (119.31.174.66) by SG2PR04CA0184.apcprd04.prod.outlook.com (2603:1096:4:14::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3066.18 via Frontend Transport; Sat, 6 Jun 2020 15:21:11 +0000 X-Mailer: git-send-email 2.7.4 X-Originating-IP: [119.31.174.66] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: fe764ab3-a5ba-47a4-8490-08d80a2d41cb X-MS-TrafficTypeDiagnostic: VE1PR04MB6511: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:660; X-Forefront-PRVS: 04267075BD X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: aP3w4PT0yhLwEDpG69hnAfiQlC9h0Plc4Kg6c1BIWarsEp+b3ySFNSFSpjhrh/K8B55aV54tj0m9tI67xkO3gOFpD7dCEYXm3l/YbFqZkhWt3BJ23F72cdkiD6oJNHFe7RjLCUU0zKKG1ORKIr6cb+XlffwHBOeAbJJpwzi+9kTEzuo4o+fTeF00nwWT5o3o9Z4QWuZN4IurMW7VAUJjW8GlHAPvFK6B8r49ec8SKvpNl2/LK8K96jnLqGVihbN9q5EJpW03rmbgiE25afVZwSym4oAhtztghniUBOmAZRTw4r2VFRscVRBqo88i5VGB10dqlTbk1HPmFojaeIArhVJP4Huni4BEe1QbzJPCSnAKAnO79MzBVV9N2C3LFz94dujKrAUy0JemSQ1nAU6yWGBxjccDac/gBseKxkBSGoHVXGrtqcEpcrgYF6HAs6Cgd7MLGMWC9W4mO5K6J4sQsPs57inAU3BHY0E6Rp3g1WE= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VE1PR04MB6638.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(396003)(136003)(366004)(346002)(39860400002)(376002)(86362001)(5660300002)(66476007)(16526019)(6506007)(66946007)(956004)(6666004)(2616005)(186003)(36756003)(2906002)(7416002)(316002)(66556008)(4326008)(478600001)(52116002)(26005)(6486002)(6512007)(8676002)(83380400001)(8936002)(921003)(32563001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 3fnGv0+uYYaRKCw5TCw3oSrtaOOg4olWc9cApIIdyQdkiThECTSIOQ8c0qKjwAoCYW1ldDrifXgMiNT4Cy+aoWjE/0+jORnvcmbewkfpmLUfmHGd7k+dN+B9JbRhL7OhUKfXdRqSiKq7Hzr9hRSg68OG9Bz41yBkPqnJGL4hjW3HluFxYLC1CCtE7obAGi3Dc8vGaTsGYiW66sxiXKIkFIiDGM91v3t4F1H2OQxsZX3RwIXyHu/Z6upbDzkp9Hl6ds57x4idzXKE1zSzWZILQCKiKg9Ixkc53fZvk5F5ZoUAbtHfnheX4XfOhqCz3atIzl2FdyHl6Q7IwamoWEm+d5encaSX8qOkjUGJ5n1DRupI3ftz5O2Z4WDpYKBnnq+vKgNxtqO7ExGxIOso9WEp/FmnU0/gXD649VZC0kxZC5IrYBZeclRIfKsd0LxIcTlp96xeFLStRAEnrUF+0XdzkgQCzw2MiD2bzeaF5jTB0+M= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: fe764ab3-a5ba-47a4-8490-08d80a2d41cb X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jun 2020 15:21:16.9986 (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-CrossTenant-UserPrincipalName: EcDmcHsUsLqDfBr3zcRviWQN7gC/cLT6OCUdjA9yFbcCF4I5Mt/PPL7Uw03LvesumwjyN5V0TWbzKaVIm3K+0w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6511 Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org There are two ways for SDMA accessing SPBA devices: one is SDMA->AIPS ->SPBA(masterA port), another is SDMA->SPBA(masterC port). Please refer to the 'Figure 58-1. i.MX 6Dual/6Quad SPBA connectivity' of i.mx6DQ Reference Manual. SDMA provide the corresponding app_2_mcu/mcu_2_app and shp_2_mcu/mcu_2_shp script for such two options. So both AIPS and SPBA scripts should keep the same behaviour, the issue only caught in AIPS script sounds not solide. The issue is more likely as the ecspi errata ERR009165(http://www.nxp.com/docs/en/errata/IMX6DQCE.pdf): eCSPI: TXFIFO empty flag glitch can cause the current FIFO transfer to be sent twice So revert commit 'df07101e1c4a' firstly. Signed-off-by: Robin Gong Acked-by: Sascha Hauer --- arch/arm/boot/dts/imx6q.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/boot/dts/imx6q.dtsi b/arch/arm/boot/dts/imx6q.dtsi index 78a4d64..afdd9eb 100644 --- a/arch/arm/boot/dts/imx6q.dtsi +++ b/arch/arm/boot/dts/imx6q.dtsi @@ -177,7 +177,7 @@ clocks = <&clks IMX6Q_CLK_ECSPI5>, <&clks IMX6Q_CLK_ECSPI5>; clock-names = "ipg", "per"; - dmas = <&sdma 11 8 1>, <&sdma 12 8 2>; + dmas = <&sdma 11 7 1>, <&sdma 12 7 2>; dma-names = "rx", "tx"; status = "disabled"; }; From patchwork Sat Jun 6 23:21:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Gong X-Patchwork-Id: 214456 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=DATE_IN_FUTURE_06_12, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, UNWANTED_LANGUAGE_BODY, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 330A8C433DF for ; Sat, 6 Jun 2020 15:21:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0BE29207DF for ; Sat, 6 Jun 2020 15:21:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="oY8ltAia" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728842AbgFFPVc (ORCPT ); Sat, 6 Jun 2020 11:21:32 -0400 Received: from mail-eopbgr70048.outbound.protection.outlook.com ([40.107.7.48]:33664 "EHLO EUR04-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728660AbgFFPV2 (ORCPT ); Sat, 6 Jun 2020 11:21:28 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TJVuBmoKVP/yntNXT7lJbvw+ek1MqkGKWRVMk5wTrgerUaXlTphXhtO1Up41F0nqNYFOrTPu+ZpO3hUtQVqYoEL2NLShobvGRzbT7Aw0zPJhGQyO/rZyijdiOiwSyhNvqUPP18xAO/dJPirQtfJa7XO6YhfM8+4xbUCf5y/V/nnCeT9OQoRsYla1YS8jOLDuzQ31QkjClKYdszYCbCF4YubOG+3GUgPutZinwGYOxiunNo8fpl5nh8Vzg2yIADFJKkgCKZ8crORALYTTGo20AC7OITlFwd+ec+IWcdIp1Ynhj/p3A2sP55I6VmAz3EBtrETlf+F7z0Rbe9muMcFeRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=j8bHalFai1IPzAYRt3Uf7FuWi//Xa5PjTOrdEZJL9qQ=; b=H4B2lQotgaFt3pPW0nro5t2ItE8t09cIpMixuk+KV5AURJYa6Qe5xe/ewzkoMHHU6qpHVwvWVt81WS98ow/sWtOocda/5WNCO9LIKsAsnQsC4vQU2QoX4RatqKZF5Xdl91v/G1O+LHJ/dTCEJA2A8t9WN3CMUG/uPDqPuRnkNtbpzxNKqC2ifq2H7vDLM4OgCOlLVJ1TFyD3x1Ha4vO6RuWBRtoz+Z7+LutQ/UUSfXOvoPp76sut2nvk2EL2ou+nTFX9RN01FYBzwv5XBOMEJiNMP1fFGe0WwOIIicbIBpTQV78QIUdpm2fJIMtqn0gOJc/dtkHkn6L696RB62JI0Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=j8bHalFai1IPzAYRt3Uf7FuWi//Xa5PjTOrdEZJL9qQ=; b=oY8ltAiaPaUJSWr4fF48dehsF54n4WBfK1NyeMwVJov0wfq9Zj7pmW8VcHMtjDmIDK8Vwy2aIJXture1IIolYafmZhc3rqyS18VG/bdZ8vkX1VVdwpIIGY7bLFiAf+m/2fI1WRZQbCjT8ysmPIxaRupAMp/Lpdi2gfJX5+0MzSc= Authentication-Results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=nxp.com; Received: from VE1PR04MB6638.eurprd04.prod.outlook.com (2603:10a6:803:119::15) by VE1PR04MB6511.eurprd04.prod.outlook.com (2603:10a6:803:11f::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3066.20; Sat, 6 Jun 2020 15:21:22 +0000 Received: from VE1PR04MB6638.eurprd04.prod.outlook.com ([fe80::5cc4:23a5:ca17:da7d]) by VE1PR04MB6638.eurprd04.prod.outlook.com ([fe80::5cc4:23a5:ca17:da7d%6]) with mapi id 15.20.3066.019; Sat, 6 Jun 2020 15:21:22 +0000 From: Robin Gong To: mark.rutland@arm.com, broonie@kernel.org, robh+dt@kernel.org, catalin.marinas@arm.com, vkoul@kernel.org, will.deacon@arm.com, shawnguo@kernel.org, festevam@gmail.com, s.hauer@pengutronix.de, martin.fuzzey@flowbird.group, u.kleine-koenig@pengutronix.de, dan.j.williams@intel.com, matthias.schiffer@ew.tq-group.com Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de, linux-imx@nxp.com, dmaengine@vger.kernel.org Subject: [PATCH v9 RESEND 03/13] Revert "ARM: dts: imx6: Use correct SDMA script for SPI cores" Date: Sun, 7 Jun 2020 07:21:07 +0800 Message-Id: <1591485677-20533-4-git-send-email-yibin.gong@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1591485677-20533-1-git-send-email-yibin.gong@nxp.com> References: <1591485677-20533-1-git-send-email-yibin.gong@nxp.com> X-ClientProxiedBy: SG2PR04CA0184.apcprd04.prod.outlook.com (2603:1096:4:14::22) To VE1PR04MB6638.eurprd04.prod.outlook.com (2603:10a6:803:119::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from robin-OptiPlex-790.ap.freescale.net (119.31.174.66) by SG2PR04CA0184.apcprd04.prod.outlook.com (2603:1096:4:14::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3066.18 via Frontend Transport; Sat, 6 Jun 2020 15:21:17 +0000 X-Mailer: git-send-email 2.7.4 X-Originating-IP: [119.31.174.66] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: b0d58d60-ed4e-4849-724a-08d80a2d4542 X-MS-TrafficTypeDiagnostic: VE1PR04MB6511: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:660; X-Forefront-PRVS: 04267075BD X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 243wZ3SnFNOIPcitcVtRUpejdvt+dff/uBVdMOyQXE+E6tp5MmKwpuymqkxNOqeDzXKYl8sspdG84uXlPywrIdX1OPCkC7B5QYTnjC1bmFIeBpb6qJHVnyuvaDoFOoQ3/oKnsjsUKp1kYIiDsG3pdiJc1e3o3H76o56ulAjD+s9V21K4qfzn5h37r3BR0OvxNjQsotA6qHQ/SOvZiYvx8PreISFbT0lxrskrp8VIkjxFQ9RFhS4BNfiHpaogXByvO9WFrEsN/YtEPLdjc0I76AOIODc+LR1MAJUaVGAK5jpAi6LmOrfw/dptqiGaktK32iBkHTYViWNzAY3yCMHsbBGu6wGynhu9n3yz5m16wow/jc2m1dsaWEnDQNUsZyTZU6O/Wc7WVxaKfy0hpbAlOGjFAl/8ZdWiAB4wLBrFBjhSUxridAzLDzt3NZD12tUNEntCFVdHwu0sYQmCibt/HA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VE1PR04MB6638.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(396003)(136003)(366004)(346002)(39860400002)(376002)(86362001)(5660300002)(66476007)(16526019)(6506007)(66946007)(956004)(6666004)(2616005)(186003)(36756003)(2906002)(7416002)(316002)(66556008)(4326008)(478600001)(52116002)(26005)(6486002)(6512007)(8676002)(83380400001)(8936002)(921003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: IDxsi30zQsQhZRbv+oDwSDZqN3TcWiMeJxnqCPl6HJt+Lyr0nPdLKyBCCEt2SIlsw/LLFi70PkPN+mECKr40iy4MybehTp+3sX6k9MBDvOTrF4s8nAQHB/Jib8zIhbvSCa7In2+mLCrrrp7XuAChF+00LS+17QhZbw8KX5JA+R+xVlPbqOVO16ikYjHl1KkDxKYGPc5Nvzuk2Ia3iMtoV8qI/KAj7qR2/N/aQVOGUJgkcp+uK/T0zpGLryr3PHKEiaez9Hej53CkO5P+lnyY0zGRCWDBbd0VjG2+Zdn4pvvOPPX+YglLnUeIQ7rLO51NShB1CfVykuxXp40Tk4ReZGFqC5XVf7xAAfEYZveVtH7sjE59RQPOd1/HrjZDBmcQJseju/SlalkniIwC0ch7ynucqlNSShwxauEWB6skQTJg3U/EqVYVSflkPoRnpQC2aFlXvg0zWI4rVcTK5N+GkOqozOd7DH5iDQ6Zk3EpnHk= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: b0d58d60-ed4e-4849-724a-08d80a2d4542 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jun 2020 15:21:22.6972 (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-CrossTenant-UserPrincipalName: /EcOm8FYGgc0woMHR2LcdJ9I47E1rGy65rmezu691MhehvMTXBfBoeG+6tV40txs7MelYx9qgfD375q0GgBdWw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6511 Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org There are two ways for SDMA accessing SPBA devices: one is SDMA->AIPS ->SPBA(masterA port), another is SDMA->SPBA(masterC port). Please refer to the 'Figure 58-1. i.MX 6Dual/6Quad SPBA connectivity' of i.mx6DQ Reference Manual. SDMA provide the corresponding app_2_mcu/mcu_2_app and shp_2_mcu/mcu_2_shp script for such two options. So both AIPS and SPBA scripts should keep the same behaviour, the issue only caught in AIPS script sounds not solide. The issue is more likely as the ecspi errata ERR009165(http://www.nxp.com/docs/en/errata/IMX6DQCE.pdf): eCSPI: TXFIFO empty flag glitch can cause the current FIFO transfer to be sent twice So revert commit 'dd4b487b32a3' firstly. Signed-off-by: Robin Gong Acked-by: Sascha Hauer --- arch/arm/boot/dts/imx6qdl.dtsi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/arm/boot/dts/imx6qdl.dtsi b/arch/arm/boot/dts/imx6qdl.dtsi index 32114cf..9479a90 100644 --- a/arch/arm/boot/dts/imx6qdl.dtsi +++ b/arch/arm/boot/dts/imx6qdl.dtsi @@ -338,7 +338,7 @@ clocks = <&clks IMX6QDL_CLK_ECSPI1>, <&clks IMX6QDL_CLK_ECSPI1>; clock-names = "ipg", "per"; - dmas = <&sdma 3 8 1>, <&sdma 4 8 2>; + dmas = <&sdma 3 7 1>, <&sdma 4 7 2>; dma-names = "rx", "tx"; status = "disabled"; }; @@ -352,7 +352,7 @@ clocks = <&clks IMX6QDL_CLK_ECSPI2>, <&clks IMX6QDL_CLK_ECSPI2>; clock-names = "ipg", "per"; - dmas = <&sdma 5 8 1>, <&sdma 6 8 2>; + dmas = <&sdma 5 7 1>, <&sdma 6 7 2>; dma-names = "rx", "tx"; status = "disabled"; }; @@ -366,7 +366,7 @@ clocks = <&clks IMX6QDL_CLK_ECSPI3>, <&clks IMX6QDL_CLK_ECSPI3>; clock-names = "ipg", "per"; - dmas = <&sdma 7 8 1>, <&sdma 8 8 2>; + dmas = <&sdma 7 7 1>, <&sdma 8 7 2>; dma-names = "rx", "tx"; status = "disabled"; }; @@ -380,7 +380,7 @@ clocks = <&clks IMX6QDL_CLK_ECSPI4>, <&clks IMX6QDL_CLK_ECSPI4>; clock-names = "ipg", "per"; - dmas = <&sdma 9 8 1>, <&sdma 10 8 2>; + dmas = <&sdma 9 7 1>, <&sdma 10 7 2>; dma-names = "rx", "tx"; status = "disabled"; }; From patchwork Sat Jun 6 23:21:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Gong X-Patchwork-Id: 214455 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DATE_IN_FUTURE_06_12, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 77328C433DF for ; Sat, 6 Jun 2020 15:21:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 57409207ED for ; Sat, 6 Jun 2020 15:21:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="NGV3j9mi" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728895AbgFFPVr (ORCPT ); Sat, 6 Jun 2020 11:21:47 -0400 Received: from mail-eopbgr70089.outbound.protection.outlook.com ([40.107.7.89]:28739 "EHLO EUR04-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728884AbgFFPVq (ORCPT ); Sat, 6 Jun 2020 11:21:46 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AQs1EsjLFjjHVuaTHP5s87LdOpoWxqcMOKWBth0g48cLY/h0456toRQLy+2BYxkHP+z8+4sorOsdwHJXG9aFPFxMDWhPYmdjLRfpREfKgz70nLfSA0hmSuHUzTZ906fnpgox9B46A4xiG3Um6RjjhJOoeqgwK1xr/6nWUixSCGNTubku0y+6X4AiaOF6fWljwSMhmfftWP+z8xIsW80yHBtYqj2tBGuj9wU4uuG7MRPSwtKC9AGoAv7q0sLrw4+Pib1gmBSL3GR28MGfYi9rIbjcVfl/ub00lLcVQYXu2LysvE50oT3DY1wZgEDNu3pvx5ljMX1RKqO7fClE7AwNjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/Yx0IR+9/TNLsZpIgHM8O9jKDpTRHMYZbaruFg9y6So=; b=WU9DUznGnh274w0j+YtZzFUgusegBdrD5yhVOExfRxzUL5PpcNcl3X9hZ1LyilYegPX4P6HtvsDsFM7KeMVK+E2D/c43pfBYsIYt4bSFkLoqsNfbm1S/UuaZdNfU13CQ7PANMk7ZGTZya8T7+0wDP2c9j4QNzGw+pkfXI+4xUsn+QPyffqPr6lbMXOZjuCsFxQAZXGzV9YNMX/r7MEfcgTHwgtfL0RPsKQTLz9EfrR0kz6j3hZsGJNxkYO/OIOBNN9Xy/n37ICKoLH8QmoY5ZLyjo1qzCEwpmogn/lrt8h7dXOb2Od55ZwAH3VQ6enrqRE6LdQ1R2nZmOZFSq9l7hQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/Yx0IR+9/TNLsZpIgHM8O9jKDpTRHMYZbaruFg9y6So=; b=NGV3j9miTpK1oCo3gPWD+/y1nI87ky/bPH1YT0Re8nNQi+XPe8Pg9CGk0JzZJxaxVHdZDnFxKSCWFdxCrT2zBnClbNnKC2TmnLBFfUOMrPOGH8fp6vDHUXkmT2Ya7ATMTb/JUO+4tpt74xG7BPHiR8y3hHkjuvgTMTsC1I+85UI= Authentication-Results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=nxp.com; Received: from VE1PR04MB6638.eurprd04.prod.outlook.com (2603:10a6:803:119::15) by VE1PR04MB6511.eurprd04.prod.outlook.com (2603:10a6:803:11f::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3066.20; Sat, 6 Jun 2020 15:21:40 +0000 Received: from VE1PR04MB6638.eurprd04.prod.outlook.com ([fe80::5cc4:23a5:ca17:da7d]) by VE1PR04MB6638.eurprd04.prod.outlook.com ([fe80::5cc4:23a5:ca17:da7d%6]) with mapi id 15.20.3066.019; Sat, 6 Jun 2020 15:21:40 +0000 From: Robin Gong To: mark.rutland@arm.com, broonie@kernel.org, robh+dt@kernel.org, catalin.marinas@arm.com, vkoul@kernel.org, will.deacon@arm.com, shawnguo@kernel.org, festevam@gmail.com, s.hauer@pengutronix.de, martin.fuzzey@flowbird.group, u.kleine-koenig@pengutronix.de, dan.j.williams@intel.com, matthias.schiffer@ew.tq-group.com Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de, linux-imx@nxp.com, dmaengine@vger.kernel.org Subject: [PATCH v9 RESEND 06/13] dmaengine: imx-sdma: add mcu_2_ecspi script Date: Sun, 7 Jun 2020 07:21:10 +0800 Message-Id: <1591485677-20533-7-git-send-email-yibin.gong@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1591485677-20533-1-git-send-email-yibin.gong@nxp.com> References: <1591485677-20533-1-git-send-email-yibin.gong@nxp.com> X-ClientProxiedBy: SG2PR04CA0184.apcprd04.prod.outlook.com (2603:1096:4:14::22) To VE1PR04MB6638.eurprd04.prod.outlook.com (2603:10a6:803:119::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from robin-OptiPlex-790.ap.freescale.net (119.31.174.66) by SG2PR04CA0184.apcprd04.prod.outlook.com (2603:1096:4:14::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3066.18 via Frontend Transport; Sat, 6 Jun 2020 15:21:34 +0000 X-Mailer: git-send-email 2.7.4 X-Originating-IP: [119.31.174.66] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 213f2b5a-6182-44a6-b40e-08d80a2d4f7a X-MS-TrafficTypeDiagnostic: VE1PR04MB6511: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:361; X-Forefront-PRVS: 04267075BD X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 7MdkZ/kKz2pLGYL6qwbryRsyuzSsPORlSjpqpQH4yTuJ0l7vunQgT40SdnhVGjJYNlMbDv4EvWjd9tlWEI6z3altZV2ZlwzO6a5HJUalWBB2fQjfK1C0zh1YWpqQ5sGfX5xADRiRQX51HLiPAEB9YfL43JlrIVNAArz8I7hYd6CU+Kwz9b8sdnVEpl8l5hZv1YEk/YbkRi30kEVS6G4PNuMOhc0QiEDr60SRt7U58afiylUYcvImQqyTicp+LjK0GHqwgVi1cxGuz1DrM8Vul/K6T/jIQ9tT+KUFJVkyit1/shtpoxQhHnJtJLMCUA/cF2a/meQcp324DaotxVVaEY64x8iQBJ2tqJHteWca0+JYcf+6pnpqFGt7ukToyaLe X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VE1PR04MB6638.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(396003)(136003)(366004)(346002)(39860400002)(376002)(86362001)(5660300002)(4744005)(66476007)(16526019)(6506007)(66946007)(956004)(6666004)(2616005)(186003)(36756003)(2906002)(7416002)(316002)(66556008)(4326008)(478600001)(52116002)(26005)(6486002)(6512007)(8676002)(8936002)(921003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: DCzN9ticWJXDnmHSc3CekHN1zuJR4Nd8vRGsir8njLpdyk9vrO3h0onnq3112zR+3cefrhjbdk2I63EOjbEPThcj8bj0wT75AVeJUOt1RqLqtFvN9SyACZZSm5aDf/GVlp0tIhYmhQ2tajUzO3pCaoK9p1q6tnF8+yxPUkLyWlyjTJSN+OixLAqVOZKSpAQZ8sBJebYlJxoBOs7dkY9IkROdMR6DejfsSh0ieqOW8FVHgS4AODnf7VjvIDhlG6SxSXflQgE2JoR2f2zgmtQyT3OI7VjIJZozp1r7g0yIcXyVBL/FlaBCEEzbp1c71QEP6s2Svcd0DxIWVUcH9Vih01mRk/k1eAP6tUPRg3tFnhPH8zANsOPDa43U+Pdv8Rr75HdHVaCQ4EZl/QK12PuolpruQbVznhslfdBJcNMk7W+t3HWJyU8SKzcT6WnrEQQBEoNEQsveoOwLT2x8eWBelcYQfe72wE3Eu0g44o3U260= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 213f2b5a-6182-44a6-b40e-08d80a2d4f7a X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jun 2020 15:21:39.9490 (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-CrossTenant-UserPrincipalName: 690pzTEecQWnji9ylazGkQbcQxqVnwDLFHihyyw2xwknt5C0hAlncdcyAfiQ8WEvT/BboX9Me8Ogh0iGn74vYA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6511 Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org Add mcu_2_ecspi script to fix ecspi errata ERR009165. Signed-off-by: Robin Gong Acked-by: Vinod Koul --- drivers/dma/imx-sdma.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c index 4440ddb..db4132f 100644 --- a/drivers/dma/imx-sdma.c +++ b/drivers/dma/imx-sdma.c @@ -920,6 +920,9 @@ static void sdma_get_pc(struct sdma_channel *sdmac, emi_2_per = sdma->script_addrs->mcu_2_ata_addr; break; case IMX_DMATYPE_CSPI: + per_2_emi = sdma->script_addrs->app_2_mcu_addr; + emi_2_per = sdma->script_addrs->mcu_2_ecspi_addr; + break; case IMX_DMATYPE_EXT: case IMX_DMATYPE_SSI: case IMX_DMATYPE_SAI: From patchwork Sat Jun 6 23:21:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Gong X-Patchwork-Id: 214454 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DATE_IN_FUTURE_06_12, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 72042C433E0 for ; Sat, 6 Jun 2020 15:22:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 528C9207BC for ; Sat, 6 Jun 2020 15:22:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="se7r61Es" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728925AbgFFPV6 (ORCPT ); Sat, 6 Jun 2020 11:21:58 -0400 Received: from mail-eopbgr70055.outbound.protection.outlook.com ([40.107.7.55]:57088 "EHLO EUR04-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728904AbgFFPVw (ORCPT ); Sat, 6 Jun 2020 11:21:52 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mRsnN4rnXm2Uf79wbpERPdnuf4at2XGWX0tYTXq1oTaZ1vkQHvHpzYSyHJ7t7OK0EHxE5nRuZQV+UF1NiBbC+es+P9r43y0y+t+Tie+C3chJKwC4iTm6jSgposMKwYpzYznaV3BrbA5sLLR1EUoJWOeUlnFiyNC0bCXOluGz22YMD+nY1leTz2SVo/lS3Ne8v/JgL5f7JS1v1DmPJPL38qJm/br/fl4bo+O5EO3CgK+zB49LdeX461OLJPHYZA+SHRPbm/doNbKZzy0Bgt0mPqfSwbSAOZ5UpMea9BdxdnpIeIGpBEdb8cynWM7Ck9R4JFdu6T5yPQXnBpd7JBRshQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=SwfoeN46wII4AzCv4Aep+lEnXdhpI+0nA9yQ0aIHe7M=; b=A7oJTc/g6VAOAJozfqMzkdUjKMSgZteUKgIoV2f+63baUfYVEcigsnv01jUNv2ZGxrZZoIwX8W1hX62nADrFI/ZZziLCyA6Wlah7hGRrOHNmpsAksTzFiibwalxYeevSUmc1tcKsWno/r3s+IgHEsg/5T9e3Tj3rUlU+DWdhyEmLDHhR53Cgc14NnafuGZiL71RiyOwK63cLZTVfDkZgHB+pAA5onHqu/zUGuLSnvtEf8pHjwupKvdsw5Ll5WK3CrnNOLKtfPKpIfinVKxTqjHdrHN5Dm8UKSej6dN2shy3l4n61BVa+akWQhINwtDsS1WEnFImsDWWg1kmh+0uNJA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=SwfoeN46wII4AzCv4Aep+lEnXdhpI+0nA9yQ0aIHe7M=; b=se7r61Es7E81ZqygqHlsGEQKdtip+457S2PCZsoGtItTLkBAAfjOtMnF0vv8x52M1j58W4KG4cOCfXi/wbDRuFjcMbV4RtUjcROTDJdHNuWRCci4FCSeE+NGBpU8m2OW6Gj51hBe4JNOmVdgLJWTqs05g8DT98cGgYgRgf9fKrk= Authentication-Results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=nxp.com; Received: from VE1PR04MB6638.eurprd04.prod.outlook.com (2603:10a6:803:119::15) by VE1PR04MB6511.eurprd04.prod.outlook.com (2603:10a6:803:11f::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3066.20; Sat, 6 Jun 2020 15:21:45 +0000 Received: from VE1PR04MB6638.eurprd04.prod.outlook.com ([fe80::5cc4:23a5:ca17:da7d]) by VE1PR04MB6638.eurprd04.prod.outlook.com ([fe80::5cc4:23a5:ca17:da7d%6]) with mapi id 15.20.3066.019; Sat, 6 Jun 2020 15:21:45 +0000 From: Robin Gong To: mark.rutland@arm.com, broonie@kernel.org, robh+dt@kernel.org, catalin.marinas@arm.com, vkoul@kernel.org, will.deacon@arm.com, shawnguo@kernel.org, festevam@gmail.com, s.hauer@pengutronix.de, martin.fuzzey@flowbird.group, u.kleine-koenig@pengutronix.de, dan.j.williams@intel.com, matthias.schiffer@ew.tq-group.com Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de, linux-imx@nxp.com, dmaengine@vger.kernel.org Subject: [PATCH v9 RESEND 07/13] spi: imx: fix ERR009165 Date: Sun, 7 Jun 2020 07:21:11 +0800 Message-Id: <1591485677-20533-8-git-send-email-yibin.gong@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1591485677-20533-1-git-send-email-yibin.gong@nxp.com> References: <1591485677-20533-1-git-send-email-yibin.gong@nxp.com> X-ClientProxiedBy: SG2PR04CA0184.apcprd04.prod.outlook.com (2603:1096:4:14::22) To VE1PR04MB6638.eurprd04.prod.outlook.com (2603:10a6:803:119::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from robin-OptiPlex-790.ap.freescale.net (119.31.174.66) by SG2PR04CA0184.apcprd04.prod.outlook.com (2603:1096:4:14::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3066.18 via Frontend Transport; Sat, 6 Jun 2020 15:21:40 +0000 X-Mailer: git-send-email 2.7.4 X-Originating-IP: [119.31.174.66] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 911ec55c-7be9-478a-6998-08d80a2d52f0 X-MS-TrafficTypeDiagnostic: VE1PR04MB6511: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5236; X-Forefront-PRVS: 04267075BD X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qITVc7SVY52UqTXq/Pkk1ON4uhE0wePxcu6ayyuvJeUnKu/NO72M70M1VuUY7RwHFerISKQwi250BE8+gvSQI9/4vTqpR5E2bATs3j8s8tKMQStD+bqwHkqw16k1AwGTMhmvG4go1t/bABwmAWxm4mzF5ZoF7tkfSQZ1ei5bnUkvx8Pm1epsKq1p/39zMGbZvSXw/4Mjb5CHGGj9TS/QuS4MUjPpyDt9gK0/Vwei5xvgkQO90/dr7yS5QY9MftjvJsxAaC95tXu8P6lmVEk8++tNSch4XvkXA2ZvhQ8gvsAwnNK8MzI2zOLpI2hnTwqEVjHWMHb8XAYWO1LR/3lnHJxZ/miCt0TuXLct/MQk4RIuxxOa4gcF9QrfXfWDC8sFHb4tLdoPwwAu+9Wkw2f1hDOfDx5ZSVMLh3v+4VkRYlCm+c5Zy78zFyQe+jWlhT5RSByzvhW9N8knrubNT7LkMA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VE1PR04MB6638.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(396003)(136003)(366004)(346002)(39860400002)(376002)(86362001)(5660300002)(66476007)(16526019)(6506007)(66946007)(956004)(6666004)(2616005)(186003)(36756003)(2906002)(7416002)(316002)(66556008)(4326008)(478600001)(52116002)(26005)(6486002)(966005)(6512007)(8676002)(83380400001)(8936002)(921003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: yYmSisGS1blfkZaHxXmlVp6HDWkDAMrP8bR2OW4cvMIfoaiSiWnPRn5kJr5e+kBi3hjHH/R//2+2AS4RmTbhfKptL+PPSl3TwwDa3Td++N2iIPPrII3YiwZEm6MM6xLf9JniOb9pAAKktKqyeH0spzavHWXz14WHOk9VJ/I21ojcvqZxXz+CpJMZzR6TOAvtQBONvBpGuZ5eUWCgKJcoBjR0LcKVYZOceyk6nt710QSUXODizW+ExWfE9CDtSyj7yCRcJTO6ivEqwFpdAq9QFe2g5CNhVMQszf0i0rlZcQr/dUwd4kkK6bylw56Zk7LO/rNpK1Na0fOBIcwUtihMxQsLgZrd6G5Qk6DyBWLqoH1vtg/Bdnaqfl1ZxAMmHbXUvnEPat9OSVs7SeMZpwbtLQTqWUcYxev94lMArb17okytE4O/UxRaSuJ/3YPrX6mtHcLzx2JcnuJNSywOQdbZB3Qp7Mr+xjFkcc7WPKV0ZDk= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 911ec55c-7be9-478a-6998-08d80a2d52f0 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jun 2020 15:21:45.6347 (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-CrossTenant-UserPrincipalName: KZ54JDec7PAKZkQVtKVcaw3TRO5RsQ6NnUlvA9WYRU0t2Kttec1Sv68EXCCLuygtQYwFmj9sHwI6KyHwbpDkzg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6511 Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org 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 Acked-by: Mark Brown --- drivers/spi/spi-imx.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c index 84aebee..d4fe5dd 100644 --- a/drivers/spi/spi-imx.c +++ b/drivers/spi/spi-imx.c @@ -591,8 +591,8 @@ 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; - if (spi_imx->usedma) - ctrl |= MX51_ECSPI_CTRL_SMC; + /* ERR009165: work in XHC mode as PIO */ + ctrl &= ~MX51_ECSPI_CTRL_SMC; writel(ctrl, spi_imx->base + MX51_ECSPI_CTRL); @@ -623,7 +623,7 @@ static void mx51_setup_wml(struct spi_imx_data *spi_imx) * 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(0) | 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); @@ -1273,10 +1273,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: */ From patchwork Sat Jun 6 23:21:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Gong X-Patchwork-Id: 214453 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=DATE_IN_FUTURE_06_12, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, UNWANTED_LANGUAGE_BODY, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 678A7C433E1 for ; Sat, 6 Jun 2020 15:22:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3E18920810 for ; Sat, 6 Jun 2020 15:22:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="LcIfgXiL" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728102AbgFFPWF (ORCPT ); Sat, 6 Jun 2020 11:22:05 -0400 Received: from mail-eopbgr70055.outbound.protection.outlook.com ([40.107.7.55]:57088 "EHLO EUR04-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728880AbgFFPWB (ORCPT ); Sat, 6 Jun 2020 11:22:01 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hFnzR+0TeSJpRp4Oe4m57R+pHAdBwpQkB6PHC9eQsWE+ERoeRKcg3vLSq8mes0jsnMeai8J+HVX7VrHva1sBtizu1x4JwkLYYRjOR1c+Dizqaz6ZImDoNB2NZmm8AQrnoNzQGdrFhYpZOkgdcaBcdmKVHadOE44FeZHyGUIA3aPp4R9r68nfk1b2Er+a2NvNrNWwbP54WSDqpiCzROT1/DJCDYSnlnGrnWEqVExTNWx/wJxDG92qfzkkKZhmlqxb1vVIrIktFTMQ0EogpU8R8h8LVeX2VFeHV/TbFU0xMu340onbya6uaYiBzgqi6dhpvhcqe+ghQb1fUg1fnC/kdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9n1VV5nm38ydhp9SERQDwP6xUvEr4oY0B1T8ST6d3As=; b=LG/s/z37EJZvDjKt+ZW1kZ73+oUMwENIikvfQ8HN3+zJVFkxonvOpfFZOHcE5iX1RxgvIKYsyZCbis20PUMk3ISBc82DMqA3WZLdnF/GHw4TAI/8JXHTvrCeK0ovhiyYjVcbJH43UHB2SUSYeFoRkLzkSrnsr7utxStaDSw9+7VHFiymurpMRQ5IKaCOK7szWLZvtQNz+cp3ts9Gww3/rZZWAHEYTCLyvvXZAZWkn5QubZWJ72Zm1NAhJydaV5Wzr8GUHa4N/JWatWkIB1RfzZuJHzGk8w6baYylwNwycRu1oshr05tGG4I4SPeBzRRxCAN+4nlFRT8UQPt0wuu8+A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9n1VV5nm38ydhp9SERQDwP6xUvEr4oY0B1T8ST6d3As=; b=LcIfgXiLi8T2j7PJXrR4NGBcwDa/a77D6B6Tz2ZAgWgiarD4mCbApQHQ86lC0hjzqsUoEBt7p5ECVk/9fSZZ0TqFLlp+EVUOVa0ExgqxSdrgLUmLWl0GU5v1SqX9vLjUqKeTWrsBZXsufeUio4OMG7nXPFY5aTOpUcejjiPIsx4= Authentication-Results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=nxp.com; Received: from VE1PR04MB6638.eurprd04.prod.outlook.com (2603:10a6:803:119::15) by VE1PR04MB6511.eurprd04.prod.outlook.com (2603:10a6:803:11f::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3066.20; Sat, 6 Jun 2020 15:21:51 +0000 Received: from VE1PR04MB6638.eurprd04.prod.outlook.com ([fe80::5cc4:23a5:ca17:da7d]) by VE1PR04MB6638.eurprd04.prod.outlook.com ([fe80::5cc4:23a5:ca17:da7d%6]) with mapi id 15.20.3066.019; Sat, 6 Jun 2020 15:21:51 +0000 From: Robin Gong To: mark.rutland@arm.com, broonie@kernel.org, robh+dt@kernel.org, catalin.marinas@arm.com, vkoul@kernel.org, will.deacon@arm.com, shawnguo@kernel.org, festevam@gmail.com, s.hauer@pengutronix.de, martin.fuzzey@flowbird.group, u.kleine-koenig@pengutronix.de, dan.j.williams@intel.com, matthias.schiffer@ew.tq-group.com Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de, linux-imx@nxp.com, dmaengine@vger.kernel.org Subject: [PATCH v9 RESEND 08/13] spi: imx: remove ERR009165 workaround on i.mx6ul Date: Sun, 7 Jun 2020 07:21:12 +0800 Message-Id: <1591485677-20533-9-git-send-email-yibin.gong@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1591485677-20533-1-git-send-email-yibin.gong@nxp.com> References: <1591485677-20533-1-git-send-email-yibin.gong@nxp.com> X-ClientProxiedBy: SG2PR04CA0184.apcprd04.prod.outlook.com (2603:1096:4:14::22) To VE1PR04MB6638.eurprd04.prod.outlook.com (2603:10a6:803:119::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from robin-OptiPlex-790.ap.freescale.net (119.31.174.66) by SG2PR04CA0184.apcprd04.prod.outlook.com (2603:1096:4:14::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3066.18 via Frontend Transport; Sat, 6 Jun 2020 15:21:45 +0000 X-Mailer: git-send-email 2.7.4 X-Originating-IP: [119.31.174.66] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 4e15ae43-9ac9-4f99-ebfd-08d80a2d5659 X-MS-TrafficTypeDiagnostic: VE1PR04MB6511: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7691; X-Forefront-PRVS: 04267075BD X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3tlGSsvlMg8CPRh3JUZ7Eu1QWlA2K+3COVsVOl9hdg+5azGNk8jCiIi6z1G4qaKrbjGjYCw2BvN+Lfix8XhxcMN08F5c5M95xxGaRI//T2o1JT9jevGtJBHSx8XWHXaD22yulkw4ZafWuH2Dz3r42V/d533FP2NONOQGXHgT0O8EvWdzR1d5NRyjQMOarkmeD8l8VV/VjwXnqx5BcpG/4A1yzhTbA3w6EHSpZ9hPKWjfkU9I02BNV1tDC3WX4MmClsNgeFWzubIlkMJyZxF/y20zUXPxlKe5OJRK50K560FgMf2LojqVNhn/n0Ga6t72tkSjKJ9PB2OL95Ebdc/7glcS4iVGowQdrjlsxp6jQKzN838QRE3PWKL1rYbi1LnUULZxBdAlr7190tEUOFdJCpZG3Vj/i/hLzjz60PYD/Kw5Dy4wgH1zovdDQDlmE9gd+y9bBeiSFZ5bilYQ2Fvn0Q== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VE1PR04MB6638.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(396003)(136003)(366004)(346002)(39860400002)(376002)(86362001)(5660300002)(66476007)(16526019)(6506007)(66946007)(956004)(6666004)(2616005)(186003)(36756003)(2906002)(7416002)(316002)(66556008)(4326008)(478600001)(52116002)(26005)(6486002)(966005)(6512007)(8676002)(83380400001)(8936002)(921003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 9j+iBK97ZKBMUDz5M3oORQRPSWZNnc+QHM81nMriJJXhFSSDM9OBA3NQK8T6o+IGkO619wo1AWee3zy0gSx0tZnuSduNzzJoDg7cy9p4L678Zgg60kRWxhhE6i+5sndIlsp6haCOSYr5uwnVUALPXpcY+UCKGVXIV4iyNUbIpeXHio1lrg9yyX3wiACHzTPI9XE1+u/9XondD242oDvrgVv1SifiWMSC+mE35JF39SnxaciEcliViaUVPbxjLVPVUzMLIvEuNS75bVn4Kyj5L6va/fsnV8/xo6AgslcYH9yvG0icbg+j4nwZ1jBvKbAaYmDvT/gf8XGVE6/Io4dR7DXrw1rYqfe4/KxutmhjM6jje4w5+iviZV90Esc0X+DnuMld6QvwalR+z/8dHtG+QB7WnrM6Xb7PfkhLnqxqP2a51m/7h8jqMxXaq7FadLGk0VdR4cSkyMlDKhEMItW/J2/g40K1ceaQJ4we0qb471k= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4e15ae43-9ac9-4f99-ebfd-08d80a2d5659 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jun 2020 15:21:51.3823 (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-CrossTenant-UserPrincipalName: Iz/rkRpNyHt6okRltVZlbe3/UWFI2siorMvYBPkbi9RQkh4n0AysvqXO2foV3ZzNmzMgZQHVlpC0JUv/LWeYpg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6511 Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org ERR009165 fixed on i.mx6ul/6ull/6sll. All other i.mx6/7 and i.mx8m/8mm still need this errata. Please refer to nxp official errata document from https://www.nxp.com/ . For removing workaround on those chips. Add new i.mx6ul type. Signed-off-by: Robin Gong Acked-by: Mark Brown --- drivers/spi/spi-imx.c | 59 ++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 54 insertions(+), 5 deletions(-) diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c index d4fe5dd..437ff1e 100644 --- a/drivers/spi/spi-imx.c +++ b/drivers/spi/spi-imx.c @@ -57,6 +57,7 @@ enum spi_imx_devtype { IMX35_CSPI, /* CSPI on all i.mx except above */ IMX51_ECSPI, /* ECSPI on i.mx51 */ IMX53_ECSPI, /* ECSPI on i.mx53 and later */ + IMX6UL_ECSPI, /* ERR009165 fix from i.mx6ul */ }; struct spi_imx_data; @@ -76,6 +77,11 @@ struct spi_imx_devtype_data { bool has_slavemode; unsigned int fifo_size; bool dynamic_burst; + /* + * ERR009165 fixed or not: + * https://www.nxp.com/docs/en/errata/IMX6DQCE.pdf + */ + bool tx_glitch_fixed; enum spi_imx_devtype devtype; }; @@ -132,6 +138,11 @@ static inline int is_imx51_ecspi(struct spi_imx_data *d) return d->devtype_data->devtype == IMX51_ECSPI; } +static inline int is_imx6ul_ecspi(struct spi_imx_data *d) +{ + return d->devtype_data->devtype == IMX6UL_ECSPI; +} + static inline int is_imx53_ecspi(struct spi_imx_data *d) { return d->devtype_data->devtype == IMX53_ECSPI; @@ -591,8 +602,14 @@ 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 */ - ctrl &= ~MX51_ECSPI_CTRL_SMC; + /* + * ERR009165: work in XHC mode instead of SMC as PIO on the chips + * before i.mx6ul. + */ + if (spi_imx->usedma && spi_imx->devtype_data->tx_glitch_fixed) + ctrl |= MX51_ECSPI_CTRL_SMC; + else + ctrl &= ~MX51_ECSPI_CTRL_SMC; writel(ctrl, spi_imx->base + MX51_ECSPI_CTRL); @@ -618,12 +635,16 @@ 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; + + if (spi_imx->devtype_data->tx_glitch_fixed) + tx_wml = spi_imx->wml; /* * 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(0) | + 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); @@ -1017,6 +1038,23 @@ static struct spi_imx_devtype_data imx53_ecspi_devtype_data = { .devtype = IMX53_ECSPI, }; +static struct spi_imx_devtype_data imx6ul_ecspi_devtype_data = { + .intctrl = mx51_ecspi_intctrl, + .prepare_message = mx51_ecspi_prepare_message, + .prepare_transfer = mx51_ecspi_prepare_transfer, + .trigger = mx51_ecspi_trigger, + .rx_available = mx51_ecspi_rx_available, + .reset = mx51_ecspi_reset, + .setup_wml = mx51_setup_wml, + .fifo_size = 64, + .has_dmamode = true, + .dynamic_burst = true, + .has_slavemode = true, + .tx_glitch_fixed = true, + .disable = mx51_ecspi_disable, + .devtype = IMX6UL_ECSPI, +}; + static const struct platform_device_id spi_imx_devtype[] = { { .name = "imx1-cspi", @@ -1040,6 +1078,9 @@ static const struct platform_device_id spi_imx_devtype[] = { .name = "imx53-ecspi", .driver_data = (kernel_ulong_t) &imx53_ecspi_devtype_data, }, { + .name = "imx6ul-ecspi", + .driver_data = (kernel_ulong_t) &imx6ul_ecspi_devtype_data, + }, { /* sentinel */ } }; @@ -1052,6 +1093,7 @@ static const struct of_device_id spi_imx_dt_ids[] = { { .compatible = "fsl,imx35-cspi", .data = &imx35_cspi_devtype_data, }, { .compatible = "fsl,imx51-ecspi", .data = &imx51_ecspi_devtype_data, }, { .compatible = "fsl,imx53-ecspi", .data = &imx53_ecspi_devtype_data, }, + { .compatible = "fsl,imx6ul-ecspi", .data = &imx6ul_ecspi_devtype_data, }, { /* sentinel */ } }; MODULE_DEVICE_TABLE(of, spi_imx_dt_ids); @@ -1179,7 +1221,14 @@ static int spi_imx_dma_configure(struct spi_master *master) tx.direction = DMA_MEM_TO_DEV; tx.dst_addr = spi_imx->base_phys + MXC_CSPITXDATA; tx.dst_addr_width = buswidth; - tx.dst_maxburst = spi_imx->wml; + /* + * For ERR009165 with TX_THRESHOLD=0 could enlarge burst size to fifo + * size to speed up fifo filling as possible. + */ + if (spi_imx->devtype_data->tx_glitch_fixed) + tx.dst_maxburst = spi_imx->wml; + else + tx.dst_maxburst = spi_imx->devtype_data->fifo_size; ret = dmaengine_slave_config(master->dma_tx, &tx); if (ret) { dev_err(spi_imx->dev, "TX dma configuration failed with %d\n", ret); @@ -1690,7 +1739,7 @@ static int spi_imx_probe(struct platform_device *pdev) spi_imx->bitbang.master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH \ | SPI_NO_CS; if (is_imx35_cspi(spi_imx) || is_imx51_ecspi(spi_imx) || - is_imx53_ecspi(spi_imx)) + is_imx53_ecspi(spi_imx) || is_imx6ul_ecspi(spi_imx)) spi_imx->bitbang.master->mode_bits |= SPI_LOOP | SPI_READY; spi_imx->spi_drctl = spi_drctl; From patchwork Sat Jun 6 23:21:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Gong X-Patchwork-Id: 214451 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DATE_IN_FUTURE_06_12, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2EC1FC433E3 for ; Sat, 6 Jun 2020 15:22:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0C56A207D3 for ; Sat, 6 Jun 2020 15:22:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="eoMxN3az" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728912AbgFFPWS (ORCPT ); Sat, 6 Jun 2020 11:22:18 -0400 Received: from mail-vi1eur05on2048.outbound.protection.outlook.com ([40.107.21.48]:62060 "EHLO EUR05-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728968AbgFFPWM (ORCPT ); Sat, 6 Jun 2020 11:22:12 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=c79UDeMnw6sYC4sdSW1GlcmsRNS2E0gvK8oJIOrFdjEhZIrcIPyez6DyAv4tBybWU8eOSVP6VhQbuyZJpNiQ7zTFQf906RBz+UDttVV8wIjCroiu+z6oVjacHXcs3GtIbUaSyNWAXFaFePUdma3s1BxrBioQlGDvHPRQChHu5+TAKGBVbYpX3V8k+C7jngjQQJXtue0ZZ8ZYO3qx4BcRSDrQZWRFaoRVKFW1G6I1zMPnFpmQvCrIVY33WLcOvdH5t/1j/qsgy+91WhD+BiH10zP/lVKiekb34sqlyqJmcDd1v+qzlTqzLFp0qaJwQ6KU0V5uL/tCO3niBEbVrxSwBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=sZvU3VGhVcTeYxe4fB6geATT0prKN/x1vEpROhK8pVc=; b=UaBNo8gK6tTDP5DLYNovk91YGtKjgSKlK74fROPoYBiLjI9oCvGkSm5iU26nxRoPpN0r+oliYQBWSDC+xTpvAoL+9MDIhu+qVe0CcL5n1kpGF531/xFcNaxEIuaLLPwcdf84D3oXcRco9yzVMfBmXoxAxVeZ5t2yZ+xANegIlOYjO877jOll4XfH7H8Rk796kNS/AKhpeXwpOn9CVfMKVQdAj4+khqj1qYKg1voJyga6UCGoQyK/34QsIojtolj6LFWsNeAgaxL9oq8SxDdFigwu7nLU7wRzEl25x/VhFiYq0UchdZ/anNlnwTpAGA3AjDgTYP19qa3xfK6tdaBCNw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=sZvU3VGhVcTeYxe4fB6geATT0prKN/x1vEpROhK8pVc=; b=eoMxN3azQXJeyXHMXVDrxy+kM41r7KbT/ZcJugM8aIVU9wsDqToqawLEuXc5UcVMHqb5vOY9p4ja0ZQCGcwKeWy5DNWRlqNnHcJGpzKDMgRNR68on1KYm2DjiaQ7EZVPnv0jIFBplywfrkICZ9S4tp39uVP4lbQ+lWrofgnWFvQ= Authentication-Results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=nxp.com; Received: from VE1PR04MB6638.eurprd04.prod.outlook.com (2603:10a6:803:119::15) by VE1PR04MB6429.eurprd04.prod.outlook.com (2603:10a6:803:11a::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3066.18; Sat, 6 Jun 2020 15:22:08 +0000 Received: from VE1PR04MB6638.eurprd04.prod.outlook.com ([fe80::5cc4:23a5:ca17:da7d]) by VE1PR04MB6638.eurprd04.prod.outlook.com ([fe80::5cc4:23a5:ca17:da7d%6]) with mapi id 15.20.3066.019; Sat, 6 Jun 2020 15:22:08 +0000 From: Robin Gong To: mark.rutland@arm.com, broonie@kernel.org, robh+dt@kernel.org, catalin.marinas@arm.com, vkoul@kernel.org, will.deacon@arm.com, shawnguo@kernel.org, festevam@gmail.com, s.hauer@pengutronix.de, martin.fuzzey@flowbird.group, u.kleine-koenig@pengutronix.de, dan.j.williams@intel.com, matthias.schiffer@ew.tq-group.com Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de, linux-imx@nxp.com, dmaengine@vger.kernel.org Subject: [PATCH v9 RESEND 11/13] dma: imx-sdma: add i.mx6ul compatible name Date: Sun, 7 Jun 2020 07:21:15 +0800 Message-Id: <1591485677-20533-12-git-send-email-yibin.gong@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1591485677-20533-1-git-send-email-yibin.gong@nxp.com> References: <1591485677-20533-1-git-send-email-yibin.gong@nxp.com> X-ClientProxiedBy: SG2PR04CA0184.apcprd04.prod.outlook.com (2603:1096:4:14::22) To VE1PR04MB6638.eurprd04.prod.outlook.com (2603:10a6:803:119::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from robin-OptiPlex-790.ap.freescale.net (119.31.174.66) by SG2PR04CA0184.apcprd04.prod.outlook.com (2603:1096:4:14::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3066.18 via Frontend Transport; Sat, 6 Jun 2020 15:22:03 +0000 X-Mailer: git-send-email 2.7.4 X-Originating-IP: [119.31.174.66] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: ef91cb12-216d-4d18-7c4d-08d80a2d6092 X-MS-TrafficTypeDiagnostic: VE1PR04MB6429: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:632; X-Forefront-PRVS: 04267075BD X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: coMAB8/jnmsVkVdSnzzcvKVc1OCbOXn6XU26vcLwfLiZU5puYTZ0ZCJYrZkPCBu9jRbf5+SqPnz+Lppt5v7v4uYbq3n3ZKPFJnfsU1rlIsWnzKf6dsTB1zkvo0xQSjUeh2PTkgbmP5f6J01VTPNYPGQx9cGTRfwuRqa755giIaz9wFtLZD95/tvXqcdlKiqdmvtl/mJHsdphvRDqr2qIMt+/ztKckTkxrli+TKAV71nssxeyZAt/OPnp6+FtlDKInrkcUhKIBFptxihU6fHE8kHVFKdbrd507sR/ptziRyaBH+ZyLGxeRQqN0O5jHNF6iOps8wH+m/5YB/7194/wmxEw8TKJLUuT8OVlhNLHOuw= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VE1PR04MB6638.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(366004)(346002)(136003)(376002)(396003)(39860400002)(66946007)(52116002)(6512007)(66476007)(66556008)(6506007)(186003)(7416002)(16526019)(26005)(2906002)(86362001)(8936002)(956004)(8676002)(2616005)(6486002)(6666004)(316002)(4326008)(36756003)(4744005)(478600001)(5660300002)(921003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: /+r2qcIlty4GVYgrJ/lgjcT5L7u5L751XDek/bDvzXVQjr5PtkKHmd6IoD+FyU2zSxSPHejPhqKH6+MGiLqEEcB/nFRRKAc2+FXhjYYO26pa7fI9xtFb8fvcwoSgYlMTuNVYU4fYivzXhPgEKDBI2hz9d+5vLdBsOmN48JQHKF8WqCXEtcbjxFmD/MWLs8qzrjg1dH6x5W0dHCVhveqhfwVd1OIrHTj9g66U3fN25ayFXdSY9Szisf4Y3P9JQfWBAdxqoK9UIW9uM8PgeikkgB6KzTdlOlHVOLPUziOehyhESBhwpL39r9xTNCpPUsM993JaPKa2XVkpLZLR7raXO/r8MRmQN2DD+LupNBNIF56LKn0Xy+kOwM+a7SyO8s1IzWJZ9mhVGUU7BfdNv8WlrjAiioCZzJpGbxa9lT9a2rs9+AcFVph0jcY/qLtIIq9roKZF9oWWsBkEb6xdyzoy/mNVf4MV4rosDTZAfI6eh64= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: ef91cb12-216d-4d18-7c4d-08d80a2d6092 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jun 2020 15:22:08.6282 (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-CrossTenant-UserPrincipalName: QOyKZY7kdyqi4aKrDTOws1ihBPiF5JbYTlr3bVJp/7RU3bZyZYUgKzUbDzpP2DurNdjjZ7x3QUgEYPToOpc2Bg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6429 Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org Add i.mx6ul compatible name in binding doc. Signed-off-by: Robin Gong Reviewed-by: Rob Herring --- Documentation/devicetree/bindings/dma/fsl-imx-sdma.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/dma/fsl-imx-sdma.txt b/Documentation/devicetree/bindings/dma/fsl-imx-sdma.txt index c9e9740..12c316f 100644 --- a/Documentation/devicetree/bindings/dma/fsl-imx-sdma.txt +++ b/Documentation/devicetree/bindings/dma/fsl-imx-sdma.txt @@ -9,6 +9,7 @@ Required properties: "fsl,imx53-sdma" "fsl,imx6q-sdma" "fsl,imx7d-sdma" + "fsl,imx6ul-sdma" "fsl,imx8mq-sdma" "fsl,imx8mm-sdma" "fsl,imx8mn-sdma" From patchwork Sat Jun 6 23:21:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Gong X-Patchwork-Id: 214452 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DATE_IN_FUTURE_06_12, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D8C93C433E0 for ; Sat, 6 Jun 2020 15:22:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B857C20810 for ; Sat, 6 Jun 2020 15:22:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="HIigH58n" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728969AbgFFPWT (ORCPT ); Sat, 6 Jun 2020 11:22:19 -0400 Received: from mail-eopbgr80044.outbound.protection.outlook.com ([40.107.8.44]:26597 "EHLO EUR04-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728991AbgFFPWS (ORCPT ); Sat, 6 Jun 2020 11:22:18 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QekgbrYbLEdrq4muIPqoRU0zlLrNXdv4eccDuOV1dd+pRiKBK8/em2fCllKnfmaJWPzLjddT5OUEhmCgPnf7sQdePXucvxhqYAUuTAkGWudcRtky3go8VpoYZkx6ZvIuKzzz/eic4fZ4H+rBjwM0+8eRgrDQUystXOJ3cQ4heLECgjOakmD0z65AeMawMn+wx6m/tzFv/ArSZT9MRyTpZY5kaTXMs3MOdiVmvaGwxdw2AtyFChwoIagiMdcPRldsgydZJ3kmQ45X6SLYgPSi7IhJHdZBi412qxuxtm7xev38j+UfSZbnsVSHTCdAoyF7dUd0U4ParlT5Yk8aAPxMKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mFbDanBWSu2S5nbk4C4ogbtxHYjU/2zcsNJWbhy/sHo=; b=BLS6DVB1DFH9eNZPmcXmL1WxYsobro7guoybRUU0KXar3CMvP5TfPSesiNpTgY9uLxMhE7GC2LR4cgmRnKwz7URii8bVLesFMXK4XiL9bDbt0PpIlOhRtIXm8Tmup18oovTpq6005/+n6WsKI2LzCMZnXXw9o4BbpJD5kKBm7qOQ4Ov6NO6rWBnD0bzrcdK7c/OXxmo2GnXrdLk0I+OY7wHeP9VNa1UxJcqglpLKYOncNt+XZLiggzVRubnl03AkMcySY6q9jQDEo48b1lQPqf99ZJCSHAGznRkziB/2MMUMI25ysIdKBPHjYEQ/CTJo9S6U3vF8uQiebnQcmjX3Mw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mFbDanBWSu2S5nbk4C4ogbtxHYjU/2zcsNJWbhy/sHo=; b=HIigH58nz4aw7muA9t8iK8N15uNQRpmeF1JOyjBu4EvNqI30J8yWLWTtTBRKbRPJm4c2O/iU0sDa+slJXrRSvS6UNZ1go7xkXjgbpSI91qSHs7WDuKtFERXF7/InV/TWhlJBrEsZ5RD7NkQG2wcDUewXpykQvNT5pbY4hwih5b8= Authentication-Results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=nxp.com; Received: from VE1PR04MB6638.eurprd04.prod.outlook.com (2603:10a6:803:119::15) by VE1PR04MB6429.eurprd04.prod.outlook.com (2603:10a6:803:11a::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3066.18; Sat, 6 Jun 2020 15:22:14 +0000 Received: from VE1PR04MB6638.eurprd04.prod.outlook.com ([fe80::5cc4:23a5:ca17:da7d]) by VE1PR04MB6638.eurprd04.prod.outlook.com ([fe80::5cc4:23a5:ca17:da7d%6]) with mapi id 15.20.3066.019; Sat, 6 Jun 2020 15:22:14 +0000 From: Robin Gong To: mark.rutland@arm.com, broonie@kernel.org, robh+dt@kernel.org, catalin.marinas@arm.com, vkoul@kernel.org, will.deacon@arm.com, shawnguo@kernel.org, festevam@gmail.com, s.hauer@pengutronix.de, martin.fuzzey@flowbird.group, u.kleine-koenig@pengutronix.de, dan.j.williams@intel.com, matthias.schiffer@ew.tq-group.com Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de, linux-imx@nxp.com, dmaengine@vger.kernel.org Subject: [PATCH v9 RESEND 12/13] dmaengine: imx-sdma: fix ecspi1 rx dma not work on i.mx8mm Date: Sun, 7 Jun 2020 07:21:16 +0800 Message-Id: <1591485677-20533-13-git-send-email-yibin.gong@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1591485677-20533-1-git-send-email-yibin.gong@nxp.com> References: <1591485677-20533-1-git-send-email-yibin.gong@nxp.com> X-ClientProxiedBy: SG2PR04CA0184.apcprd04.prod.outlook.com (2603:1096:4:14::22) To VE1PR04MB6638.eurprd04.prod.outlook.com (2603:10a6:803:119::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from robin-OptiPlex-790.ap.freescale.net (119.31.174.66) by SG2PR04CA0184.apcprd04.prod.outlook.com (2603:1096:4:14::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3066.18 via Frontend Transport; Sat, 6 Jun 2020 15:22:08 +0000 X-Mailer: git-send-email 2.7.4 X-Originating-IP: [119.31.174.66] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: dff58dcb-e259-4682-9a53-08d80a2d6405 X-MS-TrafficTypeDiagnostic: VE1PR04MB6429: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6790; X-Forefront-PRVS: 04267075BD X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: O0oqycciC1aTCVhke0xezIUwCkxM9/P0bjvSDKaDMACFJm4I0Rcko6Wsa5jNSO+vDE1Zdr4ybIvni9bgw8rLknIlDoH2Ntny8WvL2fjS7gg+BvfZRx/E5qgwF5wGXZX30zxBJlc+jR6+DDz1y+HAtyxuCi+x8zAqzsTV+ToFi5Ht/YpZphJMdsdnrfRqLD57OYn0iImvGP21PM0A1hn5r5RrFa8FMiFrOmTLhtlpLPqKwBFX4uHyakvARlxAVXFOaBoTq7KrKaFq3g2V/EPwsbguNfzIMSHew7+2tlr/Q4fyXM6bZlhTDdvSnBVYvucSrEP3VsM78LBljjSwdnoHS/4lNlPTmx/wCj5Kyp4eEExsjCxUHRax1wL4wbWXkUNJ X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VE1PR04MB6638.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(366004)(346002)(136003)(376002)(396003)(39860400002)(66946007)(52116002)(6512007)(66476007)(66556008)(6506007)(186003)(7416002)(16526019)(26005)(83380400001)(2906002)(86362001)(8936002)(956004)(8676002)(2616005)(6486002)(6666004)(316002)(4326008)(36756003)(478600001)(5660300002)(921003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: Lc7nnBtZG7YaM3Lu5WdKt5UsagLZsOT2CUpLkqR8sBCvn20iGjH/rf4pwqklgvoXN8a0qLkHzbwiTNuVhaAWyt5hUQ5wF4BNpEqvNBpf5vXz6lbXa+iI2fBg2K8rMwnBM/6StyAavdNmMvRS/xhvdKKY97ocyEZmCGFz1iTZw8i54uvYt0AV2ojburjTbfv8Slu1ldcL+LEBFUkNB82YL6ITSxrTmMM6lR36sHjVCTbayDyDJtD+O+nKekkCbAHa4TEayLGZdTMCk03FhK4rnvyh94Jjxsz+hxPXgJfaSyDCVMLCHzaIBk6RFixG4Dm6nJf4hWD67d53fvqjTOx042kQFII0PQA4hL98EVdZJyMvhpQc49L1mExl2bE3jzprm3sXuwZ5BcmI8nm8KBnvsLuQ27TIybpUuWXrvjMt5zaQxVQQ3RyYqEIwsQypvnOEw0HbpRgRDUFa+J6K6uNM7OlfWRlp6jqkRmHXMrM8QxY= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: dff58dcb-e259-4682-9a53-08d80a2d6405 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jun 2020 15:22:14.3308 (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-CrossTenant-UserPrincipalName: Ljn6Zw16HeX1fgLctXU078cOKMmqRHQynulStd6X11zTn5N10Xqjw4Su3xoeDQvz0guKWBjxWQ+tsPRAA/9Q7w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6429 Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org Because the number of ecspi1 rx event on i.mx8mm is 0, the condition check ignore such special case without dma channel enabled, which caused ecspi1 rx works failed. Actually, no need to check event_id0/event_id1 and replace checking 'event_id1' with 'DMA_DEV_TO_DEV', so that configure event_id1 only in case DEV_TO_DEV. Signed-off-by: Robin Gong Acked-by: Vinod Koul --- drivers/dma/imx-sdma.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c index be86ae8..320104f 100644 --- a/drivers/dma/imx-sdma.c +++ b/drivers/dma/imx-sdma.c @@ -1183,7 +1183,7 @@ static int sdma_config_channel(struct dma_chan *chan) if ((sdmac->peripheral_type != IMX_DMATYPE_MEMORY) && (sdmac->peripheral_type != IMX_DMATYPE_DSP)) { /* Handle multiple event channels differently */ - if (sdmac->event_id1) { + if (sdmac->direction == DMA_DEV_TO_DEV) { if (sdmac->peripheral_type == IMX_DMATYPE_ASRC_SP || sdmac->peripheral_type == IMX_DMATYPE_ASRC) sdma_set_watermarklevel_for_p2p(sdmac); @@ -1351,9 +1351,9 @@ static void sdma_free_chan_resources(struct dma_chan *chan) sdma_channel_synchronize(chan); - if (sdmac->event_id0 >= 0) - sdma_event_disable(sdmac, sdmac->event_id0); - if (sdmac->event_id1) + sdma_event_disable(sdmac, sdmac->event_id0); + + if (sdmac->direction == DMA_DEV_TO_DEV) sdma_event_disable(sdmac, sdmac->event_id1); sdmac->event_id0 = 0; @@ -1651,13 +1651,11 @@ static int sdma_config(struct dma_chan *chan, memcpy(&sdmac->slave_config, dmaengine_cfg, sizeof(*dmaengine_cfg)); /* Set ENBLn earlier to make sure dma request triggered after that */ - if (sdmac->event_id0 >= 0) { - if (sdmac->event_id0 >= sdmac->sdma->drvdata->num_events) - return -EINVAL; - sdma_event_enable(sdmac, sdmac->event_id0); - } + if (sdmac->event_id0 >= sdmac->sdma->drvdata->num_events) + return -EINVAL; + sdma_event_enable(sdmac, sdmac->event_id0); - if (sdmac->event_id1) { + if (sdmac->direction == DMA_DEV_TO_DEV) { if (sdmac->event_id1 >= sdmac->sdma->drvdata->num_events) return -EINVAL; sdma_event_enable(sdmac, sdmac->event_id1);