Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A226BC7EE23 for ; Thu, 8 Jun 2023 12:03:21 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D6B7286086; Thu, 8 Jun 2023 14:03:19 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id DF35C860BC; Thu, 8 Jun 2023 14:03:17 +0200 (CEST) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by phobos.denx.de (Postfix) with ESMTP id 9DDB7846B0 for ; Thu, 8 Jun 2023 14:03:14 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=andre.przywara@arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 30C84AB6; Thu, 8 Jun 2023 05:03:59 -0700 (PDT) Received: from donnerap.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 0E5133F663; Thu, 8 Jun 2023 05:03:12 -0700 (PDT) Date: Thu, 8 Jun 2023 13:03:10 +0100 From: Andre Przywara To: Sam Edwards Cc: u-boot@lists.denx.de, Jagan Teki , Marek Vasut Subject: Re: [PATCH 1/2] usb: musb-new: sunxi: only perform SRAM initialization when necessary Message-ID: <20230608130310.6a873b9d@donnerap.cambridge.arm.com> In-Reply-To: <20230607231644.28203-2-CFSworks@gmail.com> References: <20230607231644.28203-1-CFSworks@gmail.com> <20230607231644.28203-2-CFSworks@gmail.com> Organization: ARM X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.32; aarch64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean On Wed, 7 Jun 2023 17:16:43 -0600 Sam Edwards wrote: > Only the older (ca. A10, A20) sunxis need this poke for the MUSB to > function. Mimic the Linux kernel and add a `has_sram` flag to the config > structure that is only set for the specific compatibles that require > this initialization. The patch looks alright in general, thanks for sending this! I will try to test it on an older SoC in the next days. As an added bonus, that should actually help the F1C100s USB(-OTG) support. Cheers, Andre > Signed-off-by: Sam Edwards > --- > drivers/usb/musb-new/sunxi.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/drivers/usb/musb-new/sunxi.c b/drivers/usb/musb-new/sunxi.c > index ab55d68620..c05c0d5561 100644 > --- a/drivers/usb/musb-new/sunxi.c > +++ b/drivers/usb/musb-new/sunxi.c > @@ -85,6 +85,7 @@ > > struct sunxi_musb_config { > struct musb_hdrc_config *config; > + bool has_sram; > }; > > struct sunxi_glue { > @@ -313,7 +314,10 @@ static int sunxi_musb_init(struct musb *musb) > > musb->isr = sunxi_musb_interrupt; > > - USBC_ConfigFIFO_Base(); > + if (glue->cfg->has_sram) { > + USBC_ConfigFIFO_Base(); > + } > + > USBC_EnableDpDmPullUp(musb->mregs); > USBC_EnableIdPullUp(musb->mregs); > > @@ -525,6 +529,7 @@ static int musb_usb_remove(struct udevice *dev) > > static const struct sunxi_musb_config sun4i_a10_cfg = { > .config = &musb_config, > + .has_sram = true, > }; > > static const struct sunxi_musb_config sun6i_a31_cfg = {