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: 13595042 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12olkn2055.outbound.protection.outlook.com [40.92.21.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1436322337; Mon, 18 Mar 2024 06:39:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.92.21.55 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710743950; cv=fail; b=DtIm9hKjEGeU3NrI+xvPANgiBK9cHwlPSxnJmS0VifuDHo//E4kwHdvv4eIcps1Zsd9RJ7OmQ/Mi+vdIPqGWyUoZTrbgKwVOYxIMs0Bvwx1nMHmIKEgz0Ogu5lWtls5J00cfss4M0jVjuvMfdvgLnmaLVTrNT97PMAaZ4ciBl1I= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710743950; c=relaxed/simple; bh=Ck92H+AJ1dLuii2Tsr5GLRzwjEWRlB+XP0aYYdVCltU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=mj7wjDFDs8fhnH2WprDzVCfBpfS4NM65Igt7CNrArF7smBCCFtZEXo2PTQCVWmJrav6YfWCHgO6xuRDER9I299VXag6YGmcF7x4IagqI34IxsdajfFfvtWkJvUKy5okf8qHNdSCw7uEEcxGwB22gQYe3R/ej+rc2khVFEABKSPA= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=outlook.com; spf=pass smtp.mailfrom=outlook.com; dkim=pass (2048-bit key) header.d=outlook.com header.i=@outlook.com header.b=cZvx4XjQ; arc=fail smtp.client-ip=40.92.21.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=outlook.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=outlook.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=outlook.com header.i=@outlook.com header.b="cZvx4XjQ" 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> Precedence: bulk X-Mailing-List: dmaengine@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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/oixoLbP6oaXE4qUehpUyOgz1xoQb8kynRJwXRXC2vqlPuXcGoeitVUHAZoSmlPu2s5xlfahHzMjAm1yzGuRfXBYRUk4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I78mSt0L8Fq6bQyMaQ6kfN2+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 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__