Message ID | 20240209100122.61335-1-dharma.b@microchip.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-59190-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp743313dyd; Fri, 9 Feb 2024 02:02:31 -0800 (PST) X-Google-Smtp-Source: AGHT+IFRKVf6sMQckmEgx3Mgrlne5AwELPDZTOjlyy4+SoWwSzs2HugbLdeVfTz3PKXEYclGqbSG X-Received: by 2002:a17:906:4447:b0:a3b:ad01:f66e with SMTP id i7-20020a170906444700b00a3bad01f66emr726258ejp.25.1707472950983; Fri, 09 Feb 2024 02:02:30 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707472950; cv=pass; d=google.com; s=arc-20160816; b=cnwjb9hITXgfMqqZAlckk07ziPFMknyIZGW0pfJXQgsZK8YWF6OS4fj/DnkkvEcGA+ r5ZlbDt9kOUVdVHZJmvQzvrtlE59/pok9Kn/a/D9ou62uZZ0bGBfi9vNq09pA4TyTl3W sFEAFJeJFWz/ZtAo067SPKkn+RvjDXdr7DqrNOS1hMlUr/BxABtqC73F26Fbyw4S4bte V07KyjinQyMN5f9zhnrcgxr6AG1Xx2WpBSbC9Cq79s6xbwwADVsLkLqD0CUU1OxXNhli Fhk8uHovcpMzqv4d/Ov6YcTDdJqa21umxZYnnDlMfOT6haxJhAU0QOdODiNxnQ9jHWsi 0r3A== 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:message-id:date:subject:to:from :dkim-signature; bh=6LuTNGRFGQ5idStnxRknISqcgBdZauv0tBArh0BhIjs=; fh=VzqEHSyNP3sTwrYKEOWvSUpN2eb1ALpNw3bvTU1u7hY=; b=U8kraQepn8p36te/4yTSjY9aIUXZdK/OlM1UFkOvm1hnWJU0nkokbsZ02eFleI496N hfTEpkGizzAtblHiEW61xfMBcUW12cUgtQDwCk15Agns8ETSAXDH50HeedFYesRTzwKi uXAH4k6Sg9P0kO+EVqerOFzi9o2rGCY5wuajx3JKQ/p5BFaqJKEY1ciSQqkNczKc6pPp ed1iuM1H39C6Khow1hC+yByUm+lF7YowZbQcdRsXybvVJGRyiFoL5BeYbyvnUAvp0cMB X4JLtg/pqQQBETZ40r5Hz+NE9MQqVjDcEaSXGJnVEFpIBX+I/Pxj8H8VI4fnfMcuBo1e twPg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=c0kNo2SP; 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-59190-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59190-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=REJECT dis=NONE) header.from=microchip.com X-Forwarded-Encrypted: i=2; AJvYcCUa1/S/wlDW1Zdu0huID9qGoGCse6O1bl+yathuKY5f4REHdYaVQ4xPmQNWRc+8MeD/adfPqYy3PNM591Fa/vceGvGAiQ== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id lv8-20020a170906bc8800b00a385bbed224si680117ejb.648.2024.02.09.02.02.30 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 02:02:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-59190-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=c0kNo2SP; 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-59190-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59190-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 6A0131F241D1 for <ouuuleilei@gmail.com>; Fri, 9 Feb 2024 10:02:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 429B469308; Fri, 9 Feb 2024 10:02:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="c0kNo2SP" 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 614703FDF; Fri, 9 Feb 2024 10:02:10 +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=1707472933; cv=none; b=QbGWUFk7hADUjUhmc8mUy/dA+N7Hk5wVwvBR74fcWaJzgCt7FrxCCNH9p0Feqfh1NJQGjqzWfmEepM+Uag3j/0A7N1VWiFr2jgavUTSY5knakKg511AUIymarWixepMP8Kq9kJAaDlt3jThapuaZDXmBbfVIJiwQR97weshaLdc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707472933; c=relaxed/simple; bh=dHt3XARATvm47LBWteX4AQlK8JTfzsMgBrvHp9qNz0k=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=nL29ZPvtz2cDbI8BHXFRUzZ7Ioh2CGFvsuigH9Lc2PUNX/z+09E8iJyqthb7R1HyXUV+6FoAj8W/3W9xvCW86obSFocqw2dKjWL0GHi9yKGC/jsrATYmmGRCKvnbHh60p7Ubq2cwWw6n6B3I9yI9SI6GOqnTpUOkxUZmECrXsMg= 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=c0kNo2SP; 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=1707472931; x=1739008931; h=from:to:subject:date:message-id:mime-version: content-transfer-encoding; bh=dHt3XARATvm47LBWteX4AQlK8JTfzsMgBrvHp9qNz0k=; b=c0kNo2SPI6EbSBVthgfSe7+zNz01vqweSIlSvXFdQOlDGWCZ9uBlHjMP +aZBawe2TSaSqwe1a062RYEKHgQeuAHWCxgQfG+sMt5kRiDl86wtH+nI4 OzxMUPnQ+dqjm4hyvuFO8rqgkH8uDpY3FFd4dyVJvSbcl3a0TQaqEJQ2/ 6r7LjuFiqC8ECqfWf9uEiCkH474Bhj1oPSogu4ckH2xDdbX+KGvztBDRA EMe9o25yE7wtfaFhp0dcofbjrrMaiqi68ha/KAiZ/7TuGfJyK1BOfTOWE nlpTt5BcJU3RtWF1+khwaQVr8tFnlUxBRAcaBjHEpy0PnfIegM4psKtow A==; X-CSE-ConnectionGUID: fX7JcovPRN+JJx0KDfcpAQ== X-CSE-MsgGUID: gvdEMF7UTZGKu02Cq+Yz3Q== X-IronPort-AV: E=Sophos;i="6.05,256,1701154800"; d="scan'208";a="17415429" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa1.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 09 Feb 2024 03:02:09 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Fri, 9 Feb 2024 03:01:29 -0700 Received: from che-lt-i70843lx.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, 9 Feb 2024 03:01:25 -0700 From: Dharma Balasubiramani <dharma.b@microchip.com> To: <tglx@linutronix.de>, <robh+dt@kernel.org>, <krzysztof.kozlowski+dt@linaro.org>, <conor+dt@kernel.org>, <nicolas.ferre@microchip.com>, <alexandre.belloni@bootlin.com>, <claudiu.beznea@tuxon.dev>, <dharma.b@microchip.com>, <linux-kernel@vger.kernel.org>, <devicetree@vger.kernel.org>, <linux-arm-kernel@lists.infradead.org> Subject: [PATCH v2] dt-bindings: interrupt-controller: Convert Atmel AIC to json-schema Date: Fri, 9 Feb 2024 15:31:22 +0530 Message-ID: <20240209100122.61335-1-dharma.b@microchip.com> X-Mailer: git-send-email 2.25.1 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: 1790322042007826175 X-GMAIL-MSGID: 1790415157135654853 |
Series |
[v2] dt-bindings: interrupt-controller: Convert Atmel AIC to json-schema
|
|
Commit Message
Dharma Balasubiramani
Feb. 9, 2024, 10:01 a.m. UTC
Convert the Atmel AIC binding document to DT schema format using
json-schema.
Signed-off-by: Dharma Balasubiramani <dharma.b@microchip.com>
---
Changelog
v1 -> v2
- Drop the '|' as there is no formatting to preserve.
- Remove unnecessary marketing statement from description.
- Drop the description for interrupts and reg, it's obvious.
- Put reg after compatible.
- Drop comment in example.
- Drop the example of device that is wired to an AIC as it's(dma) binding is
not yet available.
---
.../interrupt-controller/atmel,aic.txt | 43 -----------
.../interrupt-controller/atmel,aic.yaml | 74 +++++++++++++++++++
2 files changed, 74 insertions(+), 43 deletions(-)
delete mode 100644 Documentation/devicetree/bindings/interrupt-controller/atmel,aic.txt
create mode 100644 Documentation/devicetree/bindings/interrupt-controller/atmel,aic.yaml
base-commit: 0dd3ee31125508cd67f7e7172247f05b7fd1753a
Comments
On Fri, Feb 09, 2024 at 03:31:22PM +0530, Dharma Balasubiramani wrote: > +examples: > + - | > + interrupt-controller@fffff000 { > + compatible = "atmel,at91rm9200-aic"; > + interrupt-controller; > + #interrupt-cells = <3>; > + reg = <0xfffff000 0x200>; One nit if there's some other reason for a respin, reg before interrupt-controller. Reviewed-by: Conor Dooley <conor.dooley@microchip.com> Cheers, Conor.
On Fri, Feb 09, 2024 at 03:31:22PM +0530, Dharma Balasubiramani wrote: > Convert the Atmel AIC binding document to DT schema format using > json-schema. > > Signed-off-by: Dharma Balasubiramani <dharma.b@microchip.com> > --- > Changelog > v1 -> v2 > - Drop the '|' as there is no formatting to preserve. > - Remove unnecessary marketing statement from description. > - Drop the description for interrupts and reg, it's obvious. > - Put reg after compatible. > - Drop comment in example. > - Drop the example of device that is wired to an AIC as it's(dma) binding is > not yet available. > --- > .../interrupt-controller/atmel,aic.txt | 43 ----------- > .../interrupt-controller/atmel,aic.yaml | 74 +++++++++++++++++++ > 2 files changed, 74 insertions(+), 43 deletions(-) > delete mode 100644 Documentation/devicetree/bindings/interrupt-controller/atmel,aic.txt > create mode 100644 Documentation/devicetree/bindings/interrupt-controller/atmel,aic.yaml > > diff --git a/Documentation/devicetree/bindings/interrupt-controller/atmel,aic.txt b/Documentation/devicetree/bindings/interrupt-controller/atmel,aic.txt > deleted file mode 100644 > index 7079d44bf3ba..000000000000 > --- a/Documentation/devicetree/bindings/interrupt-controller/atmel,aic.txt > +++ /dev/null > @@ -1,43 +0,0 @@ > -* Advanced Interrupt Controller (AIC) > - > -Required properties: > -- compatible: Should be: > - - "atmel,<chip>-aic" where <chip> can be "at91rm9200", "sama5d2", > - "sama5d3" or "sama5d4" > - - "microchip,<chip>-aic" where <chip> can be "sam9x60" > - > -- interrupt-controller: Identifies the node as an interrupt controller. > -- #interrupt-cells: The number of cells to define the interrupts. It should be 3. > - The first cell is the IRQ number (aka "Peripheral IDentifier" on datasheet). > - The second cell is used to specify flags: > - bits[3:0] trigger type and level flags: > - 1 = low-to-high edge triggered. > - 2 = high-to-low edge triggered. > - 4 = active high level-sensitive. > - 8 = active low level-sensitive. > - Valid combinations are 1, 2, 3, 4, 8. > - Default flag for internal sources should be set to 4 (active high). > - The third cell is used to specify the irq priority from 0 (lowest) to 7 > - (highest). > -- reg: Should contain AIC registers location and length > -- atmel,external-irqs: u32 array of external irqs. > - > -Examples: > - /* > - * AIC > - */ > - aic: interrupt-controller@fffff000 { > - compatible = "atmel,at91rm9200-aic"; > - interrupt-controller; > - #interrupt-cells = <3>; > - reg = <0xfffff000 0x200>; > - }; > - > - /* > - * An interrupt generating device that is wired to an AIC. > - */ > - dma: dma-controller@ffffec00 { > - compatible = "atmel,at91sam9g45-dma"; > - reg = <0xffffec00 0x200>; > - interrupts = <21 4 5>; > - }; > diff --git a/Documentation/devicetree/bindings/interrupt-controller/atmel,aic.yaml b/Documentation/devicetree/bindings/interrupt-controller/atmel,aic.yaml > new file mode 100644 > index 000000000000..df81115a8b7f > --- /dev/null > +++ b/Documentation/devicetree/bindings/interrupt-controller/atmel,aic.yaml > @@ -0,0 +1,74 @@ > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/interrupt-controller/atmel,aic.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: Advanced Interrupt Controller (AIC) > + > +maintainers: > + - Nicolas Ferre <nicolas.ferre@microchip.com> > + - Dharma balasubiramani <dharma.b@microchip.com> > + > +description: > + The Advanced Interrupt Controller (AIC) is an 8-level priority, individually > + maskable, vectored interrupt controller providing handling of up to one > + hundred and twenty-eight interrupt sources. > + > +allOf: > + - $ref: /schemas/interrupt-controller.yaml# > + > +properties: > + compatible: > + enum: > + - atmel,at91rm9200-aic > + - atmel,sama5d2-aic > + - atmel,sama5d3-aic > + - atmel,sama5d4-aic > + - microchip,sam9x60-aic > + > + reg: > + maxItems: 1 > + > + interrupt-controller: true > + > + "#interrupt-cells": > + const: 3 > + description: | > + The 1st cell is the IRQ number (Peripheral IDentifier on datasheet). > + The 2nd cell specifies flags: > + bits[3:0] trigger type and level flags: > + 1 = low-to-high edge triggered. > + 2 = high-to-low edge triggered. > + 4 = active high level-sensitive. > + 8 = active low level-sensitive. > + Valid combinations: 1, 2, 3, 4, 8. > + Default for internal sources: 4 (active high). > + The 3rd cell specifies irq priority from 0 (lowest) to 7 (highest). > + > + interrupts: > + maxItems: 1 > + > + atmel,external-irqs: > + $ref: /schemas/types.yaml#/definitions/uint32-array > + description: u32 array of external irqs. Constraints on the array size and/or entry values? > + > +required: > + - compatible > + - reg > + - interrupt-controller > + - "#interrupt-cells" > + - atmel,external-irqs > + > +unevaluatedProperties: false > + > +examples: > + - | > + interrupt-controller@fffff000 { > + compatible = "atmel,at91rm9200-aic"; > + interrupt-controller; > + #interrupt-cells = <3>; > + reg = <0xfffff000 0x200>; > + atmel,external-irqs = <31>; > + }; > +... > > base-commit: 0dd3ee31125508cd67f7e7172247f05b7fd1753a > -- > 2.25.1 >
Hi Rob, On 12/02/24 7:38 pm, Rob Herring wrote: > EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe > > On Fri, Feb 09, 2024 at 03:31:22PM +0530, Dharma Balasubiramani wrote: >> Convert the Atmel AIC binding document to DT schema format using >> json-schema. >> >> Signed-off-by: Dharma Balasubiramani <dharma.b@microchip.com> >> --- >> Changelog >> v1 -> v2 >> - Drop the '|' as there is no formatting to preserve. >> - Remove unnecessary marketing statement from description. >> - Drop the description for interrupts and reg, it's obvious. >> - Put reg after compatible. >> - Drop comment in example. >> - Drop the example of device that is wired to an AIC as it's(dma) binding is >> not yet available. >> --- >> .../interrupt-controller/atmel,aic.txt | 43 ----------- >> .../interrupt-controller/atmel,aic.yaml | 74 +++++++++++++++++++ >> 2 files changed, 74 insertions(+), 43 deletions(-) >> delete mode 100644 Documentation/devicetree/bindings/interrupt-controller/atmel,aic.txt >> create mode 100644 Documentation/devicetree/bindings/interrupt-controller/atmel,aic.yaml >> >> diff --git a/Documentation/devicetree/bindings/interrupt-controller/atmel,aic.txt b/Documentation/devicetree/bindings/interrupt-controller/atmel,aic.txt >> deleted file mode 100644 >> index 7079d44bf3ba..000000000000 >> --- a/Documentation/devicetree/bindings/interrupt-controller/atmel,aic.txt >> +++ /dev/null >> @@ -1,43 +0,0 @@ >> -* Advanced Interrupt Controller (AIC) >> - >> -Required properties: >> -- compatible: Should be: >> - - "atmel,<chip>-aic" where <chip> can be "at91rm9200", "sama5d2", >> - "sama5d3" or "sama5d4" >> - - "microchip,<chip>-aic" where <chip> can be "sam9x60" >> - >> -- interrupt-controller: Identifies the node as an interrupt controller. >> -- #interrupt-cells: The number of cells to define the interrupts. It should be 3. >> - The first cell is the IRQ number (aka "Peripheral IDentifier" on datasheet). >> - The second cell is used to specify flags: >> - bits[3:0] trigger type and level flags: >> - 1 = low-to-high edge triggered. >> - 2 = high-to-low edge triggered. >> - 4 = active high level-sensitive. >> - 8 = active low level-sensitive. >> - Valid combinations are 1, 2, 3, 4, 8. >> - Default flag for internal sources should be set to 4 (active high). >> - The third cell is used to specify the irq priority from 0 (lowest) to 7 >> - (highest). >> -- reg: Should contain AIC registers location and length >> -- atmel,external-irqs: u32 array of external irqs. >> - >> -Examples: >> - /* >> - * AIC >> - */ >> - aic: interrupt-controller@fffff000 { >> - compatible = "atmel,at91rm9200-aic"; >> - interrupt-controller; >> - #interrupt-cells = <3>; >> - reg = <0xfffff000 0x200>; >> - }; >> - >> - /* >> - * An interrupt generating device that is wired to an AIC. >> - */ >> - dma: dma-controller@ffffec00 { >> - compatible = "atmel,at91sam9g45-dma"; >> - reg = <0xffffec00 0x200>; >> - interrupts = <21 4 5>; >> - }; >> diff --git a/Documentation/devicetree/bindings/interrupt-controller/atmel,aic.yaml b/Documentation/devicetree/bindings/interrupt-controller/atmel,aic.yaml >> new file mode 100644 >> index 000000000000..df81115a8b7f >> --- /dev/null >> +++ b/Documentation/devicetree/bindings/interrupt-controller/atmel,aic.yaml >> @@ -0,0 +1,74 @@ >> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) >> +%YAML 1.2 >> +--- >> +$id: http://devicetree.org/schemas/interrupt-controller/atmel,aic.yaml# >> +$schema: http://devicetree.org/meta-schemas/core.yaml# >> + >> +title: Advanced Interrupt Controller (AIC) >> + >> +maintainers: >> + - Nicolas Ferre <nicolas.ferre@microchip.com> >> + - Dharma balasubiramani <dharma.b@microchip.com> >> + >> +description: >> + The Advanced Interrupt Controller (AIC) is an 8-level priority, individually >> + maskable, vectored interrupt controller providing handling of up to one >> + hundred and twenty-eight interrupt sources. >> + >> +allOf: >> + - $ref: /schemas/interrupt-controller.yaml# >> + >> +properties: >> + compatible: >> + enum: >> + - atmel,at91rm9200-aic >> + - atmel,sama5d2-aic >> + - atmel,sama5d3-aic >> + - atmel,sama5d4-aic >> + - microchip,sam9x60-aic >> + >> + reg: >> + maxItems: 1 >> + >> + interrupt-controller: true >> + >> + "#interrupt-cells": >> + const: 3 >> + description: | >> + The 1st cell is the IRQ number (Peripheral IDentifier on datasheet). >> + The 2nd cell specifies flags: >> + bits[3:0] trigger type and level flags: >> + 1 = low-to-high edge triggered. >> + 2 = high-to-low edge triggered. >> + 4 = active high level-sensitive. >> + 8 = active low level-sensitive. >> + Valid combinations: 1, 2, 3, 4, 8. >> + Default for internal sources: 4 (active high). >> + The 3rd cell specifies irq priority from 0 (lowest) to 7 (highest). >> + >> + interrupts: >> + maxItems: 1 >> + >> + atmel,external-irqs: >> + $ref: /schemas/types.yaml#/definitions/uint32-array >> + description: u32 array of external irqs. > > Constraints on the array size and/or entry values? The hardware's support for external IRQs may differ, which is why a u32 array is utilized. This choice is based on the fact that IRQ numbers are commonly expressed as integers, and a 32-bit unsigned integer provides a standardized size capable of representing a broad range of numbers. This size is more than adequate for accommodating IRQ numbering. > >> + >> +required: >> + - compatible >> + - reg >> + - interrupt-controller >> + - "#interrupt-cells" >> + - atmel,external-irqs >> + >> +unevaluatedProperties: false >> + >> +examples: >> + - | >> + interrupt-controller@fffff000 { >> + compatible = "atmel,at91rm9200-aic"; >> + interrupt-controller; >> + #interrupt-cells = <3>; >> + reg = <0xfffff000 0x200>; >> + atmel,external-irqs = <31>; >> + }; >> +... >> >> base-commit: 0dd3ee31125508cd67f7e7172247f05b7fd1753a >> -- >> 2.25.1 >> -- With Best Regards, Dharma B.
On Tue, Feb 13, 2024 at 04:23:36AM +0000, Dharma.B@microchip.com wrote: > On 12/02/24 7:38 pm, Rob Herring wrote: > > On Fri, Feb 09, 2024 at 03:31:22PM +0530, Dharma Balasubiramani wrote: > >> + atmel,external-irqs: > >> + $ref: /schemas/types.yaml#/definitions/uint32-array > >> + description: u32 array of external irqs. > > > > Constraints on the array size and/or entry values? > > The hardware's support for external IRQs may differ, which is why a u32 > array is utilized. This choice is based on the fact that IRQ numbers are > commonly expressed as integers, and a 32-bit unsigned integer provides a > standardized size capable of representing a broad range of numbers. This > size is more than adequate for accommodating IRQ numbering. I don't think Rob was questioning your use of u32s, but rather the fact that you do not limit the values at all nor the number of values.
Hi Rob and Conor, On 14/02/24 12:43 am, Conor Dooley wrote: > On Tue, Feb 13, 2024 at 04:23:36AM +0000,Dharma.B@microchip.com wrote: >> On 12/02/24 7:38 pm, Rob Herring wrote: >>> On Fri, Feb 09, 2024 at 03:31:22PM +0530, Dharma Balasubiramani wrote: >>>> + atmel,external-irqs: >>>> + $ref: /schemas/types.yaml#/definitions/uint32-array >>>> + description: u32 array of external irqs. >>> Constraints on the array size and/or entry values? >> The hardware's support for external IRQs may differ, which is why a u32 >> array is utilized. This choice is based on the fact that IRQ numbers are >> commonly expressed as integers, and a 32-bit unsigned integer provides a >> standardized size capable of representing a broad range of numbers. This >> size is more than adequate for accommodating IRQ numbering. > I don't think Rob was questioning your use of u32s, but rather the fact > that you do not limit the values at all nor the number of values. The peripheral identification defined at the product level corresponds to the interrupt source number. SoC External Interrupts Peripheral ID AT91RM9200 - IRQ0–IRQ6 25 - 31 SAMA5D2 - IRQ0–IRQn 49 SAMA5D3 - IRQ0–IRQn 47 SAMA5D4 - IRQ0–IRQn 56 SAM9x60 - IRQ0–IRQn 31 To reflect these constraints in bindings, I intend to make the following changes. atmel,external-irqs: $ref: /schemas/types.yaml#/definitions/uint32-array description: u32 array of external irqs. if: properties: compatible: contains: const: atmel,at91rm9200-aic then: minItems: 1 maxItems: 7 else: minItems: 1 maxItems: 1 -- With Best Regards, Dharma B.
On Mon, Feb 19, 2024 at 03:30:52PM +0000, Dharma.B@microchip.com wrote: > Hi Rob and Conor, > > On 14/02/24 12:43 am, Conor Dooley wrote: > > On Tue, Feb 13, 2024 at 04:23:36AM +0000,Dharma.B@microchip.com wrote: > >> On 12/02/24 7:38 pm, Rob Herring wrote: > >>> On Fri, Feb 09, 2024 at 03:31:22PM +0530, Dharma Balasubiramani wrote: > >>>> + atmel,external-irqs: > >>>> + $ref: /schemas/types.yaml#/definitions/uint32-array > >>>> + description: u32 array of external irqs. > >>> Constraints on the array size and/or entry values? > >> The hardware's support for external IRQs may differ, which is why a u32 > >> array is utilized. This choice is based on the fact that IRQ numbers are > >> commonly expressed as integers, and a 32-bit unsigned integer provides a > >> standardized size capable of representing a broad range of numbers. This > >> size is more than adequate for accommodating IRQ numbering. > > I don't think Rob was questioning your use of u32s, but rather the fact > > that you do not limit the values at all nor the number of values. > > The peripheral identification defined at the product level corresponds > to the interrupt source number. > > SoC External Interrupts Peripheral ID > AT91RM9200 - IRQ0–IRQ6 25 - 31 > SAMA5D2 - IRQ0–IRQn 49 > SAMA5D3 - IRQ0–IRQn 47 > SAMA5D4 - IRQ0–IRQn 56 > SAM9x60 - IRQ0–IRQn 31 > > To reflect these constraints in bindings, I intend to make the following > changes. > > atmel,external-irqs: > $ref: /schemas/types.yaml#/definitions/uint32-array > description: u32 array of external irqs. > if: > properties: > compatible: > contains: > const: atmel,at91rm9200-aic > then: > minItems: 1 > maxItems: 7 > else: > minItems: 1 > maxItems: 1 Just to point out, that if this is not psuedocode, the syntax here is not quite right. It should be: allOf: - if: properties: compatible: contains: const: atmel,at91rm9200-aic then: properties: atmel,external-irqs: minItems: 1 maxItems: 7 else: properties: atmel,external-irqs: minItems: 1 maxItems: 1 But you can simply this further by applying minItems: 1 & maxitems: 7 to the property directly and just setting maxItems: 1 when the compatible is not atmel,at91rm9200-aic. There should be plenty of examples in-tree for you to copy this sort of thing from - clock-names is a property you often see this used for. Cheers, Conor.
On 21/02/24 1:02 am, Conor Dooley wrote: > On Mon, Feb 19, 2024 at 03:30:52PM +0000,Dharma.B@microchip.com wrote: >> Hi Rob and Conor, >> >> On 14/02/24 12:43 am, Conor Dooley wrote: >>> On Tue, Feb 13, 2024 at 04:23:36AM +0000,Dharma.B@microchip.com wrote: >>>> On 12/02/24 7:38 pm, Rob Herring wrote: >>>>> On Fri, Feb 09, 2024 at 03:31:22PM +0530, Dharma Balasubiramani wrote: >>>>>> + atmel,external-irqs: >>>>>> + $ref: /schemas/types.yaml#/definitions/uint32-array >>>>>> + description: u32 array of external irqs. >>>>> Constraints on the array size and/or entry values? >>>> The hardware's support for external IRQs may differ, which is why a u32 >>>> array is utilized. This choice is based on the fact that IRQ numbers are >>>> commonly expressed as integers, and a 32-bit unsigned integer provides a >>>> standardized size capable of representing a broad range of numbers. This >>>> size is more than adequate for accommodating IRQ numbering. >>> I don't think Rob was questioning your use of u32s, but rather the fact >>> that you do not limit the values at all nor the number of values. >> The peripheral identification defined at the product level corresponds >> to the interrupt source number. >> >> SoC External Interrupts Peripheral ID >> AT91RM9200 - IRQ0–IRQ6 25 - 31 >> SAMA5D2 - IRQ0–IRQn 49 >> SAMA5D3 - IRQ0–IRQn 47 >> SAMA5D4 - IRQ0–IRQn 56 >> SAM9x60 - IRQ0–IRQn 31 >> >> To reflect these constraints in bindings, I intend to make the following >> changes. >> >> atmel,external-irqs: >> $ref: /schemas/types.yaml#/definitions/uint32-array >> description: u32 array of external irqs. >> if: >> properties: >> compatible: >> contains: >> const: atmel,at91rm9200-aic >> then: >> minItems: 1 >> maxItems: 7 >> else: >> minItems: 1 >> maxItems: 1 > Just to point out, that if this is not psuedocode, the syntax here is > not quite right. It should be: > > allOf: > - if: > properties: > compatible: > contains: > const: atmel,at91rm9200-aic > then: > properties: > atmel,external-irqs: > minItems: 1 > maxItems: 7 > else: > properties: > atmel,external-irqs: > minItems: 1 > maxItems: 1 > > But you can simply this further by applying minItems: 1 & maxitems: 7 > to the property directly and just setting maxItems: 1 when the > compatible is not atmel,at91rm9200-aic. > > There should be plenty of examples in-tree for you to copy this sort of > thing from - clock-names is a property you often see this used for. Sure, Thanks for pointing it out. I will address your previous suggestion "reg before interrupt-controller." as well in v3. > > Cheers, > Conor. -- With Best Regards, Dharma B.
diff --git a/Documentation/devicetree/bindings/interrupt-controller/atmel,aic.txt b/Documentation/devicetree/bindings/interrupt-controller/atmel,aic.txt deleted file mode 100644 index 7079d44bf3ba..000000000000 --- a/Documentation/devicetree/bindings/interrupt-controller/atmel,aic.txt +++ /dev/null @@ -1,43 +0,0 @@ -* Advanced Interrupt Controller (AIC) - -Required properties: -- compatible: Should be: - - "atmel,<chip>-aic" where <chip> can be "at91rm9200", "sama5d2", - "sama5d3" or "sama5d4" - - "microchip,<chip>-aic" where <chip> can be "sam9x60" - -- interrupt-controller: Identifies the node as an interrupt controller. -- #interrupt-cells: The number of cells to define the interrupts. It should be 3. - The first cell is the IRQ number (aka "Peripheral IDentifier" on datasheet). - The second cell is used to specify flags: - bits[3:0] trigger type and level flags: - 1 = low-to-high edge triggered. - 2 = high-to-low edge triggered. - 4 = active high level-sensitive. - 8 = active low level-sensitive. - Valid combinations are 1, 2, 3, 4, 8. - Default flag for internal sources should be set to 4 (active high). - The third cell is used to specify the irq priority from 0 (lowest) to 7 - (highest). -- reg: Should contain AIC registers location and length -- atmel,external-irqs: u32 array of external irqs. - -Examples: - /* - * AIC - */ - aic: interrupt-controller@fffff000 { - compatible = "atmel,at91rm9200-aic"; - interrupt-controller; - #interrupt-cells = <3>; - reg = <0xfffff000 0x200>; - }; - - /* - * An interrupt generating device that is wired to an AIC. - */ - dma: dma-controller@ffffec00 { - compatible = "atmel,at91sam9g45-dma"; - reg = <0xffffec00 0x200>; - interrupts = <21 4 5>; - }; diff --git a/Documentation/devicetree/bindings/interrupt-controller/atmel,aic.yaml b/Documentation/devicetree/bindings/interrupt-controller/atmel,aic.yaml new file mode 100644 index 000000000000..df81115a8b7f --- /dev/null +++ b/Documentation/devicetree/bindings/interrupt-controller/atmel,aic.yaml @@ -0,0 +1,74 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/interrupt-controller/atmel,aic.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Advanced Interrupt Controller (AIC) + +maintainers: + - Nicolas Ferre <nicolas.ferre@microchip.com> + - Dharma balasubiramani <dharma.b@microchip.com> + +description: + The Advanced Interrupt Controller (AIC) is an 8-level priority, individually + maskable, vectored interrupt controller providing handling of up to one + hundred and twenty-eight interrupt sources. + +allOf: + - $ref: /schemas/interrupt-controller.yaml# + +properties: + compatible: + enum: + - atmel,at91rm9200-aic + - atmel,sama5d2-aic + - atmel,sama5d3-aic + - atmel,sama5d4-aic + - microchip,sam9x60-aic + + reg: + maxItems: 1 + + interrupt-controller: true + + "#interrupt-cells": + const: 3 + description: | + The 1st cell is the IRQ number (Peripheral IDentifier on datasheet). + The 2nd cell specifies flags: + bits[3:0] trigger type and level flags: + 1 = low-to-high edge triggered. + 2 = high-to-low edge triggered. + 4 = active high level-sensitive. + 8 = active low level-sensitive. + Valid combinations: 1, 2, 3, 4, 8. + Default for internal sources: 4 (active high). + The 3rd cell specifies irq priority from 0 (lowest) to 7 (highest). + + interrupts: + maxItems: 1 + + atmel,external-irqs: + $ref: /schemas/types.yaml#/definitions/uint32-array + description: u32 array of external irqs. + +required: + - compatible + - reg + - interrupt-controller + - "#interrupt-cells" + - atmel,external-irqs + +unevaluatedProperties: false + +examples: + - | + interrupt-controller@fffff000 { + compatible = "atmel,at91rm9200-aic"; + interrupt-controller; + #interrupt-cells = <3>; + reg = <0xfffff000 0x200>; + atmel,external-irqs = <31>; + }; +...