Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp4800743ybc; Fri, 15 Nov 2019 10:15:54 -0800 (PST) X-Google-Smtp-Source: APXvYqzirEoPKASHTXl9DUqKeyFEXXfsgiKk6lUpckozR5UWxvO0b2IKIMtOlgoHGuOlMm8H/9dX X-Received: by 2002:a17:906:24d4:: with SMTP id f20mr2798321ejb.182.1573841753932; Fri, 15 Nov 2019 10:15:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573841753; cv=none; d=google.com; s=arc-20160816; b=0SDDwID7Brd/oNO72/9728jpMAMaepKSzW7YXeSDeqItcauHsqkCqqn6XFxcSlH4ih +wpthMatOC6pKs1PcSOIzN6QJnWZ7tHNs7zotm3UJ9ud5tRt+BuKT7RWZsNuw0SNwT75 kJohrQH6S/LXVlPOFrwil6Kh/lR3rpc+I7dHhmU0po3svnX4qivqajTWtgGJVl6gDsrO HdB3fpyF6Gp3hmQxYyIXUBKsPAoAUaQA2T2ekYkgr3DBdVlsUAuZmZ8AwjaX7iGPOJ1q N1CMYGXH0tOH9MFlPjgLEbxb4ISE/oVsbHlk4fomHA8PfE5v6/hmkfGD+jSWrKD0P/9N NXXg== 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=OyaPEfrTH529l/ASlfKrbaJ4eycdKiFeNGebqnuC/6k=; b=0T6g9VS6P02PGLOUrZzSxlmMh+/GJLBw2UzAn6oe7GEa4+IZ7cmTSpCopgn3t0S7Eq OLD5GGIqTHPUF+XGo+JcIMd9UwJi0JX+19zSb0tmFe4Fbzfd0YU3QwdFBkjDwwBUs9JQ dEPaf76yw3SfuA74rSDg8A058qSv8GpvuhHcC1bTaX3nnVviiWr77/NtcTd2XmPtrAiW DQTXMMYi90J55ieomF/rAxqe+ZoDzUZddp8F2t1FaWVGrq4GkVI/o+99+dVPO8WRFTXr 7n4YBnndS4Aen2gl3wTWnxiLwvrxproh2tCIqpoxa0bL33T9qb3WYrhwkyhlHGqff/sj yr1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=Zqt5YNel; 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 w4si4510271ejb.276.2019.11.15.10.15.28; Fri, 15 Nov 2019 10:15:53 -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=Zqt5YNel; 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 S1726605AbfKOSMU (ORCPT + 99 others); Fri, 15 Nov 2019 13:12:20 -0500 Received: from mx08-00178001.pphosted.com ([91.207.212.93]:12248 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726182AbfKOSMU (ORCPT ); Fri, 15 Nov 2019 13:12:20 -0500 Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx08-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id xAFI7qf0005169; Fri, 15 Nov 2019 19:12:00 +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=OyaPEfrTH529l/ASlfKrbaJ4eycdKiFeNGebqnuC/6k=; b=Zqt5YNelE3NG9zhmyagZpXnnHLCInTVSJ49lmj9cRFrU2oLHnlAvhNpdS5iS83EozMb+ 5WAyPQqLef1LXpz+sllxTwFPdLOgRiEK6gB7N3aZLvD714pxqVbmnl92SJ75PalRG7Tf cgujyqBXVbTBZGBRuaahXwWdzVk9mf0peSpPRrwrnZ5yHp9V+tkWOd6gfo5focmARn1w vqOq5TXZ2hGUALOMkBtGHx+mcoFapXkBc2Y5rBqzlO0N5KDByUSX5f7ccPKOr0JKXjJQ 6VfFDI2CzcLI7R0L9L9+PwfbPuVUO7KOXKsv82bZijGADVkPwkU27apjyzClgZIVu6yO Fg== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2w7psfnt48-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 15 Nov 2019 19:12:00 +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 63D3010002A; Fri, 15 Nov 2019 19:11:59 +0100 (CET) Received: from Webmail-eu.st.com (sfhdag3node2.st.com [10.75.127.8]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 341E920FF9E; Fri, 15 Nov 2019 19:11:59 +0100 (CET) Received: from lmecxl0912.lme.st.com (10.75.127.49) by SFHDAG3NODE2.st.com (10.75.127.8) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Fri, 15 Nov 2019 19:11:58 +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> <7415fff5-030c-a65b-a405-a1197e166432@st.com> From: Alexandre Torgue Message-ID: Date: Fri, 15 Nov 2019 19:11:57 +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.49] X-ClientProxiedBy: SFHDAG4NODE1.st.com (10.75.127.10) 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/15/19 6:41 PM, Rob Herring wrote: > On Fri, Nov 15, 2019 at 11:28 AM Alexandre Torgue > wrote: >> >> >> >> 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 ? > > Like this: > > properties: > ... > interrupts: > maxItems: ?? > minItems: ?? > > allOf: > - $ref: /schemas/interrupt-controller.yaml# > - if: > properties: > compatible: > contains: > enum: > - st,stm32-exti > - st,stm32h7-exti > then: > required: > - interrupts > Yes it is better :). Let me send the V2 Thanks Alex