Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754729AbbEUDOY (ORCPT ); Wed, 20 May 2015 23:14:24 -0400 Received: from mail-bn1on0148.outbound.protection.outlook.com ([157.56.110.148]:19456 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753751AbbEUDOT (ORCPT ); Wed, 20 May 2015 23:14:19 -0400 Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=freescale.com; rowland.harvard.edu; dkim=none (message not signed) header.d=none; Date: Thu, 21 May 2015 11:13:36 +0800 From: Peter Chen To: Rob Herring CC: Greg Kroah-Hartman , Kishon Vijay Abraham I , , , , Arnd Bergmann , Alan Stern Subject: Re: [PATCH v2 6/6] usb: chipidea: add work-around for Marvell HSIC PHY startup Message-ID: <20150521031334.GA2897@shlinux2> References: <1432087805-16671-1-git-send-email-robh@kernel.org> <1432087805-16671-7-git-send-email-robh@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <1432087805-16671-7-git-send-email-robh@kernel.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1;BN1AFFO11FD013;1:ulB7mX1MMiK0PcKPNl9K4a+DZhvy4bDtGpR8m/i6a/hKd0c1kWMtKJUdaQ8AQ1nySNJ8O+sX8lsdF0O+c94mWNZBe3YwiK66UESgW0oKk1aNsB9dADgezSuYdA0Bx7vFzrssS3b7Q18bngJnJBitX5Mu5+NXONcUV9wOezDkxDH0KDcxC4bIkTOebCXNMxrOZSN2kJpIs/LSYtSqJLxMv26uf4dH0IR7+yMdu+jshkfTzZSjZl00Enc/lS1aoctkTHxyW0xsSSFKjZvA9OMN3HYK/JE1wXa1EqToEeT+BbFuw0Hjw+WrBlWLBg7BVhme X-Forefront-Antispam-Report: CIP:192.88.158.2;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10019020)(6009001)(339900001)(24454002)(199003)(189002)(51704005)(33716001)(64706001)(104016003)(47776003)(46102003)(106466001)(81156007)(4001350100001)(54356999)(76176999)(4001540100001)(50986999)(97736004)(23726002)(85426001)(77156002)(97756001)(110136002)(50466002)(92566002)(19580405001)(19580395003)(68736005)(5001960100002)(5001920100001)(69596002)(86362001)(87936001)(105606002)(5001830100001)(62966003)(6806004)(5001860100001)(33656002)(46406003)(189998001)(2950100001)(77096005)(83506001)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:BL2PR03MB420;H:az84smr01.freescale.net;FPR:;SPF:Fail;PTR:InfoDomainNonexistent;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;BL2PR03MB420;2:7Tv+SRx/VlKmk4h4J1splt3fgb6I2FZnziowAKKGDWyYjPUYvPAFiLuFzygORzhx;2:tA6maKqEjduYY5FRajCAaDWoDbItvVhWnygrckCAoF895oxNrm+Im3a7eg0OODCPCCzXKmIVy4CJ1CaY6Jay5sAnbX54uZqEYOpkfPdUMUxKMURi1BBF0XrGcL9+tg2SvQWJEBEpHrbMAXXNqbxwwGAQ/CXIrrYkv5epovhkdMqLytL3kcj/DejFicqFQZLdb8IUTxTew8a6LK8YWYLuk/XaEDMKzDzt1BsRh8VUBlE=;6:SNoxTugZePdxJooWT0GMP14u8KBEPS1PcUApQdQ3D/SMbY2f548Lw40PMkyvXMXj3sH/P2x7gxKqb2W1rGtjEJKyjdXYwhD5YKcNUANNMr8x767OVRVMX4j3HyXFDFzzmWO4hABueXjU3gGatH4Z9WtYpiHbBomkOnLTQgVinY3kI0njUva8Kq8A/6DMLBN/v0/Jn3riitHve++T8xEZalZgJ2h33S0WX3iLGYzWwkGUXyhha/NaE1+3f9+V/DGubUun72zzpOpP86G+r7cL8LPlOuADkt6IOmtgu/RzU8aZf9lm0QM7iSiFRoIRkS/ZIhjwmL8sr+eWsIxUDkovmw==;3:i0L4TfRw+AC6gOLEea8KCXkLuRZHNTMSqhhOElb6E+hAJa12Avt5nMzEeMiz2SJwX4oJaTfm8VNNXzHmslz+ZOHmQWKD9nPAqIQ04zhFeqhbHC2ysu26zGPUVCpVnNuJhCa+Ct3ikopd1eocIWhGWwQ56r26SpNw7Brpo1K8FT4mzI5VVgMNCaitg35NmPFiQn9LoXiuaDWbU/NbwAm7laFsWCS8BKZP9OruBPfnriU/tnr7ewr4HwXu1gSPjGHSHxgggFh3c2yxktbLdSUGvztbiYRv5wsLFMWD/Ju7X6c= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BL2PR03MB420; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(5005006)(3002001);SRVR:BL2PR03MB420;BCL:0;PCL:0;RULEID:;SRVR:BL2PR03MB420; X-Forefront-PRVS: 0583A86C08 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BL2PR03MB420;9:c2YCCY9knPrZ7lZnwSX1NHe/LvIXraYhPnS7s0A138X?= =?us-ascii?Q?T9b25uNJ/O0fkJxTQqjas53uPQwsBcDmOZNT2O8mE4HcLbaNc+7kXJ0Zpjwm?= =?us-ascii?Q?Xc6MEALBuXIQnIjp3Bccoi+YF7lnVLV7QZ8aFkQVhCVztotaKHEqkm6/sFpS?= =?us-ascii?Q?iIcYnA5DOrRZd1/t8dJTg946v9BF5EJ3CxHCfm6T+H9K7Nyf2848VLwJfStG?= =?us-ascii?Q?E2gyWo6m3yK3E12Sqachd1varfPMijh1hzwV+V1nz/jSzzYsVpPz2yjwIRTR?= =?us-ascii?Q?F5o+qxYRNvtamEDxN9UFRsqwAaNevBkgmJmFGr+7vTWZELdDumrP7ccJ7+Hi?= =?us-ascii?Q?Um0XK4kLt3PgNG5HEbkNNL/mPSidRG1mmQi4di29rSqaFaVA7sZ8a3NUde/+?= =?us-ascii?Q?VbZ5fVZ1l3RHazwQm3bsNYPOeHHEfJOYxWVgCFe13730/WEaVT8tJOuhN7H8?= =?us-ascii?Q?qT3tXqd8Zdbbf9320oUbplYcntPUSjDvOUBma3woCArPdSH7qnNOZAVFb+gc?= =?us-ascii?Q?g0gyLyCt/U27bbbyKXhz1DM93n6OAy/KOx3dN9kCohXb9HVpVlbTr31m4PnQ?= =?us-ascii?Q?nZK5khAwIgJPLm9TZPQxbV8vpu0ZFOdfdkUWnoWuCFFklWEvvNr5dnT1OBpR?= =?us-ascii?Q?MbG2dI0f9EYN8wTH1qWSjL6HPwrC2Ea+oNC+1R4xQ/X0VDarUXEoXydHHmwp?= =?us-ascii?Q?R3hd4f15JBi9jotpgpO1gCxn80iZCCyFP0Y05860RqHplQT+sWn5Hm1aC3cW?= =?us-ascii?Q?UBrRXGxuq769EMN6GYmyA2dMnQPdUs3jciJr86MFDH/KCQ4rsthFf2muUlJ6?= =?us-ascii?Q?Og6rozaCGxDDYR9M50VWkroytG4cA33MyESPDBNILGazaYk54YO1ypF8iAao?= =?us-ascii?Q?79wc9hhseWbB53xsgQDrGFzrHcYa0hCyoyKtu6If22B+rXgbkK0j6o/bIf1X?= =?us-ascii?Q?ytfBbNAJlkIl72VlhCxhOGAF2aYMTIigHYs7DEXiTuDO+CIqS9cdkM8r9O/X?= =?us-ascii?Q?7N7Y3945TZFHAzcmnrtgT3cme8GBlSFBhvwS9rjynybOGd/zevVG7fTmo4Cf?= =?us-ascii?Q?JNduKwdwIx1RXAnWcpH5MVkSLqu4YQOjjgSwTRuIVTNhFxgA+HUiB8QXAlsp?= =?us-ascii?Q?KfUzPB5AX5QB7Aoye81qa6/ZLQb3t2tZwSC7RzGqiW62EfyA/iNDISKWxStP?= =?us-ascii?Q?G0mBltJudwXdfxnUYkSqVH1YX3jIv24hR?= X-Microsoft-Exchange-Diagnostics: 1;BL2PR03MB420;3:d5a0StxPRGcBbGaJnLjGw8KxKnbZh8mncJKzjQNjoad3u5r0B0LotaRJwoocxFkwCiRgTR5aEdcSch/tWSb9NnI3E7D25KwBSqT9s2s6p8Pz6V/wmTA1nYHTioVEjGqNhxOORampSfbQeo1eYciT1A==;10:JPI5iZzsD1COpZsU29YZrdG6I/LiBXWjHm3lT/QPlo2ZYCDlJ7qvDthKQWoDKrBp9yBpY55yna3t4CWbfIikJN/IuQLmr2/sx+zXwxcdwSc=;6:y/6+roBoYdJglcuG+Z1lXpQBLd5dQAxJqLfY7JpS18caXNO26p01dDKRIjGAYaei X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 May 2015 03:14:16.3815 (UTC) X-MS-Exchange-CrossTenant-Id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=710a03f5-10f6-4d38-9ff4-a80b81da590d;Ip=[192.88.158.2];Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL2PR03MB420 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2407 Lines: 75 On Tue, May 19, 2015 at 09:10:05PM -0500, Rob Herring wrote: > The Marvell 28nm HSIC PHY requires the port to be forced to HS mode after > the port power is applied. This is done using the test mode in the PORTSC > register. > > As HSIC is always HS, this work-around should be safe to do with all HSIC > PHYs. If not, a flag can also be added. I think a flag is needed, not sure all vendors can work well with that. > > Signed-off-by: Rob Herring > Cc: Peter Chen > Cc: Greg Kroah-Hartman > Cc: linux-usb@vger.kernel.org > --- > drivers/usb/chipidea/host.c | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > > diff --git a/drivers/usb/chipidea/host.c b/drivers/usb/chipidea/host.c > index 21fe1a3..6cf87b8 100644 > --- a/drivers/usb/chipidea/host.c > +++ b/drivers/usb/chipidea/host.c > @@ -37,12 +37,14 @@ static int (*orig_bus_suspend)(struct usb_hcd *hcd); > > struct ehci_ci_priv { > struct regulator *reg_vbus; > + struct ci_hdrc *ci; > }; > > static int ehci_ci_portpower(struct usb_hcd *hcd, int portnum, bool enable) > { > struct ehci_hcd *ehci = hcd_to_ehci(hcd); > struct ehci_ci_priv *priv = (struct ehci_ci_priv *)ehci->priv; > + struct ci_hdrc *ci = priv->ci; > struct device *dev = hcd->self.controller; > int ret = 0; > int port = HCS_N_PORTS(ehci->hcs_params); > @@ -64,6 +66,15 @@ static int ehci_ci_portpower(struct usb_hcd *hcd, int portnum, bool enable) > return ret; > } > } > + > + if (enable && (ci->platdata->phy_mode == USBPHY_INTERFACE_MODE_HSIC)) { > + /* > + * Marvell 28nm HSIC PHY requires forcing the port to HS mode. > + * As HSIC is always HS, this should be safe for others. > + */ > + hw_port_test_set(ci, 5); > + hw_port_test_set(ci, 0); > + } > return 0; > }; > > @@ -112,6 +123,7 @@ static int host_start(struct ci_hdrc *ci) > > priv = (struct ehci_ci_priv *)ehci->priv; > priv->reg_vbus = NULL; > + priv->ci = ci; > > if (ci->platdata->reg_vbus && !ci_otg_is_fsm_mode(ci)) { > if (ci->platdata->flags & CI_HDRC_TURN_VBUS_EARLY_ON) { > -- > 2.1.0 > -- Best Regards, Peter Chen -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/