From nobody Mon Feb 9 05:42:36 2026 Received: from mail-ed1-f66.google.com (mail-ed1-f66.google.com [209.85.208.66]) (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 63F7940B6FC for ; Wed, 4 Feb 2026 14:23:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.66 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770215005; cv=none; b=QfEHfr+ne8hLxx5QwSUW3dZAlnFIa5E1VgMc+f+WZeP8Z8HADRm0S1hG3cC6SwlguFjSD8h8/4L7Y6/+PTAfEE9nrBsDIWmy5KKraevaIS4rn7ywJsX1wyYfo6v0aYJiYHu+8LTVF/T7I3tOrpyf0lMvoLoZ6QF5u8dQZbHyfWY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770215005; c=relaxed/simple; bh=1zX/KmPqe4XbBIXKCE0/BFFxZ+38CAZXt+tLU70EOuc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qNwMtnZ96LAyV7QNDFymMFo55o1NWXd0fjn0wtgDV3WsBD4CYGzh+/VJIVCsqvAo8HCgn0G7nZn26e2HKVZ5BicywuqJS0YzxcC7vfshPaLUic0Ggoa2yc/6wzMpoX5VmzanfOOVjXwoFPCXDVgBrvuZcmgeLLRtySSMK+2fhok= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=PhvLEth7; arc=none smtp.client-ip=209.85.208.66 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="PhvLEth7" Received: by mail-ed1-f66.google.com with SMTP id 4fb4d7f45d1cf-64bea6c5819so1235827a12.3 for ; Wed, 04 Feb 2026 06:23:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1770215004; x=1770819804; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=I1znNX1N3rANUdGlvXWVGWuiuSP52fPEYjbxG/ELNnM=; b=PhvLEth7b1lrYThDBkWEXbvC5QmpmRnrqvGnnhHauVsw6E3kxOGOfGiHPhB6iWpQyv jKrer/l9zPje9JIIhO8P46UeEcUovAT2AlNURGNI/B9JFZm79Us3kPinteNC1/oPPDDK BVYCiUs5ST+pU8OtN+0cYV3R4ot17ZjDGpGbhA1pm5KiRKf98e7rX7hZqx+W9uSbE5h8 Z3NMD8Nkiev2VpCf1qClvI+G1KyPmQrRi7fckQL5H/CQ/LdHO7dt3XKz3EPBlkLsIht3 EfXKUsG2GZtVgk6gQgVclc0wZRKnC1bRfTMoiPLE5MkD0ewwfj7xe25wBQAEgfbmbf3h I25Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770215004; x=1770819804; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=I1znNX1N3rANUdGlvXWVGWuiuSP52fPEYjbxG/ELNnM=; b=AGYQx+xIZGZTALeOCyjmc0JGr1zGQGgolaRfAeO5zx0NUXRtKvGsIfGigkZr6gz66G QmVLKJQswb5xGwAKH0SRWF6KGbb+ZoVGRzCkHJrOwlG2MD1tHkWirRIwWoLzO9a5aUyq QDXqxWPtJbfnVL7kYkjuKsKqt3fd01EsRPw3ZvR1v5dhlGGHxfP0EyZDCbQD7GwlBu3K 0Zs8HqbIx5+X8dJKSvfK+JCGu4VVlmTKtyC20non0cNRcAJH2//5O4m6ICLh9xsT/Run 3/B5tQItEnrU9jq9DyXGqnqA8Sm8v2nDidwncRl5/vAcADYzXtpTKwjOkfqrPXTDCja8 fi+g== X-Forwarded-Encrypted: i=1; AJvYcCU+XP+6P8ELBlki+O74wb+WGRpkCBrhoDGd17gHFE6rxe3+cMOVee6sT4coOpNzX881PZ2WcL7OthcAO98=@vger.kernel.org X-Gm-Message-State: AOJu0YyizhCQHLwAXp6tCepGsF15Aw2zmu667dQiU4tGURpd3VOfwqv7 k4pUb/NzaFk5k839LfvteEtgxJBFzPvrklBQUYjMWmP9C+r6/PRc55rf X-Gm-Gg: AZuq6aKtA58wZ1dYzCrTExvSHa6qnJLEuq1Ku5D9FsNgUY5SCLG2C5FPQOpZCvkdfaX RdbfGwuj0VlxVnopU3fylHOod4tcZ9ln1eJ87N1Esb7BloY5VwH3sxK65yL4fg+IAG+GETqHgyD r5DikCd7C7CoSTrSKJ7cF4j2vsRIea93Rekd7ZpuBXrMXxFwHohPZHnja3Lmy7tuNzDpbegRJp6 WLsuDNx3QPFJ2bTikNlnNUnsZTdq8QzCMVnHWD+PTW6oQuAvHiw9Y2i2/evlRP3oOxtxgoAK097 vhnL80iKWdgXJUOZC1qefT7SJFv0u/j9KJxJHBX8ayCzXRgnAgFbaouaJwicrtI2mqRuMUIIsef a04H9M3M+k8Jg9dj3/s8LKDD2ea4/eTAcIzTgnclZga9BnnxdPv+nZF+UYxUArUavvmReAXmDRw n+jjba15KXz2xTUipk/eTJM1j13dfHyGdVT8Y= X-Received: by 2002:a17:906:eecd:b0:b87:173f:61b with SMTP id a640c23a62f3a-b8e9ef2c012mr215351566b.9.1770215003489; Wed, 04 Feb 2026 06:23:23 -0800 (PST) Received: from localhost.localdomain ([2a00:23c4:a758:8a01:3c9f:a100:4d45:ebc7]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b8ea001ea7dsm129038366b.47.2026.02.04.06.23.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Feb 2026 06:23:23 -0800 (PST) From: Biju X-Google-Original-From: Biju To: Thomas Gleixner , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Geert Uytterhoeven , Magnus Damm Cc: Biju Das , Lad Prabhakar , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Biju Das Subject: [PATCH 1/8] dt-bindings: interrupt-controller: renesas,rzg2l-irqc: Document RZ/G3L SoC Date: Wed, 4 Feb 2026 14:23:09 +0000 Message-ID: <20260204142320.103184-2-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260204142320.103184-1-biju.das.jz@bp.renesas.com> References: <20260204142320.103184-1-biju.das.jz@bp.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" From: Biju Das Document RZ/G3L (R9A08G046) IRQC bindings. The IRQC block on RZ/G3L SoC is almost identical to one found on the RZ/G3S SoC with the difference like it support more External IRQs, GPT Error Interrupts and also has additional registers for GPT/MTU IRQ selection, shared IRQ selection between external IRQ and TINT. Hence new generic compatible string "renesas,r9a08g046-irqc" is added for RZ/G3L SoC. Signed-off-by: Biju Das --- .../renesas,rzg2l-irqc.yaml | 66 +++++++++++++++++-- 1 file changed, 62 insertions(+), 4 deletions(-) diff --git a/Documentation/devicetree/bindings/interrupt-controller/renesas= ,rzg2l-irqc.yaml b/Documentation/devicetree/bindings/interrupt-controller/r= enesas,rzg2l-irqc.yaml index 44b6ae5fc802..6ee81663f0a1 100644 --- a/Documentation/devicetree/bindings/interrupt-controller/renesas,rzg2l-= irqc.yaml +++ b/Documentation/devicetree/bindings/interrupt-controller/renesas,rzg2l-= irqc.yaml @@ -30,7 +30,10 @@ properties: - renesas,r9a08g045-irqc # RZ/G3S - const: renesas,rzg2l-irqc =20 - - const: renesas,r9a07g043f-irqc # RZ/Five + - items: + - enum: + - renesas,r9a07g043f-irqc # RZ/Five + - renesas,r9a08g046-irqc # RZ/G3L =20 '#interrupt-cells': description: The first cell should contain a macro RZG2L_{NMI,IRQX} in= cluded in the @@ -58,6 +61,14 @@ properties: - description: IRQ5 interrupt - description: IRQ6 interrupt - description: IRQ7 interrupt + - description: IRQ8 interrupt + - description: IRQ9 interrupt + - description: IRQ10 interrupt + - description: IRQ11 interrupt + - description: IRQ12 interrupt + - description: IRQ13 interrupt + - description: IRQ14 interrupt + - description: IRQ15 interrupt - description: GPIO interrupt, TINT0 - description: GPIO interrupt, TINT1 - description: GPIO interrupt, TINT2 @@ -97,6 +108,14 @@ properties: - description: ECCRAM1 1bit error interrupt - description: ECCRAM1 2bit error interrupt - description: ECCRAM1 error overflow interrupt + - description: Integrated GPT Error interrupt for channel 0, OVFUNF0 + - description: Integrated GPT Error interrupt for channel 1, OVFUNF1 + - description: Integrated GPT Error interrupt for channel 2, OVFUNF2 + - description: Integrated GPT Error interrupt for channel 3, OVFUNF3 + - description: Integrated GPT Error interrupt for channel 4, OVFUNF4 + - description: Integrated GPT Error interrupt for channel 5, OVFUNF5 + - description: Integrated GPT Error interrupt for channel 6, OVFUNF6 + - description: Integrated GPT Error interrupt for channel 7, OVFUNF7 =20 interrupt-names: minItems: 45 @@ -110,6 +129,14 @@ properties: - const: irq5 - const: irq6 - const: irq7 + - const: irq8 + - const: irq9 + - const: irq10 + - const: irq11 + - const: irq12 + - const: irq13 + - const: irq14 + - const: irq15 - const: tint0 - const: tint1 - const: tint2 @@ -149,6 +176,14 @@ properties: - const: ec7tie1-1 - const: ec7tie2-1 - const: ec7tiovf-1 + - const: ovfunf0 + - const: ovfunf1 + - const: ovfunf2 + - const: ovfunf3 + - const: ovfunf4 + - const: ovfunf5 + - const: ovfunf6 + - const: ovfunf7 =20 clocks: maxItems: 2 @@ -180,6 +215,22 @@ required: allOf: - $ref: /schemas/interrupt-controller.yaml# =20 + - if: + properties: + compatible: + contains: + enum: + - renesas,r9a07g043f-irqc + - renesas,r9a07g043u-irqc + - renesas,r9a07g044-irqc + - renesas,r9a07g054-irqc + then: + properties: + interrupts: + maxItems: 48 + interrupt-names: + maxItems: 48 + - if: properties: compatible: @@ -192,12 +243,19 @@ allOf: maxItems: 45 interrupt-names: maxItems: 45 - else: + + - if: + properties: + compatible: + contains: + enum: + - renesas,r9a08g046-irqc + then: properties: interrupts: - minItems: 48 + maxItems: 61 interrupt-names: - minItems: 48 + maxItems: 61 =20 unevaluatedProperties: false =20 --=20 2.43.0 From nobody Mon Feb 9 05:42:36 2026 Received: from mail-ej1-f42.google.com (mail-ej1-f42.google.com [209.85.218.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 BFEE6283FD6 for ; Wed, 4 Feb 2026 14:23:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770215006; cv=none; b=S19hwh/uf2D9BW+eVK9IMATQm67BP+5uo61A/KY69t+L67l02KwdNhUHZK/ZgaUtK8+ZlHXWkpy0KM5zVeZXGmjgGRZx/PJOs1GRLz0HM/U9J2qUAEgqhv1KtN1cwcOBMjjqtjVtla3dEqSTnq690NStFfgvz/Und/wvl9kGiaU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770215006; c=relaxed/simple; bh=GQuhT/tYWweuUx5ujA6rRjXoqkczMUhSFVoDxDBYdc0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=dOiMZ9upIvR2BaHp+/hMR+oHMbA79LYPUxjWr7nHsykk1u+q+E5bDd9cB2yqbP9jDQdFMUh2AeMkZYYlt+r/4eTuZyW1zi5r5fgH19y0us5IRu2oKfoTQqKQn4/T1e7QJXRWcXvQgfqA84/cacMdEJoJ/AS2t/CwvghnhBIJ+8o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=l9RXx/f0; arc=none smtp.client-ip=209.85.218.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="l9RXx/f0" Received: by mail-ej1-f42.google.com with SMTP id a640c23a62f3a-b8850aa5b56so1108157366b.2 for ; Wed, 04 Feb 2026 06:23:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1770215004; x=1770819804; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=epCayHlvCsfz7S+7gHZWH4Yw7IrAlRqKPfSc7t/2oH4=; b=l9RXx/f0R6PTeVYq+TUg2uupHyLLlVp6EXGlGwGmaUW49MMm+LwEnazq3nJFbvkeDo DRLLQervAf+n8FbjnpQ8suVOsimrIvVBr2KpKZb7AnR7nCHkGCxUfb369fowv/B0isKO g1m+7NDbtVD/96T4uzYFSa1bPgnP0lbyxo0suoIxvPOddTgpDFJFAnMbgF39CRCdLLb5 cSvX4RZSEAUOq+J3HzHx/XPtV+bGUNDnpZe0MyHKhSQkkEFZ1L4kcTBnKAs7F7YUQmSI 7SHYAMAC9LgVoAh2afa0e2FEjv5C/oP+hYqcT9nxQEMxU2rq2PqEoQG/9LHTN8OfvNrI KS6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770215004; x=1770819804; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=epCayHlvCsfz7S+7gHZWH4Yw7IrAlRqKPfSc7t/2oH4=; b=VZ0ls2aalu2uvRDK2Hj2h1vFs+Rir4z3V21qWfE9g8RKOChvJvLykampoDFytdpAHJ ajtoKDZ2ufbEmIVj5sTye4iDLLqA1I8ADWvOqtzQ801OH3ZdzTtSQQAl+Qs8aVlRu6It Pn47sw9MckMf6crWTVuA8zaimFnGzMMi3y1UDp4jy6WNVTolWd95w4t5ytiicdEbAl7h KmvvOEK8PAxjDvA/RBY67omRTXymG9Ff7uzgnz7gmK1z53QlkYO7mEp1nlnXxwcFpaVQ fsyudOKXxvlZAZ7TfMUITB6M9zYgpzjoX65DDAjkf64OmSDcGiGD2UU/+Ha7a06LCL0B Wpgg== X-Forwarded-Encrypted: i=1; AJvYcCWjP0YaFW9Xk/m38A8hqUgF2CdM9itN5gM9qie0gHdex0TPoHgRKVDX5baQcWamEVs7xJpM2Afi24vetZg=@vger.kernel.org X-Gm-Message-State: AOJu0YwkgwaQzVTPyoqR1x21BNvMTWZ6+3nEUnQSo9/6rfGrCiN/rYo2 FVsSb9AASityyWKW7DBz3UaDyfsqYcXjP92rx/BjmB9zY4mPgmgRsKS7 X-Gm-Gg: AZuq6aKxTE1d+Un/7j59zkIgoYX6yNneDh8VxT9gku+bN+1V2g5cNhMQAD6CSh2iWRu U6QdzZN2nFUx4Qd5SJVMEGJ7FKcIuGV7JSCxPbWRRwwgflPiqaOjXvsu9qzIqNt+gLlrAktOAmm CMgETXobhWln8dYBB37i0yIF1F43XL0lrlvDQxvkndT5RepHBXEilL5v4eKHccPQGgG+ozB88gR jgF51xrVjtNo5DYggDAY4rPWXwohS15T3go9ulWwtbYHlkf8xqbkkuI2j8o8DKUKGZrS0x2XTJ3 jiUQ3pZJfQnkklR5hgIcK8GQO8xodzdYK/rb2b9I3j2wClnhtaZClvVI7sIG4O09xvpeUbNBh6A JekhwFZQxOdASGST2Bb/650XU5PjO/VkcsvLNwsThiVTfU2GBWSP5XPCrrgcrMLoRv5jTsZAa7k c/vKcW8kYKSFDm9bnFoRIAaWWYsv71u7BZhvI= X-Received: by 2002:a17:907:26c3:b0:b8e:7e21:1344 with SMTP id a640c23a62f3a-b8e9f176d98mr186025866b.23.1770215004004; Wed, 04 Feb 2026 06:23:24 -0800 (PST) Received: from localhost.localdomain ([2a00:23c4:a758:8a01:3c9f:a100:4d45:ebc7]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b8ea001ea7dsm129038366b.47.2026.02.04.06.23.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Feb 2026 06:23:23 -0800 (PST) From: Biju X-Google-Original-From: Biju To: Thomas Gleixner Cc: Biju Das , linux-kernel@vger.kernel.org, Geert Uytterhoeven , Prabhakar Mahadev Lad , Biju Das , linux-renesas-soc@vger.kernel.org Subject: [PATCH 2/8] irqchip/renesas-rzg2l: Make fwspec variable as pointer in struct rzg2l_irqc_priv Date: Wed, 4 Feb 2026 14:23:10 +0000 Message-ID: <20260204142320.103184-3-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260204142320.103184-1-biju.das.jz@bp.renesas.com> References: <20260204142320.103184-1-biju.das.jz@bp.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" From: Biju Das The total number of IRQs in RZ/G2L and RZ/G3L SoC are different. The RZ/G3L has 16 external IRQs where as RZ/G2L has only 8 external IRQ. Dynamicaly allocate fwspec memory instead of static allocation to support both SoCs. Signed-off-by: Biju Das --- drivers/irqchip/irq-renesas-rzg2l.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/irqchip/irq-renesas-rzg2l.c b/drivers/irqchip/irq-rene= sas-rzg2l.c index e73d426cea6d..20e2b1c4587b 100644 --- a/drivers/irqchip/irq-renesas-rzg2l.c +++ b/drivers/irqchip/irq-renesas-rzg2l.c @@ -79,7 +79,7 @@ struct rzg2l_irqc_reg_cache { static struct rzg2l_irqc_priv { void __iomem *base; const struct irq_chip *irqchip; - struct irq_fwspec fwspec[IRQC_NUM_IRQ]; + struct irq_fwspec *fwspec; raw_spinlock_t lock; struct rzg2l_irqc_reg_cache cache; } *rzg2l_irqc_data; @@ -554,6 +554,11 @@ static int rzg2l_irqc_common_probe(struct platform_dev= ice *pdev, struct device_n if (IS_ERR(rzg2l_irqc_data->base)) return PTR_ERR(rzg2l_irqc_data->base); =20 + rzg2l_irqc_data->fwspec =3D devm_kcalloc(&pdev->dev, IRQC_NUM_IRQ, + sizeof(*rzg2l_irqc_data->fwspec), GFP_KERNEL); + if (!rzg2l_irqc_data->fwspec) + return -ENOMEM; + ret =3D rzg2l_irqc_parse_interrupts(rzg2l_irqc_data, node); if (ret) return dev_err_probe(dev, ret, "cannot parse interrupts: %d\n", ret); --=20 2.43.0 From nobody Mon Feb 9 05:42:36 2026 Received: from mail-ej1-f49.google.com (mail-ej1-f49.google.com [209.85.218.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 9C3FE410D3A for ; Wed, 4 Feb 2026 14:23:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770215006; cv=none; b=UXKrToD5anRYaTmIQ6zfBQldktuusf8Sp2zL8wnIwttv0wKmAKAeYrDjEXZIjvseylu9fQJO19qD9PYWXJ4cQQyAzCkRb/COnjxP+yHRb4oDPjAs6OqXBUIiNb43Io0XKynUulDZEBktZCEeCKQ3wR6TrPgwUgoCFD/hpEW+9R4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770215006; c=relaxed/simple; bh=o22U+8vY0dnnJkZ0gE8DL8cxlUxYyX5mY0s7rT0nJlA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kgvUy2PV93WMEz/zQL/Oqxsg5C1Tmqv7cjjlA6WVM63UIOXGkcXrrLQA/VcZlgRnDSPtN3rcR9K+ZE2fpAwfJBeGAOQmR3E18YTnRyPY6itKIj4mqsJjBpzZWBbFk8oUGmf+x7U1aEkDAVdMqBKedTbXUBAgE/tBHoFXtrq3Z0g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=BfWlpROV; arc=none smtp.client-ip=209.85.218.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="BfWlpROV" Received: by mail-ej1-f49.google.com with SMTP id a640c23a62f3a-b872f1c31f1so894432066b.0 for ; Wed, 04 Feb 2026 06:23:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1770215005; x=1770819805; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=3vZGh2mgpsYmBnSmPEEEfEUpJ8/hDIu2t+YRg9j8bgk=; b=BfWlpROVlpw1uMlk66hzPmQ4MHY6CYukQCpitwRjEdcuFxIN4SZGH1cwcqYUMIjZTT p2XYVGOsemDq0f6cFk+BET7dIrwQS5cHMXaarQ3eWTn2JaV9AUeVL7dKQBdZ3eJRC40a 42Xopp4GqkaAlWGLEkzr/pwoSdqIMvTDKxkXmRtUg80qizFRrh9jkCz5EbV7xmo9OdPA nfdm65h8i33IFAYd+Zr1FsWi22IlyGtbeHCUyH9wqsPE9EzV0Jv6DHohYiyWPi4NzZ/5 i+AQB/VJFY02QDQm4f9f5CGwbkejHuaLO8QJQf16zIX9jirPgurdPqa29cW4oluL+uIb JgiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770215005; x=1770819805; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=3vZGh2mgpsYmBnSmPEEEfEUpJ8/hDIu2t+YRg9j8bgk=; b=Y0pHqefAvXneaBcQhKCuobRSwtE/QzcqKsOdSlbwaVDZLltXbtSp330qgfM2TV9E6P JQn0mVGNvvKJEtFjlsRdb7N2iZBZyRgksO+GBUMa8B52Ai32xAmad/5PPSyjvjr4e3lI hkidQuDxCYl57exOPZVHnNmXmBjM91hUOsSITjXoVZ3+algT8Rx4z6dy5p6QUA8DgBwK wqRzot+hyLZi8hTD+3QfjWJCGXoMnh7szv7WgxsmywtO293K1fG8b6ZrgeJHqDFRh4Fi VGmpQnAXelZW9pNgahIbL01wU0SIPLmIA091TNIeG1DN0HdlWQB/rdTIN9wRYUu80208 c98g== X-Forwarded-Encrypted: i=1; AJvYcCXxCRP3F/C2PDLXFGroqh67KTglAc5ewrV5clADIX7bnQhwyI3+xvYRaAPJPCfSX/hJXwHh/dIGoUuiX+w=@vger.kernel.org X-Gm-Message-State: AOJu0YzRCYIP75ECKPOGNaXbXa/dzI+gj93XzzvbzXqIwWSp33H1GE// WeauqwvRFJoWa8ItcbnYkEJsVyGY+8pq1jz+Lsnq3NN7YdClpYcV17vy X-Gm-Gg: AZuq6aIft9DfbV5Dm/69F932kLlfpaustXM8EPrCqTmrXKUfaoWIU1ivDU4yPCMu1tq 3YAme9HMrJbEKbAtDZQnZKHIxx4K/m/P2I7vWRq0nAvMjshZHZADlyYVNRNBfq7poJA98i6YuBs 4zIajwy1RZSG4g/R2i5Yk9AVwXyX2NOIELJhQGLBYhLnMDdIl8OwbeFlJVICTJlcmEzSFBAUXmw t5AASlnDu6YgGZDIoENJkPzNB5tKLoQE3LVVnIHqZAnkqp98QpNVmj6iV/MHCjXr3XgVxqSbUqe fghqw0DsXH9TiuDghmKHGx1cfjxqnYo80aTfBYGvbfI/UqAGLDO/u1i4Bm72V/3ov7K0qy3Nuqi HtPv0L+/6uOB9XtL2EUhJ3IGzvouW9hcxXoJrBB/M2y5QO9Kv850iGaHMvPhZOhZ48pdI1Kq+Jd XKh8E3oqFSAsI1ShG4RPtf7Htz/I3JWQgv6MY= X-Received: by 2002:a17:907:971e:b0:b87:d3af:de68 with SMTP id a640c23a62f3a-b8e9ef25d95mr181125766b.7.1770215004658; Wed, 04 Feb 2026 06:23:24 -0800 (PST) Received: from localhost.localdomain ([2a00:23c4:a758:8a01:3c9f:a100:4d45:ebc7]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b8ea001ea7dsm129038366b.47.2026.02.04.06.23.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Feb 2026 06:23:24 -0800 (PST) From: Biju X-Google-Original-From: Biju To: Thomas Gleixner Cc: Biju Das , linux-kernel@vger.kernel.org, Geert Uytterhoeven , Prabhakar Mahadev Lad , Biju Das , linux-renesas-soc@vger.kernel.org Subject: [PATCH 3/8] irqchip/renesas-rzg2l: Drop IRQC_NUM_IRQ macro Date: Wed, 4 Feb 2026 14:23:11 +0000 Message-ID: <20260204142320.103184-4-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260204142320.103184-1-biju.das.jz@bp.renesas.com> References: <20260204142320.103184-1-biju.das.jz@bp.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" From: Biju Das The total number of IRQs in RZ/G2L and RZ/G3L SoC are different. Introduce struct rzg2l_hw_info to handle the hardware differences and replace the macro IRQC_NUM_IRQ with num_irq variable in struct rzg2l_hw_info. Signed-off-by: Biju Das --- drivers/irqchip/irq-renesas-rzg2l.c | 46 ++++++++++++++++++++--------- 1 file changed, 32 insertions(+), 14 deletions(-) diff --git a/drivers/irqchip/irq-renesas-rzg2l.c b/drivers/irqchip/irq-rene= sas-rzg2l.c index 20e2b1c4587b..cd9909a85280 100644 --- a/drivers/irqchip/irq-renesas-rzg2l.c +++ b/drivers/irqchip/irq-renesas-rzg2l.c @@ -24,7 +24,6 @@ #define IRQC_IRQ_COUNT 8 #define IRQC_TINT_START (IRQC_IRQ_START + IRQC_IRQ_COUNT) #define IRQC_TINT_COUNT 32 -#define IRQC_NUM_IRQ (IRQC_TINT_START + IRQC_TINT_COUNT) =20 #define ISCR 0x10 #define IITSR 0x14 @@ -68,12 +67,21 @@ struct rzg2l_irqc_reg_cache { u32 titsr[2]; }; =20 +/** + * struct rzg2l_hw_info - Interrupt Control Unit controller hardware info = structure. + * @num_irq: Total Number of interrupts + */ +struct rzg2l_hw_info { + u8 num_irq; +}; + /** * struct rzg2l_irqc_priv - IRQ controller private data structure * @base: Controller's base address * @irqchip: Pointer to struct irq_chip * @fwspec: IRQ firmware specific data * @lock: Lock to serialize access to hardware registers + * @info: Pointer to struct rzg2l_hw_info * @cache: Registers cache for suspend/resume */ static struct rzg2l_irqc_priv { @@ -81,6 +89,7 @@ static struct rzg2l_irqc_priv { const struct irq_chip *irqchip; struct irq_fwspec *fwspec; raw_spinlock_t lock; + const struct rzg2l_hw_info *info; struct rzg2l_irqc_reg_cache cache; } *rzg2l_irqc_data; =20 @@ -136,7 +145,7 @@ static void rzg2l_irqc_eoi(struct irq_data *d) raw_spin_lock(&priv->lock); if (hw_irq >=3D IRQC_IRQ_START && hw_irq <=3D IRQC_IRQ_COUNT) rzg2l_clear_irq_int(priv, hw_irq); - else if (hw_irq >=3D IRQC_TINT_START && hw_irq < IRQC_NUM_IRQ) + else if (hw_irq >=3D IRQC_TINT_START && hw_irq < priv->info->num_irq) rzg2l_clear_tint_int(priv, hw_irq); raw_spin_unlock(&priv->lock); irq_chip_eoi_parent(d); @@ -182,7 +191,7 @@ static void rzfive_irqc_mask(struct irq_data *d) raw_spin_lock(&priv->lock); if (hwirq >=3D IRQC_IRQ_START && hwirq <=3D IRQC_IRQ_COUNT) rzfive_irqc_mask_irq_interrupt(priv, hwirq); - else if (hwirq >=3D IRQC_TINT_START && hwirq < IRQC_NUM_IRQ) + else if (hwirq >=3D IRQC_TINT_START && hwirq < priv->info->num_irq) rzfive_irqc_mask_tint_interrupt(priv, hwirq); raw_spin_unlock(&priv->lock); irq_chip_mask_parent(d); @@ -196,7 +205,7 @@ static void rzfive_irqc_unmask(struct irq_data *d) raw_spin_lock(&priv->lock); if (hwirq >=3D IRQC_IRQ_START && hwirq <=3D IRQC_IRQ_COUNT) rzfive_irqc_unmask_irq_interrupt(priv, hwirq); - else if (hwirq >=3D IRQC_TINT_START && hwirq < IRQC_NUM_IRQ) + else if (hwirq >=3D IRQC_TINT_START && hwirq < priv->info->num_irq) rzfive_irqc_unmask_tint_interrupt(priv, hwirq); raw_spin_unlock(&priv->lock); irq_chip_unmask_parent(d); @@ -207,7 +216,7 @@ static void rzfive_tint_irq_endisable(struct irq_data *= d, bool enable) struct rzg2l_irqc_priv *priv =3D irq_data_to_priv(d); unsigned int hwirq =3D irqd_to_hwirq(d); =20 - if (hwirq >=3D IRQC_TINT_START && hwirq < IRQC_NUM_IRQ) { + if (hwirq >=3D IRQC_TINT_START && hwirq < priv->info->num_irq) { u32 offset =3D hwirq - IRQC_TINT_START; u32 tssr_offset =3D TSSR_OFFSET(offset); u8 tssr_index =3D TSSR_INDEX(offset); @@ -249,9 +258,10 @@ static void rzfive_irqc_irq_enable(struct irq_data *d) =20 static void rzg2l_tint_irq_endisable(struct irq_data *d, bool enable) { + struct rzg2l_irqc_priv *priv =3D irq_data_to_priv(d); unsigned int hw_irq =3D irqd_to_hwirq(d); =20 - if (hw_irq >=3D IRQC_TINT_START && hw_irq < IRQC_NUM_IRQ) { + if (hw_irq >=3D IRQC_TINT_START && hw_irq < priv->info->num_irq) { struct rzg2l_irqc_priv *priv =3D irq_data_to_priv(d); u32 offset =3D hw_irq - IRQC_TINT_START; u32 tssr_offset =3D TSSR_OFFSET(offset); @@ -385,12 +395,13 @@ static int rzg2l_tint_set_edge(struct irq_data *d, un= signed int type) =20 static int rzg2l_irqc_set_type(struct irq_data *d, unsigned int type) { + struct rzg2l_irqc_priv *priv =3D irq_data_to_priv(d); unsigned int hw_irq =3D irqd_to_hwirq(d); int ret =3D -EINVAL; =20 if (hw_irq >=3D IRQC_IRQ_START && hw_irq <=3D IRQC_IRQ_COUNT) ret =3D rzg2l_irq_set_type(d, type); - else if (hw_irq >=3D IRQC_TINT_START && hw_irq < IRQC_NUM_IRQ) + else if (hw_irq >=3D IRQC_TINT_START && hw_irq < priv->info->num_irq) ret =3D rzg2l_tint_set_edge(d, type); if (ret) return ret; @@ -496,7 +507,7 @@ static int rzg2l_irqc_alloc(struct irq_domain *domain, = unsigned int virq, return -EINVAL; } =20 - if (hwirq > (IRQC_NUM_IRQ - 1)) + if (hwirq > (priv->info->num_irq - 1)) return -EINVAL; =20 ret =3D irq_domain_set_hwirq_and_chip(domain, virq, hwirq, priv->irqchip, @@ -520,7 +531,7 @@ static int rzg2l_irqc_parse_interrupts(struct rzg2l_irq= c_priv *priv, unsigned int i; int ret; =20 - for (i =3D 0; i < IRQC_NUM_IRQ; i++) { + for (i =3D 0; i < priv->info->num_irq; i++) { ret =3D of_irq_parse_one(np, i, &map); if (ret) return ret; @@ -532,7 +543,8 @@ static int rzg2l_irqc_parse_interrupts(struct rzg2l_irq= c_priv *priv, } =20 static int rzg2l_irqc_common_probe(struct platform_device *pdev, struct de= vice_node *parent, - const struct irq_chip *irq_chip) + const struct irq_chip *irq_chip, + const struct rzg2l_hw_info *info) { struct irq_domain *irq_domain, *parent_domain; struct device_node *node =3D pdev->dev.of_node; @@ -554,7 +566,9 @@ static int rzg2l_irqc_common_probe(struct platform_devi= ce *pdev, struct device_n if (IS_ERR(rzg2l_irqc_data->base)) return PTR_ERR(rzg2l_irqc_data->base); =20 - rzg2l_irqc_data->fwspec =3D devm_kcalloc(&pdev->dev, IRQC_NUM_IRQ, + rzg2l_irqc_data->info =3D info; + + rzg2l_irqc_data->fwspec =3D devm_kcalloc(&pdev->dev, info->num_irq, sizeof(*rzg2l_irqc_data->fwspec), GFP_KERNEL); if (!rzg2l_irqc_data->fwspec) return -ENOMEM; @@ -579,7 +593,7 @@ static int rzg2l_irqc_common_probe(struct platform_devi= ce *pdev, struct device_n =20 raw_spin_lock_init(&rzg2l_irqc_data->lock); =20 - irq_domain =3D irq_domain_create_hierarchy(parent_domain, 0, IRQC_NUM_IRQ= , dev_fwnode(dev), + irq_domain =3D irq_domain_create_hierarchy(parent_domain, 0, info->num_ir= q, dev_fwnode(dev), &rzg2l_irqc_domain_ops, rzg2l_irqc_data); if (!irq_domain) { pm_runtime_put(dev); @@ -591,14 +605,18 @@ static int rzg2l_irqc_common_probe(struct platform_de= vice *pdev, struct device_n return 0; } =20 +static const struct rzg2l_hw_info rzg2l_hw_params =3D { + .num_irq =3D IRQC_IRQ_START + IRQC_IRQ_COUNT + IRQC_TINT_COUNT, +}; + static int rzg2l_irqc_probe(struct platform_device *pdev, struct device_no= de *parent) { - return rzg2l_irqc_common_probe(pdev, parent, &rzg2l_irqc_chip); + return rzg2l_irqc_common_probe(pdev, parent, &rzg2l_irqc_chip, &rzg2l_hw_= params); } =20 static int rzfive_irqc_probe(struct platform_device *pdev, struct device_n= ode *parent) { - return rzg2l_irqc_common_probe(pdev, parent, &rzfive_irqc_chip); + return rzg2l_irqc_common_probe(pdev, parent, &rzfive_irqc_chip, &rzg2l_hw= _params); } =20 IRQCHIP_PLATFORM_DRIVER_BEGIN(rzg2l_irqc) --=20 2.43.0 From nobody Mon Feb 9 05:42:36 2026 Received: from mail-ej1-f43.google.com (mail-ej1-f43.google.com [209.85.218.43]) (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 0D773413226 for ; Wed, 4 Feb 2026 14:23:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770215007; cv=none; b=Riazf22QC8zQaEo1Tl00pz/ExB/jl12Q0jfQLBIro961FkoSOMkAXpxtM656QOp8wb9BzZdRWbkY12tdzqgl0ppfDefOWIhW+2SHbVEjW8EZ16hiVnXkeHzUVT2AQNhL4pSiHFibYSxwhJ4d4Ni4zLtx+i30l0AKr4bnkteBy88= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770215007; c=relaxed/simple; bh=MSRFo2crIcOJkaH4o2xo/M8idc65w/dU332G575LEgE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=eIcf2YRiCGAgzr7pJ1+7e+UInMFrnvOme8GVEQ2GfYOAaoLUU3rqtqHLKAEnJ1h3Y5x1agKbR6827FNkIdOWeHqSgB5oI5hYSmFudhI6cZfK8zudo+VwxBZ9jwXNV26JKylAOdVZEvfrPg4vxpaFhDG4EvwgNawOmK4iN4tDCb0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=bLRyBmYL; arc=none smtp.client-ip=209.85.218.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="bLRyBmYL" Received: by mail-ej1-f43.google.com with SMTP id a640c23a62f3a-b86ed375d37so922822666b.3 for ; Wed, 04 Feb 2026 06:23:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1770215005; x=1770819805; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=pvf/j5r3fxogIJNtwMp54ndm6avrMEeWBQ2S4kb33Lg=; b=bLRyBmYLowedJIDWx9XdvHO3tbgwtH00Z+VmZpTPfPPbWDsDKvWIIWPdsUdzFDCd3C ME1YEeH4O5oLuzqBjGXfhanS9hcK+ZQh/uIr9Pd97Gpe1PpZ6I99PhagRThp3Cw6rP1k Zsj49tA3P4x6TSiu1gxGB+qjQ3uvknW0sj/dfVpBFwOkZtqTLKOnKVi+Kr8ROySGoZgr W9ue2BxzMWTmOyCC2BipE2DJUhqi0T0Q4RB2AqX5VcoHLhZfWDgrKhQBhCldyxVfXVR2 UQa/EMNHHeADfXIpJBzDZsrpXsctlyoeqmjMlworiCHk6ECkBWY7OJ1k7MrWco3hCY2T vEqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770215005; x=1770819805; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=pvf/j5r3fxogIJNtwMp54ndm6avrMEeWBQ2S4kb33Lg=; b=qS9yYRM1oytIvKuQpCM8piujHcwHZPJQ7rs8JHnl79DW4MBh8HtOAcrOwt9p4QVXvO nSLQJ4rXbrno+NlOUe8Lx9pEC5qj5IbiBRqebSH7NEIdl1hH+8gRO3GSWv2432ktgGg/ dWI6G5IMFUOxgVQLAc83OcwcQge1wWw16qDSxRTgIhaUFn8/dh+5lQR5pcvIN5CxYAxg +9m3QZpU7gKWCqeyxRMCKTuQPA0u1r1Rz7E0eV1gDQZ3zZ2W191SG8oC3+ap1D8MF4b5 K7h9G90sfv8THEGBcbhIu8QYqjr1Z305zRYZa+q0LLhem9uJTmljY98zO/7M1YYBU4o3 Y8dw== X-Forwarded-Encrypted: i=1; AJvYcCXCuarpVLfmauh5QLZ4aGckA+Pq5r0rn9mIJfdCOmzPsqMQnbaj1zDEwcsq2LNAHbV2vtJXimgG7BykSd8=@vger.kernel.org X-Gm-Message-State: AOJu0Yxh297MRZ//TdqUB2fXxbobpN+0gN7cr5g2pNaCK4U4METr1e/N YiXV0qeetzqZ+7nKaq+8/Hwv7Kj4bOewxxGybk15tVC2nEQFR6Q+GRcu X-Gm-Gg: AZuq6aLECA+YJIfCmRrbiRZ8oamhORdx5d5tweNKsqT7KKRFNRYoyXNh2KU4sVMpjTI EKm1FQvJAe89XXrJfcREAVRuY+YYqk0Y6dWItrx7f1znMvMEHBi1NGgO6XYL+oBObkDm6I9V7dQ YVg11qLQFPd5rulBlqmFyL71dWUnXbeFHS8cKh/67truDhbCPxAue+NHq5RkHhrQo3hzXe0JwQc BghbBREtrdfi9nPdqQ5LUeFPiinsOpR1aU4N9gTo3NwDhQdOn7AqkPOCjkkfVPOREo0aLdDMFBt 2botJxjOwDKZ788QS9vrcC5hi+fLiDitD7XJjXuPo8+KOPE8i7LY4PcF4ZDIVT0x6bnLSy/FOQ0 pLVaWiBiZwBEuL5VrPUnjXIrggIyYDt7HkPWYfZ96xrhkAQPlqlysWWXnVXXcUjAZibitu0M8Js bcEoXcZtnYTcEjpcDThGD0jQmUSmuoEUoYRL0= X-Received: by 2002:a17:907:d78b:b0:b87:1669:de1a with SMTP id a640c23a62f3a-b8e9f35d918mr216902266b.64.1770215005288; Wed, 04 Feb 2026 06:23:25 -0800 (PST) Received: from localhost.localdomain ([2a00:23c4:a758:8a01:3c9f:a100:4d45:ebc7]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b8ea001ea7dsm129038366b.47.2026.02.04.06.23.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Feb 2026 06:23:25 -0800 (PST) From: Biju X-Google-Original-From: Biju To: Thomas Gleixner Cc: Biju Das , linux-kernel@vger.kernel.org, Geert Uytterhoeven , Prabhakar Mahadev Lad , Biju Das , linux-renesas-soc@vger.kernel.org Subject: [PATCH 4/8] irqchip/renesas-rzg2l: Drop IRQC_TINT_START macro Date: Wed, 4 Feb 2026 14:23:12 +0000 Message-ID: <20260204142320.103184-5-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260204142320.103184-1-biju.das.jz@bp.renesas.com> References: <20260204142320.103184-1-biju.das.jz@bp.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" From: Biju Das The IRQC_TINT_START value is different for RZ/G3L and RZ/G2L SoC. Add tint_start variable in struct rzg2l_hw_info to handle this differences and drop the macro IRQC_TINT_START. Signed-off-by: Biju Das --- drivers/irqchip/irq-renesas-rzg2l.c | 30 +++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/drivers/irqchip/irq-renesas-rzg2l.c b/drivers/irqchip/irq-rene= sas-rzg2l.c index cd9909a85280..e5393306f610 100644 --- a/drivers/irqchip/irq-renesas-rzg2l.c +++ b/drivers/irqchip/irq-renesas-rzg2l.c @@ -22,7 +22,6 @@ =20 #define IRQC_IRQ_START 1 #define IRQC_IRQ_COUNT 8 -#define IRQC_TINT_START (IRQC_IRQ_START + IRQC_IRQ_COUNT) #define IRQC_TINT_COUNT 32 =20 #define ISCR 0x10 @@ -69,9 +68,11 @@ struct rzg2l_irqc_reg_cache { =20 /** * struct rzg2l_hw_info - Interrupt Control Unit controller hardware info = structure. + * @tint_start: Start of TINT interrupts * @num_irq: Total Number of interrupts */ struct rzg2l_hw_info { + u8 tint_start; u8 num_irq; }; =20 @@ -123,7 +124,7 @@ static void rzg2l_clear_irq_int(struct rzg2l_irqc_priv = *priv, unsigned int hwirq =20 static void rzg2l_clear_tint_int(struct rzg2l_irqc_priv *priv, unsigned in= t hwirq) { - u32 bit =3D BIT(hwirq - IRQC_TINT_START); + u32 bit =3D BIT(hwirq - priv->info->tint_start); u32 reg; =20 reg =3D readl_relaxed(priv->base + TSCR); @@ -145,7 +146,7 @@ static void rzg2l_irqc_eoi(struct irq_data *d) raw_spin_lock(&priv->lock); if (hw_irq >=3D IRQC_IRQ_START && hw_irq <=3D IRQC_IRQ_COUNT) rzg2l_clear_irq_int(priv, hw_irq); - else if (hw_irq >=3D IRQC_TINT_START && hw_irq < priv->info->num_irq) + else if (hw_irq >=3D priv->info->tint_start && hw_irq < priv->info->num_i= rq) rzg2l_clear_tint_int(priv, hw_irq); raw_spin_unlock(&priv->lock); irq_chip_eoi_parent(d); @@ -170,7 +171,7 @@ static void rzfive_irqc_unmask_irq_interrupt(struct rzg= 2l_irqc_priv *priv, static void rzfive_irqc_mask_tint_interrupt(struct rzg2l_irqc_priv *priv, unsigned int hwirq) { - u32 bit =3D BIT(hwirq - IRQC_TINT_START); + u32 bit =3D BIT(hwirq - priv->info->tint_start); =20 writel_relaxed(readl_relaxed(priv->base + TMSK) | bit, priv->base + TMSK); } @@ -178,7 +179,7 @@ static void rzfive_irqc_mask_tint_interrupt(struct rzg2= l_irqc_priv *priv, static void rzfive_irqc_unmask_tint_interrupt(struct rzg2l_irqc_priv *priv, unsigned int hwirq) { - u32 bit =3D BIT(hwirq - IRQC_TINT_START); + u32 bit =3D BIT(hwirq - priv->info->tint_start); =20 writel_relaxed(readl_relaxed(priv->base + TMSK) & ~bit, priv->base + TMSK= ); } @@ -191,7 +192,7 @@ static void rzfive_irqc_mask(struct irq_data *d) raw_spin_lock(&priv->lock); if (hwirq >=3D IRQC_IRQ_START && hwirq <=3D IRQC_IRQ_COUNT) rzfive_irqc_mask_irq_interrupt(priv, hwirq); - else if (hwirq >=3D IRQC_TINT_START && hwirq < priv->info->num_irq) + else if (hwirq >=3D priv->info->tint_start && hwirq < priv->info->num_irq) rzfive_irqc_mask_tint_interrupt(priv, hwirq); raw_spin_unlock(&priv->lock); irq_chip_mask_parent(d); @@ -205,7 +206,7 @@ static void rzfive_irqc_unmask(struct irq_data *d) raw_spin_lock(&priv->lock); if (hwirq >=3D IRQC_IRQ_START && hwirq <=3D IRQC_IRQ_COUNT) rzfive_irqc_unmask_irq_interrupt(priv, hwirq); - else if (hwirq >=3D IRQC_TINT_START && hwirq < priv->info->num_irq) + else if (hwirq >=3D priv->info->tint_start && hwirq < priv->info->num_irq) rzfive_irqc_unmask_tint_interrupt(priv, hwirq); raw_spin_unlock(&priv->lock); irq_chip_unmask_parent(d); @@ -216,8 +217,8 @@ static void rzfive_tint_irq_endisable(struct irq_data *= d, bool enable) struct rzg2l_irqc_priv *priv =3D irq_data_to_priv(d); unsigned int hwirq =3D irqd_to_hwirq(d); =20 - if (hwirq >=3D IRQC_TINT_START && hwirq < priv->info->num_irq) { - u32 offset =3D hwirq - IRQC_TINT_START; + if (hwirq >=3D priv->info->tint_start && hwirq < priv->info->num_irq) { + u32 offset =3D hwirq - priv->info->tint_start; u32 tssr_offset =3D TSSR_OFFSET(offset); u8 tssr_index =3D TSSR_INDEX(offset); u32 reg; @@ -261,9 +262,9 @@ static void rzg2l_tint_irq_endisable(struct irq_data *d= , bool enable) struct rzg2l_irqc_priv *priv =3D irq_data_to_priv(d); unsigned int hw_irq =3D irqd_to_hwirq(d); =20 - if (hw_irq >=3D IRQC_TINT_START && hw_irq < priv->info->num_irq) { + if (hw_irq >=3D priv->info->tint_start && hw_irq < priv->info->num_irq) { struct rzg2l_irqc_priv *priv =3D irq_data_to_priv(d); - u32 offset =3D hw_irq - IRQC_TINT_START; + u32 offset =3D hw_irq - priv->info->tint_start; u32 tssr_offset =3D TSSR_OFFSET(offset); u8 tssr_index =3D TSSR_INDEX(offset); u32 reg; @@ -354,7 +355,7 @@ static int rzg2l_tint_set_edge(struct irq_data *d, unsi= gned int type) { struct rzg2l_irqc_priv *priv =3D irq_data_to_priv(d); unsigned int hwirq =3D irqd_to_hwirq(d); - u32 titseln =3D hwirq - IRQC_TINT_START; + u32 titseln =3D hwirq - priv->info->tint_start; u32 tssr_offset =3D TSSR_OFFSET(titseln); u8 tssr_index =3D TSSR_INDEX(titseln); u8 index, sense; @@ -401,7 +402,7 @@ static int rzg2l_irqc_set_type(struct irq_data *d, unsi= gned int type) =20 if (hw_irq >=3D IRQC_IRQ_START && hw_irq <=3D IRQC_IRQ_COUNT) ret =3D rzg2l_irq_set_type(d, type); - else if (hw_irq >=3D IRQC_TINT_START && hw_irq < priv->info->num_irq) + else if (hw_irq >=3D priv->info->tint_start && hw_irq < priv->info->num_i= rq) ret =3D rzg2l_tint_set_edge(d, type); if (ret) return ret; @@ -503,7 +504,7 @@ static int rzg2l_irqc_alloc(struct irq_domain *domain, = unsigned int virq, tint =3D TINT_EXTRACT_GPIOINT(hwirq); hwirq =3D TINT_EXTRACT_HWIRQ(hwirq); =20 - if (hwirq < IRQC_TINT_START) + if (hwirq < priv->info->tint_start) return -EINVAL; } =20 @@ -606,6 +607,7 @@ static int rzg2l_irqc_common_probe(struct platform_devi= ce *pdev, struct device_n } =20 static const struct rzg2l_hw_info rzg2l_hw_params =3D { + .tint_start =3D IRQC_IRQ_START + IRQC_IRQ_COUNT, .num_irq =3D IRQC_IRQ_START + IRQC_IRQ_COUNT + IRQC_TINT_COUNT, }; =20 --=20 2.43.0 From nobody Mon Feb 9 05:42:36 2026 Received: from mail-ej1-f46.google.com (mail-ej1-f46.google.com [209.85.218.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 F1561413249 for ; Wed, 4 Feb 2026 14:23:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770215008; cv=none; b=MQaSRbCjmeEBMOPAgsxbO44zfZnTRlRGUG7an+9xfYXKIU/Bgf6OiPJjKShZoPpBS0z3Hj0h3DZsYzY3syM9/4dkvDzRSSUsSmEffaRzaRhYHlIaTNcVOyyrRE/IKPmz7b9XjDrolmnAeWLCZUiCCMeXm2gV+ZcIAvxroPS9rOE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770215008; c=relaxed/simple; bh=5AmNmV/7OYEj3hbgv7UTssLtDFytyjII7T5RP/pQtzs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=cQhi5+QW/lEr9LbiWuidp2ghySQKw8SA3+2WpExJbh47CdrjE8nK9jab0cYy3MIBU3g6HRmJUW1DNJs4H2wLHKcfzxeJJQ0E37cLUMLTxAdFo6Nf6KKhIDPkUykozskC6cfp6w+6TPnhwS1x5qPHdvCyl31FPq67NcNoCCjZYGo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=F28la7Ey; arc=none smtp.client-ip=209.85.218.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="F28la7Ey" Received: by mail-ej1-f46.google.com with SMTP id a640c23a62f3a-b8876d1a39bso981143066b.1 for ; Wed, 04 Feb 2026 06:23:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1770215006; x=1770819806; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=zFfVv3K0yLen35ya4HYpO7XKBGusBRurN2Ils5L40xg=; b=F28la7Ey4YPDuW2eePC138K6lmvGQf2fXxk0wm/zJZWRL//TE4PwtLECBELOCUdw5W ykGLRQc5fLSwgFoUMJGKaaKNf5Qlh6ZftILiL7n0LGuSdKoeTIN8pXeVkF5kEPjw8WeG sYEQLlWAlcSwIJf2Jxo1ENEd33Vr/bHOARLArFpHIztUycQWYC5BrqBkIoeEgmHpKod9 3nszzv101XFgZSJOLmix5EdM7nwE9GRN7jA1oFUheJunie8SoqOyg0xi2XNP2b3vkd74 UiBBeHRJMonjc9LXlMvyhduAt8luteqbzVXQxqEwnGu3Lqufb+be39D4YY3Wj7AbU89D qBPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770215006; x=1770819806; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=zFfVv3K0yLen35ya4HYpO7XKBGusBRurN2Ils5L40xg=; b=cfW6LPBCmFb3NMOVjom6oxjKmWTHsynVaww/xO8+kmbvtUD0KCIMoE/pRT3vxVEgtD ynYcmbLuQhKRqCoL2K5agX1PHQmRvbkfVUN4YZib88MCXNpZ5o0sPgX/rzfu0Xq/p0ju /60WA2NJqBpAzSRU4zRpLetKqrYSD6A0HxK75A3Am2pfBCsOvf72rpvhanzBV9zwys9V CPRa6FyFcUgRt4TeL2jj2tIFCkR3TZ4BIyP8IHYL096DxT+6QCOnuYxUPVyf3iC2Jn7L ZbiOFyimCYYOTMVRF8yEXguatbvP3SZlAgIOUWa4tFrjGcgqQHAVVaR4dzSv8SnaKstC iVBQ== X-Forwarded-Encrypted: i=1; AJvYcCUrYjm2fwMTj6vtxbSLi+RJuvF4umBOx37e9mlhFJtl3DX+DFz+KjPnNJWk4FI4LEoNYUqFcuDqyeR2RNo=@vger.kernel.org X-Gm-Message-State: AOJu0Yw6xL/J3Jbz0r5aQiwS+1EbUmAr4SL2P00vYkMWNrZ7LdPM1B9x FoAwEHpvT662FTXEpZiCOuM7x2K8l4Xv0/VNue4Pr1lybDVX1Wvz7kpc X-Gm-Gg: AZuq6aKEWFHdh06JcAarl5P7Pc43Z2jIRlvfjZyvFOf/iSSgY35LbvCTnmVnhX17TKh xIuvzKE+R6NZfU/HmSwLsKGQhMhznN5R1mW0klulxySoX71kbt+hFHLyDSbVlyL+3PxPK0tR0vC N5f3FtXdOIWIEQ4ba7eOdGMZrsOAaTEQTE1y5TphrNKtuw3MEheby6OwnQmvWF71EXNSx2Ter28 FBjxB7piphIVQ3lID9o26EigAaRTURH/1YF+XSjopPOugRnKi4miOgt1p6BAwE501aP5Jcxlsha G01WLY1dgRJMoLAHtHCNQ5eGfcvG/OJuW3h67aDZGsAdLkDUy0z6C/5lNgmmvTjwVYwk/IZ6qhe JeNa0sDEz+94mYHLwmKRP95uiD/bNs1wJNZbDT7Y03cSj2bSMoDAdzLUkSS73AFwh6Ua/r87dmx hGlNhQmjLv+cRUa0Po+bupsvc7w8JBWS8R39s= X-Received: by 2002:a17:907:9308:b0:b76:7f64:77a5 with SMTP id a640c23a62f3a-b8e9f0b5c95mr224255166b.20.1770215005812; Wed, 04 Feb 2026 06:23:25 -0800 (PST) Received: from localhost.localdomain ([2a00:23c4:a758:8a01:3c9f:a100:4d45:ebc7]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b8ea001ea7dsm129038366b.47.2026.02.04.06.23.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Feb 2026 06:23:25 -0800 (PST) From: Biju X-Google-Original-From: Biju To: Thomas Gleixner Cc: Biju Das , linux-kernel@vger.kernel.org, Geert Uytterhoeven , Prabhakar Mahadev Lad , Biju Das , linux-renesas-soc@vger.kernel.org Subject: [PATCH 5/8] irqchip/renesas-rzg2l: Drop IRQC_IRQ_COUNT macro Date: Wed, 4 Feb 2026 14:23:13 +0000 Message-ID: <20260204142320.103184-6-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260204142320.103184-1-biju.das.jz@bp.renesas.com> References: <20260204142320.103184-1-biju.das.jz@bp.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" From: Biju Das The total number of External IRQs in RZ/G2L and RZ/G3L SoC are different. The RZ/G3L has 16 external IRQs where as RZ/G2L has only 8 external IRQ. Add irq_count variable in struct rzg2l_hw_info to handle this differences and drop the macro IRQC_IRQ_COUNT. Signed-off-by: Biju Das --- drivers/irqchip/irq-renesas-rzg2l.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/drivers/irqchip/irq-renesas-rzg2l.c b/drivers/irqchip/irq-rene= sas-rzg2l.c index e5393306f610..0de7db45d4c8 100644 --- a/drivers/irqchip/irq-renesas-rzg2l.c +++ b/drivers/irqchip/irq-renesas-rzg2l.c @@ -21,7 +21,6 @@ #include =20 #define IRQC_IRQ_START 1 -#define IRQC_IRQ_COUNT 8 #define IRQC_TINT_COUNT 32 =20 #define ISCR 0x10 @@ -68,10 +67,12 @@ struct rzg2l_irqc_reg_cache { =20 /** * struct rzg2l_hw_info - Interrupt Control Unit controller hardware info = structure. + * @irq_count: Number of IRQC interrupts * @tint_start: Start of TINT interrupts * @num_irq: Total Number of interrupts */ struct rzg2l_hw_info { + u8 irq_count; u8 tint_start; u8 num_irq; }; @@ -144,7 +145,7 @@ static void rzg2l_irqc_eoi(struct irq_data *d) unsigned int hw_irq =3D irqd_to_hwirq(d); =20 raw_spin_lock(&priv->lock); - if (hw_irq >=3D IRQC_IRQ_START && hw_irq <=3D IRQC_IRQ_COUNT) + if (hw_irq >=3D IRQC_IRQ_START && hw_irq <=3D priv->info->irq_count) rzg2l_clear_irq_int(priv, hw_irq); else if (hw_irq >=3D priv->info->tint_start && hw_irq < priv->info->num_i= rq) rzg2l_clear_tint_int(priv, hw_irq); @@ -190,7 +191,7 @@ static void rzfive_irqc_mask(struct irq_data *d) unsigned int hwirq =3D irqd_to_hwirq(d); =20 raw_spin_lock(&priv->lock); - if (hwirq >=3D IRQC_IRQ_START && hwirq <=3D IRQC_IRQ_COUNT) + if (hwirq >=3D IRQC_IRQ_START && hwirq <=3D priv->info->irq_count) rzfive_irqc_mask_irq_interrupt(priv, hwirq); else if (hwirq >=3D priv->info->tint_start && hwirq < priv->info->num_irq) rzfive_irqc_mask_tint_interrupt(priv, hwirq); @@ -204,7 +205,7 @@ static void rzfive_irqc_unmask(struct irq_data *d) unsigned int hwirq =3D irqd_to_hwirq(d); =20 raw_spin_lock(&priv->lock); - if (hwirq >=3D IRQC_IRQ_START && hwirq <=3D IRQC_IRQ_COUNT) + if (hwirq >=3D IRQC_IRQ_START && hwirq <=3D priv->info->irq_count) rzfive_irqc_unmask_irq_interrupt(priv, hwirq); else if (hwirq >=3D priv->info->tint_start && hwirq < priv->info->num_irq) rzfive_irqc_unmask_tint_interrupt(priv, hwirq); @@ -400,7 +401,7 @@ static int rzg2l_irqc_set_type(struct irq_data *d, unsi= gned int type) unsigned int hw_irq =3D irqd_to_hwirq(d); int ret =3D -EINVAL; =20 - if (hw_irq >=3D IRQC_IRQ_START && hw_irq <=3D IRQC_IRQ_COUNT) + if (hw_irq >=3D IRQC_IRQ_START && hw_irq <=3D priv->info->irq_count) ret =3D rzg2l_irq_set_type(d, type); else if (hw_irq >=3D priv->info->tint_start && hw_irq < priv->info->num_i= rq) ret =3D rzg2l_tint_set_edge(d, type); @@ -500,7 +501,7 @@ static int rzg2l_irqc_alloc(struct irq_domain *domain, = unsigned int virq, * from 16-31 bits. TINT from the pinctrl driver needs to be programmed * in IRQC registers to enable a given gpio pin as interrupt. */ - if (hwirq > IRQC_IRQ_COUNT) { + if (hwirq > priv->info->irq_count) { tint =3D TINT_EXTRACT_GPIOINT(hwirq); hwirq =3D TINT_EXTRACT_HWIRQ(hwirq); =20 @@ -607,8 +608,9 @@ static int rzg2l_irqc_common_probe(struct platform_devi= ce *pdev, struct device_n } =20 static const struct rzg2l_hw_info rzg2l_hw_params =3D { - .tint_start =3D IRQC_IRQ_START + IRQC_IRQ_COUNT, - .num_irq =3D IRQC_IRQ_START + IRQC_IRQ_COUNT + IRQC_TINT_COUNT, + .irq_count =3D 8, + .tint_start =3D IRQC_IRQ_START + 8, + .num_irq =3D IRQC_IRQ_START + 8 + IRQC_TINT_COUNT, }; =20 static int rzg2l_irqc_probe(struct platform_device *pdev, struct device_no= de *parent) --=20 2.43.0 From nobody Mon Feb 9 05:42:36 2026 Received: from mail-ed1-f52.google.com (mail-ed1-f52.google.com [209.85.208.52]) (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 7F959413254 for ; Wed, 4 Feb 2026 14:23:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770215008; cv=none; b=J2wV86MVmJCWbaLT4gpLN6wsLz5rWOLwMdH8UZR9cB7dMRqWebkTn+2PNOecNc3RmzI1OXugWEbwKfkbTILGsQankQb+ZQeFp2wRNdon/FcXNciFSQIRzOsVFhygX7qU6gdZSPqohWBfO5E3BewZybU2L+yJ+RDoJWngMxBRzZY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770215008; c=relaxed/simple; bh=KPVJTRz0ucSseFkmTa0BS3za7U+/6HbVZcxV1WMT/20=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=azMpKHuRKywXsqHC1W1lsahXUPE18vZbwwPsvBcEXB/x3MUCl0LMnLRZZWm81wvKhBWYHHqwGYWuj0jBX0jCbncNgYK2k6HCcjHsYIHBjnRfbPDo1FyjNLCUU0K/WeaBg+HQ9aeLX/P2QXWGzHCNU9v24i0ojnL+0y8VkySdGwQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=lXkYXGNt; arc=none smtp.client-ip=209.85.208.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="lXkYXGNt" Received: by mail-ed1-f52.google.com with SMTP id 4fb4d7f45d1cf-658034ce0e3so10884779a12.3 for ; Wed, 04 Feb 2026 06:23:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1770215007; x=1770819807; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=7PClPLuzQLIiCREY9O1ZTBwMqo8hf+l9T87+sxH7Xy8=; b=lXkYXGNt+uFLb/XNY+Ywz0dckOTZKQeK45bG1sa0GGwmz8tl8cGfxsSBUziFvciasY 73EDr0orVCXrt3xRy2hig9yJabAE4d4tqKHHXq4JkttGMRSe5XRJu0M79e02lRgz4+tn jQLgnUugZme0gKj8vaKNCu2hmoboCMMgXtDtVpZj6EEsPv6qxdKH8Nr7Xp6l0jnh3GOX aHSIC/cNp9I/iIWgHNVA1M1Oy/7PS53TTPaKgks5VZ4HMZ7Rg34nurrVb7YEHj6piUMy rIk0H/krdSi6k8Kn2geMRcgFLOipXTzkyoO6HAqxzN/CCyP/vbM+rPxtUec5319t4mod tOaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770215007; x=1770819807; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=7PClPLuzQLIiCREY9O1ZTBwMqo8hf+l9T87+sxH7Xy8=; b=HUs9QZoyY3WnUnLOEEsSd9X93GTODFhG7fAKUoUiVpqFoZw8zuf9HyfJSBkaRjn2yO hKBTh2NMEqa4vpIF0bPZKzBl8Oy0j6XADlwP9aMqrK8gRzmznKSLOzE9ZCeJLr5qFIxZ j0dx2aM4tNfGJ2thXtQGTTj/Uf2cr6CozAM2nKdf8FOcAUZ/zH3cxoOEEpfJV6dHhxXt JoPQWeOKYH2UzDLXHKnPEOs9/FJ4t4bg8341dbt90n2xyZVIZ0Bxm6AAqMPmv7sTOPrX jtMbfMRxAlywdyMlQ5WRXT7UCuZhFefrFJiGnY8mHKsqmXc2Ink6mYsuV0zEUoapUNnE 0Spw== X-Forwarded-Encrypted: i=1; AJvYcCWFxgVBAkQqia/MnrCU26qHaWCsrwyjCLwYqR6Ow4kUTBO7B6Q5QV7PXL0qde73KVi9aPAa9OVpsUhUYcM=@vger.kernel.org X-Gm-Message-State: AOJu0YxyqNkblwwJggzj2wtuYRTv5CfmgsQMjUFHYJWcfeOceWqIjHS9 oPZb+07f6izqZXcbFXWUe42AyCLaoKF7dXU7ptTnsvIooOL8lO8XUcxNWrc4qxAh X-Gm-Gg: AZuq6aLiG0BPshKkQlmz2eAPg1H5JwB6kAycrRP0uXRbkwGoltglVDHSpAauV6yVvIq a138raMmtSSXhJwPEHC1f5hZE9PWxNJTP4ld6m96Zgr8OUGgqtIwrUIOmW0r6WYCTOqU432t65I AWpQKaw9tWN/YSepsiCENoMC5sJywHH5I1hr5lQipvP+CezxNga7FE7mSeTFxN6+8+AkSs1VZ7K H2QBD6GPD55Uhmy608sryMu6UDEQ/cQ+h2anH+0Qi+yw6aaZryW+HesQXAaIrrHVzlIaUNKEEHy PBWIQ00BjucgQEMuTasTuygJj571DZQKUlQZzMePQ+DudZUwdPbOh4VhpltdjC8UrNmQfTSbgCp ydDoxwaRCK8TZs7ysuEioVKuu+p/Z41mcT73RDXGHDXk9idfZomY9XaLdkl7k82xXFFK2bbKOq5 2XjesC81SY/lR72njvDyu89mVgYFwo16HY9U0= X-Received: by 2002:a17:907:d0c:b0:b8e:2a8a:4320 with SMTP id a640c23a62f3a-b8e9f2d8f05mr185302766b.49.1770215006647; Wed, 04 Feb 2026 06:23:26 -0800 (PST) Received: from localhost.localdomain ([2a00:23c4:a758:8a01:3c9f:a100:4d45:ebc7]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b8ea001ea7dsm129038366b.47.2026.02.04.06.23.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Feb 2026 06:23:26 -0800 (PST) From: Biju X-Google-Original-From: Biju To: Thomas Gleixner Cc: Biju Das , linux-kernel@vger.kernel.org, Geert Uytterhoeven , Prabhakar Mahadev Lad , Biju Das , linux-renesas-soc@vger.kernel.org Subject: [PATCH 6/8] irqchip/renesas-rzg2l: Add RZ/G3L support Date: Wed, 4 Feb 2026 14:23:14 +0000 Message-ID: <20260204142320.103184-7-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260204142320.103184-1-biju.das.jz@bp.renesas.com> References: <20260204142320.103184-1-biju.das.jz@bp.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" From: Biju Das The IRQC block on the RZ/G3L SoC is almost identical to the one found on the RZ/G2L SoC, with the following differences: - The number of GPIO interrupts for TINT selection is 113 instead of 123. - The pin index and TINT selection index are not in the 1:1 map. - The number of External IRQ is 16 instead of 8, out of this 8 IRQs are shared with TINT. Add support for the RZ/G3L driver by filling the rzg2l_hw_info table and adding LUT for mapping between pin index and TINT selection index. Signed-off-by: Biju Das --- drivers/irqchip/irq-renesas-rzg2l.c | 47 +++++++++++++++++++++++++++-- 1 file changed, 44 insertions(+), 3 deletions(-) diff --git a/drivers/irqchip/irq-renesas-rzg2l.c b/drivers/irqchip/irq-rene= sas-rzg2l.c index 0de7db45d4c8..06c439c98ff5 100644 --- a/drivers/irqchip/irq-renesas-rzg2l.c +++ b/drivers/irqchip/irq-renesas-rzg2l.c @@ -67,14 +67,16 @@ struct rzg2l_irqc_reg_cache { =20 /** * struct rzg2l_hw_info - Interrupt Control Unit controller hardware info = structure. + * @tssel_lut: TINT lookup table * @irq_count: Number of IRQC interrupts * @tint_start: Start of TINT interrupts * @num_irq: Total Number of interrupts */ struct rzg2l_hw_info { - u8 irq_count; - u8 tint_start; - u8 num_irq; + const u8 *tssel_lut; + u8 irq_count; + u8 tint_start; + u8 num_irq; }; =20 /** @@ -343,6 +345,9 @@ static u32 rzg2l_disable_tint_and_set_tint_source(struc= t irq_data *d, struct rzg u32 tint =3D (u32)(uintptr_t)irq_data_get_irq_chip_data(d); u32 tien =3D reg & (TIEN << TSSEL_SHIFT(tssr_offset)); =20 + if (priv->info->tssel_lut) + tint =3D priv->info->tssel_lut[tint]; + /* Clear the relevant byte in reg */ reg &=3D ~(TSSEL_MASK << TSSEL_SHIFT(tssr_offset)); /* Set TINT and leave TIEN clear */ @@ -607,6 +612,36 @@ static int rzg2l_irqc_common_probe(struct platform_dev= ice *pdev, struct device_n return 0; } =20 +/* Mapping based on port index on Table 4.2-1 and GPIOINT on Table 4.6-7 */ +static const u8 rzg3l_tssel_lut[] =3D { + 83, 84, /* P20-P21 */ + 7, 8, 9, 10, 11, 12, 13, /* P30-P36 */ + 85, 86, 87, 88, 89, 90, 91, /* P50-P56 */ + 92, 93, 94, 95, 96, 97, 98, /* P60-P66 */ + 99, 100, 101, 102, 103, 104, 105, 106, /* P70-P77 */ + 107, 108, 109, 110, 111, 112, /* P80-P85 */ + 45, 46, 47, 48, 49, 50, 51, 52, /* PA0-PA7 */ + 53, 54, 55, 56, 57, 58, 59, 60, /* PB0-PB7 */ + 61, 62, 63, /* PC0-PC2 */ + 64, 65, 66, 67, 68, 69, 70, 71, /* PD0-PD7 */ + 72, 73, 74, 75, 76, 77, 78, 79, /* PE0-PE7 */ + 80, 81, 82, /* PF0-PF2 */ + 27, 28, 29, 30, 31, 32, 33, 34, /* PG0-PG7 */ + 35, 36, 37, 38, 39, 40, /* PH0-PH5 */ + 2, 3, 4, 5, 6, /* PJ0-PJ4 */ + 41, 42, 43, 44, /* PK0-PK3 */ + 14, 15, 16, 17, 26, /* PL0-PL4 */ + 18, 19, 20, 21, 22, 23, 24, 25, /* PM0-PM7 */ + 0, 1 /* PS0-PS1 */ +}; + +static const struct rzg2l_hw_info rzg3l_hw_params =3D { + .tssel_lut =3D rzg3l_tssel_lut, + .irq_count =3D 16, + .tint_start =3D IRQC_IRQ_START + 16, + .num_irq =3D IRQC_IRQ_START + 16 + IRQC_TINT_COUNT, +}; + static const struct rzg2l_hw_info rzg2l_hw_params =3D { .irq_count =3D 8, .tint_start =3D IRQC_IRQ_START + 8, @@ -618,6 +653,11 @@ static int rzg2l_irqc_probe(struct platform_device *pd= ev, struct device_node *pa return rzg2l_irqc_common_probe(pdev, parent, &rzg2l_irqc_chip, &rzg2l_hw_= params); } =20 +static int rzg3l_irqc_probe(struct platform_device *pdev, struct device_no= de *parent) +{ + return rzg2l_irqc_common_probe(pdev, parent, &rzg2l_irqc_chip, &rzg3l_hw_= params); +} + static int rzfive_irqc_probe(struct platform_device *pdev, struct device_n= ode *parent) { return rzg2l_irqc_common_probe(pdev, parent, &rzfive_irqc_chip, &rzg2l_hw= _params); @@ -625,6 +665,7 @@ static int rzfive_irqc_probe(struct platform_device *pd= ev, struct device_node *p =20 IRQCHIP_PLATFORM_DRIVER_BEGIN(rzg2l_irqc) IRQCHIP_MATCH("renesas,rzg2l-irqc", rzg2l_irqc_probe) +IRQCHIP_MATCH("renesas,r9a08g046-irqc", rzg3l_irqc_probe) IRQCHIP_MATCH("renesas,r9a07g043f-irqc", rzfive_irqc_probe) IRQCHIP_PLATFORM_DRIVER_END(rzg2l_irqc) MODULE_AUTHOR("Lad Prabhakar "); --=20 2.43.0 From nobody Mon Feb 9 05:42:36 2026 Received: from mail-ej1-f52.google.com (mail-ej1-f52.google.com [209.85.218.52]) (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 1F831280330 for ; Wed, 4 Feb 2026 14:23:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770215009; cv=none; b=BUXGkyhjX/BbHh0Mxt+0rO2GocvPmg65Oq2nKKjyPx8jaiEjMhWK9apIdj7iDibLU5JWK5ePg0wybnddUy1RmWDkJyC+LfXRJLGSdoInFQ1l9EZoJ//VkBus9USZLSKs+tNX17V+Icwrd/dznNcion9uBnqDyYX2VAZ3BP6wUXs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770215009; c=relaxed/simple; bh=7uZA7LNr7iPsl7XDZ3uueymNvVT1Vu2jXQb+PyBTyuQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WTs6nZZ51S0iSEbtw1S+8pszHSQUosu6pdPOAH6DJwBSO6OHBTr6pBaV89U217cQ5rEpHbRbeOroxRr29AmW5yi7DhaWJEqUMqiDemlchkROTpcd4ROCeBQp84TaaZxG43aWufhsXkSmxXDv2GGEN3ee0+6/cjTvzoEKgMWq3Oc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=C20a6ZDo; arc=none smtp.client-ip=209.85.218.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="C20a6ZDo" Received: by mail-ej1-f52.google.com with SMTP id a640c23a62f3a-b885e8c679bso1080868666b.1 for ; Wed, 04 Feb 2026 06:23:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1770215007; x=1770819807; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=dqD4SOzNdzRZRBlGF2cldwsLifXb9u+irjs2hZVgIzU=; b=C20a6ZDoKnopVCH1GQYS0QSbbo1oCnMzX9RDttoly18534gRLAdDb2QJYxF9rIwVBt fp/e9DhVhjkd1bp3kI75aM4lOpSsWmeo2PwdN+EhqZXAdg112ggrCytn70SpiKbUDXy2 I4/yCOspFMvz0Vf+vDdApWWIqZ2wFlaeUGBvVfUAVuIPm+c4QopXY4c26MBBtJeH2al1 p3al1ZjgsMrZWvTnZ+tGfPT8J1AYS7xIysOdKQCemSkYMyqSO4ScqzQd7G0b3kLYnOR3 /7tw9dX66xS1juQOSM3MecKrNx4iy6CctZXN82eH0M+jY9Vw9bj4xXfsEYJqgPXMYnEd /XfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770215007; x=1770819807; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=dqD4SOzNdzRZRBlGF2cldwsLifXb9u+irjs2hZVgIzU=; b=Jtdg9Ykg++rCo81d8eS8pr2WkUp4xSAR4KsHomv/qVCqXQTtGXZwSRBoJ0x76O/5t5 8slVDXn0rod+LdipdbKPWB242S3WTohXvlHOK8OdAoVuK1bpVCwM/YFu7SGBkKz+s7Ir uDvdldQeY9Xh+HMvLnjYvgBseovzuu32vphEnrxC9o/v8x9IMnM3zLIYCNNRVN1l4k+X +X24C7aPiCttCwq6+cgfduoqdAQYdPDYL7JP+dkXO1554/i5fmoHlXQoFLYxjaJPnLlJ JFS2VovGRFJbm5cwieRLsjOdPH0Z4Gwv9LK8Icoo7CVkPVWMBZJfPO7tYjN1tx9pVnOK czUw== X-Forwarded-Encrypted: i=1; AJvYcCXgN5SIPWF/KkNaXM/SNm70yYpzrGEE8RgLUFnPuBf664Afxdy7tv7KkBY+vaA335I8jb9WvKXoSnloDlE=@vger.kernel.org X-Gm-Message-State: AOJu0Yz/O+aSvABkzZDgNAx4fdI29RIGg/hk5O2HM2LVTC5TAZq6y7F3 /IItCww78j0k0/bz2JI6sk1o1WlqKIm2DjLPQzivXyQP4MbdKLdiRRoeHtMSZ/V9 X-Gm-Gg: AZuq6aI4M65JykApOs1CkiFXrw/mEZqQIU9w83hfQGnLLrUdq1Ho6WJ/sdB9qWxG6Gj tE1pCzQIig3pBtUl3bX0bxr7wJtWrOj8AR254zZpL8b9aTlnw5if2cvt3MYCjX/QiRxlLrnZ2eX kDmjwLnRknjeip/g8ph1Q3LnoR68g4y0x7DlAmbcjtrU6KicBwK30uMD+6cG+FtLwyWjp1zlBsr 9Uo9xWM2MorPtw9ieo3yw6vp+2xZwTnUZlyK07V19g+NlbvtHWCgI9xjuZNa7BFumo5ANPcvq0w llF1ECzQw+V6cDT7ruTUDcDXLSp322c64yff1Obb56JIB1Xp1SbCFgp2ahRBJ3ydS3VT2HsN7Mh zuFO0ZqtM0G1UKNvnDA9/GU4dAmw+v3FefEOE1PlknknDfeMV/HSAD7INQpiDLX82oY6axX3AqO J1XcEcnZ7UBgpNXhP8o2SAwQsLotcGQ+Rzdxo= X-Received: by 2002:a17:906:ee8e:b0:b8e:92e:d30b with SMTP id a640c23a62f3a-b8e9f086a2amr246615366b.21.1770215007210; Wed, 04 Feb 2026 06:23:27 -0800 (PST) Received: from localhost.localdomain ([2a00:23c4:a758:8a01:3c9f:a100:4d45:ebc7]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b8ea001ea7dsm129038366b.47.2026.02.04.06.23.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Feb 2026 06:23:26 -0800 (PST) From: Biju X-Google-Original-From: Biju To: Thomas Gleixner Cc: Biju Das , linux-kernel@vger.kernel.org, Geert Uytterhoeven , Prabhakar Mahadev Lad , Biju Das , linux-renesas-soc@vger.kernel.org Subject: [PATCH 7/8] irqchip/renesas-rzg2l: Add shared irq support Date: Wed, 4 Feb 2026 14:23:15 +0000 Message-ID: <20260204142320.103184-8-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260204142320.103184-1-biju.das.jz@bp.renesas.com> References: <20260204142320.103184-1-biju.das.jz@bp.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" From: Biju Das The total number of External IRQs in RZ/G2L and RZ/G3L SoC are different. The RZ/G3L has 16 external IRQs out of which it shares 8 IRQs with TINT, where as RZ/G2L has only 8 external IRQ. Add shared_irq variable in struct rzg2l_hw_info to handle this differences by adding the callback irq_{request,release}_resources(). Signed-off-by: Biju Das --- drivers/irqchip/irq-renesas-rzg2l.c | 94 +++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) diff --git a/drivers/irqchip/irq-renesas-rzg2l.c b/drivers/irqchip/irq-rene= sas-rzg2l.c index 06c439c98ff5..59108e1d53ec 100644 --- a/drivers/irqchip/irq-renesas-rzg2l.c +++ b/drivers/irqchip/irq-renesas-rzg2l.c @@ -29,6 +29,8 @@ #define TITSR(n) (0x24 + (n) * 4) #define TITSR0_MAX_INT 16 #define TITSEL_WIDTH 0x2 +#define INTTSEL 0x2c +#define TINTSEL(n) BIT(n) #define TSSR(n) (0x30 + ((n) * 4)) #define TIEN BIT(7) #define TSSEL_SHIFT(n) (8 * (n)) @@ -58,10 +60,12 @@ /** * struct rzg2l_irqc_reg_cache - registers cache (necessary for suspend/re= sume) * @iitsr: IITSR register + * @inttsel: INTTSEL register * @titsr: TITSR registers */ struct rzg2l_irqc_reg_cache { u32 iitsr; + u32 inttsel; u32 titsr[2]; }; =20 @@ -71,12 +75,14 @@ struct rzg2l_irqc_reg_cache { * @irq_count: Number of IRQC interrupts * @tint_start: Start of TINT interrupts * @num_irq: Total Number of interrupts + * @shared_irq_cnt: Number of shared interrupts */ struct rzg2l_hw_info { const u8 *tssel_lut; u8 irq_count; u8 tint_start; u8 num_irq; + u8 shared_irq_cnt; }; =20 /** @@ -295,6 +301,87 @@ static void rzg2l_irqc_irq_enable(struct irq_data *d) irq_chip_enable_parent(d); } =20 +static bool rzg2l_irqc_is_shared_irqc(const struct rzg2l_hw_info *info, un= signed int hw_irq) +{ + return ((hw_irq >=3D (info->tint_start - info->shared_irq_cnt)) && + hw_irq < info->tint_start); +} + +static bool rzg2l_irqc_is_shared_tint(const struct rzg2l_hw_info *info, un= signed int hw_irq) +{ + return ((hw_irq >=3D (info->num_irq - info->shared_irq_cnt)) && + hw_irq < info->num_irq); +} + +static int rzg2l_irqc_irq_request_resources(struct irq_data *d) +{ + unsigned int hw_irq =3D irqd_to_hwirq(d); + struct rzg2l_irqc_priv *priv =3D irq_data_to_priv(d); + const struct rzg2l_hw_info *info =3D priv->info; + u32 offset, tssr_offset; + u8 tssr_index, tssel_shift; + u32 reg, inttsel_reg; + u8 value; + + if (!info->shared_irq_cnt) + return 0; + + if (rzg2l_irqc_is_shared_irqc(info, hw_irq)) { + offset =3D hw_irq + IRQC_TINT_COUNT - info->tint_start; + tssr_offset =3D TSSR_OFFSET(offset); + tssr_index =3D TSSR_INDEX(offset); + tssel_shift =3D TSSEL_SHIFT(tssr_offset); + + reg =3D readl_relaxed(priv->base + TSSR(tssr_index)); + value =3D (reg & (TIEN << tssel_shift)) >> tssel_shift; + if (value) + goto err_conflict; + + raw_spin_lock(&priv->lock); + inttsel_reg =3D readl_relaxed(priv->base + INTTSEL); + inttsel_reg |=3D TINTSEL(offset); + writel_relaxed(inttsel_reg, priv->base + INTTSEL); + raw_spin_unlock(&priv->lock); + } else if (rzg2l_irqc_is_shared_tint(info, hw_irq)) { + offset =3D hw_irq - info->tint_start; + tssr_offset =3D TSSR_OFFSET(offset); + tssr_index =3D TSSR_INDEX(offset); + + inttsel_reg =3D readl_relaxed(priv->base + INTTSEL); + value =3D (inttsel_reg & TINTSEL(offset)) >> offset; + if (value) + goto err_conflict; + } + + return 0; + +err_conflict: + pr_err("%s: Shared SPI conflict!\n", __func__); + return -EBUSY; +} + +static void rzg2l_irqc_irq_release_resources(struct irq_data *d) +{ + unsigned int hw_irq =3D irqd_to_hwirq(d); + struct rzg2l_irqc_priv *priv =3D irq_data_to_priv(d); + const struct rzg2l_hw_info *info =3D priv->info; + u32 offset; + u8 inttsel_reg; + + if (!priv->info->shared_irq_cnt) + return; + + if (rzg2l_irqc_is_shared_irqc(info, hw_irq)) { + offset =3D hw_irq + IRQC_TINT_COUNT - info->tint_start; + + raw_spin_lock(&priv->lock); + inttsel_reg =3D readl_relaxed(priv->base + INTTSEL); + inttsel_reg &=3D ~TINTSEL(offset); + writel_relaxed(inttsel_reg, priv->base + INTTSEL); + raw_spin_unlock(&priv->lock); + } +} + static int rzg2l_irq_set_type(struct irq_data *d, unsigned int type) { struct rzg2l_irqc_priv *priv =3D irq_data_to_priv(d); @@ -422,6 +509,8 @@ static int rzg2l_irqc_irq_suspend(void *data) void __iomem *base =3D rzg2l_irqc_data->base; =20 cache->iitsr =3D readl_relaxed(base + IITSR); + if (rzg2l_irqc_data->info->shared_irq_cnt) + cache->inttsel =3D readl_relaxed(base + INTTSEL); for (u8 i =3D 0; i < 2; i++) cache->titsr[i] =3D readl_relaxed(base + TITSR(i)); =20 @@ -440,6 +529,8 @@ static void rzg2l_irqc_irq_resume(void *data) */ for (u8 i =3D 0; i < 2; i++) writel_relaxed(cache->titsr[i], base + TITSR(i)); + if (rzg2l_irqc_data->info->shared_irq_cnt) + writel_relaxed(cache->inttsel, base + INTTSEL); writel_relaxed(cache->iitsr, base + IITSR); } =20 @@ -459,6 +550,8 @@ static const struct irq_chip rzg2l_irqc_chip =3D { .irq_unmask =3D irq_chip_unmask_parent, .irq_disable =3D rzg2l_irqc_irq_disable, .irq_enable =3D rzg2l_irqc_irq_enable, + .irq_request_resources =3D rzg2l_irqc_irq_request_resources, + .irq_release_resources =3D rzg2l_irqc_irq_release_resources, .irq_get_irqchip_state =3D irq_chip_get_parent_state, .irq_set_irqchip_state =3D irq_chip_set_parent_state, .irq_retrigger =3D irq_chip_retrigger_hierarchy, @@ -640,6 +733,7 @@ static const struct rzg2l_hw_info rzg3l_hw_params =3D { .irq_count =3D 16, .tint_start =3D IRQC_IRQ_START + 16, .num_irq =3D IRQC_IRQ_START + 16 + IRQC_TINT_COUNT, + .shared_irq_cnt =3D 8, }; =20 static const struct rzg2l_hw_info rzg2l_hw_params =3D { --=20 2.43.0 From nobody Mon Feb 9 05:42:36 2026 Received: from mail-ej1-f51.google.com (mail-ej1-f51.google.com [209.85.218.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 9CCCC410D2F for ; Wed, 4 Feb 2026 14:23:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770215010; cv=none; b=AXPID4IuvKBowqF8P5V2Z/A1zM8zE7kS3EZj5AyoENt+prw+pVesHXP/36uMd+LIJYacTArY/SpEd6YYN9sKuAf+ucojw1maSwP7P8f7GArRhLdcM5BJLgj6fz/RsLifqu08/JwMokx/ua7bolspxAeBEplHkOuqrA78VBXg6ws= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770215010; c=relaxed/simple; bh=UP+9KdRnkLsvToA8MtZEcm32tDDxPt9OHWzvcibE/xg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=W7fuhoQfjnqCQ1sLP53HlKuOh75QRe2rJ8i+7qtv++Ih3pNZj8dIXAe9GaHAvG8NEuKZ3nRAMwMPDlZg6zaqe4okHIYxSCXeKmuGC9DwCbVgu/rAzjwUW8WeZDQgBf/HFfOLOsLd0QSQjheh0VxopyEcc/2lAT+kh/8AZrJcIOs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ECi2anPi; arc=none smtp.client-ip=209.85.218.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ECi2anPi" Received: by mail-ej1-f51.google.com with SMTP id a640c23a62f3a-b8869cd7bb1so1195276066b.1 for ; Wed, 04 Feb 2026 06:23:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1770215008; x=1770819808; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+JoeGOuekatIj2w4dOO9r1vdS0XM/ncxVioEhSKM/u4=; b=ECi2anPiK35Ib9nk7K7fIlJlrxWTRoblRVtVM6uwk3Qlnc/X21HzI+xxOL1BBVWY5m 82t3Ue6Zhn5g4IwN97BlX/Ge3opejG4pdU+gY2z1SLkWh8QO/hYPSMN5nTIbATwAtxLZ TUgIIN1pAsWEjnyy2Vuc5Zl5blGP7xVawFNfM5mt9xBeek7f+QPTU2PHEryUvoQL72AW VD5c+6mCEcZ7o79YLzliZ+gpC9/n2k5KtlsMgHUWF7ROU7oz3I1F4t0BdUaC4PNyY0Kq SqzVX4WLjjfUI8LRxgxEZP07aAFSfO7HfCeVeavIn/q2Idt76BWE4yAhu2rD/yEQxdtk wMFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770215008; x=1770819808; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=+JoeGOuekatIj2w4dOO9r1vdS0XM/ncxVioEhSKM/u4=; b=WvW1GAlS75M0Xw2/bSssndEb9xMdasrDomldj0nJwJF92gLnIa1tmZaJdDNmu1CeFN Aa5shASYlEqJmTeaS8toGPz6GibuhpEQMu/Cj3C3tZT8aN/ru6TtK6B9YxF5Nm2snjl2 Mulu6P1HZyKDi6ewqYe/h3/TkMEsfNHiP/A/5f6yDr7QWC9lpLSSWhfxslkKWZUGoVYY 0d/lZg6PEk7wkKnitxv0weWCdKGPyA1297RVFH8DMkwhgdfM2M7MttgDphBqJY98B/lv E9ip5f7WUDJ0EWqbjUwJrI/B2KSxnshMXZ8YdxPI112RjtcN4WIrwUnQ6K+s2TnwBT0x iRog== X-Forwarded-Encrypted: i=1; AJvYcCU48Dz3tc3Vw3aPSogVaMFiUibglCPnFGnqHYW2P9anFXMcMSkudMnWXYSrnUzmN12ysIL2PDp4zMWoifw=@vger.kernel.org X-Gm-Message-State: AOJu0Yx49m8bIVrHs3uSJ8Qcqc8XMJoUjWPggshAGbc1POoTlLEpwuOE stPz9SwpukngKEbuZ/6spWSoRbTTkMgk2i+ZnO3me+UDkQuByN/DCWoC X-Gm-Gg: AZuq6aLTPo3BBaKPLiapjOnrhbsazvnoYM6qgUOJ/+6/FQqdQjWOYByk7+cNp9PiFnl uKvZK3VtNEePBzUWIdklzYZtadZSSkHgR8AV0IGwrfkJXNguWD1+XAZbzVFDmpsC/4bJZnz4pun O04RreRzOdCD5nLD3eqThFC9gtDBzQ6rjo1w82hufUAJ+W/350zpjOiULaH3Gcdz0vmyWS6xCZ/ mFPXIbZS6GJVooRRIfwyyQqML75CEwna/yiAZLmnmTNLKmQhaJjM305kc9VyJYHTw1NC1E0lUa2 RYvS6RwO+MGLTNGgvoYeYR5G/8Ojfwd5QraHzB2AxCoe4bXS2h1XybpauBOYKiZVrwc+7EOMpzX 0SmcTrakGY0VzYRum57D/3JnhFTmUbSi6jIeIU4s3e6yZrXCzg9o2hiskYOS7vhf9VLVU/NIZAh VJtrrWy4TJLz21nNCV23R6F7wd3DFz5gd+Grk= X-Received: by 2002:a17:907:3d0c:b0:b87:63a8:880c with SMTP id a640c23a62f3a-b8e9ef58045mr221168866b.19.1770215007916; Wed, 04 Feb 2026 06:23:27 -0800 (PST) Received: from localhost.localdomain ([2a00:23c4:a758:8a01:3c9f:a100:4d45:ebc7]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b8ea001ea7dsm129038366b.47.2026.02.04.06.23.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Feb 2026 06:23:27 -0800 (PST) From: Biju X-Google-Original-From: Biju To: Geert Uytterhoeven , Magnus Damm , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Biju Das , linux-renesas-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Prabhakar Mahadev Lad , Biju Das Subject: [PATCH 8/8] arm64: dts: renesas: r9a08g046: Add ICU node Date: Wed, 4 Feb 2026 14:23:16 +0000 Message-ID: <20260204142320.103184-9-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260204142320.103184-1-biju.das.jz@bp.renesas.com> References: <20260204142320.103184-1-biju.das.jz@bp.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" From: Biju Das Add interrupt control node to RZ/G3L ("R9A08G046") SoC DTSI and add icu as interrupt-parent of pincontrol. Signed-off-by: Biju Das --- This patch depend upon [1] [1] https://lore.kernel.org/linux-renesas-soc/20260203131048.421708-9-biju.= das.jz@bp.renesas.com/T/#u --- arch/arm64/boot/dts/renesas/r9a08g046.dtsi | 91 ++++++++++++++++++++++ 1 file changed, 91 insertions(+) diff --git a/arch/arm64/boot/dts/renesas/r9a08g046.dtsi b/arch/arm64/boot/d= ts/renesas/r9a08g046.dtsi index a92a4e07cc10..65dfa145ef59 100644 --- a/arch/arm64/boot/dts/renesas/r9a08g046.dtsi +++ b/arch/arm64/boot/dts/renesas/r9a08g046.dtsi @@ -188,6 +188,7 @@ pinctrl: pinctrl@11030000 { gpio-ranges =3D <&pinctrl 0 0 232>; interrupt-controller; #interrupt-cells =3D <2>; + interrupt-parent =3D <&icu>; clocks =3D <&cpg CPG_MOD R9A08G046_GPIO_HCLK>; power-domains =3D <&cpg>; resets =3D <&cpg R9A08G046_GPIO_RSTN>, @@ -196,6 +197,96 @@ pinctrl: pinctrl@11030000 { reset-names =3D "rstn", "port", "spare"; }; =20 + icu: interrupt-controller@11050000 { + compatible =3D "renesas,r9a08g046-irqc"; + #interrupt-cells =3D <2>; + #address-cells =3D <0>; + interrupt-controller; + reg =3D <0 0x11050000 0 0x10000>; + interrupts =3D , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + ; + interrupt-names =3D "nmi", + "irq0", "irq1", "irq2", "irq3", + "irq4", "irq5", "irq6", "irq7", + "irq8", "irq9", "irq10", "irq11", + "irq12", "irq13", "irq14", "irq15", + "tint0", "tint1", "tint2", "tint3", + "tint4", "tint5", "tint6", "tint7", + "tint8", "tint9", "tint10", "tint11", + "tint12", "tint13", "tint14", "tint15", + "tint16", "tint17", "tint18", "tint19", + "tint20", "tint21", "tint22", "tint23", + "tint24", "tint25", "tint26", "tint27", + "tint28", "tint29", "tint30", "tint31", + "bus-err", "ec7tie1-0", "ec7tie2-0", "ec7tiovf-0", + "ovfunf0", "ovfunf1", "ovfunf2", "ovfunf3", + "ovfunf4", "ovfunf5", "ovfunf6", "ovfunf7"; + clocks =3D <&cpg CPG_MOD R9A08G046_IA55_CLK>, + <&cpg CPG_MOD R9A08G046_IA55_PCLK>; + clock-names =3D "clk", "pclk"; + power-domains =3D <&cpg>; + resets =3D <&cpg R9A08G046_IA55_RESETN>; + }; + dmac: dma-controller@11820000 { compatible =3D "renesas,r9a08g046-dmac", "renesas,rz-dmac"; reg =3D <0 0x11820000 0 0x10000>, --=20 2.43.0