From patchwork Tue Oct 25 08:36:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joy Zou X-Patchwork-Id: 13018717 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 1E93DC38A2D for ; Tue, 25 Oct 2022 08:36:25 +0000 (UTC) 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=Oxz3zC8bkeA1WoAVdZgUQtgcArvXMb8PsFXSVtTsHI0=; b=ckbSgK2oJBgAgR SKIXjS1241q4mCcvLYY5E0mSFOXvMWkpEjYeGCjQwuBUP2wIG02LA1WqCeW8rW2RVARFhNTdTldpU 7sbWTHpDObOB5Im2+4+W0f3MZG24NjW2Pu/1O96SQ+nAL9X4NQpQt+bH8sQ3ruLOG+wFGTbkK0uYn nim4CdixI8cCJiLcwFHZxuEwE+V8gfRdxcGIyLbolrDwP6MI+p65NaT1MqqJNxjIXcEFclz6NFPGX 7p6DJIF9di5/OvvgZCWRKu4fK38HgYSOwDuGTiTzrEikx1OdTvr4O1lEsWRo5rBNB1Jg4u2N+YqH7 w/F6C/oWS90v5KBSS1sw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1onFP3-004Lle-In; Tue, 25 Oct 2022 08:35:17 +0000 Received: from mail-eopbgr20043.outbound.protection.outlook.com ([40.107.2.43] helo=EUR02-VE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1onFP0-004Lka-5n for linux-arm-kernel@lists.infradead.org; Tue, 25 Oct 2022 08:35:16 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Vb6G67a3/INFVOAdRtLusRSxpXLdGCXEa/KOgLU7tIAvqG3w+tckPEaE2qAz7kBPlwhV5ePf2w8BagbqABYackBcZMAumtoqLf5RRictGNWBzVYcchR1JqJj3spXJ8QtFr4/yBUU+K9VyNFk7TJnY+yzPG5rG767t74ilnUnMUvo9z8d71wYWyDRg9X4tgZVzf0koeR2JFzUtVntNw/mXnxPwSPoWeXTLKn8pCU5cFfve5001T9oO+WCzh7txD3tX+v+31dQIm/TcnMJFvBzikt9BGIr2ny+ELNMy6WUm4ZxFlRVaqsc+yFuHtN8wrVfSKI2Y901n9DXOEVrB2usUg== 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=SylflRXXaFH8xi2NFIAS3qALAQHUaiUaXpNs+xde5Ok=; b=iabynQYEKELEqsSAt+lPlZeCr0mK56tIgqKMiNQLLW4Faflvw0k7GGxV2DTQw1yr7kk1lGQSJEK8U+gXfeMZweTiSypj0smbbHQai5KWuGAS0vkv7XA24/03FAhDFr6no2gETWUm93xVcv5nfhFn/gh9waL2pRkaj6vhA5TsANmlQFoA0z0bT90+OwZKFP5ixQ0XSPYUkism5Hre9GXEi0p14tGm59QRNKWidYHpKpp1BXcyc5Yl8Jfbs4AtCdZS7ECpP2zCpanIoOmSCBqZThTwoNQDKB2uBzcENm+PmRfOKUDMnxPdcIUY0hFoUGi/dZ1YciKnAJoCdU12ZEK2eQ== 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=SylflRXXaFH8xi2NFIAS3qALAQHUaiUaXpNs+xde5Ok=; b=pMmOpIO3H/MCxIFLTkPzt1eVuaeuwft6iSaM41/18hrP9mBMChEYV2BXLh2Y+u1nGp6rwUNsNmwndNe/H6s1Z3XhLtgWOxsKKh+4BS7++A+1LxRSrgEHRkayixZC5O4fKaHibV8dgwk0RbZ2a//wmCpjY+YM8myvWRMGIrhZXR8= 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 VI1PR04MB6928.eurprd04.prod.outlook.com (2603:10a6:803:12e::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.21; Tue, 25 Oct 2022 08:35:10 +0000 Received: from AM6PR04MB5925.eurprd04.prod.outlook.com ([fe80::7a34:469:fd53:922c]) by AM6PR04MB5925.eurprd04.prod.outlook.com ([fe80::7a34:469:fd53:922c%7]) with mapi id 15.20.5746.021; Tue, 25 Oct 2022 08:35:10 +0000 From: Joy Zou To: vkoul@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com Cc: shengjiu.wang@nxp.com, martink@posteo.de, dev@lynxeye.de, alexander.stein@ew.tq-group.com, peng.fan@nxp.com, david@ixit.cz, aford173@gmail.com, hongxing.zhu@nxp.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 v8 1/2] dt-bindings: fsl-imx-sdma: Convert imx sdma to DT schema Date: Tue, 25 Oct 2022 16:36:08 +0800 Message-Id: <20221025083609.2129260-2-joy.zou@nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20221025083609.2129260-1-joy.zou@nxp.com> References: <20221025083609.2129260-1-joy.zou@nxp.com> X-ClientProxiedBy: SG2PR02CA0061.apcprd02.prod.outlook.com (2603:1096:4:54::25) To AM6PR04MB5925.eurprd04.prod.outlook.com (2603:10a6:20b:ab::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB5925:EE_|VI1PR04MB6928:EE_ X-MS-Office365-Filtering-Correlation-Id: 3ddb48e7-930d-4f16-ee65-08dab663d3eb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: b+m6EwWnNRtcuL2lEY8zhTmvWyHv8AY7UtjP/9El0t7ceVUkIeoO08aU4nuweR9RnD1O48FZAnIvlRTjepL3TdLCvL2/ISUEqNShEAPkaPmZ2T/2wSY9BoxqM3FKWe8kSjWC4DucFWdDk9NDb/dMZ7cevoRA8hdUY4kqBkJHGObn193xM8VI+6AYOeLWtdvuw6THAZF0kVTLYlmNY7dUERh6Fd0NrcyqHGtM/gSeykpB773s0UPqGYeryW/pmyE2ek+RuCKHOSHdr3zfI5Wxrgc9CoVpbyyi0Uqgweu8hWX7JPv4YtnzWnPgLdWCQJ555E7q+Lvau0AiBR3FH36zMp+NYMeZ4dcZWKsFwMYsy9spPXK/8dwFg99BwMKytpWhi7YLEwGyt/rvdDZe8I5EZCnB1kMZ/pwV3r6vY+IK6uHDTW/f1a+SNblb1/piUM0WXtnkWWrxA1UWOq6XaGSNi8NtxSxWBwJDJlHYV+dDBJYhII/XfYxGk8DIR/6C1DKMekiLW0udbLioRa1q9w72spT7EKtVMJtWdMLVGzs9YlV04yPG7TVuXMN9tYAkT0VUZsIY8jbjGLs+6mOPQ4AqMUkXmQ5NjCPcfrLfVeeoM/eySH6JbnOB2Wj93dkYNGgO2UT+XNsCuRbdmN5Q08PSNOvQzXEKtHvBTiNLOHh/X57XQNJE7c6SO3Hy0wP/B9JI6HGqYALyth2dPzbzeUjFFJpYAghKzykFeiwVFoTX0ysoz+03X8VSUIOSRYqB8l62r24uJt4EEhq30ruoiqcdaQt55hLG9/yusT62HIrBvw+mw7wVeK/X3cBr94X8oG/uHyQjtTmcdlJ6jB7m/ui2Yg== 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:(13230022)(4636009)(376002)(366004)(39860400002)(346002)(396003)(136003)(451199015)(6512007)(2616005)(26005)(478600001)(6506007)(52116002)(83380400001)(186003)(1076003)(44832011)(2906002)(316002)(966005)(6486002)(8936002)(5660300002)(7416002)(4326008)(8676002)(66476007)(66556008)(66946007)(41300700001)(86362001)(36756003)(38100700002)(38350700002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: w2m5Z6X5wSRI0nvEIaub+ZmKjALVZy0wR+3noVtLed+ob1FSta/H1wMHBgmJRCr/dKjO5uLXx1vfN4XhAlkv5hCtDv5ATgXPpgPsoLGO4cGUklsXMaLoix0X/q4lvOF/ndHfmS4VfQBSMcHUrTqBF9lXMxhuLaG7agDGOMlT3rsk1tdg8HaGr76f5Mpz8TMduTgbhzLADCW1atN5BrcFyrkJ/JbsXjDkYSIlioUMn+TL0FumHgeVeFXAF56MTP24o1nlntDNDFqxVglIR63mGV3KZJh0KResXo9W3PTBmpemoKMMxST5JZKZ3T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/lsPtvOfBKqQm02dqzeY8h0CgBagbZXuN+TjSAptNPAP/Ny1RVs1ZEIiiA56ibucUSFKvBiQzrgzAS67yc7ztTR+tHaWd5/39LohAjJN/F9l0+YSPRxMxiB663M2BiT6iYM32xAoBSX57VarsTr6/bSAo5G92sDEcjGvE3tkR9Ib8SWrKjA/+cv7dCHVNm5G5EQYJ3qs4GmAFH X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3ddb48e7-930d-4f16-ee65-08dab663d3eb X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB5925.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Oct 2022 08:35:10.3099 (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: cEYm4QRfIfht4Zvh5ulC/VBq7S+Ae1EXJvlCIIjurQDKy3r1S+yiRNIjAcgV9PVQ X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB6928 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221025_013514_399949_F03F6C2F X-CRM114-Status: GOOD ( 18.27 ) 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 Convert the i.MX SDMA binding to DT schema format using json-schema. The compatibles fsl,imx31-to1-sdma, fsl,imx31-to2-sdma, fsl,imx35-to1-sdma and fsl,imx35-to2-sdma are not used. So need to delete it. The compatibles fsl,imx50-sdma, fsl,imx6sll-sdma and fsl,imx6sl-sdma are added. The original binding don't list all compatible used. In addition, add new peripheral types HDMI Audio. Signed-off-by: Joy Zou --- Changes in v8: add the dma-controller quotes. delete #dma-cells in required. Changes in v6: delete tag Acked-by from commit message. Changes in v5: modify the commit message fromat. add additionalProperties, because delete the quotes in patch v4. delete unevaluatedProperties due to similar to additionalProperties. modification fsl,sdma-event-remap items and description. Changes in v4: modify the commit message. delete the quotes in patch. modify the compatible in patch. delete maxitems and add items for clock-names property. add iram property. Changes in v3: modify the commit message. modify the filename. modify the maintainer. delete the unnecessary comment. modify the compatible and run dt_binding_check and dtbs_check. add clocks and clock-names property. delete the reg description and add maxItems. delete the interrupts description and add maxItems. add ref for gpr property. modify the fsl,sdma-event-remap ref type and add items. delete consumer example. Changes in v2: convert imx sdma bindings to DT schema. --- .../devicetree/bindings/dma/fsl,imx-sdma.yaml | 149 ++++++++++++++++++ .../devicetree/bindings/dma/fsl-imx-sdma.txt | 118 -------------- 2 files changed, 149 insertions(+), 118 deletions(-) create mode 100644 Documentation/devicetree/bindings/dma/fsl,imx-sdma.yaml delete mode 100644 Documentation/devicetree/bindings/dma/fsl-imx-sdma.txt 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..fe527d32cdb6 --- /dev/null +++ b/Documentation/devicetree/bindings/dma/fsl,imx-sdma.yaml @@ -0,0 +1,149 @@ +# 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: + - Joy Zou + +allOf: + - $ref: "dma-controller.yaml#" + +properties: + compatible: + oneOf: + - items: + - enum: + - fsl,imx50-sdma + - fsl,imx51-sdma + - fsl,imx53-sdma + - fsl,imx6q-sdma + - fsl,imx7d-sdma + - const: fsl,imx35-sdma + - items: + - enum: + - fsl,imx6sx-sdma + - fsl,imx6sl-sdma + - const: fsl,imx6q-sdma + - items: + - const: fsl,imx6ul-sdma + - const: fsl,imx6q-sdma + - const: fsl,imx35-sdma + - items: + - const: fsl,imx6sll-sdma + - const: fsl,imx6ul-sdma + - items: + - const: fsl,imx8mq-sdma + - const: fsl,imx7d-sdma + - items: + - enum: + - fsl,imx8mp-sdma + - fsl,imx8mn-sdma + - fsl,imx8mm-sdma + - const: fsl,imx8mq-sdma + - items: + - enum: + - fsl,imx25-sdma + - fsl,imx31-sdma + - fsl,imx35-sdma + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + 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: + $ref: /schemas/types.yaml#/definitions/phandle + description: The phandle to the General Purpose Register (GPR) node + + fsl,sdma-event-remap: + $ref: /schemas/types.yaml#/definitions/uint32-matrix + maxItems: 2 + items: + items: + - description: GPR register offset + - description: GPR register shift + - description: GPR register value + description: | + Register bits of sdma event remap, the format is . + The order is , . + + clocks: + maxItems: 2 + + clock-names: + items: + - const: ipg + - const: ahb + + iram: + $ref: /schemas/types.yaml#/definitions/phandle + description: The phandle to the On-chip RAM (OCRAM) node. + +required: + - compatible + - reg + - interrupts + - fsl,sdma-ram-script-name + +additionalProperties: 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"; + }; + +... diff --git a/Documentation/devicetree/bindings/dma/fsl-imx-sdma.txt b/Documentation/devicetree/bindings/dma/fsl-imx-sdma.txt deleted file mode 100644 index 12c316ff4834..000000000000 --- a/Documentation/devicetree/bindings/dma/fsl-imx-sdma.txt +++ /dev/null @@ -1,118 +0,0 @@ -* Freescale Smart Direct Memory Access (SDMA) Controller for i.MX - -Required properties: -- compatible : Should be one of - "fsl,imx25-sdma" - "fsl,imx31-sdma", "fsl,imx31-to1-sdma", "fsl,imx31-to2-sdma" - "fsl,imx35-sdma", "fsl,imx35-to1-sdma", "fsl,imx35-to2-sdma" - "fsl,imx51-sdma" - "fsl,imx53-sdma" - "fsl,imx6q-sdma" - "fsl,imx7d-sdma" - "fsl,imx6ul-sdma" - "fsl,imx8mq-sdma" - "fsl,imx8mm-sdma" - "fsl,imx8mn-sdma" - "fsl,imx8mp-sdma" - The -to variants should be preferred since they allow to determine the - correct ROM script addresses needed for the driver to work without additional - firmware. -- reg : Should contain SDMA registers location and length -- interrupts : Should contain SDMA interrupt -- #dma-cells : Must be <3>. - The first cell specifies the DMA request/event ID. See details below - about the second and third cell. -- fsl,sdma-ram-script-name : Should contain the full path of SDMA RAM - scripts firmware - -The second cell of dma phandle specifies the peripheral type of DMA transfer. -The full ID of peripheral types can be found below. - - ID transfer type - --------------------- - 0 MCU domain SSI - 1 Shared SSI - 2 MMC - 3 SDHC - 4 MCU domain UART - 5 Shared UART - 6 FIRI - 7 MCU domain CSPI - 8 Shared CSPI - 9 SIM - 10 ATA - 11 CCM - 12 External peripheral - 13 Memory Stick Host Controller - 14 Shared Memory Stick Host Controller - 15 DSP - 16 Memory - 17 FIFO type Memory - 18 SPDIF - 19 IPU Memory - 20 ASRC - 21 ESAI - 22 SSI Dual FIFO (needs firmware ver >= 2) - 23 Shared ASRC - 24 SAI - -The third cell specifies the transfer priority as below. - - ID transfer priority - ------------------------- - 0 High - 1 Medium - 2 Low - -Optional properties: - -- gpr : The phandle to the General Purpose Register (GPR) node. -- fsl,sdma-event-remap : Register bits of sdma event remap, the format is - . - reg is the GPR register offset. - shift is the bit position inside the GPR register. - val is the value of the bit (0 or 1). - -Examples: - -sdma@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.txt file. - -Examples: - -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>; -}; - -Using the fsl,sdma-event-remap property: - -If we want to use SDMA on the SAI1 port on a MX6SX: - -&sdma { - gpr = <&gpr>; - /* SDMA events remap for SAI1_RX and SAI1_TX */ - fsl,sdma-event-remap = <0 15 1>, <0 16 1>; -}; - -The fsl,sdma-event-remap property in this case has two values: -- <0 15 1> means that the offset is 0, so GPR0 is the register of the -SDMA remap. Bit 15 of GPR0 selects between UART4_RX and SAI1_RX. -Setting bit 15 to 1 selects SAI1_RX. -- <0 16 1> means that the offset is 0, so GPR0 is the register of the -SDMA remap. Bit 16 of GPR0 selects between UART4_TX and SAI1_TX. -Setting bit 16 to 1 selects SAI1_TX. From patchwork Tue Oct 25 08:36:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joy Zou X-Patchwork-Id: 13018718 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id C24C8C04A95 for ; Tue, 25 Oct 2022 08:36:29 +0000 (UTC) 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=AGfDjnPNyJmU251v+zwF50RQuiyIuWKSUQgXyKzaJJs=; b=yoRAVUH12WLgcS CSOeLK4vAL+KOMm0Wv3ieE/Wo3ZHiu8y9HzYrSC6kjuU+3MJ8ftVOtZZI2nz5IQpEPKvr7jWD8UMi 4s42FI+2tNwbXfdbG6SbD7f15HAnYN6hXdkGsDfSuDOFSw8f6ie9ldleY2CuMhK5yZ6e64wBMWM2G 3ZpEI27KsPYRek5CHFYfv1Kc+rYKIaWHbjc3jyqLMWgFg8+c18V+xPvhBjyFFF20fPfaJMVVmDFPz R31IiXkkF7eGc9ShbO/oZhcgM27+Zjln2VMWU0lvLH6GrKWuy7YmvzRr/45XIEXvvg4QAhMnxgIJn htRhGIhmQcwmkLMZwdyg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1onFPD-004LoE-Lw; Tue, 25 Oct 2022 08:35:27 +0000 Received: from mail-eopbgr130078.outbound.protection.outlook.com ([40.107.13.78] helo=EUR01-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1onFP9-004LmX-Bi for linux-arm-kernel@lists.infradead.org; Tue, 25 Oct 2022 08:35:24 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BE438h8D31rNF5R0iCEYFRM1U+8twoaFaHgGcryAd5cJ9l2OTF49//3nsg3N2HMA2YK91c2DFlQrIUf7uZuw+0XTqOVekbabhYsKNHmAk88I1aFddqWQ8fZ3/TWNvAc5O/8ifqQgcarxb17ZiT1FUh0WDcN3TBWQBq99haqIuiOvfjQ0VKXmgjnKrossIquapVSXhfIO771Di7tRcbiabI/eh3WpXdbn2yJ0s/A0Nemwh0iN2jUk2l5SnMv2ZSawe0qaKT5RoLdTqEjgQ72owFohbjnWvBjL9n9AzdR8GO15u6+bCTPDEBq5jXC3ULn/FFu2M9nnYlezr1cC5fThjw== 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=wNh9RhNK+gVdolc8RfOujvV7bD1ZX6aurSU8CsL7YAc=; b=X6cwQ4Gw6qrfmrh/6bieduvQl0HFFAdpYkkVQStyADwCEbrF2evasilQMF2nhBLZWD6NHQ8F3zTTgPRtSR1dyiIcrOfbYOouieSLIHMOHs4Yo7IrneFZYrWpgbxbsKE47RU+CUwlnrBgSWgksdxfQYcjli0HGyQx2jJU7kDOa8WVHSpASeaIskxve0BMxhbqX+IXsEyCC82BvkShMBsrA2wCl8eVlI+Rz/K0HB3oLFPJOV5eLDvpU3fc/OchgWWJw1IQiXgXkb2jFCgeu6TiiKufPjAY8eXQOp/PV3BUAxAtwnf7khFJnNBLqJ9mMQZo4TNlygBfgkrDTLhCpEfK/Q== 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=wNh9RhNK+gVdolc8RfOujvV7bD1ZX6aurSU8CsL7YAc=; b=f2vyuDGRLHQEAFFBxsQY4IlYurv3bwB09F8JL6ejB1xdlE1E2y/HuBFGhR6kOSc5lKXFUrcfLgjDTFpHT/rItEWX53Be0WXB/uEL48KRACdIVoO1N1fvI+/snVvBqe3WkkgREBpL9pJ2Mq1pCsTVzXfZJ2GsSy64cACyMi5pjVU= 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 DBBPR04MB7737.eurprd04.prod.outlook.com (2603:10a6:10:1e5::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.21; Tue, 25 Oct 2022 08:35:19 +0000 Received: from AM6PR04MB5925.eurprd04.prod.outlook.com ([fe80::7a34:469:fd53:922c]) by AM6PR04MB5925.eurprd04.prod.outlook.com ([fe80::7a34:469:fd53:922c%7]) with mapi id 15.20.5746.021; Tue, 25 Oct 2022 08:35:19 +0000 From: Joy Zou To: vkoul@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com Cc: shengjiu.wang@nxp.com, martink@posteo.de, dev@lynxeye.de, alexander.stein@ew.tq-group.com, peng.fan@nxp.com, david@ixit.cz, aford173@gmail.com, hongxing.zhu@nxp.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 v8 2/2] dmaengine: imx-sdma: support hdmi in sdma Date: Tue, 25 Oct 2022 16:36:09 +0800 Message-Id: <20221025083609.2129260-3-joy.zou@nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20221025083609.2129260-1-joy.zou@nxp.com> References: <20221025083609.2129260-1-joy.zou@nxp.com> X-ClientProxiedBy: SG2PR02CA0061.apcprd02.prod.outlook.com (2603:1096:4:54::25) To AM6PR04MB5925.eurprd04.prod.outlook.com (2603:10a6:20b:ab::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB5925:EE_|DBBPR04MB7737:EE_ X-MS-Office365-Filtering-Correlation-Id: 5d7ee84b-e53e-472e-e350-08dab663d96c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: d18zTHBehdkAgu9t2hxF0TDTEEutBGhll1pMUKTSQRooXbh8IxTkO30tc0JMdEaeuNeW3DzAckiSUayfhndmGj/lxwD+fm7GRnxlpZqvpHloeod3w9jS1wydPyEqiTu9NzH/WN1Y1ajffRRaTDMuEe6cwaJsXC5SRK3tU7dmMweeX8slZQ9dOdbD6BTHh0YW1G0hFxr+zKotpBwj9pXdU87Kpm92BbXtapzVV8vrIVFHp7X0aR3/xekglvzEFVNNG3l78sn7KjznP9b4nXM8GtZPWsKjhpVQJikMpGev/xDNi+PUKYsAIm3ktmMSt7BuNOZq6L08NlkbPCFyQcGY2uiX6+r8SQwJOY+Vo2dXyt/+np3uPq8RGJJcuzD6FiqP1rmdWw1mR8HYvX3Vwci9qFS6sYzcbZ/eeYS9OGGd7B8+PLNnEN/8WogZrmy49aDyMNWmkCv/bGBxnUPZ7URZ28ETjZ2nYP4YxYHPcAeWjlS5RgymfiN2PU1zaT4X/j8LSXo5s9A02iXcCbrDK5A1QBgf/cwCumKZ0RaDRbSKSNpamlxuxZ7s5Pk82PVz2tIM57CDeOqtfNUebovxT3Cm7UdXIfsSHs+AyKsJV/U1lf//GYDWSqVLjK8X+OCE8emTNE19uTweuqlv23W2ePleNDEy3HgSC2vjvyAhdgoMEAxHgcqT7Ya0Vybqm6DutZMdLHtBQiO1T951vei0YTa5C5zwXIlUkpA2iM9t6G6HdXjLp+tkYtfbCQI+HTnPeTiDpHI0wu7yF0knF7wVzEsZbw== 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:(13230022)(4636009)(376002)(396003)(366004)(136003)(346002)(39860400002)(451199015)(478600001)(6666004)(52116002)(44832011)(2906002)(4326008)(8676002)(6506007)(26005)(6512007)(316002)(38350700002)(7416002)(38100700002)(8936002)(66556008)(66476007)(5660300002)(66946007)(41300700001)(6486002)(36756003)(1076003)(2616005)(83380400001)(186003)(86362001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: jBncPL1U8SKnEJ3rDf8KKYREQr/Cbgnkym7RcE0TZzBTuNsjUI2AgZ8pPupqoCdSzbAXT0xwaBQCsX4zCXg4o13TY/FoiOokCUYTHiWV04gq9CBr1Bh9nugOCBeZgOUY0cs7r0akKtw3I4brF3A1bIhUmduQxU2oU8j9GD7zSSrsHa2PZqymIQsgQmV0L1jmKMC+szoIleYz4EYOoG2td+q9w96a403TUsRO3ZJVHr0eutaDAYsl9BAwdQkYdIXg9adCUyzZTT7pNgHl9Mh2QsOLI0+hTfmBQcZBU57/DmE6VmHYNDBWDozDSYkiB7EF2zzQ1d2ffhimLOKZ9n8My9qVpz1S1hLVd2Pqz5mrXalUdwS8iQiLu+TR/YcaqO3o9wVWald/zjyRVCXbQ16tr0WBKRsEr3rJXp6QLCsuLueltREZtN7JbQHLcMJI6IePFS1AzdY8IfD30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FlRig6uP4zLrsvH4jI3kejdUEbespqq2rzBCZEyHiER7J/o/kELFZAl X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5d7ee84b-e53e-472e-e350-08dab663d96c X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB5925.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Oct 2022 08:35:19.4812 (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: /vjeW8ua7uzkxebb0jMYi4T2NFHjPo0HarwizVMROoIuStqV8S9+XGDaFZ3d5v2P X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7737 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221025_013523_431847_84624906 X-CRM114-Status: GOOD ( 18.36 ) 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 The hdmi script already supported in sdma firmware. So add support hdmi in sdma driver. The design of hdmi script is different from common script such as sai. There is no need to config buffer descriptor for HDMI. The cyclic capability is achieved by the hdmi script. The slave config is so simple, only config src_addr, dts_addr and direction DMA_TRANS_NONE. Signed-off-by: Joy Zou --- Changes in v7: modify the commit message. --- 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 fbea5f62dd98..ab877ceeac3f 100644 --- a/drivers/dma/imx-sdma.c +++ b/drivers/dma/imx-sdma.c @@ -954,7 +954,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); @@ -1074,6 +1077,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); @@ -1125,11 +1132,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; @@ -1513,7 +1525,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 */ @@ -1678,13 +1690,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); @@ -1701,6 +1716,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; @@ -1761,6 +1779,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 f487a4fa103a..cfec5f946e23 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 {