From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933725AbbIDWdq (ORCPT ); Fri, 4 Sep 2015 18:33:46 -0400 Received: from mail-bl2on0099.outbound.protection.outlook.com ([65.55.169.99]:48708 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933196AbbIDWdo (ORCPT ); Fri, 4 Sep 2015 18:33:44 -0400 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=David.Daney@caviumnetworks.com; Message-ID: <55EA1C3F.1030300@caviumnetworks.com> Date: Fri, 4 Sep 2015 15:33:35 -0700 From: David Daney User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7 MIME-Version: 1.0 To: Marc Zyngier , Mark Rutland , "tirumalesh.chalamarla@caviumnetworks.com" , "Richter, Robert" , "Chintakuntla, Radha" CC: "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "iommu@lists.linux-foundation.org" , "linux-arm-kernel@lists.infradead.org" , Will Deacon , Robin Murphy , Lorenzo Pieralisi , "arnd@arndb.de" , "treding@nvidia.com" , "majun258@huawei.com" , "thunder.leizhen@huawei.com" , "laurent.pinchart@ideasonboard.com" Subject: Re: [PATCH 2/3] Docs: dt: Add PCI MSI map bindings References: <1437670365-20704-1-git-send-email-mark.rutland@arm.com> <1437670365-20704-3-git-send-email-mark.rutland@arm.com> <55B5E8C1.4030707@arm.com> In-Reply-To: <55B5E8C1.4030707@arm.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [64.2.3.194] X-ClientProxiedBy: BLUPR07CA0099.namprd07.prod.outlook.com (10.255.223.170) To BN3PR0701MB1717.namprd07.prod.outlook.com (25.163.39.16) X-Microsoft-Exchange-Diagnostics: 1;BN3PR0701MB1717;2:I8+MsTT/Vv+Zmu4+al2wt3qCIvSFV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p3aa4lIzuOlifWQngEhjRqxAzvG0NbZpJgfJlnxXM4cMi2blE29UDtxpMVUDfT9eR/nll/Vt2A/v5PUYxSybvL1ILo3rferps9krbw4C9aBXlBjVd2rvMs4gdI1lp4pTkT6Xql8n8Zh6lpExDWhO+dmHsdRa/A6XVTv6pLAu7o7Zvyku3tpAkjbWNMqDsyzWQOfUZE/dTd6iEZfX2Ij+VFKqaAggFE=;4:RLjVH+LY0unywxkCkFdR1b/Gh1dRRKuOTkSY5zXnGecfAXDvvvPznZPIMRXvIwxoZlf83iUhMFT3gd26tYqLgL5g54fkVvDdfQIXEQd3Yp3TxjA45N3waMX14pIrfBie4dfOAkOekHlwmuVx+I6qnGPLm5cD2pgENSZtqUvXfYaUaq9v3c05W9dA+i0/961nPmCqwsl3m6EfrH5kV1BjtmTvqPblN2eI5qVq4RdJ2v/h36Nat0ureas1BvPa2mZMYl9BbgNt9Z0lsnLHaqvkmVeYWnv+3nn3E+2dPXlk0JUOWVap5+h9Kg93ZILEN3FQ X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(8121501046)(5005006)(3002001);SRVR:BN3PR0701MB1717;BCL:0;PCL:0;RULEID:;SRVR:BN3PR0701MB1717; X-Forefront-PRVS: 06891E23FB X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6009001)(377454003)(52604005)(189002)(479174004)(164054003)(199003)(24454002)(47776003)(53416004)(65816999)(189998001)(122386002)(76176999)(68736005)(101416001)(69596002)(77096005)(83506001)(50986999)(23746002)(106356001)(5001860100001)(87266999)(64706001)(19580395003)(5001830100001)(33656002)(105586002)(97736004)(50466002)(87976001)(80316001)(66066001)(5001770100001)(19580405001)(65956001)(64126003)(4001350100001)(4001540100001)(77156002)(2950100001)(62966003)(4001450100002)(5001960100002)(42186005)(81156007)(2501003)(54356999)(40100003)(65806001)(5004730100002)(92566002)(36756003)(59896002)(46102003)(5007970100001)(217873001);DIR:OUT;SFP:1101;SCL:1;SRVR:BN3PR0701MB1717;H:dl.caveonetworks.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1;BN3PR0701MB1717;23:VWzO2vuaN7EE7DD/6k40wbcBrfpX0axLVRt?= =?Windows-1252?Q?SLafQY3DINUSXZBZz9FqiEm/Abw2YxwvxwWtv9iScFm1dyNQCisB4ZIn?= =?Windows-1252?Q?J90PjNXWo9cAGNM7yER3u7w1iaQ09EOyeO0njbI3JW3FzIq5BEuVf2+r?= =?Windows-1252?Q?JIB5/8zwaRK5BNp+M3n23eLI3m28zpPHJNEBWr7vi5k6iOtyFexaxWrE?= =?Windows-1252?Q?VMVVBcdWViIr7O9nXcaYVKtvnifLWnktYgUqUZKlbjngQCfLlDnlgrnu?= =?Windows-1252?Q?FLLCe9U3wLY2VttGeX0kxFsbNa5vvCt7UkbHyC2MM4Oq9b+md2PvIdRb?= =?Windows-1252?Q?j1Uu8+f0HeD1MamVSiTvrO3Ml5yJ84jR/FruIrVOWE5arjvhocmkjKoU?= =?Windows-1252?Q?2ZtRHKC6qNmuN2Z4KqaOQKnR9fwf9gKVrnDtmYexrPd2ULJJuLI9XCcj?= =?Windows-1252?Q?EYDeOnZoU6BwJTstVlSOOEzNLXKjlYvECQUlZTPEJKVI2+ZaV8Amb0c1?= =?Windows-1252?Q?8MfSKDdF+ZMXbTf6R17q8SPyI1ujoGN+F69F06W2l3WZXwXXPfsy3gkr?= =?Windows-1252?Q?QU2/AKEojSVjodFRh5CYHxex7JBnJJGoSmuj7vS+2bRrOMZF7YNMs+Re?= =?Windows-1252?Q?Ao9p2Cd/HtKGTr8ZbsPDnn5BVVCkXiKq0pfF2CEPmQniFVgKRovQJ+if?= =?Windows-1252?Q?4e6rzl9/Gsy8ySOOuLoxV70MCp/HzxITy0tQLV6FOG2RES0S1wppJ64G?= =?Windows-1252?Q?P7aOLe3prSBbghXkinz1E7g6G0N6LEc2ORZGebSe5N8+Ox7t5SrP+1Bx?= =?Windows-1252?Q?iLSPe7wKVySfJR90EKzH10B+L763ZxQQU3id/UAXzJ/tDcgaxeMWl4Pn?= =?Windows-1252?Q?N+hTvUlM1ZFSf5M8HPmImsMrcCBtBy7dnXgbaQTIWFzBP2ThCaLMtLBl?= =?Windows-1252?Q?3j/Lwjt3DjCAp7NxirEwEGTZJZeBokmLlxNtsK8FkhnUk/QPIlVvAnV4?= =?Windows-1252?Q?e0tp2fb48OLq+qBiHMUZWK8xgskeugrO/dzDxKB5nUZd+m5V7Ex1Ku1t?= =?Windows-1252?Q?jGYjHP/FT0o5Yr0cqDqGbKGLksu3ZIvqEN2LjOv88GMEiRW0Oo4MM0fV?= =?Windows-1252?Q?L8s07OAyKnNamRRsFSBH3GzoFUgVpLeiCsFZUyjqXT+grlOD2FYd4br5?= =?Windows-1252?Q?zKJghduSXjzKq3D/0EJyufCfieMQV0TnxRV0q2DR6IrulgxdsDL2OCx2?= =?Windows-1252?Q?8dhcaGeISI0ErY2SyEITYyZuh2+UiI4iqam9/79opeCgLBQ95X/82qkj?= =?Windows-1252?Q?aXeh2B84C2ZO3WTtJ4eq+Iw6Fi+7ND/GTeuFN+2mot6i2NjmrEBlruH6?= =?Windows-1252?Q?PftoyfECdVRvrgDmUZGfaRLi6e84XPPYag6UNazZZmKH53RTwr7wtlrs?= =?Windows-1252?Q?9UnaV27WHr+1B/oaM3cXq2LdLTm51twvthu1mVaI4LXnReK9N6HhtSX7?= =?Windows-1252?Q?ZSPoCc8JOj1xNba6xcWShdH4LyQE/SSa0OkAkxfUmrFhkxv0yt4COefR?= =?Windows-1252?Q?WdhNPcB28RzcZ/vVsbn6MEdddI4XiHOXTYHeGIa1m2irt5Xpn/JyFJbN?= =?Windows-1252?Q?NGo3pYCTEJMXbqpSdYqIbr/SYm9gpNz6TakwKZVI9RGXo?= X-Microsoft-Exchange-Diagnostics: 1;BN3PR0701MB1717;5:G7Z1dJz5P4SR/zIjoHiWYQUhEkJlVCFmQggtWSKwX+vf5lcBFeA54aNLrenbOdwRDnkZfaQCiLbSIoLGWmbJ7fywGuQWmVJlK0G4xyyXw1tScPOX0y7qowHeCFllufW8/MLCn3mMUckjyJqaHoeZ1A==;24:P5aXibPkQKZqaBDb0bZp0NgbjkeQqu1wZjyOpTYlWunX2fTeQNaVCVUvyepeh9aq+yuJ1DlxCg67NlmbM189VYOYe4msHnqO0HcfUE5gdsc=;20:+PZtDPoaFGclorqkHj0SFT3JrpTvVpSSb7c+Ain3lgiR+l0bS7DAZZ+8Cj0LRyZrb7sDCM8kb7cDtT+EF911Ng== SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Sep 2015 22:33:39.4101 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR0701MB1717 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Mark, First of all: Thanks for working on this. I now have a prototype implementation for irq-gic-v3-its.c that is using this binding on Cavium's ThunderX platform. Q: Have you guys had any more thoughts on this that might require changing the binding? If not, I will be sending out my patches for your consideration. Thanks, David Daney On 07/27/2015 01:16 AM, Marc Zyngier wrote: > On 23/07/15 17:52, Mark Rutland wrote: >> Currently msi-parent is used by a few bindings to describe the >> relationship between a PCI root complex and a single MSI controller, but >> this property does not have a generic binding document. >> >> Additionally, msi-parent is insufficient to describe more complex >> relationships between MSI controllers and devices under a root complex, >> where devices may be able to target multiple MSI controllers, or where >> MSI controllers use (non-probeable) sideband information to distinguish >> devices. >> >> This patch adds a generic binding for mapping PCI devices to MSI >> controllers. This document covers msi-parent, and a new msi-map property >> (specific to PCI*) which may be used to map devices (identified by their >> Requester ID) to sideband data for each MSI controller that they may >> target. >> >> Signed-off-by: Mark Rutland Acked-by: David Daney >> --- >> Documentation/devicetree/bindings/pci/pci-msi.txt | 220 ++++++++++++++++++++++ >> 1 file changed, 220 insertions(+) >> create mode 100644 Documentation/devicetree/bindings/pci/pci-msi.txt >> >> diff --git a/Documentation/devicetree/bindings/pci/pci-msi.txt b/Documentation/devicetree/bindings/pci/pci-msi.txt >> new file mode 100644 >> index 0000000..9b3cc81 >> --- /dev/null >> +++ b/Documentation/devicetree/bindings/pci/pci-msi.txt >> @@ -0,0 +1,220 @@ >> +This document describes the generic device tree binding for describing the >> +relationship between PCI devices and MSI controllers. >> + >> +Each PCI device under a root complex is uniquely identified by its Requester ID >> +(AKA RID). A Requester ID is a triplet of a Bus number, Device number, and >> +Function number. >> + >> +For the purpose of this document, when treated as a numeric value, a RID is >> +formatted such that: >> + >> +* Bits [15:8] are the Bus number. >> +* Bits [7:3] are the Device number. >> +* Bits [2:0] are the Function number. >> +* Any other bits required for padding must be zero. >> + >> +MSIs may be distinguished in part through the use of sideband data accompanying >> +writes. In the case of PCI devices, this sideband data may be derived from the >> +Requester ID. A mechanism is required to associate a device with both the MSI >> +controllers it can address, and the sideband data that will be associated with >> +its writes to those controllers. >> + >> +For generic MSI bindings, see >> +Documentation/devicetree/bindings/interrupt-controller/msi.txt. >> + >> + >> +PCI root complex >> +================ >> + >> +Optional properties >> +------------------- >> + >> +- msi-map: Maps a Requester ID to an MSI controller and associated >> + msi-specifier data. The property is an arbitrary number of tuples of >> + (rid-base,msi-controller,msi-base,length), where: >> + >> + * rid-base is a single cell describing the first RID matched by the entry. >> + >> + * msi-controller is a single phandle to an MSI controller >> + >> + * msi-base is an msi-specifier describing the msi-specifier produced for the >> + first RID matched by the entry. >> + >> + * length is a single cell describing how many consecutive RIDs are matched >> + following the rid-base. >> + >> + Any RID r in the interval [rid-base, rid-base + length) is associated with >> + the listed msi-controller, with the msi-specifier (r - rid-base + msi-base). >> + >> +- msi-map-mask: A mask to be applied to each Requester ID prior to being mapped >> + to an msi-specifier per the msi-map property. >> + >> +- msi-parent: Describes the MSI parent of the root complex itself. Where >> + the root complex and MSI controller do not pass sideband data with MSI >> + writes, this property may be used to describe the MSI controller(s) >> + used by PCI devices under the root complex, if defined as such in the >> + binding for the root complex. > > Right, this is where I'd expect some details about #msi-cells. Is it > meant to be ignored? The lack of symmetry between the PCI and non-PCI > use cases feels a bit inelegant (not to mention that it precludes having > an unified parser for both cases). > > This otherwise looks good to me. > > Thanks, > > M. >