Received: by 2002:a05:6a10:c7d3:0:0:0:0 with SMTP id h19csp789547pxy; Sun, 15 Aug 2021 00:12:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyx0T67olVYf7dwJOzbS01KeVUxO1gUnI1kOKCTm7spRhhkUozIsm4cPCFU6LK6VL31AQa7 X-Received: by 2002:aa7:cad9:: with SMTP id l25mr13231398edt.351.1629011520322; Sun, 15 Aug 2021 00:12:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629011520; cv=none; d=google.com; s=arc-20160816; b=nVLVYBBppCmE9oREUrQuFj5GuAbO+9P9MTvutssp4nKX5t5aI/egl7PolUhg9cyA+k 9F5tmx5wT6U9p7K/j2eI7nSwssSu6H/vCprHIkTqfcv+xr/HCSsBThqWMR5eUqMNsiBW f84gcvyx13JQwWmThN+rMsL27s3wMoTmRtCNK0YmzUzIANO//4xh7agMHaY0xC2VgW1k 2JoMjb8gaNQC/gX3vtnrJ1n7OoUZGhYBLiKhVagKm8+bWxFcigA9c8kbnyu0x6ab6AMP StdgS5oZgZ65fuE95SATlc9uyRcsr8+p70e+EhQf7lQ13kHk+Z66gAEma2T0ee9fybAD UUcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :subject:cc:to:from:message-id:date; bh=JBVx4h963FS5CyxSi/NGsmWHMtyviw8qvJ1p9QySi4s=; b=A/w976RGklyyZWwe0J/aUXP4K9nkyGuuGTiAFPGRhzTHr/RYyqIyv2fYwK3fQR9P28 sst8ov1MwiCbFB9CM6BX3i9Vi4QO0BgFNjlUiF3ma+8/QTGex7EIvuR2yfACLCdCeaZ2 +WVekZvuIpen+8VQR9wuoMeLX+y/AEdWIn4Vo2m8ypt2PlWkET5bP+A5nn45GHhGY7Em v93WkI32H1PStyPoiDS6QtnrvtMGF/M/HffzhxIzU+gY2alegNNt0VCz2KrUZJGt2DMi NXe2DiBOQF6dO/FKHqQT4E+aqzpvy0ggeuZqrb7Pa9Pugf2qNOXvjRKlr30mm+m9HSse X6tw== ARC-Authentication-Results: i=1; mx.google.com; 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 qk43si7705582ejc.325.2021.08.15.00.11.37; Sun, 15 Aug 2021 00:12:00 -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; 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 S236104AbhHOHKb (ORCPT + 99 others); Sun, 15 Aug 2021 03:10:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:57330 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235569AbhHOHKa (ORCPT ); Sun, 15 Aug 2021 03:10:30 -0400 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B58A860F46; Sun, 15 Aug 2021 07:10:00 +0000 (UTC) Received: from 109-170-232-56.xdsl.murphx.net ([109.170.232.56] helo=wait-a-minute.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1mFAHO-0054tO-NY; Sun, 15 Aug 2021 08:09:58 +0100 Date: Sun, 15 Aug 2021 08:09:58 +0100 Message-ID: <87bl5z18vt.wl-maz@kernel.org> From: Marc Zyngier To: Alyssa Rosenzweig Cc: linux-pci@vger.kernel.org, Bjorn Helgaas , Rob Herring , Lorenzo Pieralisi , Krzysztof =?UTF-8?B?V2lsY3p5xYRza2k=?= , Stan Skowronek , Mark Kettenis , Sven Peter , Hector Martin , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH 1/2] dt-bindings: PCI: Add Apple PCI controller In-Reply-To: <20210815042525.36878-2-alyssa@rosenzweig.io> References: <20210815042525.36878-1-alyssa@rosenzweig.io> <20210815042525.36878-2-alyssa@rosenzweig.io> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 109.170.232.56 X-SA-Exim-Rcpt-To: alyssa@rosenzweig.io, linux-pci@vger.kernel.org, bhelgaas@google.com, robh+dt@kernel.org, lorenzo.pieralisi@arm.com, kw@linux.com, stan@corellium.com, kettenis@openbsd.org, sven@svenpeter.dev, marcan@marcan.st, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Alyssa, On Sun, 15 Aug 2021 05:25:24 +0100, Alyssa Rosenzweig wrote: > > Document the properties used by the Apple PCI controller. This is a > fairly standard PCI controller, although it is not derived from any > known non-Apple IP. > > Signed-off-by: Alyssa Rosenzweig I would rather you post something as an extension to Mark's work, for multiple reasons: - Mark's patch is still being discussed, and is the current reference (specially given that it is already in use in OpenBSD and u-boot). - we cannot have multiple bindings. There can only be one, shared across implementations. Otherwise, you need a different kernel depending on whether you are booting from m1n1 or u-boot. - what you have here is vastly inconsistent (you are describing the MSIs twice, using two different methods). Thanks, M. > --- > .../devicetree/bindings/pci/apple,pcie.yaml | 153 ++++++++++++++++++ > MAINTAINERS | 6 + > 2 files changed, 159 insertions(+) > create mode 100644 Documentation/devicetree/bindings/pci/apple,pcie.yaml > > diff --git a/Documentation/devicetree/bindings/pci/apple,pcie.yaml b/Documentation/devicetree/bindings/pci/apple,pcie.yaml > new file mode 100644 > index 000000000000..4378f5a05804 > --- /dev/null > +++ b/Documentation/devicetree/bindings/pci/apple,pcie.yaml > @@ -0,0 +1,153 @@ > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/pci/apple,pcie.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: Apple SoC PCIe Controller Device Tree Bindings > + > +maintainers: > + - Alyssa Rosenzweig > + > +description: |+ > + Apple SoC PCIe host controller. > + > +allOf: > + - $ref: /schemas/pci/pci-bus.yaml# > + > +properties: > + compatible: > + const: apple,pcie > + > + reg: > + items: > + - description: PCIe configuration region. > + - description: Core registers. > + - description: AXI bridge registers. > + - description: Port 0 (radio) registers. > + - description: Port 1 (USB) registers. > + - description: Port 2 (Ethernet) registers. > + > + reg-names: > + items: > + - const: config > + - const: rc > + - const: phy > + - const: port0 > + - const: port1 > + - const: port2 > + > + interrupts: > + maxItems: 35 > + > + msi-controller: > + description: Identifies the node as an MSI controller. > + > + msi-parent: > + description: MSI controller the device is capable of using. > + > + reset-gpios: > + description: Reset lines for each of the ports of the controller. > + > + pinctrl-0: > + description: Pin controller for the reset lines. > + > + pinctrl-names: > + description: Names for the pin controller. > + > +required: > + - reg > + - reg-names > + - interrupt-parent > + - interrupts > + - msi-controller > + - msi-parent > + - msi-interrupts > + - iommu-map > + - iommu-map-mask > + - pinctrl-0 > + - pinctrl-names > + - reset-gpios > + - bus-range > + - "#address-cells" > + - "#size-cells" > + - ranges > + - device_type > + > +unevaluatedProperties: false > + > +examples: > + - | > + #include > + #include > + > + soc { > + #address-cells = <2>; > + #size-cells = <2>; > + pcie0: pcie@690000000 { > + compatible = "apple,pcie"; > + reg = <0x6 0x90000000 0x0 0x1000000>, > + <0x6 0x80000000 0x0 0x100000>, > + <0x6 0x8c000000 0x0 0x100000>, > + <0x6 0x81000000 0x0 0x4000>, > + <0x6 0x82000000 0x0 0x4000>, > + <0x6 0x83000000 0x0 0x4000>; > + reg-names = "config", "rc", "phy", "port0", > + "port1", "port2"; > + interrupt-parent = <&aic>; > + interrupts = , > + , > + , > + , > + , > + , > + , > + , > + , > + , > + , > + , > + , > + , > + , > + , > + , > + , > + , > + , > + , > + , > + , > + , > + , > + , > + , > + , > + , > + , > + , > + , > + , > + , > + ; > + msi-controller; > + msi-parent = <&pcie0>; > + msi-interrupts = <704 32>; > + iommu-map = <0x100 &pcie0_dart_0 0 1>, > + <0x200 &pcie0_dart_1 0 1>, > + <0x300 &pcie0_dart_2 0 1>; > + iommu-map-mask = <0xff00>; > + pinctrl-0 = <&pcie_pins>; > + pinctrl-names = "default"; > + reset-gpios = <&gpio 152 0 &gpio 153 0 &gpio 33 0>; > + bus-range = <0 15>; > + #address-cells = <3>; > + #size-cells = <2>; > + ranges = <0x43000000 0x6 0xa0000000 0x6 0xa0000000 > + 0x0 0x20000000>, > + <0x02000000 0x0 0xc0000000 0x6 0xc0000000 > + 0x0 0x40000000>; > + device_type = "pci"; > + }; > + }; > +... > diff --git a/MAINTAINERS b/MAINTAINERS > index b63403793c81..d7d2e1d1e2f2 100644 > --- a/MAINTAINERS > +++ b/MAINTAINERS > @@ -1269,6 +1269,12 @@ S: Maintained > F: Documentation/devicetree/bindings/iommu/apple,dart.yaml > F: drivers/iommu/apple-dart.c > > +APPLE PCIE CONTROLLER DRIVER > +M: Alyssa Rosenzweig > +L: linux-pci@vger.kernel.org > +S: Maintained > +F: Documentation/devicetree/bindings/pci/apple,pcie.yaml > + > APPLE SMC DRIVER > M: Henrik Rydberg > L: linux-hwmon@vger.kernel.org > -- > 2.30.2 > > -- Without deviation from the norm, progress is not possible.