Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S938605AbcKPJzh (ORCPT ); Wed, 16 Nov 2016 04:55:37 -0500 Received: from mail-ve1eur01on0052.outbound.protection.outlook.com ([104.47.1.52]:50684 "EHLO EUR01-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753617AbcKPJzT (ORCPT ); Wed, 16 Nov 2016 04:55:19 -0500 X-Greylist: delayed 9183 seconds by postgrey-1.27 at vger.kernel.org; Wed, 16 Nov 2016 04:55:18 EST From: Scott Wood To: Sriram Dash , "linux-kernel@vger.kernel.org" , "linux-usb@vger.kernel.org" , "devicetree@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" CC: "mark.rutland@arm.com" , "felipe.balbi@linux.intel.com" , "mathias.nyman@intel.com" , "catalin.marinas@arm.com" , "will.deacon@arm.com" , "kishon@ti.com" , "robh+dt@kernel.org" , "stern@rowland.harvard.edu" , Suresh Gupta , "gregkh@linuxfoundation.org" , "pku.leo@gmail.com" Subject: Re: [upstream-release] [PATCH 1/2] drivers: usb: phy: Add qoriq usb 3.0 phy driver support Thread-Topic: [upstream-release] [PATCH 1/2] drivers: usb: phy: Add qoriq usb 3.0 phy driver support Thread-Index: AQHSPjfIdBocuEaXMU2jHpnkfUNzKg== Date: Wed, 16 Nov 2016 07:22:09 +0000 Message-ID: References: <1479101215-26954-1-git-send-email-sriram.dash@nxp.com> <1479101215-26954-2-git-send-email-sriram.dash@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=scott.wood@nxp.com; x-originating-ip: [2601:449:8400:923b:12bf:48ff:fe84:c9a0] x-microsoft-exchange-diagnostics: 1;HE1PR0401MB1931;7:TTH5vUKaUZ3cjruL/0XAE3vqSKBoK6uRkTYTfb9oOglSqCxNvq7FpzIpUGBHNhFy42MY1129CO6n8tzIY+8eccEUC0BeVFqC+O1zt1q7Vy1wXdo39SLowmeidBnWzvoLWFnfKdo3CqfFedXE4FtrqJliKxnH40Mxnn4RevK0epey9mK7aP8OV7DGYAFgVq9fcujkQgBJYLaj4trGuAKsAQdlQVycT8zalwGfxGsA4+loRvBr0GEyYTN6iA/QZlEqd4Mb/VbiLJdt9pLUi3Vx1J5LWzDHOlJQ26nsBB5unjQa/CWN1C1vrAyJpeCSjk1WVy/lcRQpvlkL92m4NlWGsC9Cnho67U7UXdaSkIhgAeQ= x-ms-office365-filtering-correlation-id: 9ad39b15-1663-4879-ca5f-08d40df146ef x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:HE1PR0401MB1931; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6045074)(6060326)(6040279)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6055026)(6061324)(6046074)(6041221);SRVR:HE1PR0401MB1931;BCL:0;PCL:0;RULEID:;SRVR:HE1PR0401MB1931; x-forefront-prvs: 01283822F8 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(6009001)(7916002)(199003)(189002)(377454003)(43544003)(24454002)(122556002)(5001770100001)(97736004)(6506003)(229853002)(305945005)(87936001)(7846002)(77096005)(3280700002)(2900100001)(9686002)(33656002)(7736002)(189998001)(7416002)(2501003)(102836003)(74316002)(8936002)(5660300001)(68736007)(3660700001)(76176999)(7696004)(106116001)(76576001)(105586002)(101416001)(93886004)(50986999)(86362001)(2906002)(2201001)(81156014)(4326007)(54356999)(106356001)(6116002)(81166006)(92566002);DIR:OUT;SFP:1101;SCL:1;SRVR:HE1PR0401MB1931;H:HE1PR0401MB1931.eurprd04.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX: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: 16 Nov 2016 07:22:09.1970 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0401MB1931 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 uAG9u0CY001626 Content-Length: 2837 Lines: 84 On 11/15/2016 06:39 AM, Sriram Dash wrote: >> From: Scott Wood >> On 11/13/2016 11:27 PM, Sriram Dash wrote: >>> diff --git a/Documentation/devicetree/bindings/phy/phy-qoriq-usb3.txt >>> b/Documentation/devicetree/bindings/phy/phy-qoriq-usb3.txt >>> new file mode 100644 >>> index 0000000..d934c80 >>> --- /dev/null >>> +++ b/Documentation/devicetree/bindings/phy/phy-qoriq-usb3.txt >>> @@ -0,0 +1,36 @@ >>> +Driver for Freescale USB 3.0 PHY >>> + >>> +Required properties: >>> + >>> +- compatible : fsl,qoriq-usb3-phy >> > > Hi Scott, > >> This is a very vague compatible. Are there versioning registers within this register >> block? >> > > There are versioning registers for the phy (1.0 and 1.1). But the current erratum > A008751 does not require the mentioning of the version numbers. Was planning > to take care of the versioning when there is code diversity on the basis of the > version number. That is not how device tree bindings work. The describe the hardware, not the driver. That said, is the block version sufficient to tell whether a given chip has this erratum? If so, you don't need a special property for the erratum. If not, what is different about the PHY that is not described by the versioning? In any case, it would be nice to mention the version register and its offset in the binding, just so that it becomes part of the definition of this compatible string, and if we come out with some QorIQ chip with a USB3 PHY that is totally different and doesn't have that version register, it'll be clear that it needs a different compatible. >>> +static inline u32 qoriq_usb3_phy_readl(void __iomem *addr, u32 >>> +offset) { >>> + return __raw_readl(addr + offset); >>> +} >>> + >>> +static inline void qoriq_usb3_phy_writel(void __iomem *addr, u32 offset, >>> + u32 data) >>> +{ >>> + __raw_writel(data, addr + offset); >>> +} >> >> Why raw? Besides missing barriers, this will cause the accesses to be native-endian >> which is not correct. >> > > The only reason for __raw_writel is to make the code faster. Does that really matter here? > However, shall I use writel(with both barriers and byte swap) instead Yes, if the registers are little-endian on all chips. > and then make appropriate changes in the value 32'h27672B2A? Not sure what you mean here. > In my knowledge, there are more than 5 errata in pipeline, Then please get all of these errata described in the device tree ASAP (unless their presence can be reliably inferred from the block version, as discussed above). > However, in future, if any other erratum comes up, and it has to be applied > at any point other than during init, then the variable has to be added in > qoriq_usb3_phy struct and the property has to be read separately. Or if the erratum is detected by some means other than a device tree property... -Scott