From nobody Fri Dec 19 15:07:01 2025 Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4F3473446D4; Fri, 5 Dec 2025 15:13:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.160.252.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764947643; cv=none; b=k3wo49X6sZab8P1h2rLPw4bB1BREPrhyTHvwkBZMQ6V9sJkquiweelM3WYjvPFp7p1z/oiFHaPYy1kemFVjuAeHdiZ1dBFI90RY+nsPUaFtx5sjzti4yIa0t8ZwCXW19laqK5Fsc5TwLMXNiEJA4ccArS2VLGeqYwb697bfz3Lk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764947643; c=relaxed/simple; bh=x1YVE2yjw3ZRn2O5N3QTAjBV9AFut/Cx/KiKXDYBhbQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=SoALZG/I1/Ao4TgrrTDfBSFpmsQTtWQO7iayafCI4AJsKQQ1jwwgz8bMJohk6StnByGI+og/eE569d9SMHI/tM75/xm0B9dAGJz0AumYUKGx6RNWC2qTXLl/zuU9AenIOzbLf3lMqOLgMuogpVnlfGwyAtArN4Nu8xSuxCIyFG0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com; spf=pass smtp.mailfrom=renesas.com; arc=none smtp.client-ip=210.160.252.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=renesas.com X-CSE-ConnectionGUID: BuvU9K+aRR+6yV7VTkwjYg== X-CSE-MsgGUID: XHx0sXa0TiyQN5aRIYJueg== Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie6.idc.renesas.com with ESMTP; 06 Dec 2025 00:13:53 +0900 Received: from demon-pc.localdomain (unknown [10.226.93.202]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 45CB24005E29; Sat, 6 Dec 2025 00:13:49 +0900 (JST) From: Cosmin Tanislav To: Vinod Koul , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Geert Uytterhoeven , Magnus Damm , Cosmin Tanislav , Fabrizio Castro , Lad Prabhakar , Johan Hovold , Biju Das Cc: dmaengine@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org Subject: [PATCH v3 1/6] dmaengine: sh: rz_dmac: make error interrupt optional Date: Fri, 5 Dec 2025 17:12:49 +0200 Message-ID: <20251205151254.2970669-2-cosmin-gabriel.tanislav.xa@renesas.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251205151254.2970669-1-cosmin-gabriel.tanislav.xa@renesas.com> References: <20251205151254.2970669-1-cosmin-gabriel.tanislav.xa@renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The Renesas RZ/T2H (R9A09G077) and RZ/N2H (R9A09G087) SoCs do not have an error interrupt for the DMACs, and the current driver implementation does not make much use of it. To prepare for adding support for these SoCs, do not error out if the error interrupt is missing. Signed-off-by: Cosmin Tanislav --- V3: * no changes V2: * remove notes drivers/dma/sh/rz-dmac.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/drivers/dma/sh/rz-dmac.c b/drivers/dma/sh/rz-dmac.c index 38137e8d80b9..20a5c1766a58 100644 --- a/drivers/dma/sh/rz-dmac.c +++ b/drivers/dma/sh/rz-dmac.c @@ -954,16 +954,15 @@ static int rz_dmac_probe(struct platform_device *pdev) } =20 /* Register interrupt handler for error */ - irq =3D platform_get_irq_byname(pdev, irqname); - if (irq < 0) - return irq; - - ret =3D devm_request_irq(&pdev->dev, irq, rz_dmac_irq_handler, 0, - irqname, NULL); - if (ret) { - dev_err(&pdev->dev, "failed to request IRQ %u (%d)\n", - irq, ret); - return ret; + irq =3D platform_get_irq_byname_optional(pdev, irqname); + if (irq > 0) { + ret =3D devm_request_irq(&pdev->dev, irq, rz_dmac_irq_handler, 0, + irqname, NULL); + if (ret) { + dev_err(&pdev->dev, "failed to request IRQ %u (%d)\n", + irq, ret); + return ret; + } } =20 /* Initialize the channels. */ --=20 2.52.0 From nobody Fri Dec 19 15:07:01 2025 Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6BF9B33DEC4; Fri, 5 Dec 2025 15:14:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.160.252.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764947654; cv=none; b=N926WPB1RQZg/yGRhlQjTh5TMQLxFjf0Q1Kkv+jVl3K7UzYep+eJsost6ZgY7JbovPT2qvcRWo7EFQJ/IHXEBKsk77lfuekUWddD4bzeNp0LXrT7HMvD41do73Ja3reLXpLI284KT6F/cuLd6ty+VNpqQdmTTl+kgefcrkQXEqI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764947654; c=relaxed/simple; bh=Cz20XkiM+P8nczxVeOAeZHCzIkyeCTB3xpUqIz6Tg/Q=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=JCTsOyGt3LwGE4UVAKx5QfA8PIu9tPiJB7h5gjyZ16ApUfcFyCsUgPpwnQGAHRPHM5pBzMp3MvIRH7Ej2zZob1GHg/fyuPOQK1nbA+lulzubAuJeIsiX/cSrf7lSSxXjfZY7MR79nlWoZujUc8wkYxNUL6jo250RXCBaildyN7Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com; spf=pass smtp.mailfrom=renesas.com; arc=none smtp.client-ip=210.160.252.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=renesas.com X-CSE-ConnectionGUID: byJsjLt4SP6ypJgqnYA/mw== X-CSE-MsgGUID: QxDbWAbwSimkeun2Jkv2ZQ== Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie6.idc.renesas.com with ESMTP; 06 Dec 2025 00:13:59 +0900 Received: from demon-pc.localdomain (unknown [10.226.93.202]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id BF5224005E29; Sat, 6 Dec 2025 00:13:54 +0900 (JST) From: Cosmin Tanislav To: Vinod Koul , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Geert Uytterhoeven , Magnus Damm , Cosmin Tanislav , Fabrizio Castro , Lad Prabhakar , Johan Hovold , Biju Das Cc: dmaengine@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org Subject: [PATCH v3 2/6] dmaengine: sh: rz_dmac: make register_dma_req() chip-specific Date: Fri, 5 Dec 2025 17:12:50 +0200 Message-ID: <20251205151254.2970669-3-cosmin-gabriel.tanislav.xa@renesas.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251205151254.2970669-1-cosmin-gabriel.tanislav.xa@renesas.com> References: <20251205151254.2970669-1-cosmin-gabriel.tanislav.xa@renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The Renesas RZ/T2H (R9A09G077) and RZ/N2H (R9A09G087) SoCs use a completely different ICU unit compared to RZ/V2H, which requires a separate implementation. To prepare for adding support for these SoCs, add a chip-specific structure and put a pointer to the rzv2h_icu_register_dma_req() function in the .register_dma_req field of the chip-specific structure to allow for other implementations. Do the same for the default request value, RZV2H_ICU_DMAC_REQ_NO_DEFAULT, and place it into .dma_req_no_default. While at it, factor out the logic that calls .register_dma_req() or rz_dmac_set_dmars_register() into a separate function to remove some code duplication. Signed-off-by: Cosmin Tanislav --- V3: * replace -1 with direct usage of dma_req_no_default and remove the check inside rz_dmac_set_dma_req_no() V2: * remove notes drivers/dma/sh/rz-dmac.c | 65 ++++++++++++++++++++++------------------ 1 file changed, 36 insertions(+), 29 deletions(-) diff --git a/drivers/dma/sh/rz-dmac.c b/drivers/dma/sh/rz-dmac.c index 20a5c1766a58..e4b369f13cbc 100644 --- a/drivers/dma/sh/rz-dmac.c +++ b/drivers/dma/sh/rz-dmac.c @@ -95,9 +95,16 @@ struct rz_dmac_icu { u8 dmac_index; }; =20 +struct rz_dmac_info { + void (*register_dma_req)(struct platform_device *icu_dev, u8 dmac_index, + u8 dmac_channel, u16 req_no); + u16 dma_req_no_default; +}; + struct rz_dmac { struct dma_device engine; struct rz_dmac_icu icu; + const struct rz_dmac_info *info; struct device *dev; struct reset_control *rstc; void __iomem *base; @@ -106,8 +113,6 @@ struct rz_dmac { unsigned int n_channels; struct rz_dmac_chan *channels; =20 - bool has_icu; - DECLARE_BITMAP(modules, 1024); }; =20 @@ -319,6 +324,16 @@ static void rz_dmac_set_dmars_register(struct rz_dmac = *dmac, int nr, u32 dmars) rz_dmac_ext_writel(dmac, dmars32, dmars_offset); } =20 +static void rz_dmac_set_dma_req_no(struct rz_dmac *dmac, unsigned int inde= x, + int req_no) +{ + if (dmac->info->register_dma_req) + dmac->info->register_dma_req(dmac->icu.pdev, dmac->icu.dmac_index, + index, req_no); + else + rz_dmac_set_dmars_register(dmac, index, req_no); +} + static void rz_dmac_prepare_desc_for_memcpy(struct rz_dmac_chan *channel) { struct dma_chan *chan =3D &channel->vc.chan; @@ -336,13 +351,7 @@ static void rz_dmac_prepare_desc_for_memcpy(struct rz_= dmac_chan *channel) lmdesc->chext =3D 0; lmdesc->header =3D HEADER_LV; =20 - if (dmac->has_icu) { - rzv2h_icu_register_dma_req(dmac->icu.pdev, dmac->icu.dmac_index, - channel->index, - RZV2H_ICU_DMAC_REQ_NO_DEFAULT); - } else { - rz_dmac_set_dmars_register(dmac, channel->index, 0); - } + rz_dmac_set_dma_req_no(dmac, channel->index, dmac->info->dma_req_no_defau= lt); =20 channel->chcfg =3D chcfg; channel->chctrl =3D CHCTRL_STG | CHCTRL_SETEN; @@ -393,12 +402,7 @@ static void rz_dmac_prepare_descs_for_slave_sg(struct = rz_dmac_chan *channel) =20 channel->lmdesc.tail =3D lmdesc; =20 - if (dmac->has_icu) { - rzv2h_icu_register_dma_req(dmac->icu.pdev, dmac->icu.dmac_index, - channel->index, channel->mid_rid); - } else { - rz_dmac_set_dmars_register(dmac, channel->index, channel->mid_rid); - } + rz_dmac_set_dma_req_no(dmac, channel->index, channel->mid_rid); =20 channel->chctrl =3D CHCTRL_SETEN; } @@ -671,13 +675,7 @@ static void rz_dmac_device_synchronize(struct dma_chan= *chan) if (ret < 0) dev_warn(dmac->dev, "DMA Timeout"); =20 - if (dmac->has_icu) { - rzv2h_icu_register_dma_req(dmac->icu.pdev, dmac->icu.dmac_index, - channel->index, - RZV2H_ICU_DMAC_REQ_NO_DEFAULT); - } else { - rz_dmac_set_dmars_register(dmac, channel->index, 0); - } + rz_dmac_set_dma_req_no(dmac, channel->index, dmac->info->dma_req_no_defau= lt); } =20 /* @@ -868,14 +866,13 @@ static int rz_dmac_parse_of_icu(struct device *dev, s= truct rz_dmac *dmac) uint32_t dmac_index; int ret; =20 - ret =3D of_parse_phandle_with_fixed_args(np, "renesas,icu", 1, 0, &args); - if (ret =3D=3D -ENOENT) + if (!dmac->info->register_dma_req) return 0; + + ret =3D of_parse_phandle_with_fixed_args(np, "renesas,icu", 1, 0, &args); if (ret) return ret; =20 - dmac->has_icu =3D true; - dmac->icu.pdev =3D of_find_device_by_node(args.np); of_node_put(args.np); if (!dmac->icu.pdev) { @@ -930,6 +927,7 @@ static int rz_dmac_probe(struct platform_device *pdev) if (!dmac) return -ENOMEM; =20 + dmac->info =3D device_get_match_data(&pdev->dev); dmac->dev =3D &pdev->dev; platform_set_drvdata(pdev, dmac); =20 @@ -947,7 +945,7 @@ static int rz_dmac_probe(struct platform_device *pdev) if (IS_ERR(dmac->base)) return PTR_ERR(dmac->base); =20 - if (!dmac->has_icu) { + if (!dmac->info->register_dma_req) { dmac->ext_base =3D devm_platform_ioremap_resource(pdev, 1); if (IS_ERR(dmac->ext_base)) return PTR_ERR(dmac->ext_base); @@ -1067,9 +1065,18 @@ static void rz_dmac_remove(struct platform_device *p= dev) pm_runtime_disable(&pdev->dev); } =20 +static const struct rz_dmac_info rz_dmac_v2h_info =3D { + .register_dma_req =3D rzv2h_icu_register_dma_req, + .dma_req_no_default =3D RZV2H_ICU_DMAC_REQ_NO_DEFAULT, +}; + +static const struct rz_dmac_info rz_dmac_common_info =3D { + .dma_req_no_default =3D 0, +}; + static const struct of_device_id of_rz_dmac_match[] =3D { - { .compatible =3D "renesas,r9a09g057-dmac", }, - { .compatible =3D "renesas,rz-dmac", }, + { .compatible =3D "renesas,r9a09g057-dmac", .data =3D &rz_dmac_v2h_info }, + { .compatible =3D "renesas,rz-dmac", .data =3D &rz_dmac_common_info }, { /* Sentinel */ } }; MODULE_DEVICE_TABLE(of, of_rz_dmac_match); --=20 2.52.0 From nobody Fri Dec 19 15:07:01 2025 Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D60A033FE08; Fri, 5 Dec 2025 15:14:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.160.252.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764947651; cv=none; b=SIGJxA/KTbto6kbRWDKOtY8mjc2dgz+pmpYKotMY0y1sHQFzTGAjL2X5EvzpifTRVxLMcUcI4MbLWJj8HohpEHh1mT0xuxwAOYJQODGkCfkhskVoTZw24SVhSXtJPa94gs3aCaGU/AVmDBTfYRizDTWNBOn+atMrJlwBKjynFrc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764947651; c=relaxed/simple; bh=ukb1UAwmqxDBbf6H+og+mlmMTI5A9pD1u9Se2kBCWOI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bqLYZe1ikyGgQw9OrAQnEeiCn8Kq1HXEDPvKuvvaapZDrMUf9uSoOUVfyBmNC/drgUS6WWkDafd89N9qJNdEPMyjMeDf2Pju3YDwdOITt1RLpLjIbUPLYWPsXhmDicqwFwv4iNMS8v5ZdTr0MYGn6c+4uRjvysTTgknnJKX/8mQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com; spf=pass smtp.mailfrom=renesas.com; arc=none smtp.client-ip=210.160.252.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=renesas.com X-CSE-ConnectionGUID: hUMuIR75SDKFo2Fnt02k6Q== X-CSE-MsgGUID: ptbN+7ocRsyHC8p0hJzpCQ== Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie6.idc.renesas.com with ESMTP; 06 Dec 2025 00:14:04 +0900 Received: from demon-pc.localdomain (unknown [10.226.93.202]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 5ADD44005E29; Sat, 6 Dec 2025 00:14:00 +0900 (JST) From: Cosmin Tanislav To: Vinod Koul , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Geert Uytterhoeven , Magnus Damm , Cosmin Tanislav , Fabrizio Castro , Lad Prabhakar , Johan Hovold , Biju Das Cc: dmaengine@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org Subject: [PATCH v3 3/6] dt-bindings: dma: renesas,rz-dmac: document RZ/{T2H,N2H} Date: Fri, 5 Dec 2025 17:12:51 +0200 Message-ID: <20251205151254.2970669-4-cosmin-gabriel.tanislav.xa@renesas.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251205151254.2970669-1-cosmin-gabriel.tanislav.xa@renesas.com> References: <20251205151254.2970669-1-cosmin-gabriel.tanislav.xa@renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The Renesas RZ/T2H (R9A09G077) and RZ/N2H (R9A09G087) SoCs have three DMAC instances. Compared to the previously supported RZ/V2H, these SoCs are missing the error interrupt line and the reset lines, and they use a different ICU IP. Document them, and use RZ/T2H as a fallback for RZ/N2H as the DMACs are entirely compatible. Signed-off-by: Cosmin Tanislav Reviewed-by: Rob Herring (Arm) --- V3: * pick up Rob's Reviewed-by tag V2: * remove notes .../bindings/dma/renesas,rz-dmac.yaml | 100 ++++++++++++++---- 1 file changed, 82 insertions(+), 18 deletions(-) diff --git a/Documentation/devicetree/bindings/dma/renesas,rz-dmac.yaml b/D= ocumentation/devicetree/bindings/dma/renesas,rz-dmac.yaml index f891cfcc48c7..f7bcdb4a29ca 100644 --- a/Documentation/devicetree/bindings/dma/renesas,rz-dmac.yaml +++ b/Documentation/devicetree/bindings/dma/renesas,rz-dmac.yaml @@ -28,6 +28,13 @@ properties: =20 - const: renesas,r9a09g057-dmac # RZ/V2H(P) =20 + - const: renesas,r9a09g077-dmac # RZ/T2H + + - items: + - enum: + - renesas,r9a09g087-dmac # RZ/N2H + - const: renesas,r9a09g077-dmac + reg: items: - description: Control and channel register block @@ -35,27 +42,12 @@ properties: minItems: 1 =20 interrupts: + minItems: 16 maxItems: 17 =20 interrupt-names: - items: - - const: error - - const: ch0 - - const: ch1 - - const: ch2 - - const: ch3 - - const: ch4 - - const: ch5 - - const: ch6 - - const: ch7 - - const: ch8 - - const: ch9 - - const: ch10 - - const: ch11 - - const: ch12 - - const: ch13 - - const: ch14 - - const: ch15 + minItems: 16 + maxItems: 17 =20 clocks: items: @@ -121,6 +113,35 @@ required: allOf: - $ref: dma-controller.yaml# =20 + - if: + properties: + compatible: + contains: + enum: + - renesas,rz-dmac + - renesas,r9a09g057-dmac + then: + properties: + interrupt-names: + items: + - const: error + - const: ch0 + - const: ch1 + - const: ch2 + - const: ch3 + - const: ch4 + - const: ch5 + - const: ch6 + - const: ch7 + - const: ch8 + - const: ch9 + - const: ch10 + - const: ch11 + - const: ch12 + - const: ch13 + - const: ch14 + - const: ch15 + - if: properties: compatible: @@ -188,6 +209,49 @@ allOf: - renesas,icu - resets =20 + - if: + properties: + compatible: + contains: + const: renesas,r9a09g077-dmac + then: + properties: + reg: + maxItems: 1 + clocks: + maxItems: 1 + + clock-names: false + resets: false + reset-names: false + + interrupts: + maxItems: 16 + + interrupt-names: + items: + - const: ch0 + - const: ch1 + - const: ch2 + - const: ch3 + - const: ch4 + - const: ch5 + - const: ch6 + - const: ch7 + - const: ch8 + - const: ch9 + - const: ch10 + - const: ch11 + - const: ch12 + - const: ch13 + - const: ch14 + - const: ch15 + + required: + - clocks + - power-domains + - renesas,icu + additionalProperties: false =20 examples: --=20 2.52.0 From nobody Fri Dec 19 15:07:01 2025 Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D594B19006B; Fri, 5 Dec 2025 15:14:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.160.252.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764947664; cv=none; b=GcH+pyLf0i32QDwSk1oGsA/VTDoGUGanoBxHbDM9NObWR1QLBAkZ3BhGu1UN8m/GdnhnxU6YRzhGFE8yVjGeUV/4HTbxZs2h7za67qOzjQ4COqI2wdDJgQsAcTHh806rEqGIob7Q/pStQQd3V0mkn1iaVVLNBIiGaF78HGO/cFg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764947664; c=relaxed/simple; bh=BI3xuJAU00rEkEy7Ppxjcva179LcP2IiwZo9Bd4ZgAo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Gtqbhhnl/980SSiThMx1U4p6giToEdkZbDQssYiKNTy8J20IyfdrhGGqrsRufgjqqs7a37T+zp4I3vUb1muU58vfCwEUy0I7Sf3WXF8MsIOh3A/ZGldAZqterM7nDbZI4q6Zw8b4HLS0x5P1joAiZgEb/vD1tpKAiIEIVjGbXAs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com; spf=pass smtp.mailfrom=renesas.com; arc=none smtp.client-ip=210.160.252.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=renesas.com X-CSE-ConnectionGUID: P/in2etHStCAJDD+SDw70A== X-CSE-MsgGUID: qwRG+e5USd+M3Geopyhcaw== Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie6.idc.renesas.com with ESMTP; 06 Dec 2025 00:14:10 +0900 Received: from demon-pc.localdomain (unknown [10.226.93.202]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id E11064005E29; Sat, 6 Dec 2025 00:14:05 +0900 (JST) From: Cosmin Tanislav To: Vinod Koul , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Geert Uytterhoeven , Magnus Damm , Cosmin Tanislav , Fabrizio Castro , Lad Prabhakar , Johan Hovold , Biju Das Cc: dmaengine@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org Subject: [PATCH v3 4/6] dmaengine: sh: rz_dmac: add RZ/{T2H,N2H} support Date: Fri, 5 Dec 2025 17:12:52 +0200 Message-ID: <20251205151254.2970669-5-cosmin-gabriel.tanislav.xa@renesas.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251205151254.2970669-1-cosmin-gabriel.tanislav.xa@renesas.com> References: <20251205151254.2970669-1-cosmin-gabriel.tanislav.xa@renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The Renesas RZ/T2H (R9A09G077) and RZ/N2H (R9A09G087) SoCs use a completely different ICU unit compared to RZ/V2H, which requires a separate implementation. Add support for them. RZ/N2H will use RZ/T2H as a fallback. Signed-off-by: Cosmin Tanislav --- V3: * no changes V2: * remove notes drivers/dma/sh/rz-dmac.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/dma/sh/rz-dmac.c b/drivers/dma/sh/rz-dmac.c index e4b369f13cbc..2f06ed4025da 100644 --- a/drivers/dma/sh/rz-dmac.c +++ b/drivers/dma/sh/rz-dmac.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -1070,12 +1071,18 @@ static const struct rz_dmac_info rz_dmac_v2h_info = =3D { .dma_req_no_default =3D RZV2H_ICU_DMAC_REQ_NO_DEFAULT, }; =20 +static const struct rz_dmac_info rz_dmac_t2h_info =3D { + .register_dma_req =3D rzt2h_icu_register_dma_req, + .dma_req_no_default =3D RZT2H_ICU_DMAC_REQ_NO_DEFAULT, +}; + static const struct rz_dmac_info rz_dmac_common_info =3D { .dma_req_no_default =3D 0, }; =20 static const struct of_device_id of_rz_dmac_match[] =3D { { .compatible =3D "renesas,r9a09g057-dmac", .data =3D &rz_dmac_v2h_info }, + { .compatible =3D "renesas,r9a09g077-dmac", .data =3D &rz_dmac_t2h_info }, { .compatible =3D "renesas,rz-dmac", .data =3D &rz_dmac_common_info }, { /* Sentinel */ } }; --=20 2.52.0 From nobody Fri Dec 19 15:07:01 2025 Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D20553128CD; Fri, 5 Dec 2025 15:14:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.160.252.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764947666; cv=none; b=OXM6WZwhf6YY8XSaRDT7F2S3YgSLZHWlT3T5+SYVhzXZnonDy58VXn44briAWoVTKEKUuhx1SEGhqIBpeQnzUwCmpaH36J7n3oEp5zxipLYRB5wsk1GvzAqLH7ddSPNYL/fh/ySGNZ1K3riZn3pmaPP/kvrK5mO4wLA/xzulvPQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764947666; c=relaxed/simple; bh=FHNLY+zmitbKKd7HxkszEXAyj18Tz6ibrEBH/y5/FNQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=asDKTqUPBsvrT/4Wx9WL95cjShxnLSrekudYUIEYJtOdA9alMIGzaPrAtp54AXlyuIJVkS29ZzkJ0wzJTR8Lju21cvaZv/dL9HyAN/8kKJ3MGjPHt+k/kENfD+BJzvlF/k6oJ5466snlm6yuTNUj71v+RQ20tWz1ruw0emer9+s= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=renesas.com; spf=fail smtp.mailfrom=renesas.com; arc=none smtp.client-ip=210.160.252.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=renesas.com X-CSE-ConnectionGUID: w9nZcPmDR+mLMTEuFJ4TKA== X-CSE-MsgGUID: 15jBQDvfQeeyO9Wj8iQzNg== Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie6.idc.renesas.com with ESMTP; 06 Dec 2025 00:14:15 +0900 Received: from demon-pc.localdomain (unknown [10.226.93.202]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 589464007D09; Sat, 6 Dec 2025 00:14:11 +0900 (JST) From: Cosmin Tanislav To: Vinod Koul , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Geert Uytterhoeven , Magnus Damm , Cosmin Tanislav , Fabrizio Castro , Lad Prabhakar , Johan Hovold , Biju Das Cc: dmaengine@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org Subject: [PATCH v3 5/6] arm64: dts: renesas: r9a09g077: add DMAC support Date: Fri, 5 Dec 2025 17:12:53 +0200 Message-ID: <20251205151254.2970669-6-cosmin-gabriel.tanislav.xa@renesas.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251205151254.2970669-1-cosmin-gabriel.tanislav.xa@renesas.com> References: <20251205151254.2970669-1-cosmin-gabriel.tanislav.xa@renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The Renesas RZ/T2H (R9A09G077) SoC has three instances of the DMAC IP. Add support for them. Signed-off-by: Cosmin Tanislav --- V3: * no changes V2: * remove notes arch/arm64/boot/dts/renesas/r9a09g077.dtsi | 90 ++++++++++++++++++++++ 1 file changed, 90 insertions(+) diff --git a/arch/arm64/boot/dts/renesas/r9a09g077.dtsi b/arch/arm64/boot/d= ts/renesas/r9a09g077.dtsi index 6812af127684..ee11efb68638 100644 --- a/arch/arm64/boot/dts/renesas/r9a09g077.dtsi +++ b/arch/arm64/boot/dts/renesas/r9a09g077.dtsi @@ -376,6 +376,96 @@ i2c2: i2c@81008000 { status =3D "disabled"; }; =20 + dmac0: dma-controller@800c0000 { + compatible =3D "renesas,r9a09g077-dmac"; + reg =3D <0 0x800c0000 0 0x1000>; + interrupts =3D , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + ; + interrupt-names =3D "ch0", "ch1", "ch2", "ch3", + "ch4", "ch5", "ch6", "ch7", + "ch8", "ch9", "ch10", "ch11", + "ch12", "ch13", "ch14", "ch15"; + clocks =3D <&cpg CPG_CORE R9A09G077_CLK_PCLKH>; + power-domains =3D <&cpg>; + #dma-cells =3D <1>; + dma-channels =3D <16>; + renesas,icu =3D <&icu 0>; + }; + + dmac1: dma-controller@800c1000 { + compatible =3D "renesas,r9a09g077-dmac"; + reg =3D <0 0x800c1000 0 0x1000>; + interrupts =3D , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + ; + interrupt-names =3D "ch0", "ch1", "ch2", "ch3", + "ch4", "ch5", "ch6", "ch7", + "ch8", "ch9", "ch10", "ch11", + "ch12", "ch13", "ch14", "ch15"; + clocks =3D <&cpg CPG_CORE R9A09G077_CLK_PCLKH>; + power-domains =3D <&cpg>; + #dma-cells =3D <1>; + dma-channels =3D <16>; + renesas,icu =3D <&icu 1>; + }; + + dmac2: dma-controller@800c2000 { + compatible =3D "renesas,r9a09g077-dmac"; + reg =3D <0 0x800c2000 0 0x1000>; + interrupts =3D , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + ; + interrupt-names =3D "ch0", "ch1", "ch2", "ch3", + "ch4", "ch5", "ch6", "ch7", + "ch8", "ch9", "ch10", "ch11", + "ch12", "ch13", "ch14", "ch15"; + clocks =3D <&cpg CPG_CORE R9A09G077_CLK_PCLKH>; + power-domains =3D <&cpg>; + #dma-cells =3D <1>; + dma-channels =3D <16>; + renesas,icu =3D <&icu 2>; + }; + gmac0: ethernet@80100000 { compatible =3D "renesas,r9a09g077-gbeth", "snps,dwmac-5.20"; reg =3D <0 0x80100000 0 0x10000>; --=20 2.52.0 From nobody Fri Dec 19 15:07:01 2025 Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E75912882B8; Fri, 5 Dec 2025 15:14:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.160.252.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764947669; cv=none; b=LAED3zmV8HGfpFProsAltklYTkRVkqKWmnGxvqrFiQS3zUduWiBxqFFyJAQIJGhPU9gk7YaR4WkrY4oXpBSqjBsVlpNLOdQbUUgW02l4FBRq07faTEc7suTcPHS1G5HDdBpVgWedIOAYHis3sGuTyN90kT9jsV1bxpI3qeMeaaI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764947669; c=relaxed/simple; bh=LGNDITOGN56nKw/+waZVvVH6x24rIrz1jsoZ3YGgqOg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=poNS3pYVe+IhX0qmWQ+3FnoaZ80qCBc702zYIdBUIB0aLMcl22tqfA9Hh5rzk4UDJxv8IWEP/I+O3rcn2XFc1YVzF/W02g1YfXMUmMQ34gq/iddaO7ueWAic6XuJZqX1AMsuvjihALhh73YYDfrRR4oZJO/8EYIaKgSM8W9w+3E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com; spf=pass smtp.mailfrom=renesas.com; arc=none smtp.client-ip=210.160.252.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=renesas.com X-CSE-ConnectionGUID: DlSGkFb+TgGXA5Q0hTaMYw== X-CSE-MsgGUID: 7V/iATJSTC6j9AqIryBf8Q== Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie5.idc.renesas.com with ESMTP; 06 Dec 2025 00:14:21 +0900 Received: from demon-pc.localdomain (unknown [10.226.93.202]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id D5AEB4005E29; Sat, 6 Dec 2025 00:14:16 +0900 (JST) From: Cosmin Tanislav To: Vinod Koul , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Geert Uytterhoeven , Magnus Damm , Cosmin Tanislav , Fabrizio Castro , Lad Prabhakar , Johan Hovold , Biju Das Cc: dmaengine@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org Subject: [PATCH v3 6/6] arm64: dts: renesas: r9a09g087: add DMAC support Date: Fri, 5 Dec 2025 17:12:54 +0200 Message-ID: <20251205151254.2970669-7-cosmin-gabriel.tanislav.xa@renesas.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251205151254.2970669-1-cosmin-gabriel.tanislav.xa@renesas.com> References: <20251205151254.2970669-1-cosmin-gabriel.tanislav.xa@renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The Renesas RZ/N2H (R9A09G087) SoC has three instances of the DMAC IP. Add support for them. Signed-off-by: Cosmin Tanislav --- V3: * no changes V2: * remove notes arch/arm64/boot/dts/renesas/r9a09g087.dtsi | 90 ++++++++++++++++++++++ 1 file changed, 90 insertions(+) diff --git a/arch/arm64/boot/dts/renesas/r9a09g087.dtsi b/arch/arm64/boot/d= ts/renesas/r9a09g087.dtsi index 19475c72017f..7b1f2c1c9e85 100644 --- a/arch/arm64/boot/dts/renesas/r9a09g087.dtsi +++ b/arch/arm64/boot/dts/renesas/r9a09g087.dtsi @@ -376,6 +376,96 @@ i2c2: i2c@81008000 { status =3D "disabled"; }; =20 + dmac0: dma-controller@800c0000 { + compatible =3D "renesas,r9a09g087-dmac", "renesas,r9a09g077-dmac"; + reg =3D <0 0x800c0000 0 0x1000>; + interrupts =3D , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + ; + interrupt-names =3D "ch0", "ch1", "ch2", "ch3", + "ch4", "ch5", "ch6", "ch7", + "ch8", "ch9", "ch10", "ch11", + "ch12", "ch13", "ch14", "ch15"; + clocks =3D <&cpg CPG_CORE R9A09G087_CLK_PCLKH>; + power-domains =3D <&cpg>; + #dma-cells =3D <1>; + dma-channels =3D <16>; + renesas,icu =3D <&icu 0>; + }; + + dmac1: dma-controller@800c1000 { + compatible =3D "renesas,r9a09g087-dmac", "renesas,r9a09g077-dmac"; + reg =3D <0 0x800c1000 0 0x1000>; + interrupts =3D , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + ; + interrupt-names =3D "ch0", "ch1", "ch2", "ch3", + "ch4", "ch5", "ch6", "ch7", + "ch8", "ch9", "ch10", "ch11", + "ch12", "ch13", "ch14", "ch15"; + clocks =3D <&cpg CPG_CORE R9A09G087_CLK_PCLKH>; + power-domains =3D <&cpg>; + #dma-cells =3D <1>; + dma-channels =3D <16>; + renesas,icu =3D <&icu 1>; + }; + + dmac2: dma-controller@800c2000 { + compatible =3D "renesas,r9a09g087-dmac", "renesas,r9a09g077-dmac"; + reg =3D <0 0x800c2000 0 0x1000>; + interrupts =3D , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + ; + interrupt-names =3D "ch0", "ch1", "ch2", "ch3", + "ch4", "ch5", "ch6", "ch7", + "ch8", "ch9", "ch10", "ch11", + "ch12", "ch13", "ch14", "ch15"; + clocks =3D <&cpg CPG_CORE R9A09G087_CLK_PCLKH>; + power-domains =3D <&cpg>; + #dma-cells =3D <1>; + dma-channels =3D <16>; + renesas,icu =3D <&icu 2>; + }; + gmac0: ethernet@80100000 { compatible =3D "renesas,r9a09g087-gbeth", "renesas,r9a09g077-gbeth", "snps,dwmac-5.20"; --=20 2.52.0