Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp3773742pxv; Tue, 13 Jul 2021 03:28:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw2W/ffd3uhaD5s8XSdtRalRapMNbgZyA60VezrKbfKZrOvSmLdQfqWJdXT/upy8UFpvv+U X-Received: by 2002:a5d:9958:: with SMTP id v24mr2700379ios.4.1626172124477; Tue, 13 Jul 2021 03:28:44 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1626172124; cv=pass; d=google.com; s=arc-20160816; b=Pwt0anS4rEe7VN3/bdUzUW8iz8AO7x3g2TviaPA1Oa+1END/ZE3oXFF1YAs1lpuZce lk9zVWufy68pDvA/I2uqSXSgQ6o0faZ/bEblNKj4V6Uvs3sqB/gb9nlHCtGErS58Kpj6 j0evTsgLps2OLVouApCgF37+g4Fc9rcHJdNDCIUltT/kDsSTDlk/sWwjc30MKUibK5sU HhTasCFPyz7g4Bq2ux5W5K6lamGIRuf5bi3JTrqJiYIrKERkWUXIVH8z0mQZCY0YoF6x JkKv3YdnTe2MYgqN6M6tLQ6yUaHSByaquSObDZnkAUTddACttsVYKtAHAvx7ltt+V9pC X1tw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=Jy7wYF5hmeBicDao0726iP4rATOZGsJRcrBYBDsOo/g=; b=wOqAPbAqLaiMuJnizQwyQD1hPRLpTUIxDTxu9hMtIlM6re2lsYMwNIKxW+tlpULLyQ KReSOHo/kcRHD4AnqGP+AxGm3wiF4P6/o8O5iCCVSaD3f43U8WnupdFlO18dOhXV5aO9 7intBL7VDODDsCS3p+L15HojTY91dldBWxwKKYBiTNwCORY+KpWq4nIWWyfNA+aCjR6H pi+6V7wTUvovELfKZ19EvGVps3isBXBgpJ7QfaQ8srcaZNxFwwFQuH+bwNUpiEO74Btn IbbwyAznF7Zhv2e/OhFyW8ptD9ZLc8FUf66hPpdN3w+10F03ZJxmc3tOUkRdAMELrH75 k2bg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=oWDj7LO0; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s13si19916075ioj.45.2021.07.13.03.28.31; Tue, 13 Jul 2021 03:28:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=oWDj7LO0; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235791AbhGMK3c (ORCPT + 99 others); Tue, 13 Jul 2021 06:29:32 -0400 Received: from mail-vi1eur05on2073.outbound.protection.outlook.com ([40.107.21.73]:65299 "EHLO EUR05-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S235767AbhGMK3a (ORCPT ); Tue, 13 Jul 2021 06:29:30 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=f8+WIkW9dzr7np9Agfmv2CIAWthL1xBXWP1Petut7DbY2EAWTXywxSwSzh+CUEHlbPOvDHnI/g+bQl4dWknbTzYvoZROErT4M6x3OAIohCfa2fcrwKswmiCleGi3h1v69bOxYTSEX/ItDQA4PCIjF2jUBQfCj8nRBfBhaiHo0JRoW5ZnckFwiTmG50OyvTb25o03hdMUGXoe1U86k2WXmYEwOjucz6zZING4oTpiFDycVn6zLzJjPQB2Fw6Dnu/hSGJlrSNLrQ+tPHAYaI04ShtkuO12M9s2BriJKMuPJejGTzvyrGik+30L0P664bzsQELbyfF6jgfQ0P3UFeOchg== 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=Jy7wYF5hmeBicDao0726iP4rATOZGsJRcrBYBDsOo/g=; b=H9+yrwausTwr/s7/QD7qyquBxGMIb/24kupMVGeR3159E+QG/ICYIzTrlmpLLMV+MzYuMB/heZaD+kPQxBjTeFf5cEw5v1DmilmJa3NbHL85/ooRisVYOMJZZPi54BcYhEXMM53hc9yVRCt4DGLUYhYPYW2GttKc2gh66RUWMAGqopE4sGfUO826ulpFX8xvpOxsLV4Z0ehZSQksAleAHC6YtjH2gmwaad6CoIi5wXNZvJhxjzcmUA+//p5KLkCVkKCsFcm4a53U1uo/C9nCm9dRBzvkcpgnHjfT70uAJd3mG9OFnFIPJJ3CQdrDlClFHwzn2VyjumcYkAiD3G/DHw== 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=Jy7wYF5hmeBicDao0726iP4rATOZGsJRcrBYBDsOo/g=; b=oWDj7LO00CN6EjBhbcwCscLFx47p87pG/qxL4TS9wRKxy3emlSQ7SQwD1BfcRETyhuViISKXdqO4x+DrVO538AR4CHV5UHhbXPky+UftwrSqle69VJ8PkB0gicEajiLjvfdmqNdB0Ok8kyRcl3YqbertqpkBpFiZy52HC1D6sSY= 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 VI1PR0402MB3344.eurprd04.prod.outlook.com (2603:10a6:803:10::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4287.23; Tue, 13 Jul 2021 10:26:38 +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.4308.027; Tue, 13 Jul 2021 10:26:38 +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 v15 11/12] dmaengine: imx-sdma: add uart rom script Date: Wed, 14 Jul 2021 02:41:48 +0800 Message-Id: <1626201709-19643-12-git-send-email-yibin.gong@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1626201709-19643-1-git-send-email-yibin.gong@nxp.com> References: <1626201709-19643-1-git-send-email-yibin.gong@nxp.com> Content-Type: text/plain X-ClientProxiedBy: SG2PR06CA0198.apcprd06.prod.outlook.com (2603:1096:4:1::30) 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 SG2PR06CA0198.apcprd06.prod.outlook.com (2603:1096:4:1::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.4308.20 via Frontend Transport; Tue, 13 Jul 2021 10:26:32 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: bc20d32d-c6ad-408f-4864-08d945e8b2a3 X-MS-TrafficTypeDiagnostic: VI1PR0402MB3344: 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: /Bj2K5bShk/Simo8Sg5VUl2nea0xaiFDECBuYqHPKU/utcK8f4wxVGXtwi8PbZP3cRkfA46QDnTARyJYo2uIlSI6AJwMFugre0wRUa+nORuUs2KgHhUntB1HYL0XL+gqF8n2dtVT8QWHbr2K6VUubjWEjcINkyYtzyNSdW3ngYOCQt7uhU0GXoY8a/NLcS/A7MucJ5Sq7bM1qMmpOiealq6YZWFmChRYNApyrlUeeaud1TMo9LH6OTCSEvcifwyS7h9ON1MQ8cAmAOXAeLGcFVTE8/Pc4r/ezGhS6Gky8VyiNW2Fh5Ldz4nsOnDYfg32zACaV1+rgTQc/SuxbUUZhqXGMe9hQytNyBurbLq/pBnoN1nxUoN9h8geq78PjM67BnXJhSj4DE/e0/FkNFzkVqwudJXeflTIj2eQs3UBCe1WKA5l8L5KWWwKTTHR+eFeDeymsuuyFyFvHAsPUFbSGiKfV2Hub9BvoFvAe55WtODRMCC/AdG6/5xkn1P4ryqi35qKbb3shodJbhRzVk2nUlBFNUYeKdH6ABRRzcRwGs8ig2MGELP+IedtjbaRSQMcZQ8NW45oZ95sion5bRnEKmBRZXkieDLUGnVQgZ6gMLV4ed6DlNtyoQYrY1zWkCRspjKfvddCvXlXmSDqcGAHQqamFkcxPf8A0y7YpcRT1DXHcPBVoY2K0e7SaZdYX7CzZxKBfEuV4iTkVS0C4337a0jtOLfBiIG4bkrsJZbRb/jr06MGbWm2haQ/jJZzFmNqdGb/uLt3HAhHY6WeVJSZRNmF3E5zqaOKU90YVrJDrWckpvjEeox2kaUIvzvrmghR 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)(396003)(366004)(346002)(376002)(39840400004)(4326008)(26005)(66476007)(956004)(36756003)(8936002)(6486002)(478600001)(5660300002)(6512007)(86362001)(83380400001)(7416002)(2616005)(6666004)(966005)(66946007)(8676002)(66556008)(316002)(38100700002)(38350700002)(6636002)(2906002)(921005)(6506007)(186003)(52116002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?6D+3dQDAwLFneHH9qZ2vjg6fCajYfH9dphB1Mz4F5C6qf1Xd/p4oZmF7Cilw?= =?us-ascii?Q?eDYWk+bYf5FnWBDfFcIvwfoLqPrPwFu7r+RWhocYe5mhRY06XxLzGXvM7z+Q?= =?us-ascii?Q?9TNsUxQNmLoVO3+Bg2QwGMnoveAoraiEwSww9gW2jcS2x4Uyo9CewmvdlG7/?= =?us-ascii?Q?DlzIAkWg+HThxxBuFeshS3YqTkvrmgZFJOEQ0WHFH/RZ/Y8zr8oxgyPRG4MO?= =?us-ascii?Q?NzTUhPGQ+fRAmvDqngua1iXVFefvS6CY1xOlVJ7kCd0hAP8oiFNN+hyOORty?= =?us-ascii?Q?IXBPgr5GT6oxBJ5Al+GLSTK+iYkokUcQP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hWzAg8NHQLNADe7WIBWBjTsPqTsHHFPk+TgVm4PghhA1nkyjva?= =?us-ascii?Q?s4eMd6cbwHG2PoeQwIiruHIFlXl4l/7+g36QP5Mss6HuZZavUn2gO3SfuazR?= =?us-ascii?Q?oViwIGDdPDXAeC6UoZIb84/U?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: bc20d32d-c6ad-408f-4864-08d945e8b2a3 X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6688.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2021 10:26:38.3119 (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: F6hu6zdioHi3O56pXaf4n1sI4Uzeh86beI4YPkQu9JZ6EnGZ2+8zFxEv2MRrfzL8TjnVLHdJr1gYkrG2HYjPDA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0402MB3344 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 211299f..c449755 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 */ @@ -1749,8 +1753,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) @@ -1774,6 +1778,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) -- 2.7.4