From nobody Tue Oct 7 05:26:55 2025 Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DEF7D242D67 for ; Mon, 14 Jul 2025 09:40:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752486022; cv=none; b=dSEssWHEgd4oibaKPKeUQKhK4Eo0N0xJnb/xvCmenYhksFNhHIudjo9w6rUGlenGOdbwrHbdOx+6HrGi2TcMiLI6rKhdl7s2bqC8CsfAAP8TVPEkjmIzT9ZmNoCR6I4YnHm3N9Xyy7TBNaRcA9Cli2+4ZFqw9IY2s/rb6mMzoXE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752486022; c=relaxed/simple; bh=4KPyVnkqnA6b1PNIcB7ie8tzayQaIfMIQ14OoYISvso=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=PQcI09yfv7Kk9H7gGEPxxm9yMa3v0912aGqicRbAl+RnCj2Ws3yV9PwXtNzG7K4GXlfkD1Wxp67vQOcljA6xjIyaVEFJLb1HojBcSCRyAs4UsEgrwBh9JhlaKnzyhnZoz4Cr3HYyDNhqMgI5ZTXH/6fJR+LpBjgA3v0fB74eOso= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=riscstar.com; spf=pass smtp.mailfrom=riscstar.com; dkim=pass (2048-bit key) header.d=riscstar-com.20230601.gappssmtp.com header.i=@riscstar-com.20230601.gappssmtp.com header.b=j+uV61g5; arc=none smtp.client-ip=209.85.128.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=riscstar.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=riscstar.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=riscstar-com.20230601.gappssmtp.com header.i=@riscstar-com.20230601.gappssmtp.com header.b="j+uV61g5" Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-45555e3317aso16236845e9.3 for ; Mon, 14 Jul 2025 02:40:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=riscstar-com.20230601.gappssmtp.com; s=20230601; t=1752486019; x=1753090819; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=ZNWYOZeX7/6WvQlTq10OWDC/eEvu8idMvnYMiM3ozYE=; b=j+uV61g5POyT46OnX2NOArcft9UKa3C2Zw4BmGylJBXcLGINSt4n/OqsX+/kcLG5sk Xk1EnmeUjvPF6GreeWB8hOqL6jr7QZLQI9ZKJowVK2XYJom8+Z7Pb5/wUR0OA9Ju2c1k 7ZHWzWIMzbRJla+FrrSJTHoTWwHiHGSc+TGFwlxKAlCSJRJY2VwgtAmqN/W0DQ8Ig+f/ vy7tftMxPz/FpTzWPn94lod0N0IxBqHcLkAoTXY9BYnoIwN2nRt7/1ylEYeG+LQkyfhl nQjrN2y6JQ/LSEfW8w8vRZBzoo+6dKq8kvu6foLFJeq+Ce3A9vqabJ8z6TFgpT7lTs3c 9d2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752486019; x=1753090819; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZNWYOZeX7/6WvQlTq10OWDC/eEvu8idMvnYMiM3ozYE=; b=D9kApuaaaUJpXFm+Ed0nyHsqppSv/+S5fNcwJfY2qsNnS77jmT4dsTdcv+Ylt2nAih 4adr/A0v7rW7VvrafKUiAWhGBlxAO/biToP0JcwFDsjjYOb42yoyyUHLmY+R9brYwF+/ /bGKEIpwLwBseQ5lLWge6g6zQoJgl66VqhYHbpZ3G+UET2yw633C2LskndLXwpDBblOc 7hdSTFzem7ckbSPGwm/ZyHu93kIddoD2mfHgTIMsZBbAapccPpuXvSgZYfSThqFJlDzt qNrvM/5aWjnEA0uGMk0WP1Mo5sdEjwwmtQW1Hug96PC43CaAnPaF+nV4lsqQmNtesUN4 FRYw== X-Forwarded-Encrypted: i=1; AJvYcCXsIlKPYAPcfzVAvlPzZTSRDlJ8FlBgSsyH+WMlRMTrYVnYJ9HiwQuV72N4N0rzKPjYTHLUiotMQyggUt0=@vger.kernel.org X-Gm-Message-State: AOJu0YzIoiaZSlOvpg/DSTT/hBXE5Y/FO8PtpAZHuO/VJ1InHM1Lc7f8 aUTkqEPAGmOCa9tUsT8mxEshzOx0qjMen3zedpB5Rm/kg8FFz3zSFkDMACRxz/vaBX8= X-Gm-Gg: ASbGnctWgR109P+1gjHY8DU9D8WB5A9jmUzt2r7nLxV1svCgA+mRoOe6MhAvX5l/sEU 3GoLVhdTPtGmJZ31iRhbaRaZhw62fSMJjfT37Av9c9oufirZgJlPZGwB3htYOdwMkzy2GsON9Qy phtWFQAK3gk8WBW8F7QS8BcypYkZACZaM9AWEJ95Ei432aitke0BDqHVURTEBuorWvUz9jhL3Jd VnkBoKRLTwJba4Rs3uRIyYvIhlEmAwFHilWhhGpV3TQkXIa8F+ecooWzE0ZgX2B9sDVwVeogKbD /XCesB7wovnkp6woo8SWhZf+5nKHtMMV9qnRdHLbKZNpV+LyK7pSRyDg7ZXpUs2C0tBNmzLKYg= = X-Google-Smtp-Source: AGHT+IH7LWrI288pfqr0DobhXiBAETFLObRARl9QHaXZq8n40/zrMI7hQXZgqc6YvjtV174ymKHG1A== X-Received: by 2002:a05:600c:8b55:b0:456:1204:e7e2 with SMTP id 5b1f17b1804b1-4561204eb05mr46649275e9.12.1752486019172; Mon, 14 Jul 2025 02:40:19 -0700 (PDT) Received: from [127.0.1.1] ([2a09:0:1:2::3035]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4561b25a948sm24989035e9.35.2025.07.14.02.40.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Jul 2025 02:40:18 -0700 (PDT) From: Guodong Xu Date: Mon, 14 Jul 2025 17:39:28 +0800 Subject: [PATCH v3 1/8] dt-bindings: dma: Add SpacemiT K1 PDMA controller Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250714-working_dma_0701_v2-v3-1-8b0f5cd71595@riscstar.com> References: <20250714-working_dma_0701_v2-v3-0-8b0f5cd71595@riscstar.com> In-Reply-To: <20250714-working_dma_0701_v2-v3-0-8b0f5cd71595@riscstar.com> To: Vinod Koul , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Yixun Lan , =?utf-8?q?Duje_Mihanovi=C4=87?= , Philipp Zabel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti Cc: Alex Elder , Vivian Wang , dmaengine@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, spacemit@lists.linux.dev, Guodong Xu X-Mailer: b4 0.14.2 Add device tree binding documentation for the SpacemiT K1 PDMA controller. Signed-off-by: Guodong Xu Reviewed-by: Rob Herring (Arm) Tested-by: Troy Mitchell --- v3: New patch. --- .../devicetree/bindings/dma/spacemit,k1-pdma.yaml | 68 ++++++++++++++++++= ++++ 1 file changed, 68 insertions(+) diff --git a/Documentation/devicetree/bindings/dma/spacemit,k1-pdma.yaml b/= Documentation/devicetree/bindings/dma/spacemit,k1-pdma.yaml new file mode 100644 index 0000000000000000000000000000000000000000..ec06235baf5ca3ecffe7dba9bb4= 25b242985660e --- /dev/null +++ b/Documentation/devicetree/bindings/dma/spacemit,k1-pdma.yaml @@ -0,0 +1,68 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/dma/spacemit,k1-pdma.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: SpacemiT K1 PDMA Controller + +maintainers: + - Guodong Xu + +allOf: + - $ref: dma-controller.yaml# + +properties: + compatible: + const: spacemit,k1-pdma + + reg: + maxItems: 1 + + interrupts: + description: Shared interrupt for all DMA channels + maxItems: 1 + + clocks: + maxItems: 1 + + resets: + maxItems: 1 + + dma-channels: + maximum: 16 + + '#dma-cells': + const: 1 + description: + The DMA request number for the peripheral device. + +required: + - compatible + - reg + - interrupts + - clocks + - resets + - dma-channels + - '#dma-cells' + +unevaluatedProperties: false + +examples: + - | + #include + + soc { + #address-cells =3D <2>; + #size-cells =3D <2>; + + dma-controller@d4000000 { + compatible =3D "spacemit,k1-pdma"; + reg =3D <0x0 0xd4000000 0x0 0x4000>; + interrupts =3D <72>; + clocks =3D <&syscon_apmu CLK_DMA>; + resets =3D <&syscon_apmu RESET_DMA>; + dma-channels =3D <16>; + #dma-cells =3D <1>; + }; + }; --=20 2.43.0 From nobody Tue Oct 7 05:26:55 2025 Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C02C52417D1 for ; Mon, 14 Jul 2025 09:40:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752486029; cv=none; b=vCaDQTAAp93f9kDxBUr99tcQgoNbW0Hz6vulvsO/0CN3BrVvNob4KJOhHWmUf+GpxtfLSD1jtX1eWWclj3MfGhK9qK+OubYv7XkyLSc8CDx7NtxGcqvgz0KeG827dFLDzi6XeJJ0+4gVwhre0v9m6RM0RScRzp2YOvpMFffwiN8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752486029; c=relaxed/simple; bh=fAjYUeW+4LAGffwsSutY6W1lwq2EBQZzUiZY6gVtC8Q=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=IScva2ewcqVdTvDm8g5xlruKoZLGPXDQMfuQ8Ak9U2y6bkr6wdV7su/FEMnu+UaV2iLfzYOIGoM3M9W6pqhhyhK9w6VYG/Y0c9D/ZXOoe4m74eDdec1sn6ENTpVgR91q+5AWy+5NXa2XBHItMLYNSz8clg7r7rePC8BfwWb4gWg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=riscstar.com; spf=pass smtp.mailfrom=riscstar.com; dkim=pass (2048-bit key) header.d=riscstar-com.20230601.gappssmtp.com header.i=@riscstar-com.20230601.gappssmtp.com header.b=n09VUg/k; arc=none smtp.client-ip=209.85.221.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=riscstar.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=riscstar.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=riscstar-com.20230601.gappssmtp.com header.i=@riscstar-com.20230601.gappssmtp.com header.b="n09VUg/k" Received: by mail-wr1-f50.google.com with SMTP id ffacd0b85a97d-3a528243636so2147212f8f.3 for ; Mon, 14 Jul 2025 02:40:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=riscstar-com.20230601.gappssmtp.com; s=20230601; t=1752486025; x=1753090825; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=qq1yIQl81CDUUjvpmEnXhN2Lz/OlMt3l5QjMkKHWpvM=; b=n09VUg/kRiQ7MmyDt3GYMsn/4SkcV0vJmf2K0T6FnaO649i/AZxKRIjUVaSdlrLMVK xnSTDndkafym6RVKu//BkE321/Um78hVIpgEfMlwowKOQ/SaL7kzxCr+4LQQMjCyBkTp +IBRstzRGpW/ZQOJ5utCjtnzpEF9Ag7A4CnFOEQcuOQ2jIbE01/p1CTjG3uqGbYL+NK0 1e2ZAzMshrY4hoSMum3MeTdjxi7Fd4vTQCBxICqOTuLWcFU++UwJIHYr7y8y5gxlqjRP q5lkqTIlYiVkbcu2V2N/fDNsZi4uL2/Xi1pjztkYQ+TEslNS+BWbYywOeALhBaz4LB/k Qaqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752486025; x=1753090825; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qq1yIQl81CDUUjvpmEnXhN2Lz/OlMt3l5QjMkKHWpvM=; b=VhTudEM2bkxEWuEpKuNfKxlL/AUsmZRPBfpA8nrJwch8JRo/8kPXSM/HVq5FudDfTx FYwIZWCjcs2suanX/j2suc7ALXuWsd+lxmnKQnJJssIoigyAjnUoDMEWox4YNqY91Mpz ZI77tN4jFeKV88rShf92RXGvaTcebUNol+gnBC4tyCDu/5JLXRCQnn4gxvGc+cqUsCk1 zAvTwUKyYCvcnjQUpfCRHt1OmPzDP2+6HoQQn0cLqaLuBgwTfCwPZopCwBSAkGqlSFP4 RVF+Xt+kHIkbJ9JWWyk1EnvJDmZsoc4xFeHnCmNYKxdg7M0B6dLreYh360A67VYcp0L3 U6zA== X-Forwarded-Encrypted: i=1; AJvYcCWSefAL4qwyRRZYEE/lZq11B82SdSCoVMEobBnyBRIctZodn3at9xnBlNfWU+RANCEelbtWGIGUVU4eRUM=@vger.kernel.org X-Gm-Message-State: AOJu0Yx60lqkBN/Lw0cEPP5haqfvzLLSqhVywCwezFLBfHOmX11hhl4i lrB0YaSdO2Jb/L7Kt6SvMN61xWCAMpwTPjQak/ikxNj+Ky4+1w4XNGOarokP3XsorXg= X-Gm-Gg: ASbGncvq15/zRiUhlroO7PXA7Kj1jqJelHepWgeyMMEFZ+rzkl9jR+rddXh/hReA0rL tpTllTiDtz7kLy/1siuqL7AkjoNDOjHI/WVtOiUTFoKdo7cW49wAGMELv/H1zZpw4hWibaM3mkS tFFalgGNiP9Q15A4RqaS3g7Q8FnefuOU2udIB8dfTsftcYYx6Yrw3lOmJ1+cl2O0iUKd/ji4v7K k815D+T+1Q27nmitOhudZ3ntUdCvQm5hg7gmZAL2P1Xj7mfACp59ZAzlhwJ12g4Wk/m79eukOgQ Ottk6pHKCQtxnwhLM8VcJ9Ao7EabYLXiBP1/aPXlkn52JBdRNczqb2CH/4272oGgJBWKsvHxUw= = X-Google-Smtp-Source: AGHT+IF6lJB/75RKuYglHguDkP/WuOKNpgun14Va/8fXDBRY/jjqffgn9QMUWocm8IuxU0KZ4gL2CA== X-Received: by 2002:adf:cd8f:0:b0:3a4:f55a:4ae2 with SMTP id ffacd0b85a97d-3b5f18d9986mr7801135f8f.50.1752486025115; Mon, 14 Jul 2025 02:40:25 -0700 (PDT) Received: from [127.0.1.1] ([2a09:0:1:2::3035]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4561b25a948sm24989035e9.35.2025.07.14.02.40.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Jul 2025 02:40:24 -0700 (PDT) From: Guodong Xu Date: Mon, 14 Jul 2025 17:39:29 +0800 Subject: [PATCH v3 2/8] dmaengine: mmp_pdma: Add optional clock support Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250714-working_dma_0701_v2-v3-2-8b0f5cd71595@riscstar.com> References: <20250714-working_dma_0701_v2-v3-0-8b0f5cd71595@riscstar.com> In-Reply-To: <20250714-working_dma_0701_v2-v3-0-8b0f5cd71595@riscstar.com> To: Vinod Koul , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Yixun Lan , =?utf-8?q?Duje_Mihanovi=C4=87?= , Philipp Zabel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti Cc: Alex Elder , Vivian Wang , dmaengine@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, spacemit@lists.linux.dev, Guodong Xu X-Mailer: b4 0.14.2 Add support for retrieving and enabling an optional clock during mmp_pdma_probe(). Signed-off-by: Guodong Xu Tested-by: Troy Mitchell --- v3: No change. v2: No change. --- drivers/dma/mmp_pdma.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/dma/mmp_pdma.c b/drivers/dma/mmp_pdma.c index a95d31103d3063a1d11177a1a37b89ac2fd213e9..4a6dbf55823722d26cc69379d22= aaa88fbe19313 100644 --- a/drivers/dma/mmp_pdma.c +++ b/drivers/dma/mmp_pdma.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include =20 @@ -1019,6 +1020,7 @@ static int mmp_pdma_probe(struct platform_device *op) { struct mmp_pdma_device *pdev; struct mmp_dma_platdata *pdata =3D dev_get_platdata(&op->dev); + struct clk *clk; int i, ret, irq =3D 0; int dma_channels =3D 0, irq_num =3D 0; const enum dma_slave_buswidth widths =3D @@ -1037,6 +1039,10 @@ static int mmp_pdma_probe(struct platform_device *op) if (IS_ERR(pdev->base)) return PTR_ERR(pdev->base); =20 + clk =3D devm_clk_get_optional_enabled(pdev->dev, NULL); + if (IS_ERR(clk)) + return PTR_ERR(clk); + if (pdev->dev->of_node) { /* Parse new and deprecated dma-channels properties */ if (of_property_read_u32(pdev->dev->of_node, "dma-channels", --=20 2.43.0 From nobody Tue Oct 7 05:26:55 2025 Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BEE14244667 for ; Mon, 14 Jul 2025 09:40:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752486033; cv=none; b=VUOZvAp8VGzoXDqAPKkB3dd84bAxNiuA8kOWYstpHaqjwCPDBHvKC2Fsy4NoYtBaUP3470I2mHPWu4WUgBf/EL6eurAU9Hk51/YBzsgdOznylEWUwRWUV13C2iOj2qGyvWqUisgJrW7tAHvea7w3BkbPPirsIWf03IOCoECIL0I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752486033; c=relaxed/simple; bh=Rnvq7ILXDlYn7NCyNrMKelcmx8kPHn08CJvMC7C4paI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Girg8KdNx5NxsrCghqoXGsy6wA5kCfQgQ+DFLtUCqpzRLFk6d9lDnByuzp0BnEjMyAzCryl4KDzEKXDud9OTXd/z4ulOMrKnczAPSthC8LY0Y6e6b9loLcE/Won0hSbPjcZOHF51IbPypKH4/r6CzLRfMU8f5c4oWwWiHn9Kpgc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=riscstar.com; spf=pass smtp.mailfrom=riscstar.com; dkim=pass (2048-bit key) header.d=riscstar-com.20230601.gappssmtp.com header.i=@riscstar-com.20230601.gappssmtp.com header.b=05u/1uny; arc=none smtp.client-ip=209.85.128.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=riscstar.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=riscstar.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=riscstar-com.20230601.gappssmtp.com header.i=@riscstar-com.20230601.gappssmtp.com header.b="05u/1uny" Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-4560d176f97so15492805e9.0 for ; Mon, 14 Jul 2025 02:40:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=riscstar-com.20230601.gappssmtp.com; s=20230601; t=1752486030; x=1753090830; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=OERStMpxFd1oXz1mhimWCIXZsdyaGxN/N1YtYf02ffU=; b=05u/1unyDoWhpxfJaRp+DbVH5Z0MtRjys9KbOZbfg79QZdu43Kw2d+5pSUJNjOZuaq RahcbRYqgMX4o1cE7jUWsvHOqoretF0xNkKn5ruS9in2tJr5yiII+37lVHAqRIzqqyHu atvoYyMIMpe5rM1oit5kwKkwP/yHscYF8xV05d/Fy4kdctxn8BIUZahGaN96lVJaJcCh BFHWqO+tj1KrViutmDyKAeX4t5A+MwbA3TKR9ec068GI6n7USDOYZCKCgkv5Hojd+y5+ dPDtXLfaU5GYTmMhBk72/zRZleKlw5dwwzNiUrcDK+VW0z1eSfdXAvGEN12nyE+1/Tki vaEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752486030; x=1753090830; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=OERStMpxFd1oXz1mhimWCIXZsdyaGxN/N1YtYf02ffU=; b=R8hLM9JLvIDJ/DtfTK5aDRr93kEHC5EQeUEEWTf9zkUEK8WI/xUz7vGoNNhlaLi3Ih +JrcBT0IdMSdrsBdVAIKn6Nc56SFpdJYUSu3JIBxKPqHF17v/gnAhJHhc90T5VcZ9er/ HnqFYjo/ez+r7PLtSri/gMhXrbl6tEPTAGlOsWhCdUUNEATEQm9YzpwRHpOU0YmmPC0X xnFpG1YdYdHBWFk5R846o4E6zVA2Dc6Kb0mLi7kzNi5P/Rsc+OP68Jut/1sUSAvSPoBO aytJCvgn1r3ekx/adCI1xt9Vsms849G8mQD8OwI9rNmKMBxWLgDhuMSNsOvi/AQkzwY2 wzlw== X-Forwarded-Encrypted: i=1; AJvYcCWE2oyIKuzG4XVxM16zVmXQFEowfOvbv4dK2AV5yyAfDC7RixDnNGTO1liMOoj92IHGnf4p6XdVuYweE7k=@vger.kernel.org X-Gm-Message-State: AOJu0YzNC2YbXYQ3cRTqEXzDDp0zE1c9DdjrYL4jumQBvIPLnn02VisY 81l92FnSgnTn3NV2ORRqHaB5PegDNzWoCEpjvPKGeL5lnubnWdru9Yo1gNwtvSMdobE= X-Gm-Gg: ASbGncvtfQkuKLKP5gJE5PmJlfx7L3uw+E+mJ/5AVSxeaIcsvQWtZI0F0+jisLAkUad kCkrmv1DI8vaao9BCd8SSj+wf91ScLVQjIFob1Fewz2cQXsbKc1raY87v9/bTMwZDOSbix64f6G APZ/do01tjA4hQh8bRhXVgjZyX0P1iIkXRrSJiBXDohxbRSOfdFb2r+GzWUuLD/aBPE2pt9tj3k Q5W8efphfCVB705R3fK/Zw04nz5d5ZIH/k/8C8iTHE7FJqpp+2kJH5XRdcmBQckIcSIBc+sSbeP VG2uTn1F+nqVIA13RRQ3UZNOesZcrqJomsSxMXy99y4sjFyli235WtI0TPTYcLCqFcudNItoAA= = X-Google-Smtp-Source: AGHT+IFjyUYE1dOQ8JxazLI7iDjsE8P/QTDlCi2i9qu5IYfCUbgHi3kKfOduLMWkN27Rdg061Q9fig== X-Received: by 2002:a05:600c:a08e:b0:453:745:8534 with SMTP id 5b1f17b1804b1-454ec128c22mr110575145e9.12.1752486030219; Mon, 14 Jul 2025 02:40:30 -0700 (PDT) Received: from [127.0.1.1] ([2a09:0:1:2::3035]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4561b25a948sm24989035e9.35.2025.07.14.02.40.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Jul 2025 02:40:29 -0700 (PDT) From: Guodong Xu Date: Mon, 14 Jul 2025 17:39:30 +0800 Subject: [PATCH v3 3/8] dmaengine: mmp_pdma: Add optional reset controller support Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250714-working_dma_0701_v2-v3-3-8b0f5cd71595@riscstar.com> References: <20250714-working_dma_0701_v2-v3-0-8b0f5cd71595@riscstar.com> In-Reply-To: <20250714-working_dma_0701_v2-v3-0-8b0f5cd71595@riscstar.com> To: Vinod Koul , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Yixun Lan , =?utf-8?q?Duje_Mihanovi=C4=87?= , Philipp Zabel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti Cc: Alex Elder , Vivian Wang , dmaengine@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, spacemit@lists.linux.dev, Guodong Xu X-Mailer: b4 0.14.2 Add support to acquire and deassert an optional hardware reset controller during mmp_pdma_probe(). Signed-off-by: Guodong Xu Tested-by: Troy Mitchell --- v3: No change. v2: No change. --- drivers/dma/mmp_pdma.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/dma/mmp_pdma.c b/drivers/dma/mmp_pdma.c index 4a6dbf55823722d26cc69379d22aaa88fbe19313..fe627efeaff07436647f86ab5ec= 5333144a3c92d 100644 --- a/drivers/dma/mmp_pdma.c +++ b/drivers/dma/mmp_pdma.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include =20 @@ -1021,6 +1022,7 @@ static int mmp_pdma_probe(struct platform_device *op) struct mmp_pdma_device *pdev; struct mmp_dma_platdata *pdata =3D dev_get_platdata(&op->dev); struct clk *clk; + struct reset_control *rst; int i, ret, irq =3D 0; int dma_channels =3D 0, irq_num =3D 0; const enum dma_slave_buswidth widths =3D @@ -1043,6 +1045,11 @@ static int mmp_pdma_probe(struct platform_device *op) if (IS_ERR(clk)) return PTR_ERR(clk); =20 + rst =3D devm_reset_control_get_optional_exclusive_deasserted(pdev->dev, + NULL); + if (IS_ERR(rst)) + return PTR_ERR(rst); + if (pdev->dev->of_node) { /* Parse new and deprecated dma-channels properties */ if (of_property_read_u32(pdev->dev->of_node, "dma-channels", --=20 2.43.0 From nobody Tue Oct 7 05:26:55 2025 Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2EBDF242D6C for ; Mon, 14 Jul 2025 09:40:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752486039; cv=none; b=s6fzMVyU3g/KbjAF9U2DN/R2ifih1okJd+doxMAenui4X2KZT8J8jVraIY1ANJ6Kmie7NmgYGdxJ+4wEk82iduJayZVxkpaW22u6RK2aYL8xbkP/rd/YzMeuTpUBq/nS6QwwytVUfq3jMrfivBxZQZRzzsou2rQWGswRefmS2G8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752486039; c=relaxed/simple; bh=Ic0q083PKb5jQO5jS8PJtAWjghdihgrksDGL2Bmonhs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=azTs5oua4H3noLFPNa7nIlfuJL2s3/MM3xiQt4AyGcX1N9cPWfPQZ9nSaistTR8NZlK2dQ9SZqWcbA5TVCXsQk7owX8ZXEmW7VulNKGkPfx7jpfiRDo82dHpwx/osSq1U2pDM5cDMzvvCAaYQXYhzL+ioXLp/dQLpXVLQ5QOjlc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=riscstar.com; spf=pass smtp.mailfrom=riscstar.com; dkim=pass (2048-bit key) header.d=riscstar-com.20230601.gappssmtp.com header.i=@riscstar-com.20230601.gappssmtp.com header.b=alKYlEde; arc=none smtp.client-ip=209.85.128.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=riscstar.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=riscstar.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=riscstar-com.20230601.gappssmtp.com header.i=@riscstar-com.20230601.gappssmtp.com header.b="alKYlEde" Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-455e6fb8057so27693955e9.3 for ; Mon, 14 Jul 2025 02:40:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=riscstar-com.20230601.gappssmtp.com; s=20230601; t=1752486035; x=1753090835; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=Nf/IPfUyGjpqzTHraTaPzdUKhY9dRaqJkChrbbDT/mU=; b=alKYlEde9UMWsdAGQnh43wR/kw5hkhi2vZEXtnMM0YFOZeZ3PIhGuEnhwKoMkDD8ou zlnXn3PWukhJZoSmDTC1FWFESYBR+LPIJG79r6348nbqgpHs56kVhpyuSnjLkiSpFNFz iaQxAf2IqWYuuEOaoCAm80vZv1JgOeHteBkloQAx2ctTO4NaCTvTgIsuofiEFLAKGZ2O bsqUoIz2SCXr2MwXr88HVdVGCiZGi0l0LBktbDotiUJZ09qwRXgjE45XHEeCrXSB1vW/ nTDFAW2Qc0vBIGcbXU9NbEUoU1CJR3+RDa30/YxDamLUwrAYwEXBHz/WdUnx78swE4G0 DSAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752486035; x=1753090835; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Nf/IPfUyGjpqzTHraTaPzdUKhY9dRaqJkChrbbDT/mU=; b=ECL7qxiowZP98QRJQseGp0FWoDE3CEw/5/Ie+H+KMm4Ci6Jrv0yPvZnW2nAEWVub4b qu0UzbWVopAdJSCuFqeGGR9ei3k/w1s0lTixDK0QlnQZdF8EaO2m7Ur+gh8mqlP+75f6 754bCGAM2nJ/G/00wU8YnLdFWZtjnME0c1bXUnLudWOXdr3R+SGp//3/4SOyqS6EQ7BB dbRyLCOqPIomhW+gYaitMpnZWGW+gX5Adk3KVa09Vkiwy+HbkrAkDCLnLVKrSLogG8bB E/jsQAiO8y+3V6XsQWi8PvKgEIL3cxbT4G6DjUscBvR2u1hzWWG/cSBDeXn+6th9gOvZ S4EA== X-Forwarded-Encrypted: i=1; AJvYcCVv3Cbsdycq9DFcaYfT2bJ/zNauHxCUjOOGrfjyh0MJPI9N0BtYifCDokJp+r5bYbGiI0GwtB2oby9NVRw=@vger.kernel.org X-Gm-Message-State: AOJu0YxBkLVDGCd+Lkze+qaEZDNd4iTxQdNIzaG6aOWCG98ftOIzydR5 YAOvjOHHD6seV+zTv5hWUl7MojLJEJF9pIY7sl71jjb/iUhoUGFNPNLVCq9gzFQn5Gw= X-Gm-Gg: ASbGncuHCU1DGqIw/i+GuJfyisBFCl7KQwDHDH+dZS9tqwoNjRW8tI0DdlpvMMvxunJ VQRGGiFMr0XkGZtCyl4e/MLtdUExXVD1KUme+7usHFsPidZlE+H/jPackO/8Xk8MrVjl6DS9oom 81hlS6bxBvgtcozrCgHZ5MPZ+HVmRiv3+Ipy7W74MCu9+4yXk1Xpiuv5BJws75FojklQiN+obak 4+C5lh3VsdWj3zKwTHn8OC7HNg3VWPpyF5b030wRdsdt2zM85xbTqUB+rxqheUFVS3Ay0S/OfmX lxzr4E88tltPcv2QlT0C9+rZvI8hzQaZDI1w4HkglMoBVB+uxc2nty6EjJ6qmM4+9cUROb8o2A= = X-Google-Smtp-Source: AGHT+IEQZoU/n08E3LUSTa2y5lN/DekZwsaH3HdxgDScpT0Usl6o4Nzw23KeBCf0UPOjneDAUTbB3g== X-Received: by 2002:a05:600c:1d20:b0:456:1ac8:cac8 with SMTP id 5b1f17b1804b1-4561ac8ce1dmr23716405e9.15.1752486035477; Mon, 14 Jul 2025 02:40:35 -0700 (PDT) Received: from [127.0.1.1] ([2a09:0:1:2::3035]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4561b25a948sm24989035e9.35.2025.07.14.02.40.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Jul 2025 02:40:35 -0700 (PDT) From: Guodong Xu Date: Mon, 14 Jul 2025 17:39:31 +0800 Subject: [PATCH v3 4/8] dmaengine: mmp_pdma: Add operations structure for controller abstraction Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250714-working_dma_0701_v2-v3-4-8b0f5cd71595@riscstar.com> References: <20250714-working_dma_0701_v2-v3-0-8b0f5cd71595@riscstar.com> In-Reply-To: <20250714-working_dma_0701_v2-v3-0-8b0f5cd71595@riscstar.com> To: Vinod Koul , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Yixun Lan , =?utf-8?q?Duje_Mihanovi=C4=87?= , Philipp Zabel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti Cc: Alex Elder , Vivian Wang , dmaengine@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, spacemit@lists.linux.dev, Guodong Xu X-Mailer: b4 0.14.2 Introduce mmp_pdma_ops structure to abstract 32-bit addressing operations and enable support for different controller variants. This prepares for adding 64-bit addressing support. The ops structure includes: - Hardware register operations (read/write DDADR, DSADR, DTADR) - Descriptor memory operations (manipulate descriptor structs) - Controller configuration (run bits, DMA mask) Convert existing 32-bit operations to use the new abstraction layer while maintaining backward compatibility. Signed-off-by: Guodong Xu Tested-by: Troy Mitchell --- v3: No change. v2: New patch, introduce mmp_pdma_ops for 32-bit addressing operations. --- drivers/dma/mmp_pdma.c | 187 +++++++++++++++++++++++++++++++++++++++++----= ---- 1 file changed, 156 insertions(+), 31 deletions(-) diff --git a/drivers/dma/mmp_pdma.c b/drivers/dma/mmp_pdma.c index fe627efeaff07436647f86ab5ec5333144a3c92d..610df28f429783779c1c143a13b= 3a829e42cf003 100644 --- a/drivers/dma/mmp_pdma.c +++ b/drivers/dma/mmp_pdma.c @@ -25,7 +25,7 @@ #define DCSR 0x0000 #define DALGN 0x00a0 #define DINT 0x00f0 -#define DDADR 0x0200 +#define DDADR(n) (0x0200 + ((n) << 4)) #define DSADR(n) (0x0204 + ((n) << 4)) #define DTADR(n) (0x0208 + ((n) << 4)) #define DCMD 0x020c @@ -120,12 +120,55 @@ struct mmp_pdma_phy { struct mmp_pdma_chan *vchan; }; =20 +/** + * struct mmp_pdma_ops - Operations for the MMP PDMA controller + * + * Hardware Register Operations (read/write hardware registers): + * @write_next_addr: Function to program address of next descriptor into + * DDADR/DDADRH + * @read_src_addr: Function to read the source address from DSADR/DSADRH + * @read_dst_addr: Function to read the destination address from DTADR/DTA= DRH + * + * Descriptor Memory Operations (manipulate descriptor structs in memory): + * @set_desc_next_addr: Function to set next descriptor address in descrip= tor + * @set_desc_src_addr: Function to set the source address in descriptor + * @set_desc_dst_addr: Function to set the destination address in descript= or + * @get_desc_src_addr: Function to get the source address from descriptor + * @get_desc_dst_addr: Function to get the destination address from descri= ptor + * + * Controller Configuration: + * @run_bits: Control bits in DCSR register for channel start/stop + * @dma_mask: DMA addressing capability of controller. 0 to use OF/platf= orm + * settings, or explicit mask like DMA_BIT_MASK(32/64) + */ +struct mmp_pdma_ops { + /* Hardware Register Operations */ + void (*write_next_addr)(struct mmp_pdma_phy *phy, dma_addr_t addr); + u64 (*read_src_addr)(struct mmp_pdma_phy *phy); + u64 (*read_dst_addr)(struct mmp_pdma_phy *phy); + + /* Descriptor Memory Operations */ + void (*set_desc_next_addr)(struct mmp_pdma_desc_hw *desc, + dma_addr_t addr); + void (*set_desc_src_addr)(struct mmp_pdma_desc_hw *desc, + dma_addr_t addr); + void (*set_desc_dst_addr)(struct mmp_pdma_desc_hw *desc, + dma_addr_t addr); + u64 (*get_desc_src_addr)(const struct mmp_pdma_desc_hw *desc); + u64 (*get_desc_dst_addr)(const struct mmp_pdma_desc_hw *desc); + + /* Controller Configuration */ + u32 run_bits; + u64 dma_mask; +}; + struct mmp_pdma_device { int dma_channels; void __iomem *base; struct device *dev; struct dma_device device; struct mmp_pdma_phy *phy; + const struct mmp_pdma_ops *ops; spinlock_t phy_lock; /* protect alloc/free phy channels */ }; =20 @@ -138,24 +181,61 @@ struct mmp_pdma_device { #define to_mmp_pdma_dev(dmadev) \ container_of(dmadev, struct mmp_pdma_device, device) =20 -static int mmp_pdma_config_write(struct dma_chan *dchan, - struct dma_slave_config *cfg, - enum dma_transfer_direction direction); +/* For 32-bit PDMA */ +static void write_next_addr_32(struct mmp_pdma_phy *phy, dma_addr_t addr) +{ + writel(addr, phy->base + DDADR(phy->idx)); +} =20 -static void set_desc(struct mmp_pdma_phy *phy, dma_addr_t addr) +static u64 read_src_addr_32(struct mmp_pdma_phy *phy) { - u32 reg =3D (phy->idx << 4) + DDADR; + return readl(phy->base + DSADR(phy->idx)); +} =20 - writel(addr, phy->base + reg); +static u64 read_dst_addr_32(struct mmp_pdma_phy *phy) +{ + return readl(phy->base + DTADR(phy->idx)); +} + +static void set_desc_next_addr_32(struct mmp_pdma_desc_hw *desc, dma_addr_= t addr) +{ + desc->ddadr =3D addr; +} + +static void set_desc_src_addr_32(struct mmp_pdma_desc_hw *desc, dma_addr_t= addr) +{ + desc->dsadr =3D addr; +} + +static void set_desc_dst_addr_32(struct mmp_pdma_desc_hw *desc, dma_addr_t= addr) +{ + desc->dtadr =3D addr; } =20 +static u64 get_desc_src_addr_32(const struct mmp_pdma_desc_hw *desc) +{ + return desc->dsadr; +} + +static u64 get_desc_dst_addr_32(const struct mmp_pdma_desc_hw *desc) +{ + return desc->dtadr; +} + +static int mmp_pdma_config_write(struct dma_chan *dchan, + struct dma_slave_config *cfg, + enum dma_transfer_direction direction); + static void enable_chan(struct mmp_pdma_phy *phy) { u32 reg, dalgn; + struct mmp_pdma_device *pdev; =20 if (!phy->vchan) return; =20 + pdev =3D to_mmp_pdma_dev(phy->vchan->chan.device); + reg =3D DRCMR(phy->vchan->drcmr); writel(DRCMR_MAPVLD | phy->idx, phy->base + reg); =20 @@ -167,18 +247,29 @@ static void enable_chan(struct mmp_pdma_phy *phy) writel(dalgn, phy->base + DALGN); =20 reg =3D (phy->idx << 2) + DCSR; - writel(readl(phy->base + reg) | DCSR_RUN, phy->base + reg); + writel(readl(phy->base + reg) | pdev->ops->run_bits, + phy->base + reg); } =20 static void disable_chan(struct mmp_pdma_phy *phy) { - u32 reg; + u32 reg, dcsr; =20 if (!phy) return; =20 reg =3D (phy->idx << 2) + DCSR; - writel(readl(phy->base + reg) & ~DCSR_RUN, phy->base + reg); + dcsr =3D readl(phy->base + reg); + + if (phy->vchan) { + struct mmp_pdma_device *pdev; + + pdev =3D to_mmp_pdma_dev(phy->vchan->chan.device); + writel(dcsr & ~pdev->ops->run_bits, phy->base + reg); + } else { + /* If no vchan, just clear the RUN bit */ + writel(dcsr & ~DCSR_RUN, phy->base + reg); + } } =20 static int clear_chan_irq(struct mmp_pdma_phy *phy) @@ -297,6 +388,7 @@ static void mmp_pdma_free_phy(struct mmp_pdma_chan *pch= an) static void start_pending_queue(struct mmp_pdma_chan *chan) { struct mmp_pdma_desc_sw *desc; + struct mmp_pdma_device *pdev =3D to_mmp_pdma_dev(chan->chan.device); =20 /* still in running, irq will start the pending list */ if (!chan->idle) { @@ -331,7 +423,7 @@ static void start_pending_queue(struct mmp_pdma_chan *c= han) * Program the descriptor's address into the DMA controller, * then start the DMA transaction */ - set_desc(chan->phy, desc->async_tx.phys); + pdev->ops->write_next_addr(chan->phy, desc->async_tx.phys); enable_chan(chan->phy); chan->idle =3D false; } @@ -447,6 +539,7 @@ mmp_pdma_prep_memcpy(struct dma_chan *dchan, size_t len, unsigned long flags) { struct mmp_pdma_chan *chan; + struct mmp_pdma_device *pdev =3D to_mmp_pdma_dev(dchan->device); struct mmp_pdma_desc_sw *first =3D NULL, *prev =3D NULL, *new; size_t copy =3D 0; =20 @@ -478,13 +571,14 @@ mmp_pdma_prep_memcpy(struct dma_chan *dchan, chan->byte_align =3D true; =20 new->desc.dcmd =3D chan->dcmd | (DCMD_LENGTH & copy); - new->desc.dsadr =3D dma_src; - new->desc.dtadr =3D dma_dst; + pdev->ops->set_desc_src_addr(&new->desc, dma_src); + pdev->ops->set_desc_dst_addr(&new->desc, dma_dst); =20 if (!first) first =3D new; else - prev->desc.ddadr =3D new->async_tx.phys; + pdev->ops->set_desc_next_addr(&prev->desc, + new->async_tx.phys); =20 new->async_tx.cookie =3D 0; async_tx_ack(&new->async_tx); @@ -528,6 +622,7 @@ mmp_pdma_prep_slave_sg(struct dma_chan *dchan, struct s= catterlist *sgl, unsigned long flags, void *context) { struct mmp_pdma_chan *chan =3D to_mmp_pdma_chan(dchan); + struct mmp_pdma_device *pdev =3D to_mmp_pdma_dev(dchan->device); struct mmp_pdma_desc_sw *first =3D NULL, *prev =3D NULL, *new =3D NULL; size_t len, avail; struct scatterlist *sg; @@ -559,17 +654,18 @@ mmp_pdma_prep_slave_sg(struct dma_chan *dchan, struct= scatterlist *sgl, =20 new->desc.dcmd =3D chan->dcmd | (DCMD_LENGTH & len); if (dir =3D=3D DMA_MEM_TO_DEV) { - new->desc.dsadr =3D addr; + pdev->ops->set_desc_src_addr(&new->desc, addr); new->desc.dtadr =3D chan->dev_addr; } else { new->desc.dsadr =3D chan->dev_addr; - new->desc.dtadr =3D addr; + pdev->ops->set_desc_dst_addr(&new->desc, addr); } =20 if (!first) first =3D new; else - prev->desc.ddadr =3D new->async_tx.phys; + pdev->ops->set_desc_next_addr(&prev->desc, + new->async_tx.phys); =20 new->async_tx.cookie =3D 0; async_tx_ack(&new->async_tx); @@ -609,6 +705,7 @@ mmp_pdma_prep_dma_cyclic(struct dma_chan *dchan, unsigned long flags) { struct mmp_pdma_chan *chan; + struct mmp_pdma_device *pdev =3D to_mmp_pdma_dev(dchan->device); struct mmp_pdma_desc_sw *first =3D NULL, *prev =3D NULL, *new; dma_addr_t dma_src, dma_dst; =20 @@ -651,13 +748,14 @@ mmp_pdma_prep_dma_cyclic(struct dma_chan *dchan, =20 new->desc.dcmd =3D (chan->dcmd | DCMD_ENDIRQEN | (DCMD_LENGTH & period_len)); - new->desc.dsadr =3D dma_src; - new->desc.dtadr =3D dma_dst; + pdev->ops->set_desc_src_addr(&new->desc, dma_src); + pdev->ops->set_desc_dst_addr(&new->desc, dma_dst); =20 if (!first) first =3D new; else - prev->desc.ddadr =3D new->async_tx.phys; + pdev->ops->set_desc_next_addr(&prev->desc, + new->async_tx.phys); =20 new->async_tx.cookie =3D 0; async_tx_ack(&new->async_tx); @@ -678,7 +776,7 @@ mmp_pdma_prep_dma_cyclic(struct dma_chan *dchan, first->async_tx.cookie =3D -EBUSY; =20 /* make the cyclic link */ - new->desc.ddadr =3D first->async_tx.phys; + pdev->ops->set_desc_next_addr(&new->desc, first->async_tx.phys); chan->cyclic_first =3D first; =20 return &first->async_tx; @@ -764,7 +862,9 @@ static unsigned int mmp_pdma_residue(struct mmp_pdma_ch= an *chan, dma_cookie_t cookie) { struct mmp_pdma_desc_sw *sw; - u32 curr, residue =3D 0; + struct mmp_pdma_device *pdev =3D to_mmp_pdma_dev(chan->chan.device); + u64 curr; + u32 residue =3D 0; bool passed =3D false; bool cyclic =3D chan->cyclic_first !=3D NULL; =20 @@ -776,17 +876,18 @@ static unsigned int mmp_pdma_residue(struct mmp_pdma_= chan *chan, return 0; =20 if (chan->dir =3D=3D DMA_DEV_TO_MEM) - curr =3D readl(chan->phy->base + DTADR(chan->phy->idx)); + curr =3D pdev->ops->read_dst_addr(chan->phy); else - curr =3D readl(chan->phy->base + DSADR(chan->phy->idx)); + curr =3D pdev->ops->read_src_addr(chan->phy); =20 list_for_each_entry(sw, &chan->chain_running, node) { - u32 start, end, len; + u64 start, end; + u32 len; =20 if (chan->dir =3D=3D DMA_DEV_TO_MEM) - start =3D sw->desc.dtadr; + start =3D pdev->ops->get_desc_dst_addr(&sw->desc); else - start =3D sw->desc.dsadr; + start =3D pdev->ops->get_desc_src_addr(&sw->desc); =20 len =3D sw->desc.dcmd & DCMD_LENGTH; end =3D start + len; @@ -802,7 +903,7 @@ static unsigned int mmp_pdma_residue(struct mmp_pdma_ch= an *chan, if (passed) { residue +=3D len; } else if (curr >=3D start && curr <=3D end) { - residue +=3D end - curr; + residue +=3D (u32)(end - curr); passed =3D true; } =20 @@ -996,9 +1097,26 @@ static int mmp_pdma_chan_init(struct mmp_pdma_device = *pdev, int idx, int irq) return 0; } =20 +static const struct mmp_pdma_ops marvell_pdma_v1_ops =3D { + .write_next_addr =3D write_next_addr_32, + .read_src_addr =3D read_src_addr_32, + .read_dst_addr =3D read_dst_addr_32, + .set_desc_next_addr =3D set_desc_next_addr_32, + .set_desc_src_addr =3D set_desc_src_addr_32, + .set_desc_dst_addr =3D set_desc_dst_addr_32, + .get_desc_src_addr =3D get_desc_src_addr_32, + .get_desc_dst_addr =3D get_desc_dst_addr_32, + .run_bits =3D (DCSR_RUN), + .dma_mask =3D 0, /* let OF/platform set DMA mask */ +}; + static const struct of_device_id mmp_pdma_dt_ids[] =3D { - { .compatible =3D "marvell,pdma-1.0", }, - {} + { + .compatible =3D "marvell,pdma-1.0", + .data =3D &marvell_pdma_v1_ops + }, { + /* sentinel */ + } }; MODULE_DEVICE_TABLE(of, mmp_pdma_dt_ids); =20 @@ -1050,6 +1168,10 @@ static int mmp_pdma_probe(struct platform_device *op) if (IS_ERR(rst)) return PTR_ERR(rst); =20 + pdev->ops =3D of_device_get_match_data(&op->dev); + if (!pdev->ops) + return -ENODEV; + if (pdev->dev->of_node) { /* Parse new and deprecated dma-channels properties */ if (of_property_read_u32(pdev->dev->of_node, "dma-channels", @@ -1111,7 +1233,10 @@ static int mmp_pdma_probe(struct platform_device *op) pdev->device.directions =3D BIT(DMA_MEM_TO_DEV) | BIT(DMA_DEV_TO_MEM); pdev->device.residue_granularity =3D DMA_RESIDUE_GRANULARITY_DESCRIPTOR; =20 - if (pdev->dev->coherent_dma_mask) + /* Set DMA mask based on ops->dma_mask, or OF/platform */ + if (pdev->ops->dma_mask) + dma_set_mask(pdev->dev, pdev->ops->dma_mask); + else if (pdev->dev->coherent_dma_mask) dma_set_mask(pdev->dev, pdev->dev->coherent_dma_mask); else dma_set_mask(pdev->dev, DMA_BIT_MASK(64)); --=20 2.43.0 From nobody Tue Oct 7 05:26:55 2025 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 47F2924169D for ; Mon, 14 Jul 2025 09:40:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752486045; cv=none; b=r/uwDwNbWY7uUZS6c/WS/V+BpPWcvZYlHb+qbCeqxfCf+/MinakDDr2XWDWvpg8RQPDnTGKycXhq1/EZfJxRAXyWxoRnFvz5pvZZZMn4DbqgtaWaSu0Favr+brA/fosDvoNlCSnZkhRAwonzmhAzZcmjJ7gHHJngfx1T/6g6qn4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752486045; c=relaxed/simple; bh=t+PtLLl2csko86gC15MVR5xmoGQ82PGqWDIw44J/F64=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Sn3v6uNwAFPhwxt+96rUnmZ0XYn5D7NKX/Z5PuqiHyUtLnif/N8f3njYnR+XokcAJXLeJ+jWXbJ2nwD9NXdklDVhWfQA4D0pc5uZ0lFDe2/pwJRK3khHBFY0/859lEHdM0Cu2Pi1+yRxnOoyIpBf+DVy4oSYL+m9cz7+HDMX6+Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=riscstar.com; spf=pass smtp.mailfrom=riscstar.com; dkim=pass (2048-bit key) header.d=riscstar-com.20230601.gappssmtp.com header.i=@riscstar-com.20230601.gappssmtp.com header.b=p2ZLe2nt; arc=none smtp.client-ip=209.85.128.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=riscstar.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=riscstar.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=riscstar-com.20230601.gappssmtp.com header.i=@riscstar-com.20230601.gappssmtp.com header.b="p2ZLe2nt" Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-451dbe494d6so38977025e9.1 for ; Mon, 14 Jul 2025 02:40:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=riscstar-com.20230601.gappssmtp.com; s=20230601; t=1752486040; x=1753090840; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=lHyo6WbVst+k96hYCCL5FpFG2I13xsshsqklBEvZimA=; b=p2ZLe2nts1BoE6Y0POBTmAxwGFPDUKV2ePwNre6VVaZ2sXHfStPHaOLD0Xg7EewvuP ZjN3HVCOuejaP9etiyUqgupozD28yxrovzUEsFoYJgUjZ/ZSf8QMCGjWA5THcpbDCdXP ScpUxl7wJ5hdZ8KHa7dq2dgvnyWDlYO3X/l/cSwdSI/XtcZR1cTE19BVUPEJ8igHGcgN MOBKL+Tj0LrZeNw1UnXLWrLp8ccS0Gr1WMcgF1nhIuvTkDhqj38mZBJW8XBKpUCFKRgU ExtyE9gdEWYpQfWssRGLpJ6PeMIy2eOHHE2DrqFPRCWXGufcphamcZ54QHsj0T9VBo74 MHxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752486040; x=1753090840; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lHyo6WbVst+k96hYCCL5FpFG2I13xsshsqklBEvZimA=; b=heTxi5QIr7gxFQIblh4+nFNTQnQkB9H3LeaEmdgAerxCQPFYqAPc4jhilFWOKeUDt8 1FftLKHAvaqmlPMeUESc+8tjyVxrxjrOseYQGU1WIye8xzZDwI2FQiFsvEvLxkURLekt t69vukJYSuAvnDK/D9nMRkTa551Fm99MP5xthGCW/Vvhvaih/U1VtFdYozN6KUqRkJsG zyHjudYx7mqL9dx55HAwak5Hkm6zs64yab/FsBHQKmD8e7Sko/OxGB7ds8+sz6R0XLLk +JYamen0eDy8DA2Ur3aDWJ1uH0fAM2JGV6NVJMdfBTsZTyaU0Kz8SIbe5yfYQjUqvkXO 5h+w== X-Forwarded-Encrypted: i=1; AJvYcCXGTiK34XVs75bUGE+thbIqZrRijePjBLWYzyFUJrOJ6XzPR7KKCNuVDlNBXPSLfiGwRUaGVLZzKgLkRRQ=@vger.kernel.org X-Gm-Message-State: AOJu0YxQ4jNWQvcBfV1NxWGbdQja9dKp9lgi25D/iL90By0CE0KYsZ5i d7rMztsvqovWJZh7mQUMAho+VtEfNxekRwd4b95GCsK2vknjpdXDMKEn3FhztmiMZx8= X-Gm-Gg: ASbGncshjatK4xxQ/R1ScAoXfIOawPQWVe31OMPD0znSdmzuINgLeHWs1xUSgyNoPsL xsKmPQ2rrl97tEr87JrIS1qMT082A1WoCn3vn3mhCbHM88VZURoCVm7QNqdgedp/1KquvLTJIsU V6JieS7iT+NT8UdZlOSaosUUF/EpdYnwdj8w0b+L3/185TkJG9C8kCD71BfEudXHvBrdKx3mZXp b/+4qC9lrhKGvRePj2deZ6I9zoSVOZbF/C2hqOSaTKe0TPBV/6+zD8H8c/dv+nYKz4ZQawHAvNs KjGMCc8jffMgk2ILQsId6zmjnq+AJWrP9OOdzREH5um7/Wfekw1B5dfLTfWUu1FZ296UvfxvRn7 a0/3nFNqA X-Google-Smtp-Source: AGHT+IGMTXvhvY8iN6lci20yl+rKURCNv/HNwzYvEck8oYvdUaVh9h9tdTVerIXfkpTkApuHna9q8g== X-Received: by 2002:a05:600c:610:b0:43c:f44c:72a6 with SMTP id 5b1f17b1804b1-455174367demr79853935e9.2.1752486040570; Mon, 14 Jul 2025 02:40:40 -0700 (PDT) Received: from [127.0.1.1] ([2a09:0:1:2::3035]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4561b25a948sm24989035e9.35.2025.07.14.02.40.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Jul 2025 02:40:40 -0700 (PDT) From: Guodong Xu Date: Mon, 14 Jul 2025 17:39:32 +0800 Subject: [PATCH v3 5/8] dmaengine: mmp_pdma: Add SpacemiT K1 PDMA support with 64-bit addressing Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250714-working_dma_0701_v2-v3-5-8b0f5cd71595@riscstar.com> References: <20250714-working_dma_0701_v2-v3-0-8b0f5cd71595@riscstar.com> In-Reply-To: <20250714-working_dma_0701_v2-v3-0-8b0f5cd71595@riscstar.com> To: Vinod Koul , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Yixun Lan , =?utf-8?q?Duje_Mihanovi=C4=87?= , Philipp Zabel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti Cc: Alex Elder , Vivian Wang , dmaengine@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, spacemit@lists.linux.dev, Guodong Xu X-Mailer: b4 0.14.2 Add support for SpacemiT K1 PDMA controller which features 64-bit addressing capabilities. The SpacemiT K1 PDMA extends the descriptor format with additional 32-bit words for high address bits, enabling access to memory beyond 4GB boundaries. The new spacemit_k1_pdma_ops provides necessary 64-bit address handling functions and k1 specific controller configurations. Key changes: - Add ARCH_SPACEMIT dependency to Kconfig - Define new high 32-bit address registers (DDADRH, DSADRH, DTADRH) - Add DCSR_LPAEEN bit for Long Physical Address Extension Enable - Implement 64-bit operations for SpacemiT K1 PDMA Signed-off-by: Guodong Xu Tested-by: Troy Mitchell --- v3: No change. v2: New patch. - Implement 64-bit addrssing support to mmp_pdma - Add support for SpacemiT K1 PDMA - Extend the MMP_PDMA entry in Kconfig to depend on ARCH_SPACEMIT --- drivers/dma/Kconfig | 2 +- drivers/dma/mmp_pdma.c | 81 ++++++++++++++++++++++++++++++++++++++++++++++= ++++ 2 files changed, 82 insertions(+), 1 deletion(-) diff --git a/drivers/dma/Kconfig b/drivers/dma/Kconfig index db87dd2a07f7606e40dc26ea41d26fcdd1fad979..fff70f66c773934efb2fcafdc36= 28ba06c734640 100644 --- a/drivers/dma/Kconfig +++ b/drivers/dma/Kconfig @@ -451,7 +451,7 @@ config MILBEAUT_XDMAC =20 config MMP_PDMA tristate "MMP PDMA support" - depends on ARCH_MMP || ARCH_PXA || COMPILE_TEST + depends on ARCH_MMP || ARCH_PXA || ARCH_SPACEMIT || COMPILE_TEST select DMA_ENGINE help Support the MMP PDMA engine for PXA and MMP platform. diff --git a/drivers/dma/mmp_pdma.c b/drivers/dma/mmp_pdma.c index 610df28f429783779c1c143a13b3a829e42cf003..28c03d05e0b2708fcb8faffeeb9= 7b97ed6fcbdc5 100644 --- a/drivers/dma/mmp_pdma.c +++ b/drivers/dma/mmp_pdma.c @@ -28,6 +28,9 @@ #define DDADR(n) (0x0200 + ((n) << 4)) #define DSADR(n) (0x0204 + ((n) << 4)) #define DTADR(n) (0x0208 + ((n) << 4)) +#define DDADRH(n) (0x0300 + ((n) << 4)) +#define DSADRH(n) (0x0304 + ((n) << 4)) +#define DTADRH(n) (0x0308 + ((n) << 4)) #define DCMD 0x020c =20 #define DCSR_RUN BIT(31) /* Run Bit (read / write) */ @@ -44,6 +47,7 @@ #define DCSR_EORSTOPEN BIT(26) /* STOP on an EOR */ #define DCSR_SETCMPST BIT(25) /* Set Descriptor Compare Status */ #define DCSR_CLRCMPST BIT(24) /* Clear Descriptor Compare Status */ +#define DCSR_LPAEEN BIT(21) /* Long Physical Address Extension Enable */ #define DCSR_CMPST BIT(10) /* The Descriptor Compare Status */ #define DCSR_EORINTR BIT(9) /* The end of Receive */ =20 @@ -76,6 +80,16 @@ struct mmp_pdma_desc_hw { u32 dsadr; /* DSADR value for the current transfer */ u32 dtadr; /* DTADR value for the current transfer */ u32 dcmd; /* DCMD value for the current transfer */ + /* + * The following 32-bit words are only used in the 64-bit, ie. + * LPAE (Long Physical Address Extension) mode. + * They are used to specify the high 32 bits of the descriptor's + * addresses. + */ + u32 ddadrh; /* High 32-bit of DDADR */ + u32 dsadrh; /* High 32-bit of DSADR */ + u32 dtadrh; /* High 32-bit of DTADR */ + u32 rsvd; /* reserved */ } __aligned(32); =20 struct mmp_pdma_desc_sw { @@ -222,6 +236,57 @@ static u64 get_desc_dst_addr_32(const struct mmp_pdma_= desc_hw *desc) return desc->dtadr; } =20 +/* For 64-bit PDMA */ +static void write_next_addr_64(struct mmp_pdma_phy *phy, dma_addr_t addr) +{ + writel(lower_32_bits(addr), phy->base + DDADR(phy->idx)); + writel(upper_32_bits(addr), phy->base + DDADRH(phy->idx)); +} + +static u64 read_src_addr_64(struct mmp_pdma_phy *phy) +{ + u32 low =3D readl(phy->base + DSADR(phy->idx)); + u32 high =3D readl(phy->base + DSADRH(phy->idx)); + + return ((u64)high << 32) | low; +} + +static u64 read_dst_addr_64(struct mmp_pdma_phy *phy) +{ + u32 low =3D readl(phy->base + DTADR(phy->idx)); + u32 high =3D readl(phy->base + DTADRH(phy->idx)); + + return ((u64)high << 32) | low; +} + +static void set_desc_next_addr_64(struct mmp_pdma_desc_hw *desc, dma_addr_= t addr) +{ + desc->ddadr =3D lower_32_bits(addr); + desc->ddadrh =3D upper_32_bits(addr); +} + +static void set_desc_src_addr_64(struct mmp_pdma_desc_hw *desc, dma_addr_t= addr) +{ + desc->dsadr =3D lower_32_bits(addr); + desc->dsadrh =3D upper_32_bits(addr); +} + +static void set_desc_dst_addr_64(struct mmp_pdma_desc_hw *desc, dma_addr_t= addr) +{ + desc->dtadr =3D lower_32_bits(addr); + desc->dtadrh =3D upper_32_bits(addr); +} + +static u64 get_desc_src_addr_64(const struct mmp_pdma_desc_hw *desc) +{ + return ((u64)desc->dsadrh << 32) | desc->dsadr; +} + +static u64 get_desc_dst_addr_64(const struct mmp_pdma_desc_hw *desc) +{ + return ((u64)desc->dtadrh << 32) | desc->dtadr; +} + static int mmp_pdma_config_write(struct dma_chan *dchan, struct dma_slave_config *cfg, enum dma_transfer_direction direction); @@ -1110,10 +1175,26 @@ static const struct mmp_pdma_ops marvell_pdma_v1_op= s =3D { .dma_mask =3D 0, /* let OF/platform set DMA mask */ }; =20 +static const struct mmp_pdma_ops spacemit_k1_pdma_ops =3D { + .write_next_addr =3D write_next_addr_64, + .read_src_addr =3D read_src_addr_64, + .read_dst_addr =3D read_dst_addr_64, + .set_desc_next_addr =3D set_desc_next_addr_64, + .set_desc_src_addr =3D set_desc_src_addr_64, + .set_desc_dst_addr =3D set_desc_dst_addr_64, + .get_desc_src_addr =3D get_desc_src_addr_64, + .get_desc_dst_addr =3D get_desc_dst_addr_64, + .run_bits =3D (DCSR_RUN | DCSR_LPAEEN), + .dma_mask =3D DMA_BIT_MASK(64), /* force 64-bit DMA addr capability */ +}; + static const struct of_device_id mmp_pdma_dt_ids[] =3D { { .compatible =3D "marvell,pdma-1.0", .data =3D &marvell_pdma_v1_ops + }, { + .compatible =3D "spacemit,k1-pdma", + .data =3D &spacemit_k1_pdma_ops }, { /* sentinel */ } --=20 2.43.0 From nobody Tue Oct 7 05:26:55 2025 Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0C841245029 for ; Mon, 14 Jul 2025 09:40:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752486049; cv=none; b=GOEz658zKU2Mg6KkNqoh7yt48lYTRFuZvpcrz3PrOrWvmEjsxwoacyPYtDPKG2CcUdP4/+MRUipoD6xU8yn2NVyHnPADBVnHFfZDqOUBVrwBtNukmpVRGEvngXx+r+nxE8ihKrmkRb/eTy81xp7Ub+6xwFcy95c3G03+d3PZLSs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752486049; c=relaxed/simple; bh=/btqLu9YUwLhGvieYWNsjaYgCGjJUVWfq3uFh2mxvQM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=sALQ8kN6QwvQbCwELdPlEj2r0sjrg2k+CI/fpua17uzjWUdOTE6CJz9TjdQMShX2UymDWa+tX9lApVGmnqPIBYd3r+1PAyU/m9WkQ2rbsMCEg28IjDSLctC3Ro8UTTR9mGwzVAGoO/OmANZr5XrMV5870BdiTQ7pz8BvvRcEYco= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=riscstar.com; spf=pass smtp.mailfrom=riscstar.com; dkim=pass (2048-bit key) header.d=riscstar-com.20230601.gappssmtp.com header.i=@riscstar-com.20230601.gappssmtp.com header.b=odzxTaAr; arc=none smtp.client-ip=209.85.128.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=riscstar.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=riscstar.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=riscstar-com.20230601.gappssmtp.com header.i=@riscstar-com.20230601.gappssmtp.com header.b="odzxTaAr" Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-456108bf94bso7674055e9.0 for ; Mon, 14 Jul 2025 02:40:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=riscstar-com.20230601.gappssmtp.com; s=20230601; t=1752486046; x=1753090846; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=gFrJpXFfbxx2B9ksANEMQWjDtT+enBv/IzvtrGekg3w=; b=odzxTaArcr8JE39wQswE3qmcnJXsr23kpPBHJ75Sn2ymlhZ2MnbANwwYUV7pF4aUmw lIDplRZAv1hxXHTHtEqKQIX5foMYtEWzyY++iDOlVxWgUUQHHJzdc6zrPVZFg0zBuM4L +5kiXhKAu+pP6CZBcwyN8CLIzuiqf4xJf9L7zSa0pwqg99C8Edo1OlDVdC7H+9EkPTR4 lshSbKgd60Nbk7WDg/Wh6p8syVxAQSP0PaUHVAOlBZPzEeAlEP7uhMN+GGrOqRMnQfs7 D1xFoMLHffxZLZh8tclHnk9cHFLlz4EOA7wi1erEHEZuQb9bA7AOg5yKj2jkrdCEqoPy TtcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752486046; x=1753090846; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gFrJpXFfbxx2B9ksANEMQWjDtT+enBv/IzvtrGekg3w=; b=HJn1r/FqAdU6YacL2BHeqazFRiODwJYS9oJ+E9Ef+fWXpfU32U8IdS7kU4y63JB9hR adRGTYzHymWSEYKdXZnYZ7ujOT14+t+uHHkZ9YXdOYzJfIhiaXymq0pU05/g6/wCT1ze 3pUHNM0IC1WhSOC/6OIwFpQCGWYVh7O3dbHfp4NdKtX3L/fZKutMr4uSmU2rqmjcJ6vc uF0M9vWkcYQwegBg/KY0tFBa7xQQPs0E8S8VpwOZAeybKhuQ+An0YoYAhvDz/NReLSj2 3rR8CeV5dpF9Xyjk+vCSZVB5FTolJF4GUlqsfsIeExprTagPi0SXtCeFKpUUBaFKWHPp ciHg== X-Forwarded-Encrypted: i=1; AJvYcCU6nTWaDghH8bwLMbQjK1X/1ReCx7XgU8qVit4brrI1hTO07VgYaHzxpveRGgNwMLyoL2BoK4sNDvj/Fos=@vger.kernel.org X-Gm-Message-State: AOJu0Yxs0S2AUSDQNOTXkaeLGhW+4LmHKfGUKDvAEd0VUWHk8ytcoOtX xH1IAzZS2RzdGNsq4XVMpPspfxJ77UVcchE3OsqqwyaT/qVysBGtinvCLPgXymiK+cw= X-Gm-Gg: ASbGnct9ui0cbwjtxr1dYBSO1u5b40h3Y9NcrMnPT9By2wMYv/HdvfvZN7yYtDcaJkF 5x6F3TlTtw0Q1q2ADfudJ+FRAM+JW19Y9oMZMsu0Gxh9NpbYZux/zXTquAOC6LBsa0MT5DJeOgn cU4U0scKhFxeOXPhT3MoAfUzvFECrUTVxNfA+DkL9CbfUrSZpb1AUMM05cqY9sFl5EQIFyiPmIB j40ycg5qgB5I5lmni8K9oD+PKaaxuLGT5dkK+dWoNO0NiN9UC8KQx34OeoVS+FL8STSoRbCFQfx yZuaHQT9+FwAJ+tzS4r/txUxUM/XsbB+DssKE4eIGRaK7rOvXf+brnmj+5eB7G2/qIVnAPo82w= = X-Google-Smtp-Source: AGHT+IF/LhOg6RIkatqA9vyQ71gHfsxJ1ctVouZmIzEYwK0/MuM77sFw7XTim5p/um56mFwUUDCigw== X-Received: by 2002:a05:600c:198d:b0:453:b1c:442a with SMTP id 5b1f17b1804b1-454f4253f14mr101420315e9.27.1752486046346; Mon, 14 Jul 2025 02:40:46 -0700 (PDT) Received: from [127.0.1.1] ([2a09:0:1:2::3035]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4561b25a948sm24989035e9.35.2025.07.14.02.40.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Jul 2025 02:40:46 -0700 (PDT) From: Guodong Xu Date: Mon, 14 Jul 2025 17:39:33 +0800 Subject: [PATCH v3 6/8] riscv: dts: spacemit: Add PDMA0 node for K1 SoC Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250714-working_dma_0701_v2-v3-6-8b0f5cd71595@riscstar.com> References: <20250714-working_dma_0701_v2-v3-0-8b0f5cd71595@riscstar.com> In-Reply-To: <20250714-working_dma_0701_v2-v3-0-8b0f5cd71595@riscstar.com> To: Vinod Koul , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Yixun Lan , =?utf-8?q?Duje_Mihanovi=C4=87?= , Philipp Zabel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti Cc: Alex Elder , Vivian Wang , dmaengine@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, spacemit@lists.linux.dev, Guodong Xu X-Mailer: b4 0.14.2 Add PDMA0 dma-controller node under dma_bus for SpacemiT K1 SoC. The PDMA0 node is marked as disabled by default, allowing board-specific device trees to enable it as needed. Signed-off-by: Guodong Xu Tested-by: Troy Mitchell --- v3: - adjust pdma0 position, ordering by device address - update properties according to the newly created schema binding v2: - Updated the compatible string. - Rebased. Part of the changes in v1 is now in this patchset: - "riscv: dts: spacemit: Add DMA translation buses for K1" - Link: https://lore.kernel.org/all/20250623-k1-dma-buses-rfc-wip-v1-0-c= 0144082061f@iscas.ac.cn/ --- arch/riscv/boot/dts/spacemit/k1.dtsi | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/arch/riscv/boot/dts/spacemit/k1.dtsi b/arch/riscv/boot/dts/spa= cemit/k1.dtsi index abde8bb07c95c5a745736a2dd6f0c0e0d7c696e4..46dc002af947893cc2c234ee61e= 63c371cd966ca 100644 --- a/arch/riscv/boot/dts/spacemit/k1.dtsi +++ b/arch/riscv/boot/dts/spacemit/k1.dtsi @@ -660,6 +660,17 @@ dma-bus { dma-ranges =3D <0x0 0x00000000 0x0 0x00000000 0x0 0x80000000>, <0x1 0x00000000 0x1 0x80000000 0x3 0x00000000>; =20 + pdma0: dma-controller@d4000000 { + compatible =3D "spacemit,k1-pdma"; + reg =3D <0x0 0xd4000000 0x0 0x4000>; + interrupts =3D <72>; + clocks =3D <&syscon_apmu CLK_DMA>; + resets =3D <&syscon_apmu RESET_DMA>; + dma-channels =3D <16>; + #dma-cells=3D <1>; + status =3D "disabled"; + }; + uart0: serial@d4017000 { compatible =3D "spacemit,k1-uart", "intel,xscale-uart"; --=20 2.43.0 From nobody Tue Oct 7 05:26:55 2025 Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 54EC1245029 for ; Mon, 14 Jul 2025 09:40:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752486055; cv=none; b=NPLjPi25T9PS156YNlvAp5qvBlUFheCbMTkAc8AWaGAY9zk9Z7U0LeAWc0Y8ikS2btScBHbhUxbHTDECWBH8JhLzPuthLQ1M+tn+huzsXn5Vd61vVA6jfcZQfeh4PA1zon+X4EmRz+ESmFUZhhY7SQsIamaU4cnj6dQppi4B23A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752486055; c=relaxed/simple; bh=hAq0x+oX9cbcJkUs7e6ehMKp0TSf4ywLJDhNt9d1ea4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=jbiI+i5pocW5HVuyGP+9wH9YOkZL4GoLKKgwohT/sZU0j0bW25FH8qJLxd40m0ZtjwB05msGc+en3efnv0b/0LG0ntt4maeQ4pAthkn7M/8xa5jQdWWllDOKv6Lck7t6xad8pZK76jTLA/5FaAT8F26ZChPUvinOwtu7n75k5YY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=riscstar.com; spf=pass smtp.mailfrom=riscstar.com; dkim=pass (2048-bit key) header.d=riscstar-com.20230601.gappssmtp.com header.i=@riscstar-com.20230601.gappssmtp.com header.b=nNmdLz41; arc=none smtp.client-ip=209.85.128.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=riscstar.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=riscstar.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=riscstar-com.20230601.gappssmtp.com header.i=@riscstar-com.20230601.gappssmtp.com header.b="nNmdLz41" Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-455b00339c8so18047055e9.3 for ; Mon, 14 Jul 2025 02:40:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=riscstar-com.20230601.gappssmtp.com; s=20230601; t=1752486052; x=1753090852; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=Ldfd3zKYA1234Y8Fp1Vc0yI6IvJCQoMDmBQmNhJG3pA=; b=nNmdLz41H8PnCrgZhp5DlEMlVvXH+4TAOfkkMuR+5co7OTUnLGN9Chl9iVwVbQ7B0V EaHof10Ix5INsTxkEKlCsQbhky1i7qlZBvkUWZj6bJF+siyodOJperHDJEGg5z66vtBe ZTE3QWgkj0EyAoH0WLkSqJrqrt6mmz1G5qgpjRgOynJXgIaERh/iW4JOsJKr4ApWIgGx s/6BPQ2XUg/uBwVgGVSYcm30c+nNqbO/hannt60xVyCzWn2BLbS7qTRhOZyvOwOverK2 9KwEfQLy6QCHOr8751EIMGgtWGKDMSHuF628C9xJ/B2dAew9LzBxVI8y9yPjBH2Ozscl FRxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752486052; x=1753090852; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Ldfd3zKYA1234Y8Fp1Vc0yI6IvJCQoMDmBQmNhJG3pA=; b=n8pLj63/oa2bxm/+zMoOGifGF2onoMUyDW9wXEi0CRicVdzqaYskJG5EvYBeLpVHPw TU/6AVlN1C4xqXahixNX4ZT/oNkeEPENePdoFTrLZOvVbCPXqH0+Mrt0wmWFsZCh8Uzr 2QImt/KBTihwpW8629p+GMyVaIdHsD1AIvWhIfyjztBpOEKBbq52udTS4rd1Oibu7Z+Q ive/NyCTijww1mxuI/0QkDi1yeOQLOlGjs/ttleveutACQqe1xRafWkZ+kakDJyyz5xl 4UISBylQnT4NB0l0Rt0RuFNQ/OygYrglzuJmH47KCQS/hroTEsVvo+7+nWML2acX7JzK Jv5Q== X-Forwarded-Encrypted: i=1; AJvYcCVSCDs0wCi3/jfb8HDfbMLArURYEztQRyaRyVGz02+h2HwNBPmzXW3qjoQbQNNm3Jd0iUoy5dW/z1rlvl0=@vger.kernel.org X-Gm-Message-State: AOJu0YztSBOmpHrV7PJwnkGXHQarO2dsL22tL4SBkhByJj1QqLScYP4H WgyJoDpcK56SJ7DWTgHXiCTwczzBHJzAdaL69jmCZeFaW6Ltxr+KfUWuZM8rPvvvLqg= X-Gm-Gg: ASbGncsteruJzhb406X3wD0Yvt9+mNG4+E+XVTSZZbGfUe4GFzK1Inpk0B/lZyeHOTr 4r6pzL0YoER6X1ZnWWb7MSKFhYmyTtQvpEhQHs4QiHipxiCkh7oEB2V7lLhINPVBoc0WhJ0L9z2 546kFwcMiyw2sFXCytOiK4BuWa3BvnuuFZlFdQq407bDuuVF2ayAWyCnBqFzMS4E9j9nr7cF24n Ry7rwa5tBtt+mJhkijSpoLBeJppLmGFUCGB7YcYcExYmBzrqahm7tmZdtlHcSjKoaLNsxSemUei drybJNVhHWMfrucm+zf4jYI4wcedEsC1DwlYV5bVg4mLDt20LfIivGyYuF09BuLfXlqbDATDgw= = X-Google-Smtp-Source: AGHT+IHBUTHXXfV/sAbab2DTdMAgIRdSFUuzZnhKWqGYxvLkdc88i2Qw/Sud4EEPv8EFPz7tb3aRDQ== X-Received: by 2002:a05:6000:270b:b0:3a5:3b93:be4b with SMTP id ffacd0b85a97d-3b5f189621cmr8029790f8f.25.1752486051776; Mon, 14 Jul 2025 02:40:51 -0700 (PDT) Received: from [127.0.1.1] ([2a09:0:1:2::3035]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4561b25a948sm24989035e9.35.2025.07.14.02.40.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Jul 2025 02:40:51 -0700 (PDT) From: Guodong Xu Date: Mon, 14 Jul 2025 17:39:34 +0800 Subject: [PATCH v3 7/8] riscv: dts: spacemit: Enable PDMA0 on Banana Pi F3 and Milkv Jupiter Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250714-working_dma_0701_v2-v3-7-8b0f5cd71595@riscstar.com> References: <20250714-working_dma_0701_v2-v3-0-8b0f5cd71595@riscstar.com> In-Reply-To: <20250714-working_dma_0701_v2-v3-0-8b0f5cd71595@riscstar.com> To: Vinod Koul , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Yixun Lan , =?utf-8?q?Duje_Mihanovi=C4=87?= , Philipp Zabel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti Cc: Alex Elder , Vivian Wang , dmaengine@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, spacemit@lists.linux.dev, Guodong Xu X-Mailer: b4 0.14.2 Enable the PDMA0 on the SpacemiT K1-based Banana Pi F3 and Milkv Jupiter boards by setting its status to "okay". Signed-off-by: Guodong Xu Tested-by: Troy Mitchell --- v3: adjust pdma0 position, ordering by name alphabetic v2: added pdma0 enablement on Milkv Jupiter --- arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts | 4 ++++ arch/riscv/boot/dts/spacemit/k1-milkv-jupiter.dts | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts b/arch/riscv/b= oot/dts/spacemit/k1-bananapi-f3.dts index fe22c747c5012fe56d42ac8a7efdbbdb694f31b6..310dbd42d99f2ac150356c2128a= 6e16d1723d19f 100644 --- a/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts +++ b/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts @@ -40,6 +40,10 @@ &emmc { status =3D "okay"; }; =20 +&pdma0 { + status =3D "okay"; +}; + &uart0 { pinctrl-names =3D "default"; pinctrl-0 =3D <&uart0_2_cfg>; diff --git a/arch/riscv/boot/dts/spacemit/k1-milkv-jupiter.dts b/arch/riscv= /boot/dts/spacemit/k1-milkv-jupiter.dts index 4483192141049caa201c093fb206b6134a064f42..15b814aabe10c0a21ece9f0d422= 64c775b505bb5 100644 --- a/arch/riscv/boot/dts/spacemit/k1-milkv-jupiter.dts +++ b/arch/riscv/boot/dts/spacemit/k1-milkv-jupiter.dts @@ -20,6 +20,10 @@ chosen { }; }; =20 +&pdma0 { + status =3D "okay"; +}; + &uart0 { pinctrl-names =3D "default"; pinctrl-0 =3D <&uart0_2_cfg>; --=20 2.43.0 From nobody Tue Oct 7 05:26:55 2025 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C8C0E246BAF for ; Mon, 14 Jul 2025 09:40:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752486061; cv=none; b=tqUH/ru0dtA1xTT5M5jK91LZ0Y2/LAufISKDfpV3Jj9a3rnW3jMvsremvcZaLWkXnwgAiR8DjLs6qJWUUKcHPsdp8ykunR9tsXYMDYV6i7+y5tKQq++n92kgKSj7hFqXV5aP98tcv5jBuoVpfIZTLTI6/Gi2NGbuJsk9Nze94nU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752486061; c=relaxed/simple; bh=Kdry2gVbb8miTXmXd16rrT7u8YzjkAcFEZdjgAgPfA0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=WwFZ2/HSO3wlXsPrKQUeUHF/HUjSxdHgKdZ4z/Ok6bUiBqlIyhZLoIZt3HZUw7brwbO3ip/xHZBt+ean2g5K7qZuueH0gjT+rtyaRHC/+CzrqqioIFYnPwAOfRygGZlsZQ45HNFQgtOogBa8OnN/Lkff0n9g9OED5R8eUf0+FT4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=riscstar.com; spf=pass smtp.mailfrom=riscstar.com; dkim=pass (2048-bit key) header.d=riscstar-com.20230601.gappssmtp.com header.i=@riscstar-com.20230601.gappssmtp.com header.b=16kThx4o; arc=none smtp.client-ip=209.85.128.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=riscstar.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=riscstar.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=riscstar-com.20230601.gappssmtp.com header.i=@riscstar-com.20230601.gappssmtp.com header.b="16kThx4o" Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-4561ca74829so5446815e9.0 for ; Mon, 14 Jul 2025 02:40:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=riscstar-com.20230601.gappssmtp.com; s=20230601; t=1752486058; x=1753090858; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=mBgGdTksVfeSjCf4/icT/1ch7Jc0HArkGcJLo9ytMP4=; b=16kThx4oc14mDeeieiSvzRjQ89+o8CCI83t9QLL/FD3l4z/vCssXGL1k6xLRfdwE6S d8E5/oHcTpMgCXrkzBvHFznmP5g3jFveVA7nkgeMtzsTMh2hMcqKaeiZZUnj+XQ2Gxix C6hZiQ2Om6qReeW0Bwv9uoLTSAEFzV0I4bMEB++hD6MOK4LlhAlyCjrzsyQB2yEt12CN yoUtyNOp9VbQYqW9NBxTEtDdL25cBCSJskA4LyzIlDQkPQ/Fc15lG+jju+c4jMFQK85r oVQQXSeMmX0h896ATKReGbRfshP/+xpkGN3MNVaNCLqrAGw2qO0cxvq28hmP8ws560JV uKhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752486058; x=1753090858; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mBgGdTksVfeSjCf4/icT/1ch7Jc0HArkGcJLo9ytMP4=; b=cnxh8J11hXofSyCeE2JtfpF0biZhNBf1NtGWHdtyVsQE9a7aX3Su4IWk2Xb4aHt6gh eIs+l4OerCsEIt5WtPZJGqArEh0Fu+GUMMq7jtis9e1YYeT1mp6g2OTCw3P4ZKmCntJj qtOuh9Su8X0qnr09QmCAlBom37cSyWJxJW+pS69cURvlVXoEoUQyTyH9EvEBBqzgHFQx bxYMt1TSdCO5oMA3P7oy91qo69sa0ZnssaAz1qhS2Son6KgJBTywMuxmT5h/OTc6JDM1 QMC2wivyIiDuBiHNeuVynQgU07aihNRad0EwQmtAHqzPOBLR+6k4pmO28oq+B0FUXbSk jnog== X-Forwarded-Encrypted: i=1; AJvYcCWiUpa3A2VijPjXzaN51QOug57ihk5tANRBiO2eN6x6uUINn3faTL/ndfc5FLWufbt6nC2nNcKE98Sv0+0=@vger.kernel.org X-Gm-Message-State: AOJu0YydG90bwkqYk3P+DXke0tvQsP6Pmd3+xq20D3CtptEILwzPVy5N +goYH8KIutSrtIyULQ4LtlF01ZBTHlS/Th+shfDZYBYgY1UMhLKztKvSfzWQi2Dep6Q= X-Gm-Gg: ASbGnctxOKwnH/zH+yEieO8vrjBM44k8oEkXVQ2Rv9Z5gvbUonTUqLdz1QKMUpT/GXd MVTdNRmavrmm9mG0tPSeqjLEFAOOLVccrhu20dSErqIeodRkhhjmY4oVxM64eWlCqPOWYMLDkXG Wa5E847UhpJl5r+6xIMTg2cMKxcQSJZDrP9xSVDajjXLvG74sIw1CtkYqTPRS5ucOCd06CG4SrN pHmIEHgM9CSS+xoZ/6bY4WZglsTn9QvYixoqRg8tmDMrhmau7Tow0J6VrpEodHNzrF1J/4zC07B SLHIIDcJNDF8cVmqsUm29bWrXK7yjKnImTp5L1zKuOgpsdk9xtLj546Hqgdmn9ZZ/ZXfONWN1A= = X-Google-Smtp-Source: AGHT+IFZBd9BqIW4mTa6M2LIKLJ6VdBKVXcqNR4ZLAhmo9BpW6Qpf38x6Z4W0deTyL9Fnv8RWBe2kw== X-Received: by 2002:a05:600c:5024:b0:456:1611:cea5 with SMTP id 5b1f17b1804b1-4561611d3d6mr36347635e9.18.1752486058120; Mon, 14 Jul 2025 02:40:58 -0700 (PDT) Received: from [127.0.1.1] ([2a09:0:1:2::3035]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4561b25a948sm24989035e9.35.2025.07.14.02.40.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Jul 2025 02:40:57 -0700 (PDT) From: Guodong Xu Date: Mon, 14 Jul 2025 17:39:35 +0800 Subject: [PATCH v3 8/8] riscv: defconfig: Enable MMP_PDMA support for SpacemiT K1 SoC Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250714-working_dma_0701_v2-v3-8-8b0f5cd71595@riscstar.com> References: <20250714-working_dma_0701_v2-v3-0-8b0f5cd71595@riscstar.com> In-Reply-To: <20250714-working_dma_0701_v2-v3-0-8b0f5cd71595@riscstar.com> To: Vinod Koul , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Yixun Lan , =?utf-8?q?Duje_Mihanovi=C4=87?= , Philipp Zabel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti Cc: Alex Elder , Vivian Wang , dmaengine@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, spacemit@lists.linux.dev, Guodong Xu X-Mailer: b4 0.14.2 Enable CONFIG_MMP_PDMA in the riscv defconfig for SpacemiT K1 SoC boards. Signed-off-by: Guodong Xu Tested-by: Troy Mitchell --- v3: No change. v2: Rebased. Part of the modification in v1 is now in this patch: - "riscv: defconfig: run savedefconfig to reorder it" , which has been merged into riscv/linux.git (for-next) - Link: https://git.kernel.org/riscv/c/d958097bdf88 --- arch/riscv/configs/defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/riscv/configs/defconfig b/arch/riscv/configs/defconfig index 37c98c0f98ffc0ee9d021e4d07aa37a27d342f7a..b6519fcc91c0bb56f71df336fd3= 793af3d64fe78 100644 --- a/arch/riscv/configs/defconfig +++ b/arch/riscv/configs/defconfig @@ -240,6 +240,7 @@ CONFIG_RTC_DRV_SUN6I=3Dy CONFIG_DMADEVICES=3Dy CONFIG_DMA_SUN6I=3Dm CONFIG_DW_AXI_DMAC=3Dy +CONFIG_MMP_PDMA=3Dm CONFIG_VIRTIO_PCI=3Dy CONFIG_VIRTIO_BALLOON=3Dy CONFIG_VIRTIO_INPUT=3Dy --=20 2.43.0