Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp2864643pxv; Sun, 18 Jul 2021 03:56:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwgbqX1K2ekBrVZjeRMYPBfkgxAMXHL8vCv/SsxQV4UY+yy8Jgv3LRkgSvbHoJixDAA1o0r X-Received: by 2002:a5d:960b:: with SMTP id w11mr14783773iol.138.1626605772002; Sun, 18 Jul 2021 03:56:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626605771; cv=none; d=google.com; s=arc-20160816; b=Ns0k1JL1fAzvhmwTwddEASthcbPBrEP0BaihHmTLDIzQJKcfVakv4mNXFdf+sKOO7b yxY56rP4SO06DPnpKm+CSMPj8w5pPNTOzjcfE926lkzdDHKUQP5s+Vf8fbnzbcp7MTWu QWlIKj7spG+2pUGWoQnkC2pOUtolNGi7pZQG8cWM+Vv0NGMFZU4UmkIXDPJmMoziB2VR 1IVFfsAQgYnm7v4MVaDp0Bxb5gOJ7DsyolO2DDglof735NZtGzXdJnPuafkZ8uDFQfJH p3pMji/FheF0/9l4wxM5bRuzHMt58o2Isw8nACbgFPip9qpQ6M5MYEMbLO0sDAXx7goV HBhQ== 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:subject:cc:to:from:date :dkim-signature; bh=a9tLHe/VWa3T3yVUsK00hl+S57uT6KGX7nmiLK3Zc84=; b=fi8Z7uImDrabSh39dTLm0mcCSxuWf2vElYukD2MXpyj92i5mS5II44oXYVfAAMyGAv o6Rxe/kovSA5r2/SSadkdzDgn6z9xxgXcRWkpjtmu5O1mbhJPU/P72MNk6XJFVkdJ8Vp eXRBS93pqeukTwzlxVBYmQcKJahuLvXjRAdUi21Jzaitbg/8jemgzYkvaqw9pQWZTOGi CGvgK8gK9ex9fpBHBYF73JmSKdkzu0wS9i4GEpD3CZjd8wh67qqo+mjlrn1r+fGif1Jf z6sHEWxxHQsVr7nKA06ABE586gnlOGIcwTjFRa2+q2JwEvo0d0+2kK7xctY5R9c5Vj4N bkGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=c5EeEyh6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y26si1747671iod.1.2021.07.18.03.55.59; Sun, 18 Jul 2021 03:56:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=c5EeEyh6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232601AbhGRK6H (ORCPT + 99 others); Sun, 18 Jul 2021 06:58:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:45366 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230461AbhGRK6G (ORCPT ); Sun, 18 Jul 2021 06:58:06 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4282360E09; Sun, 18 Jul 2021 10:55:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1626605708; bh=IbtTbduagSl46TiZq6dHHvm7L6082HA3Xm8jM1+Pkps=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=c5EeEyh6UJstCmymZEE59uhejrYUfXl3NeBcZgpqlZdioFyw665uC8wN0gsyLwCUm CyckWCJ52+cchqyQcUbUciadgF+Cyh0YImU5OFaqEbQRrOD0f4yQXT4O5UxNZITTSC o5cy6wjRU01CHtWU3WZNqz8DTVmy45biQgxNE7NHJBpk3LxbNdo3eVgTX18FDGGnwU 7ZJQ9NOkgkouzZzDUT06TKo566wSAEXIZ9HfDf471qf5ECVgZM724sZb6lYVUGfvag 7KhdjlJcqfm9DmJxr0PFgvLNZelBr6fPq1mrgW2bVOmtV2q7qTpIRwsHjoLL00aVmR b+s7KFwqlGAxw== Date: Sun, 18 Jul 2021 12:55:03 +0200 From: Mauro Carvalho Chehab To: Rob Herring Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Bjorn Helgaas , Gustavo Pimentel , Jingoo Han , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org Subject: Re: [PATCH v4 1/5] dt-bindings: PCI: add snps,dw-pcie.yaml Message-ID: <20210718125503.395515e7@coco.lan> In-Reply-To: <20210718115916.3a37f969@coco.lan> References: <0454d09414d74d9789213f5e7779002bcc024537.1626174242.git.mchehab+huawei@kernel.org> <20210715172337.GA1263164@robh.at.kernel.org> <20210718115916.3a37f969@coco.lan> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Sun, 18 Jul 2021 11:59:16 +0200 Mauro Carvalho Chehab escreveu: > Em Thu, 15 Jul 2021 11:23:37 -0600 > Rob Herring escreveu: > > > On Tue, Jul 13, 2021 at 01:17:51PM +0200, Mauro Carvalho Chehab wrote: > > > Currently, the designware schema is defined on a text file: > > > designware-pcie.txt > > > > > > Convert the pci-bus part into a schema. > > > > > > Signed-off-by: Mauro Carvalho Chehab > > > --- > > > .../devicetree/bindings/pci/snps,dw-pcie.yaml | 96 +++++++++++++++++++ > > > MAINTAINERS | 1 + > > > 2 files changed, 97 insertions(+) > > > create mode 100644 Documentation/devicetree/bindings/pci/snps,dw-pcie.yaml > > > > > > diff --git a/Documentation/devicetree/bindings/pci/snps,dw-pcie.yaml b/Documentation/devicetree/bindings/pci/snps,dw-pcie.yaml > > > new file mode 100644 > > > index 000000000000..fd372d715ab4 > > > --- /dev/null > > > +++ b/Documentation/devicetree/bindings/pci/snps,dw-pcie.yaml > > > @@ -0,0 +1,96 @@ > > > +# SPDX-License-Identifier: GPL-2.0 > > > +%YAML 1.2 > > > +--- > > > +$id: http://devicetree.org/schemas/pci/snps,dw-pcie.yaml# > > > +$schema: http://devicetree.org/meta-schemas/core.yaml# > > > + > > > +title: Synopsys DesignWare PCIe interface > > > + > > > +maintainers: > > > + - Jingoo Han > > > + - Gustavo Pimentel > > > + > > > +description: | > > > + Synopsys DesignWare PCIe host controller > > > + > > > +allOf: > > > + - $ref: /schemas/pci/pci-bus.yaml# > > > + > > > +properties: > > > + compatible: > > > + anyOf: > > > + - {} > > > + - const: snps,dw-pcie > > > + > > > + reg: > > > + description: | > > > + It should contain Data Bus Interface (dbi) and config registers for all > > > + versions. > > > + For designware core version >= 4.80, it may contain ATU address space. > > > + minItems: 2 > > > + maxItems: 4 > > > + > > > + reg-names: > > > + minItems: 2 > > > + maxItems: 4 > > > + items: > > > + enum: [dbi, dbi2, config, atu, addr_space, app, elbi, mgmt] > > > > Isn't 'config' only for host and 'addr_space' only for endpoint? > > The problem on enforcing an enum here is that severa *.dts files violate it. > In the specific case of 'addr_space', there is (are?) place(s) where the wrong > compatible was used, like on arch/arm/boot/dts/artpec6.dtsi: > > pcie: pcie@f8050000 { > compatible = "axis,artpec6-pcie", "snps,dw-pcie"; > reg = <0xf8050000 0x2000 > 0xf8040000 0x1000 > 0xc0000000 0x2000>; > reg-names = "dbi", "phy", "config"; > #address-cells = <3>; > #size-cells = <2>; > device_type = "pci"; > /* downstream I/O */ > ranges = <0x81000000 0 0 0xc0002000 0 0x00010000 > /* non-prefetchable memory */ > 0x82000000 0 0xc0012000 0xc0012000 0 0x1ffee000>; > num-lanes = <2>; > bus-range = <0x00 0xff>; > interrupts = ; > interrupt-names = "msi"; > #interrupt-cells = <1>; > interrupt-map-mask = <0 0 0 0x7>; > interrupt-map = <0 0 0 1 &intc GIC_SPI 144 IRQ_TYPE_LEVEL_HIGH>, > <0 0 0 2 &intc GIC_SPI 145 IRQ_TYPE_LEVEL_HIGH>, > <0 0 0 3 &intc GIC_SPI 146 IRQ_TYPE_LEVEL_HIGH>, > <0 0 0 4 &intc GIC_SPI 147 IRQ_TYPE_LEVEL_HIGH>; > axis,syscon-pcie = <&syscon>; > status = "disabled"; > }; > > pcie_ep: pcie_ep@f8050000 { > compatible = "axis,artpec6-pcie-ep", "snps,dw-pcie"; > reg = <0xf8050000 0x2000 > 0xf8051000 0x2000 > 0xf8040000 0x1000 > 0xc0000000 0x20000000>; > reg-names = "dbi", "dbi2", "phy", "addr_space"; > num-ib-windows = <6>; > num-ob-windows = <2>; > num-lanes = <2>; > axis,syscon-pcie = <&syscon>; > status = "disabled"; > }; > > (funny enough, this is not generating warnings here). > > Btw, besides the above, there are some DTS that use something different > from what's there at the enum: > > > $ make CROSS_COMPILE=aarch64-linux-gnu- ARCH=arm64 dtbs_check 2>&1 |tee dtbs_check.log > $ grep "\['dbi', 'dbi2', 'config', 'atu', 'app', 'elbi', 'mgmt'\]" dtbs_check.log|sed "s,From schema:,,"|cut -d: -f 2-|cut -d' ' -f 4-|sort|uniq -c|sort -n -r > 51 'ctrl' is not one of ['dbi', 'dbi2', 'config', 'atu', 'app', 'elbi', 'mgmt'] > 44 'parf' is not one of ['dbi', 'dbi2', 'config', 'atu', 'app', 'elbi', 'mgmt'] > 18 'cfg' is not one of ['dbi', 'dbi2', 'config', 'atu', 'app', 'elbi', 'mgmt'] > 4 'link' is not one of ['dbi', 'dbi2', 'config', 'atu', 'app', 'elbi', 'mgmt'] > > In order to use an enum and not having warnings, the enum should be > instead: > > reg-names: > minItems: 2 > maxItems: 4 > items: > enum: [dbi, dbi2, config, atu, app, elbi, mgmt, ctrl, parf, cfg, link] Actually, some reg definitions have 5 items. I'm sending an updated patch series. Thanks, Mauro