From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756114AbcBHUrc (ORCPT ); Mon, 8 Feb 2016 15:47:32 -0500 Received: from mail-by2on0087.outbound.protection.outlook.com ([207.46.100.87]:16477 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755971AbcBHUr0 (ORCPT ); Mon, 8 Feb 2016 15:47:26 -0500 Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=none action=none header.from=caviumnetworks.com; Message-ID: <56B8FED6.1050804@caviumnetworks.com> Date: Mon, 8 Feb 2016 12:47:18 -0800 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: Rob Herring CC: David Daney , Bjorn Helgaas , , Will Deacon , , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , , , David Daney Subject: Re: [PATCH v5 3/3] pci, pci-thunder-ecam: Add driver for ThunderX-pass1 on-chip devices References: <1454715675-17512-1-git-send-email-ddaney.cavm@gmail.com> <1454715675-17512-4-git-send-email-ddaney.cavm@gmail.com> <20160208195642.GA15103@rob-hp-laptop> In-Reply-To: <20160208195642.GA15103@rob-hp-laptop> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [64.2.3.194] X-ClientProxiedBy: BN1PR07CA0070.namprd07.prod.outlook.com (10.255.193.45) To DM3PR07MB2138.namprd07.prod.outlook.com (25.164.4.144) X-Microsoft-Exchange-Diagnostics: 1;DM3PR07MB2138;2:mcvwjNJHIJ8Yp3DU8v7YdabEyDL4fZKZbtLcZXjDGEQN/NeckWXghvoDICByZQ+85LFq5zxTEgGI/sp90NbNnei6j0kXtCL8kuaQoTbwCs26iK+/snIO1YevQ9yNm/dsSlvsWhW51FHp6+DyjqvxAg==;3:BQLEFd1MMP17pCheQIOB0qrmML9Ycazmr+aQTjrTMfo4zNO7tOsetU8zkbzBY017DnFWYaa53DzMNskSU3C35zbCLwj4c3hmDI7YVoHNnzH7erVS3xrbM0lecmomYQ3p;25:bAr1D3jg0bmtd5lWpqYuOKzsu5L0Q7q01lJ9DYMcera5CCylsIJGMtDGDAMnaWm23h4TTK43ZAxDUsRCAeIcXB46InEuOarE+z3yjClW3gdANBX6Ua/7lGjn0giznG4fxPK6T6aJk1tovrnlEEUy2QwsBwoA4oaeMk/hV9ZwuQlpbeVHfMF1snPn9UFDnm79OGWg3kEhxgQ2BoZetrG0xVHopj7VJy2p//+uXfCjxv+6K+JdUXtR6yJLa0OEOjmhnTVjuDBroUlG+jOIus97Tu1701ZO9SfZ6XW88ujbYi+WsiT8TZ/jm6jEfWU6oj3J X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM3PR07MB2138; X-MS-Office365-Filtering-Correlation-Id: fe0e051e-77d7-4c9c-535e-08d330c90bd9 X-Microsoft-Exchange-Diagnostics: 1;DM3PR07MB2138;20:RI6+goJoSVzV9cby4c3/feIbqb31Y1aTrHex8ffLKoNxhgOIUXSpDrjdixmiPROIvZKCFZjuJ4Xvtxp5pvvICtoGeCToB7PGrdZqoEYEdEvhkurtY5qEBfZ4ABd8VZifRBO+Z9sXDKgeqJHJiuzMDVhzEb39eXKaNJeB5L/vDXdkucdGaivYfOnzp1ksYsPH09r411A4AhK+kcKZIxZcZLkB+wVzrWhedHglsFSLS1jl3AqSOwU6eWkIvNeH+mxqpX6uIVgC2ST8akwNcRB32c2UNHSCRmtwfS/RqEB/qSS5hoPUDcE/DrglQbnw6CfOqrCyqE/kTWLKMjVk2EasPixlfdvbVkySu7plV8KgqA4U71HJrV10xCRv86jyubUzdAbx/2mBmtCW7jUZfYkOWvX/4ZJXFqmXmQAesafrWT4qmcQF3Iij52rEzLZIhE5v/OQJ9p+qCSwREKCA2Y049QB5r/tnoBQmyTxk+Qp+JWcmhn3cNunTYHyTrTu1c77V62c5p67LlWpdpqptaPz2e++gKkxVaYaQr/fwKkdA9g1r8H3xeLXOFGxo2KVeocYOFl/s5ULX1UZXeuAHCUkG/WOP/euvHg1+VA9jhhV9mZM= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001);SRVR:DM3PR07MB2138;BCL:0;PCL:0;RULEID:;SRVR:DM3PR07MB2138; X-Microsoft-Exchange-Diagnostics: 1;DM3PR07MB2138;4:Iql2BqAO/Tma4rrnwk95IojZL1/im9Q6e++EFEBF0nQUYFsw/30J2YnxymIniMNDpyI14ohoXfAhmQpf2opdmqzdEWbq33ukLr/6SfpTqIGqyhFxArwzZ1lfsEnneN6LakRSBHFu9NoavabeMeQpur+qxh0SkfOISlvaLBhOJQt+klxRzLvZPAwowhYmKU+FoYY10QMNfUjV69eAqSwSXzeTp/J4AS4vyXtgE0MmDSKzZ3PYOUuD6ThJwcoQkoLI1SLBJNd3HTP89/b/SvDMECvq82+30kgpegYxzUScuwrKmdqp6Qq9myLk3W01IfvNQtECYgrtzI6PaOLBGKio2zqaxSBNrjnL1a4hAd4LCBBGresNJA3bZArYr9gVfmCu X-Forefront-PRVS: 084674B2CF X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6009001)(377454003)(479174004)(24454002)(50466002)(42186005)(4326007)(4001350100001)(76176999)(54356999)(65816999)(65956001)(110136002)(47776003)(5001960100002)(50986999)(65806001)(33656002)(40100003)(19580395003)(80316001)(2950100001)(19580405001)(66066001)(5008740100001)(2906002)(36756003)(586003)(5004730100002)(87976001)(230783001)(77096005)(1096002)(53416004)(230700001)(23756003)(6116002)(64126003)(3846002)(122386002)(92566002)(189998001)(83506001);DIR:OUT;SFP:1101;SCL:1;SRVR:DM3PR07MB2138;H:dl.caveonetworks.com;FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?iso-8859-1?Q?1;DM3PR07MB2138;23:73LKPoN1vSZpjM54499E63auomRbW9odvrmUozj?= =?iso-8859-1?Q?PDimz1CgDeYksFFCGuYZGPNSAZarG+su2O0quqC/BNhA1pXEBnfPFpjpDv?= =?iso-8859-1?Q?CT+AZgQFj6bqXuRcJVPiQhnP199mzUYKlWU7nnq1ATL2jVNd3fcNZ/xRMu?= =?iso-8859-1?Q?cj74pVzUorbtWVeU89X0Yt+tjCPTa6lK1rEh18I5HLjQEMplRTpFBqDg3l?= =?iso-8859-1?Q?HcJt3oeVpKHoN/66ETXGjfStsOTl1rUMRry3vSPz+sytDjl/eff/8B8IlR?= =?iso-8859-1?Q?gJG5bGGy5DDPLKSndYvsvcuKjcHY2BpdkVwQf6aDiGJChAzrUVYJpOOrIQ?= =?iso-8859-1?Q?tkXWVT6vV8wIksr0Ff01O05UxGOtowK80DpyJH+oEa77xEKCIzYoxUysPx?= =?iso-8859-1?Q?AtcQnAD6dlZyOMKxXksPtrSLnDoEgKy5uwqIoRsR08ecNxTNuZ6cq/Zvww?= =?iso-8859-1?Q?eB6lY4SqbWcc32+blXvJEMjqLSsEUnSE1tQe3/e1qCMWANBd8ajbexotVN?= =?iso-8859-1?Q?qODv9iP046MLWKUean0HN0ltcHi+ZwvEo9tyJNMJwVVILRT5130HyU/JPq?= =?iso-8859-1?Q?a5hn1D1SZOLW0SV4vHwQzOaR/o+IvhoungJqWJERlBDxOv1dBl/7kKSHXA?= =?iso-8859-1?Q?h3MPXXIyv7F7gUoAuOOdlDCRx4pZfdMuWzpSYVUWjYDWdtv8+/Pl6ASfhV?= =?iso-8859-1?Q?m5EBa+SduZjAo0AwaDKbVjbUdjr+uvFFsKMRy4jO8p1pcDDLyYqKRVnRlJ?= =?iso-8859-1?Q?dFa9iD6q/YUcevNgFnrPxqdy2xgbram8/N3Lp9vaa7zVnSdhPC6xRqKzf6?= =?iso-8859-1?Q?Sg6nUIrdb2WmaqsZ+KgJIRbGcqYLRB/UryX5ZBbN5Hsfv2IvObqAe8eICy?= =?iso-8859-1?Q?0ZlIKmh9tBWMUhzb2ShUnOKvFfaaicCU4KWCKJmn2oWZSx9a/PWjLCcYE7?= =?iso-8859-1?Q?rBCaiTtrK4H/L3STo1nyNDJOv7AohYel+nuNas1MowREcBcVSH3+7Ib0Sk?= =?iso-8859-1?Q?6AXTPiuxf6YWfNEnuZoVUZ9Zsvw8CHBjZpK1iT3qxdqkb+6LOKcv/5ueC+?= =?iso-8859-1?Q?QzF61fdBtOwIMkaU1Fz3WNosxqub8mS0q+oU0/dxmypVCHH9PjPTFrVBE3?= =?iso-8859-1?Q?LktkEfHZR4XNeJPgD1nZX+p7zGbYc/ZNxEvIy2oqsVMX2T+an212YR6dZq?= =?iso-8859-1?Q?O71MQ6vmbDt?= X-Microsoft-Exchange-Diagnostics: 1;DM3PR07MB2138;5:Mw6ZWx5rMiXS8hzX9qyGUnJhIG61rDHhJ2YbIbV4afVwrhyOMZTdx2wO3hLwpQv9bEQliiMf713ACuP16UOujD9r7XHq3bcvjR+JHulY99c3jJb+cPyRZd2dTHgGlyXDipnEnNaUXA4eLh1nJVR7OQ==;24:X5/hqPOW92woOVCfPhgY5Nn5H0IKNxFat7SI75/18PJ8GA6ffOBatZT/X8phrIvXlHn1Oj3hZespPABsYhmyTSSngYUWNMPEtFUZRMrnLeI= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Feb 2016 20:47:21.7535 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM3PR07MB2138 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/08/2016 11:56 AM, Rob Herring wrote: > On Fri, Feb 05, 2016 at 03:41:15PM -0800, David Daney wrote: >> From: David Daney >> >> The cavium,pci-thunder-ecam devices are exactly ECAM based PCI root >> complexes. These root complexes (loosely referred to as ECAM units in >> the hardware manuals) are used to access the Thunder on-chips devices. >> They are special in that all the BARs on devices behind these root >> complexes are at fixed addresses. To handle this in a manner >> compatible with the core PCI code, we have the config access functions >> synthesize Enhanced Allocation (EA) capability entries for each BAR. >> >> Since this EA synthesis is needed for exactly one chip model, we can >> hard code some assumptions about the device topology and the >> properties of specific DEVFNs in the driver. >> >> Signed-off-by: David Daney >> --- >> .../devicetree/bindings/pci/pci-thunder-ecam.txt | 30 ++ >> drivers/pci/host/Kconfig | 7 + >> drivers/pci/host/Makefile | 1 + >> drivers/pci/host/pci-thunder-ecam.c | 358 +++++++++++++++++++++ >> 4 files changed, 396 insertions(+) >> create mode 100644 Documentation/devicetree/bindings/pci/pci-thunder-ecam.txt >> create mode 100644 drivers/pci/host/pci-thunder-ecam.c >> >> diff --git a/Documentation/devicetree/bindings/pci/pci-thunder-ecam.txt b/Documentation/devicetree/bindings/pci/pci-thunder-ecam.txt >> new file mode 100644 >> index 0000000..34658f2 >> --- /dev/null >> +++ b/Documentation/devicetree/bindings/pci/pci-thunder-ecam.txt >> @@ -0,0 +1,30 @@ >> +* ThunderX PCI host controller for pass-1.x silicon >> + >> +Firmware-initialized PCI host controller to on-chip devices found on >> +some Cavium ThunderX processors. These devices have ECAM based config >> +access, but the BARs are all at fixed addresses. We handle the fixed >> +addresses by synthesizing Enhanced Allocation (EA) capabilities for >> +these devices. >> + >> +The properties and their meanings are identical to those described in >> +host-generic-pci.txt except as listed below. >> + >> +Properties of the host controller node that differ from >> +host-generic-pci.txt: >> + >> +- compatible : Must be "cavium,pci-host-thunder-ecam" >> + >> +Example: >> + >> + pci@84b0,00000000 { > > Drop the comma, OK... > and the node name should be "pcie". > Why pcie? There are no PCIe devices or buses reachable from this type of root complex. There are however many PCI devices. > Otherwise, > > Acked-by: Rob Herring > >> + compatible = "cavium,pci-host-thunder-ecam"; >> + device_type = "pci"; >> + msi-parent = <&its>; >> + msi-map = <0 &its 0x30000 0x10000>; >> + bus-range = <0 31>; >> + #size-cells = <2>; >> + #address-cells = <3>; >> + #stream-id-cells = <1>; >> + reg = <0x84b0 0x00000000 0 0x02000000>; /* Configuration space */ >> + ranges = <0x03000000 0x8180 0x00000000 0x8180 0x00000000 0x80 0x00000000>; /* mem ranges */ >> + };