From patchwork Wed Jul 14 10:20:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Gong X-Patchwork-Id: 477220 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=-16.8 required=3.0 tests=BAYES_00, DATE_IN_FUTURE_06_12,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, 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 445E7C07E96 for ; Wed, 14 Jul 2021 02:04:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 280E4613AB for ; Wed, 14 Jul 2021 02:04:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237416AbhGNCH0 (ORCPT ); Tue, 13 Jul 2021 22:07:26 -0400 Received: from mail-eopbgr60083.outbound.protection.outlook.com ([40.107.6.83]:46992 "EHLO EUR04-DB3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S237379AbhGNCHZ (ORCPT ); Tue, 13 Jul 2021 22:07:25 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DLIPhJuBF+4SSEZXRVXTpR4sJZkbNXiDAjIBdyojPwX0SQDK2gLcJbZRrLOwvoRBF8+8+wA1xhAkiMmh4nIj5th1qHEFUjrZSoM+RxN/HXKyqdqNfxjqfZDUu8h9IEwT+tmoNBs2KKtpkFLgsyOvQEH1Cc/gJ/oVFPAsiz/AbysvI7OIvOUGQfIeYrer0gfZ9GSvSTwlZgeJGs3cZhb3CiRszeYWEecT4/Dr5lir3iOkciAe4Rti1I7TnBmva2crp7nU9En7sdiaMWjAAUpMOJLGrNUWQ0PZg6NRqpzktMdYT/FcfxFgREhzwffnEEQgUuC1IA0rEpYHsYCJgcPNYg== 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=QJ72kGobutbcDxLx+bWS8PzUgxHjzbso6I9Vt7rhhAY=; b=JI5eMoe5pwpWMhwXt2rY/yyoDX6kr3X9tQGM05GskFUDXchHCnc7W0BwAYWJ4KwzlCf0NBORS8k6tBsJ7qIuHvysh8LmG2t899v4J4Kz4dvbNBC2Bg4T1c21m4UJXdDuG+kE15MmaaDVhWktoH3Q9x2WERCS6fa8/zdTwB0MKeN4JIBMLIP+yirqghjbvH/va7V5ahfpLJkxG9Wbacn1vqoeDz9oLrr3EC5hbN2LAR5nR1OhpRg65nKzvkAk0QqYGIyCzt/MGQYctTUW2Yd9jz9QtvHwwG3ftR5GjniMxYmV37KglBtKwbOOoE9wBQYi+M8GhTn2EkccJ8d7rJkbew== 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=QJ72kGobutbcDxLx+bWS8PzUgxHjzbso6I9Vt7rhhAY=; b=E67z2GYD5ITcuV7WCAtN7a3PnMIae8We2cuZvZb5jwMqQqWoXoCbsmMzf6+zur7oRfLNy0LifpDSDLFocVsI6bY0OBKSgUZrkJDlfXjWankvwQ7Eqq1IsrTZMau3ZUPcZ5NioyY1s3rR4Rd5MUPRm0WvtchsUtZzAsm1DZyxhpE= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none; kernel.org; dmarc=none action=none header.from=nxp.com; Received: from VE1PR04MB6688.eurprd04.prod.outlook.com (2603:10a6:803:127::25) by VI1PR04MB4175.eurprd04.prod.outlook.com (2603:10a6:803:40::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4308.22; Wed, 14 Jul 2021 02:04:33 +0000 Received: from VE1PR04MB6688.eurprd04.prod.outlook.com ([fe80::a978:6f38:2bce:9076]) by VE1PR04MB6688.eurprd04.prod.outlook.com ([fe80::a978:6f38:2bce:9076%5]) with mapi id 15.20.4331.021; Wed, 14 Jul 2021 02:04:33 +0000 From: Robin Gong To: vkoul@kernel.org, mark.rutland@arm.com, broonie@kernel.org, robh+dt@kernel.org, catalin.marinas@arm.com, 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, frieder.schrempf@kontron.de, m.felsch@pengutronix.de, l.stach@pengutronix.de, xiaoning.wang@nxp.com Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org, linux-imx@nxp.com, kernel@pengutronix.de, dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v16 01/12] Revert "ARM: dts: imx6q: Use correct SDMA script for SPI5 core" Date: Wed, 14 Jul 2021 18:20:41 +0800 Message-Id: <1626258052-22198-2-git-send-email-yibin.gong@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1626258052-22198-1-git-send-email-yibin.gong@nxp.com> References: <1626258052-22198-1-git-send-email-yibin.gong@nxp.com> X-ClientProxiedBy: SG2PR02CA0016.apcprd02.prod.outlook.com (2603:1096:3:17::28) To VE1PR04MB6688.eurprd04.prod.outlook.com (2603:10a6:803:127::25) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from robin-OptiPlex-790.ap.freescale.net (119.31.174.66) by SG2PR02CA0016.apcprd02.prod.outlook.com (2603:1096:3:17::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.4331.21 via Frontend Transport; Wed, 14 Jul 2021 02:04:26 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 37fdf83c-a0b9-42e5-cf7c-08d9466bb8c0 X-MS-TrafficTypeDiagnostic: VI1PR04MB4175: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:660; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: pnkJ5qOHuQraGkO+kP3zjYkfgv3zY3Z/T0IOI4sfShcHAmAOfTbowFi0qKvaAN2MW+KJ7lO1kirSmV83bHDgy2Vz+N39g04ZGHxyN/dR/xM/YpKcX5NmtJmIpgV6duyvSGk8zXJ48T0QxL+3TvW9nrgbD20gnno5nT2jmslUNQGQSvIozShlLAbFu9B9rcr3VztFJEBWI92BGJdRfJibL38JH5uYS1vGT06NqFDLYJA2AJSvhZHXQpjdEPASi74pMI2lOkLe0icOX7h0Oyhbyk8cow/Q2Qwfu2UfE0zSxtI0kOFykmna039RUTAvIlzpcdxektYeKFznOuk8+XjjqT0oRIYgwWMP92zJzwT9pUiRAUkSoS76NIEDsP1PUBHUiJwneO//xx/OnYGzI86nqks3b+RNimIOlC+Y1RIcIzxxzi6EMSPsDRqBZPtA70czsnZbuRp9dNl+9TgNW5X99no/NncRsFuZsgFg5F8qObZzvwz2yymUJ9YbPUnwGrTGknc9ERpuYNc/6U9Qrl3YGdmsi+S6DW0UgUmagaDn8wQLWSvWG7WOwI1793ABGuppjmb/WvdeoXHfw/dMram0aZkcYFuB6WQ/taSxauNbSYRO6US9Ck6JEGQeBxW68f3/SEuIaTbgvKJPa0xi8dnNhz8rQI9g+2STB2wNKEWTA+YVuc4peWSxTGQn5f+ZJeplTRy8w/DhWPDVYN2GBKUWMW6ISzeFrgu467fve2HhL+uAAK1UTKUiWwyXlgbwFaQXr02c3ZV+qNeyPzzs5QXXBRL7qE5C8C8LgMLUQQjwCieC3fThVeiTSMJiWIYOReOrcaAK3J/r0KbSdFeRUjSYlg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VE1PR04MB6688.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(396003)(136003)(39860400002)(376002)(346002)(8936002)(7416002)(6512007)(2906002)(921005)(6636002)(6666004)(83380400001)(6506007)(86362001)(26005)(36756003)(4326008)(66476007)(478600001)(66556008)(956004)(52116002)(6486002)(8676002)(38350700002)(38100700002)(186003)(5660300002)(2616005)(316002)(66946007)(32563001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: jT5eXizo75RlpKQu9OjBhKxVGcZ6yQYMNymDtdL5XvDugASnv+pc/bO3DCKCvCmzd60SrF1udLjRzmJIbyN3s9U5fYMyGAlFFwjFLn70BN0HYJ7YbGGbkrRDlNOMCSyvXcGxSzCQMrgwozoCitJ88jAKdWwRzK6D3lBM/BrdPeFyx770d9YTWypW2a3CybH6JEh3e2kWSu28D7kR1ll5C7Ym17bo8f70IChF4edVBWSiZwOn8615Jl2P10OxEi67YrhnfuLLczOCdJyfxETsJY3SCbzSqz30YToioiWY1R1etr+zzdeVIQX0bArGdNSs2sWgz0BVw2GGelHlOhMQGsI5eevAE0vnE3ERYDnTntnqZuv5Cjh3xh6uiSUgaYuO/hI8qrEsqPCk+syNok540guLYsWE2MkB2oJkMKxoiUJbGmkbA2Y0gVSpjKMLibNkAo0gkq6s3oqICFcXke3d6VsL5bQ4AwtPVIklODVbHz82BtaXfyBg0+lT1OLJ2MSahdNi9jVoKXDQcMHSfxA1x/6zIJjQX6BctD1+Sl8u++ouj8aK7OCKRB1CV+JqwQYzorvZDtMQItrx3dkgMNP5j0PI3ZLmgQf2TEq0i4y1wYhg0ZLcf3qLTBn93OzarUU/vhhkcYW/3taI8mGlqwUuLMfIUlHNd18Cu79k+RBW3YR2m1sC67c/Ie6Q9HaLckH9iHZLdOB1381F7rT52ZilCS7K3IanvkC0RovMSICvRFFDKAnL/r9h/p0jkMAUqCeDRZzzvgG1wttYEqGgCSqQlewjx46/6OthyTnRLC6MNugiMfGTyU701aeXPsBQLjPIrpexpogryfsmdPq+F89h3KDxfkfF4E4PJ4Gce4gJSkBoLBD7dRKGaDr99hUBeTn5wiGKM7py2y17QIUI4110469uwPajqawQAcgrQgd8HJRVIINxGRBUoTo2HNQmu+wHDeeqcVqnylvbtoOa3DGhUmbUd/uaSEbaC0379uPPlvJ4k41Mbtoh62Qh2fLoYGUUtVG2+0ZSDeMT6y3URqF2ONi6/gReGIUhRhp0ljFO9/01EHqPhiI5JlACno67XL0uJ7hnrvFrhlZKSIm5yw6aE/+lYxOQgHHQiOAPS18AQn98iZ5xNe0bzHTzxkMQvBUuL0Evi4Hudw/AGCWsckJN+GIA6l6t6gRhpNpkkZBh16gesr4f+iCaRVMbpWof1OMwr7XHXhyH1zlliDluBknpp+V/F7A3KZ/2MKyazM6CvNXjLBIUab1cldLpgR51ZyyJmznfWeBP//BTpi4W8ZgpLPRpv4CU+xlbPJmMYibWLicUf98PrWuKNlPT/rheLAio X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 37fdf83c-a0b9-42e5-cf7c-08d9466bb8c0 X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6688.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jul 2021 02:04:32.9092 (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: SY/aYvTHSPOAwQejCR4g000nMlL6AziIwP/oc64A8RVFwToagHoSGh0FIiQAp/Ua9JySVYxTpMeLpfMz73m3uA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB4175 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 8d209c1..9caba45 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 Wed Jul 14 10:20:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Gong X-Patchwork-Id: 477219 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=-16.8 required=3.0 tests=BAYES_00, DATE_IN_FUTURE_06_12,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, 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 423CBC11F67 for ; Wed, 14 Jul 2021 02:04:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2A7AD61380 for ; Wed, 14 Jul 2021 02:04:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237454AbhGNCHj (ORCPT ); Tue, 13 Jul 2021 22:07:39 -0400 Received: from mail-eopbgr60044.outbound.protection.outlook.com ([40.107.6.44]:55091 "EHLO EUR04-DB3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S237441AbhGNCHj (ORCPT ); Tue, 13 Jul 2021 22:07:39 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=i9P4tlJETYWIyaGWVFUas/uM9sae3eAqh45fO4WqpyVR2Z0L02iuqd9T5IvBnZ5xXdzCSy1HM5VGA3nETsn3gT4FrfLcArpf548nXz/dYWRrg+HE4rnkuCH8ifFGuMyIM5V8SQSb3dGBERggELeVgBMJho8TaBeQlpRQgXd3a9dYq4K5N1rmYCHyP7pc+CKlncGke3eglEJ2je5EgLrNBWzbmyZuu4rE52XJjC5ps3cW3w+Wl8JFOlYEj5cwrKPBDWocqavuXKJdkWtlCBmP7ApJmhmOLy4BI4kkzg78aLn1v8oLTjOpnyRbGo8LSke2Gc1RAiuTDk7xBWDJ/nrpZw== 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=O26POmsGphSxwJgUL6Oe/jseTLhWb+pnxNqyrwdqNaU=; b=Py/moBDAO3I2rA3E4SpLv23EaNddJ8LJ+V5XzVMIkUtXYPDPUJnvX6Be1wltyBJf5ZBagsyJrfWNnsKx8J5DzqU0xcaMPpaNaKe+A0gOn4//mTDSHkIKLKeI6OuF28CVFrvVi4uYlpwL6p7weHas7SMUyOxIxEhvXRRKNNp8IOugBE7ZIr5GbvfX/ZbPu8HWH+oOokMhOG0lwpcWiWk6YDVBgmaWFvCh/CswxcYvJpaioywex/NJV0FTneeFiBShaIlL2vzXXh5yKHOw/pcU0xdEqCYJV0jNCRgeB0R5zengHf8DcT00vS/Wyr4wdDMAXy7oWiyeErh1r/5ofAp2tA== 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=O26POmsGphSxwJgUL6Oe/jseTLhWb+pnxNqyrwdqNaU=; b=RPuNfkWHvBpOIuoMJDEIqNQUX2GZr9XCQNBn17AhQHybgTHBexvE9q1H4eBdL9/Umlwx92khXNmSryS/plY/Yex5USVp89Dgf+ofs0MkAxwJBRZ7czvdlgsz9bG7/wseC/kNpJlcUf9Lc0kVSMSp0dfR2OiNbXhLglvBqnI7WC0= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none; kernel.org; dmarc=none action=none header.from=nxp.com; Received: from VE1PR04MB6688.eurprd04.prod.outlook.com (2603:10a6:803:127::25) by VI1PR04MB4175.eurprd04.prod.outlook.com (2603:10a6:803:40::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4308.22; Wed, 14 Jul 2021 02:04:46 +0000 Received: from VE1PR04MB6688.eurprd04.prod.outlook.com ([fe80::a978:6f38:2bce:9076]) by VE1PR04MB6688.eurprd04.prod.outlook.com ([fe80::a978:6f38:2bce:9076%5]) with mapi id 15.20.4331.021; Wed, 14 Jul 2021 02:04:46 +0000 From: Robin Gong To: vkoul@kernel.org, mark.rutland@arm.com, broonie@kernel.org, robh+dt@kernel.org, catalin.marinas@arm.com, 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, frieder.schrempf@kontron.de, m.felsch@pengutronix.de, l.stach@pengutronix.de, xiaoning.wang@nxp.com Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org, linux-imx@nxp.com, kernel@pengutronix.de, dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v16 03/12] Revert "dmaengine: imx-sdma: refine to load context only once" Date: Wed, 14 Jul 2021 18:20:43 +0800 Message-Id: <1626258052-22198-4-git-send-email-yibin.gong@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1626258052-22198-1-git-send-email-yibin.gong@nxp.com> References: <1626258052-22198-1-git-send-email-yibin.gong@nxp.com> X-ClientProxiedBy: SG2PR02CA0016.apcprd02.prod.outlook.com (2603:1096:3:17::28) To VE1PR04MB6688.eurprd04.prod.outlook.com (2603:10a6:803:127::25) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from robin-OptiPlex-790.ap.freescale.net (119.31.174.66) by SG2PR02CA0016.apcprd02.prod.outlook.com (2603:1096:3:17::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.4331.21 via Frontend Transport; Wed, 14 Jul 2021 02:04:40 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 833ae4e0-22c1-4c4d-55f3-08d9466bc11b X-MS-TrafficTypeDiagnostic: VI1PR04MB4175: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:132; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: sYZQbLXg1pLYGWGpzTN/xW9R6t3keS7vWHeXseghPtd7OQOwvAivnd4mYjoPFy25VT3tzXYgBcbiDYsqE2pZupi4Ymh3BevI8sGeQr3JOkS1Zx6FbB4A3kL3A+RwQyTZk8ShoNRFa6yGHG6eMsuWS6TYijK++5VQXjoP4wZ2bD2N2NDP8Z51qaviFibMM6cgGkDVTTHa+7l70wflk3wNgWeIeUmnDFA6Ivwq9WnQnqB+dT7dKOr22rX5v6qSkcxTCw0dh9HkBAKMl0iLSYg5ttHmcYRqQ7x8fGYu3In0iJgEA1fccoO9eueyWwhO2n0RHbarLYuXHHIcocMEnwCgcFJJPtJac4Y5pQ3f+bC7PT9dRivwA8TOBH8NWc9WD3076v9RYE0JMQ91clJI7pP+aSYxZJr30aAlFu5AecGiDu3bmnbnNzG13sguvxE+p393wzcY1tdUaUrf6eDrblFXn1N0OqgpgQFGphCOuWlX5fjFFJLqilARowWM6mngGymrB6eDO6/Sf7FKtDAQxfYCWWKvBY19/xionGqdsJaN4aEgWjaBF7Xu6w2wX5KPvpWrpaxPu6xwq7UMHV0DVuIlBU3//g8mz0F5SVDTyB+ms6fEsLcmdogPZWF9sbwxvUQsA5CdyE50CfDZShmZ/dhjtgPJJll3VmJh7A/2eRLb/wEKZYTzbzCpu+0tj1tVpksvgIIdf/adiAhE7JH1Xi5qCglEySxA/ArrUXTPIVfqN4g= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VE1PR04MB6688.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(396003)(136003)(39860400002)(376002)(346002)(8936002)(7416002)(6512007)(2906002)(921005)(6636002)(83380400001)(6506007)(86362001)(26005)(36756003)(4326008)(66476007)(478600001)(66556008)(956004)(52116002)(6486002)(8676002)(38350700002)(38100700002)(186003)(5660300002)(2616005)(316002)(66946007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: XstRq1XgUyIKIcOgQYKraCIeQ2UVyfH0fVyefOGv8avl2LldXOc2nqt55m/5J1BZlfPFdOIqxUcjSkMaGOsC/VcG7uhRZmcYUan3XzCM3+f4BclxZZY+XVvIcrh/l8kQDwMn4/FM+eatrW4e5tOcPPRyymbLZOWqj6ObNTXjeGD1IGCZDHrBiiXswLQULag4JzA7RSkrQZC1Sh6/NJ1vmXuS9+Ie2zTFmpPZIY7fiEiTDJcxNEPiseoQEPlWhoFXsjuGDOsWUr6x0SzciSZJp9GrhpfheslcRaAffqqdR1IVhZ2Lg26Y28Kk6Yf6VKnyiEUk8u+lkYyIjaMgnP0g1mYhUGd3uZnYrv/I+TLkVwYk1pc/udhKxIEmXgKE2/KMUMv1/3YFEXPKiW57px7lqINA3mtmJzoYMPxlYOhIt94xEJUnxZfXEGlaEbA0SopODeNJhOAVP7NcrSI9ctxONaamIl+ZdySOGEUC4sDcPexYq6z0qIfiSnCFRe5RFR/gHSodKxAggpFdJ1ul1qxeT9D9AABMSlAq9MQHiTpr3uvIzuzWmWv9pa3Hj7v5p6F2BewBXsJ1Smpt2uM0Rq4JOWPfnvQG/ehTuq5bxf5x+5oRyVGxpckdHEDCqHSdrqGuWcO1w/QK+bwkAOfj80w6xsOBdlqSoE/mkexd1/KpHcSBUsfjkfG9rVp91vSN2VHG1emZfk5bmu6wz2W/YEVwjoUa6aSl7555crt3fCHY1sWcNLkf2JfUDaolV7YxXkwn0ITZzPkBwpzdd4FulNz7cjUPDsRpcPhXO/EMiQ6xHgConnNvOpy88HTB0AA64iHFeo6NOvpt8mnCMo4T9xR1Bq1/n+NEsqGJJmNlKnWye+6Y+6gj71HPZGg1Lgu8hUWMLGEgaASjGKkOwSAZPorpzcCfDzi0JRvAbskkM3jkK8grknf623QehH69Sd+nhVcWqsGj8KR8vpm/knfgk/hG4PMTDLaQHdp/RW7DJs0Eye9ZJ53Jxk0bAfBn4aBIr9BFEaCTdoBe1Ev62Oh4uaTbgn2wLy/cnLkdL3s32PnI685I7Lr6HZZVsTqBr4PsOQx9hDkq0ZSzzUObI80c0K3vqIP7NcnzyEvUSlhkb7WmXnqHjdBAapRSB2rqNMv1V5pyGpeZvOJIYbvUhV7tGDVVuAxGMGTmDO15AMLaoyQu0YmaeYInTjqw46cdP0fCePgi9Nbo710Xbo2ACQX+p+lBLVS/+3ARVUvmG3hWwID9qPsSnQba23gfOFoGKN3QwIUwQbUk3CQ5qdb4Gi9MnQxGg1GptB/lSBzMbZnHwIO2iq6igNgQTnJPAvieAodQOW8U X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 833ae4e0-22c1-4c4d-55f3-08d9466bc11b X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6688.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jul 2021 02:04:46.7353 (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: cwP9sr/mIEZrLjRUy/LxOQZse+GDDd8ahiXli7SOa7s7wvLoxKEMr8QqiQZFVvBqh0hYlv9EocQSDWupeFHxOQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB4175 Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org This reverts commit ad0d92d7ba6aecbe2705907c38ff8d8be4da1e9c, because in spi-imx case, burst length may be changed dynamically. Fixes: ad0d92d7ba6a ("dmaengine: imx-sdma: refine to load context only once") Cc: Signed-off-by: Robin Gong Acked-by: Sascha Hauer Tested-by: Richard Leitner --- drivers/dma/imx-sdma.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c index 8070fd6..e510df0 100644 --- a/drivers/dma/imx-sdma.c +++ b/drivers/dma/imx-sdma.c @@ -433,7 +433,6 @@ struct sdma_channel { unsigned long watermark_level; u32 shp_addr, per_addr; enum dma_status status; - bool context_loaded; struct imx_dma_data data; struct work_struct terminate_worker; }; @@ -1008,9 +1007,6 @@ static int sdma_load_context(struct sdma_channel *sdmac) int ret; unsigned long flags; - if (sdmac->context_loaded) - return 0; - if (sdmac->direction == DMA_DEV_TO_MEM) load_address = sdmac->pc_from_device; else if (sdmac->direction == DMA_DEV_TO_DEV) @@ -1053,8 +1049,6 @@ static int sdma_load_context(struct sdma_channel *sdmac) spin_unlock_irqrestore(&sdma->channel_0_lock, flags); - sdmac->context_loaded = true; - return ret; } @@ -1093,7 +1087,6 @@ static void sdma_channel_terminate_work(struct work_struct *work) vchan_get_all_descriptors(&sdmac->vc, &head); spin_unlock_irqrestore(&sdmac->vc.lock, flags); vchan_dma_desc_free_list(&sdmac->vc, &head); - sdmac->context_loaded = false; } static int sdma_terminate_all(struct dma_chan *chan) @@ -1361,7 +1354,6 @@ static void sdma_free_chan_resources(struct dma_chan *chan) sdmac->event_id0 = 0; sdmac->event_id1 = 0; - sdmac->context_loaded = false; sdma_set_channel_priority(sdmac, 0); From patchwork Wed Jul 14 10:20:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Gong X-Patchwork-Id: 477218 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=-16.8 required=3.0 tests=BAYES_00, DATE_IN_FUTURE_06_12,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham 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 2308AC07E95 for ; Wed, 14 Jul 2021 02:05:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0DA0C613AB for ; Wed, 14 Jul 2021 02:05:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237415AbhGNCH4 (ORCPT ); Tue, 13 Jul 2021 22:07:56 -0400 Received: from mail-eopbgr60072.outbound.protection.outlook.com ([40.107.6.72]:6252 "EHLO EUR04-DB3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S237428AbhGNCHx (ORCPT ); Tue, 13 Jul 2021 22:07:53 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=k+BZ/ZMlEAsYyr4kQcUsATuzdLruiTfTvvcN85+0Cozwozy7dK5siKkSUtTORN8/1J3lwTnRBiWob+ROpmJ3i0PVSyouXIdLB1PUSLYq6yrnQjHYwcWarAXtiYMvqjJqjW/HXaPDheP0ZICVRMpM3LTjFitZqs/zYhgLy+o8kzflBtFX842LvAfZPH1oDUo5g1B0D4nCeyyyINz1yeQYZDD3m9STekbWRowQ1M2bA6nC5r3zSIYxmb7CCjDHTKtX+ftr7IDjUY6IEc1RgoqbBSNia99CxV5d3tB6/CXVHCFYpPtZ9HvLVPvme/Ivd/M4JiXcwDatJN1t3vnvu8R4IQ== 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=L+wNYSXkpgwjMDrrP/9fWqjfNAb2CmAVUWdGJvYPzQQ=; b=h6cDmDm5tdosekmCIjiKnnPPYa4VfoswWKJYYp6Meak/QOByV9BT/9lNI92U0ORXWVpid/LEd6muXogTdOCJ/epssKiFRmtC1AFKZtqFnqFYtrYyJyIQkL+myeya1xDFTdluu5Ob9xQYlhtYuRBSaR4V8qaUXJyd+DXoLK4zo+epQTYBwNGar5xzETEv1lWUDNhGj9sm8xip5VZo9SLx3DGPo6mN31hT6DaDrBoKsH3Idf4C6xGUmZRz07YYx6Q9NQ4GeQVTrQjYMA5sTcoAwgfTbRnML1wlwxbOnnLj9Ss5ROOcs8psr5YFcsEojrSEKl3nZB9iyxze/y/WZB6ECQ== 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=L+wNYSXkpgwjMDrrP/9fWqjfNAb2CmAVUWdGJvYPzQQ=; b=HheEpRqOLpFr8U6zXTr25mmhcOHt4KgOsEe9/JRxS0apx3SO0XGpoAwgZWzZCB3TD/hU+Nd2RHADYElbQRL5eHHWaULhohadZUN+iYKHLyaTh9+ndC0bZKrGosaIwV7hG4eEFajBYdHvR96t8fv6ZUlWX2Yf+i6+fu7E8eZtMxs= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none; kernel.org; dmarc=none action=none header.from=nxp.com; Received: from VE1PR04MB6688.eurprd04.prod.outlook.com (2603:10a6:803:127::25) by VI1PR04MB4175.eurprd04.prod.outlook.com (2603:10a6:803:40::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4308.22; Wed, 14 Jul 2021 02:05:00 +0000 Received: from VE1PR04MB6688.eurprd04.prod.outlook.com ([fe80::a978:6f38:2bce:9076]) by VE1PR04MB6688.eurprd04.prod.outlook.com ([fe80::a978:6f38:2bce:9076%5]) with mapi id 15.20.4331.021; Wed, 14 Jul 2021 02:05:00 +0000 From: Robin Gong To: vkoul@kernel.org, mark.rutland@arm.com, broonie@kernel.org, robh+dt@kernel.org, catalin.marinas@arm.com, 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, frieder.schrempf@kontron.de, m.felsch@pengutronix.de, l.stach@pengutronix.de, xiaoning.wang@nxp.com Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org, linux-imx@nxp.com, kernel@pengutronix.de, dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v16 05/12] dmaengine: dma: imx-sdma: add fw_loaded and is_ram_script Date: Wed, 14 Jul 2021 18:20:45 +0800 Message-Id: <1626258052-22198-6-git-send-email-yibin.gong@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1626258052-22198-1-git-send-email-yibin.gong@nxp.com> References: <1626258052-22198-1-git-send-email-yibin.gong@nxp.com> X-ClientProxiedBy: SG2PR02CA0016.apcprd02.prod.outlook.com (2603:1096:3:17::28) To VE1PR04MB6688.eurprd04.prod.outlook.com (2603:10a6:803:127::25) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from robin-OptiPlex-790.ap.freescale.net (119.31.174.66) by SG2PR02CA0016.apcprd02.prod.outlook.com (2603:1096:3:17::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.4331.21 via Frontend Transport; Wed, 14 Jul 2021 02:04:54 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 60c91c20-3fa8-4783-c999-08d9466bc949 X-MS-TrafficTypeDiagnostic: VI1PR04MB4175: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7219; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: dZqRkSR2sejJWzwzJvktPfvOBV27KCbwjIzKM53e4x+vMlL8SZAhmRZ9UtGO/Tt3Ea+afNqRC8u8sTATAAY6RYqW9Vk4mKy7FxR8e4Zr+/6p0ZVUMFG2RdvxZHG0ySWTMm7Q72BAAl+JBTB0RsH8AHrMBW+KkHRgC+a4scQnMF+qFoZZcSdGLUEivOI4VGcCBsS6qJtDeRWn+155q7rRym0WhBk/K6cFkJKuFbY2Wv7VmjzW+5hhQC7S63HwledMgIJbKRcITYIKrNl6nAtF05uyXdtWPFvH3Ucx/Nymw1oIUvz4J7N6mv+jmEVvuVjvwmZY22xlhBCPcit8i5ybMtbhkfzk9yuKpi7XGuM45Oedyar6730wY6DN+vn3tgJoapA/Rv/Pd69Yq2++MvOvHJk4IU1mFdSpp/utdVcl+g9eAOUoTPsBp7y6s0bhhQQs7ZaxvoNHXakrpsgmXd/geCXDgx48+0VNh/9l46zsv8s+nrEBgIiN6E7b7rx3t/v/+AXu7dLUCdvP2VPAfxsIU2/PzqmO2Q3fZYo5Ni5fAIq1R5eOxl2Ag05YL9Pz16yTzHXr+DAomm4Pf3xsAbSmdiASYrRj1460SH+pSbgNJfkz1My76jKTCZD5T9L6D6pgXpeQ7Q1i3GbFiNV3pUthnHdaWVvkgRtr4KdVCZ96y/oJkrnSEOiCg5/zI5bCN9uWdHdVLVEs620RxsBqDrL0EI3E8p/ZuH0S7/tNR3c1dso= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VE1PR04MB6688.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(396003)(136003)(39860400002)(376002)(346002)(8936002)(7416002)(6512007)(2906002)(921005)(6636002)(6666004)(83380400001)(6506007)(86362001)(26005)(36756003)(4326008)(66476007)(478600001)(66556008)(956004)(52116002)(6486002)(8676002)(38350700002)(38100700002)(186003)(5660300002)(2616005)(316002)(66946007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: U820x/kAKbbma9XOIy1HoN9k4gE833G8enmUldlf8xSJBbzYFlv6N/n5ugkPab0mxv+AJ/Vwdzm9lMbwwe+e4oM5ncGNKIvZMavwlM10jb+oanWbVahaPWHsnWCSJntNwiE3ndnKACOk3LIz5Qz7VwK1TwQxdmhbDS5/5uWYPcBfzZ/XbAQ4NAsBJK3TFbJ+7xjRLz1U0M9U9SdG28f0q7ZVThEfd5BpU3gPmo9kzEtlLVuy89PzompJ18ZV822PZMpwhv8+qOHLG7xJlY8wc/sFgQKNpW0bPTkpnF/TiIk/f79JU0EjeGzvBfzgOFtjHMSHmTIBJMt29KBr/bn92kWZdnq7WZ1USkJBBcOBBDG206Uisl24yh+EKYah/GlTSnPjXXFChrjerU/BbW7rjntv7uK/mwXpS6VocYU+x2/zl3QqLaf1ZgvYBOKC6F/F1LcIyUSYglLfMgl+4WeoseB2D2AhG8HFzWnpY+g1rEV/+njPo3iieGBHmhB/GfQ5S0Y00E+ZE4xmO1msOf/7aW7sk6milmz8ToUnCNRXJe70XnHYhInvqeiPwSfcmORdjeufVUChD+8Bwjyi6Gn+1pkRk3/bHjj9+IBSUbe9AsRMK/XzfLO3+K4KXvcBRdYCK8lsj6WgUp0PdQkYpRYW8TQmn0A1VF/w4kkPJ1OhK9WGJIa51UDZ4NhgpBjbiJe1hwIE9+RFwLUAaVEK+iQUUiByWbjodLZmCd6mQ2SvA3dk58jgMTu57URZ2D+A3OBJaxWJCJ881hvIJBtv6/bQqeV4TS0XlKruIWA954Y5EK9hyAdEY20fGV7XnClPe+E8R/vPvcN/By/8BXUVO5bNP8wHjfzoN2k6B49SmrdPAHv3LKsJ16E892Ig8APRw4LqoO38olxGh4wAwFeBNnrUHmmkK2CG9lQO7RmrJTlecVEE+TpQOevUpjwJDF81tS7c6ELnx7yEElIF4rSAYSEkC5Dna43kPqr5PepNydVemco+o6QAzIs7FckXqr0AYrQntFWVDkE8UaJgmqz3MFvNa2nY6e/FKuihGwiRE0P/wm35Y3qQRJNyQUP5akHmRl4k/lP9G3JZaEq4OvEJacZ/s/QqONxypLvUXVLPx45abYsef2HvB5teA/MmG6qUlP5kDSDswCajXyYB9TJzAkUHixyilFTHHKkiHpOsY6AxvF/33kIglUpenmadSmTjrIHKOaTOrDQtF820wl81PM+DxZlJzU12zOTKZGdjwryMHSw9FeMkL4PFE3UIqU8Uhzfsz2HPbvM/ZYieObt4CdxCMUQwRmPr0YJoRA6OYK6BgERU+CNx0AeTH+eN15XpnyIv X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 60c91c20-3fa8-4783-c999-08d9466bc949 X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6688.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jul 2021 02:05:00.7054 (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: sP4wnIGZ1cbAhB0Z9UwQXEJR9Kmj4tBSe0JXKjN3bcLPi43tTBigmeTMfLzegyEZP3SUVTsyqKKvhDVFD3dqCQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB4175 Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org Add 'fw_loaded' and 'is_ram_script' to check if the script used by channel is ram script and it's loaded or not, so that could prevent meaningless following malloc dma descriptor and bd allocate in sdma_transfer_init(), otherwise memory may be consumed out potentially without free in case that spi fallback into pio while dma transfer failed by sdma firmware not ready(next ERR009165 patch depends on sdma RAM scripts/firmware). Signed-off-by: Robin Gong Acked-by: Vinod Koul Reviewed-by: Lucas Stach --- drivers/dma/imx-sdma.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c index 665ccbf..d366198 100644 --- a/drivers/dma/imx-sdma.c +++ b/drivers/dma/imx-sdma.c @@ -435,6 +435,7 @@ struct sdma_channel { enum dma_status status; struct imx_dma_data data; struct work_struct terminate_worker; + bool is_ram_script; }; #define IMX_DMA_SG_LOOP BIT(0) @@ -498,6 +499,7 @@ struct sdma_engine { struct sdma_buffer_descriptor *bd0; /* clock ratio for AHB:SDMA core. 1:1 is 1, 2:1 is 0*/ bool clk_ratio; + bool fw_loaded; }; static int sdma_config_write(struct dma_chan *chan, @@ -918,6 +920,7 @@ static void sdma_get_pc(struct sdma_channel *sdmac, sdmac->pc_to_device = 0; sdmac->device_to_device = 0; sdmac->pc_to_pc = 0; + sdmac->is_ram_script = false; switch (peripheral_type) { case IMX_DMATYPE_MEMORY: @@ -953,6 +956,7 @@ static void sdma_get_pc(struct sdma_channel *sdmac, case IMX_DMATYPE_SSI_DUAL: per_2_emi = sdma->script_addrs->ssish_2_mcu_addr; emi_2_per = sdma->script_addrs->mcu_2_ssish_addr; + sdmac->is_ram_script = true; break; case IMX_DMATYPE_SSI_SP: case IMX_DMATYPE_MMC: @@ -967,6 +971,7 @@ static void sdma_get_pc(struct sdma_channel *sdmac, per_2_emi = sdma->script_addrs->asrc_2_mcu_addr; emi_2_per = sdma->script_addrs->asrc_2_mcu_addr; per_2_per = sdma->script_addrs->per_2_per_addr; + sdmac->is_ram_script = true; break; case IMX_DMATYPE_ASRC_SP: per_2_emi = sdma->script_addrs->shp_2_mcu_addr; @@ -1363,6 +1368,11 @@ static struct sdma_desc *sdma_transfer_init(struct sdma_channel *sdmac, { struct sdma_desc *desc; + if (!sdmac->sdma->fw_loaded && sdmac->is_ram_script) { + dev_warn_once(sdmac->sdma->dev, "sdma firmware not ready!\n"); + goto err_out; + } + desc = kzalloc((sizeof(*desc)), GFP_NOWAIT); if (!desc) goto err_out; @@ -1792,6 +1802,8 @@ static void sdma_load_firmware(const struct firmware *fw, void *context) sdma_add_scripts(sdma, addr); + sdma->fw_loaded = true; + dev_info(sdma->dev, "loaded firmware %d.%d\n", header->version_major, header->version_minor); From patchwork Wed Jul 14 10:20:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Gong X-Patchwork-Id: 477217 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=-16.8 required=3.0 tests=BAYES_00, DATE_IN_FUTURE_06_12,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham 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 17B0AC07E96 for ; Wed, 14 Jul 2021 02:05:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0687A613B2 for ; Wed, 14 Jul 2021 02:05:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237494AbhGNCIH (ORCPT ); Tue, 13 Jul 2021 22:08:07 -0400 Received: from mail-eopbgr60058.outbound.protection.outlook.com ([40.107.6.58]:54855 "EHLO EUR04-DB3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S237428AbhGNCIH (ORCPT ); Tue, 13 Jul 2021 22:08:07 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LubNKwW79mOFWCnWPrqJYIBYHJ20vASlesqOpH6i/nA+hGD8nYz6SJPiLfnWqAcCwec4luYLfxsr+3U1I8fBopmPs59RrlEvJv29iuGmC0feTBxMaifdxqchrv+rADT+BkMHAJ9bay02dtka8Qwoamoj2VDWt979kbqhAMH1jdv8cuuI24kMVG7r5hHBr9ib5QT05bf1kGDBfr/HQHK3XWr5URUZBZGP2FsfuhF7g+18kdq3Vf+HCiMxaN/ATN9YXlb1JBDogzdt06zHE95MECd+hpod76w1RXq0c4y47atC9R82QhgH08y+/udMirf39GVpE2HBMyUou5wJyCOKNQ== 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=sNYiV5p+Zer9BF/iPd2ivN5XQBG3Brjn3etpGvNEgl8=; b=bt9pU6agi8mPvA4Hm/1zgBP4m8D7vQ2bWVK7llEURaI0nIuiMl1qcmr3H0M/KyS66+G0uwE6beh1n7HJ0AWyn/ezI2WBYl7UzK7MHZy3650WNUosNXvMOHcc1Syj/+1eGWLMBgtfnzyqbkzmCmjeWMujFvO8LBeKkURbYDgDjx1wShmt8Tya3LrdTNNC30iJWzlDHZCCy1BDCiyR0ttYD/wOFF7gr6/m0YUIzC14KkpxB21qOgmeO3ltamb5fChLtBF5FghDdsLDcs1d99bXCoVgfiLRH8PfFM7P65vy1ztKzjlVwLz7CJyqLU0MQjfmcufDDlOMt79rWrmr48ssEg== 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=sNYiV5p+Zer9BF/iPd2ivN5XQBG3Brjn3etpGvNEgl8=; b=oTiro4bYTnDlF5PNDC++7kfiquVB+4X02tx3gGNYgX1vbpyAnsz2FyE8FRiLbpkm1gopnXRxoFgB3q2YFCRRsiZBTF/OMEqVCvrG/bTEAIA38uYPmuRqkRL8IODzYVXv9YlMqY3xSLiLMQCHVVH/XIHqec7mBonHbAudVhLIOco= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none; kernel.org; dmarc=none action=none header.from=nxp.com; Received: from VE1PR04MB6688.eurprd04.prod.outlook.com (2603:10a6:803:127::25) by VI1PR04MB4175.eurprd04.prod.outlook.com (2603:10a6:803:40::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4308.22; Wed, 14 Jul 2021 02:05:14 +0000 Received: from VE1PR04MB6688.eurprd04.prod.outlook.com ([fe80::a978:6f38:2bce:9076]) by VE1PR04MB6688.eurprd04.prod.outlook.com ([fe80::a978:6f38:2bce:9076%5]) with mapi id 15.20.4331.021; Wed, 14 Jul 2021 02:05:14 +0000 From: Robin Gong To: vkoul@kernel.org, mark.rutland@arm.com, broonie@kernel.org, robh+dt@kernel.org, catalin.marinas@arm.com, 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, frieder.schrempf@kontron.de, m.felsch@pengutronix.de, l.stach@pengutronix.de, xiaoning.wang@nxp.com Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org, linux-imx@nxp.com, kernel@pengutronix.de, dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v16 07/12] spi: imx: fix ERR009165 Date: Wed, 14 Jul 2021 18:20:47 +0800 Message-Id: <1626258052-22198-8-git-send-email-yibin.gong@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1626258052-22198-1-git-send-email-yibin.gong@nxp.com> References: <1626258052-22198-1-git-send-email-yibin.gong@nxp.com> X-ClientProxiedBy: SG2PR02CA0016.apcprd02.prod.outlook.com (2603:1096:3:17::28) To VE1PR04MB6688.eurprd04.prod.outlook.com (2603:10a6:803:127::25) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from robin-OptiPlex-790.ap.freescale.net (119.31.174.66) by SG2PR02CA0016.apcprd02.prod.outlook.com (2603:1096:3:17::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.4331.21 via Frontend Transport; Wed, 14 Jul 2021 02:05:08 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d5ead7d8-3180-41e6-8e8f-08d9466bd1c5 X-MS-TrafficTypeDiagnostic: VI1PR04MB4175: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5236; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: DdlXoprDvwHObC1TBTegO6vDtGBcWY+8KWAahuYEiNCQ2BVra8MSX729OtsyoJk9rmFFi/iN3xjL0R9zSQAB2060GoPMkuHg0qMKBdma6tDtukaCCqvT2+kMmAAe7zWy2c0ClsNYz7a32ZWY5IV5cEgfHefcAYMGvANjpNUjlJIXQ03w0RBwkMmImAs01YjGW4O1qJ8Cd7ZVOLM5VGWBQISnKvZOU8YNBC3+oGI6IZFJJUznkqoTMIoIEWpvA8bnHsZwI3y9DjEuSF7fQPLJhrVMjjeSnNdJOqQf3dalWZbk/LtEqJLFOtHZ644NdqVt8TmvICa5WhUEEz+uGpQ83u9k+pLDUd2H8v6Ap/IZT0UzBt57cOGL4C9MmoJEkEcXXb8oMqn1nk5jFavCuvVm0OuZoRceMnXiwKGhZ6BB8SXZWTf9ZCOQelanr9TzHFgmKg030UTnm0GNHX6BEkKVGBVDsQPseX4V4cxkrFdFp02g85GC8OrAXTSFwr0iMwQw8/Td366JL6AyxteZVt0C9lY1/h5uy1GZ05DPDESzvag4dL3i6MxdwvudEvvvUqxKA/w3DzyIYQmrkgpQk4BYQ3GjulDTLmEgtXzOubA7tqkt39gaDvwbN0xVjIel3K9ZsNskGjLLq+Gh4V1FA1jl5HUMstYxCFXTbPTMkCFvqdtJX6rC7BfHl9OPKnC0pL6MXYilkrO+N1jcYgXqCVEvbiFUr4Osl9ksu0GzCVxH4xVSvNKL1Wa6FVcvbXwO/e7ggj7YHiAzt+MgHnVAEOa1RmrLa+sfjgPB22cLuuUWa34vHupPi+4GJIUikzpUC98y X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VE1PR04MB6688.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(396003)(136003)(39860400002)(376002)(346002)(8936002)(7416002)(6512007)(2906002)(921005)(6636002)(6666004)(83380400001)(6506007)(86362001)(26005)(36756003)(4326008)(66476007)(478600001)(66556008)(956004)(52116002)(6486002)(8676002)(38350700002)(38100700002)(186003)(5660300002)(2616005)(966005)(316002)(66946007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: c3Dk2NCZMrPlwXDb7T8ZZTprOnF9ro0z+anAJWVB0a41kyKsNOhWxh9Y9h3noTczicWL3NWS9luiOm7UZv8eZzfL6/EYaipnEGLbzYyHv7FGzycj8usRk6d22ZG8sXTZQn/CB1CdbbShrJe5mxZMd4dAR28AjVmSxiyLEixXiHWdIHqDTkjR7XCCmTwv1kDpejUMC67FmuEKRjw3ilb7jNz6XvGRvv/SFNCVIOul9JHmCWYLp2i8f+rOzZo+h85Y9oLxUzhLVD0xyKQTsqlDmrVuuW5YwAuSmgX24PylOhqKLfpxzSUEpP2spELLyWzqbzI3IDzTDGOGKLiMLdjc8vDVgaUHO3/i8uYB3mQD5mR/19AAGd+9GfEUIfCpB6ssbTKJtUdEirDRzs1QDrxkqv65QCmH3KFq8SqJe+apxFU1X1y1bscQcm66jXxuAJcghy/Of3/GPuweAtDfriaO2dR+EhL+4i29UeFPCY4iDqzBy1seC9LIThtpe3ALOMbrNsZlEUJNHsVY+TPxKwAMI6bjjaKbysOG7Ed12FhlNNwkBc8fpGOJvoCAb+RPp/OJIyTWK07Q9ig9X8lmspEwGNyaCofdAAERlKE/ovsb1P7UmiJ1i7nrEvavGFJ8tR/qOvzuxJnUXjtgzBG4rc++eE2aC3k2SYfz8/VoHngyd19c1iqiCp3JzKh/2u6YoJQTprwcElWhrQZQRttZedr2X2jE9D7P10cNp6HKd24VL/QH4iHKYszVTrg7JhGeg6skDsrt/phURdoLk6K4AcPOakQgwcjsQPp6Go0kdKTDG2Pn0IxeGEI7TzkKampaGuJ7yivSAKw6l0Mz4yqvBrE4p2AtUL33Qk2ectqQEU1GKuNsg3qNXkxBVtox/SBmtU94AY7bvQxu2rXH7QNxOWvEmcQb6+ypRi2oNtg/Tkf2JwZexB84sLA92/4urB7hL+b7ZPlQHQ9cKJxAcjB6HD1nIr03pDEaDte3ZJD2ASjM08+byxOf1Su98G7vRW7AVYUtSsXK28HJqFVlVH4d3SnMgRzmROiBFjhjcuB/d+fSWBOy4TeXm4XxP84p8An9g3ECWIfrJpYoyshmD22M60L+sJWD5uAahoJZUP8d2CiBJLg8UUvYv3Eq2O73FRfqEON6Bn6cYUSL+QB1VZkRCtDTyaeCkHZXEuT5F5aQmyfCZANf84D6p+KC9XdzGu3AhjkLClP3Ib1ehXqs6k1pyf1fQoCrhGe0Uhj24VN3lh6dnbu33lfUPpPw4id1dKh2UOFYXv/x9+hNzBO8iyVglY4UO4dP38PEGODy2hT8DvSY9gcleyjDyycA+XF2tjynBZnI X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: d5ead7d8-3180-41e6-8e8f-08d9466bd1c5 X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6688.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jul 2021 02:05:14.7054 (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: nZf5iQUGCnuNlqvtX+b258wqBG3MHWIqclSGuLOaAk+OiF86HmzsRj49D3WMO0jjEpgEn1AKpVKQY1lqTF9/aA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB4175 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 Reviewed-by: Lucas Stach 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 4aee3db..61e4fa0 100644 --- a/drivers/spi/spi-imx.c +++ b/drivers/spi/spi-imx.c @@ -608,8 +608,8 @@ static int mx51_ecspi_prepare_transfer(struct spi_imx_data *spi_imx, ctrl |= mx51_ecspi_clkdiv(spi_imx, spi_imx->spi_bus_clk, &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); @@ -1239,10 +1239,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 Wed Jul 14 10:20:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Gong X-Patchwork-Id: 477216 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=-14.0 required=3.0 tests=BAYES_00, DATE_IN_FUTURE_06_12,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE,SPF_PASS, UNWANTED_LANGUAGE_BODY,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham 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 D1DE1C07E96 for ; Wed, 14 Jul 2021 02:05:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BC656613BF for ; Wed, 14 Jul 2021 02:05:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237368AbhGNCIX (ORCPT ); Tue, 13 Jul 2021 22:08:23 -0400 Received: from mail-eopbgr60081.outbound.protection.outlook.com ([40.107.6.81]:36238 "EHLO EUR04-DB3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S237356AbhGNCIW (ORCPT ); Tue, 13 Jul 2021 22:08:22 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=I6eMyITtqrZZ/mkCxiyxluxRcVauHHTdY9ZxohhbrvfhBcYi3FwOjrUSEpLmvm/8GVyHmBCZVmYXeS1mfXL4ckp59A4et3M2R26RK+k4Us4LxJMtvuJTESEiWuEgR6tOE6lSaqoHNvET46RVqmHV157Jq8OKJTPtUhKJXKofKJkVRWgqIQG1DhWsyItdow53MWqTpQjJfzPcBsP0any1SP6P2MkZsbuuB0OXZBzdvbGOXPaiReULX7YivvFBxVNHKbs6TBmAu/l6DJtmezfiSl8+w25knXiN2pwy9SlQUg0FjX/aTbimygBmUpNeBV/sIAGcQblqOvrPz7whuHsY5g== 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=xb+X7X4L/mtWzVycwsA3YmjE5CNp5DwSoUVSouktETg=; b=bsmeZN5ONzswG54pSdkDpOSXVhvTYF5wUvFUP6BFNnS+rV/TvpeaDyF/n63DZAk1P1fq8qfMwIDhFGgYme4znLPmIvYijfhH1f78SsB/E8pt3ly3Vl2fI6O3f8NAPH9b19Els0A8qjrQeLfBZnHBATDjn6QpDUHqVFsYsEqAWzCwIdhc8rRKXjINThepZL3tpXQ95pSAYJelUr1QayQPQNKa9p+Gd4AbGJcm/GhNSbRnR2weelXfI3+FKVniyvvcw6PTQqz4U3kNIiLsSkI7OuN8SXjrmqu/Hh7sNi2jKthmxCdcbnEDZ9qBIjyq0n4LyDHVjJ+3c5LeWYiij0ab5g== 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=xb+X7X4L/mtWzVycwsA3YmjE5CNp5DwSoUVSouktETg=; b=eaANw/wAGNsgNAYJxRqJeRiJD4lonTmXQsCzKxtDnbXUt/kuspUeC/kV8ox9FMKRllLAmQPnzHjAVwJoJ55MDh0J4TRRyKEYsalxxtqjbAjC0NM2QuFNX4nTCPtC8NJT/Cmh1YSG/LFvGI2Mv4vzQck+SCrhAVcoF2Gaw6u0/q0= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none; kernel.org; dmarc=none action=none header.from=nxp.com; Received: from VE1PR04MB6688.eurprd04.prod.outlook.com (2603:10a6:803:127::25) by VI1PR04MB4175.eurprd04.prod.outlook.com (2603:10a6:803:40::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4308.22; Wed, 14 Jul 2021 02:05:28 +0000 Received: from VE1PR04MB6688.eurprd04.prod.outlook.com ([fe80::a978:6f38:2bce:9076]) by VE1PR04MB6688.eurprd04.prod.outlook.com ([fe80::a978:6f38:2bce:9076%5]) with mapi id 15.20.4331.021; Wed, 14 Jul 2021 02:05:28 +0000 From: Robin Gong To: vkoul@kernel.org, mark.rutland@arm.com, broonie@kernel.org, robh+dt@kernel.org, catalin.marinas@arm.com, 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, frieder.schrempf@kontron.de, m.felsch@pengutronix.de, l.stach@pengutronix.de, xiaoning.wang@nxp.com Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org, linux-imx@nxp.com, kernel@pengutronix.de, dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v16 09/12] dmaengine: imx-sdma: remove ERR009165 on i.mx6ul Date: Wed, 14 Jul 2021 18:20:49 +0800 Message-Id: <1626258052-22198-10-git-send-email-yibin.gong@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1626258052-22198-1-git-send-email-yibin.gong@nxp.com> References: <1626258052-22198-1-git-send-email-yibin.gong@nxp.com> X-ClientProxiedBy: SG2PR02CA0016.apcprd02.prod.outlook.com (2603:1096:3:17::28) To VE1PR04MB6688.eurprd04.prod.outlook.com (2603:10a6:803:127::25) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from robin-OptiPlex-790.ap.freescale.net (119.31.174.66) by SG2PR02CA0016.apcprd02.prod.outlook.com (2603:1096:3:17::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.4331.21 via Frontend Transport; Wed, 14 Jul 2021 02:05:22 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 031e0ccf-8fa3-4283-a1f9-08d9466bd9fb X-MS-TrafficTypeDiagnostic: VI1PR04MB4175: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7219; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: IzasPzVL4g1InZcWNeAbWEbtq1JvQuXdr7Er4tTBeKNH70bCw1wkQW4Fs5sEbQYuiGsZ8jzJKWJ39oeBOUAglfUvBO4fGSP8VW2GktiaesqEW5/ZnSAU5J3P4PvOzZZxEN3JmNOUXRZI0q9l5Ian0KnGVrl8iHGGjZO22EdB6nTykquiohGElkSVSuOhV4v7x886lex6eS18LKNMd1vem7s+iQI5ca7/fbZ591eHl3QbiaG443zVL6FVLut0FHwqDDWRJfVvMaW689e593SWvZE8saiEnINeiuaJaNqHg9dw+0x0cdxlCX4IYP2TvPeQ8ogrC3gyv2w4nBujuosIiRvpk35Q5LApcr1De93wOM9ht2ZhQY6YOnbXcrz6cuo3fn8JejR/wagdNydT8kn12DF7zJoeVdx+c81AA7ORitKODwXyQmzHHHRrO/nxzc5CjqmIWg2qVrS7fWpPPEJPovTY7PRydD+feo/OhmPLIIZQGCOXLHPU1j5Xe8ecvhOpC5ZPHZ3wWh2GRcySpZJLl6+3vDDrgftUnqELWqV3xak/TMmuaB2D4gG3j0yDVvy8SVkM1AqmW5VXl2mGhPDuiPpeylFBPizS519hxjc3OCD5pgLc56ZlspqHPSOcgOti8zNIe8kf+3YrUdkddTiFEy3Wf8uUfonMT506CzSaTXSHxqK+VQxOEZX8wx7DRdP4E6rjLfAhMWPWAwY0uczTyQ05/Ucdwr7k+xKC4DVDU2BTyt1h7J0Fgimc+BL8oiJDXIcwKXJNAzJgLS4Rr/sS/xji9ioGWR1LS4VZqQW/baJmfAVADHm6gyb/GWKmeHBn X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VE1PR04MB6688.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(396003)(136003)(39860400002)(376002)(346002)(8936002)(7416002)(6512007)(2906002)(921005)(6636002)(6666004)(83380400001)(6506007)(86362001)(26005)(36756003)(4326008)(66476007)(478600001)(66556008)(956004)(52116002)(6486002)(8676002)(38350700002)(38100700002)(186003)(5660300002)(2616005)(966005)(316002)(66946007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: wvnZlvVK5bIYz8XqHDFwt/IjGt/+azjIquuknQHs2Okpk6UsnZ+k/i/sLQ+WAJiSzFdW7lNHKHlpfKvxLGFtSZ1o8+NtJb64knoLFpqjjgJk4jDFgikAd3/u2uSafgGeUi3qhiSvgFsMiGm9WzZAXS4MbdY16zHJfD4TdM1WL0y9Zic8rFNH+/zG58C+nJUrAsQHG+D1JD9IMQo4YPwGqGqkF5ykefSJKqCX5WKd4OjcKBs0esMtCj4JuvdbbkG3V6YUBAgQyBPDcZkA7XFadbsN7P1v9V8iYwvUV4t8Mb8ukfMwGqYEMEEyoLK6tIL1xnS38ZHmzhVieAK9B3ii9dhs05UYvJHkAWedG/4gNCpbRdvk845CQdvD0BOBVO2Y9Hgvy4t9U0AyYjgbslHsAjtdNWXngGkV+VG+npVYRV56njHKOcE4JHA0qzb1/q7hk1+gEGGth55OXgDLknbjaU5DoQkuuqel/KGJkin3CGy5nAL+0rbarAgQeFvhVNchOVT4GyfKUjYN6PLNKxyhVOKhF8OdWZ7+aTV3aIQXErZFYvb6wtBVdgdc6uwwy6pRuii30Gwk5OFF13pXxr+zgQIZov2gKbdGVy4OQNIWi74/vmRDHRvJcI/KkxqCeb6aE1Hg5Xoa6eZ3hFk3qD3wuj3z9NEV3APv6AN0ns/EL8i3Bstr5gnYuhQFiq9frYAizL6r8/C/C3kTqHTWHVC4zxHA3T6HvSkOOC7qAzVYRymq98/f4fdikLULk/Tr0epfTn3MKQ4/3FWnthn9iwP4SeyM8Fgd/us+0SdaUbcgNmpQ+/lVq6Aqvd42fVWY/gromRumyAqKbVzhZ24RXRcliRn/Q4M4ViEKVsxL8ABSOCQ7OnaL3lQHDxNbdO0vBMqy+r9ZFLp4BDeo2Sq8IbGNjTgEqbAfNns9lrZN73+pTg7h580jS4jR23HEYE+HEOXQgaauPltnbPV0eP2CR4Mg7Dp/QN7BHy3JsTf2MT0s1HZtCL3eUdMM1gFaIDjrcn9ONWcNW3qJthfFdqQcX4z1xEDssEaiO+cxFfmkFIB9TBmXqHTxqtR3bjyU+fJ/xtDR0Oac2DuXAP3ZaPv2HtVi81dxhHhjOdifVtPmmM2bwkmIPaG6kPG7t6RIM/NOSkNF9ETHOixdddwoTP7FKzqvTupZ7IlUsrxbTJGcWdnk1ngNfz1uHYI5mn5xDr8prclOqUs6vmVWleu48x2ilBeXAEB6Ci9+RRnszlVeF6w2BFzNDapQjv2oxb/DuD695x/dSRi1EyDRsbmyRheKtuYxrzOjMBwkzqLL84vLMeUNy7MANlqfd/XHkEblKs0cmd1A X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 031e0ccf-8fa3-4283-a1f9-08d9466bd9fb X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6688.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jul 2021 02:05:28.4796 (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: wlO2mHe3dlA6jzoJPf4+MDn9H0F71wuJHXuiEqvI3Ms4xdpIaDwvPt3Vdw99AIYYG601oiHdbflrd28vSOoZHg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB4175 Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org ECSPI issue fixed from i.mx6ul at hardware level, no need ERR009165 anymore on those chips such as i.mx8mq. Signed-off-by: Robin Gong Acked-by: Vinod Koul --- drivers/dma/imx-sdma.c | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c index 5969df8..cfcd413 100644 --- a/drivers/dma/imx-sdma.c +++ b/drivers/dma/imx-sdma.c @@ -476,6 +476,13 @@ struct sdma_driver_data { int num_events; struct sdma_script_start_addrs *script_addrs; bool check_ratio; + /* + * ecspi ERR009165 fixed should be done in sdma script + * and it has been fixed in soc from i.mx6ul. + * please get more information from the below link: + * https://www.nxp.com/docs/en/errata/IMX6DQCE.pdf + */ + bool ecspi_fixed; }; struct sdma_engine { @@ -596,6 +603,13 @@ static struct sdma_driver_data sdma_imx6q = { .script_addrs = &sdma_script_imx6q, }; +static struct sdma_driver_data sdma_imx6ul = { + .chnenbl0 = SDMA_CHNENBL0_IMX35, + .num_events = 48, + .script_addrs = &sdma_script_imx6q, + .ecspi_fixed = true, +}; + static struct sdma_script_start_addrs sdma_script_imx7d = { .ap_2_ap_addr = 644, .uart_2_mcu_addr = 819, @@ -629,6 +643,7 @@ static const struct of_device_id sdma_dt_ids[] = { { .compatible = "fsl,imx31-sdma", .data = &sdma_imx31, }, { .compatible = "fsl,imx25-sdma", .data = &sdma_imx25, }, { .compatible = "fsl,imx7d-sdma", .data = &sdma_imx7d, }, + { .compatible = "fsl,imx6ul-sdma", .data = &sdma_imx6ul, }, { .compatible = "fsl,imx8mq-sdma", .data = &sdma_imx8mq, }, { /* sentinel */ } }; @@ -948,8 +963,15 @@ static void sdma_get_pc(struct sdma_channel *sdmac, 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; - sdmac->is_ram_script = true; + + /* Use rom script mcu_2_app if ERR009165 fixed */ + if (sdmac->sdma->drvdata->ecspi_fixed) { + emi_2_per = sdma->script_addrs->mcu_2_app_addr; + } else { + emi_2_per = sdma->script_addrs->mcu_2_ecspi_addr; + sdmac->is_ram_script = true; + } + break; case IMX_DMATYPE_EXT: case IMX_DMATYPE_SSI: From patchwork Wed Jul 14 10:20:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Gong X-Patchwork-Id: 477215 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=-21.8 required=3.0 tests=BAYES_00, DATE_IN_FUTURE_06_12,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING, MSGID_FROM_MTA_HEADER, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham 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 8BA76C11F66 for ; Wed, 14 Jul 2021 02:05:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6DC23613AB for ; Wed, 14 Jul 2021 02:05:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237443AbhGNCIh (ORCPT ); Tue, 13 Jul 2021 22:08:37 -0400 Received: from mail-eopbgr60058.outbound.protection.outlook.com ([40.107.6.58]:40519 "EHLO EUR04-DB3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S237317AbhGNCIg (ORCPT ); Tue, 13 Jul 2021 22:08:36 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QbMNSAcNuZ89WCQEHLFONRDFPipf0ciwLzetiAjjUjZd3kgwWHKFk3KND9CXIh3G8LLweRR5gMC0ET9/NiVN2uk/meZ7OSZZKqfTIinb+MHQILlfU3BlbBx4bc3AkYSSFbEeH4fSi90fEUti+/YRwLl9gcrITMpW+qEAH7MubVOH9CwKfa+ngO6fuwi5DvhHvkrHarK1ccQc2iAuh1jy4xn2/PRSyNSjicLgV4uNesEzFzfBtWNSy4UlW1c01l7d8ufF7GSDP5bmiO5NRVJlyY0BQsYWSTvz475K8xLNIAHF44JcXqz0sF5ClT6dITwHOdEDLWqeKrUgAksugIYxCQ== 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=eivtqmCh/6qtoM7vlA+AvrjcmQeA2UWkk6iZBtAnm+8=; b=InQO5icx+/gl9tGfSeKEHD4Z1L3/bJoqSkxpQ/T6yK9BUjLC12dFGTbw46rzU/do++/yIjw/RfQuj2rtghzhg8QfMuJerz3zpjZuk8SlbJwo5qwZkp33nbFzq7udcwLzdXhlxyKH5NB4qBAk0cxDNVe5+Q2Qv2fTAggCA/E4Dkf3txjSGAoV9BIXnbJ89rBgaq3J9a5CSWiSM0TvyINzeyb5wp0R4RVwkPmKYiqnXsxiny4VxnT0gcjo/XEpHAyDB6GqtEmkxzPcfAn5kqJN+8h4P73anfYn1qLcfulb7QtJeg6g+n5H7P6Nx+ga0Qi4nkqbnTI56j54N54BTsNUUQ== 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=eivtqmCh/6qtoM7vlA+AvrjcmQeA2UWkk6iZBtAnm+8=; b=DX+8QaXMwc4gf9AVvEPBQ74cxVzaMjE+T1nZcw91bli8XX69H9qzGiJqxANLZ2dWU1LLsiahNivcsMJT59FfLh57SQpN7MfNYEgYQZlki1h7SndtIQbDcKGfny+f6P9cyyvFKTSxl9ImpRKHyN21pqwwn7bM9wZfv6sKwxR1DgM= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none; kernel.org; dmarc=none action=none header.from=nxp.com; Received: from VE1PR04MB6688.eurprd04.prod.outlook.com (2603:10a6:803:127::25) by VI1PR04MB5773.eurprd04.prod.outlook.com (2603:10a6:803:e6::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4308.22; Wed, 14 Jul 2021 02:05:42 +0000 Received: from VE1PR04MB6688.eurprd04.prod.outlook.com ([fe80::a978:6f38:2bce:9076]) by VE1PR04MB6688.eurprd04.prod.outlook.com ([fe80::a978:6f38:2bce:9076%5]) with mapi id 15.20.4331.021; Wed, 14 Jul 2021 02:05:42 +0000 From: Robin Gong To: vkoul@kernel.org, mark.rutland@arm.com, broonie@kernel.org, robh+dt@kernel.org, catalin.marinas@arm.com, 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, frieder.schrempf@kontron.de, m.felsch@pengutronix.de, l.stach@pengutronix.de, xiaoning.wang@nxp.com Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org, linux-imx@nxp.com, kernel@pengutronix.de, dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v16 11/12] dmaengine: imx-sdma: add uart rom script Date: Wed, 14 Jul 2021 18:20:51 +0800 Message-Id: <1626258052-22198-12-git-send-email-yibin.gong@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1626258052-22198-1-git-send-email-yibin.gong@nxp.com> References: <1626258052-22198-1-git-send-email-yibin.gong@nxp.com> X-ClientProxiedBy: SG2PR02CA0016.apcprd02.prod.outlook.com (2603:1096:3:17::28) To VE1PR04MB6688.eurprd04.prod.outlook.com (2603:10a6:803:127::25) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from robin-OptiPlex-790.ap.freescale.net (119.31.174.66) by SG2PR02CA0016.apcprd02.prod.outlook.com (2603:1096:3:17::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.4331.21 via Frontend Transport; Wed, 14 Jul 2021 02:05:35 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 78775705-c336-4c08-7c56-08d9466be239 X-MS-TrafficTypeDiagnostic: VI1PR04MB5773: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6790; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: t+8+YJfnNq9Hh1m/QxjgnkIgtKhyVeek1pzBNT4wU9L1VW/k7rh4EFuGTbZzQ/+1uU5jTr+9ke26neLQXA/+C/gTJa19c6VbYHEhhABjz2xvxKAirO5CYvzBHVxUNoGlWVSB2QbQxS+iUdQu01cCzOu/7zuPCmHtLPAvpyr154nlOlPCW1ciMEeQPb4kYiv0slixrqNQojvQuUIE1nhj5hKjxIA4679REcI0P87sARcpLDfttaTILC5pQSsKbqXIj+xUXqtaPYubk5kesz+kGFKtatB1RNIGZP41fnBDuc5se86pTRJBHGoxY5bOxRi4Q5pw7UZFTxuCCTz5dzewjyGAk2KPHXIT0ET+aoRvbBlMv6VbXjMKAaDAdBPccJGtaJy3+dEgIkXnRhIG7FeVoLc+DURQxoT1BmeOCUbuQGy002njym0j5VTf6syaAoLjNLDJOfk/kZ+b92rR42tIx3pqQR/AbDZuVoelDbs25KHG/izoQ/VN1M84Eirl1L4RJcWmgxKJeAI6KVq4OCZmxwTf1btQd54UeS6lNK4shlkmoMbX+QRumfnitC4tfulkiJXXvTitO1Sx5RWdQrfT7gjjieJ/NIteiECzJ6khPz4J3epj2ZMY4eO57C3d9voRn2Heqp5qRff7RoKxqM4QJpF5EZAichHat7zmYV8GMOe00Kl32JiiyxWkzbDEsIDLfUVKxMIpYQ4ezg/fvqCuNlpPuGAxB7kSdshqdOChAsbHlfEv15yUaTqeWfw0fDVRd03mF7O3QIpiBpX7vOnUmixuCMbBi7Eqib4uL8U1+T55i3VxSNwPgTQ6764wXHBx X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VE1PR04MB6688.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(376002)(39860400002)(366004)(396003)(346002)(7416002)(2906002)(316002)(6636002)(921005)(6666004)(83380400001)(38100700002)(186003)(6506007)(52116002)(26005)(4326008)(8676002)(478600001)(66556008)(2616005)(956004)(66476007)(36756003)(86362001)(66946007)(8936002)(5660300002)(38350700002)(966005)(6512007)(6486002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: uATJW4JLqLrCVqgi+7+bdwJme5YS8SUlFr+F+NFwoxlgLAbePtsBwUEtikC+CAcksZw9WJ2bJQ363y3NGW1x/Qi1ZQ05Bk2QRJAIAIMtFQS2LqKk5OPV+CVKjDFLoE42vHHp8LD5bVIZfKgn53ivJEq3rbaWw1K+ZmmymagZT6SJti3h27FMYsdVBWMv3oAK8DrMgmiiE+B0i/VntX9tbvmKR9OoRoYxNRKlqbKLCYSmGOh4M9ae0FMgjI+TlcYPEoxYUtdwETrJSaPsZtV5KFBbZ3tHxfmxcATzCOWD11WBpt4N3UWsXuA5i+JoknMvJD5arzxLxvXmh7Bd6pPLBaj7c1oDR/djo4cUMvLhNBvoutDOsp+iVRBAUaAFfsVBtAdYzAEijbKp8XKYY2Ch7A0/xLSeulPhG1T3T9wRF9tn6jijWBmZZkpMVcfuxLYkmsrM4z9u7uYovR6jgerg0Utq1as4voIUVnnQ81sESPY2qe/1xTtYHjg8QnG/8BolQApLlpYB1aWne3ldIzYFMfQqPANBAXyjTMBv+PSK7aAI7gWuLecLO0g3NO9LyiYbMwGN76hq/WnwGexjSXsK1OzFT/2aIr7DsnoFbuyk/IFuhjCFKhH1/LUxOPJfJVtZ1dPiktlP5zjeT8aD7z1364UhHwyPxpY3IqLQiamksmC3nAcjEP4JrllFzDOAU9Ej7lyuoSHLliBqHFE7q/Z5kAWUIJu/L5HBwfYVPW1C8CS3p/QM5tL4hqm2THRPoFpakE8qagtOi7tAreMdgUj41WQ4YR5XMwaQfQRwYxvUxkcu+Dzarx0HlkTGWxnOOuFlVbIyz/z30nQMJcdV9iYuCW/AOSx+LDzs2Ub1oE8efunAklQW1ze3WzhpnEeJPOGPHxzOzr/aOTfWlDTqQJ2o45ewJUGvcVqfiOYRGua2AT9MfyIAjC+d4/k6epMp9PmWMhZgaEVwG/Nwd08GiGyvxx3xZHbh7qL5SEN9sjt4DXNF2XSPrrHNJ9TyfH96VumPDkpwLi+sqoEbMzh5LePQst+1VHQK0UcCrATD8zu1l5df9ty4rePnE2gvwsV46Pq6cHRwJrD6WgJAoKWyPXuL6znVfJjmOzrodT575ulCwQOOWFSYcq1FOmeeZENNTA+3DgWsIOxWkeIwLilSEPsRB1S0QRC7SzwfME4FAsttHhJJiqxp7TVpz9WWQI8JeWYvZ3SECLiOLw315X3EinxF2MdNP1Oxg1DfLLDf3uTj5DMu9MKGYLjq1gpRzhGeMIxyuvH5Rpi3AIOzmGiAxfV55TvPLZHMGX4RzfxkHmz3mhMFa/IpdeyuI2tx81KonSnM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 78775705-c336-4c08-7c56-08d9466be239 X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6688.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jul 2021 02:05:42.4496 (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: G9n/RfTeNXxJV/2vC5d1qxq4XPhQPaDhRkcVc4nWdarNb+zuWhTW7fBvuE68Wa6HJIuSSPPBOh2XE52GDDiFBQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB5773 Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org For the compatibility of NXP internal legacy kernel before 4.19 which is based on uart ram script and upstreaming kernel based on uart rom script, add both uart ram/rom script in latest sdma firmware. By default uart rom script used. Besides, add two multi-fifo scripts for SAI/PDM on i.mx8m/8mm and add back qspi script miss for v4(i.mx7d/8m/8mm family, but v3 is for i.mx6). rom script: uart_2_mcu_addr uartsh_2_mcu_addr /* through spba bus */ am script: uart_2_mcu_ram_addr uartsh_2_mcu_ram_addr /* through spba bus */ Please get latest sdma firmware from the below and put them into the path (/lib/firmware/imx/sdma/): https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git /tree/imx/sdma Signed-off-by: Robin Gong Reviewed-by: Lucas Stach Acked-by: Vinod Koul --- drivers/dma/imx-sdma.c | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c index cfcd413..9ec1edf 100644 --- a/drivers/dma/imx-sdma.c +++ b/drivers/dma/imx-sdma.c @@ -198,12 +198,12 @@ struct sdma_script_start_addrs { s32 per_2_firi_addr; s32 mcu_2_firi_addr; s32 uart_2_per_addr; - s32 uart_2_mcu_addr; + s32 uart_2_mcu_ram_addr; s32 per_2_app_addr; s32 mcu_2_app_addr; s32 per_2_per_addr; s32 uartsh_2_per_addr; - s32 uartsh_2_mcu_addr; + s32 uartsh_2_mcu_ram_addr; s32 per_2_shp_addr; s32 mcu_2_shp_addr; s32 ata_2_mcu_addr; @@ -230,6 +230,10 @@ struct sdma_script_start_addrs { s32 zcanfd_2_mcu_addr; s32 zqspi_2_mcu_addr; s32 mcu_2_ecspi_addr; + s32 mcu_2_sai_addr; + s32 sai_2_mcu_addr; + s32 uart_2_mcu_addr; + s32 uartsh_2_mcu_addr; /* End of v3 array */ s32 mcu_2_zqspi_addr; /* End of v4 array */ @@ -1747,8 +1751,8 @@ static void sdma_issue_pending(struct dma_chan *chan) #define SDMA_SCRIPT_ADDRS_ARRAY_SIZE_V1 34 #define SDMA_SCRIPT_ADDRS_ARRAY_SIZE_V2 38 -#define SDMA_SCRIPT_ADDRS_ARRAY_SIZE_V3 41 -#define SDMA_SCRIPT_ADDRS_ARRAY_SIZE_V4 42 +#define SDMA_SCRIPT_ADDRS_ARRAY_SIZE_V3 45 +#define SDMA_SCRIPT_ADDRS_ARRAY_SIZE_V4 46 static void sdma_add_scripts(struct sdma_engine *sdma, const struct sdma_script_start_addrs *addr) @@ -1772,6 +1776,19 @@ static void sdma_add_scripts(struct sdma_engine *sdma, for (i = 0; i < sdma->script_number; i++) if (addr_arr[i] > 0) saddr_arr[i] = addr_arr[i]; + + /* + * get uart_2_mcu_addr/uartsh_2_mcu_addr rom script specially because + * they are now replaced by uart_2_mcu_ram_addr/uartsh_2_mcu_ram_addr + * to be compatible with legacy freescale/nxp sdma firmware, and they + * are located in the bottom part of sdma_script_start_addrs which are + * beyond the SDMA_SCRIPT_ADDRS_ARRAY_SIZE_V1. + */ + if (addr->uart_2_mcu_addr) + sdma->script_addrs->uart_2_mcu_addr = addr->uart_2_mcu_addr; + if (addr->uartsh_2_mcu_addr) + sdma->script_addrs->uartsh_2_mcu_addr = addr->uartsh_2_mcu_addr; + } static void sdma_load_firmware(const struct firmware *fw, void *context)