From patchwork Tue Nov 15 09:38:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joy Zou X-Patchwork-Id: 20268 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2613976wru; Tue, 15 Nov 2022 01:40:31 -0800 (PST) X-Google-Smtp-Source: AA0mqf5WdrWmLbG7J0blUNZ4GBwBJW17yrKPhCfk+9WH3bdM6Wj2o9sO5SOMM3y50Df+qqAAcDhm X-Received: by 2002:a17:906:6b88:b0:7ad:8480:309d with SMTP id l8-20020a1709066b8800b007ad8480309dmr13149672ejr.156.1668505231774; Tue, 15 Nov 2022 01:40:31 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1668505231; cv=pass; d=google.com; s=arc-20160816; b=08U6PpGF8VjGwH9jD6cHM9FlMFXlWEZivP0zuMS1NwZexlBb5+qdArpb1wAiv/CmOq AafBnJjPoRr6LO8Cog7vNBbwdXUfssf3Q3IwL8tHcM8FaA5iZ3dYl8EnOD/d/L+AgG7b 5USNiwqdNVMudWaH/WuOa2/FegoczERbcrLFNJzeFiuXls1EmgioIEMAAcHfOj7DnsxI 4qArUq3AxekQRQZJfdMBbBHyCJA5pGtx4/L6b5bhAZ0HaD5LSlF9EduSkETliZGUJktW ar62fyOvf637PMJNaWORAZwXIcuH6GgnYFZ7/MeTWH0ZVC2EU36gKy/UonpHwS56c0Zc 26lA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=yHebfnZTxJDDCL+ZyNibYPD0eTXxe7WPyqFWM6WXrzU=; b=BVkNv5rZbUeHhAizY5v9mbRRB4PoC6IvLQTL2d3MEGWrmdPe4j/bF5oL5F6mknWZ61 0J+2UUSMBxy72w3/NHx/MJTuUW7xXvYbSeNPR9S8pwcjih/UQYSj1WrLKjjrPbgLkW7q 9Cp4v69ePwgbI+uaP6VeJEpIEYeDlOSnK/wjousfjkeiV60AaXXUo1IVyXH8JbmqPNl3 f42HmRaiTYPj/LU0NTbhRz4zdXiwD+LYzsQ5AyS1+VSExjPyvPxvlLlb7FrPbcLviGXI wJxz5/jH5WONrPGBV3OAL/uo6Obufk6J8YosFrRC0AADGOe+tPFEyW6osJvn7rf5j5SQ fulQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b="NLxrKdw/"; 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 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hq6-20020a1709073f0600b007ade82b9e73si12841748ejc.757.2022.11.15.01.40.07; Tue, 15 Nov 2022 01:40:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b="NLxrKdw/"; 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 2620:137:e000::1:20 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 S233041AbiKOJhY (ORCPT + 99 others); Tue, 15 Nov 2022 04:37:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59946 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232824AbiKOJhT (ORCPT ); Tue, 15 Nov 2022 04:37:19 -0500 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70048.outbound.protection.outlook.com [40.107.7.48]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DD7B813D66; Tue, 15 Nov 2022 01:37:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nXyKGKoFdXCJ6BArh/yBo0Xqnd0L74m3uEYpl1Y+BdBZzrRRKz1F9tAlKAZSnjuMHBjqhalrzqmRWqmJ0LHwDdU0anz4ish3RK/QNU85DXzNV2GyFUHbfKvw0ZwCYypk1gjAMfpNqhCpAhWcOV1f+8qJMnh/mqV3ettsU4sZ1wuLK7ByjKHGWj8TaC5mNpSW+XJx9z29QddRv2INLP52sDSbx+TZxLP24YT7k3mcK5kOpVYuKubobgMpJPlqr5Q76qtshb1icLGWjtyU5AV2GM5lcofgZP9T1mU1GuSBnwh5ARevWlJ6qC/mYeQ3qdRhY6sgjvJeSo78yVbGTX/Y/w== 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=yHebfnZTxJDDCL+ZyNibYPD0eTXxe7WPyqFWM6WXrzU=; b=Sj+jGNHGVXoDY1/cOq2UbLbesgQEYlREPNgLvZZM1HvK1T3zj4xI5LP6SKoHZ2oVQvYcyGbvNRiGxme4uB0hKVz0fphxkAZNhE8+I+KH330nTvYO7r96E5C4UdzFlpO/gQEHZZOIcfCjzAbWkqvH0DOUhb3/21cePfK9r/dC82azXdhj/PV5BcTjEmjkJOo8G+VeBgsuAg8wGlEpxUdVixD1x8YwnmXuPyXN70TuQmgldmUQfTKjC4pQpzVRdD1B7dekYrQp31yxwaAiQ/cDbCuIsjNLRL18JFQw3Gmwbse1FBo42LjIHW5vjT/ximiwM0nvDiPoiTZL9L+8j36M1Q== 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=yHebfnZTxJDDCL+ZyNibYPD0eTXxe7WPyqFWM6WXrzU=; b=NLxrKdw/t+FumREW9/viCgCjiRtzWbTaAJKhrcn+2718O70u0zYPg3ADfhmE1j267S0bralIQ1r4y0jjsgEIkDEE8oX7O5II3iV4gpWQ8BPmPu5s6lJYEe15DUDZcjmAa4hg09uIQg9NetsSZSR3BLgqBtW4UyHWbh/3vBfj7a8= 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 PA4PR04MB9462.eurprd04.prod.outlook.com (2603:10a6:102:2aa::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5813.17; Tue, 15 Nov 2022 09:37:12 +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.5813.018; Tue, 15 Nov 2022 09:37:12 +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 v10 1/2] dt-bindings: fsl-imx-sdma: Convert imx sdma to DT schema Date: Tue, 15 Nov 2022 17:38:22 +0800 Message-Id: <20221115093823.2879128-2-joy.zou@nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20221115093823.2879128-1-joy.zou@nxp.com> References: <20221115093823.2879128-1-joy.zou@nxp.com> X-ClientProxiedBy: SG2P153CA0017.APCP153.PROD.OUTLOOK.COM (2603:1096::27) To AM6PR04MB5925.eurprd04.prod.outlook.com (2603:10a6:20b:ab::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB5925:EE_|PA4PR04MB9462:EE_ X-MS-Office365-Filtering-Correlation-Id: 7cc474fb-3cbf-410b-cb95-08dac6ecf95b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: OkHBs6gGk5WPGl/wxSDHWOAy1oB0AIKXWrUImPd0sLP5alHAZLQ2jP+e48p6aooVFN2sSGUwkyCMJaLripHrCbtMIv677dviiqgfF78RqY6kpwGiQj3XbBt4pyt7xiKe2BhUbJqEYjOo7HbllH1gIc1rxjNv5cQx7Oj7WMKTlpGeQGMpI5dUEwuqU6Y4Qre2Y0T7WQe0z21g6+3NX7H3S9bYi5vEiklj8paFUQLN+Au5l0b5+Ikul2rtclEBouh+UzyIaCDJF8vIpgWDegfWSB6kpNVc3ZeBe7DsSTz9c7xiWip2k5QIBmvQwc9K0Rom2HXlf+kPUemVcT7Pt6MXNY3V/k8EY3MO82NtJ617qFlVdKXGrGkQHCHB+7mYiuy5JMdxPtFopKIOarcjD5UhN8PsaEQRHtLeH9XakygIYR8hOOO+RuHnCewQ48NPF8w5Las2R4KAOj2TOwSmfQRRvOJRj1hSTBwsewPjYtRkYE5n2iLVm33rpYVhMro4oSt0Cpem3PyahF+33O/Ky5njiWktnULtayTKxk5+5a6zAyIj2mBIJ2p0G2mumofiXv7QcseoCEP19/CThcXqjZuQ1GfXH09h6+dUUpUP8xbUjSQ4ah5cDoFbXWH3hMU1OykJhnc96reya6LdWoiQfh4bkBjVc1P36d/HEId9Iml1LJA1LXh8kV8BTg0UiyXIrhw1drcDKf8WhNK8fE83Cw1lwnk4U/Fne09zHOZ9w2Q0XX1zSptixWSpRZoqQ6OLJfNZeQqrQ3EnIuCjDSZSc3wLa0vUxVI00l32WXIzEIn76+F8M+gVpPdnj7fxYjCLmxuvvtr0HHIQq5XvKPXCdcGJEQ== 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)(346002)(366004)(136003)(396003)(39860400002)(451199015)(6666004)(478600001)(6486002)(966005)(5660300002)(8936002)(7416002)(66556008)(36756003)(6506007)(41300700001)(2616005)(52116002)(44832011)(2906002)(1076003)(66476007)(316002)(6512007)(26005)(8676002)(4326008)(66946007)(186003)(83380400001)(86362001)(38100700002)(38350700002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ZcP1H04mcYxu5NF6LSE3BZ76yet73eb4yfJuCoXmvRWPphOuaXJqGbSBYgegCUIN+2oixkNp7MMvUcGLwxC+SvB+X08d07bl9s8UJnHsuhQ3yerZID1gLvJAt0CBJQ9F1fOHVcxhDeJ//0HI3Qj30xt3/h7uQppTJUSL4ftC2IBmcD8sbeYiycsTZHW/yizMvY9Wb4LtLUMeIXxYtNiP5iYH8cHX9Y8D628csoPjtaa5PmFY9vHsFrYJ24hcaPA0eW4XgZFhH8I1bGte/JiNDr17vuSp3uC5s2XDcRDQhOVD9nv1o2OAOZd126H0I94hbvwACYiWjW7vNnjp6rSuxWK4bwyBc+9Zrj9X3hR8w/sqXoXKZaJ1TrCBWAH1dQR5CXw+4EsqJqjHvbPDWzUvsdkG2Rq6zFwDcQJBUGweGmHCXEzK8QThTSL2NdKq+KsH7bRCpenHExKkQ4LSyST38LIuua33fQgshXT4HovSQpipF4CR2UmZTzNLD/zinNneBYh5StffGEtM5NVG5rS+j/apB8FySzYwDQNjFV6WLB28oWlypjtqgpY1xSa3EIVIrC6KPg4CcdedRt3wtWAcsV42CmzE0U+kAjmmiZwr1h06hmqLJynu5pgLicYohN2rsDaDXQi8X9S9rjTYoZshSWBfRuEedCGxlh8WcrAqgwN72F/pxcTtS4M6e1wOivw4mR2V9iNZfCCsuqIdk2USMm9UW/Gkhp4wCeavF6XR4L9/iSEzHfJN3o3ZVA8xB0eeW89vjnbcJQMOpXF/mkyYnL5WOPuIgWCnskpzvaM+3j9lwcZu4fRLbKdvfxYxP7xrt5mgA6tox5WgCSMt0J2szVrb/3U0gQvrxm4dqY8N2h9DjWxSG+v0B//Ej/VAB3IxgwnXjHH02vgZe9go738QCYDnH0M1E2VJaKolp7jwrt1smksd9oYEqck8JF8nXpabK4ZnKyDVJQlVsKMgkz5NM3rX3mmQnpxengMRRBqS0I0K6+BxTS8mV4S2naeNJiRlM3xVCOs4fCsIle0Wkt+KHm0gjqLqetd+baNNubwxo4ICcTsNVFqkarsJ64N60e0LFDquJTSF+WQlGrvo8BQpQcmqX7+JuBEMUO4x96oqKS1YQaI2fSeiCgpmbxrTD833EYlleriWuKX2NEnoNCQy13N/tUvOmCFoh7xg2QQKT8a0CFy9eHHi404Z50x3geE+rG3HweHTX8mQ+LGzQ96p5ZhSisuB+yRDOwMtxyTaezzeIrft21Xmho0jPGfmuYVAXnPYxjkrk+A+WWgVbcedKx8gBynNYg46yUe/2ZiU1IeLOy3PJo9fpHj5+LMZygpj4GdvFmxOhdcEN+MFSX15wj63cyZHq8LC+etkd5nrWwneas0SrRUyLk+q08Bw3+4xLg53YZQEqM40HKDch/f66m35DjItLY2zD3zP1vYz7FnnEAnqi3z+fgfvTN4SkG4nEsqWjrI5l2ziEAMjVsuwlLdq6Wj2aRDan1gfpVXnN5QXk25D7PZBl182wov2O7bkugiCSzmPlsT8XbVsK6vFAX4mOuJebU9BupAj3ukeAuC+WuwJ4q//fWTfEwWWIbpD X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7cc474fb-3cbf-410b-cb95-08dac6ecf95b X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB5925.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Nov 2022 09:37:12.7126 (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: wNA8lW/EVdK4wuGrbgRGXSZ/F6xIxOjai4VlF7onHgdRd5hNjDT1jfmJ9kna3fJR X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR04MB9462 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749554541922076551?= X-GMAIL-MSGID: =?utf-8?q?1749554541922076551?= 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 Reviewed-by: Krzysztof Kozlowski --- Changes in v10: change refernce the dma-common into dma-controller. Changes in v9: add the dma-common refernce. delete the dma-controller refernce. delete qoutes. Changes in v8: add the dma-controller refernce. 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 refernce 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..b95dd8db5a30 --- /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 Nov 15 09:38:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joy Zou X-Patchwork-Id: 20269 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2614041wru; Tue, 15 Nov 2022 01:40:43 -0800 (PST) X-Google-Smtp-Source: AA0mqf5xctE4sHl1xpnqZQfd9e3znfpOzv8YNOa5T9WT3dAUy8I7hLRrFwN0zBwgEFqOKcRi4yPd X-Received: by 2002:aa7:d58b:0:b0:468:4c9a:7c6c with SMTP id r11-20020aa7d58b000000b004684c9a7c6cmr969107edq.397.1668505243272; Tue, 15 Nov 2022 01:40:43 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1668505243; cv=pass; d=google.com; s=arc-20160816; b=RXsLn05S/GvLCZVqtTZ4Qy03yMQQjaX9+1Ww3pgNKxjxYICM5RNgInN4K7ky4rqHgQ N3AL5+MExVyCyxBExSlhx9mmn3YJPxr2j43eev5gD2Mp7HhGlRm1mug4uiWkZXas247E ROI31s+4hgKd4eeyGcpivFbgqYKZZ0rwtmXaXwlE7u4o2K/bcuOT4w8GavxQB7ego/v2 VUvCwFrFRBEve/5C73QKAGlYrVg2lbLEod8WuXfsO2ITNpedK4iwx7TGhcB9O6XpTxow +TWtmT5fR4UWAQEZ1MiqhwSNmHO/5p7XXyT0/rTql1RAcQC1xsGNWuhq+cBMXZKak9rP 4fng== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=wNh9RhNK+gVdolc8RfOujvV7bD1ZX6aurSU8CsL7YAc=; b=pzfPZrY2SBZgRG0z8HoJ4YHVNgGfuClSU1QwVJi12APR790hxIpx7XByo0AdadxJof dgsPgM2ziW/XlGno2x26Rm32g1g57vGxGYu1hJZf4CuUo57JnpRwvtLATQ5quG1lvJOZ P7ps1ReXt1X0l74THvpP7DnEc853TZlvrzPdn66uolNXk37CvUKJGVA3jrAttFVpAvlU yIBmf62jDFeH42ZZ+yGOVdM6T4yHvIgnkhgAvBC4t0HBFgAj5XcBI+lkr8WkDP+TZM85 l7xwFKXFiRVS9+DfpUziAcFOAokRJts1pcJASlFOHJUBYod7jHyTlMCmAZvBzn9vrRLy zUUA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=VdPQqBXh; 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 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f22-20020a0564021e9600b004617bf36c3csi11576318edf.308.2022.11.15.01.40.19; Tue, 15 Nov 2022 01:40:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=VdPQqBXh; 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 2620:137:e000::1:20 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 S232976AbiKOJh2 (ORCPT + 99 others); Tue, 15 Nov 2022 04:37:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59970 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232880AbiKOJhY (ORCPT ); Tue, 15 Nov 2022 04:37:24 -0500 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70074.outbound.protection.outlook.com [40.107.7.74]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5B1F917428; Tue, 15 Nov 2022 01:37:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FDIAxhndZrDOIxRVj/EpAK9FKK9/MM5LKlWhdmRzVwExir3x2VOnaEA1AW5XRGkvREAz6jOxYJdira8m9pjsdi+0N/36NZDxpBj/58B7+IQ1gLlNoplL81GYftmw4JJGvPbc/XXDJVuHXZO9hHO2SBp3ui64fA79jXeF2s8xIxVagKHT3rLMWHxOPXsG5PaXqvwvAWHP8Pnxys4Ahxn/HfsZMxOUg8Z1M4dESl/zw+cYOtRD5He9m5Iwt5nynqFppgd3knTaWmHOqNstOFHtk9BAb9CiQ3YF37bmPmisRx27qZcL6fpBbeKp/8Af1oQRyWGZpyPKGzuW2dTw7n3uCw== 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=ogOd9B2Gz/T/xHmB3PU8raH0qC0IrCsEJaQm6CxhqMcK1D493y1hMKRjHlGBv+GTiADfSGmBo/3Cz9LIuMs8JfSyV7O9ULgF0hD4tT2EYa9FlJtQ26ABikUfGWL/dJ3V8HNYY9JFKe7Myfz/+taAcrBwtyUqizWqYcU2h1dHD5MlWRS1f8ZXct3ZtepisfAUMUXaAlaXTpYuAxW9uGpVQmFG1eX2w/qQ8IySSiK7TGgI7zVUzS8nLSOos66BIvm6cJxOgGwON+PncA/7e9+ubLDqLU+nVRCuNMu7S+GnMyXhraXEZCYukIUMf7nsslSqhj5NDbCWa9V5+q0Rzlf07Q== 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=VdPQqBXh/GCD6JH2E/XB/3C+6oUUbjoAuNEUjyJ2yU6LESCYh2gg/IuFX6V9GK/qpjaEnK0SOlKTxZyiQN6y9csY63VG9NXFwac+mVVYsfoayQ8IqNi3GCgFppOmacE6EecwkSahJwFi7uwAdhyZxYejk1NOeu8VHOXJfihB5vA= 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 PA4PR04MB9462.eurprd04.prod.outlook.com (2603:10a6:102:2aa::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5813.17; Tue, 15 Nov 2022 09:37: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.5813.018; Tue, 15 Nov 2022 09:37: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 v10 2/2] dmaengine: imx-sdma: support hdmi in sdma Date: Tue, 15 Nov 2022 17:38:23 +0800 Message-Id: <20221115093823.2879128-3-joy.zou@nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20221115093823.2879128-1-joy.zou@nxp.com> References: <20221115093823.2879128-1-joy.zou@nxp.com> X-ClientProxiedBy: SG2P153CA0017.APCP153.PROD.OUTLOOK.COM (2603:1096::27) To AM6PR04MB5925.eurprd04.prod.outlook.com (2603:10a6:20b:ab::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB5925:EE_|PA4PR04MB9462:EE_ X-MS-Office365-Filtering-Correlation-Id: 1c536565-aa0f-44bb-c15d-08dac6ecfd93 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Qd21CLnqaqVQtTTHP4RHxBkOkU168mieaDlCFr36xjIdngJnxZUWibVc7eYUv+VHnMZpRYc3MVx5IghYONQlRSLIbOkev6M2PDJCSU9LOm7f7bZFjAielmalaL0E6+RkWK/Z6WdkCvpZlTKgRhlcp9FDhPVa4Dz/f/bg506SkhLbKnBBLEC3Q3f5wS4TBSrX2g1zcBlkAwIjCJmiHJsE5V9Cf1S/8ye3tMHtc2zRDoRnu+fIw7397YNc2eJMax4YDcsO+qxH5ke2le+xcwUzO7EasEwb7UkNl0/oxl+Mp424kLNi+Hq+Vfv7fMlHsQ87UoR8Nso6cFdhH1fmoaoCnCN7/79OugDOwqCeWeCipBTt6a6T4LM3egnQZ5u6ncLARBwUn6/bbaCsTiRWuwPZa6vtsBznBtug0tYaDWfd7REKgPZDQiMl4MRuuKmue5EI7MXwg6Fftyi1FTadO3CoE7iWwcvizKclmUb4W/SfXGepnpJJ7wG8tt2MalbIceYhRmSXdBQwJmcFSQJuVY9mz6VMx+5xBGNZvlAujF57CaNztpGPDmN4hBig6V88P/7zeW4qRqOVv8W/OLPI4aOYbTHWV+JWp708MZarpDhPQ/6kJfnaa8DxNKblZz4XPpn1kvrKHJ23aFRBhKzmxqa91PlAIWsKfdtCUl5XtwizPdFfUp0FqhvqH59eVHGe+s/tTBy7Xbe1SWJSqAaHZKx6eLCGiP3U6tclfH8ubETo+Qr++WO0kYHcTTmAGSQ9DLhV6uYolHeCkHA3sKUg/4sfkw== 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)(346002)(366004)(136003)(396003)(39860400002)(451199015)(6666004)(478600001)(6486002)(5660300002)(8936002)(7416002)(66556008)(36756003)(6506007)(41300700001)(2616005)(52116002)(44832011)(2906002)(1076003)(66476007)(316002)(6512007)(26005)(8676002)(4326008)(66946007)(186003)(83380400001)(86362001)(38100700002)(38350700002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 3x6cbpUI1BwZgTw213i9Fuj+UrdmGST08Ph/l+SaTBrjdQeiciFeJsC4zYz6kzoFOjQ3/60w6NnQXS3H8JZRk0skPKaKwX316FtUv6+PlL2W1bvpximxFI7KP5RrIehjfN/HcaO5dynSMUQHFbdruaJZfpXeY/CNJLRuo9xP8zOvepssjmo5271CRY7R+kY8DKSqy6UqQk0c4xrGTTSjKnElQzEDixlolRqLUrOtx99TQOBhAJg/ZW99umlaeSCkmPyWfij1kchXo8rJnUi61By/CL28JiLLLE2Xj4ciqL9k4QG5ealJBXqp1xiV1cItoORpvrAKC058OWbfFNnvQBhy+XXPibd9SQSZd7mSe1peshIdhQqZPKej8zbtKD4nChHB988aeWska1OpSM5m5vgQxhXeN/yNzuBx/K+dSaKrqxZDOk5rhLAL3VmwwlohNx1oUimlaL5Nz9XcEiCWisrSPJHZtbZQMp798HpGem7De4Mn9RlT7fN+6xMNNCvBtHb387X+gULUvorsSe66IlG+MvvwjDKwb7rbvt+8S9dQviRFz4qRWgpskVIXkv4EfArNITpPwyzZMcVJGSnlaf6thhjcmLzaZnwYrNc7Z/b8Rx79E2z0kL5TrzAJTD4kIdGgnMAWJcxS2TTo7FXpK5nS9UpdXsQJJxHvy6JG/Zl8v1ijKSmIlLNqg01xLUpM//7+rBxorsmZkEZMXSPa+U2kRSjbbEzcd97ESmx3G7OlxiL26ixYOHuumkWkrBC1lKradXCuXo82Nwe+yntR4fMWn6e2+25PY3eRrLb7FMivvZw/gZUf5m+6V5WE/7fHcHmXvrKlsxTFFnOR/8RllyVHaE5puEycdCTFRMrKvlBbNeMi3qOKY5gB6DT3UuDz6guE6kKLPpR0oJDN8YodG4NQzFgz8xMJiu4ErAah+hO6hAZeKRwHnQPsFJrsmkRDCLbPrQUs9CYJgC2eZk14L3MIgxr5YqyYE8broHKlUIfKlFFx9Qom6vAEB/Btn9M+e81LkVgV7JuAiEss0teHtqMO+mirHlzCOkOtXrxGvkuoUwbHjHc4iWaVoEAeS6aUvAiDu77wynBVhggl2CtmVabZENNZm7Uqu+PAFXjR83Qidbz3du1zJONuEYarimo7XHygct4SVwePpvRtyniLACfvzAHK+CoAvOpZzlojR47/gsBf+TRjQcqR4pvusSdeimflgmhWYXtoT54Re5J3/kSSCYqDOdT4CaJrUAFCmKrlGnXPNQBpsBm6zFEd0LbNVqpm6xJt7IoyHQn+JHfK1wNSBefkl9T40N8/LFG9eY4kzX/peNdBoahL+yQ0YkUJFfM2PQQ4NBcA5dE5uRPzYzNLZeZn+OMTolWa0y0oBh2Xh5HSFe6n9JNO6foBt7gbBiOPAbhzul3tVJ2+n6NsmzPuNn7KDRPbXZznv22YEItRcV1lqGYGdCgGdWDWbqwVVBwGNrutR4/6UI0AsCf0hSZD2HIplDQ8e21l2h2H02wI01d6MOlTPdFd23HdQ6lWTcwSz/rr/rN2OF887KelI0PBzJE69f+Hzcoz1G1ijmbVeu/6XWANf3EcqIAHngs5 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1c536565-aa0f-44bb-c15d-08dac6ecfd93 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB5925.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Nov 2022 09:37:19.6809 (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: sUbukpO1lgUw5kCdkjRv0Cg/kd4j9fcrNewdzPSQZSx5W/MiPuBA6Lxx3tvzfpDx X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR04MB9462 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749554554026521302?= X-GMAIL-MSGID: =?utf-8?q?1749554554026521302?= 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 Reviewed-by: Sascha Hauer --- 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 {