[v4,29/39] irqchip/atmel-aic5: Add support to get nirqs from DT for sam9x60 & sam9x7
Message ID | 20240223172905.673053-1-varshini.rajendran@microchip.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-78863-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp736016dyb; Fri, 23 Feb 2024 09:35:40 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCW3pZv1hRV0T6r7xTv4wUkDelv+W/vv+c2sk47KioZV6NKgiyaGOdhZIM9fJm9y88Pa+n4QEuhH3Q0rtr0b+tEj9TPU4w== X-Google-Smtp-Source: AGHT+IG2De05sc+mdf1iIAiI2JTB9wB+7HsUREMCDAuJGhOKtpSvdvWGnTLvAi3jCIJU0P8WG4Ms X-Received: by 2002:a0c:cc0c:0:b0:68f:2e24:6156 with SMTP id r12-20020a0ccc0c000000b0068f2e246156mr485589qvk.16.1708709740464; Fri, 23 Feb 2024 09:35:40 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708709740; cv=pass; d=google.com; s=arc-20160816; b=At6eBY73nCkucKgUy8I/yF2OtUoqHZuwipQgzm5urEEiYiDWQ6uvrcueUp/h5iBr5d lnI2TSJHOP6HfDO29r2n+y3QZjIZb+piIpukFnlAZPH9YGJ8xUr5tvinJyqPrQVnjsWQ mGpuW9yEfBc8KdP1kk8LvAmK3MjG6l8W29DvHgMMktCwIAEkuaU+lTnZ5Is6wI7e7tcb R/IAThB3aLCcPyWRgMXangICT/9iCHrUT3bWD5HmNSUhf/2ZFdJqi4gDsck90ktobBY9 8OG4bM89X76o7QW12VdzLBv0V2aXH5YHQMjQfqRqis9sJ8R5qZWPd95eZMuh35AM97N/ yosA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:to:from:dkim-signature; bh=/TW6IyYi/CkodujDBoEMpXMx2DHimfSj4baFUi3HnFE=; fh=9cSjHDXwPRGGzxev83FSEJv/Z9VDZNykIguMlcPwmTY=; b=bojjLJp1+BVFaR0URCdRX4eslmHmOF8PvEuydorkCoI9dBVekgZbcD65kyfC85Dwev 5RwfutFzIFOnb8HytImJtndhiY86ZCsLFl3GJsM3G3efILDjfWwAWCC7TN4l5g07c1ag jUjHw3lKPnwhb0jyQgzpJd3YKb/2X9om7Qg5H7dQEmSuObWvgGwayKnQ4QJ9oAEdfGf/ AcgA9FwsVDYIUGpAxLRSiMPy6jBOZkNQIyve7NYPPBqPQi7FiV/fUJMUo+FBQc1eOqPv 5BRCwNm8BfQCvpjFTbKmmPASiTkrDESuXXb6XyMHHTDjJ6O6iYZkQoJVduKAGS56HU8Z j5/A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=C0w9IwhP; arc=pass (i=1 spf=pass spfdomain=microchip.com dkim=pass dkdomain=microchip.com dmarc=pass fromdomain=microchip.com); spf=pass (google.com: domain of linux-kernel+bounces-78863-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-78863-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=REJECT dis=NONE) header.from=microchip.com Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id jl6-20020ad45e86000000b006846c97c980si16288755qvb.579.2024.02.23.09.35.40 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Feb 2024 09:35:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-78863-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=C0w9IwhP; arc=pass (i=1 spf=pass spfdomain=microchip.com dkim=pass dkdomain=microchip.com dmarc=pass fromdomain=microchip.com); spf=pass (google.com: domain of linux-kernel+bounces-78863-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-78863-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=REJECT dis=NONE) header.from=microchip.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 0D8991C22DE9 for <ouuuleilei@gmail.com>; Fri, 23 Feb 2024 17:35:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 758921420D6; Fri, 23 Feb 2024 17:29:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="C0w9IwhP" Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8619F1420B3; Fri, 23 Feb 2024 17:29:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=68.232.153.233 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708709363; cv=none; b=cVDoHJLMqEbNkaJYiKo5cGVnQQcV94OuXrwoWYJnYxw6E1HKCmuMj+KRg82ct/ZLWsBC4GhKN2sDWd7hlDroW3I3z1V2UMG9MclMrYsKh+AgNGkunvhnyuM4iT+g4+wZcARU7tbvGqyC4DOYbFLGR8mbdL8OGGqq1KgihzS/wdQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708709363; c=relaxed/simple; bh=032mMVSQqEKqmJWHEH/kd/ajYLY2Zrh+cOXnnpQqiKQ=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=JqZFrADTjl8M4Yq2h4vEngS7eqZ10RV3GcKOfwObV8k1UFZapdvBrL8rB0IYwbX20nU3kEIgXkgNtlKbkikdv48lyP1wUkvIyFMtdLd2TLFDRAepPGdMk3HDOQbbSJPwCltSPN2qrLeO8u+HZb9ap2DBzoISoMAMwn6exVoTr1s= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=microchip.com; spf=pass smtp.mailfrom=microchip.com; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b=C0w9IwhP; arc=none smtp.client-ip=68.232.153.233 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=microchip.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=microchip.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1708709362; x=1740245362; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=032mMVSQqEKqmJWHEH/kd/ajYLY2Zrh+cOXnnpQqiKQ=; b=C0w9IwhP1dEjGcfci+1ijL4HhXC3xCZVAi2cdQHmJ9U4yVJIVZ/wxITM nbyLSKTtuGdf5kXFOdL+aOJHbPAL/Wl/WDKXbquC/Qm7Z6W68IJds1EEN dtFMxFcAbqpCHMCyVEjBfdYUHjq+8LRCJ163pq0ElcgJNoxxNbgt26XSc qxt8307R+Ij2YDU1eT+4eBaE9OPQD3kXwu3iA9oSOkE0KT8CgwwcVlo8T W+t557TPFlxDRowQvA6C2sy4xNaKzrEPa1B3lyjWY6wMIOGdjbSUcdaO3 tDk5AQyClKzEyFxCP1LuDPBLyR1/mZQ8sGhN+Vzc83A8ORP8dsHrYAAqW g==; X-CSE-ConnectionGUID: UUhv/eVbQlm9nBTg2b0S7g== X-CSE-MsgGUID: rc+ohozORYusiT9RdenFHA== X-IronPort-AV: E=Sophos;i="6.06,180,1705388400"; d="scan'208";a="16734688" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa3.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 23 Feb 2024 10:29:21 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Fri, 23 Feb 2024 10:29:19 -0700 Received: from che-lt-i67070.microchip.com (10.10.85.11) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.2507.35 via Frontend Transport; Fri, 23 Feb 2024 10:29:14 -0700 From: Varshini Rajendran <varshini.rajendran@microchip.com> To: <robh+dt@kernel.org>, <krzysztof.kozlowski+dt@linaro.org>, <conor+dt@kernel.org>, <tglx@linutronix.de>, <nicolas.ferre@microchip.com>, <alexandre.belloni@bootlin.com>, <claudiu.beznea@tuxon.dev>, <andre.przywara@arm.com>, <mani@kernel.org>, <shawnguo@kernel.org>, <durai.manickamkr@microchip.com>, <varshini.rajendran@microchip.com>, <devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>, <linux-arm-kernel@lists.infradead.org> Subject: [PATCH v4 29/39] irqchip/atmel-aic5: Add support to get nirqs from DT for sam9x60 & sam9x7 Date: Fri, 23 Feb 2024 22:59:05 +0530 Message-ID: <20240223172905.673053-1-varshini.rajendran@microchip.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240223171342.669133-1-varshini.rajendran@microchip.com> References: <20240223171342.669133-1-varshini.rajendran@microchip.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791712024437494830 X-GMAIL-MSGID: 1791712024437494830 |
Series |
Add support for sam9x7 SoC family
|
|
Commit Message
Varshini Rajendran
Feb. 23, 2024, 5:29 p.m. UTC
Add support to get number of IRQs from the respective DT node for sam9x60
and sam9x7 devices. Since only this factor differs between the two SoCs,
this patch adds support for the same. Adapt the sam9x60 dtsi
accordingly.
Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
---
Changes in v4:
- Changed the implementation to fetch the NIRQs from DT as per the
comment to avoid introducing a new compatible when this is the only
difference between the SoCs related to this IP.
---
arch/arm/boot/dts/microchip/sam9x60.dtsi | 1 +
drivers/irqchip/irq-atmel-aic5.c | 11 ++++++++---
2 files changed, 9 insertions(+), 3 deletions(-)
Comments
On 23.02.2024 19:29, Varshini Rajendran wrote: > Add support to get number of IRQs from the respective DT node for sam9x60 > and sam9x7 devices. Since only this factor differs between the two SoCs, > this patch adds support for the same. Adapt the sam9x60 dtsi > accordingly. > > Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com> > --- > Changes in v4: > - Changed the implementation to fetch the NIRQs from DT as per the > comment to avoid introducing a new compatible when this is the only > difference between the SoCs related to this IP. > --- > arch/arm/boot/dts/microchip/sam9x60.dtsi | 1 + > drivers/irqchip/irq-atmel-aic5.c | 11 ++++++++--- > 2 files changed, 9 insertions(+), 3 deletions(-) > > diff --git a/arch/arm/boot/dts/microchip/sam9x60.dtsi b/arch/arm/boot/dts/microchip/sam9x60.dtsi > index 73d570a17269..e405f68c9f54 100644 > --- a/arch/arm/boot/dts/microchip/sam9x60.dtsi > +++ b/arch/arm/boot/dts/microchip/sam9x60.dtsi > @@ -1201,6 +1201,7 @@ aic: interrupt-controller@fffff100 { > interrupt-controller; > reg = <0xfffff100 0x100>; > atmel,external-irqs = <31>; > + microchip,nr-irqs = <50>; > }; > > dbgu: serial@fffff200 { > diff --git a/drivers/irqchip/irq-atmel-aic5.c b/drivers/irqchip/irq-atmel-aic5.c > index 145535bd7560..5d96ad8860d3 100644 > --- a/drivers/irqchip/irq-atmel-aic5.c > +++ b/drivers/irqchip/irq-atmel-aic5.c > @@ -398,11 +398,16 @@ static int __init sama5d4_aic5_of_init(struct device_node *node, > } > IRQCHIP_DECLARE(sama5d4_aic5, "atmel,sama5d4-aic", sama5d4_aic5_of_init); > > -#define NR_SAM9X60_IRQS 50 > - > static int __init sam9x60_aic5_of_init(struct device_node *node, > struct device_node *parent) > { > - return aic5_of_init(node, parent, NR_SAM9X60_IRQS); > + int ret, nr_irqs; > + > + ret = of_property_read_u32(node, "microchip,nr-irqs", &nr_irqs); > + if (ret) { > + pr_err("Not found microchip,nr-irqs property\n"); This breaks the ABI. You should ensure old device trees are still working with this patch. > + return ret; > + } > + return aic5_of_init(node, parent, nr_irqs); > } > IRQCHIP_DECLARE(sam9x60_aic5, "microchip,sam9x60-aic", sam9x60_aic5_of_init);
diff --git a/arch/arm/boot/dts/microchip/sam9x60.dtsi b/arch/arm/boot/dts/microchip/sam9x60.dtsi index 73d570a17269..e405f68c9f54 100644 --- a/arch/arm/boot/dts/microchip/sam9x60.dtsi +++ b/arch/arm/boot/dts/microchip/sam9x60.dtsi @@ -1201,6 +1201,7 @@ aic: interrupt-controller@fffff100 { interrupt-controller; reg = <0xfffff100 0x100>; atmel,external-irqs = <31>; + microchip,nr-irqs = <50>; }; dbgu: serial@fffff200 { diff --git a/drivers/irqchip/irq-atmel-aic5.c b/drivers/irqchip/irq-atmel-aic5.c index 145535bd7560..5d96ad8860d3 100644 --- a/drivers/irqchip/irq-atmel-aic5.c +++ b/drivers/irqchip/irq-atmel-aic5.c @@ -398,11 +398,16 @@ static int __init sama5d4_aic5_of_init(struct device_node *node, } IRQCHIP_DECLARE(sama5d4_aic5, "atmel,sama5d4-aic", sama5d4_aic5_of_init); -#define NR_SAM9X60_IRQS 50 - static int __init sam9x60_aic5_of_init(struct device_node *node, struct device_node *parent) { - return aic5_of_init(node, parent, NR_SAM9X60_IRQS); + int ret, nr_irqs; + + ret = of_property_read_u32(node, "microchip,nr-irqs", &nr_irqs); + if (ret) { + pr_err("Not found microchip,nr-irqs property\n"); + return ret; + } + return aic5_of_init(node, parent, nr_irqs); } IRQCHIP_DECLARE(sam9x60_aic5, "microchip,sam9x60-aic", sam9x60_aic5_of_init);