From patchwork Thu Oct 20 08:33:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akhil R X-Patchwork-Id: 13012800 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 829EFC43219 for ; Thu, 20 Oct 2022 08:34:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230285AbiJTIeW (ORCPT ); Thu, 20 Oct 2022 04:34:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38116 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231299AbiJTIeM (ORCPT ); Thu, 20 Oct 2022 04:34:12 -0400 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2042.outbound.protection.outlook.com [40.107.93.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A849918BE2C; Thu, 20 Oct 2022 01:34:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QnMqsHRDU3w5GPMDD2xroh+fSK/hXtLN4Xhb9vWGBpSWQzS2jyKxNbHayM1ImMPvMPI4LSFA7c+x5kRYEUGWybjX7pOOLOVl5lM0Lo+Fjj4ty4OKohiJkxX6ubDd46zHUw60/TmyvW1vQZIYiuQGCoerUyXN39oqeojt6nM7igq0DgHdLSUtHGkaCCETu6VG2soDfgON9w2qgVEo2ZuwGgaFVs9NA3J8zlygG9oKwHOuW1tMsJFPE4lHUVmfolNtP+F+k8uNO038Pu5pYkcuiBhUiF5aHR0CFyoD669oH0u6UAVV63HBe2+aJbDmQS1rZK5JAH9CyRhwk9LKMO3G8g== 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=chAtKV5D7aE+UDykF9wh79CnPg93VUJ/Yjcm53OMFFM=; b=WnvWyPTJKFTgyGE0zy/Hhz8m9CfaPZW4I9jTZvqjDLUynMp4dl2zl/8Vy6/Bla5UYCWmRBp1TDVFpfnYvWx+YVwL7j5Y7MAzKg3tQVV3fu6OFq0uCX2dcpy2i7Ih6fFBH59NfPTeoxNJYovnPfCyHvkeJZpBYHwqnsBmNg5l/Gm+UysXcus6rw8ObW1O+xVxCaSNjAO0BHYRDibUpFOBUE2MB23MKYCr1UcJUva+BtQC8WN4Xb8x7ApbaQzelvym/KlY0cRaYxVg75vhTUxmmZNNyzPhFgE5rbhuIsoQCprKgaEBMGbMc+6bVq6yYC76VmSVDSxb9OTjyRhoMQh/RA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none (sender ip is 216.228.117.161) smtp.rcpttodomain=kernel.org smtp.mailfrom=nvidia.com; dmarc=fail (p=reject sp=reject pct=100) action=oreject header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=chAtKV5D7aE+UDykF9wh79CnPg93VUJ/Yjcm53OMFFM=; b=Aaft7DI9/p2DiwRjXor+ulP92JlWDHVe61JzrizocSb8hm9rbQ77M4eKPek/xXaN+1eQiTtiplPb++bD+3UoR9iuIEFIv/GHYAuYmwMZemJhT7Y1e85lPDZllW84q+jAGWB4yRmjvhlsH/x+0227+smDnTnVKMA2G9WSjA6EBZUqXZdtQ1iTILVBz1UqBi420jdgZpkilMy056jO8twnMi5czYjfKsG01OereFn5G5vlHBox8KB/BRaaRvky6/zj8mGEd0TtJdQCWRgk+ZtRLPmbyBFCpbVQTC62FnnRZKA+bvsvJ6My6OyGvTZNWV0SfvrcphAiT9IWA8A3JxETqw== Received: from DS7PR03CA0309.namprd03.prod.outlook.com (2603:10b6:8:2b::7) by CY5PR12MB6348.namprd12.prod.outlook.com (2603:10b6:930:f::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.26; Thu, 20 Oct 2022 08:34:01 +0000 Received: from DM6NAM11FT088.eop-nam11.prod.protection.outlook.com (2603:10b6:8:2b:cafe::92) by DS7PR03CA0309.outlook.office365.com (2603:10b6:8:2b::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.34 via Frontend Transport; Thu, 20 Oct 2022 08:34:01 +0000 X-MS-Exchange-Authentication-Results: spf=none (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=fail action=oreject header.from=nvidia.com; Received-SPF: None (protection.outlook.com: nvidia.com does not designate permitted sender hosts) Received: from mail.nvidia.com (216.228.117.161) by DM6NAM11FT088.mail.protection.outlook.com (10.13.172.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.16 via Frontend Transport; Thu, 20 Oct 2022 08:34:01 +0000 Received: from rnnvmail205.nvidia.com (10.129.68.10) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.26; Thu, 20 Oct 2022 01:33:50 -0700 Received: from rnnvmail205.nvidia.com (10.129.68.10) by rnnvmail205.nvidia.com (10.129.68.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.29; Thu, 20 Oct 2022 01:33:49 -0700 Received: from BUILDSERVER-IO-L4T.nvidia.com (10.127.8.14) by mail.nvidia.com (10.129.68.10) with Microsoft SMTP Server id 15.2.986.29 via Frontend Transport; Thu, 20 Oct 2022 01:33:45 -0700 From: Akhil R To: , , , , , , , , , , , CC: Subject: [PATCH RESEND v2 1/3] dt-bindings: dmaengine: Add dma-channel-mask to Tegra GPCDMA Date: Thu, 20 Oct 2022 14:03:20 +0530 Message-ID: <20221020083322.36431-2-akhilrajeev@nvidia.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221020083322.36431-1-akhilrajeev@nvidia.com> References: <20221020083322.36431-1-akhilrajeev@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT088:EE_|CY5PR12MB6348:EE_ X-MS-Office365-Filtering-Correlation-Id: a693e34f-cc4d-40c3-5816-08dab275d718 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: B74K/VoAkzLrYYbhqFChvXotw/zVnab3S2uiVAWkWXKdlC/ucBvlpswasXWQJPDSGlvHUCItwLNFebPlv4Okk1mYbOXRrE3Cf1AvuPr380lzBKU7MX9Kl4f6ak0//F5/wkPqWNrM7sGDz8A9TRC3C4RXDIFXkoU3yF0L2Rx7ErGQ9lCizL1WNxsLtIQGmjhtvMR9OLiKB+wI5JDefCMUeFwpAUuIDlatV3CcckLkZKF6T8ikJHMYLlzVdOSFxAS76esUsrBhyNpAxOfsZXJOQimmLM9po7tAumJxICm7IjzmqxJAta7gucBZEMHfpH0jHVDUILQlMAUq+ZxLZ5fTFJ1puH1MM1nq3M1hUdAiwzQTlcWqgXqvd8zDO9kqS4w3MIww7vyQTeh7WA9tvJXyVO7U7/0k3Ab7T6Otmqoef4FMHCKAok789xQWV3U5iep9uscLCrGOkSy6vdJLQ1IpeKs1vrgAMHIq2gdu4I8tarxlRhoR7suRkimnrNPsPmLngus8Nh2ckP9Tlc96RaoUf6jWe6wGVwd66ZXVbnZaF87OAoTWdH46E6SC7R60WC8kWrHwXXxIf1WBy4rtxZvXDfghG43if6zxkyI05yF+zcmRmZTpGJ9FJMMkagBGK+P0frLxScUHQjMXDEDTT8ytvZtzceJmYPkuaqGK7DQyJ9jQfJ1BY5ktAlGaGDifazhDducovZ1C/QGn6j6BBcWgUBZ9mRYBlUkovXaDQgTkAVKYCgWS2P/8WpyIOWarRfuqwbwAgOLbeGuBPxdFifcsVoMKGL/ntNme8zVJXB5f5h0= X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230022)(4636009)(39860400002)(346002)(396003)(136003)(376002)(451199015)(36840700001)(46966006)(40470700004)(110136005)(8676002)(336012)(70206006)(4326008)(107886003)(70586007)(6666004)(316002)(186003)(2616005)(1076003)(36756003)(86362001)(83380400001)(426003)(40480700001)(2906002)(47076005)(36860700001)(41300700001)(5660300002)(7696005)(26005)(40460700003)(7416002)(8936002)(356005)(478600001)(7636003)(82740400003)(921005)(82310400005);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Oct 2022 08:34:01.4086 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a693e34f-cc4d-40c3-5816-08dab275d718 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.161];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT088.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR12MB6348 Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org Add dma-channel-mask property in Tegra GPCDMA document. The property would help to specify the channels to be used in kernel and reserve few for the firmware. This was previously achieved by limiting the channel number to 31 in the driver. Now since we can list all 32 channels, update the interrupts property as well to list all 32 interrupts. Signed-off-by: Akhil R Acked-by: Thierry Reding Acked-by: Krzysztof Kozlowski --- .../devicetree/bindings/dma/nvidia,tegra186-gpc-dma.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/dma/nvidia,tegra186-gpc-dma.yaml b/Documentation/devicetree/bindings/dma/nvidia,tegra186-gpc-dma.yaml index c8894476b6ab..851bd50ee67f 100644 --- a/Documentation/devicetree/bindings/dma/nvidia,tegra186-gpc-dma.yaml +++ b/Documentation/devicetree/bindings/dma/nvidia,tegra186-gpc-dma.yaml @@ -39,7 +39,7 @@ properties: Should contain all of the per-channel DMA interrupts in ascending order with respect to the DMA channel index. minItems: 1 - maxItems: 31 + maxItems: 32 resets: maxItems: 1 @@ -52,6 +52,9 @@ properties: dma-coherent: true + dma-channel-mask: + maxItems: 1 + required: - compatible - reg @@ -60,6 +63,7 @@ required: - reset-names - "#dma-cells" - iommus + - dma-channel-mask additionalProperties: false @@ -108,5 +112,6 @@ examples: #dma-cells = <1>; iommus = <&smmu TEGRA186_SID_GPCDMA_0>; dma-coherent; + dma-channel-mask = <0xfffffffe>; }; ... From patchwork Thu Oct 20 08:33:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akhil R X-Patchwork-Id: 13012799 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 A0C8DC433FE for ; Thu, 20 Oct 2022 08:34:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230082AbiJTIeV (ORCPT ); Thu, 20 Oct 2022 04:34:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38322 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231329AbiJTIeS (ORCPT ); Thu, 20 Oct 2022 04:34:18 -0400 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2040.outbound.protection.outlook.com [40.107.236.40]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5E98418C422; Thu, 20 Oct 2022 01:34:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=em9cXqkNRltyFa+Zm+GwLhWppwpt0J9odiUovm5DlZzCK2JCyeNa1laZlUSFicUZLSSXH0HOMZHQMqhUtiKjK8mc60adjlH631trQDzGQup5TrBHLPK9JCeXGlqEYkoT4vl5bF2bQkQVP6DmWawFwCc1VaSE4ecd46l83P9yveoCUdHnz1LsXIGNr634qrVKzbylop6QSOm7vEQNJLlccmOeOZRhwaCa3jPfMJSvYTtMkvQWOjR/BskxNwqdXTi9/00lhd5QxQ1S6ETwis9Q8hXleG1SWRCNyCIc3lvOq2F4g3lDzIlCn7O/8e5VNZyuKfql6Zc5xtTpWRfsnMI98A== 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=dQzIWFZ5aH2Zm8fCIT34AMMeWZtJUsHhyL2NPV5hoqc=; b=ehpL+I+XqvlZ4nlRaYeJJwEUDcsfVmrMs0UnX+eEAO2vpNCfG401zBcATrzK/ugSK7S1nvKk/SYDnUoeMez8Qo3+e4So6160eyxZ2LEaXS1DrVCwv0z/O7vlnDIVKz8S5kfS6gHTcd1UPzhUG3skEbtFURimaPAWWLwQBcbfKIHHs2PRjWXz8B4UYlqea+pHaOUutJtnpAXOO+OXJyJCKvaqOLf6yXKuJ38xveVTmzwn7jBBA5RrrrR9RpoetqzZki23tDxeFK9M/mCSz3TjwWTpt3vKTRpVUsWGVqtDiduI8LegiqRG1fjjdoZDWuErQ8Zled+7KW7YKUNuMVei+w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none (sender ip is 216.228.117.160) smtp.rcpttodomain=kernel.org smtp.mailfrom=nvidia.com; dmarc=fail (p=reject sp=reject pct=100) action=oreject header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=dQzIWFZ5aH2Zm8fCIT34AMMeWZtJUsHhyL2NPV5hoqc=; b=E2H3V3pQgn0h7j/QevfvlxirkMOt5YZ8mH+MS1xeMmcSBcMqdxHBYC2+rZi3n/qQv7gUFbTBi3pwMU2eh2WAWgqi3z0xZd/GxxAitTr+yTN5JPSW2G3NmMkRybMm8ey8Zki2+dO6KNYGssgrEv1AqvCJ+AtMGC1XoevcNn2CQJMpxMaX6lSKHgFnk/ZD64IqyInP1p++p3p0cF8TLCs4iuduEuntyFbau3cAJZ2vgaCdsCTAqLhMFU2WVhGu6W0xvCRtsbeqYU3oMrrRDNWYsCUNvWXLR1pPzkfWHLSjLr7eI7LVteStWlhT50OQbqzkiTbc1QUZvekp8z/sOH7Pbw== Received: from DM6PR08CA0048.namprd08.prod.outlook.com (2603:10b6:5:1e0::22) by CH3PR12MB7500.namprd12.prod.outlook.com (2603:10b6:610:148::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.26; Thu, 20 Oct 2022 08:34:07 +0000 Received: from DM6NAM11FT032.eop-nam11.prod.protection.outlook.com (2603:10b6:5:1e0:cafe::1c) by DM6PR08CA0048.outlook.office365.com (2603:10b6:5:1e0::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.20 via Frontend Transport; Thu, 20 Oct 2022 08:34:07 +0000 X-MS-Exchange-Authentication-Results: spf=none (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=fail action=oreject header.from=nvidia.com; Received-SPF: None (protection.outlook.com: nvidia.com does not designate permitted sender hosts) Received: from mail.nvidia.com (216.228.117.160) by DM6NAM11FT032.mail.protection.outlook.com (10.13.173.93) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.16 via Frontend Transport; Thu, 20 Oct 2022 08:34:06 +0000 Received: from rnnvmail205.nvidia.com (10.129.68.10) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.26; Thu, 20 Oct 2022 01:33:58 -0700 Received: from rnnvmail205.nvidia.com (10.129.68.10) by rnnvmail205.nvidia.com (10.129.68.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.29; Thu, 20 Oct 2022 01:33:57 -0700 Received: from BUILDSERVER-IO-L4T.nvidia.com (10.127.8.14) by mail.nvidia.com (10.129.68.10) with Microsoft SMTP Server id 15.2.986.29 via Frontend Transport; Thu, 20 Oct 2022 01:33:53 -0700 From: Akhil R To: , , , , , , , , , , , CC: Subject: [PATCH RESEND v2 2/3] arm64: tegra: Add dma-channel-mask in GPCDMA node Date: Thu, 20 Oct 2022 14:03:21 +0530 Message-ID: <20221020083322.36431-3-akhilrajeev@nvidia.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221020083322.36431-1-akhilrajeev@nvidia.com> References: <20221020083322.36431-1-akhilrajeev@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT032:EE_|CH3PR12MB7500:EE_ X-MS-Office365-Filtering-Correlation-Id: df049db7-560a-4926-7397-08dab275da4d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: XCIxq7JTsCq58aNL7ZiYaBc6dEy4ncI2jHJjF0SJFt1TWGV8oWCavRy3QqUs0FlmK7iU+S1LVLCLOynDbtr8uwtGyCRcrohtzo7fh+2REzXN6x9gmJ7eKOJkpd5kWRu4cRqPRh7tD4g9P1WgvRFwBD1BOGFi8UbDwfIB9Vsw/kfsOrRUpX7Oni1FV8M96KleiTL5EOBzxtVa+umWkzbpb1o77WiGb/y/twybRJNcEnoBhoWdhx8QzAJ7TDyw1uF0K9takkPTjK9y9dOmUBgldSl0FFrGYU16lhlZXi57C31oBC7EUyq7IY6b1D0GarLF8QnPqFOzDfpNDqM215sI2eN7f1qx3fG1/4Qj9pt8fcdcLDTJO//odIvidrz2Lf2XM+xzHkBBb/73Ec4yvzVpTj03EX3G33Im6iUMxGaXr31CXtZgRy+T+iW8/d3gYb2FUDZ4OQF0Hp3QZ0khB9kFBHHyH9DnCwWA4A1H+jhnePi6Xdzynj5bPXJ8cq/w4jfwCMBLqeHablPxF6a4TvYj46uD079c+BsB1tQHXon8n0TMPI7XGLZO8pgFcwCxpkXYxilgtXwkoGBsJQWqrtMZRfOxZBy/IZP0wxqHHkkKJwmbE/WFdD4uFKPJk6U7KCDqQkRP6fKev6rBLo8nsnhowB4TioXltw6HMKL2kiJh/YAsl2zZdihqvhInCU6s1+VSQyrR2+TnqiijjPoiZvETyULXn3mD1Q6rxp/5WR3KP25yKA1fCvnbSJFYSM98c/7KZ3mYxUnquDZtqRX6JDDxXV5qCgQcGlJMtYF/tSxnjTk= X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230022)(4636009)(346002)(376002)(39860400002)(396003)(136003)(451199015)(46966006)(40470700004)(36840700001)(921005)(107886003)(6666004)(8936002)(4326008)(478600001)(70586007)(70206006)(8676002)(110136005)(36756003)(36860700001)(41300700001)(7696005)(426003)(40480700001)(40460700003)(186003)(1076003)(82310400005)(26005)(2616005)(86362001)(336012)(356005)(83380400001)(82740400003)(7636003)(47076005)(316002)(2906002)(7416002)(5660300002);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Oct 2022 08:34:06.8210 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: df049db7-560a-4926-7397-08dab275da4d X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT032.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB7500 Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org Add dma-channel-mask property in Tegra GPCDMA device tree node. The property would help to specify the channels to be used in kernel and reserve few for the firmware. This was previously achieved by limiting the channel number to 31 in the driver. Now since we can list all 32 channels, update the interrupts property as well to list all 32 interrupts. Signed-off-by: Akhil R --- arch/arm64/boot/dts/nvidia/tegra186.dtsi | 4 +++- arch/arm64/boot/dts/nvidia/tegra194.dtsi | 4 +++- arch/arm64/boot/dts/nvidia/tegra234.dtsi | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/arch/arm64/boot/dts/nvidia/tegra186.dtsi b/arch/arm64/boot/dts/nvidia/tegra186.dtsi index 6602fe421ee8..db479064ff72 100644 --- a/arch/arm64/boot/dts/nvidia/tegra186.dtsi +++ b/arch/arm64/boot/dts/nvidia/tegra186.dtsi @@ -78,7 +78,8 @@ reg = <0x0 0x2600000 0x0 0x210000>; resets = <&bpmp TEGRA186_RESET_GPCDMA>; reset-names = "gpcdma"; - interrupts = , + interrupts = , + , , , , @@ -112,6 +113,7 @@ #dma-cells = <1>; iommus = <&smmu TEGRA186_SID_GPCDMA_0>; dma-coherent; + dma-channel-mask = <0xfffffffe>; status = "okay"; }; diff --git a/arch/arm64/boot/dts/nvidia/tegra194.dtsi b/arch/arm64/boot/dts/nvidia/tegra194.dtsi index 41f3a7e188d0..b009f8145016 100644 --- a/arch/arm64/boot/dts/nvidia/tegra194.dtsi +++ b/arch/arm64/boot/dts/nvidia/tegra194.dtsi @@ -142,7 +142,8 @@ reg = <0x2600000 0x210000>; resets = <&bpmp TEGRA194_RESET_GPCDMA>; reset-names = "gpcdma"; - interrupts = , + interrupts = , + , , , , @@ -176,6 +177,7 @@ #dma-cells = <1>; iommus = <&smmu TEGRA194_SID_GPCDMA_0>; dma-coherent; + dma-channel-mask = <0xfffffffe>; status = "okay"; }; diff --git a/arch/arm64/boot/dts/nvidia/tegra234.dtsi b/arch/arm64/boot/dts/nvidia/tegra234.dtsi index 0170bfa8a467..ccc1a4bd094d 100644 --- a/arch/arm64/boot/dts/nvidia/tegra234.dtsi +++ b/arch/arm64/boot/dts/nvidia/tegra234.dtsi @@ -27,7 +27,8 @@ reg = <0x2600000 0x210000>; resets = <&bpmp TEGRA234_RESET_GPCDMA>; reset-names = "gpcdma"; - interrupts = , + interrupts = , + , , , , @@ -60,6 +61,7 @@ ; #dma-cells = <1>; iommus = <&smmu_niso0 TEGRA234_SID_GPCDMA>; + dma-channel-mask = <0xfffffffe>; dma-coherent; }; From patchwork Thu Oct 20 08:33:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akhil R X-Patchwork-Id: 13012801 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 D1D5DC433FE for ; Thu, 20 Oct 2022 08:34:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230480AbiJTIej (ORCPT ); Thu, 20 Oct 2022 04:34:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38970 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230357AbiJTIe3 (ORCPT ); Thu, 20 Oct 2022 04:34:29 -0400 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2088.outbound.protection.outlook.com [40.107.94.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B8ADC184989; Thu, 20 Oct 2022 01:34:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=igT/f3oqo+N6FE3RFwNCgWiD2lLdp7b4wrZQSlnDhcNyToQl1WFyunpvutynPIjpIc8NYr3nbePvjUOWx7xwUVBdeI4TIiX4MhZdWU05Rw8lQIM9oUM9NFLoR/7xulzOt/JI/FlwekbxalIzrckjrK01vnmuO9cqcgsbKqET9PKAjoHNb8DCM8qQd2iUCkmM5kJQbROCS/U55LgB8H5X5K+OAYC3cPJiyelFL1PEJ07b3x9DgPOzQt4G/n/FJXMPZFD6G/62kb3L+k1WY5nIGlPrana+lYzj9hlwgq1QouJ9Yxjkb81rXxyA7WzaifMkB+32L8mmGTiSHDf3gYjzcg== 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=jNwyMeAIYU3rsM0sxRbv5dfLY4ZKhEDZlaw8279Ciz0=; b=XOiMH1YvutISHowN88X5+OKVDz7iOjPSGrTi5pBi6CLdQDqmjUSE04Dm4c+S49oMQGt/9sECtrxfInrcsTSzIAxgqsDeK0LATgNZv62w711tiyzP5UnjpTI+kiDv8grBpZzokyEb2Deandj+6qkrGhtkF2U07yeCfBTZoK0P1aAHtF1XS6PRwd1fhBvtu4Dzl80Z3NLCJr5DcbMfQHK9Tme5r0laqucTPQdDt04l22RxaEjSKl4f5RIwXODiwTTIFtjmFfSqCby9kUWN3pipuV9pYGwRwE9xmweLMifXOKqvCM1VFexlU8uIg/GMPFB46RHZg0YuDM6SuVythbwuBw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none (sender ip is 216.228.117.161) smtp.rcpttodomain=kernel.org smtp.mailfrom=nvidia.com; dmarc=fail (p=reject sp=reject pct=100) action=oreject header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=jNwyMeAIYU3rsM0sxRbv5dfLY4ZKhEDZlaw8279Ciz0=; b=Qtk3/hFwr8I92dooADU72pC8gWOzfTe6rXq+XZn9yuYzNsycgCoc1RJJxMyJp7jfmInnUau19ty5Cq24GiAgrR++x2lCY82RlhDwbmkkehwF0YxHOG61drzkvYFjz4OS2b2dWKzAs1jrOh9AhuCRzQAkGsN11uAyahHE6JGie6o3SlPF6gMiq+kLh1pPToBwo5ngT0oJyABPltAEPgwxUJBIkpatwDZE70XHui+o5z8ImkByrhK+FLz7caPfTKSBSbRXEgzEwbxgXRawfYuYg2+M9eRj+g4AbYCM/nweLJqv/Cn7/Luep6m5oPXMgQ0ULJ5lqsMO6le+Gux0LXusCA== Received: from DM6PR08CA0063.namprd08.prod.outlook.com (2603:10b6:5:1e0::37) by CH2PR12MB5003.namprd12.prod.outlook.com (2603:10b6:610:68::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.34; Thu, 20 Oct 2022 08:34:15 +0000 Received: from DM6NAM11FT020.eop-nam11.prod.protection.outlook.com (2603:10b6:5:1e0:cafe::e7) by DM6PR08CA0063.outlook.office365.com (2603:10b6:5:1e0::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.23 via Frontend Transport; Thu, 20 Oct 2022 08:34:15 +0000 X-MS-Exchange-Authentication-Results: spf=none (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=fail action=oreject header.from=nvidia.com; Received-SPF: None (protection.outlook.com: nvidia.com does not designate permitted sender hosts) Received: from mail.nvidia.com (216.228.117.161) by DM6NAM11FT020.mail.protection.outlook.com (10.13.172.224) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.16 via Frontend Transport; Thu, 20 Oct 2022 08:34:15 +0000 Received: from rnnvmail202.nvidia.com (10.129.68.7) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.26; Thu, 20 Oct 2022 01:34:04 -0700 Received: from rnnvmail205.nvidia.com (10.129.68.10) by rnnvmail202.nvidia.com (10.129.68.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.29; Thu, 20 Oct 2022 01:34:04 -0700 Received: from BUILDSERVER-IO-L4T.nvidia.com (10.127.8.14) by mail.nvidia.com (10.129.68.10) with Microsoft SMTP Server id 15.2.986.29 via Frontend Transport; Thu, 20 Oct 2022 01:34:00 -0700 From: Akhil R To: , , , , , , , , , , , CC: Subject: [PATCH RESEND v2 3/3] dmaengine: tegra: Add support for dma-channel-mask Date: Thu, 20 Oct 2022 14:03:22 +0530 Message-ID: <20221020083322.36431-4-akhilrajeev@nvidia.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221020083322.36431-1-akhilrajeev@nvidia.com> References: <20221020083322.36431-1-akhilrajeev@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT020:EE_|CH2PR12MB5003:EE_ X-MS-Office365-Filtering-Correlation-Id: 84289e0b-47fe-4bce-2151-08dab275df4b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rKWRFziNLcYBOhTc9dVeIKdGJtUKyj/qGSlLBeIQgz+uhvxxdeodxKfiRKf3B6h8YZyW35NGttRW/eGLKlKX6a15YHBX33oJQsRe0XxtK6mMtpBplDLwqUiMjdEnqb88BjXgOvGnqNHG5/9EStgr6LYiYprOgVM/6XdXGlPW9XWD4AxSKBrcTYF0tQR+n5P4PYHt5zXHEEDE29aVYzpGidGs4MID4D7a4CDuOycsqFp/x6El/26j4jGTviJSPyxWD+8sov83fjDsXxK8faZVuBIsGzarzaslQuRVO/56wmAaSk5zezpCAZ7bKuQ95mfDUD0qLa9l2uY0mAK7uMky0crUuc3Fs/aDqHL+hTV/XUpfI9E7sENtYE7PekVuf8x+6xfPWQMMVfHvLzXiTVG/HgkL6kxqrIO7NFl8Lf9uD7xQohHuXHGcCFA9uBGmea7gyCyPcn4a+u0bBY6l4Kz7uBu2y82CFUvZ8JgbyPfnWDuqksa6Q9/cBw1o/06r8DpdUztONEFp2DuWqvcrtBlr61cB5HrvWa/+BcWJU8iJeooR/qDjVSbXX6LG8wb0mVvRlCblv6J07XJzZrYuzpf8Tm348vbm8+/NmKn2Rn0UYfnn47j9F6YLEZPPqH2njZx/eGLzA+9kbdMKoCX41AaexveNQsZg2FO778Hka4cTQVCQm4vmsqGsAnjUVgOlLOm19McK3gnifk1wr0G9A3omP7Yr8/0Wpu+qoYf6sNkUqNHAuWOh/zw40zhq/Lqj6KtjOJDMowr4oWbBCKKKTuqZswHOOWtLhIoMVTxkkE2x2Q0= X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230022)(4636009)(136003)(376002)(346002)(396003)(39860400002)(451199015)(46966006)(36840700001)(40470700004)(82740400003)(26005)(7696005)(41300700001)(86362001)(83380400001)(47076005)(36756003)(110136005)(8676002)(4326008)(426003)(70586007)(70206006)(8936002)(336012)(5660300002)(7416002)(107886003)(6666004)(36860700001)(40480700001)(316002)(921005)(2616005)(1076003)(2906002)(7636003)(356005)(186003)(82310400005)(40460700003)(478600001);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Oct 2022 08:34:15.1632 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 84289e0b-47fe-4bce-2151-08dab275df4b X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.161];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT020.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB5003 Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org Add support for dma-channel-mask so that only the specified channels are used. This helps to reserve some channels for the firmware. This was initially achieved by limiting the channel number to 31 in the driver and adjusting the register address to skip channel0 which was reserved for a firmware. Now, with this change, the driver can align more to the actual hardware which has 32 channels. Signed-off-by: Akhil R Reviewed-by: Jon Hunter --- drivers/dma/tegra186-gpc-dma.c | 37 +++++++++++++++++++++++++++------- 1 file changed, 30 insertions(+), 7 deletions(-) diff --git a/drivers/dma/tegra186-gpc-dma.c b/drivers/dma/tegra186-gpc-dma.c index fa9bda4a2bc6..1d1180db6d4e 100644 --- a/drivers/dma/tegra186-gpc-dma.c +++ b/drivers/dma/tegra186-gpc-dma.c @@ -161,7 +161,10 @@ #define TEGRA_GPCDMA_BURST_COMPLETION_TIMEOUT 5000 /* 5 msec */ /* Channel base address offset from GPCDMA base address */ -#define TEGRA_GPCDMA_CHANNEL_BASE_ADD_OFFSET 0x20000 +#define TEGRA_GPCDMA_CHANNEL_BASE_ADDR_OFFSET 0x10000 + +/* Default channel mask reserving channel0 */ +#define TEGRA_GPCDMA_DEFAULT_CHANNEL_MASK 0xfffffffe struct tegra_dma; struct tegra_dma_channel; @@ -246,6 +249,7 @@ struct tegra_dma { const struct tegra_dma_chip_data *chip_data; unsigned long sid_m2d_reserved; unsigned long sid_d2m_reserved; + u32 chan_mask; void __iomem *base_addr; struct device *dev; struct dma_device dma_dev; @@ -1288,7 +1292,7 @@ static struct dma_chan *tegra_dma_of_xlate(struct of_phandle_args *dma_spec, } static const struct tegra_dma_chip_data tegra186_dma_chip_data = { - .nr_channels = 31, + .nr_channels = 32, .channel_reg_size = SZ_64K, .max_dma_count = SZ_1G, .hw_support_pause = false, @@ -1296,7 +1300,7 @@ static const struct tegra_dma_chip_data tegra186_dma_chip_data = { }; static const struct tegra_dma_chip_data tegra194_dma_chip_data = { - .nr_channels = 31, + .nr_channels = 32, .channel_reg_size = SZ_64K, .max_dma_count = SZ_1G, .hw_support_pause = true, @@ -1304,7 +1308,7 @@ static const struct tegra_dma_chip_data tegra194_dma_chip_data = { }; static const struct tegra_dma_chip_data tegra234_dma_chip_data = { - .nr_channels = 31, + .nr_channels = 32, .channel_reg_size = SZ_64K, .max_dma_count = SZ_1G, .hw_support_pause = true, @@ -1380,15 +1384,28 @@ static int tegra_dma_probe(struct platform_device *pdev) } stream_id = iommu_spec->ids[0] & 0xffff; + ret = device_property_read_u32(&pdev->dev, "dma-channel-mask", + &tdma->chan_mask); + if (ret) { + dev_warn(&pdev->dev, + "Missing dma-channel-mask property, using default channel mask %#x\n", + TEGRA_GPCDMA_DEFAULT_CHANNEL_MASK); + tdma->chan_mask = TEGRA_GPCDMA_DEFAULT_CHANNEL_MASK; + } + INIT_LIST_HEAD(&tdma->dma_dev.channels); for (i = 0; i < cdata->nr_channels; i++) { struct tegra_dma_channel *tdc = &tdma->channels[i]; + /* Check for channel mask */ + if (!(tdma->chan_mask & BIT(i))) + continue; + tdc->irq = platform_get_irq(pdev, i); if (tdc->irq < 0) return tdc->irq; - tdc->chan_base_offset = TEGRA_GPCDMA_CHANNEL_BASE_ADD_OFFSET + + tdc->chan_base_offset = TEGRA_GPCDMA_CHANNEL_BASE_ADDR_OFFSET + i * cdata->channel_reg_size; snprintf(tdc->name, sizeof(tdc->name), "gpcdma.%d", i); tdc->tdma = tdma; @@ -1449,8 +1466,8 @@ static int tegra_dma_probe(struct platform_device *pdev) return ret; } - dev_info(&pdev->dev, "GPC DMA driver register %d channels\n", - cdata->nr_channels); + dev_info(&pdev->dev, "GPC DMA driver register %lu channels\n", + hweight_long(tdma->chan_mask)); return 0; } @@ -1473,6 +1490,9 @@ static int __maybe_unused tegra_dma_pm_suspend(struct device *dev) for (i = 0; i < tdma->chip_data->nr_channels; i++) { struct tegra_dma_channel *tdc = &tdma->channels[i]; + if (!(tdma->chan_mask & BIT(i))) + continue; + if (tdc->dma_desc) { dev_err(tdma->dev, "channel %u busy\n", i); return -EBUSY; @@ -1492,6 +1512,9 @@ static int __maybe_unused tegra_dma_pm_resume(struct device *dev) for (i = 0; i < tdma->chip_data->nr_channels; i++) { struct tegra_dma_channel *tdc = &tdma->channels[i]; + if (!(tdma->chan_mask & BIT(i))) + continue; + tegra_dma_program_sid(tdc, tdc->stream_id); }