Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp4719326rwb; Sun, 13 Nov 2022 12:02:28 -0800 (PST) X-Google-Smtp-Source: AA0mqf4klJ+1yzN2I/mSAzTTR8E3sXNr61Nt4cSb3+T3fEa6XmdFf3GCjlxxwG3vZZEszYI7iErM X-Received: by 2002:a17:907:119a:b0:7ad:b45d:810c with SMTP id uz26-20020a170907119a00b007adb45d810cmr8582949ejb.181.1668369748373; Sun, 13 Nov 2022 12:02:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668369748; cv=none; d=google.com; s=arc-20160816; b=0upBO/OCqmrSjgd04Z0eqT0CUkUD1cEOXitKtp6lt1Vt5clsSaLjdhlwcfA21WYrQ/ XtnK4bcyvNQg7/pwiro5tkctfc8eUQZsR6RzjsjzetwhRSZlh7G/jKWewg294SjXhjQN /D1+GsA4IQXWLWvZkqqoWHZ6eFyyuFr5a2QLHIEjQKUPllUeeJsTxIMg75QS6Tmv0XY2 w487H8jBvHKAhTNsSuWX35siIxuathnSqbXqzJfZdtT9CUeaeBbU6UYB+Al3mW63m7L5 d56t0OpeLJvkyj/h5Mtvhzt0Gz9bYv1kdwSINmTZPaWzn4K9EzcLykaR2FY/8MgMCKUB /qLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=8LlkqqiVv/lhmjc3kta/QC77O8du5LeEjhq3BGupOjM=; b=vFwh8637SXcxmulCHFge6OieK7I4Mg113P/7RdYh83/wglCv5cSUbnbMvrfxS0EuxB ppdEvK7897xST8h6DJOWnth1PjQKuUAFGug0arlC9YA0Eln3tRZszGsqZaYpwgOfO5HY cF0HK7K7GBB+mgx6PC/tdZPqMDk3FZsAPfa10P17+qRoNzDe1PT0+nP9VzU33ZYOZz81 Cu0WWV/1mHjoTpiYZ+Xm4oYocaCSYoY3ntwjqfhfP2k7OTJwsQ6V+Tptg4d91OtTEY5H JxSCFBO5Qf+mRRaY3wdOoE5+zeYt9VcaaD6rgqUPyTNTYzVmX7PC4dM6GoWM+9tTfErI txqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baikalelectronics.ru header.s=post header.b="F/9UTlj8"; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=baikalelectronics.ru Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e3-20020a50a683000000b00461d5afea01si7832879edc.165.2022.11.13.12.02.07; Sun, 13 Nov 2022 12:02:28 -0800 (PST) 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=@baikalelectronics.ru header.s=post header.b="F/9UTlj8"; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=baikalelectronics.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235641AbiKMTP2 (ORCPT + 90 others); Sun, 13 Nov 2022 14:15:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46278 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235400AbiKMTOx (ORCPT ); Sun, 13 Nov 2022 14:14:53 -0500 Received: from post.baikalelectronics.com (post.baikalelectronics.com [213.79.110.86]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 65EE3DF86; Sun, 13 Nov 2022 11:14:52 -0800 (PST) Received: from post.baikalelectronics.com (localhost.localdomain [127.0.0.1]) by post.baikalelectronics.com (Proxmox) with ESMTP id F21C2E0EB0; Sun, 13 Nov 2022 22:14:51 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= baikalelectronics.ru; h=cc:cc:content-transfer-encoding :content-type:content-type:date:from:from:in-reply-to:message-id :mime-version:references:reply-to:subject:subject:to:to; s=post; bh=8LlkqqiVv/lhmjc3kta/QC77O8du5LeEjhq3BGupOjM=; b=F/9UTlj8n963 U6rFJ/lYN4nRD6udMnyjFUQmSlS2AoVz3nIPunDMS0WsEDKJtvEApZ4pvr1/GUfp 3g8S13KnEof6dQewO08YKd7VZxKcb2cfdKXSdOFvt2BZYK4sq5NxQxs/90JxxMVz i1gMnRUZTXhP3wO6xu7WavDyVAyAnIQ= Received: from mail.baikal.int (mail.baikal.int [192.168.51.25]) by post.baikalelectronics.com (Proxmox) with ESMTP id E4B4FE0E6A; Sun, 13 Nov 2022 22:14:51 +0300 (MSK) Received: from localhost (192.168.168.10) by mail (192.168.51.25) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Sun, 13 Nov 2022 22:14:51 +0300 From: Serge Semin To: Rob Herring , Rob Herring , Krzysztof Kozlowski , Bjorn Helgaas , Lorenzo Pieralisi , Cai Huoqing , Robin Murphy , Jingoo Han , Gustavo Pimentel CC: Serge Semin , Serge Semin , Alexey Malahov , Pavel Parkhomenko , =?UTF-8?q?Krzysztof=20Wilczy=C5=84ski?= , Frank Li , Manivannan Sadhasivam , caihuoqing , Vinod Koul , , , Subject: [PATCH v7 07/20] dt-bindings: PCI: dwc: Apply generic schema for generic device only Date: Sun, 13 Nov 2022 22:12:48 +0300 Message-ID: <20221113191301.5526-8-Sergey.Semin@baikalelectronics.ru> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221113191301.5526-1-Sergey.Semin@baikalelectronics.ru> References: <20221113191301.5526-1-Sergey.Semin@baikalelectronics.ru> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [192.168.168.10] X-ClientProxiedBy: MAIL.baikal.int (192.168.51.25) To mail (192.168.51.25) X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,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 Having the generic compatible strings constraints with the 'any'+'generic string' semantic implicitly encourages either to add new DW PCIe-based DT-bindings with the generic compatible string attached or just forget about adding new DT-bindings since the corresponding DT-node will be evaluated anyway. Moreover having that semantic implemented in the generic DT-schema causes the DT-validation tool to apply the schema twice: first by implicit compatible-string-based selection and second by means of the 'allOf: [ $ref ]' statement. Let's fix all of that by dropping the compatible property constraints and selecting the generic DT-schema only for the purely generic DW PCIe DT-nodes. The later is required since there is a driver for such devices. (Though there are no such DT-nodes currently defined in the kernel DT sources.) Signed-off-by: Serge Semin Reviewed-by: Rob Herring --- Changelog v3: - This is a new patch unpinned from the next one: https://lore.kernel.org/linux-pci/20220503214638.1895-2-Sergey.Semin@baikalelectronics.ru/ by the Rob' request. (@Rob) - Fix compatible property schema so one would work as expected: string must contain either generic DW PCIe IP-core name or both generic and equipped with IP-core version names. Changelog v5: - Switch the patch from not-selecting the generic schemas to applying them to the generic DW PCIe device nodes only. - Drop the generic compatible string used as fallback. (@Rob) --- .../devicetree/bindings/pci/snps,dw-pcie-ep.yaml | 16 ++++++++++------ .../devicetree/bindings/pci/snps,dw-pcie.yaml | 16 ++++++++++------ 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/Documentation/devicetree/bindings/pci/snps,dw-pcie-ep.yaml b/Documentation/devicetree/bindings/pci/snps,dw-pcie-ep.yaml index fc3b5d4ac245..d04001248b53 100644 --- a/Documentation/devicetree/bindings/pci/snps,dw-pcie-ep.yaml +++ b/Documentation/devicetree/bindings/pci/snps,dw-pcie-ep.yaml @@ -13,16 +13,20 @@ maintainers: description: | Synopsys DesignWare PCIe host controller endpoint +# Please create a separate DT-schema for your DWC PCIe Endpoint controller +# and make sure it's assigned with the vendor-specific compatible string. +select: + properties: + compatible: + const: snps,dw-pcie-ep + required: + - compatible + allOf: - $ref: /schemas/pci/pci-ep.yaml# - $ref: /schemas/pci/snps,dw-pcie-common.yaml# properties: - compatible: - anyOf: - - {} - - const: snps,dw-pcie-ep - reg: description: | It should contain Data Bus Interface (dbi) and config registers for all @@ -38,9 +42,9 @@ properties: enum: [dbi, dbi2, config, atu, addr_space, link, atu_dma, appl] required: + - compatible - reg - reg-names - - compatible additionalProperties: true diff --git a/Documentation/devicetree/bindings/pci/snps,dw-pcie.yaml b/Documentation/devicetree/bindings/pci/snps,dw-pcie.yaml index e787b9727589..85861b71d9ff 100644 --- a/Documentation/devicetree/bindings/pci/snps,dw-pcie.yaml +++ b/Documentation/devicetree/bindings/pci/snps,dw-pcie.yaml @@ -13,16 +13,20 @@ maintainers: description: | Synopsys DesignWare PCIe host controller +# Please create a separate DT-schema for your DWC PCIe Root Port controller +# and make sure it's assigned with the vendor-specific compatible string. +select: + properties: + compatible: + const: snps,dw-pcie + required: + - compatible + allOf: - $ref: /schemas/pci/pci-bus.yaml# - $ref: /schemas/pci/snps,dw-pcie-common.yaml# properties: - compatible: - anyOf: - - {} - - const: snps,dw-pcie - reg: description: | It should contain Data Bus Interface (dbi) and config registers for all @@ -47,9 +51,9 @@ properties: additionalProperties: true required: + - compatible - reg - reg-names - - compatible examples: - | -- 2.38.1