From patchwork Mon Mar 18 06:38:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Inochi Amaoto X-Patchwork-Id: 13595048 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 C0EE8C54E5D for ; Mon, 18 Mar 2024 06:39:33 +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=cfEY//LpPrjDIRoZQC3MFvWsfRd1go3y0pcfbMAdTas=; b=Qvsln1/7JSBL7e AStvJvNDRlc2NiXAjgfg4RnQzkvduUKCD5oIsPFtW5Uni7U5Gj5JbwNJ48nqjccqkVVyw5+2PCFh6 ySt5RLnDJtLT2IezFzrGlnr+UT04eTmtlB5GRA8HnjhdpelGJHYRC86nAdzXzl9pgs3Tt2ihmdRap YCjLD9puivphVoM+w5nNahp1yFjg/HeuhNlRhY5hLbIgq82FASiLuaYG8HySnhTgzD7TJgeUsqTA4 uygbgUQq0zTRBzE4sGqb86wyFf+qDYsTo3mUtkvGSLTzzbzKSLKIr92lB8hu5ifSh8upwlbca24zo y3wyTeoK7lR77cg6cVJw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rm6eb-00000007Ubz-3RAO; Mon, 18 Mar 2024 06:39:27 +0000 Received: from mail-bn7nam10olkn20800.outbound.protection.outlook.com ([2a01:111:f403:2804::800] helo=NAM10-BN7-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rm6eW-00000007UZB-2KUX for linux-riscv@lists.infradead.org; Mon, 18 Mar 2024 06:39:22 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mhQiJJWhtzdp89OHLp1AE7M0PDkSEI4+qlM1kBzvh7NepEtdWUOkqRXYmbx2VUkibq/YyuvT1hhse07Tg5v8iElLiVj7Tgr+K7WCIkp9xvCILs6qqGV1/V1b5MjN9nSQss5kfq6h9hwN/sejjfVrJ/xI6n/aWAjo3/jKyQ+qHVepQiqcrSvc18Uyk3o+p1xEJ1xKegCHJmR9Hu741oF+/dQz25swDkTA43zGSxVb8XdO/39oXkC5+7V3NFQ8m92Yty0MGq0qZcPMSl99wtkCS+OSrygSwWr6NkXwO7iYuiaf2XfefWD5MYz/r6O/FF0+UmBFpaw63xXFPuWK0SUc0w== 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=PkAgJGGdKKPoWWI2AqRpY4pgPVtQAHf44q7yZFC9Dls=; b=empvOZW8oD0oAUQhDVPhikdw2NUsNNpp0mEBa5157smz5rkLqeF/fYWX0YGk8PX97/i3YR8cNsfaBMYJMMXClRajTvFE2xrNuwiT0i/aFPDjeZPNQpWxvVMo1TaSXYONbT6dDGjRAQTpk9yitmbzasmS4XgP0n/Hzg1ZAJmCn8oqQYKHwp00RzxIYT6LICRCiuGFNkfonzD1iXQeE7Lbdiu7NMKhd7j0CDPJYtUMFQkVRMM3lVNu4gHhUOYn3u+lgNfHe4s6WJjnz3J9H3nB3m4uHKZYsqDxHD1/saJfTsr5cgVkbr88zROuj37Z2Qm4ZxtghjTl9soO1npqP1rlOw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=PkAgJGGdKKPoWWI2AqRpY4pgPVtQAHf44q7yZFC9Dls=; b=cZvx4XjQOPoCcodd/csLtPtsyUPO5pxNTnMBGcgH7nj+j+kj+OJYIFawli2FEcU6GM/272/N9/Bvve28THwRwUJyjjGPPnPl9n6aW4jBHsoFfaPLGaZ2C+b+YmjWbQrv+1Te/G4PsbfodAJDOPAbjbD5za4LZ/41N/ifExcA2eV8UE0fw2p/mA6LyB093R6Qr4WaimhSmODCTRIUxP4RE0krUqLyXGauju0WvPQ5gZ7u9jUG+TUYyTicjaUjuHBp4pFOv3cIhnJSyCJSZ0/la203GA3yUjXozd0unRC8yuGtfSsespG3B+uSbzkyBTDHQ6/NLAlz90xuVYQQ9SLJ8Q== Received: from IA1PR20MB4953.namprd20.prod.outlook.com (2603:10b6:208:3af::19) by SN7PR20MB5460.namprd20.prod.outlook.com (2603:10b6:806:2ab::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7386.25; Mon, 18 Mar 2024 06:39:05 +0000 Received: from IA1PR20MB4953.namprd20.prod.outlook.com ([fe80::8615:efe2:7c8e:2041]) by IA1PR20MB4953.namprd20.prod.outlook.com ([fe80::8615:efe2:7c8e:2041%3]) with mapi id 15.20.7386.025; Mon, 18 Mar 2024 06:39:04 +0000 From: Inochi Amaoto To: Vinod Koul , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen Wang , Inochi Amaoto , Paul Walmsley , Palmer Dabbelt , Albert Ou Cc: Jisheng Zhang , Liu Gui , Jingbao Qiu , dlan@gentoo.org, dmaengine@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org Subject: [PATCH v4 1/4] dt-bindings: dmaengine: Add dmamux for CV18XX/SG200X series SoC Date: Mon, 18 Mar 2024 14:38:48 +0800 Message-ID: X-Mailer: git-send-email 2.44.0 In-Reply-To: References: X-TMN: [/Tvn18KFNAAjoTgdgefbrj1RME0n3DxMVAbczuAVNCk=] X-ClientProxiedBy: TYAPR01CA0062.jpnprd01.prod.outlook.com (2603:1096:404:2b::26) To IA1PR20MB4953.namprd20.prod.outlook.com (2603:10b6:208:3af::19) X-Microsoft-Original-Message-ID: <20240318063852.1554712-1-inochiama@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: IA1PR20MB4953:EE_|SN7PR20MB5460:EE_ X-MS-Office365-Filtering-Correlation-Id: 1f5de4b7-742f-43c8-e7ae-08dc47161b07 X-MS-Exchange-SLBlob-MailProps: iS5pQZgsAQC2q90QthcXzz/6SAXpPIRrDXYBbiJ5dTtNfWJwaG79xth2+7fFi/TVXSDHFQ5APfh8qg7VGt28+ADpr6ikUABPQ5EwxI1SK8GHYd4/Fuwr+h1nnTxtrCxJtA56xGnl//tIOyqwC2z8buKzRN+vf6cB2q4rarAh7BFCZAgdV8EVZPn2/vCzWSeVA8Brut76MoDrlGjM6OZU4bBfEmSFg65/RLW4/7jlgknChSBAKXussesYlqrkN9Wu3qmSGct+bjrqgRQyBk1eRfUglzgnD5kbqETrvJYEBHkI4h0lCIJRVrGOyQP1EvoEjNLYYvLjnhsXSSmjbbKUttvoRl6Dp8vKJOwziTJROLp4eOyskUZ6ysfKn/oixoLbP6oaXE4qUehpUyOgz1xoQb8kynRJwXRXC2vqlPuXcGoeitVUHAZoSmlPu2s5xlfahHzMjAm1yzGuRfXBYRUk4Eua+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St0L8Fq6bQyMaQ6kfN2+QuuDen7548JJegM2yLSYIVS0Oa9bW1QqGJoLXZI3s3DzklwKUeUISTAWnrzqegI5wD7fOOiEh8t/SXQ5Ufv6RGiHCBc9RxGrT9K3n9IwmM1qiM2/BXrDBGiHb2KN6AycChuDMQs43seBxJ9/uiyujcLYazcpRAI9/xyo2faYDsLowPGB8ZHiLL/GyQEkaVLqZZyg4sBx2cWj0HywZYfyOyfwnYQqPSHa6jgSbW2bj7dT8e8tPc/NiMorgvPi4fP1KmXXySL3f5f6Swv/JDvO45lTEaPcl X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1f5de4b7-742f-43c8-e7ae-08dc47161b07 X-MS-Exchange-CrossTenant-AuthSource: IA1PR20MB4953.namprd20.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Mar 2024 06:39:04.9468 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR20MB5460 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240317_233920_883879_71F10D95 X-CRM114-Status: GOOD ( 11.86 ) X-BeenThere: linux-riscv@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-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org The DMA IP of Sophgo CV18XX/SG200X is based on a DW AXI CORE, with an additional channel remap register located in the top system control area. The DMA channel is exclusive to each core. Add the dmamux binding for CV18XX/SG200X series SoC Signed-off-by: Inochi Amaoto Reviewed-by: Rob Herring --- .../bindings/dma/sophgo,cv1800-dmamux.yaml | 47 ++++++++++++++++ include/dt-bindings/dma/cv1800-dma.h | 55 +++++++++++++++++++ 2 files changed, 102 insertions(+) create mode 100644 Documentation/devicetree/bindings/dma/sophgo,cv1800-dmamux.yaml create mode 100644 include/dt-bindings/dma/cv1800-dma.h -- 2.44.0 diff --git a/Documentation/devicetree/bindings/dma/sophgo,cv1800-dmamux.yaml b/Documentation/devicetree/bindings/dma/sophgo,cv1800-dmamux.yaml new file mode 100644 index 000000000000..c813c66737ba --- /dev/null +++ b/Documentation/devicetree/bindings/dma/sophgo,cv1800-dmamux.yaml @@ -0,0 +1,47 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/dma/sophgo,cv1800-dmamux.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Sophgo CV1800/SG200 Series DMA mux + +maintainers: + - Inochi Amaoto + +allOf: + - $ref: dma-router.yaml# + +properties: + compatible: + const: sophgo,cv1800-dmamux + + reg: + maxItems: 2 + + '#dma-cells': + const: 3 + description: + The first cells is DMA channel. The second one is device id. + The third one is the cpu id. + + dma-masters: + maxItems: 1 + + dma-requests: + const: 8 + +required: + - '#dma-cells' + - dma-masters + +additionalProperties: false + +examples: + - | + dma-router { + compatible = "sophgo,cv1800-dmamux"; + #dma-cells = <3>; + dma-masters = <&dmac>; + dma-requests = <8>; + }; diff --git a/include/dt-bindings/dma/cv1800-dma.h b/include/dt-bindings/dma/cv1800-dma.h new file mode 100644 index 000000000000..3ce9dac25259 --- /dev/null +++ b/include/dt-bindings/dma/cv1800-dma.h @@ -0,0 +1,55 @@ +/* SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause */ + +#ifndef __DT_BINDINGS_DMA_CV1800_H__ +#define __DT_BINDINGS_DMA_CV1800_H__ + +#define DMA_I2S0_RX 0 +#define DMA_I2S0_TX 1 +#define DMA_I2S1_RX 2 +#define DMA_I2S1_TX 3 +#define DMA_I2S2_RX 4 +#define DMA_I2S2_TX 5 +#define DMA_I2S3_RX 6 +#define DMA_I2S3_TX 7 +#define DMA_UART0_RX 8 +#define DMA_UART0_TX 9 +#define DMA_UART1_RX 10 +#define DMA_UART1_TX 11 +#define DMA_UART2_RX 12 +#define DMA_UART2_TX 13 +#define DMA_UART3_RX 14 +#define DMA_UART3_TX 15 +#define DMA_SPI0_RX 16 +#define DMA_SPI0_TX 17 +#define DMA_SPI1_RX 18 +#define DMA_SPI1_TX 19 +#define DMA_SPI2_RX 20 +#define DMA_SPI2_TX 21 +#define DMA_SPI3_RX 22 +#define DMA_SPI3_TX 23 +#define DMA_I2C0_RX 24 +#define DMA_I2C0_TX 25 +#define DMA_I2C1_RX 26 +#define DMA_I2C1_TX 27 +#define DMA_I2C2_RX 28 +#define DMA_I2C2_TX 29 +#define DMA_I2C3_RX 30 +#define DMA_I2C3_TX 31 +#define DMA_I2C4_RX 32 +#define DMA_I2C4_TX 33 +#define DMA_TDM0_RX 34 +#define DMA_TDM0_TX 35 +#define DMA_TDM1_RX 36 +#define DMA_AUDSRC 37 +#define DMA_SPI_NAND 38 +#define DMA_SPI_NOR 39 +#define DMA_UART4_RX 40 +#define DMA_UART4_TX 41 +#define DMA_SPI_NOR1 42 + +#define DMA_CPU_A53 0 +#define DMA_CPU_C906_0 1 +#define DMA_CPU_C906_1 2 + + +#endif // __DT_BINDINGS_DMA_CV1800_H__ From patchwork Mon Mar 18 06:38:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Inochi Amaoto X-Patchwork-Id: 13595049 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 54091C54E58 for ; Mon, 18 Mar 2024 06:39:34 +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=vViSf+HSLsO26idyz4uzmfEhKVq6R8EffNOxlwlDKTU=; b=hfOBoPq6CTKElm qxrq67DLawTbJFUz7hVL/3sYFc848f/OK5n3n2mevUMqbh+mAAFiSbItA6fZXQ68DY4rnWAYkQCnn XEi8q61c8UOQPPG04csGXWsW2S/RuF1BI7f82ZnXZvyu+F8Ckxg+j7SJvUc1B8NI/l1nK4Gre4vlW AToxikoF60wiGaMGz1NJQ+sODN1LFUbgK/F8d1t6xGZlNZLXwiaKkVl170N8p2Id/zQoll7gT8fdH hU0D9S3wP4jWfc2Hr3U9UUBPTvZu2ly4JGGZP+EdmZvQPCy2xiA8lcD5GWgQzJLGbLMehPUhvcOFG +1clNb9bj4Uh1HKdMO8A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rm6ef-00000007Ue8-0NmI; Mon, 18 Mar 2024 06:39:29 +0000 Received: from mail-bn7nam10olkn20800.outbound.protection.outlook.com ([2a01:111:f403:2804::800] helo=NAM10-BN7-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rm6ea-00000007UZB-001g for linux-riscv@lists.infradead.org; Mon, 18 Mar 2024 06:39:26 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dYR1Jy+wQ8+RMyCaBxb4ZQxzhir6+Yj7ilMDseo4RecY8fKRj1oyZJPEkKuUs/bO5QaKuzlB6fZ/7eiPNZcBedNsC7p88E0nLDxN+ykeKZaDLYUOS8FeHRV93L/3lZi0gcZlxuVgncvID6PH9LK2SBnSsHiWz/oXlt6vgaOutlF3Ms9Cgtzf1VQgb5QC88su5MXzOBnpeFscGm4qfh6VHehd6VITbgR76JhBpznicgDciAbETBAo0dnRPZQHm7YWW759FjC4JhERAlM7Mc6GkXl7KZkO9nce+yaePOQ9clylSGdkm3JgtvuAokt+ho+Mf1WPnqXMLvb26lPM/dThSA== 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=DUPDeMgzx5bBbMIFB5my6AeSJvafCKMk3W8pCIQGUSM=; b=PNzeMRN4Jmn5OBVxl3WgvuXv9H48kw9qth3gc+Ck4zE0Xd91U6ARvegapejlpTPyciT8Qn/s7NB0vS9F9FubyKrE5wn0qa6c1w6PuTdLwsp7IWhW5xSXTLPi4zL87Rel9XJeQM7/opAcGeu9oLBSaeSchxOoQjd/H8UUy6h7R5K3CVR/DalIuw2gBFVlo4Vbo3hX3mwtJkRYBv/yQFjWtKHPCYGUWWZUEycTou0o46yEA1lkcUHmmNG2F5LflLixWYK0IvJuo+aOs8M7KGrRgAB5RrYv7b3gzGN8MXSfxiAMc7cTzO2P01htyndQp6r6nRqKtS6lF/LQ68OrcDiARg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=DUPDeMgzx5bBbMIFB5my6AeSJvafCKMk3W8pCIQGUSM=; b=cuG6cfWIlLmA/Sgl51zPi9H8fbAkiaFGLr8bnt9Av6AaqrIx5auqzetdjBYnzcFZvRw+cn3cXGTPIgKrEFmRQDk4rZ4WLrCe+56XuHDBZcemNHUcH4FRclyLF00JzK84BJ+sfraysv8ZcrsY5K7TXFgLV55W2nREFro8ztK+yD6ljD9EDcTOCcRU51QZZS4UVKMY7ikXC60M0Pl8c4vST5XBNIfBcNmT/87mP0XnMZgwb1oNymeznQg++N+A1Vr7RPfl7dfKrEVg0tnayY6VfM8TJqu6aiow7b3XEuwXU3qAQD/wKG3uG0Z/p3GtcDJse3EaR3eNNMjdIE6Mlr0xpA== Received: from IA1PR20MB4953.namprd20.prod.outlook.com (2603:10b6:208:3af::19) by SN7PR20MB5460.namprd20.prod.outlook.com (2603:10b6:806:2ab::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7386.25; Mon, 18 Mar 2024 06:39:09 +0000 Received: from IA1PR20MB4953.namprd20.prod.outlook.com ([fe80::8615:efe2:7c8e:2041]) by IA1PR20MB4953.namprd20.prod.outlook.com ([fe80::8615:efe2:7c8e:2041%3]) with mapi id 15.20.7386.025; Mon, 18 Mar 2024 06:39:09 +0000 From: Inochi Amaoto To: Vinod Koul , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen Wang , Inochi Amaoto , Paul Walmsley , Palmer Dabbelt , Albert Ou Cc: Jisheng Zhang , Liu Gui , Jingbao Qiu , dlan@gentoo.org, dmaengine@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org Subject: [PATCH v4 2/4] dt-bindings: soc: sophgo: Add top misc controller of CV18XX/SG200X series SoC Date: Mon, 18 Mar 2024 14:38:49 +0800 Message-ID: X-Mailer: git-send-email 2.44.0 In-Reply-To: References: X-TMN: [FsOmjLBBlLNCs8Y3njdAwO6TWmGnFPSV1JROZl0lzrE=] X-ClientProxiedBy: TY2PR04CA0013.apcprd04.prod.outlook.com (2603:1096:404:f6::25) To IA1PR20MB4953.namprd20.prod.outlook.com (2603:10b6:208:3af::19) X-Microsoft-Original-Message-ID: <20240318063852.1554712-2-inochiama@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: IA1PR20MB4953:EE_|SN7PR20MB5460:EE_ X-MS-Office365-Filtering-Correlation-Id: 7cb41ed8-3be1-4fbe-0a0e-08dc47161dc9 X-MS-Exchange-SLBlob-MailProps: RlF2DIMZ1qUQWS8lN22nULkf5597sA7XTOYMcwrjOxIakFiGGMGZrpbOnudJ6iHK8HIMbrkc7/xtsAkSj+ikLljg5qT63tEJ0wH/mTogyh5OBbofutqo5iU2BXSinr5WNip5asT0Vf6v9E+iWmOjuR1fmEgPI2TT2wLXVHnIWSQQDiHmDT4DTesB0JaEv5G40wMOQM66AlV3rsURTvTC/IqSi3gqD0EhZ8JEoQ6JTVtyCHouK671EZbj4WxEKyDiRulWgJy+lzfMrcamRRxv8oxz0DKOpQBNwT2BZcF9/I5Bg5m4vlblP7IdcoIuoAy4CDTAKU6NrKxJmjJyPJMKpLU+QXvC9UyGh5J/8OexpZ+yoXuebgiJVuzgiftJCvBRgtR0rzdkV1shrj7gp/M8njfR1PFp10rnDtuyVk7SFBeCFJHEeJ9fFazEXe9+ueMTgCXwWpENiGGZYGeXkaTsd/BXDNgNJR3nnpqZfYkz7v1lVFF0B7FBwBoX6i+8govp9wBH8u+wQsC1cDDAhwDDolqHl7f3L/sQ5lAj6Aj15i8dj87TyKl2hHcuoHsolKwjwIhWgg8G/TIAoLkLvDqj7qNXIze/4MgMtSuSCxftYENwOwBEb3p7NoPG8ySCMhZO1mKDiKZlFxBI1ZUfi89pZnakg8umCLnEyw6q2YysxZi58+iqcoSxTqGwdqCA4i+Sm2biSmHVtqUB3SraYPLyqbcdz/NhIRLG2/DYOr2+FR4KyD3phY5KtAgbmk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8gt/BGXfI0JVq9F7Pl9AzXX9B8x1215cgJxq6psCaIYeN9E45z6zUbLH X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7cb41ed8-3be1-4fbe-0a0e-08dc47161dc9 X-MS-Exchange-CrossTenant-AuthSource: IA1PR20MB4953.namprd20.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Mar 2024 06:39:09.5566 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR20MB5460 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240317_233924_636711_BDC98C4F X-CRM114-Status: GOOD ( 10.88 ) X-BeenThere: linux-riscv@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-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org CV18XX/SG200X series SoCs have a special top misc system controller, which provides register access for several devices. In addition to register access, this system controller also contains some subdevices (such as dmamux). Add bindings for top misc controller of CV18XX/SG200X series SoC. Signed-off-by: Inochi Amaoto --- .../soc/sophgo/sophgo,cv1800-top-syscon.yaml | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 Documentation/devicetree/bindings/soc/sophgo/sophgo,cv1800-top-syscon.yaml -- 2.44.0 diff --git a/Documentation/devicetree/bindings/soc/sophgo/sophgo,cv1800-top-syscon.yaml b/Documentation/devicetree/bindings/soc/sophgo/sophgo,cv1800-top-syscon.yaml new file mode 100644 index 000000000000..009e45e520d9 --- /dev/null +++ b/Documentation/devicetree/bindings/soc/sophgo/sophgo,cv1800-top-syscon.yaml @@ -0,0 +1,57 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/soc/sophgo/sophgo,cv1800-top-syscon.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Sophgo CV1800/SG2000 SoC top system controller + +maintainers: + - Inochi Amaoto + +description: + The Sophgo CV1800/SG2000 SoC top misc system controller provides + register access to configure related modules. + +properties: + compatible: + items: + - const: sophgo,cv1800-top-syscon + - const: syscon + - const: simple-mfd + + reg: + maxItems: 1 + + "#address-cells": + const: 1 + + "#size-cells": + const: 1 + +required: + - compatible + - reg + +additionalProperties: + type: object + +examples: + - | + syscon@3000000 { + compatible = "sophgo,cv1800-top-syscon", + "syscon", "simple-mfd"; + reg = <0x03000000 0x1000>; + #address-cells = <1>; + #size-cells = <1>; + + dma-router@154 { + compatible = "sophgo,cv1800-dmamux"; + reg = <0x154 0x8>, <0x298 0x4>; + #dma-cells = <3>; + dma-masters = <&dmac>; + dma-requests = <8>; + }; + }; + +... From patchwork Mon Mar 18 06:38:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Inochi Amaoto X-Patchwork-Id: 13595050 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 78F2AC54E58 for ; Mon, 18 Mar 2024 06:39:37 +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=hrlfC9uFm11nz+V9fw983aHVE3FKpwFpfCglJUMO/rY=; b=k7M+JQT+IUcQE6 bvyLND1XMABE1gUpXm/OjLePZBw99fqm82qs5+2V3ft7SC3OYZa8ksFi+R0ICfmQPzW5JHiDsoO/X SGvbD68DSgV280RILPog/ZnX8nFyuuiuYCT5RIZPZ41Xw9T0WnGItZRAi9LmEarZaPdwdOw+SPB+G t3kJBypwCf/eh7oP3uN0dYvl59EF3initqUru7DycU7NznrRufUFWhEItHgj63EsYNNwsZ2urxRbM J/gAGf+SwB8K20iVJ/arQn/D97qPP6eoQCRzAyg69pYzjJSHaiMLsyWWjn8S1ZNeyDmtNmdljK3+N U0lu6cAGDFwlGUwUVgwA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rm6ej-00000007Uga-129S; Mon, 18 Mar 2024 06:39:33 +0000 Received: from mail-bn7nam10olkn20800.outbound.protection.outlook.com ([2a01:111:f403:2804::800] helo=NAM10-BN7-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rm6ed-00000007UZB-2OYJ for linux-riscv@lists.infradead.org; Mon, 18 Mar 2024 06:39:31 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=m59jB33G1Qtzeab/FL9TWv9CxTRWKMmKnG5RFIv2zUw85nCPLGk1iQjeGE/Kf3h4aohXUsr3sVc5YmSw4kzpVEm2ZLVQLRwoe9bKZEEroYxprOp7KQ/LtsU4bvShRkrbaOcf2m8KXvCcBzCI69+eau3EHMFBvVe3XM4o1/TM9MwJFoGyd+ZmEjgLmtQO9lZZSxz0doiLfkT8A0GFIXUumoBa4VFUDX6DL8OgIWWvpF/RRCj84X0RhvsPjHU5RwvhyDE7Q7Z46oNWiez9BlGl1TZ92zkazMQ+QzOni75SKC47Pe2reU6Q/6bt4DfMGpbYZr35VvXvFo5SMDUANG0bPg== 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=kS0KlR6sMzZ54c2Mbq9eCPI0GiPAwbDVfnXhdu/XLI8=; b=ClDk7JMrQXGV+w2siNPg6Smjk3haEQGB/W3Ua2/LIi17G+Rnr5JCY2gXEXsgbifn6eWqnO/F0ujb78VwmN8WHiOvPHR/bMTxKd+kdAtndKOnpTHurvo2rBGdS82/sAHiEdXrABCWL6aD4LcbifoYCy8NDCthCFyUmTcDED7zXAti1eeZ5nU/3biEk0afKOQZi3CdcSNqpR3ToFDmTQENlagj1uhbzpOq28CFd29y3LSyjkFOUSA9dumsx6+XYh2fG8eqOCg8WJubv4UaADXUjR+NpCl6TMV/EqVWcIgiBSI/wVVGQKaZhUlue5AUcH7/hChJX3LfByqewwP2f8OreA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kS0KlR6sMzZ54c2Mbq9eCPI0GiPAwbDVfnXhdu/XLI8=; b=aUl5sEYhYEtkXlb1XLmfLKH9LGTy1UpQ/mTxdfwC0dwS1Sw27MsjHPXxj6BVuMsKBOmqGU/zA8aKtcafIuyhBCAwXfes8GW9LhAlGGWtilYupXMtoHZcSNG8w/Uxi32F6GzLh96oY+QGCepXYUvGKfkzkSOzf9q14qJBrBLEU2AxjKBrLJKgVBxoMuBYLtN9JADF3md8EZ4/lesT7Y88u1i0ugBraTotU6VJlEQEiAXOHLqs/DsxMvvuFQO5Cp2BxSvd4xmSyn1NwnA4sKwE/qxUJl6+yjA6hfyOCFUa/sKAFPFWtGTs/qb6eMWDBNMG94jWmBfK/A+FTKKoFiMpEg== Received: from IA1PR20MB4953.namprd20.prod.outlook.com (2603:10b6:208:3af::19) by SN7PR20MB5460.namprd20.prod.outlook.com (2603:10b6:806:2ab::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7386.25; Mon, 18 Mar 2024 06:39:18 +0000 Received: from IA1PR20MB4953.namprd20.prod.outlook.com ([fe80::8615:efe2:7c8e:2041]) by IA1PR20MB4953.namprd20.prod.outlook.com ([fe80::8615:efe2:7c8e:2041%3]) with mapi id 15.20.7386.025; Mon, 18 Mar 2024 06:39:18 +0000 From: Inochi Amaoto To: Vinod Koul , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen Wang , Inochi Amaoto , Paul Walmsley , Palmer Dabbelt , Albert Ou Cc: Jisheng Zhang , Liu Gui , Jingbao Qiu , dlan@gentoo.org, dmaengine@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org Subject: [PATCH v4 3/4] soc/sophgo: add top sysctrl layout file for CV18XX/SG200X Date: Mon, 18 Mar 2024 14:38:50 +0800 Message-ID: X-Mailer: git-send-email 2.44.0 In-Reply-To: References: X-TMN: [X9oHuYmE/1e2DgD2cB7xx7Ogi/q8GhN5cY10QYEmxMc=] X-ClientProxiedBy: TYWPR01CA0050.jpnprd01.prod.outlook.com (2603:1096:400:17f::19) To IA1PR20MB4953.namprd20.prod.outlook.com (2603:10b6:208:3af::19) X-Microsoft-Original-Message-ID: <20240318063852.1554712-3-inochiama@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: IA1PR20MB4953:EE_|SN7PR20MB5460:EE_ X-MS-Office365-Filtering-Correlation-Id: 775a481f-39e6-4e6d-ba51-08dc47162300 X-MS-Exchange-SLBlob-MailProps: 7J/vb0KDx3g6a7F03Qev6MOuCGwUNmfEARcLw0sujbt34Dd00NjjbYQVK4cVEuGnTW4SzT+RNYTzwvll47QYHXPseAVdxcK/wvGem/v3zhap7ULmb8TUdySc28ONEy3Vz3c+HRX3RIVtwf+8t8cNV0DmNJBt3wiiba3NoTPZi5QYk2W6eCk1CA0C0Ik2WwJWkPNkxqVCwFVJtTj+2PpW2ULZZGsry/nP0aAl88OsAqxQRoJY5mY4RMUG0rOFT9QCr6nzbx5Xl7gXp2nsF0sHNrn0H+PhTRHyU74gFUWdB6V/Qvfer3hink75suAl8lT4pbvAtphpG0aykfDSTtNlT6xvUHml/DYhT5FR6tgH9ckijA6N7PI5xOL0XXKElqaW6OcSi9tfwPN0A5Q+quJaoZKRiUw6g96MoKByD4dALJu1R0miaPeO3UE8rD3rJQiyIGuQxu9dGodH9ZwrsUSjDxZYFkEoOZ9b68XO29VfIKl+PwkUAHCR6lhL5ds2KnlFurUFBlxzZ0CTVTLXWocgbvgk24x3/gR2j6JNOyOYI6rp+0TEVgWLUFuOrEescNMtkdSvo7ZZJHX0KNGXxF2YrXs/UJvjqkpdM3RydlXqubKPSf64H/6nbsETEe759ZEhUGjAnHK1ZoUH21N6+LBQTrsyTnoO5NxcUdKGMbBFQ4loj/I9U7ENlz2o7mXfABf+8LtpS4TBHgsP74ZPJ0bMpPWWoFLmxXsfF6f4ulerrM5gl04mQb/9txarRRAVthVW3IDpQWR9NX3JguPsJ5beiPaxLpfBD9DN0kPMbarb1vk= X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Xl5w4nxT5XdTch4xFSirGtvuB8uGusyV/z++pj6stA8edIoM0PCPHfzKNRDsp+/4xK4CDdqJeLatQccG59a1ubTWpX4MDvjRVgt510/l6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JGopiSeBDHHWqfSXI07ue/XFyGMFN1LO3k4SV166Js10cOF9XeUdTKozSBZs9Xys1N3R6nSKgBxRckATed1+T45A9+HLK8DppFeekA4Q349xHEhvAMWmMujA8xrTzNtpetaR8fAE9TovBruO6wQuh42MGph2XqCwUx8B04pZHDmAhQK3GEpY88hNJ25Ht53d69K7ZSHNsO7WukanV5QBATqYiv3DwCU6OYOiMC3qXIOFfCDz2+PtbyPrrdbJ0ZlxtXrupVamfxSWZp1jF1KMBddi/jO90yo9MvLUCHyGrPfWHJslPNDcIzQs9ZfAtWVyIDf/btMBMZIyFx0S+YGK1kBHTX9FIjtKV04qPYVZB55UoZKsj8Hg/te4evJnm7JL7ZnIJNPBSi+gyLozc91A6KoPCLgTrRlvRffJSVQCLFu6qkHmO3Lk9Wd0IxLqzUDaGkX/0PA5Dfw7j75cQMkJli+3R7Rv/W9g51V1Vu8lMW1LQRbcUoGI1coJ1SMEwMJuWy/mWMPPqtUnOJGwmbeoDAJ5F6ZP8GYHk2ndBgf4heJ592HcL+qb1FXaBEwzTYagzof+IDekPywKW4V0FdUKnsn3JCBWhg2flf2vR+Tgluce4hW1PUS5orA1EX5hRrmS7XbmLe+9k8ub+Ju8F6TCLg5Tqw6eXt27g3ZbSGKhr6dgo+lYWHcBJAzsEbT9N3tnJSATYq12Qs0OHQRChbxYBj9mn46f4OSZQdb66oJVCGXGm02LA09UaFKn8oS2cZKEdd4Rt/W0AgfFIw7r+z+yOdWQ2H3FKX X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 775a481f-39e6-4e6d-ba51-08dc47162300 X-MS-Exchange-CrossTenant-AuthSource: IA1PR20MB4953.namprd20.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Mar 2024 06:39:18.4642 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR20MB5460 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240317_233928_732466_CE79ABE1 X-CRM114-Status: UNSURE ( 8.96 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-riscv@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-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org The "top" system controller of CV18XX/SG200X exposes control register access for various devices. Add soc header file to describe it. Signed-off-by: Inochi Amaoto --- include/soc/sophgo/cv1800-sysctl.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 include/soc/sophgo/cv1800-sysctl.h -- 2.44.0 diff --git a/include/soc/sophgo/cv1800-sysctl.h b/include/soc/sophgo/cv1800-sysctl.h new file mode 100644 index 000000000000..b9396d33e240 --- /dev/null +++ b/include/soc/sophgo/cv1800-sysctl.h @@ -0,0 +1,30 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* + * Copyright (C) 2023 Inochi Amaoto + */ + +#ifndef CV1800_SYSCTL_H +#define CV1800_SYSCTL_H + +/* + * SOPHGO CV1800/SG2000 SoC top system controller registers offsets. + */ + +#define CV1800_CONF_INFO 0x004 +#define CV1800_SYS_CTRL_REG 0x008 +#define CV1800_USB_PHY_CTRL_REG 0x048 +#define CV1800_SDMA_DMA_CHANNEL_REMAP0 0x154 +#define CV1800_SDMA_DMA_CHANNEL_REMAP1 0x158 +#define CV1800_TOP_TIMER_CLK_SEL 0x1a0 +#define CV1800_TOP_WDT_CTRL 0x1a8 +#define CV1800_DDR_AXI_URGENT_OW 0x1b8 +#define CV1800_DDR_AXI_URGENT 0x1bc +#define CV1800_DDR_AXI_QOS_0 0x1d8 +#define CV1800_DDR_AXI_QOS_1 0x1dc +#define CV1800_SD_PWRSW_CTRL 0x1f4 +#define CV1800_SD_PWRSW_TIME 0x1f8 +#define CV1800_DDR_AXI_QOS_OW 0x23c +#define CV1800_SD_CTRL_OPT 0x294 +#define CV1800_SDMA_DMA_INT_MUX 0x298 + +#endif // CV1800_SYSCTL_H From patchwork Mon Mar 18 06:38:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Inochi Amaoto X-Patchwork-Id: 13595051 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 19406C54E58 for ; Mon, 18 Mar 2024 06:39:41 +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=9OZrF4zsEPtKDbb5z5/M2ZtjbDcZtAvBgGN5aGgmC6E=; b=SdSx3JZ9F21Q3S BX7d5/w+s+3Hx98tbeGI0J9hCyavd+5zWRejpeHQY27laCXZCT9RW4hVWbRilDt5aB74OoMPedSjc 0oqtX+7IvMkf20edIkR7pth51Xi6djI2mMqMNKDb/tyYavs+BXBKzU0L9wnW4gXrJNV0inWBp2c43 alQikfwyCWBYZd0BiMl+SdmsPFkC9OsKTszb2b2WLqXxbgEI4tBj/2R48oC3jPLaZkayzidPNywNl Hb44UW9u8O9J6uwQCCEiyHt2UcKp6J0le0z8HHxW00fYFOwB0wdf8VemE/2jgdru4yHL/xS0IEEkO CKntpEZlYtdZklEXgchw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rm6em-00000007Uiv-30ez; Mon, 18 Mar 2024 06:39:36 +0000 Received: from mail-bn7nam10olkn20800.outbound.protection.outlook.com ([2a01:111:f403:2804::800] helo=NAM10-BN7-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rm6eh-00000007UZB-2mfT for linux-riscv@lists.infradead.org; Mon, 18 Mar 2024 06:39:34 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WedTzBz980Jjprz+lTuM1g5E4uXT+ZTPNyf391fkveaOnKVyKZaGZg3glO9ENL9tAhfCBz3piL69R/ZYj+a1M970ZX5A6i4eSW0ggI/xkYRhSfttHxzjQLhhghmIdwPA5qlJumnjM4dJrQGjvT+k3w1ZbneBKpoJCLt6XV0c9KFjJMPhVBbvy7ad3hAhF34tx771XDbgQg5sDTqZ4emjnvIe/n2fzV7oYmGv2lRsqjGY/soCcR6ePU++/fKunVizzMjyCbuedkhnIgjfbLHLV28xXqGS7wMP66sNgukj8lhCpetl0lsI5DWkVOCbXnN7rXcgGl18jdzusBGArKnmZA== 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=G6pYCSaKfLXkzXMfkQJfkJFlTBHLZWxHB/e4t7eei6s=; b=iixErwYdVSVcDg2DjFREKx9i+6xS6wmgbboUuabpE1acFP3kp/8ami0Bz1P4ip9PznKBdE0D+WzIX9af+9Z4GKSb81eqhG+7B0p0i7Em/kFRakR+m60hCBfaRzfkJ4yW2CZoC6HzJ9FzhuBRckvlFwzraorEdzgIM1/7cwU8qYQbV379F2CVdwfn1focZyR2Mf9ub4bMxiNUs9X5g0Rp/eV5+lFzii+tz4Jio3PNPL3eFCWYyfUzy5sUgvcYTV16h5SUuAKqTrH7fpn+KD6mXPAU2wsjtiTvvQqqefR9N/nSxNzsYNinbzQ5Hp9HIDhybLUTh+yBhbjnJnbUZy0/Bw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=G6pYCSaKfLXkzXMfkQJfkJFlTBHLZWxHB/e4t7eei6s=; b=dxzaaOYsHaWYAvtXyNqDRvKt5sZgijnbTXGPC7Xta8XLBGwAWzZfVjWjJrUJ8SxfTnZwmf6YhNZPZl6RUIQ0UmGWnJy4yFk+7ydp3eMp41uQS1umM2H773/YWzhTp9pknh57LbC028gXsp/UIUPAS7XR36zAWLCD7EY/XPAXfYNqcsjrco/5N2JrYGkDlll2vC1ihK9bM1vf8GHhzg26tfBJYFDF2qfPVHdVRCn06PdgDjWcTOusWJwGhGuBGea9+4FJdPAks0qU8ToDH+ACYhvbvy+s+xgRMtJ2ewgyI1giCPrFgW04+yxRKe9NxgTwpNcY8EGZHvoQIk8Znbg3Xg== Received: from IA1PR20MB4953.namprd20.prod.outlook.com (2603:10b6:208:3af::19) by SN7PR20MB5460.namprd20.prod.outlook.com (2603:10b6:806:2ab::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7386.25; Mon, 18 Mar 2024 06:39:23 +0000 Received: from IA1PR20MB4953.namprd20.prod.outlook.com ([fe80::8615:efe2:7c8e:2041]) by IA1PR20MB4953.namprd20.prod.outlook.com ([fe80::8615:efe2:7c8e:2041%3]) with mapi id 15.20.7386.025; Mon, 18 Mar 2024 06:39:22 +0000 From: Inochi Amaoto To: Vinod Koul , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen Wang , Inochi Amaoto , Paul Walmsley , Palmer Dabbelt , Albert Ou Cc: Jisheng Zhang , Liu Gui , Jingbao Qiu , dlan@gentoo.org, dmaengine@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org Subject: [PATCH v4 4/4] dmaengine: add driver for Sophgo CV18XX/SG200X dmamux Date: Mon, 18 Mar 2024 14:38:51 +0800 Message-ID: X-Mailer: git-send-email 2.44.0 In-Reply-To: References: X-TMN: [7qm0FjB5asIBI6vetYBPR8kdaSYNsdCZLJ2EnNQRv48=] X-ClientProxiedBy: TYCP301CA0074.JPNP301.PROD.OUTLOOK.COM (2603:1096:405:7d::14) To IA1PR20MB4953.namprd20.prod.outlook.com (2603:10b6:208:3af::19) X-Microsoft-Original-Message-ID: <20240318063852.1554712-4-inochiama@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: IA1PR20MB4953:EE_|SN7PR20MB5460:EE_ X-MS-Office365-Filtering-Correlation-Id: 82558cd3-549a-4900-3413-08dc471625ab X-MS-Exchange-SLBlob-MailProps: 7J/vb0KDx3g6a7F03Qev6MOuCGwUNmfERvbL1B87uliY8ZRwG+wrIeHDOAedME1pjkGmrqmMix19l4z8NMY1kudSPJ7pYxqgCOYE7K42q0R8uhar0Xx7UstHHfBk+IHw44HwLe10w35cM19YJA94itnn+udRNbi9E6bqCbB0dvVc7xojYoYMTQvRvhnbtuiae6+kcOhi6IQDDKEHhbDzfCm6cftV3sIPU+dQYLVPR+MVAR1sAJHVc6FEFwASCA8Gn6EQDCgO0dPT1+O9bol8QwW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dO3hLAlBEWjE5M2EmBNl6xfpm4XhQ+T7vhWeIQKdEXPkqwcxtHGgW0WwxKJooQsn2MXfLMxaI4PTv/CChItuH+F4Gw5j9Z3XfXAWv8mZUveJ9mc+y3+J7ECs4HbGk017Yn9QZht3H685yYhRES50PubRdr/O9kc3GvyMGH8YUK6nnmm4B6VMxUfwyU8PKZaClsmSwxhOuxtwNgWvlmm3VVA3kxIXN4L43Vdre1IHur1LfRcyWcKCoey8kMpTjKNWihR6FiVE+NdK5FY+/FGHNchd2GeDf4gjaOkPoWvVicHbcmzZMUDoNTmgZGONkA20Rnsgr/82D+6EfzGhGC5I8m6eUBJZvw+ixp54PU5Z7FSHVhZVp2dcel0zRzL5oa3qnYSn3N55F26GJx X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 82558cd3-549a-4900-3413-08dc471625ab X-MS-Exchange-CrossTenant-AuthSource: IA1PR20MB4953.namprd20.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Mar 2024 06:39:22.9447 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR20MB5460 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240317_233932_067057_F8C7E4CD X-CRM114-Status: GOOD ( 16.72 ) X-BeenThere: linux-riscv@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-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Sophgo CV18XX/SG200X use DW AXI CORE with a multiplexer for remapping its request lines. The multiplexer supports at most 8 request lines. Add driver for Sophgo CV18XX/SG200X DMA multiplexer. Signed-off-by: Inochi Amaoto --- drivers/dma/Kconfig | 9 ++ drivers/dma/Makefile | 1 + drivers/dma/cv1800-dmamux.c | 232 ++++++++++++++++++++++++++++++++++++ 3 files changed, 242 insertions(+) create mode 100644 drivers/dma/cv1800-dmamux.c -- 2.44.0 diff --git a/drivers/dma/Kconfig b/drivers/dma/Kconfig index 002a5ec80620..cb31520b9f86 100644 --- a/drivers/dma/Kconfig +++ b/drivers/dma/Kconfig @@ -546,6 +546,15 @@ config PLX_DMA These are exposed via extra functions on the switch's upstream port. Each function exposes one DMA channel. +config SOPHGO_CV1800_DMAMUX + tristate "Sophgo CV1800/SG2000 series SoC DMA multiplexer support" + depends on MFD_SYSCON + depends on ARCH_SOPHGO + help + Support for the DMA multiplexer on Sophgo CV1800/SG2000 + series SoCs. + Say Y here if your board have this soc. + config STE_DMA40 bool "ST-Ericsson DMA40 support" depends on ARCH_U8500 diff --git a/drivers/dma/Makefile b/drivers/dma/Makefile index dfd40d14e408..7465f249ee47 100644 --- a/drivers/dma/Makefile +++ b/drivers/dma/Makefile @@ -67,6 +67,7 @@ obj-$(CONFIG_PPC_BESTCOMM) += bestcomm/ obj-$(CONFIG_PXA_DMA) += pxa_dma.o obj-$(CONFIG_RENESAS_DMA) += sh/ obj-$(CONFIG_SF_PDMA) += sf-pdma/ +obj-$(CONFIG_SOPHGO_CV1800_DMAMUX) += cv1800-dmamux.o obj-$(CONFIG_STE_DMA40) += ste_dma40.o ste_dma40_ll.o obj-$(CONFIG_STM32_DMA) += stm32-dma.o obj-$(CONFIG_STM32_DMAMUX) += stm32-dmamux.o diff --git a/drivers/dma/cv1800-dmamux.c b/drivers/dma/cv1800-dmamux.c new file mode 100644 index 000000000000..b41c39f2e338 --- /dev/null +++ b/drivers/dma/cv1800-dmamux.c @@ -0,0 +1,232 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2023 Inochi Amaoto + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#define DMAMUX_NCELLS 3 +#define MAX_DMA_MAPPING_ID DMA_SPI_NOR1 +#define MAX_DMA_CPU_ID DMA_CPU_C906_1 +#define MAX_DMA_CH_ID 7 + +#define DMAMUX_INTMUX_REGISTER_LEN 4 +#define DMAMUX_NR_CH_PER_REGISTER 4 +#define DMAMUX_BIT_PER_CH 8 +#define DMAMUX_CH_MASk GENMASK(5, 0) +#define DMAMUX_INT_BIT_PER_CPU 10 +#define DMAMUX_CH_UPDATE_BIT BIT(31) + +#define DMAMUX_CH_SET(chid, val) \ + (((val) << ((chid) * DMAMUX_BIT_PER_CH)) | DMAMUX_CH_UPDATE_BIT) +#define DMAMUX_CH_MASK(chid) \ + DMAMUX_CH_SET(chid, DMAMUX_CH_MASk) + +#define DMAMUX_INT_BIT(chid, cpuid) \ + BIT((cpuid) * DMAMUX_INT_BIT_PER_CPU + (chid)) +#define DMAMUX_INTEN_BIT(cpuid) \ + DMAMUX_INT_BIT(8, cpuid) +#define DMAMUX_INT_CH_BIT(chid, cpuid) \ + (DMAMUX_INT_BIT(chid, cpuid) | DMAMUX_INTEN_BIT(cpuid)) +#define DMAMUX_INT_MASK(chid) \ + (DMAMUX_INT_BIT(chid, DMA_CPU_A53) | \ + DMAMUX_INT_BIT(chid, DMA_CPU_C906_0) | \ + DMAMUX_INT_BIT(chid, DMA_CPU_C906_1)) +#define DMAMUX_INT_CH_MASK(chid, cpuid) \ + (DMAMUX_INT_MASK(chid) | DMAMUX_INTEN_BIT(cpuid)) + +struct cv1800_dmamux_data { + struct dma_router dmarouter; + struct regmap *regmap; + spinlock_t lock; + DECLARE_BITMAP(used_chans, MAX_DMA_CH_ID); + DECLARE_BITMAP(mapped_peripherals, MAX_DMA_MAPPING_ID); +}; + +struct cv1800_dmamux_map { + unsigned int channel; + unsigned int peripheral; + unsigned int cpu; +}; + +static void cv1800_dmamux_free(struct device *dev, void *route_data) +{ + struct cv1800_dmamux_data *dmamux = dev_get_drvdata(dev); + struct cv1800_dmamux_map *map = route_data; + u32 regoff = map->channel % DMAMUX_NR_CH_PER_REGISTER; + u32 regpos = map->channel / DMAMUX_NR_CH_PER_REGISTER; + unsigned long flags; + + spin_lock_irqsave(&dmamux->lock, flags); + + regmap_update_bits(dmamux->regmap, + regpos + CV1800_SDMA_DMA_CHANNEL_REMAP0, + DMAMUX_CH_MASK(regoff), + DMAMUX_CH_UPDATE_BIT); + + regmap_update_bits(dmamux->regmap, CV1800_SDMA_DMA_INT_MUX, + DMAMUX_INT_CH_MASK(map->channel, map->cpu), + DMAMUX_INTEN_BIT(map->cpu)); + + clear_bit(map->channel, dmamux->used_chans); + clear_bit(map->peripheral, dmamux->mapped_peripherals); + + spin_unlock_irqrestore(&dmamux->lock, flags); + + kfree(map); +} + +static void *cv1800_dmamux_route_allocate(struct of_phandle_args *dma_spec, + struct of_dma *ofdma) +{ + struct platform_device *pdev = of_find_device_by_node(ofdma->of_node); + struct cv1800_dmamux_data *dmamux = platform_get_drvdata(pdev); + struct cv1800_dmamux_map *map; + unsigned long flags; + unsigned int chid, devid, cpuid; + u32 regoff, regpos; + + if (dma_spec->args_count != DMAMUX_NCELLS) { + dev_err(&pdev->dev, "invalid number of dma mux args\n"); + return ERR_PTR(-EINVAL); + } + + chid = dma_spec->args[0]; + devid = dma_spec->args[1]; + cpuid = dma_spec->args[2]; + dma_spec->args_count -= 2; + + if (chid > MAX_DMA_CH_ID) { + dev_err(&pdev->dev, "invalid channel id: %u\n", chid); + return ERR_PTR(-EINVAL); + } + + if (devid > MAX_DMA_MAPPING_ID) { + dev_err(&pdev->dev, "invalid device id: %u\n", devid); + return ERR_PTR(-EINVAL); + } + + if (cpuid > MAX_DMA_CPU_ID) { + dev_err(&pdev->dev, "invalid cpu id: %u\n", cpuid); + return ERR_PTR(-EINVAL); + } + + dma_spec->np = of_parse_phandle(ofdma->of_node, "dma-masters", 0); + if (!dma_spec->np) { + dev_err(&pdev->dev, "can't get dma master\n"); + return ERR_PTR(-EINVAL); + } + + map = kzalloc(sizeof(*map), GFP_KERNEL); + if (!map) + return ERR_PTR(-ENOMEM); + + map->channel = chid; + map->peripheral = devid; + map->cpu = cpuid; + + regoff = chid % DMAMUX_NR_CH_PER_REGISTER; + regpos = chid / DMAMUX_NR_CH_PER_REGISTER; + + spin_lock_irqsave(&dmamux->lock, flags); + + if (test_and_set_bit(devid, dmamux->mapped_peripherals)) { + dev_err(&pdev->dev, "already used device mapping: %u\n", devid); + goto failed; + } + + if (test_and_set_bit(chid, dmamux->used_chans)) { + clear_bit(devid, dmamux->mapped_peripherals); + dev_err(&pdev->dev, "already used channel id: %u\n", chid); + goto failed; + } + + regmap_set_bits(dmamux->regmap, + regpos + CV1800_SDMA_DMA_CHANNEL_REMAP0, + DMAMUX_CH_SET(regoff, devid)); + + regmap_update_bits(dmamux->regmap, CV1800_SDMA_DMA_INT_MUX, + DMAMUX_INT_CH_MASK(chid, cpuid), + DMAMUX_INT_CH_BIT(chid, cpuid)); + + spin_unlock_irqrestore(&dmamux->lock, flags); + + dev_info(&pdev->dev, "register channel %u for req %u (cpu %u)\n", + chid, devid, cpuid); + + return map; + +failed: + spin_unlock_irqrestore(&dmamux->lock, flags); + dev_err(&pdev->dev, "already used channel id: %u\n", chid); + return ERR_PTR(-EBUSY); +} + +static int cv1800_dmamux_probe(struct platform_device *pdev) +{ + struct device *dev = &pdev->dev; + struct device_node *mux_node = dev->of_node; + struct cv1800_dmamux_data *data; + struct device *parent = dev->parent; + struct device_node *dma_master; + struct regmap *map = NULL; + + if (!parent) + return -ENODEV; + + map = device_node_to_regmap(parent->of_node); + if (IS_ERR(map)) + return PTR_ERR(map); + + dma_master = of_parse_phandle(mux_node, "dma-masters", 0); + if (!dma_master) { + dev_err(dev, "invalid dma-requests property\n"); + return -ENODEV; + } + of_node_put(dma_master); + + data = devm_kmalloc(dev, sizeof(*data), GFP_KERNEL); + if (!data) + return -ENOMEM; + + spin_lock_init(&data->lock); + data->regmap = map; + data->dmarouter.dev = dev; + data->dmarouter.route_free = cv1800_dmamux_free; + + platform_set_drvdata(pdev, data); + + return of_dma_router_register(mux_node, + cv1800_dmamux_route_allocate, + &data->dmarouter); +} + +static const struct of_device_id cv1800_dmamux_ids[] = { + { .compatible = "sophgo,cv1800-dmamux", }, + { } +}; +MODULE_DEVICE_TABLE(of, cv1800_dmamux_ids); + +static struct platform_driver cv1800_dmamux_driver = { + .driver = { + .name = "fsl-raideng", + .of_match_table = cv1800_dmamux_ids, + }, + .probe = cv1800_dmamux_probe, +}; +module_platform_driver(cv1800_dmamux_driver); + +MODULE_AUTHOR("Inochi Amaoto "); +MODULE_DESCRIPTION("Sophgo CV1800/SG2000 Series Soc DMAMUX driver"); +MODULE_LICENSE("GPL");