Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp3597980ybv; Tue, 25 Feb 2020 04:07:11 -0800 (PST) X-Google-Smtp-Source: APXvYqwmOGDQIGHZwTMV2Z8ZKfEQaQ0x0A4tbZx4yWn3Yhi1WSlQP+w7BYCZ0jUU4ZIMC0mHEy8y X-Received: by 2002:aca:1b11:: with SMTP id b17mr3222590oib.45.1582632431652; Tue, 25 Feb 2020 04:07:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582632431; cv=none; d=google.com; s=arc-20160816; b=Kj3lRnYv519ki52uyZVUMciGev9wj6od+PJBkA6kGRnvhTnyxb7HITsa8kgu5KBQEu gcMfl+KCHfaA3rsyQ4hnztLm/sTV/8+sF/LSyoFx1sGb+uoxTptO457GOGRta1zaOJCG d3371DospvOTGKkCntJtwx2H1IpjxEcXroIzEWGzBBcli+6XTrY+ut7kl48wAzzZIZq3 sqONKbB0etdgZetClwrgXNSA84smx33NRtF3bxFUF+hxTfGLMavxmDmLJzJlgYjKACE1 4905c28IiIWZpVV3hGn2H49kCJE13D7Yxqp/kHwROLM7uTalquB9HXMqKEu0CpAXidRA 6VQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=r1iKukmliH0s6cXFDRc4Y7DXsVLc1DbKkDrSWgE3tqk=; b=n7kuZoEO9YrAM2oaRkjrzECqQoHUtqUYRctB6pkjWWC3PUg3KJhACWLwYxC+WBSQTm /E8GY7YpSKvNW22ydIlNmwaSjIAOS36C8s/Sob61UaDq2a9iausgvlUvSEfzZJBRVcqC I55NhJGW/E64SyqgkOthsqEoNt946oQ/Mz6OgaUXGruvzDhSKm7QBjkO3qGukIrDc37k aPr62kXGYciSbVIPKHM8MmKW/kAa2fOSHtAKxXWIw6nlX5jNFVv+laN43YciiR3uuIw6 yDql20XqRSwPGjiOGqeBgj3fFgklmT0AWfbPG1eC9Lek1fVQc/j9nP1moEZq9tucs7UU 9Z+Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o1si7633450otk.154.2020.02.25.04.06.58; Tue, 25 Feb 2020 04:07:11 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729521AbgBYK6P (ORCPT + 99 others); Tue, 25 Feb 2020 05:58:15 -0500 Received: from foss.arm.com ([217.140.110.172]:49144 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726916AbgBYK6P (ORCPT ); Tue, 25 Feb 2020 05:58:15 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id B426C31B; Tue, 25 Feb 2020 02:58:14 -0800 (PST) Received: from e121166-lin.cambridge.arm.com (e121166-lin.cambridge.arm.com [10.1.196.255]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E928E3F6CF; Tue, 25 Feb 2020 02:58:13 -0800 (PST) Date: Tue, 25 Feb 2020 10:58:08 +0000 From: Lorenzo Pieralisi To: Bharat Kumar Gogada Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, bhelgaas@google.com, rgummal@xilinx.com Subject: Re: [PATCH 1/2] PCI: Versal CPM: Add device tree binding forversal CPM host controller Message-ID: <20200225105808.GA5089@e121166-lin.cambridge.arm.com> References: <1576842072-32027-1-git-send-email-bharat.kumar.gogada@xilinx.com> <1576842072-32027-2-git-send-email-bharat.kumar.gogada@xilinx.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1576842072-32027-2-git-send-email-bharat.kumar.gogada@xilinx.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Dec 20, 2019 at 05:11:11PM +0530, Bharat Kumar Gogada wrote: > Adding device tree binding documentation for versal CPM Root Port driver. > > Signed-off-by: Bharat Kumar Gogada > --- > .../devicetree/bindings/pci/xilinx-versal-cpm.txt | 66 ++++++++++++++++++++++ > 1 file changed, 66 insertions(+) > create mode 100644 Documentation/devicetree/bindings/pci/xilinx-versal-cpm.txt > > diff --git a/Documentation/devicetree/bindings/pci/xilinx-versal-cpm.txt b/Documentation/devicetree/bindings/pci/xilinx-versal-cpm.txt > new file mode 100644 > index 0000000..35f8556 > --- /dev/null > +++ b/Documentation/devicetree/bindings/pci/xilinx-versal-cpm.txt > @@ -0,0 +1,66 @@ > +* Xilinx Versal CPM DMA Root Port Bridge DT description > + > +Required properties: > +- #address-cells: Address representation for root ports, set to <3> > +- #size-cells: Size representation for root ports, set to <2> > +- #interrupt-cells: specifies the number of cells needed to encode an > + interrupt source. The value must be 1. > +- compatible: Should contain "xlnx,versal-cpm-host-1.00" > +- reg: Should contain configuration space (includes bridge registers) and > + CPM system level control and status registers, and length > +- reg-names: Must include the following entries: > + "cfg": configuration space region and bridge registers > + "cpm_slcr": CPM system level control and status registers > +- interrupts: Should contain AXI PCIe interrupt > +- interrupt-map-mask, > + interrupt-map: standard PCI properties to define the mapping of the > + PCI interface to interrupt numbers. > +- ranges: ranges for the PCI memory regions (I/O space region is not > + supported by hardware) > + Please refer to the standard PCI bus binding document for a more > + detailed explanation > +- msi-map: Maps a Requester ID to an MSI controller and associated MSI > + sideband data > +- interrupt-names: Must include the following entries: > + "misc": interrupt asserted when legacy or error interrupt is received > + > +Interrupt controller child node > ++++++++++++++++++++++++++++++++ > +Required properties: > +- interrupt-controller: identifies the node as an interrupt controller > +- #address-cells: specifies the number of cells needed to encode an > + address. The value must be 0. > +- #interrupt-cells: specifies the number of cells needed to encode an > + interrupt source. The value must be 1. > + > + > +Refer to the following binding document for more detailed description on > +the use of 'msi-map': > + Documentation/devicetree/bindings/pci/pci-msi.txt > + > +Example: > + pci@fca10000 { > + #address-cells = <3>; > + #interrupt-cells = <1>; > + #size-cells = <2>; > + compatible = "xlnx,versal-cpm-host-1.00"; > + interrupt-map = <0 0 0 1 &pcie_intc_0 1>, > + <0 0 0 2 &pcie_intc_0 2>, > + <0 0 0 3 &pcie_intc_0 3>, > + <0 0 0 4 &pcie_intc_0 4>; This is wrong, interrupts map to pin 0,1,2,3 of pcie_intc. That's what's forcing you to use the pci_irqd_intx_xlate() function and that's completely wrong. I should find a way to write a common binding for all the host bridges interrupt-map since this comes up over and over again. Please have a look at: Documentation/devicetree/bindings/pci/faraday,ftpci100.txt > + interrupt-map-mask = <0 0 0 7>; > + interrupt-parent = <&gic>; > + interrupt-names = "misc"; > + interrupts = <0 72 4>; > + ranges = <0x02000000 0x00000000 0xE0000000 0x0 0xE0000000 0x00000000 0x10000000>, > + <0x43000000 0x00000080 0x00000000 0x00000080 0x00000000 0x00000000 0x80000000>; > + msi-map = <0x0 &its_gic 0x0 0x10000>; > + reg = <0x6 0x00000000 0x0 0x1000000>, > + <0x0 0xFCA10000 0x0 0x1000>; > + reg-names = "cfg", "cpm_slcr"; > + pcie_intc_0: pci-interrupt-controller { > + #address-cells = <0>; > + #interrupt-cells = <1>; > + interrupt-controller ; > + }; > + }; > -- > 2.7.4 >