From nobody Sat Apr 4 01:50:36 2026 Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) (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 669CB3815D6 for ; Sun, 22 Mar 2026 12:24:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774182280; cv=none; b=pfVjKQYIrUkNgGl28Kr9BWTv6lfY7W7qPwSYe3o6TXM7ZQyxdQsjoeyDETirCqszaWoU52Oq+xfhoqRuz2wGfWE+FX3HC570HzXGfszqC9YvKyOBL53Bjuvq9gZrB41efLYthXU74wFx/9qWHfT4EaqLIaTyQmlTDf015KNPQj0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774182280; c=relaxed/simple; bh=c9l2i7HPT8iNPuwqrZJz+dMN2SoQtpIGWFRWvS6zBI8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Vo89C4CXIVxIiprRlXAxpJPBNIniLmKudc5VAjGAzHCwdmeu+YPL0BQvcDsrFUaM7pmp5RZY4IC5zzdRfzUfLvJ9bTURChXJZ0WhGDylx9aopNV7poqRj6AXl0PZZSaQ1aW4fD4RdOGAGoby1wj2FNFIRnH6UmjSnlOV9gHxa0Y= 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=GaTkhsbu; arc=none smtp.client-ip=209.85.221.47 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="GaTkhsbu" Received: by mail-wr1-f47.google.com with SMTP id ffacd0b85a97d-43b3d9d0695so3038271f8f.0 for ; Sun, 22 Mar 2026 05:24:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1774182277; x=1774787077; 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=vZOo4IkXrKT3vNwdWHp9bFAGOnopScx0rwaRBrsQYIM=; b=GaTkhsbuiOfPXLtfwVLF1/SVHrAnjezP+1Vs9eEJrJep2hf3tzR2WLKCMnlaLW/lUw ybQzrp3ehA/p52egkcU7XJPknAY4ju/d4mnTMjewviBgRLfky/yiQTvLR/D4m5F5FJ1R YzIHm/u90n2yG8uIEDuAtQPlYZCfhefjbDFJW/0y/SgDdiM9I2/pZWqTUWwoehfzKJ5V 4pOCNkTH3NwB14IwL6d9MnMo2TopEg4UuhsilsZF+Of/BlI/izRPN6Ts/RkctMgWvEZg FPM3IVrQVSFJlHHK87IUD8gIFu0OFczw1oRUcnYnIbb4Bvz86wf+Tc8wSR7tID+rdNqX BIFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774182277; x=1774787077; 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=vZOo4IkXrKT3vNwdWHp9bFAGOnopScx0rwaRBrsQYIM=; b=LA3F8BIqNqRDGEVlTio8z+ZWkOtHbWF/TX9sqKwCNSfu50LC5GFPpv5qOvbUEDsmSY Aib7AVWimjUYp8EHAqDpQpnqJl7H8OjDDX7FDG5hHL3/WsG4K9RkWLlVASiW/T6Evt9f pDJ1MGjOUrixAMrSPoIJeGHHdMWPfmLJdrPux9yFW3gqiJ7lK0tGTlA5kTkGMxsqJVp8 RxwSRhWk3bqWuGIJDTLY4cTMKegrs6WPoG4/PEasQYhFdR4WGY3T8V0wLC9OUP8kYaHW uSCWFeyf0PH+yVrEIcyaXF2M87leMdmRw955JHAAWYuptCsfUnm8xFY8pySDiYTy93mO I5FQ== X-Forwarded-Encrypted: i=1; AJvYcCUe63fFP91Il+jP6GQ6eTNYRnQcR98AY07F8EfaEsknp4DxWzGBS6Y1H77XEdbdiJXM0oXIh5MjFWylYxM=@vger.kernel.org X-Gm-Message-State: AOJu0Yzac+8mEhAmTyWigsNBRs6drx++ldy6oxmY1+ykbEGJEoQwu/Ad pjTPYdmYf+JfTUsrOUMKpObmiiXkmKMIDtPCdG+sWb9OF+q7C+v8H0hz0kQwVg== X-Gm-Gg: ATEYQzztfCTuaWeG89AJEkokQ1aXlSmoU+kwu5zOkxPctn9BCm4nGQVMKVwEZGYBcA9 ieO0ZUEKUOCsxxs3qq2odmerJqDrHPdOZUkpDfvt6yU93XjllO8ud1NEawGZjL7CIX0e/Cjpp7m Kwb8bkU2EmEst2m04b0i5WVdb6aPRdFo0JT3qUujxQjagqcyRGJPWSXKzu4iHIUBpJ7VmpqQzyY rsIChP18VmQQYjYyzLmfGmJFuHeUlrPJdx1iXDpV3ZoAQ24jJkvbHjSPoBXs82RV8t2dMIgCL/z Em66g97Ge2uiQJgThJRHDB2/jJ4KS82c0RJrU22v6VtpYK0+XH+iiOBwnW3+zQLrfe59lQ7kXWD hfZIbX+2vPLfQlIUbt1qeKKFS+a5k+1TKKdW/0fJZctYiEXJRGUKLLiWPFT5bj3LwM/1XukNqeT nBKBsv+cQW+/6JezFUpIjzfU/0i9E2Kada0R3CmOuA1PrOc9S3 X-Received: by 2002:a05:6000:2501:b0:43b:4d2e:9ff8 with SMTP id ffacd0b85a97d-43b6423c4d6mr14984981f8f.6.1774182276669; Sun, 22 Mar 2026 05:24:36 -0700 (PDT) Received: from localhost.localdomain ([2a00:23c4:a758:8a01:1bdc:7f84:18bc:1e56]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43b64703343sm21072695f8f.19.2026.03.22.05.24.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Mar 2026 05:24:35 -0700 (PDT) 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 v6 14/15] irqchip/renesas-rzg2l: Add RZ/G3L support Date: Sun, 22 Mar 2026 12:23:57 +0000 Message-ID: <20260322122421.132474-15-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260322122421.132474-1-biju.das.jz@bp.renesas.com> References: <20260322122421.132474-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 interrupts are 16 instead of 8, out of these 8 external interrupts 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 --- v5->v6: * No change. v4->v5: * Updated rzg3l_irqc_probe() for supporting separate interrupt chips. v3->v4: * Updated commit description IRQs->interrupts. * Updated rzg2l_disable_tint_and_set_tint_source() for making tint assignment very clear in the code. * Formatted rzg3l_tssel_lut as table format. v2->v3: * No change v1->v2: * No change --- drivers/irqchip/irq-renesas-rzg2l.c | 44 +++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/drivers/irqchip/irq-renesas-rzg2l.c b/drivers/irqchip/irq-rene= sas-rzg2l.c index 8aff8b9d49c9..1ff1c0efed66 100644 --- a/drivers/irqchip/irq-renesas-rzg2l.c +++ b/drivers/irqchip/irq-renesas-rzg2l.c @@ -67,11 +67,13 @@ 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 { + const u8 *tssel_lut; unsigned int irq_count; unsigned int tint_start; unsigned int num_irq; @@ -377,6 +379,11 @@ static u32 rzg2l_disable_tint_and_set_tint_source(stru= ct 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]; + else + tint =3D (u32)(uintptr_t)irq_data_get_irq_chip_data(d); + /* Clear the relevant byte in reg */ reg &=3D ~(TSSEL_MASK << TSSEL_SHIFT(tssr_offset)); /* Set TINT and leave TIEN clear */ @@ -683,6 +690,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, @@ -695,6 +732,12 @@ static int rzg2l_irqc_probe(struct platform_device *pd= ev, struct device_node *pa 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_irq_chip, &rzg2l= _irqc_tint_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_irq_chip, &rzfi= ve_irqc_tint_chip, @@ -703,6 +746,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