From patchwork Tue May 24 08:03:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joy Zou X-Patchwork-Id: 12859785 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0BE3CC433F5 for ; Tue, 24 May 2022 08:03:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230133AbiEXIDE (ORCPT ); Tue, 24 May 2022 04:03:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52478 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234516AbiEXICz (ORCPT ); Tue, 24 May 2022 04:02:55 -0400 Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20052.outbound.protection.outlook.com [40.107.2.52]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3765C9CC8E; Tue, 24 May 2022 01:02:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MryyVEMhAC7SCVAKx0M6KUuMLd6XbIwoc1RioYRnJVMk4UXfLaGwL1uwGree7BYAG3SxvI/IFNqvLzxMbJX4NShiLJdyjf3sTmOo4bJKAwHFGGb56hrixWY2qtETflgZln9UPxsNdwdonCvaI+flQ5xQAMrCrSV9FH+Gw5M1s04pUxnedwH62yGtfF5xwHPCCJmjBxSxbRk4fsCyanvG47RithREqXQYujz/vMjc2FkCGgUOO4x7IWRXemPb7fbPvhbRrRDAfpNR8mvxd9gurSwuK2GajtpiW2HfwOrgqYT32s3CydGAQ7+XtZ/opZVB2FZ7tzy+z3KzwsUBOsxsOQ== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ClneRox/PTiy7ggxNpWpXxtbrpL7gck+vBCzjWrTUWo=; b=XJZqmg6/IstZ0tS/mGVhaudM0z6qu9yD84vy4jSD8NQ6RprJT4Rvaz1ZLTnOrs7YWz9MsYkzXxWclvBqw8S+jSoccA+nRQpwpbskoSwQVe4uL4SNMSoW77+dJfmTHuDMRa35pJxlng/W6pwDRhY2MtBSq4ELvG0yWjOFifFDaEIow3sEpTlEfdJb43nhCGCS1GHBYs/luPk8JXBDbmsw6JCrCQsqYIjm7jbxs4Fo+VGd84BWcAiR1VqDNz+q4X8cDPh5q7WV8EGf5rfr3b4LQK53kLD8okBg8x2dzCh2juKjKsKsTbLa5r/QLyZpmG1DhZSrEujpDutu1mB5fHFvcw== 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=ClneRox/PTiy7ggxNpWpXxtbrpL7gck+vBCzjWrTUWo=; b=IXLxhGlldJ5CcqYVWif5n2DmDaimcxDlfa5whD72GiixDiCjT6bHME+RO9iPh/flknabJaaYcU92QDVTohUlvgQwvkVxanaQAV9uJ5vjCMvwqNUh1YFxPi1UdWeeALzuMeAE/cOZczPtttj5r+80ZhKwiI8IjvhbjFKKMvn6dCw= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM6PR04MB5925.eurprd04.prod.outlook.com (2603:10a6:20b:ab::19) by VI1PR04MB5279.eurprd04.prod.outlook.com (2603:10a6:803:62::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.23; Tue, 24 May 2022 08:02:26 +0000 Received: from AM6PR04MB5925.eurprd04.prod.outlook.com ([fe80::5062:4c9c:e6b9:d72c]) by AM6PR04MB5925.eurprd04.prod.outlook.com ([fe80::5062:4c9c:e6b9:d72c%3]) with mapi id 15.20.5273.022; Tue, 24 May 2022 08:02:26 +0000 From: Joy Zou To: vkoul@kernel.org Cc: shengjiu.wang@nxp.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, dmaengine@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH V2 1/2] bindings: fsl-imx-sdma: Document 'HDMI Audio' transfer Date: Tue, 24 May 2022 16:03:37 +0800 Message-Id: <20220524080337.1322240-1-joy.zou@nxp.com> X-Mailer: git-send-email 2.25.1 X-ClientProxiedBy: SG2PR01CA0116.apcprd01.prod.exchangelabs.com (2603:1096:4:40::20) To AM6PR04MB5925.eurprd04.prod.outlook.com (2603:10a6:20b:ab::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 67dd724b-be02-4ca5-95d5-08da3d5bbd87 X-MS-TrafficTypeDiagnostic: VI1PR04MB5279:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ih/nSXJ7bMj4Xm2SJmI+khHEukGUI0DbOlxFgQhxjSMbrUS4G0JD3hfxcnNbBlMCi/GYTfkoMASkwDdATijqNzZjFhTvGW2aDU6iU5KuKhPBOfErUAlrrx6BbSWEi2p+7ILEezjSJehozkDcbeHue6pxC+ehppsCrhWadizSQm3htpjWADjbFzAY3S0yIgXK7MiC1zBezXl/W5RFZgzHUDTN9NR93mQrp2jVUuwD+EHgs0M/o3uK/tr7vfRE3k5iXYNC342QukTN4ogEQ5nE9OzdWy8BsgwEf2FFAHM0ObYijphVDV/l6qDRJ0fbfUu2aAGSA1hvCGdALrCB61z1xEalvi2zfS/ZtDPfofoXAIxNqvazuR0oC6xsg3Cp0XJUYZmBcQM3mbtB8rHC0NPlCywMRlVIPyv8VMVvPLhl8nSrMazf2aAcJurMFV9/w7rSmjKt0ogBNLxyDgIH5KyVELBfwND0RdszBO+irb3dBWixUMNAEMFFGkLeaKPXpFQD/I3MBzwMt/lyJJruF2Mvrwe+IWlx4gLWtwRfEgbIbcRvg81or2iMcoQyRXk8dMwE4X9/Gs7SDE8ZFXXXxDzzu8/cy375xseM5k1mSKEDypqAz/tSrZOztpEbRyYSPaIAxSlTMSpU7APs7/dArJ35B79ZxJyqxQo+pKUeAW+TTDu3GlOhbTgO3Th8EzUtXKOYa7kAEYGzjaUMOM+ZlBp44oD31vWMNI79pcNpq1nlaHSqu6AuwsdwCv5sT2puLfLklzG9uiAIo7RQakohaP/zhRZ7v8m0SMleaxJsig0iVAEn51V0LTSTszLeVllYbpF167UTo24TjWvV4CZmmHrQDA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR04MB5925.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(2616005)(2906002)(7416002)(1076003)(52116002)(186003)(86362001)(83380400001)(508600001)(316002)(36756003)(6916009)(6486002)(966005)(5660300002)(6512007)(26005)(4326008)(8676002)(6666004)(6506007)(38100700002)(38350700002)(66946007)(66476007)(66556008)(44832011)(8936002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 31MxfXFila+yeTpcLypV+d6PaNNUjJfJNXkgiU0rv7Tvak3vFPjD8baSPHJRKaRNgWXsoKOHp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j3ORHJlq7qst3FklGdD2mLHDryzMpI0lhfn1+w98xyQ0179q5FMw/H815ND7jjtDAFBYcWog9quBMdZPg07slcmlQGalF1yUAQ6fBjbRlUOQ4a1VSwn3XlClO2Qh+oh88EAtGfJqDTCWZTBckybaQV9zatRwXfHlH2rHY8GWRM1ZWRDYzuTZauXai7+vC7w/Cq4DBzqySECZS3xKuFXEMQR7heRH5tGFh2DXPQggb3wfCeihr5HIcF7XD7Zj0qTU9L8hUiQOVI1ChnhldVIYpL6ns0iaPsZ1mt19bUj6ur7QwPjwdAmLhDv4G/HMNgkHT+6PgSupzliesD+J+FaotBe619o+5M95dQo6fjMW1gFFC/R/diqAsfKwK/VuQHtKhA3nSKFHgZeJSwyGMBOPV+hrXjxy05akaXAO+DvCTJDWC64hBfnjWMi3hk4PsaYZjz413A3IHnVJNi933z7NHAEHs1GPwlDdEK9VirfFYBJHA1EHPnXfHxs753Zw8KTsCsZuna6G+bS8qcAriDkrEKhFsakFwGG1EXJBWCwvatSmmHTJIWLAZ5o871pNwUInEttx0il4tPajtlUMIw== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 67dd724b-be02-4ca5-95d5-08da3d5bbd87 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB5925.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 May 2022 08:02:25.9631 (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: ZqJj9HlID1xvp7koF8quSLzj+Vd5KQr6bES1ioCi6eRiVdeqhSyAM9DjBGeTK+My X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB5279 Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org Add HDMI Audio transfer type. convert the sdma bindings txt into yaml in v2. Signed-off-by: Joy Zou --- Changes since v1: convert the sdma bindings txt into yaml in v2. --- .../devicetree/bindings/dma/fsl-imx-sdma.yaml | 135 ++++++++++++++++++ 1 file changed, 135 insertions(+) create mode 100644 Documentation/devicetree/bindings/dma/fsl-imx-sdma.yaml diff --git a/Documentation/devicetree/bindings/dma/fsl-imx-sdma.yaml b/Documentation/devicetree/bindings/dma/fsl-imx-sdma.yaml new file mode 100644 index 000000000000..5b4f7a09a395 --- /dev/null +++ b/Documentation/devicetree/bindings/dma/fsl-imx-sdma.yaml @@ -0,0 +1,135 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/dma/fsl-imx-sdma.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Freescale Smart Direct Memory Access (SDMA) Controller for i.MX + +maintainers: + - Vinod Koul + +allOf: + - $ref: "dma-controller.yaml#" + +# Everything else is described in the common file + +properties: + compatible: + items: + - enum: + - fsl,imx25-sdma + - fsl,imx31-sdma + - fsl,imx31-to1-sdma + - fsl,imx31-to2-sdma + - fsl,imx35-to1-sdma + - fsl,imx35-to2-sdma + - fsl,imx51-sdma + - fsl,imx53-sdma + - fsl,imx6q-sdma + - fsl,imx7d-sdma + - fsl,imx6sx-sdma + - fsl,imx6ul-sdma + - fsl,imx8mm-sdma + - fsl,imx8mn-sdma + - fsl,imx8mp-sdma + - enum: + - fsl,imx35-sdma + - fsl,imx8mq-sdma + + reg: + description: Should contain SDMA registers location and length + + interrupts: + description: Should contain SDMA interrupt + + fsl,sdma-ram-script-name: + $ref: /schemas/types.yaml#/definitions/string + description: Should contain the full path of SDMA RAM scripts firmware. + + "#dma-cells": + const: 3 + description: | + The first cell: request/event ID + + The second cell: peripheral types ID + enum: + - MCU domain SSI: 0 + - Shared SSI: 1 + - MMC: 2 + - SDHC: 3 + - MCU domain UART: 4 + - Shared UART: 5 + - FIRI: 6 + - MCU domain CSPI: 7 + - Shared CSPI: 8 + - SIM: 9 + - ATA: 10 + - CCM: 11 + - External peripheral: 12 + - Memory Stick Host Controller: 13 + - Shared Memory Stick Host Controller: 14 + - DSP: 15 + - Memory: 16 + - FIFO type Memory: 17 + - SPDIF: 18 + - IPU Memory: 19 + - ASRC: 20 + - ESAI: 21 + - SSI Dual FIFO: 22 + description: needs firmware more than ver 2 + - Shared ASRC: 23 + - SAI: 24 + - HDMI Audio: 25 + + The third cell: transfer priority ID + enum: + - High: 0 + - Medium: 1 + - Low: 2 + + gpr: + description: The phandle to the General Purpose Register (GPR) node + + fsl,sdma-event-remap: + $ref: /schemas/types.yaml#/definitions/uint32-array + description: | + Register bits of sdma event remap, the format is . + - reg: the GPR register offset + - shift: the bit position inside the GPR register + - val: the value of the bit (0 or 1) + +required: + - compatible + - reg + - interrupts + - fsl,sdma-ram-script-name + - "#dma-cells" + +unevaluatedProperties: false + +examples: + - | + sdma: dma-controller@83fb0000 { + compatible = "fsl,imx51-sdma", "fsl,imx35-sdma"; + reg = <0x83fb0000 0x4000>; + interrupts = <6>; + #dma-cells = <3>; + fsl,sdma-ram-script-name = "sdma-imx51.bin"; + }; + +#DMA clients connected to the i.MX SDMA controller must use the format +#described in the dma-controller.yaml file. + - | + ssi2: ssi@70014000 { + compatible = "fsl,imx51-ssi", "fsl,imx21-ssi"; + reg = <0x70014000 0x4000>; + interrupts = <30>; + clocks = <&clks 49>; + dmas = <&sdma 24 1 0>, + <&sdma 25 1 0>; + dma-names = "rx", "tx"; + fsl,fifo-depth = <15>; + }; + +... From patchwork Tue May 24 08:06:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joy Zou X-Patchwork-Id: 12859786 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 28CD7C433F5 for ; Tue, 24 May 2022 08:05:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229600AbiEXIFh (ORCPT ); Tue, 24 May 2022 04:05:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57836 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230251AbiEXIF1 (ORCPT ); Tue, 24 May 2022 04:05:27 -0400 Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-eopbgr150080.outbound.protection.outlook.com [40.107.15.80]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 27FF09728E; Tue, 24 May 2022 01:05:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GdmuSgLS9vMGR8+2KH4TpFtoW+jjTrgXSQHheqgotGQSxLLWfMF9zjPvM9WQRuV3ZrjFTDA32ot4p5y9w70JkRKIO800Dj6KP6sCObKwXkPfi+70b49Pq4wb4h3bPEYUPOe3tjT76XRmJs4qS7ScIHjUb6IZIAaK61pW7TwuPTbBGyCQpoKQ5liuYbDkjQQGkSP/N3q94UHzncx0M+pMP0UOtV1QOpqnyU8qiLSrkZV8YFfW4NqzS4KUngxR/MUNNitbbOmTiHGcMQTPH4TzbfTQT0Juy1J3GI5mhCyoY/WRNF1/xw2B5YymkT5gdpDKoaasWZejyGV2pUfMtgJKig== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=MqQp8N60NJf6S873pcGyCZKiuP+SNSEVIVWiZsUqWlE=; b=k3B+W3TaVy2/vkLk5YnUvoi+/yQmTFgDIs38xagmfAck7IWwcitRYCbkumx/rusKCcXR0K8Zsx363riqyv0AMTjgZx9NX63e6Gg/FCiHrS4LeazluYvg0YMxKUwZbJihuiyX57gbhYvzPIbkmZFQ2dPD8NvXI55ZvysV9KvkX6CYAeqYsn2MwHdu4AETodfE2NJXAB0bWfr8qlcKH+lKHUZGrqz84dDBDIwLUQBOTv2aEr9PGPxe93hDnoO0FBWdjqH+hJwNL4ySuW2+fMW5KS/iN1YQVdsTPm5+sZsANm7WxJ6CcEpHoPXswpA7n2pAxTGZAjebx8dUCpSKf3CVzA== 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=MqQp8N60NJf6S873pcGyCZKiuP+SNSEVIVWiZsUqWlE=; b=CmrNbcXcJdFjojV614VFFUQke8H1B6ovtooM+wjAk8fOwPIakG2T4i40NiOzfSDeEgB5anjDAJ8WnTILzP6BIW0hoVrEJLi9zOk5dh5QgsE1urrJCwWD517VFde50a+GmBiw1m0Z9nPMJCGPdXTHIK+pTF7XygKiYYL1pA3f0h0= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM6PR04MB5925.eurprd04.prod.outlook.com (2603:10a6:20b:ab::19) by AM6PR04MB6293.eurprd04.prod.outlook.com (2603:10a6:20b:71::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.23; Tue, 24 May 2022 08:05:20 +0000 Received: from AM6PR04MB5925.eurprd04.prod.outlook.com ([fe80::5062:4c9c:e6b9:d72c]) by AM6PR04MB5925.eurprd04.prod.outlook.com ([fe80::5062:4c9c:e6b9:d72c%3]) with mapi id 15.20.5273.022; Tue, 24 May 2022 08:05:20 +0000 From: Joy Zou To: vkoul@kernel.org Cc: shengjiu.wang@nxp.com, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH V2 2/2] dmaengine: imx-sdma: support hdmi audio Date: Tue, 24 May 2022 16:06:40 +0800 Message-Id: <20220524080640.1322388-1-joy.zou@nxp.com> X-Mailer: git-send-email 2.25.1 X-ClientProxiedBy: SG2PR01CA0198.apcprd01.prod.exchangelabs.com (2603:1096:4:189::7) To AM6PR04MB5925.eurprd04.prod.outlook.com (2603:10a6:20b:ab::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e8957f47-256d-4301-afc6-08da3d5c256b X-MS-TrafficTypeDiagnostic: AM6PR04MB6293:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qwhtX7xeT7MQjrRJSh3jaRYugQ2cR/cIIjCl8AxVQ6R+P+wXOEHG+dMPB2KJvJGnptLuvoX80Nd9cNcbAd+KcKpyiyUVEL4xIWHQoKzmnqGhyMT7kUHgYrJEnhbxaQWHvx2dv5OjQx/lhEl/BPMC2lSHVWSX0EvQMNqGlo+NiUrClAf+OkS8XLt21l5Qt0yXsWUsfSagjaDiS44OCzmk+m3ByT5jY2NdnmRu/UnOmlxV7/VuoRXaozKmavXocDf0GGYQmgeP3sZkpCfIdgGgHSlxRnZ9xFXFCXFP87hSFWAEYzjlAyMQPFoS++KSPMbHVOx5G52pyf2ppcEDftIjzUnMdLoTSmiSsyGz2AT/BmsIQ2iHOz9L9eIOclBB28obuX7UDVsQKCbORm4M0yB761raZ6ngXIQmLe8WRHy2wDdSVAA5vb1ctAN//jzejvI7SFhYV5FBet4STSCTaI6rTPbhN2fFqxVK8LrBZoKExxdABI/ljU96NI5B044gybkpitwrtOQtCcjzvLeXRN2VqTbzAfqmoQykMSH9iWyLa1T1GERpV3sgbSF/kufCVqbpMIMu0TkXsaBmCdReAASL8kR/7ufGV6nI+cdqYT1BfS/am4FgihPPOS86iGfMO4ySL0qrvXk+g1VBTMsglUGYnEBDVSwcQpOvVrKHquhBd1R2d4h50pUSnmOePrytR9wVG1ko48AS6kZe4mfshEJsag== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR04MB5925.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(26005)(6666004)(6512007)(6506007)(36756003)(2906002)(5660300002)(44832011)(2616005)(52116002)(83380400001)(1076003)(8676002)(186003)(8936002)(38350700002)(86362001)(38100700002)(6916009)(316002)(6486002)(66946007)(66556008)(4326008)(508600001)(66476007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: /mKD1l7BRW9UI2mIzCYxsBtdq3XZ3DrOPylpAepWnwKaObDSZeFOGE+K6G0BF6BDb/DrT/8yxlZVbBArZz8IAiPT5MmxJpJi6q/sDxfCcpKcT7hP9qmcVEkM/7wr5g6Ji9tu0DCavdmmPfpY24L2zKPhfEyEjGzbKwLb6Ye8gj1g0K5+I3Tcq3qan/20SVow1lN6xGXBNGo4jID4xvRu2TcubtAYfZJll8GqyR8XsGc3JLuGN6+zWucwDohQurH1x8lLkSnV5FcQTynM6ZUBhnlBFRys5GauTGuPXiaMGtRZXnbX/1g2CCRKHZ3zdGeBVO8Q3Z6z5+yXMkm2fTIm/CYd/YxQ0LrrGciL+JN8TCg8CusSl+fpYMD/a08qAflCI+KFIHnieXWK0g1JpXNu3wAA3V1ld5hmtrGsgasqE8jvFcN44Uo9J54PcqeC4YNgn1rggVPfYcX13PA48m/oha1hQRDy2oIiLSX45HO0AODAer8Knz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cza3r0MUrid0RrEr5CKwGk9VE7CFcVJujqiAd51Nu7gRHZ1TC009y8fUm2b/ZgV3LvlERasfNSROpgWWoOv9AcRuV229piSQI/D8+D8mYrGJpq1u12ybDdjO1R7DQsIP+XD2zbjzF3I0q1BeO6xq28zvXxnpuiDwAiMJKSaohF1jyp3Fpw/nFpCZw== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: e8957f47-256d-4301-afc6-08da3d5c256b X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB5925.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 May 2022 08:05:20.2946 (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: jMDZ0hboGr17ob9BTiIuRIzbUK6d9NijylLdXymVONA+3q6pgWGCNb1PoCcKi1KY X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR04MB6293 Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org Add hdmi audio support in sdma. Signed-off-by: Joy Zou --- Changes since v1: moved data type to include/linux/dma/imx-dma.h --- drivers/dma/imx-sdma.c | 38 +++++++++++++++++++++++++++++-------- include/linux/dma/imx-dma.h | 1 + 2 files changed, 31 insertions(+), 8 deletions(-) diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c index 8535018ee7a2..e9b8b2e9f7c9 100644 --- a/drivers/dma/imx-sdma.c +++ b/drivers/dma/imx-sdma.c @@ -941,7 +941,10 @@ static irqreturn_t sdma_int_handler(int irq, void *dev_id) desc = sdmac->desc; if (desc) { if (sdmac->flags & IMX_DMA_SG_LOOP) { - sdma_update_channel_loop(sdmac); + if (sdmac->peripheral_type != IMX_DMATYPE_HDMI) + sdma_update_channel_loop(sdmac); + else + vchan_cyclic_callback(&desc->vd); } else { mxc_sdma_handle_channel_normal(sdmac); vchan_cookie_complete(&desc->vd); @@ -1061,6 +1064,10 @@ static int sdma_get_pc(struct sdma_channel *sdmac, per_2_emi = sdma->script_addrs->sai_2_mcu_addr; emi_2_per = sdma->script_addrs->mcu_2_sai_addr; break; + case IMX_DMATYPE_HDMI: + emi_2_per = sdma->script_addrs->hdmi_dma_addr; + sdmac->is_ram_script = true; + break; default: dev_err(sdma->dev, "Unsupported transfer type %d\n", peripheral_type); @@ -1112,11 +1119,16 @@ static int sdma_load_context(struct sdma_channel *sdmac) /* Send by context the event mask,base address for peripheral * and watermark level */ - context->gReg[0] = sdmac->event_mask[1]; - context->gReg[1] = sdmac->event_mask[0]; - context->gReg[2] = sdmac->per_addr; - context->gReg[6] = sdmac->shp_addr; - context->gReg[7] = sdmac->watermark_level; + if (sdmac->peripheral_type == IMX_DMATYPE_HDMI) { + context->gReg[4] = sdmac->per_addr; + context->gReg[6] = sdmac->shp_addr; + } else { + context->gReg[0] = sdmac->event_mask[1]; + context->gReg[1] = sdmac->event_mask[0]; + context->gReg[2] = sdmac->per_addr; + context->gReg[6] = sdmac->shp_addr; + context->gReg[7] = sdmac->watermark_level; + } bd0->mode.command = C0_SETDM; bd0->mode.status = BD_DONE | BD_WRAP | BD_EXTD; @@ -1488,7 +1500,7 @@ static struct sdma_desc *sdma_transfer_init(struct sdma_channel *sdmac, desc->sdmac = sdmac; desc->num_bd = bds; - if (sdma_alloc_bd(desc)) + if (bds && sdma_alloc_bd(desc)) goto err_desc_out; /* No slave_config called in MEMCPY case, so do here */ @@ -1653,13 +1665,16 @@ static struct dma_async_tx_descriptor *sdma_prep_dma_cyclic( { struct sdma_channel *sdmac = to_sdma_chan(chan); struct sdma_engine *sdma = sdmac->sdma; - int num_periods = buf_len / period_len; + int num_periods = 0; int channel = sdmac->channel; int i = 0, buf = 0; struct sdma_desc *desc; dev_dbg(sdma->dev, "%s channel: %d\n", __func__, channel); + if (sdmac->peripheral_type != IMX_DMATYPE_HDMI) + num_periods = buf_len / period_len; + sdma_config_write(chan, &sdmac->slave_config, direction); desc = sdma_transfer_init(sdmac, direction, num_periods); @@ -1676,6 +1691,9 @@ static struct dma_async_tx_descriptor *sdma_prep_dma_cyclic( goto err_bd_out; } + if (sdmac->peripheral_type == IMX_DMATYPE_HDMI) + return vchan_tx_prep(&sdmac->vc, &desc->vd, flags); + while (buf < buf_len) { struct sdma_buffer_descriptor *bd = &desc->bd[i]; int param; @@ -1736,6 +1754,10 @@ static int sdma_config_write(struct dma_chan *chan, sdmac->watermark_level |= (dmaengine_cfg->dst_maxburst << 16) & SDMA_WATERMARK_LEVEL_HWML; sdmac->word_size = dmaengine_cfg->dst_addr_width; + } else if (sdmac->peripheral_type == IMX_DMATYPE_HDMI) { + sdmac->per_address = dmaengine_cfg->dst_addr; + sdmac->per_address2 = dmaengine_cfg->src_addr; + sdmac->watermark_level = 0; } else { sdmac->per_address = dmaengine_cfg->dst_addr; sdmac->watermark_level = dmaengine_cfg->dst_maxburst * diff --git a/include/linux/dma/imx-dma.h b/include/linux/dma/imx-dma.h index 8887762360d4..ef72e00fb55e 100644 --- a/include/linux/dma/imx-dma.h +++ b/include/linux/dma/imx-dma.h @@ -40,6 +40,7 @@ enum sdma_peripheral_type { IMX_DMATYPE_ASRC_SP, /* Shared ASRC */ IMX_DMATYPE_SAI, /* SAI */ IMX_DMATYPE_MULTI_SAI, /* MULTI FIFOs For Audio */ + IMX_DMATYPE_HDMI, /* HDMI Audio */ }; enum imx_dma_prio {