Received: by 2002:a05:7412:798b:b0:fc:a2b0:25d7 with SMTP id fb11csp522728rdb; Thu, 22 Feb 2024 10:40:52 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCV4+j5CNI2EavW9ktYwWedwrXqbqPYS93gd70iRR8pq4fYM66akielGlTuZIim9e4rJhM1XUljlh9vV7AmapYAHmiMLCo6wQWh5D8cKog== X-Google-Smtp-Source: AGHT+IGbMeOPplF5QVs3o9sdh5ZdrANja7ZIY+diMg2vhIEHi2BbaEPUSkKfwVNsZJrNQyq1aeyf X-Received: by 2002:a17:90b:1b4a:b0:29a:377f:3994 with SMTP id nv10-20020a17090b1b4a00b0029a377f3994mr3830331pjb.13.1708627251994; Thu, 22 Feb 2024 10:40:51 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708627251; cv=pass; d=google.com; s=arc-20160816; b=HtFd9xOJ4RGgzkhL5LD/n/9ZEIV07Nxrzam5QZoV4cPAzi+pMfuqr+ieQZpTTvukzJ eCy0k6tnRsfQAam91V7SlvzrO7LPZ7OqWL8uvVxSXnLIsDCSg9J+QFrHWNHpKTqjsPT3 UU14GVWAKpkUKp2IIjaYWw5R8FbySzgv2hNIGcwDbXjtaBA9w2felY5K9QGeb8l2Hkd0 PNRDhGMrMcKUxNjtVqYn6VSx+VbWiAE0Nw+Tc40p7FlcTj5n0xZuy1SzcuGkCPdiePD3 J2QfpSZfmdZjb9XBA8DmAtOH5vXu+Ppf30pZM5VQLRMWmwK0yTBA2VE1Ax0TEt1hECT3 hj2A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=GBPojBkBESLJYLV2b1XSJ8EzFLygJld2cMDAaOPhMXU=; fh=7lOXWe9AL10IhAayc1MEiQlxLf//LRpy00GPJLjlFPI=; b=jDJbntGl5PAQ0Nbzs4UR+B12oiQoT+3oemZygFuDp4Z+9hZUGrwA7Hy9WzCiGMKZB2 4GSjVEdhrRDjwXlk5ECSFoNDic8G1wWkCtp9+jsbwucKW4vg+paQeuf4jJZjkqDzzqCP 1Hz16bFsp0IbXPxPHGOLZkEXi/H7JXelNo/Xc/oVT42GDaq6o/7jIzBEe0/oWHKLei3J DCd+pK1tz8l63S1ZSchWZ8l8/hFd4T9RBy7/RhQANXo9H7iS2n0KyXqjbpdvLTRnJNJY IOeY+cZcsdmmewhq0CAfDrVA9m2KEL031hLrvzu/UdS2phTu8kJAUnoy891Q3VAKlwtg vTXA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=E5mJCdFR; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-77147-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77147-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id p21-20020a17090b011500b0029a47fc9cf9si1660307pjz.178.2024.02.22.10.40.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 10:40:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-77147-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=E5mJCdFR; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-77147-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77147-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id C07CC2824C8 for ; Thu, 22 Feb 2024 18:40:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5B38714265A; Thu, 22 Feb 2024 18:31:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="E5mJCdFR" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F3FCA1EB3A; Thu, 22 Feb 2024 18:31:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708626676; cv=none; b=NXhCotJOl9Bpp82iYQ229hE+2ONyhQy8h8hwhc19UkKTQRV+UEjp21tE0ltEcLDtAX1N6VgQpsFb9Xb49b3ckBTPHeuOK704Blsnd9zmZ3rWy13c/qSrzw0nXpX0NQv5JKewXEwLVflJIyPdAA31Vc3TMIwlw1jufgMG25BvH1g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708626676; c=relaxed/simple; bh=zSwQ+29IemVAKsJR/QppCLHoxlyDpZ3/5G5UcwkHZ9I=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=S5EERpoXSnu6WH/0t/5cILyXA9LWnqIUW3sCK/kZQqStzJ7iDK3v6QmWUfiJN6VFdjkJd/+Vhx3wSmwqrD+fo2/3/kv7qx6jygK0azaVo7tI1TxzBNhZ5Nb74i2PHtUVNbQNSNIK3IpTHIqWS09H2OS0f+YnxoSG4QeWyGEl5IY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=E5mJCdFR; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 217C8C433F1; Thu, 22 Feb 2024 18:31:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708626675; bh=zSwQ+29IemVAKsJR/QppCLHoxlyDpZ3/5G5UcwkHZ9I=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=E5mJCdFRarCvwy2IdOpt8oKhCoNcJU6+NxrAr098IA9x0H1YS/hyHxGAJdfAUzVGl lWAZjQy9ortegc+W3weeRlrky15kfRe/B9oks65Pld3RIHeWTeywjg24LpRHvC3nVh eBvV1quVZX0Aq3tes6jTO3Nw6ztMXdEtIjhPd0pWAiiht2jOMc1bl4fmihOveKQhbT NNTIKf/YD+VQswufCEHRC9RDUfQE1xc2nbz92py0VSYeQsPhnYzDEb6yQtdE1xbMSi aU/xVu+7FJhfTW4zUobEv13BOM+k7j8gc3v2sg/jSujXtaFJkPHb2VX5Qi58cV6FQd XIA5nvee7DJ0A== Date: Thu, 22 Feb 2024 12:30:48 -0600 From: Rob Herring To: Frank Li Cc: Lorenzo Pieralisi , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Bjorn Helgaas , Krzysztof Kozlowski , Conor Dooley , "open list:PCI NATIVE HOST BRIDGE AND ENDPOINT DRIVERS" , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , open list , imx@lists.linux.dev Subject: Re: [PATCH v3 1/1] dt-bindings: pci: layerscape-pci: Convert to yaml format Message-ID: <20240222183048.GA3652979-robh@kernel.org> References: <20240214194145.2669744-1-Frank.Li@nxp.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240214194145.2669744-1-Frank.Li@nxp.com> On Wed, Feb 14, 2024 at 02:41:44PM -0500, Frank Li wrote: > Convert the layerscape-pci PCIe binding document to yaml format. > > Additionally, changes for the layerscape-pci endpoint part: > - Add interrupt name 'pme' restriction for fsl,ls1028a-pcie-ep, > fsl,ls1046a-pcie-ep, and fsl,ls1088a-pcie-ep. > - Add register name restrictions: 'reg' and 'addr_space'. 'addr_space' is > required by snps,dw-pcie-ep. > - Add an example. > > Changes for the layerscape-pci root complex part: > - Add required property: 'reg-names', "#address-cells", "#size-cells", > 'device_type', 'bus-range', 'ranges', "#interrupt-cells", > 'interrupt-map-mask' and 'interrupt-map'. > - Interrupt-names requirement split to each compatible string. > - Add register name restrictions: 'reg' and 'config'. 'config' is required > by snps,dw-pcie. > > Signed-off-by: Frank Li > --- > > Notes: > There are log discuss at v1. If I missed something, let me know. > > Change from v2 to v3 > - update commit message, show change compare txt file > - add failback compatible fsl,ls-pcie-ep. > - add commit message about 'addr_space' and 'config'. > > Change from v1 to v2 > - remove '|-' > - dma-coherent: true > - add interrupts and interrupt-names at before Allof > - remove ref to snps,pcie*.yaml, some reg-names are not aligned with in > drivers > - Add an example for pcie-ep > > .../bindings/pci/fsl,layerscape-pcie-ep.yaml | 110 +++++++++++ > .../bindings/pci/fsl,layerscape-pcie.yaml | 182 ++++++++++++++++++ > .../bindings/pci/layerscape-pci.txt | 79 -------- > 3 files changed, 292 insertions(+), 79 deletions(-) > create mode 100644 Documentation/devicetree/bindings/pci/fsl,layerscape-pcie-ep.yaml > create mode 100644 Documentation/devicetree/bindings/pci/fsl,layerscape-pcie.yaml > delete mode 100644 Documentation/devicetree/bindings/pci/layerscape-pci.txt > > diff --git a/Documentation/devicetree/bindings/pci/fsl,layerscape-pcie-ep.yaml b/Documentation/devicetree/bindings/pci/fsl,layerscape-pcie-ep.yaml > new file mode 100644 > index 0000000000000..b384a0b2fe22e > --- /dev/null > +++ b/Documentation/devicetree/bindings/pci/fsl,layerscape-pcie-ep.yaml > @@ -0,0 +1,110 @@ > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/pci/fsl,layerscape-pcie-ep.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: Freescale Layerscape PCIe Endpoint(EP) controller > + > +maintainers: > + - Frank Li > + > +description: > + This PCIe EP controller is based on the Synopsys DesignWare PCIe IP. Where's the reference to the DWC schema? > + > + This controller derives its clocks from the Reset Configuration Word (RCW) > + which is used to describe the PLL settings at the time of chip-reset. > + > + Also as per the available Reference Manuals, there is no specific 'version' > + register available in the Freescale PCIe controller register set, > + which can allow determining the underlying DesignWare PCIe controller version > + information. > + > +properties: > + compatible: > + items: > + - enum: > + - fsl,ls2088a-pcie-ep > + - fsl,ls1088a-pcie-ep > + - fsl,ls1046a-pcie-ep > + - fsl,ls1028a-pcie-ep > + - fsl,lx2160ar2-pcie-ep > + - const: fsl,ls-pcie-ep > + > + reg: > + maxItems: 2 > + > + reg-names: > + items: > + - const: regs > + - const: addr_space > + > + fsl,pcie-scfg: > + $ref: /schemas/types.yaml#/definitions/phandle > + description: A phandle to the SCFG device node. The second entry is the > + physical PCIe controller index starting from '0'. This is used to get > + SCFG PEXN registers. > + > + big-endian: > + $ref: /schemas/types.yaml#/definitions/flag > + description: If the PEX_LUT and PF register block is in big-endian, specify > + this property. > + > + dma-coherent: true > + > + interrupts: > + minItems: 1 > + maxItems: 2 > + > + interrupt-names: > + minItems: 1 > + maxItems: 2 > + oneOf: > + - anyOf: > + - const: pme > + - const: aer > + - const: intr > + > +required: > + - compatible > + - reg > + - interrupts > + - interrupt-names > + > +allOf: > + - if: > + properties: > + compatible: > + enum: > + - fsl,ls1028a-pcie-ep > + - fsl,ls1046a-pcie-ep > + - fsl,ls1088a-pcie-ep > + then: > + properties: > + interrupt-names: > + items: > + - const: pme > + > +unevaluatedProperties: false > + > +examples: > + - | > + #include > + > + soc { > + #address-cells = <2>; > + #size-cells = <2>; > + > + pcie_ep1: pcie-ep@3400000 { > + compatible = "fsl,ls1028a-pcie-ep", "fsl,ls-pcie-ep"; > + reg = <0x00 0x03400000 0x0 0x00100000 > + 0x80 0x00000000 0x8 0x00000000>; > + reg-names = "regs", "addr_space"; > + interrupts = ; /* PME interrupt */ > + interrupt-names = "pme"; > + num-ib-windows = <6>; > + num-ob-windows = <8>; Not documented and deprecated. > + status = "disabled"; Examples should be enabled. > + }; > + }; > +... > diff --git a/Documentation/devicetree/bindings/pci/fsl,layerscape-pcie.yaml b/Documentation/devicetree/bindings/pci/fsl,layerscape-pcie.yaml > new file mode 100644 > index 0000000000000..988929729580a > --- /dev/null > +++ b/Documentation/devicetree/bindings/pci/fsl,layerscape-pcie.yaml > @@ -0,0 +1,182 @@ > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/pci/fsl,layerscape-pcie.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: Freescale Layerscape PCIe Root Complex(RC) controller > + > +maintainers: > + - Frank Li > + > +description: > + This PCIe RC controller is based on the Synopsys DesignWare PCIe IP > + > + This controller derives its clocks from the Reset Configuration Word (RCW) > + which is used to describe the PLL settings at the time of chip-reset. > + > + Also as per the available Reference Manuals, there is no specific 'version' > + register available in the Freescale PCIe controller register set, > + which can allow determining the underlying DesignWare PCIe controller version > + information. > + > +properties: > + compatible: > + enum: > + - fsl,ls1021a-pcie > + - fsl,ls2080a-pcie > + - fsl,ls2085a-pcie > + - fsl,ls2088a-pcie > + - fsl,ls1088a-pcie > + - fsl,ls1046a-pcie > + - fsl,ls1043a-pcie > + - fsl,ls1012a-pcie > + - fsl,ls1028a-pcie > + - fsl,lx2160a-pcie > + > + reg: > + maxItems: 2 > + > + reg-names: > + items: > + - const: regs > + - const: config > + > + fsl,pcie-scfg: > + $ref: /schemas/types.yaml#/definitions/phandle > + description: A phandle to the SCFG device node. The second entry is the > + physical PCIe controller index starting from '0'. This is used to get > + SCFG PEXN registers. > + > + big-endian: > + $ref: /schemas/types.yaml#/definitions/flag > + description: If the PEX_LUT and PF register block is in big-endian, specify > + this property. > + > + dma-coherent: true > + > + msi-parent: true > + > + iommu-map: true > + > + interrupts: > + minItems: 1 > + maxItems: 3 > + > + interrupt-names: > + minItems: 1 > + maxItems: 3 > + > +required: > + - compatible > + - reg > + - reg-names > + - "#address-cells" > + - "#size-cells" > + - device_type > + - bus-range This should never be required unless you have some restriction in the h/w. DWC generally doesn't. > + - ranges > + - interrupts > + - interrupt-names > + - "#interrupt-cells" > + - interrupt-map-mask > + - interrupt-map The common PCI and DWC schemas already make most of these required, so you don't need to here. > + > +allOf: > + - $ref: /schemas/pci/pci-bus.yaml# > + - if: > + properties: > + compatible: > + enum: > + - fsl,lx2160a-pcie > + then: > + properties: > + interrupts: > + maxItems: 2 > + interrupt-names: > + items: > + - const: pme > + - const: aer > + - const: intr > + > + - if: > + properties: > + compatible: > + enum: > + - fsl,ls1028a-pcie > + - fsl,ls1046a-pcie > + - fsl,ls1043a-pcie > + - fsl,ls1012a-pcie > + then: > + properties: > + interrupts: > + maxItems: 2 > + interrupt-names: > + items: > + - const: pme > + - const: aer > + > + - if: > + properties: > + compatible: > + enum: > + - fsl,ls2080a-pcie > + - fsl,ls2085a-pcie > + - fsl,ls2088a-pcie > + - fsl,ls1021a-pcie > + then: > + properties: > + interrupts: > + maxItems: 1 > + interrupt-names: > + items: > + - const: intr > + > + - if: > + properties: > + compatible: > + enum: > + - fsl,ls1088a-pcie > + then: > + properties: > + interrupts: > + maxItems: 1 > + interrupt-names: > + items: > + - const: aer > + > +unevaluatedProperties: false > + > +examples: > + - | > + #include > + > + soc { > + #address-cells = <2>; > + #size-cells = <2>; > + > + pcie@3400000 { > + compatible = "fsl,ls1088a-pcie"; > + reg = <0x00 0x03400000 0x0 0x00100000>, /* controller registers */ > + <0x20 0x00000000 0x0 0x00002000>; /* configuration space */ > + reg-names = "regs", "config"; > + interrupts = <0 108 IRQ_TYPE_LEVEL_HIGH>; /* aer interrupt */ > + interrupt-names = "aer"; > + #address-cells = <3>; > + #size-cells = <2>; > + dma-coherent; > + device_type = "pci"; > + bus-range = <0x0 0xff>; > + ranges = <0x81000000 0x0 0x00000000 0x20 0x00010000 0x0 0x00010000 /* downstream I/O */ > + 0x82000000 0x0 0x40000000 0x20 0x40000000 0x0 0x40000000>; /* non-prefetchable memory */ > + msi-parent = <&its>; > + #interrupt-cells = <1>; > + interrupt-map-mask = <0 0 0 7>; > + interrupt-map = <0000 0 0 1 &gic 0 0 0 109 IRQ_TYPE_LEVEL_HIGH>, > + <0000 0 0 2 &gic 0 0 0 110 IRQ_TYPE_LEVEL_HIGH>, > + <0000 0 0 3 &gic 0 0 0 111 IRQ_TYPE_LEVEL_HIGH>, > + <0000 0 0 4 &gic 0 0 0 112 IRQ_TYPE_LEVEL_HIGH>; > + iommu-map = <0 &smmu 0 1>; /* Fixed-up by bootloader */ > + }; > + }; > +...