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: 12375603 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=-20.5 required=3.0 tests=BAYES_00, DATE_IN_FUTURE_06_12,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID, 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=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 DC111C07E95 for ; Wed, 14 Jul 2021 02:14:29 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 97FFD611AB for ; Wed, 14 Jul 2021 02:14:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 97FFD611AB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=VffwodIi+k1R++CdYOe6gXO47LiFJcKnUbZocwtaBxc=; b=yuud5s89eNUq4n jIEufCAD9NA4LKOgNsKDyJEDPZZ/1kdMv41GIce8I023dh1k2YdfvuMmHTuuXu5rJOLh/vobX1RVF jifNDtMhz5hv8cDOxzsdOU17m+IR7KftMpWxjApAqB0gl/rOaOboYXy6JwymvcA01owH+X/Azzl/S baQJUOXniqdoSD+k9G9IJiFx0BFt31u4n7SuBoJNaU9H2frNNSlaNlmfEqGwN9D19TX6qAIBIT4bi TC6RaYVceukdr/p59mgb1mZPfwEGGhNoM1V7DjsnX+Sl4+6U6Kun8KCxZr0YjdZN/Ng6TbzuXNciN hc/fDJIOQRRGHpVdmOEQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m3UNA-00BvMj-VC; Wed, 14 Jul 2021 02:11:42 +0000 Received: from mail-eopbgr60085.outbound.protection.outlook.com ([40.107.6.85] helo=EUR04-DB3-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1m3UHS-00BtTC-FW for linux-arm-kernel@lists.infradead.org; Wed, 14 Jul 2021 02:05:48 +0000 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210713_190546_577149_F3AA1D1F X-CRM114-Status: GOOD ( 16.12 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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)