Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932724AbcC3IXT (ORCPT ); Wed, 30 Mar 2016 04:23:19 -0400 Received: from mail-db3on0070.outbound.protection.outlook.com ([157.55.234.70]:24896 "EHLO emea01-db3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1758658AbcC3IXL (ORCPT ); Wed, 30 Mar 2016 04:23:11 -0400 From: Peter Chen To: "maitysanchayan@gmail.com" CC: Stefan Agner , Peter Chen , "linux-usb@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "ivan.ivanov@linaro.org" , "linux-arm-kernel@lists.infradead.org" , "devicetree@vger.kernel.org" , "shawnguo@kernel.org" , "marcel@ziswiler.com" Subject: RE: [RFC PATCH 0/4] Implement USB device/host switch for Vybrid Thread-Topic: [RFC PATCH 0/4] Implement USB device/host switch for Vybrid Thread-Index: AQHRfpbZAapanA/FP0SKak35j46ZtJ9p1iGAgAU5joCAAJV5QIAB+ZsAgAAaH2A= Date: Wed, 30 Mar 2016 08:07:13 +0000 Message-ID: References: <20160325074051.GB22398@peterchendt> <3c2e72efc8cae93ff31be1b44f9a02b3@agner.ch> <20160330063246.GA16028@Sanchayan-Arch.toradex.int> In-Reply-To: <20160330063246.GA16028@Sanchayan-Arch.toradex.int> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=none action=none header.from=nxp.com; x-originating-ip: [58.33.225.112] x-ms-office365-filtering-correlation-id: 73e542a1-1b1e-49ce-052f-08d358724d55 x-microsoft-exchange-diagnostics: 1;HE1PR04MB1452;5:XHQdt4frPWZmJRseEQg6/HbkepUD5luzUt/6fDoFbSdJAp7DeNrMtEVLIDtO02bh1XizhU8LQLgS87ApITNPGH3yrimygz/L1sl8l54E10nlHNLkiWv3tky9ljxbBXrGul1xqTPfPwrKfQjqBjRJwQ==;24:8d2t0zxJ3m0Y8CdEEpvV4V9YV/LIXSFVxfK7N537ZADYzY+XvyOAXiPx2Ch35wdKS6hOS+GJzOqRGus1EVTS97efK4trHVyPiMIZgikq3O0= x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:HE1PR04MB1452; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001);SRVR:HE1PR04MB1452;BCL:0;PCL:0;RULEID:;SRVR:HE1PR04MB1452; x-forefront-prvs: 08978A8F5C x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(6009001)(24454002)(377424004)(2900100001)(54356999)(50986999)(76176999)(74316001)(2950100001)(3280700002)(5640700001)(86362001)(81166005)(2501003)(4326007)(1411001)(6116002)(77096005)(3846002)(586003)(102836003)(5008740100001)(1220700001)(1096002)(11100500001)(5004730100002)(1730700002)(33656002)(106116001)(66066001)(92566002)(5002640100001)(10400500002)(189998001)(110136002)(3660700001)(122556002)(76576001)(2906002)(2351001)(87936001)(5003600100002)(93886004)(217873001);DIR:OUT;SFP:1101;SCL:1;SRVR:HE1PR04MB1452;H:HE1PR04MB1450.eurprd04.prod.outlook.com;FPR:;SPF:None;MLV:sfv;LANG:en; spamdiagnosticoutput: 1:23 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Mar 2016 08:07:13.4586 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR04MB1452 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 base64 to 8bit by mail.home.local id u2U8NQwK020906 Content-Length: 2095 Lines: 54 > > On 16-03-29 00:24:46, Peter Chen wrote: > > > > > > > > On 2016-03-25 00:40, Peter Chen wrote: > > > > On Tue, Mar 15, 2016 at 02:08:26PM +0530, Sanchayan Maity wrote: > > > >> Hello Peter, > > > >> > > > >> The existing usage of extcon in Chipidea driver relies on OTG > > > >> registers. In case of SoC with dual role device but not a true > > > >> OTG controller, this does not work. Such SoC's should specify the > > > >> existing CI_HDRC_DUAL_ROLE_NOT_OTG flag and do the role switch > > > >> without checking any of the OTG registers in my opinion. > > > >> This is the case for Vybrid which uses a Chipidea IP but does not > > > >> have a true 5 pin OTG implemented. > > > > > > > > Sorry to reply you late due to my new born baby. > > > > > > > > Are you sure Vybrid is NOT OTG core? Afaik, it is uses the same IP > > > > base with other Freescale SoCs, just the IP core is 2.40a. > > > > When working at device mode, can you read vbus status through OTGSC? > > > > And if there is an ID pin (input pin) for Vybrid? I mean SoC, not > > > > the board. > > > > > > I think the IP is actually OTG capable, the registers are there, but > > > the signals seem not to be available on the SoC package. That is also what > the RM says... > > > > > > Quotes from the RM: > > > > > > "OTG controller should be treated as Dual role controller that > > > allows the controller to act as either a Host or a device with no > > > support for HNP/SRP." > > > > > > And later, in Chapter 11.1: > > > > > > "The USB is not a true OTG. It can be configured by software to > > > function either as peripheral or as host. The ID pin, which is > > > unique for OTG operation, is not present in this implementation. > > > There are no five pin interface. The user will get four pin host/ device > interface." > > > > > > > Get it, thanks. I am doing a patch for covering this case and vbus always-on > case. > > If I may ask at this point, how would your implementation be covering this case > for Vybrid? > Yes, if the vbus and id status are from the extcon, it will not read register OTGSC. Peter