Message ID | 20230406111142.74410-2-minda.chen@starfivetech.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp947290vqo; Thu, 6 Apr 2023 04:27:22 -0700 (PDT) X-Google-Smtp-Source: AKy350ZwUroM6An3d68r+/Zb9WhE41910iywyVgunSe3CUGO4YGGNBNqSC4K3dU7EigvjL9dG0pZ X-Received: by 2002:a17:90b:4b03:b0:23f:10ee:feef with SMTP id lx3-20020a17090b4b0300b0023f10eefeefmr11002845pjb.19.1680780442052; Thu, 06 Apr 2023 04:27:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680780442; cv=none; d=google.com; s=arc-20160816; b=m16bOTism3rBSaY8Xoonw4g1WdYMGcehZfqOfrqQwVxwG6p4KGFJpKwg47xJVDWc6/ Ff1CI/wmBqchCczL6kwt7TYBYxiNr22eZv0h59qAyVWt2Oaj5sAcbuAb+EQ2e+QW9LBR aCXeSVTQyxIlEj1vtgY91/44Q5Mr7NF8w/UccVl17cJI70ZJ5ZfqphaU2KqQGhrB3T/X jw1c6x9CzuTlpdK99vwyOO+lyadKJhx9HFB73Dmzove42TlD5pacD5YVtgy3lXMWVdOI mUMppISLJhOg+9SOdBn/Qn4uAgta5N6UxBwJ4VDcnY3A4VhvMdXx1pOMj2oo6Thh06rZ q5lw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=biaGDbUhwVvvT4J1KatLHhC182fWYhLtdIKa+AGdzW0=; b=m3VTjhaTCNhx59t4sWjdQT4VO7SEf+jxncIb6t/B570kBKNOzaxKrAtK2adb3kkTGV aczU7pfWhqwFZVWnUkm7X1JOpucPPAnX8YcEnujhRrOPOJyrJHjcZlr1KGJdxuzjkjZn V0Uei7WBFwm5ZbhDH8YD/fgtfAjyKgLu9GnFIm94s613bzGjcT7AbdOZN4Ggtg00P+2v Spc8sCZvkUIAELKYDeLnS9qxs4PKA2Iwjq9ANyK9ROaRGTziHrSkAf27+VCbziiqjOPI BOwFj171Z5PeaJVbE/HLv9cOSZ3m31ukTZiIzGcy10NBGR/aPPQA12NsL3a6ifSL9Hft +n8Q== ARC-Authentication-Results: i=1; mx.google.com; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nk10-20020a17090b194a00b00233ce76f19dsi1142653pjb.11.2023.04.06.04.27.09; Thu, 06 Apr 2023 04:27:22 -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; 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 S236532AbjDFLME (ORCPT <rfc822;lkml4gm@gmail.com> + 99 others); Thu, 6 Apr 2023 07:12:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39012 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237507AbjDFLL6 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 6 Apr 2023 07:11:58 -0400 Received: from ex01.ufhost.com (ex01.ufhost.com [61.152.239.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AE07E900E; Thu, 6 Apr 2023 04:11:52 -0700 (PDT) Received: from EXMBX165.cuchost.com (unknown [175.102.18.54]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "EXMBX165", Issuer "EXMBX165" (not verified)) by ex01.ufhost.com (Postfix) with ESMTP id 49E6C24E197; Thu, 6 Apr 2023 19:11:46 +0800 (CST) Received: from EXMBX171.cuchost.com (172.16.6.91) by EXMBX165.cuchost.com (172.16.6.75) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Thu, 6 Apr 2023 19:11:46 +0800 Received: from ubuntu.localdomain (183.27.97.179) by EXMBX171.cuchost.com (172.16.6.91) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Thu, 6 Apr 2023 19:11:45 +0800 From: Minda Chen <minda.chen@starfivetech.com> To: Emil Renner Berthing <emil.renner.berthing@canonical.com>, Conor Dooley <conor@kernel.org>, Rob Herring <robh+dt@kernel.org>, Bjorn Helgaas <bhelgaas@google.com>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Lorenzo Pieralisi <lpieralisi@kernel.org>, =?utf-8?q?Krzysztof_Wilczy=C5=84?= =?utf-8?q?ski?= <kw@linux.com> CC: <devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>, <linux-riscv@lists.infradead.org>, <linux-pci@vger.kernel.org>, Paul Walmsley <paul.walmsley@sifive.com>, Palmer Dabbelt <palmer@dabbelt.com>, Albert Ou <aou@eecs.berkeley.edu>, Philipp Zabel <p.zabel@pengutronix.de>, Mason Huo <mason.huo@starfivetech.com>, Leyfoon Tan <leyfoon.tan@starfivetech.com>, Kevin Xie <kevin.xie@starfivetech.com>, Minda Chen <minda.chen@starfivetech.com> Subject: [PATCH v1 1/3] dt-binding: pci: add JH7110 PCIe dt-binding documents. Date: Thu, 6 Apr 2023 19:11:40 +0800 Message-ID: <20230406111142.74410-2-minda.chen@starfivetech.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230406111142.74410-1-minda.chen@starfivetech.com> References: <20230406111142.74410-1-minda.chen@starfivetech.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [183.27.97.179] X-ClientProxiedBy: EXCAS066.cuchost.com (172.16.6.26) To EXMBX171.cuchost.com (172.16.6.91) X-YovoleRuleAgent: yovoleflag X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762426032625187275?= X-GMAIL-MSGID: =?utf-8?q?1762426032625187275?= |
Series |
Add JH7110 PCIe driver support
|
|
Commit Message
Minda Chen
April 6, 2023, 11:11 a.m. UTC
Add PCIe controller driver dt-binding documents
for StarFive JH7110 SoC platform.
Signed-off-by: Minda Chen <minda.chen@starfivetech.com>
---
.../bindings/pci/starfive,jh7110-pcie.yaml | 163 ++++++++++++++++++
1 file changed, 163 insertions(+)
create mode 100644 Documentation/devicetree/bindings/pci/starfive,jh7110-pcie.yaml
Comments
On 06/04/2023 13:11, Minda Chen wrote: > Add PCIe controller driver dt-binding documents > for StarFive JH7110 SoC platform. Use subject prefixes matching the subsystem (which you can get for example with `git log --oneline -- DIRECTORY_OR_FILE` on the directory your patch is touching). Missing: 's' Subject: drop second/last, redundant "dt-binding documents". The "dt-bindings" prefix is already stating that these are bindings and documentation. Drop also full stop. > > Signed-off-by: Minda Chen <minda.chen@starfivetech.com> > --- > .../bindings/pci/starfive,jh7110-pcie.yaml | 163 ++++++++++++++++++ > 1 file changed, 163 insertions(+) > create mode 100644 Documentation/devicetree/bindings/pci/starfive,jh7110-pcie.yaml > > diff --git a/Documentation/devicetree/bindings/pci/starfive,jh7110-pcie.yaml b/Documentation/devicetree/bindings/pci/starfive,jh7110-pcie.yaml > new file mode 100644 > index 000000000000..fa4829766195 > --- /dev/null > +++ b/Documentation/devicetree/bindings/pci/starfive,jh7110-pcie.yaml > @@ -0,0 +1,163 @@ > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/pci/starfive,jh7110-pcie.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: StarFive JH7110 PCIe 2.0 host controller > + > +maintainers: > + - Minda Chen <minda.chen@starfivetech.com> > + > +allOf: > + - $ref: /schemas/pci/pci-bus.yaml# > + - $ref: /schemas/interrupt-controller/msi-controller.yaml# > + > +properties: > + compatible: > + const: starfive,jh7110-pcie > + > + reg: > + maxItems: 2 > + > + reg-names: > + items: > + - const: reg > + - const: config > + > + msi-parent: true > + > + interrupts: > + maxItems: 1 > + > + clocks: > + maxItems: 4 > + > + clock-names: > + items: > + - const: noc > + - const: tl > + - const: axi_mst0 > + - const: apb > + > + resets: > + items: > + - description: AXI MST0 reset > + - description: AXI SLAVE reset > + - description: AXI SLAVE0 reset > + - description: PCIE BRIDGE reset > + - description: PCIE CORE reset > + - description: PCIE APB reset > + > + reset-names: > + items: > + - const: mst0 > + - const: slv0 > + - const: slv > + - const: brg > + - const: core > + - const: apb > + > + starfive,stg-syscon: > + $ref: /schemas/types.yaml#/definitions/phandle-array > + items: > + items: > + - description: phandle to System Register Controller stg_syscon node. > + - description: register0 offset of STG_SYSCONSAIF__SYSCFG register for PCIe. > + - description: register1 offset of STG_SYSCONSAIF__SYSCFG register for PCIe. > + - description: register2 offset of STG_SYSCONSAIF__SYSCFG register for PCIe. > + - description: register3 offset of STG_SYSCONSAIF__SYSCFG register for PCIe. > + description: > + The phandle to System Register Controller syscon node and the offset > + of STG_SYSCONSAIF__SYSCFG register for PCIe. Total 4 regsisters offset > + for PCIe. > + > + pwren-gpios: > + description: Should specify the GPIO for controlling the PCI bus device power on. What are these? Different than defined in gpio-consumer-common? > + maxItems: 1 > + > + reset-gpios: > + maxItems: 1 > + > + phys: > + maxItems: 1 > + > + interrupt-controller: > + type: object > + properties: > + '#address-cells': > + const: 0 > + > + '#interrupt-cells': > + const: 1 > + > + interrupt-controller: true > + > + required: > + - '#address-cells' > + - '#interrupt-cells' > + - interrupt-controller > + > + additionalProperties: false > + > +required: > + - reg > + - reg-names > + - "#interrupt-cells" Keep consistent quotes - either ' or " Are you sure this is correct? You have interrupt controller as child node. > + - interrupts > + - interrupt-map-mask > + - interrupt-map > + - clocks > + - clock-names > + - resets > + - msi-controller > + > +unevaluatedProperties: false > + > +examples: > + - | > + bus { > + #address-cells = <2>; > + #size-cells = <2>; > + > + pcie0: pcie@2B000000 { Lowercase hex. Everywhere. > + compatible = "starfive,jh7110-pcie"; > + #address-cells = <3>; > + #size-cells = <2>; > + #interrupt-cells = <1>; > + reg = <0x0 0x2B000000 0x0 0x1000000>, > + <0x9 0x40000000 0x0 0x10000000>; reg (and reg-names and ranges) is always second property. > + reg-names = "reg", "config"; > + device_type = "pci"; > + starfive,stg-syscon = <&stg_syscon 0xc0 0xc4 0x130 0x1b8>; > + bus-range = <0x0 0xff>; > + ranges = <0x82000000 0x0 0x30000000 0x0 0x30000000 0x0 0x08000000>, > + <0xc3000000 0x9 0x00000000 0x9 0x00000000 0x0 0x40000000>; > + interrupt-parent = <&plic>; > + interrupts = <56>; > + interrupt-map-mask = <0x0 0x0 0x0 0x7>; > + interrupt-map = <0x0 0x0 0x0 0x1 &pcie_intc0 0x1>, > + <0x0 0x0 0x0 0x2 &pcie_intc0 0x2>, > + <0x0 0x0 0x0 0x3 &pcie_intc0 0x3>, > + <0x0 0x0 0x0 0x4 &pcie_intc0 0x4>; Best regards, Krzysztof
On Thu, Apr 06, 2023 at 08:24:55PM +0200, Krzysztof Kozlowski wrote: > On 06/04/2023 13:11, Minda Chen wrote: > > + > > + interrupt-controller: > > + type: object > > + properties: > > + '#address-cells': > > + const: 0 > > + > > + '#interrupt-cells': > > + const: 1 > > + > > + interrupt-controller: true > > + > > + required: > > + - '#address-cells' > > + - '#interrupt-cells' > > + - interrupt-controller > > + > > + additionalProperties: false > > + > > +required: > > + - reg > > + - reg-names > > + - "#interrupt-cells" > > Keep consistent quotes - either ' or " > > Are you sure this is correct? You have interrupt controller as child node. I know existing stuff in-tree is far from a guarantee that it'll be right, but this does at least follow what we've got for PolarFire SoC: Documentation/devicetree/bindings/pci/microchip,pcie-host.yaml Both PLDA and both RISC-V w/ a PLIC as the interrupt controller, so in similar waters. This note existed in the original text form binding of the Microchip PCI controller: | +NOTE: | +The core provides a single interrupt for both INTx/MSI messages. So, | +create an interrupt controller node to support 'interrupt-map' DT | +functionality. The driver will create an IRQ domain for this map, decode | +the four INTx interrupts in ISR and route them to this domain. Given the similarities, I figure the same requirement applies here too. Minda? Cheers, Conor.
On Thu, Apr 06, 2023 at 07:35:09PM +0100, Conor Dooley wrote: > On Thu, Apr 06, 2023 at 08:24:55PM +0200, Krzysztof Kozlowski wrote: > > On 06/04/2023 13:11, Minda Chen wrote: > > > + > > > + interrupt-controller: > > > + type: object > > > + properties: > > > + '#address-cells': > > > + const: 0 > > > + > > > + '#interrupt-cells': > > > + const: 1 > > > + > > > + interrupt-controller: true > > > + > > > + required: > > > + - '#address-cells' > > > + - '#interrupt-cells' > > > + - interrupt-controller > > > + > > > + additionalProperties: false > > > + > > > +required: > > > + - reg > > > + - reg-names > > > + - "#interrupt-cells" > > > > Keep consistent quotes - either ' or " > > > > Are you sure this is correct? You have interrupt controller as child node. > > I know existing stuff in-tree is far from a guarantee that it'll be > right, but this does at least follow what we've got for PolarFire SoC: > Documentation/devicetree/bindings/pci/microchip,pcie-host.yaml > > Both PLDA and both RISC-V w/ a PLIC as the interrupt controller, so in > similar waters. > This note existed in the original text form binding of the Microchip > PCI controller: > | +NOTE: > | +The core provides a single interrupt for both INTx/MSI messages. So, > | +create an interrupt controller node to support 'interrupt-map' DT > | +functionality. The driver will create an IRQ domain for this map, decode > | +the four INTx interrupts in ISR and route them to this domain. > > Given the similarities, I figure the same requirement applies here too. > Minda? Further, if, as I currently suspect, there's a lot of commonality here, should the binding as well as the driver be split into common pdla bits and microchip/starfive specific ones? Suppose that's more one for you Krzysztof. Cheers, Conor.
On 06/04/2023 20:45, Conor Dooley wrote: > On Thu, Apr 06, 2023 at 07:35:09PM +0100, Conor Dooley wrote: >> On Thu, Apr 06, 2023 at 08:24:55PM +0200, Krzysztof Kozlowski wrote: >>> On 06/04/2023 13:11, Minda Chen wrote: >>>> + >>>> + interrupt-controller: >>>> + type: object >>>> + properties: >>>> + '#address-cells': >>>> + const: 0 >>>> + >>>> + '#interrupt-cells': >>>> + const: 1 >>>> + >>>> + interrupt-controller: true >>>> + >>>> + required: >>>> + - '#address-cells' >>>> + - '#interrupt-cells' >>>> + - interrupt-controller >>>> + >>>> + additionalProperties: false >>>> + >>>> +required: >>>> + - reg >>>> + - reg-names >>>> + - "#interrupt-cells" >>> >>> Keep consistent quotes - either ' or " >>> >>> Are you sure this is correct? You have interrupt controller as child node. >> >> I know existing stuff in-tree is far from a guarantee that it'll be >> right, but this does at least follow what we've got for PolarFire SoC: >> Documentation/devicetree/bindings/pci/microchip,pcie-host.yaml >> >> Both PLDA and both RISC-V w/ a PLIC as the interrupt controller, so in >> similar waters. >> This note existed in the original text form binding of the Microchip >> PCI controller: >> | +NOTE: >> | +The core provides a single interrupt for both INTx/MSI messages. So, >> | +create an interrupt controller node to support 'interrupt-map' DT >> | +functionality. The driver will create an IRQ domain for this map, decode >> | +the four INTx interrupts in ISR and route them to this domain. >> >> Given the similarities, I figure the same requirement applies here too. >> Minda? > > Further, if, as I currently suspect, there's a lot of commonality here, > should the binding as well as the driver be split into common pdla bits > and microchip/starfive specific ones? > > Suppose that's more one for you Krzysztof. Yeah, looks like only clocks and resets are different. At the end it depends how much code you would remove... Best regards, Krzysztof
On 2023/4/7 2:35, Conor Dooley wrote: > On Thu, Apr 06, 2023 at 08:24:55PM +0200, Krzysztof Kozlowski wrote: >> On 06/04/2023 13:11, Minda Chen wrote: >> > + >> > + interrupt-controller: >> > + type: object >> > + properties: >> > + '#address-cells': >> > + const: 0 >> > + >> > + '#interrupt-cells': >> > + const: 1 >> > + >> > + interrupt-controller: true >> > + >> > + required: >> > + - '#address-cells' >> > + - '#interrupt-cells' >> > + - interrupt-controller >> > + >> > + additionalProperties: false >> > + >> > +required: >> > + - reg >> > + - reg-names >> > + - "#interrupt-cells" >> >> Keep consistent quotes - either ' or " >> >> Are you sure this is correct? You have interrupt controller as child node. > > I know existing stuff in-tree is far from a guarantee that it'll be > right, but this does at least follow what we've got for PolarFire SoC: > Documentation/devicetree/bindings/pci/microchip,pcie-host.yaml > > Both PLDA and both RISC-V w/ a PLIC as the interrupt controller, so in > similar waters. > This note existed in the original text form binding of the Microchip > PCI controller: > | +NOTE: > | +The core provides a single interrupt for both INTx/MSI messages. So, > | +create an interrupt controller node to support 'interrupt-map' DT > | +functionality. The driver will create an IRQ domain for this map, decode > | +the four INTx interrupts in ISR and route them to this domain. > > Given the similarities, I figure the same requirement applies here too. > Minda? > > Cheers, > Conor. Yes, Thanks very much.
On 2023/4/7 2:24, Krzysztof Kozlowski wrote: > On 06/04/2023 13:11, Minda Chen wrote: >> Add PCIe controller driver dt-binding documents >> for StarFive JH7110 SoC platform. > > Use subject prefixes matching the subsystem (which you can get for > example with `git log --oneline -- DIRECTORY_OR_FILE` on the directory > your patch is touching). Missing: 's' > > Subject: drop second/last, redundant "dt-binding documents". The > "dt-bindings" prefix is already stating that these are bindings and > documentation. > > Drop also full stop. > ok, thanks >> >> Signed-off-by: Minda Chen <minda.chen@starfivetech.com> >> --- >> .../bindings/pci/starfive,jh7110-pcie.yaml | 163 ++++++++++++++++++ >> 1 file changed, 163 insertions(+) >> create mode 100644 Documentation/devicetree/bindings/pci/starfive,jh7110-pcie.yaml >> >> diff --git a/Documentation/devicetree/bindings/pci/starfive,jh7110-pcie.yaml b/Documentation/devicetree/bindings/pci/starfive,jh7110-pcie.yaml >> new file mode 100644 >> index 000000000000..fa4829766195 >> --- /dev/null >> +++ b/Documentation/devicetree/bindings/pci/starfive,jh7110-pcie.yaml >> @@ -0,0 +1,163 @@ >> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) >> +%YAML 1.2 >> +--- >> +$id: http://devicetree.org/schemas/pci/starfive,jh7110-pcie.yaml# >> +$schema: http://devicetree.org/meta-schemas/core.yaml# >> + >> +title: StarFive JH7110 PCIe 2.0 host controller >> + >> +maintainers: >> + - Minda Chen <minda.chen@starfivetech.com> >> + >> +allOf: >> + - $ref: /schemas/pci/pci-bus.yaml# >> + - $ref: /schemas/interrupt-controller/msi-controller.yaml# >> + >> +properties: >> + compatible: >> + const: starfive,jh7110-pcie >> + >> + reg: >> + maxItems: 2 >> + >> + reg-names: >> + items: >> + - const: reg >> + - const: config >> + >> + msi-parent: true >> + >> + interrupts: >> + maxItems: 1 >> + >> + clocks: >> + maxItems: 4 >> + >> + clock-names: >> + items: >> + - const: noc >> + - const: tl >> + - const: axi_mst0 >> + - const: apb >> + >> + resets: >> + items: >> + - description: AXI MST0 reset >> + - description: AXI SLAVE reset >> + - description: AXI SLAVE0 reset >> + - description: PCIE BRIDGE reset >> + - description: PCIE CORE reset >> + - description: PCIE APB reset >> + >> + reset-names: >> + items: >> + - const: mst0 >> + - const: slv0 >> + - const: slv >> + - const: brg >> + - const: core >> + - const: apb >> + >> + starfive,stg-syscon: >> + $ref: /schemas/types.yaml#/definitions/phandle-array >> + items: >> + items: >> + - description: phandle to System Register Controller stg_syscon node. >> + - description: register0 offset of STG_SYSCONSAIF__SYSCFG register for PCIe. >> + - description: register1 offset of STG_SYSCONSAIF__SYSCFG register for PCIe. >> + - description: register2 offset of STG_SYSCONSAIF__SYSCFG register for PCIe. >> + - description: register3 offset of STG_SYSCONSAIF__SYSCFG register for PCIe. >> + description: >> + The phandle to System Register Controller syscon node and the offset >> + of STG_SYSCONSAIF__SYSCFG register for PCIe. Total 4 regsisters offset >> + for PCIe. >> + >> + pwren-gpios: >> + description: Should specify the GPIO for controlling the PCI bus device power on. > > What are these? Different than defined in gpio-consumer-common? > power gpio board level configuration. It it not a requried property >> + maxItems: 1 >> + >> + reset-gpios: >> + maxItems: 1 >> + >> + phys: >> + maxItems: 1 >> + >> + interrupt-controller: >> + type: object >> + properties: >> + '#address-cells': >> + const: 0 >> + >> + '#interrupt-cells': >> + const: 1 >> + >> + interrupt-controller: true >> + >> + required: >> + - '#address-cells' >> + - '#interrupt-cells' >> + - interrupt-controller >> + >> + additionalProperties: false >> + >> +required: >> + - reg >> + - reg-names >> + - "#interrupt-cells" > > Keep consistent quotes - either ' or " > > Are you sure this is correct? You have interrupt controller as child node. > > >> + - interrupts >> + - interrupt-map-mask >> + - interrupt-map >> + - clocks >> + - clock-names >> + - resets >> + - msi-controller >> + >> +unevaluatedProperties: false >> + >> +examples: >> + - | >> + bus { >> + #address-cells = <2>; >> + #size-cells = <2>; >> + >> + pcie0: pcie@2B000000 { > > Lowercase hex. Everywhere. > ok >> + compatible = "starfive,jh7110-pcie"; >> + #address-cells = <3>; >> + #size-cells = <2>; >> + #interrupt-cells = <1>; >> + reg = <0x0 0x2B000000 0x0 0x1000000>, >> + <0x9 0x40000000 0x0 0x10000000>; > > reg (and reg-names and ranges) is always second property. > ok >> + reg-names = "reg", "config"; >> + device_type = "pci"; >> + starfive,stg-syscon = <&stg_syscon 0xc0 0xc4 0x130 0x1b8>; >> + bus-range = <0x0 0xff>; >> + ranges = <0x82000000 0x0 0x30000000 0x0 0x30000000 0x0 0x08000000>, >> + <0xc3000000 0x9 0x00000000 0x9 0x00000000 0x0 0x40000000>; >> + interrupt-parent = <&plic>; >> + interrupts = <56>; >> + interrupt-map-mask = <0x0 0x0 0x0 0x7>; >> + interrupt-map = <0x0 0x0 0x0 0x1 &pcie_intc0 0x1>, >> + <0x0 0x0 0x0 0x2 &pcie_intc0 0x2>, >> + <0x0 0x0 0x0 0x3 &pcie_intc0 0x3>, >> + <0x0 0x0 0x0 0x4 &pcie_intc0 0x4>; > > > Best regards, > Krzysztof >
On 10/04/2023 11:05, Minda Chen wrote: >>> + >>> + starfive,stg-syscon: >>> + $ref: /schemas/types.yaml#/definitions/phandle-array >>> + items: >>> + items: >>> + - description: phandle to System Register Controller stg_syscon node. >>> + - description: register0 offset of STG_SYSCONSAIF__SYSCFG register for PCIe. >>> + - description: register1 offset of STG_SYSCONSAIF__SYSCFG register for PCIe. >>> + - description: register2 offset of STG_SYSCONSAIF__SYSCFG register for PCIe. >>> + - description: register3 offset of STG_SYSCONSAIF__SYSCFG register for PCIe. >>> + description: >>> + The phandle to System Register Controller syscon node and the offset >>> + of STG_SYSCONSAIF__SYSCFG register for PCIe. Total 4 regsisters offset >>> + for PCIe. >>> + >>> + pwren-gpios: >>> + description: Should specify the GPIO for controlling the PCI bus device power on. >> >> What are these? Different than defined in gpio-consumer-common? >> > power gpio board level configuration. It it not a requried property What is "board level configuration"? Again - is it different than powerdown-gpios from gpio-consumer-common.yaml? Best regards, Krzysztof
On 2023/4/10 23:21, Krzysztof Kozlowski wrote: > On 10/04/2023 11:05, Minda Chen wrote: >>>> + >>>> + starfive,stg-syscon: >>>> + $ref: /schemas/types.yaml#/definitions/phandle-array >>>> + items: >>>> + items: >>>> + - description: phandle to System Register Controller stg_syscon node. >>>> + - description: register0 offset of STG_SYSCONSAIF__SYSCFG register for PCIe. >>>> + - description: register1 offset of STG_SYSCONSAIF__SYSCFG register for PCIe. >>>> + - description: register2 offset of STG_SYSCONSAIF__SYSCFG register for PCIe. >>>> + - description: register3 offset of STG_SYSCONSAIF__SYSCFG register for PCIe. >>>> + description: >>>> + The phandle to System Register Controller syscon node and the offset >>>> + of STG_SYSCONSAIF__SYSCFG register for PCIe. Total 4 regsisters offset >>>> + for PCIe. >>>> + >>>> + pwren-gpios: >>>> + description: Should specify the GPIO for controlling the PCI bus device power on. >>> >>> What are these? Different than defined in gpio-consumer-common? >>> >> power gpio board level configuration. It it not a requried property > > What is "board level configuration"? Again - is it different than > powerdown-gpios from gpio-consumer-common.yaml? > > I am sorry. I will change to powerdown-gpios follow gpio-consumer-common.yaml > > Best regards, > Krzysztof >
On Thu, Apr 6, 2023 at 7:59 PM Minda Chen <minda.chen@starfivetech.com> wrote: > > Add PCIe controller driver dt-binding documents > for StarFive JH7110 SoC platform. > > Signed-off-by: Minda Chen <minda.chen@starfivetech.com> > --- > .../bindings/pci/starfive,jh7110-pcie.yaml | 163 ++++++++++++++++++ > 1 file changed, 163 insertions(+) > create mode 100644 Documentation/devicetree/bindings/pci/starfive,jh7110-pcie.yaml > > diff --git a/Documentation/devicetree/bindings/pci/starfive,jh7110-pcie.yaml b/Documentation/devicetree/bindings/pci/starfive,jh7110-pcie.yaml > new file mode 100644 > index 000000000000..fa4829766195 > --- /dev/null > +++ b/Documentation/devicetree/bindings/pci/starfive,jh7110-pcie.yaml > @@ -0,0 +1,163 @@ > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/pci/starfive,jh7110-pcie.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: StarFive JH7110 PCIe 2.0 host controller > + > +maintainers: > + - Minda Chen <minda.chen@starfivetech.com> > + > +allOf: > + - $ref: /schemas/pci/pci-bus.yaml# > + - $ref: /schemas/interrupt-controller/msi-controller.yaml# > + > +properties: > + compatible: > + const: starfive,jh7110-pcie Since this is a PLDA IP that is likely to be reused by other vendors, should this indicate the PLDA in the string? Or the file name should be renamed to something like the synopsis dw-pcie? > + > + reg: > + maxItems: 2 > + > + reg-names: > + items: > + - const: reg > + - const: config > + > + msi-parent: true > + > + interrupts: > + maxItems: 1 > + > + clocks: > + maxItems: 4 > + > + clock-names: > + items: > + - const: noc > + - const: tl > + - const: axi_mst0 > + - const: apb > + > + resets: > + items: > + - description: AXI MST0 reset > + - description: AXI SLAVE reset > + - description: AXI SLAVE0 reset > + - description: PCIE BRIDGE reset > + - description: PCIE CORE reset > + - description: PCIE APB reset > + > + reset-names: > + items: > + - const: mst0 > + - const: slv0 > + - const: slv > + - const: brg > + - const: core > + - const: apb > + > + starfive,stg-syscon: > + $ref: /schemas/types.yaml#/definitions/phandle-array > + items: > + items: > + - description: phandle to System Register Controller stg_syscon node. > + - description: register0 offset of STG_SYSCONSAIF__SYSCFG register for PCIe. > + - description: register1 offset of STG_SYSCONSAIF__SYSCFG register for PCIe. > + - description: register2 offset of STG_SYSCONSAIF__SYSCFG register for PCIe. > + - description: register3 offset of STG_SYSCONSAIF__SYSCFG register for PCIe. > + description: > + The phandle to System Register Controller syscon node and the offset > + of STG_SYSCONSAIF__SYSCFG register for PCIe. Total 4 regsisters offset > + for PCIe. > + > + pwren-gpios: > + description: Should specify the GPIO for controlling the PCI bus device power on. > + maxItems: 1 > + > + reset-gpios: > + maxItems: 1 > + > + phys: > + maxItems: 1 > + > + interrupt-controller: > + type: object > + properties: > + '#address-cells': > + const: 0 > + > + '#interrupt-cells': > + const: 1 > + > + interrupt-controller: true > + > + required: > + - '#address-cells' > + - '#interrupt-cells' > + - interrupt-controller > + > + additionalProperties: false > + > +required: > + - reg > + - reg-names > + - "#interrupt-cells" > + - interrupts > + - interrupt-map-mask > + - interrupt-map > + - clocks > + - clock-names > + - resets > + - msi-controller > + > +unevaluatedProperties: false > + > +examples: > + - | > + bus { > + #address-cells = <2>; > + #size-cells = <2>; > + > + pcie0: pcie@2B000000 { > + compatible = "starfive,jh7110-pcie"; > + #address-cells = <3>; > + #size-cells = <2>; > + #interrupt-cells = <1>; > + reg = <0x0 0x2B000000 0x0 0x1000000>, > + <0x9 0x40000000 0x0 0x10000000>; > + reg-names = "reg", "config"; > + device_type = "pci"; > + starfive,stg-syscon = <&stg_syscon 0xc0 0xc4 0x130 0x1b8>; > + bus-range = <0x0 0xff>; > + ranges = <0x82000000 0x0 0x30000000 0x0 0x30000000 0x0 0x08000000>, > + <0xc3000000 0x9 0x00000000 0x9 0x00000000 0x0 0x40000000>; > + interrupt-parent = <&plic>; > + interrupts = <56>; > + interrupt-map-mask = <0x0 0x0 0x0 0x7>; > + interrupt-map = <0x0 0x0 0x0 0x1 &pcie_intc0 0x1>, > + <0x0 0x0 0x0 0x2 &pcie_intc0 0x2>, > + <0x0 0x0 0x0 0x3 &pcie_intc0 0x3>, > + <0x0 0x0 0x0 0x4 &pcie_intc0 0x4>; > + msi-parent = <&pcie0>; > + msi-controller; > + clocks = <&syscrg 86>, > + <&stgcrg 10>, > + <&stgcrg 8>, > + <&stgcrg 9>; > + clock-names = "noc", "tl", "axi_mst0", "apb"; > + resets = <&stgcrg 11>, > + <&stgcrg 12>, > + <&stgcrg 13>, > + <&stgcrg 14>, > + <&stgcrg 15>, > + <&stgcrg 16>; > + > + pcie_intc0: interrupt-controller { > + #address-cells = <0>; > + #interrupt-cells = <1>; > + interrupt-controller; > + }; > + }; > + }; > -- Regards, Bin
diff --git a/Documentation/devicetree/bindings/pci/starfive,jh7110-pcie.yaml b/Documentation/devicetree/bindings/pci/starfive,jh7110-pcie.yaml new file mode 100644 index 000000000000..fa4829766195 --- /dev/null +++ b/Documentation/devicetree/bindings/pci/starfive,jh7110-pcie.yaml @@ -0,0 +1,163 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/pci/starfive,jh7110-pcie.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: StarFive JH7110 PCIe 2.0 host controller + +maintainers: + - Minda Chen <minda.chen@starfivetech.com> + +allOf: + - $ref: /schemas/pci/pci-bus.yaml# + - $ref: /schemas/interrupt-controller/msi-controller.yaml# + +properties: + compatible: + const: starfive,jh7110-pcie + + reg: + maxItems: 2 + + reg-names: + items: + - const: reg + - const: config + + msi-parent: true + + interrupts: + maxItems: 1 + + clocks: + maxItems: 4 + + clock-names: + items: + - const: noc + - const: tl + - const: axi_mst0 + - const: apb + + resets: + items: + - description: AXI MST0 reset + - description: AXI SLAVE reset + - description: AXI SLAVE0 reset + - description: PCIE BRIDGE reset + - description: PCIE CORE reset + - description: PCIE APB reset + + reset-names: + items: + - const: mst0 + - const: slv0 + - const: slv + - const: brg + - const: core + - const: apb + + starfive,stg-syscon: + $ref: /schemas/types.yaml#/definitions/phandle-array + items: + items: + - description: phandle to System Register Controller stg_syscon node. + - description: register0 offset of STG_SYSCONSAIF__SYSCFG register for PCIe. + - description: register1 offset of STG_SYSCONSAIF__SYSCFG register for PCIe. + - description: register2 offset of STG_SYSCONSAIF__SYSCFG register for PCIe. + - description: register3 offset of STG_SYSCONSAIF__SYSCFG register for PCIe. + description: + The phandle to System Register Controller syscon node and the offset + of STG_SYSCONSAIF__SYSCFG register for PCIe. Total 4 regsisters offset + for PCIe. + + pwren-gpios: + description: Should specify the GPIO for controlling the PCI bus device power on. + maxItems: 1 + + reset-gpios: + maxItems: 1 + + phys: + maxItems: 1 + + interrupt-controller: + type: object + properties: + '#address-cells': + const: 0 + + '#interrupt-cells': + const: 1 + + interrupt-controller: true + + required: + - '#address-cells' + - '#interrupt-cells' + - interrupt-controller + + additionalProperties: false + +required: + - reg + - reg-names + - "#interrupt-cells" + - interrupts + - interrupt-map-mask + - interrupt-map + - clocks + - clock-names + - resets + - msi-controller + +unevaluatedProperties: false + +examples: + - | + bus { + #address-cells = <2>; + #size-cells = <2>; + + pcie0: pcie@2B000000 { + compatible = "starfive,jh7110-pcie"; + #address-cells = <3>; + #size-cells = <2>; + #interrupt-cells = <1>; + reg = <0x0 0x2B000000 0x0 0x1000000>, + <0x9 0x40000000 0x0 0x10000000>; + reg-names = "reg", "config"; + device_type = "pci"; + starfive,stg-syscon = <&stg_syscon 0xc0 0xc4 0x130 0x1b8>; + bus-range = <0x0 0xff>; + ranges = <0x82000000 0x0 0x30000000 0x0 0x30000000 0x0 0x08000000>, + <0xc3000000 0x9 0x00000000 0x9 0x00000000 0x0 0x40000000>; + interrupt-parent = <&plic>; + interrupts = <56>; + interrupt-map-mask = <0x0 0x0 0x0 0x7>; + interrupt-map = <0x0 0x0 0x0 0x1 &pcie_intc0 0x1>, + <0x0 0x0 0x0 0x2 &pcie_intc0 0x2>, + <0x0 0x0 0x0 0x3 &pcie_intc0 0x3>, + <0x0 0x0 0x0 0x4 &pcie_intc0 0x4>; + msi-parent = <&pcie0>; + msi-controller; + clocks = <&syscrg 86>, + <&stgcrg 10>, + <&stgcrg 8>, + <&stgcrg 9>; + clock-names = "noc", "tl", "axi_mst0", "apb"; + resets = <&stgcrg 11>, + <&stgcrg 12>, + <&stgcrg 13>, + <&stgcrg 14>, + <&stgcrg 15>, + <&stgcrg 16>; + + pcie_intc0: interrupt-controller { + #address-cells = <0>; + #interrupt-cells = <1>; + interrupt-controller; + }; + }; + };