Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp4755551ybc; Fri, 15 Nov 2019 09:33:12 -0800 (PST) X-Google-Smtp-Source: APXvYqyRqVDGH+QTnxMX4CPAHqrL4FBgZ58ZYJYB5kEexMO9yU4GLOX7XsfvfOUsaNCb2L963w3+ X-Received: by 2002:a17:906:5586:: with SMTP id y6mr2432994ejp.76.1573839192405; Fri, 15 Nov 2019 09:33:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573839192; cv=none; d=google.com; s=arc-20160816; b=Mi4cpzE8gYR4SNQNOPu2bjVLBZr+mvseNnL+gDN8fNZbzFIZCkgeVUPVqTp/1K5qrS dYQS5RBwxnj9GEy6jREwjbPbEHmQlTf9Jy9A7krYUx//TXgBhwMHiFMYkqaJ8+PGK6nS AdKtv+wiPwifYPA8xlDvws+B9pU1FdFILKUWvhGB6w20mg6FPoV+E9GQhOlHJhcbKUNJ kbXmWFjw5vLMjWLSZoWdCDBV58IHdMgfHygcL9zWUuR53tyBUZlMgThU+mIYXrsXHd8Z JHVeHG+VJYc7ozp2HIaFBJX6fl/wdG+bjY+0rwtuht0I/1sDHVRt2AKj1LMeDCAFZvwQ qU4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=Vv7O4F/V6ixbd+frkI+QsLdh11OHFWF8Mp0fyUbyBg0=; b=R3o6eHO4c9zQM2CbkW7b2WOnHy5E2hXy04anPhnhoK6spH9tH7nu5If3KFWq9+a2QU 7DYhqIDwABYJ+FSSQMA+q/jwGO/a7VqqN05H+x9vPiymy3USol9tv339XdshzpqcMa3e anLUZmoqlkgFVaiqCRWsD6AHxKfk5o7Y0XWn1QPwgST5ZzbbcR2vDMTalvbAYzCXGk6b 8QpK+G+O9F91xvcYSc2S+pf7p/GoVzGZflwocy/+XEyKrbb5OnPImCyuVy2nkH0x47xr NcRSEwI7C6RZdeZK8z7u/nlNyaPLiUkM2hN3/KjY8X7VQ6eSP9E08zbt8UN5h6IEX2MZ P+RA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=h2X6yxD6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=st.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cb6si5898239ejb.359.2019.11.15.09.32.46; Fri, 15 Nov 2019 09:33:12 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=h2X6yxD6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=st.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727700AbfKOR26 (ORCPT + 99 others); Fri, 15 Nov 2019 12:28:58 -0500 Received: from mx07-00178001.pphosted.com ([62.209.51.94]:28030 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727543AbfKOR26 (ORCPT ); Fri, 15 Nov 2019 12:28:58 -0500 Received: from pps.filterd (m0046037.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id xAFHR2Bb022462; Fri, 15 Nov 2019 18:28:35 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=STMicroelectronics; bh=Vv7O4F/V6ixbd+frkI+QsLdh11OHFWF8Mp0fyUbyBg0=; b=h2X6yxD6m5aDfzGWZpbtttJkSWPTPGMF/bYfW1y0BmuIFWW34L3iPPFXb9ZFRSYLRWzr SrFcLyKeGJtk7cUIg2JXzYuyMB9rWka9B/kq7nalJz1cil53mGaNeF11kRyuQT/Cx2oW bUhzLtmkXnt35aTBNMWBKT4sGgqcU4k1K8ZZLgJir0l+oHyzbi7R9PZwpswOAWHUN2cq axV1enA8CNNgA2sz5r9QwYffuPULi6FFgyJaQCPT6GbOciPA+aVv1g0YWqeUN2Yxz/dH /r+IamdHqcYoPgFMl2yuxwuKAqSrFJgKH0CtFsnrVKGjxLkAnr457pvO2Y1ZvVvXXL3G sQ== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2w7psbng5v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 15 Nov 2019 18:28:35 +0100 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 50B4E10002A; Fri, 15 Nov 2019 18:28:33 +0100 (CET) Received: from Webmail-eu.st.com (sfhdag3node2.st.com [10.75.127.8]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 1AF022D3777; Fri, 15 Nov 2019 18:28:33 +0100 (CET) Received: from lmecxl0912.lme.st.com (10.75.127.50) by SFHDAG3NODE2.st.com (10.75.127.8) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Fri, 15 Nov 2019 18:28:32 +0100 Subject: Re: [PATCH] dt-bindings: interrupt-controller: Convert stm32-exti to json-schema To: Rob Herring CC: Mark Rutland , Thomas Gleixner , Jason Cooper , Marc Zyngier , , "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" , "linux-kernel@vger.kernel.org" , References: <20191114164104.22782-1-alexandre.torgue@st.com> From: Alexandre Torgue Message-ID: <7415fff5-030c-a65b-a405-a1197e166432@st.com> Date: Fri, 15 Nov 2019 18:28:32 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.75.127.50] X-ClientProxiedBy: SFHDAG5NODE2.st.com (10.75.127.14) To SFHDAG3NODE2.st.com (10.75.127.8) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,18.0.572 definitions=2019-11-15_05:2019-11-15,2019-11-15 signatures=0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/14/19 6:18 PM, Rob Herring wrote: > On Thu, Nov 14, 2019 at 10:41 AM Alexandre Torgue > wrote: >> >> Convert the STM32 external interrupt controller (EXTI) binding to DT >> schema format using json-schema. >> >> Signed-off-by: Alexandre Torgue >> --- >> >> Hi Rob, >> >> I planned to use "additionalProperties: false" for this schema but as I add a >> property under condition, I got an error (property added under contion seems >> to be detected as an "additional" property and then error is raised). >> >> Is there a way to fix that ? > > See below. > >> >> regards >> Alex >> >> diff --git a/Documentation/devicetree/bindings/interrupt-controller/st,stm32-exti.txt b/Documentation/devicetree/bindings/interrupt-controller/st,stm32-exti.txt >> deleted file mode 100644 >> index cd01b2292ec6..000000000000 >> --- a/Documentation/devicetree/bindings/interrupt-controller/st,stm32-exti.txt >> +++ /dev/null >> @@ -1,29 +0,0 @@ >> -STM32 External Interrupt Controller >> - >> -Required properties: >> - >> -- compatible: Should be: >> - "st,stm32-exti" >> - "st,stm32h7-exti" >> - "st,stm32mp1-exti" >> -- reg: Specifies base physical address and size of the registers >> -- interrupt-controller: Indentifies the node as an interrupt controller >> -- #interrupt-cells: Specifies the number of cells to encode an interrupt >> - specifier, shall be 2 >> -- interrupts: interrupts references to primary interrupt controller >> - (only needed for exti controller with multiple exti under >> - same parent interrupt: st,stm32-exti and st,stm32h7-exti) >> - >> -Optional properties: >> - >> -- hwlocks: reference to a phandle of a hardware spinlock provider node. >> - >> -Example: >> - >> -exti: interrupt-controller@40013c00 { >> - compatible = "st,stm32-exti"; >> - interrupt-controller; >> - #interrupt-cells = <2>; >> - reg = <0x40013C00 0x400>; >> - interrupts = <1>, <2>, <3>, <6>, <7>, <8>, <9>, <10>, <23>, <40>, <41>, <42>, <62>, <76>; >> -}; >> diff --git a/Documentation/devicetree/bindings/interrupt-controller/st,stm32-exti.yaml b/Documentation/devicetree/bindings/interrupt-controller/st,stm32-exti.yaml >> new file mode 100644 >> index 000000000000..39be37e1e532 >> --- /dev/null >> +++ b/Documentation/devicetree/bindings/interrupt-controller/st,stm32-exti.yaml >> @@ -0,0 +1,82 @@ >> +# SPDX-License-Identifier: GPL-2.0 > > If ST has copyright on the old binding, can you add BSD here. > I will. >> +%YAML 1.2 >> +--- >> +$id: http://devicetree.org/schemas/interrupt-controller/st,stm32-exti.yaml# >> +$schema: http://devicetree.org/meta-schemas/core.yaml# >> + >> +title: STM32 External Interrupt Controller Device Tree Bindings >> + >> +maintainers: >> + - Alexandre Torgue >> + - Ludovic Barre >> + >> +properties: >> + compatible: >> + oneOf: >> + - items: >> + - enum: >> + - st,stm32-exti >> + - st,stm32h7-exti >> + - items: >> + - enum: >> + - st,stm32mp1-exti >> + - const: syscon >> + >> + "#interrupt-cells": >> + const: 2 >> + >> + reg: >> + maxItems: 1 >> + >> + interrupt-controller: true >> + >> + hwlocks: >> + maxItems: 1 >> + description: >> + Reference to a phandle of a hardware spinlock provider node. >> + >> +required: >> + - "#interrupt-cells" >> + - compatible >> + - reg >> + - interrupt-controller >> + >> +allOf: >> + - $ref: /schemas/interrupt-controller.yaml# >> + - if: >> + properties: >> + compatible: >> + contains: >> + enum: >> + - st,stm32-exti >> + - st,stm32h7-exti >> + then: >> + properties: >> + interrupts: >> + allOf: >> + - $ref: /schemas/types.yaml#/definitions/uint32-array > > Standard property, doesn't need a type. You just need 'maxItems' or an > 'items' list if the index is not meaningful. This appears to be the > former case. ok > >> + description: >> + Interrupts references to primary interrupt controller >> + required: >> + - interrupts > > You can move the definition to the main section as you only need > 'required' here. That should fix your additionalProperties issue. > Doing that it fails as I don't have interrupts define for mp1 compatible. Maybe I missed something ? > In hindsight, the mp1 case probably should have used interrupt-map. For MP1 driver is written differently and mapping is done inside the driver. > >> + >> +examples: >> + - | >> + //Example 1 >> + exti1: interrupt-controller@5000d000 { >> + compatible = "st,stm32mp1-exti", "syscon"; >> + interrupt-controller; >> + #interrupt-cells = <2>; >> + reg = <0x5000d000 0x400>; >> + }; >> + >> + //Example 2 >> + exti2: interrupt-controller@40013c00 { >> + compatible = "st,stm32-exti"; >> + interrupt-controller; >> + #interrupt-cells = <2>; >> + reg = <0x40013C00 0x400>; >> + interrupts = <1>, <2>, <3>, <6>, <7>, <8>, <9>, <10>, <23>, <40>, <41>, <42>, <62>, <76>; >> + }; >> + >> +... >> -- >> 2.17.1 >>