From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752493AbbEDMD6 (ORCPT ); Mon, 4 May 2015 08:03:58 -0400 Received: from mga14.intel.com ([192.55.52.115]:18535 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752051AbbEDMDv (ORCPT ); Mon, 4 May 2015 08:03:51 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,366,1427785200"; d="scan'208";a="720275402" Date: Mon, 4 May 2015 15:03:45 +0300 From: Heikki Krogerus To: Felipe Balbi Cc: David Cohen , Greg Kroah-Hartman , Stephen Boyd , Baolu Lu , Paul Bolle , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCHv3 10/12] usb: dwc3: add ULPI interface support Message-ID: <20150504120345.GA31055@kuha.fi.intel.com> References: <20150429082113.GC25288@kuha.fi.intel.com> <1430296233-144245-3-git-send-email-heikki.krogerus@linux.intel.com> <20150429150450.GC7262@saruman.tx.rr.com> <20150430103422.GB1372@kuha.fi.intel.com> <20150430145439.GC1515@saruman.tx.rr.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150430145439.GC1515@saruman.tx.rr.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Felipe, > > With 1.94a and newer, DWC3_GUSB3PIPECTL(0) and DWC3_GUSB2PHYCFG(0) > > keep their ctx over any kind of soft reset. And any configurations > > done to them here will take affect the latest when > > dwc3_core_soft_reset() is called. > > /me goes read Databook again. > > You're right. You're using the soft reset bit from DCTL, that only > resets the device side, not any global register. There are two details > which you don't appear to take care of, however. > > According to Table 7-82 on Databook 2.93a (page 725), bit 30 CSFTRST, > it's said that "Once this bit is cleared, the software must wait at > least 3 PHY clocks before accessing the PHY domain". Ok, I'll add a delay for that. > Futher down is > states that "Once a new clock is selected, the PHY domain must be reset > for proper operation". All PHYs will be reset once we call dwc3_core_soft_reset() and we do not need them to be operational before that, except in case of ULPI in order to register the interface. To make sure the ULPI interface and PHY are operational we call dwc3_soft_reset() which does everything needed for us. When we use DCTL.SoftRst the core will reset also the ULPI PHY (PHYSoftRst in DWC3_GUSB2PHYCFG(0) has no effect with ULPI). So dwc3_phy_setup() configures the PHY interfaces but it does not initialize them or the PHYs. dwc3_core_soft_reset() continues to take care of that in any case, so there is no reason to duplicate it. I think we need to point this out in the description comment of dwc3_phy_setup(). Thanks, -- heikki