Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp3901620ioa; Tue, 26 Apr 2022 12:00:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy/C8nhsP/dBTATsWfwiiFRx8J6fhcYmwltAiHPispo9N71HePmhBHJXmRLV1aH58x7woaU X-Received: by 2002:a05:6402:d05:b0:425:b5c8:faeb with SMTP id eb5-20020a0564020d0500b00425b5c8faebmr26234012edb.273.1650999648368; Tue, 26 Apr 2022 12:00:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650999648; cv=none; d=google.com; s=arc-20160816; b=xOKqSlItOlLSg8CsekoIUeviL7hwMi9AfCE4UcXc6nnt9k9QNsTXMB7kdI1aiL9Sf0 yqFqYNkuMw7p0HTqjJRuLuge9zlJggcroJOul8jOssGB4Pgp7czxg/xgGonFq2BrPrYB Ccv3e4X/k7x4GRp0jaeMzyFPF9EHzarS4unUvAs8v0YfY3Aw4MQkH50hs7LXpKPdaZbr 2y3L2Yi7QGiZGtm8S9p7pDzFNae8ggsLJTi47YF//GZAGbfTGt+Ce1cVq5DEvY4WoFYc SZn3NMZIdkwLBi75ctCAzT9tH1YeWAIOCkvelbE2UXb6lyBLKUV84AKhZJidAhLv+170 dcZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:user-agent:references:in-reply-to :subject:cc:to:from:date:content-transfer-encoding:mime-version :dkim-signature; bh=DCsEa7zKkDqLZy+dB+iRWtTIDIbRaSE/8JLGg5kT/lA=; b=fpSq7YfVdBUwdYznjm+QgNPMHXloaJO9FW4UlAcpepshsw9DY6BPkeoJZKXT34xLx8 ddjYa/psmQwb0rkIN3s4xYY4fyG3mTJkyy+DOdVpUla7C9zjfljBRKO3KIe1z5elie4t V56Cw40FE5OwTQ5mkz2pD7TpCU2WRgq1Y9KDnL7aSFULHaxP2R888Ss1x9Ie09anaDLb My2HDkmFRCdaO3zGz3kF5yinkujzBuZS75yVJ8vpJ+vVT5L3BCJs2O1NRwz7tybdr0MR E9jK8GBDLZYP/M9yXJbzV18++6AEAuGOKD833Q0pL9ZNZThsO3mqAyJiXI+5cMvb/gzw ZwnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b="B/vwdgRY"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s11-20020a17090699cb00b006f3a2a53c3asi3783341ejn.172.2022.04.26.12.00.21; Tue, 26 Apr 2022 12:00:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b="B/vwdgRY"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231164AbiDYWZW (ORCPT + 99 others); Mon, 25 Apr 2022 18:25:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36524 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343643AbiDYWBs (ORCPT ); Mon, 25 Apr 2022 18:01:48 -0400 Received: from ssl.serverraum.org (ssl.serverraum.org [IPv6:2a01:4f8:151:8464::1:2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D64C3298E; Mon, 25 Apr 2022 14:58:42 -0700 (PDT) Received: from ssl.serverraum.org (web.serverraum.org [172.16.0.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ssl.serverraum.org (Postfix) with ESMTPSA id 59D0A22246; Mon, 25 Apr 2022 23:58:39 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1650923920; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DCsEa7zKkDqLZy+dB+iRWtTIDIbRaSE/8JLGg5kT/lA=; b=B/vwdgRY9J8Xn903h4fqbxkT2zuHxf9NoV56Bh8CqE8Dl1vwTDZAOU1KeUM8lrBWj3aI4f erzbaLdSRTNVVYNve2Netuuwp5dhYr5GymSXePHQ2Rp9z9X7vgzQhcxDny0aYJ1hqFbKSq prT3Gz1uWzqH7Qd2crngmBYYeblCQ9Q= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 25 Apr 2022 23:58:39 +0200 From: Michael Walle To: Krzysztof Kozlowski Cc: Rob Herring , Krzysztof Kozlowski , Li Yang , Shawn Guo , Thomas Gleixner , Marc Zyngier , linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/2] dt-bindings: interrupt-controller: fsl,ls-extirq: convert to YAML In-Reply-To: <658851ed-33fd-8e2b-7db7-ef1ca9e31c33@linaro.org> References: <20220425140214.32448-1-michael@walle.cc> <658851ed-33fd-8e2b-7db7-ef1ca9e31c33@linaro.org> User-Agent: Roundcube Webmail/1.4.13 Message-ID: <83b596d0570c779c61c3c37c6f512679@walle.cc> X-Sender: michael@walle.cc X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am 2022-04-25 20:36, schrieb Krzysztof Kozlowski: > On 25/04/2022 16:02, Michael Walle wrote: >> Convert the fsl,ls-extirq binding to the new YAML format. >> > > (...) > >> diff --git >> a/Documentation/devicetree/bindings/interrupt-controller/fsl,ls-extirq.yaml >> b/Documentation/devicetree/bindings/interrupt-controller/fsl,ls-extirq.yaml >> new file mode 100644 >> index 000000000000..39d120ad7549 >> --- /dev/null >> +++ >> b/Documentation/devicetree/bindings/interrupt-controller/fsl,ls-extirq.yaml >> @@ -0,0 +1,88 @@ >> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) >> +%YAML 1.2 >> +--- >> +$id: >> http://devicetree.org/schemas/interrupt-controller/fsl,ls-extirq.yaml# >> +$schema: http://devicetree.org/meta-schemas/core.yaml# >> + >> +title: Freescale Layerscape External Interrupt Controller >> + >> +maintainers: >> + - Shawn Guo >> + - Li Yang >> + >> +description: | >> + Some Layerscape SOCs (LS1021A, LS1043A, LS1046A LS1088A, LS208xA, >> + LX216xA) support inverting the polarity of certain external >> interrupt >> + lines. >> + >> +allOf: >> + - $ref: /schemas/interrupt-controller.yaml# > > I have doubts whether this is here applicable. See also Rob's comment: > https://lore.kernel.org/all/YjjJpxLWJ%2FYOe0OX@robh.at.kernel.org/ > > This device does not have children, so the interrupt-controller schema > should be probably skipped. ok. >> + >> +properties: >> + compatible: >> + oneOf: >> + - enum: >> + - fsl,ls1021a-extirq >> + - fsl,ls1043a-extirq >> + - fsl,ls1088a-extirq >> + - items: >> + - enum: >> + - fsl,ls1046a-extirq >> + - const: fsl,ls1043a-extirq >> + - items: >> + - enum: >> + - fsl,ls2080a-extirq >> + - fsl,lx2160a-extirq >> + - const: fsl,ls1088a-extirq >> + >> + '#interrupt-cells': >> + const: 2 >> + >> + '#address-cells': >> + const: 0 >> + >> + interrupt-controller: true >> + >> + reg: >> + maxItems: 1 >> + description: >> + Specifies the Interrupt Polarity Control Register (INTPCR) in >> the >> + SCFG or the External Interrupt Control Register (IRQCR) in the >> ISC. >> + >> + interrupt-map: btw. minItems: 12 maxItems: 12 Isn't working here, is that expected? The validator seem to get the count of the elements of one tuple wrong. I.e. arch/arm64/boot/dts/freescale/fsl-ls2080a-rdb.dtb: interrupt-controller@14: interrupt-map: [[0, 0, 1, 0, 0, 4, 1, 0], [1, 0, 1, 4, 2, 0, 1, 0], [2, 4, 3, 0, 1, 0, 3, 4], [4, 0, 1, 0, 4, 4, 5, 0], [1, 0, 5, 4, 6, 0, 1, 0], [6, 4, 7, 0, 1, 0, 7, 4], [8, 0, 1, 0, 8, 4, 9, 0], [1, 0, 9, 4, 10, 0, 1, 0], [10, 4, 11, 0, 1, 0, 11, 4]] is too short >> + description: Specifies the mapping from external interrupts to >> GIC interrupts. >> + >> + interrupt-map-mask: >> + items: >> + - const: 0xffffffff > > This looks highly permissive mask and should be instead defined per > variant, for example (quickly looking at DTS): > 0x7 for ls1021 > 0xf for ls1043a and ls1088a Just that I understand it correctly, the result of the AND with that mask is then looked up in the interrupt-map (the first entry there)? > You might need to correct the DTS. Some confirmation from someone with > datasheet would be good. According to their datasheets they have the following number of external IRQs: - ls1021a has 6, - ls1043a has 12, - ls1046a has 12, - ls1088a has 12, - ls2080a has 12, - lx2160a has 12. That is what I need to confirm, right? Is there a better way than the following snippet: properties: interrupt-map-mask: true allOf: - if: properties: compatible: contains: enum: - fsl,ls1021a-extirq then: properties: interrupt-map-mask: items: - const: 0x7 - const: 0 - if: properties: compatible: contains: enum: - fsl,ls1043a-extirq - fsl,ls1046a-extirq - fsl,ls1088a-extirq - fsl,ls2080a-extirq - fsl,lx2160a-extirq then: properties: interrupt-map-mask: items: - const: 0xf - const: 0 -michael