Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S942034AbcJZN3S (ORCPT ); Wed, 26 Oct 2016 09:29:18 -0400 Received: from mail-db5eur01on0043.outbound.protection.outlook.com ([104.47.2.43]:63481 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S965045AbcJZN3K (ORCPT ); Wed, 26 Oct 2016 09:29:10 -0400 From: "M.H. Lian" To: Robin Murphy , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , "devicetree@vger.kernel.org" CC: Marc Zyngier , Stuart Yoder , Leo Li , Scott Wood , Shawn Guo , Mingkai Hu Subject: RE: [PATCH 1/6] dt/bindings: adjust bindings for Layerscape SCFG MSI Thread-Topic: [PATCH 1/6] dt/bindings: adjust bindings for Layerscape SCFG MSI Thread-Index: AQHSLrwGYu/OC+QhVUK3R3SPPN7oG6C5IkUAgAEgLFA= Date: Wed, 26 Oct 2016 06:55:22 +0000 Message-ID: References: <1477398945-22774-1-git-send-email-Minghuan.Lian@nxp.com> <0416d929-dfef-da09-8d9a-d1db8575afef@arm.com> In-Reply-To: <0416d929-dfef-da09-8d9a-d1db8575afef@arm.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=minghuan.lian@nxp.com; x-originating-ip: [123.151.195.1] x-ms-office365-filtering-correlation-id: b04d4714-75f5-4c5e-fd96-08d3fd6d0e75 x-microsoft-exchange-diagnostics: 1;DB6PR0401MB2629;7:P7fGqM138kMkkC34xs9aPQAct9xlIauJfp66TFWEjYDu5BQN/Eo1Fvq6MClM2h+ilOvQa8AU8SV97+09GCnGtoNZdU76zlIocZq3mAV61bbzbHZHVsFJDqL1+DgoRbdqGo66R2ep+QdT8fVCkQdIGQj+QlfmLdFg7d9hCUlHf7NJ5998P8bbPeNVMqgUHzsVVgutRhhcKu4Wmhn5RS0vhiTNEVqkl3lsg6KJrW+iiYcawnoCvnbxJdSSaYD8pYq9pRah+Egjwjpa68qxACMC05SVPGTZAuoc6A5zqRVHpBsN9Cq0RpMhKzVKQtGRNTU0Kf/trHiBjgmWuBucj38qxPvQ3Ia59C+RdnF3q+NA5wY= x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DB6PR0401MB2629; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(180628864354917)(9452136761055)(185117386973197)(258649278758335); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040176)(6045068)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(6055026)(6046068)(6072074);SRVR:DB6PR0401MB2629;BCL:0;PCL:0;RULEID:;SRVR:DB6PR0401MB2629; x-forefront-prvs: 0107098B6C x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(6009001)(7916002)(13464003)(189002)(24454002)(199003)(377454003)(76576001)(2950100002)(106356001)(8676002)(11100500001)(92566002)(8936002)(77096005)(305945005)(68736007)(87936001)(2906002)(105586002)(2900100001)(81156014)(74316002)(106116001)(189998001)(81166006)(50986999)(86362001)(2501003)(66066001)(5660300001)(2201001)(76176999)(54356999)(5002640100001)(7736002)(4326007)(7696004)(9686002)(33656002)(19580395003)(586003)(122556002)(3846002)(19580405001)(3660700001)(102836003)(3280700002)(6116002)(7846002)(101416001)(5001770100001)(10400500002)(97736004);DIR:OUT;SFP:1101;SCL:1;SRVR:DB6PR0401MB2629;H:VI1PR04MB1615.eurprd04.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Oct 2016 06:55:22.1945 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0401MB2629 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.home.local id u9QDTN19032663 Content-Length: 6489 Lines: 184 Hi Robin, Please see my comments inline. Thanks, Minghuan > -----Original Message----- > From: Robin Murphy [mailto:robin.murphy@arm.com] > Sent: Tuesday, October 25, 2016 9:01 PM > To: M.H. Lian ; linux-arm- > kernel@lists.infradead.org; linux-kernel@vger.kernel.org; > devicetree@vger.kernel.org > Cc: Marc Zyngier ; Stuart Yoder > ; Leo Li ; Scott Wood > ; Shawn Guo ; Mingkai Hu > > Subject: Re: [PATCH 1/6] dt/bindings: adjust bindings for Layerscape SCFG > MSI > > On 25/10/16 13:35, Minghuan Lian wrote: > > 1. The different version of a SoC may have different MSI > > implementation. But compatible "fsl,-msi" can not describe > > the SoC version. > > Can't it? > > compatible = "fsl-ls1043a-rev11-msi"; > > Oh, I guess it can! > > Joking aside, if there are multiple versions of a piece of hardware which > require *different* treatment by drivers, then it is obviously wrong to use > the same compatible string because *they are not compatible*. > [Minghuan Lian] Yes, but Rev1.0 and Rev1.1 SoC will use the same dts files. We cannot create different dts files for each revision of the same kind of SoC. It means that there are different variants in the different versions of the same SoC that will use the same compatible string. So I have to use SoC match interface to get the versions. I'm too radical. I do not want to first check SoC family via compatible string and then check revision via SoC match or SVR. I selected the "SoC match" like the following to get the related information at only one place. static struct soc_device_attribute soc_msi_matches[] = { { .family = "QorIQ LS1021A", .data = &ls1021_msi_cfg }, { .family = "QorIQ LS1012A", .data = &ls1021_msi_cfg }, { .family = "QorIQ LS1043A", .revision = "1.0", .data = &ls1021_msi_cfg }, { .family = "QorIQ LS1043A", .revision = "1.1", .data = &ls1043_rev11_msi_cfg }, { .family = "QorIQ LS1046A", .data = &ls1046_msi_cfg }, { }, }; I will remain the SoC related compatible and try to describe the difference via some kind of the property. > > The MSI driver will use SoC match interface to get SoC type and > > version instead of compatible string. So all MSI node can use the > > common compatible "fsl,ls-scfg-msi" and the original compatible is > > unnecessary. > > If there is some common level of functionality that *all* variants support > without the driver having to know which one is which, then there might be > some sense in having an additional common compatible to represent that > level of functionality, e.g. > > compatible = "fsl-ls1043a-rev11-msi", "fsl,ls-scfg-msi"; > > But if, say, new variants turn out to have less functionality, rather than more, > then there's probably not much point, and we should stick to specific, > accurate, compatible strings. > > DT is not specific to a kernel version, nor even to Linux. A string which triggers > some board-specific magic in a specific version of a Linux driver does not > describe the hardware. > > Robin. > > > 2. Layerscape SoCs may have one or several MSI controllers. > > In order to increase MSI interrupt number of a PCIe, the patch moves > > all MSI node into the parent node "msi-controller". So a PCIe can > > request MSI from all the MSI controllers. > > > > Signed-off-by: Minghuan Lian > > --- > > .../interrupt-controller/fsl,ls-scfg-msi.txt | 57 +++++++++++++++++++-- > - > > 1 file changed, 49 insertions(+), 8 deletions(-) > > > > diff --git > > a/Documentation/devicetree/bindings/interrupt-controller/fsl,ls-scfg-m > > si.txt > > b/Documentation/devicetree/bindings/interrupt-controller/fsl,ls-scfg-m > > si.txt > > index 9e38949..29f95fd 100644 > > --- > > a/Documentation/devicetree/bindings/interrupt-controller/fsl,ls-scfg-m > > si.txt > > +++ b/Documentation/devicetree/bindings/interrupt-controller/fsl,ls-sc > > +++ fg-msi.txt > > @@ -1,18 +1,28 @@ > > * Freescale Layerscape SCFG PCIe MSI controller > > > > +Layerscape SoCs may have one or multiple MSI controllers. > > +Each MSI controller must be showed as a child node. > > + > > Required properties: > > > > -- compatible: should be "fsl,-msi" to identify > > - Layerscape PCIe MSI controller block such as: > > - "fsl,1s1021a-msi" > > - "fsl,1s1043a-msi" > > +- compatible: should be "fsl,ls-scfg-msi" > > +- #address-cells: must be 2 > > +- #size-cells: must be 2 > > +- ranges: allows valid 1:1 translation between child's address space and > > + parent's address space > > - msi-controller: indicates that this is a PCIe MSI controller node > > + > > +Required child node: > > +A child node must exist to represent the MSI controller. > > +The following are properties specific to those nodes: > > + > > - reg: physical base address of the controller and length of memory > mapped. > > - interrupts: an interrupt to the parent interrupt controller. > > > > Optional properties: > > - interrupt-parent: the phandle to the parent interrupt controller. > > > > +Notes: > > This interrupt controller hardware is a second level interrupt > > controller that is hooked to a parent interrupt controller: e.g: ARM > > GIC for ARM-based platforms. If interrupt-parent is not provided, the > > default parent interrupt @@ -22,9 +32,40 @@ MSI controller node > > > > Examples: > > > > - msi1: msi-controller@1571000 { > > - compatible = "fsl,1s1043a-msi"; > > - reg = <0x0 0x1571000 0x0 0x8>, > > + msi: msi-controller { > > + compatible = "fsl,ls-scfg-msi"; > > + #address-cells = <2>; > > + #size-cells = <2>; > > + ranges; > > msi-controller; > > - interrupts = <0 116 0x4>; > > + > > + msi0@1580000 { > > + reg = <0x0 0x1580000 0x0 0x10000>; > > + interrupts = <0 116 0x4>, > > + <0 111 0x4>, > > + <0 112 0x4>, > > + <0 113 0x4>; > > + }; > > + > > + msi1@1590000 { > > + reg = <0x0 0x1590000 0x0 0x10000>; > > + interrupts = <0 126 0x4>, > > + <0 121 0x4>, > > + <0 122 0x4>, > > + <0 123 0x4>; > > + }; > > + > > + msi2@15a0000 { > > + reg = <0x0 0x15a0000 0x0 0x10000>; > > + interrupts = <0 160 0x4>, > > + <0 155 0x4>, > > + <0 156 0x4>, > > + <0 157 0x4>; > > + }; > > + }; > > + > > + pcie@3400000 { > > + ... > > + msi-parent = <&msi>; > > + ... > > }; > >