Received: by 2002:a05:7412:6592:b0:d7:7d3a:4fe2 with SMTP id m18csp2417949rdg; Mon, 14 Aug 2023 01:36:22 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFxgkEGOJTht5Dxe5WG7V+pjvsYScc7k65zFlliT76w0JnQxxS9gWuLN5WqaZNQGFNKdoU3 X-Received: by 2002:a17:907:7886:b0:993:f081:2c58 with SMTP id ku6-20020a170907788600b00993f0812c58mr7891142ejc.4.1692002182748; Mon, 14 Aug 2023 01:36:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692002182; cv=none; d=google.com; s=arc-20160816; b=Z8F4Kod50Hsm3u3z6GU53hjUPGRoqDW8gqMZrk5yWU5QrYy7C+YeRi+W5mTvbiGGHS 2+/FweWS/dIFr2sk6e0b97hxRiTfe6xD+et0xxlEnXjurkJjP1N7biaMks3AdFfQsLVT 65TQzSgfv0FMnAGTYhMzkMcYGSLXHJAoHLN+1YRCnmcVHz6WX6tcv2HaRDB9Gfo3fD5i ZoXobfSJANQXCnYcxPjuzQzEofOY4VPj0qxAOR0CyO7C9p0HVi7ksMA+KNNSB5a0ZGJu 5JRCeT7XDxubgb6u/6uYH52yc2fo/lVhoSROcXS5fNesv5poXrcMuqde4Np4+KauHdgH RC6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=FM/rOheFpViIiHTl0QyHNG0OuY0JdbJaz0cftfEzMo0=; fh=KXlVFBlGBib1/EY7P6GdPe+4bl+y1i+7zQr7xc1+amg=; b=zvMhV8fSr7meX68SefVS3tuJvCnVuSilBmTgNYOzPUI5W5rtNtTQb3Z/EIWaDHO1ej LromN1lFT1h+oorZbLjv8oNhbdtHdbh13avRKhfy6FwaME8MNYwtzQYdQtgjW/jF66D8 poyEJ8hBkzt08G2rfBM4ck6Y8H0BqgBuDS2pPNsGTSkk2l/zVACGgVGetvd9QOyBmFL0 lDshjm+NHVakCzazKmlqvc1IdRl93EXF7pbLxNhEbCP9LFtPAVKEYpOUyJkSs5JcvDr+ IHvOsrDU9zubpAvovTu0/tEu/ctRrz3GdZ+WdHlVqi9P2R7eqjpcUVZwxQIi8ep4ukOr gZ2w== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i6-20020a17090671c600b0098874379199si7257009ejk.163.2023.08.14.01.35.59; Mon, 14 Aug 2023 01:36: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 S231727AbjHNILs (ORCPT + 99 others); Mon, 14 Aug 2023 04:11:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33574 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234765AbjHNILd (ORCPT ); Mon, 14 Aug 2023 04:11:33 -0400 Received: from fd01.gateway.ufhost.com (fd01.gateway.ufhost.com [61.152.239.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 783F41702; Mon, 14 Aug 2023 01:11:14 -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 fd01.gateway.ufhost.com (Postfix) with ESMTP id CD8E0819D; Mon, 14 Aug 2023 16:11:07 +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; Mon, 14 Aug 2023 16:11:07 +0800 Received: from [192.168.125.127] (183.27.98.20) by EXMBX171.cuchost.com (172.16.6.91) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Mon, 14 Aug 2023 16:11:06 +0800 Message-ID: <8f526ab4-d254-d612-3ebb-ec4813a5174b@starfivetech.com> Date: Mon, 14 Aug 2023 16:11:06 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.14.0 Subject: Re: [PATCH v2 3/4] dt-bindings: PCI: Add StarFive JH7110 PCIe controller Content-Language: en-US To: Rob Herring CC: =?UTF-8?Q?Krzysztof_Wilczy=c5=84ski?= , Daire McNamara , Conor Dooley , "Krzysztof Kozlowski" , Bjorn Helgaas , Lorenzo Pieralisi , "Emil Renner Berthing" , , , , Philipp Zabel , Mason Huo , Leyfoon Tan , Kevin Xie References: <20230727103949.26149-1-minda.chen@starfivetech.com> <20230727103949.26149-4-minda.chen@starfivetech.com> <20230810224727.GA1445828-robh@kernel.org> From: Minda Chen In-Reply-To: <20230810224727.GA1445828-robh@kernel.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [183.27.98.20] X-ClientProxiedBy: EXCAS061.cuchost.com (172.16.6.21) To EXMBX171.cuchost.com (172.16.6.91) X-YovoleRuleAgent: yovoleflag X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,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 On 2023/8/11 6:47, Rob Herring wrote: > On Thu, Jul 27, 2023 at 06:39:48PM +0800, Minda Chen wrote: >> Add StarFive JH7110 SoC PCIe controller dt-bindings. >> JH7110 using PLDA XpressRICH PCIe host controller IP. >> >> Signed-off-by: Minda Chen >> Reviewed-by: Hal Feng >> --- >> .../bindings/pci/starfive,jh7110-pcie.yaml | 133 ++++++++++++++++++ >> 1 file changed, 133 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..9273e029fb20 >> --- /dev/null >> +++ b/Documentation/devicetree/bindings/pci/starfive,jh7110-pcie.yaml >> @@ -0,0 +1,133 @@ >> +# 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 host controller >> + >> +maintainers: >> + - Kevin Xie >> + >> +allOf: >> + - $ref: /schemas/pci/pci-bus.yaml# > > Can go in common schema. Unless endpoint mode is or is going to be > supported? > >> + - $ref: plda,xpressrich3-axi-common.yaml# >> + - $ref: /schemas/interrupt-controller/msi-controller.yaml# > > This is a bit odd. Do you really need to define the host bridge as an > msi-controller? Many host bridges are, but they don't need to be defined > as one in DT because PCIe spec defines its own way to do MSIs. > Ok, I will delete this. >> + - $ref: /schemas/gpio/gpio-consumer-common.yaml# > > No, you don't need to reference this. You need to define what properties > from it you use (reset-gpios). > > Though if this is for PERST#, then I'd use "perst-gpios" instead. > > And why is that not common? It's board specific, not SoC, whether or > not there's GPIO control of it. > OK >> + >> +properties: >> + compatible: >> + const: starfive,jh7110-pcie >> + >> + clocks: >> + items: >> + - description: NOC bus clock >> + - description: Transport layer clock >> + - description: AXI MST0 clock >> + - description: APB clock >> + >> + clock-names: >> + items: >> + - const: noc >> + - const: tl >> + - const: axi_mst0 >> + - const: apb >> + >> + resets: >> + items: >> + - description: AXI MST0 reset >> + - description: AXI SLAVE0 reset >> + - description: AXI SLAVE 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. > > Perhaps somewhere in here state what these registers are for. > The offsets will be removed. >> + >> + phys: >> + description: >> + Specified PHY is attached to PCIe controller. >> + maxItems: 1 >> + >> +required: >> + - compatible >> + - clocks >> + - resets >> + - starfive,stg-syscon > >> + - "#interrupt-cells" >> + - interrupt-map-mask >> + - interrupt-map > > These can all be common. > > So could 'compatible' though it is implicitly required anyways as > without it, the schema is never applied. > OK, Thanks. >> + >> +unevaluatedProperties: false >> + >> +examples: >> + - | >> + #include >> + soc { >> + #address-cells = <2>; >> + #size-cells = <2>; >> + >> + pcie0: pcie@2b000000 { >> + compatible = "starfive,jh7110-pcie"; >> + reg = <0x9 0x40000000 0x0 0x10000000>, >> + <0x0 0x2b000000 0x0 0x1000000>; >> + reg-names = "cfg", "apb"; >> + #address-cells = <3>; >> + #size-cells = <2>; >> + #interrupt-cells = <1>; >> + device_type = "pci"; >> + ranges = <0x82000000 0x0 0x30000000 0x0 0x30000000 0x0 0x08000000>, >> + <0xc3000000 0x9 0x00000000 0x9 0x00000000 0x0 0x40000000>; >> + starfive,stg-syscon = <&stg_syscon 0xc0 0xc4 0x130 0x1b8>; >> + bus-range = <0x0 0xff>; >> + 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>; > > Weird!? > I will delete this. >> + 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>; >> + reset-gpios = <&gpios 26 GPIO_ACTIVE_LOW>; >> + phys = <&pciephy0>; >> + >> + pcie_intc0: interrupt-controller { >> + #address-cells = <0>; >> + #interrupt-cells = <1>; >> + interrupt-controller; >> + }; >> + }; >> + }; >> -- >> 2.17.1 >>