From nobody Mon Dec 1 21:31:54 2025 Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 75DD530DD2F; Mon, 1 Dec 2025 12:50:15 +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=1764593417; cv=none; b=qYIb7TmCKruxapAn/GkkBHpcirMJ36UruIOIJqWVEpaGx5ui5zlkUyVgGrfkLNQki8I+xnE9tHwjx1g3hMrs80XrxOz1+o3e0KczNxS/6fmWSQq2/l9AhjY9I95oFDCan9JH3phSLwsN5Wc3PmhGosRKZ13THBu91FUjGUKoM6w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764593417; c=relaxed/simple; bh=WhAJGCEAM/F7bLNFt0kKw1qhkRc+WVMYlcXR1S0/xnw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=EGypcfD9SyZAsczXwJDkWuEprxxBv6neuVtpAPeqpszlOghcfn8q2Pwy844Bl7cDrk9THx0RS3NskI6KK1HuI3VOjL6FnCtfYgZLDzvALQxxumywhv5aCiNROMzHRzNellt0RSHbj9ONFsjf39Y1cq+NA90FWx7HkbKsVvs3KIY= 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: OPWaf4kaTA2c+leRWioepg== X-CSE-MsgGUID: RGLmopkhThaJ2d9iHxhS0A== Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 01 Dec 2025 21:50:14 +0900 Received: from demon-pc.localdomain (unknown [10.226.93.83]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 7869742100DB; Mon, 1 Dec 2025 21:50:09 +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 v2 1/6] dmaengine: sh: rz_dmac: make error interrupt optional Date: Mon, 1 Dec 2025 14:49:06 +0200 Message-ID: <20251201124911.572395-2-cosmin-gabriel.tanislav.xa@renesas.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251201124911.572395-1-cosmin-gabriel.tanislav.xa@renesas.com> References: <20251201124911.572395-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 --- 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 Mon Dec 1 21:31:54 2025 Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 27D0330EF7A; Mon, 1 Dec 2025 12:50:20 +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=1764593424; cv=none; b=Y+zEieUxYH1dGNIJ/g93D/aANfkx1RrYOWXpff2QLYE6rmB0+TqH7ZyQB6tmxHbx05Jrd9NO90GrH5WprFpYhxQDAg6kh1kIa4B6kJrZp+2M75CGzpzOXzBS8mkb3iCZzAXre2Q39nLFePOVz5H5xRHz7E0tEm9O7xbE5suHa5g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764593424; c=relaxed/simple; bh=mnEQrLvSEJoecPOYVFEQuh3HOV/snTg0bVKjC5fkMFU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=g/nuZx43Z8AY2Om8dK++CWq83TcVVHNIrxeerFpRmUvvsAgA2R9y5NTUDj2y41BTxzULsOHlV4FtN34KostJ5afzzp7gcLzKk4hkQspCzjQLt3p5RLM0BHTX4U/yD98ChV6gTgrS/JleIsxn5AJbgjPAUgcrXCKAkoJ4cXlw3F4= 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: artisk8EQHyf6H68b3mBLg== X-CSE-MsgGUID: z1sNATn7QFaEFpwHgqjcQg== Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie5.idc.renesas.com with ESMTP; 01 Dec 2025 21:50:19 +0900 Received: from demon-pc.localdomain (unknown [10.226.93.83]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 2FE7D42100E0; Mon, 1 Dec 2025 21:50:14 +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 v2 2/6] dmaengine: sh: rz_dmac: make register_dma_req() chip-specific Date: Mon, 1 Dec 2025 14:49:07 +0200 Message-ID: <20251201124911.572395-3-cosmin-gabriel.tanislav.xa@renesas.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251201124911.572395-1-cosmin-gabriel.tanislav.xa@renesas.com> References: <20251201124911.572395-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. 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. Since the default values are different between the two, use -1 for designating that the default value should be used. Signed-off-by: Cosmin Tanislav --- V2: * remove notes drivers/dma/sh/rz-dmac.c | 68 +++++++++++++++++++++++----------------- 1 file changed, 39 insertions(+), 29 deletions(-) diff --git a/drivers/dma/sh/rz-dmac.c b/drivers/dma/sh/rz-dmac.c index 20a5c1766a58..f94be3f8e232 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,19 @@ 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 (req_no < 0) + req_no =3D dmac->info->dma_req_no_default; + + 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 +354,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, -1); =20 channel->chcfg =3D chcfg; channel->chctrl =3D CHCTRL_STG | CHCTRL_SETEN; @@ -393,12 +405,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 +678,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, -1); } =20 /* @@ -868,14 +869,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 +930,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 +948,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 +1068,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 Mon Dec 1 21:31:54 2025 Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DF1C630F944; Mon, 1 Dec 2025 12:50:26 +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=1764593429; cv=none; b=X9koJ25LgkysynmjvG8jbgAa7m/i8vijDWzCQdCRJUOssoVAfi+9j+3Umbbk18BSIqajOYx1kiCyY+XC/8J6lJ8sjBLut7QvnH3fT6ZgmR4fojf1AS2y2kVT8DdR2RawQ4W5JxyjvTszLxJClA/K7Bfhd73jecT+eHw2kc39f5g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764593429; c=relaxed/simple; bh=zFA7eNiL8YbxScfmf3fTKRUWq/qcgQoMV6XqiUB5gwM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=E1+bWzOYfmLzGKO/EmQA6im6GzcYvqssPHqTDjv4gObZ+SZKrBZqmOsay5kDjORo1n3gfwpz6OD39WRLDuEySW+f0Z4rU/1MyPhN3M1gitTu1YG7GmsghoRPJ7lf747Kj6CKfsrt1033n7R56dskJdr/ouAbFm4SCHD+fSI4Hew= 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: /0Ce4U4uSQCd09pve3Ifow== X-CSE-MsgGUID: FqSOLICqT8ixMki8KGSDvA== Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 01 Dec 2025 21:50:25 +0900 Received: from demon-pc.localdomain (unknown [10.226.93.83]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id E3D3142100DB; Mon, 1 Dec 2025 21:50:20 +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 v2 3/6] dt-bindings: dma: renesas,rz-dmac: document RZ/{T2H,N2H} Date: Mon, 1 Dec 2025 14:49:08 +0200 Message-ID: <20251201124911.572395-4-cosmin-gabriel.tanislav.xa@renesas.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251201124911.572395-1-cosmin-gabriel.tanislav.xa@renesas.com> References: <20251201124911.572395-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 --- 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 Mon Dec 1 21:31:54 2025 Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 88F9D25485A; Mon, 1 Dec 2025 12:50:31 +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=1764593433; cv=none; b=NdkYW7dzL9ydRNiXdTm6F86vGb5O1P8DzCddfg9FRoCiGd9QV/IK/Pvf15DLcgJSI3QpF5iFDq3D7wef5ngTMaDvwY3RLlpu7QWX9MFaKPdyUhDpq85FfAp1HxIWsy1pLMkxkYclsNS8RZrauD9BpVPgjCJJXA6HJeMtCnKS/wk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764593433; c=relaxed/simple; bh=KRdjna8ohdnklC4PmiXDdUZTz070u73fx9KBLPmMEU8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DG2RaiWdOwE/MhuHpBLPlgfyArl7N2qhfTVVycwYW+h6GSKxDwgfittWuJStkYHHrOZFi1OH3hYxLoorBIfFDfwb0Fe0ZZ1oJtJ1JXvAUXZ9gYA8iH0Ullb8BgSlPtjLjC8tHzZ4r97mjaXs93B3zhE82Sf8suD/U3dGBFgtYIU= 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: 9ESiXhB6RVCraCNqbr7SQg== X-CSE-MsgGUID: xnQ1l1dURymitEGGeW0yQA== Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 01 Dec 2025 21:50:31 +0900 Received: from demon-pc.localdomain (unknown [10.226.93.83]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 98DB742100DB; Mon, 1 Dec 2025 21:50:26 +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 v2 4/6] dmaengine: sh: rz_dmac: add RZ/{T2H,N2H} support Date: Mon, 1 Dec 2025 14:49:09 +0200 Message-ID: <20251201124911.572395-5-cosmin-gabriel.tanislav.xa@renesas.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251201124911.572395-1-cosmin-gabriel.tanislav.xa@renesas.com> References: <20251201124911.572395-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 --- 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 f94be3f8e232..c0c23c39a626 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 @@ -1073,12 +1074,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 Mon Dec 1 21:31:54 2025 Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3C7D525485A; Mon, 1 Dec 2025 12:50:37 +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=1764593439; cv=none; b=Q0fefOB0kcAe2CZn3wF2Xd/o2ma5UEM78TfzpAeA4tW/nVob7YTSvniYsy1U4vnJgoae4sp8Yf9rxDwDBxjRDFKTew1yTTmkxhBTOXOpCYbvVXCREZNquZbBJjfPZgN+NmfP1rXAXN/TWKHAuL9CAFO/OV7wANkmNX2sPuWRuNE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764593439; c=relaxed/simple; bh=cRnvEf51K15FRWQUZ+UAmSDC2DtwCQ2cDp1eEF9GKgk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=I3/I/GgRFEUaB1yC/TnS9g4VuB8sAOZZDBsWMggJjNsVR4/PslnSMwOxXNsqEHhO2ZxKb6UKHp30P9p13aT33qBQpx5OUpneOgmFQdpdAzXoBw6+ke4zlUuylpNpxnxCvyd7qyrdSSoW3IQObVcoyeu0TkCmzSbUHBPnV5E4R+A= 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: lQEaD8+VRJi9x9I/ew6wrw== X-CSE-MsgGUID: FSHxq62LS+mNV7x4wiE1wg== Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 01 Dec 2025 21:50:36 +0900 Received: from demon-pc.localdomain (unknown [10.226.93.83]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 58FBF42100DB; Mon, 1 Dec 2025 21:50:32 +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 v2 5/6] arm64: dts: renesas: r9a09g077: add DMAC support Date: Mon, 1 Dec 2025 14:49:10 +0200 Message-ID: <20251201124911.572395-6-cosmin-gabriel.tanislav.xa@renesas.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251201124911.572395-1-cosmin-gabriel.tanislav.xa@renesas.com> References: <20251201124911.572395-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 --- 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 Mon Dec 1 21:31:54 2025 Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D548430E849; Mon, 1 Dec 2025 12:50:42 +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=1764593444; cv=none; b=Was5b3bK540dMKNK1UA0aGknQxIT421Mpbsye/dVSjoJdlpi64+/w8fzqCYmlPyTLGoHb/nCPBZm6iFhm9BOEMnmEdGb0ToBBKHBa8OCD8jDf2srrXTq89k7bWI11vVD3nvF7fHFotyzwE4UOLBPG13uUbg2c4Zyxy6dXo0b3xE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764593444; c=relaxed/simple; bh=SE5M85jfYohwVmOgRWoTggeWXp/bqT+CsszUNiDZeNM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=BHDW3Qi1KDoqZK/hbyiSImusrwZPJ896HV+UNIW/GRHHSMqK8kiXF5gnoWrngrbpbDGb5KqBCrLAyoJe5bYee/7UoxZiOgNqchFynqfY055YeW6oC/jSQXzBfNo2HlCVaKVPqAwvJn9U7STfpbMOl24gnXYgxSPRe6+acQV5vsE= 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: 1BKojXa7Qzq/GtyBe2sKQg== X-CSE-MsgGUID: IoO2Ul7kSuKPXGm95HiXNw== Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 01 Dec 2025 21:50:42 +0900 Received: from demon-pc.localdomain (unknown [10.226.93.83]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id EE5B242100E1; Mon, 1 Dec 2025 21:50:37 +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 v2 6/6] arm64: dts: renesas: r9a09g087: add DMAC support Date: Mon, 1 Dec 2025 14:49:11 +0200 Message-ID: <20251201124911.572395-7-cosmin-gabriel.tanislav.xa@renesas.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251201124911.572395-1-cosmin-gabriel.tanislav.xa@renesas.com> References: <20251201124911.572395-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 --- 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