From patchwork Thu Jun 15 19:07:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Edwards X-Patchwork-Id: 1795581 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20221208 header.b=cnN30lgp; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4QhsHQ0XxNz20QH for ; Fri, 16 Jun 2023 05:07:30 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 264348617C; Thu, 15 Jun 2023 21:07:15 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="cnN30lgp"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A33D18617C; Thu, 15 Jun 2023 21:07:12 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x133.google.com (mail-il1-x133.google.com [IPv6:2607:f8b0:4864:20::133]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 8D11586140 for ; Thu, 15 Jun 2023 21:07:07 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=cfsworks@gmail.com Received: by mail-il1-x133.google.com with SMTP id e9e14a558f8ab-341ce6fb1bfso4415275ab.2 for ; Thu, 15 Jun 2023 12:07:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686856026; x=1689448026; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=VZUCM9H5mYFRZxZS3yWx7FVgQAu5r7KVuvJOnUdZYSs=; b=cnN30lgpR2nlLBrBJDgteWxu+u+KyWkiqvv3Dg0zWLe5z7ukYlMU8MSU08w+sAmfVx rtWYWUfVNt3GIT4oDz6abRyXFjdFWOKeO3r1u8x6RWpZDBNaayhieT/U5ybyspia/6N8 usJPwm74Mczmg9t0n4c89zNMJchcfp0yvW4QwgeazAnE1OyrhdQe/E9TKNP++L1DUUzi bWFGu7IxSkWthfqJec+XWhP2Xhmy0ZCYjrGmBb8s674TyBPZQNGSFLqi42V/EX/xJXvO mPV4LOeOfNDuNpoUdG4VLKWi6q5hKjgMH3Pw7GO1XhUBMHL8PRr12DtPSqxaayrMgN7+ 0hFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686856026; x=1689448026; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VZUCM9H5mYFRZxZS3yWx7FVgQAu5r7KVuvJOnUdZYSs=; b=YTKuX67t4XLDvsnDH9mmdA/sLNDYd1WjB/uqov0ue2EFSB6uf5prgNZIaALAIbC7TU zB+C15/IkQ3YfPLU99wksVipygim0mX88kLHNhMqzSSi+8/vp9mynoKpzrAXBhrXsLMF EfjIeNSINJlN/ws8uaR2F83ADvLEY5N9xZz61TucBt29lJnp9QgUOQB3K7XMtFTM/cTY AgHFrHx/HVoTItwRuyhGXOzJB/s+npB1DeObrPMEcegC/5VFJELEtrGw05QUHD5+X6V0 RttjNNcorjK5UW95fTkNTIJhKnEC9y+4ueW5Ehu7jEpnhKPDAI806eLFCltqCyrUT/1f ciIg== X-Gm-Message-State: AC+VfDxMOQ8MrIhrvTv6JUGV5wiwgeMLGCIs5DBGawr8HjFPG6b0Lhrt ySJcl3ejE10lUKK6+un+2DRI0mLs+aChDnkd X-Google-Smtp-Source: ACHHUZ6L6OMVWFQrgQriiuEVpH7TUmxw/F6oO7osWgdHo4dD4jcittsS9WI9BO5Dp6cg5jautkKgfA== X-Received: by 2002:a05:6e02:791:b0:335:7be2:26ca with SMTP id q17-20020a056e02079100b003357be226camr292919ils.19.1686856025996; Thu, 15 Jun 2023 12:07:05 -0700 (PDT) Received: from celestia.nettie.lan ([2001:470:42c4:101:b738:8cfc:8eb7:c069]) by smtp.gmail.com with ESMTPSA id o9-20020a92c689000000b0034095da6b5csm2224571ilg.80.2023.06.15.12.07.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Jun 2023 12:07:05 -0700 (PDT) From: Sam Edwards X-Google-Original-From: Sam Edwards To: u-boot@lists.denx.de Cc: Andre Przywara , Jagan Teki , Sam Edwards Subject: [PATCH v4 1/2] usb: musb-new: sunxi: only perform SRAM initialization when necessary Date: Thu, 15 Jun 2023 13:07:00 -0600 Message-Id: <20230615190701.327852-2-CFSworks@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230615190701.327852-1-CFSworks@gmail.com> References: <20230615190701.327852-1-CFSworks@gmail.com> MIME-Version: 1.0 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 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. Signed-off-by: Sam Edwards Reviewed-by: Andre Przywara Tested-by: Andre Przywara --- 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 c5c63249aa..1111a67eaf 100644 --- a/drivers/usb/musb-new/sunxi.c +++ b/drivers/usb/musb-new/sunxi.c @@ -83,6 +83,7 @@ struct sunxi_musb_config { struct musb_hdrc_config *config; + bool has_sram; }; struct sunxi_glue { @@ -311,7 +312,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); @@ -517,6 +521,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 = {