From patchwork Wed Jun 7 23:16:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Edwards X-Patchwork-Id: 1791946 X-Patchwork-Delegate: marek.vasut@gmail.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=KoBdFYcj; 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 4Qc3CQ48ljz20WP for ; Thu, 8 Jun 2023 09:17:22 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7EEAA8607F; Thu, 8 Jun 2023 01:16:58 +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="KoBdFYcj"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8A96D8478A; Thu, 8 Jun 2023 01:16:55 +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-io1-xd31.google.com (mail-io1-xd31.google.com [IPv6:2607:f8b0:4864:20::d31]) (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 1FA23860A6 for ; Thu, 8 Jun 2023 01:16:52 +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-io1-xd31.google.com with SMTP id ca18e2360f4ac-777b0dd72d8so167044439f.1 for ; Wed, 07 Jun 2023 16:16:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686179810; x=1688771810; 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=6tBeRX5MpMw8WjkuSBXWaznr5I03T/iX20okQ1VdT1k=; b=KoBdFYcjGlbafFleMA2zW0iS5VFsTg7wLmGLxcPuss+PZmJofRJDpN0rGiDuqtEl0x iZm5TIaEvKikgNsgz0YRbLiYr1Ks4ayXoYPg3L7J4yXYWpC8iZGB8MZRxoPD25sD68WU 8nQl7MiwBi3nq38NqUvtAEIyQBBdobhO5NeQrMZXELR8vMoOF4S6fMBiKpoOqxu/DkAG 6oyTvdeRe877WwbHmSfHf7Tr2OT5z/VPqesIKERK+esdBCYTvkmTH86nGijQENrMRoWh /Oeauk8djdtly/nTOxSWrIYI/ZmVHRI/O9hNTS3TMEBTv7Vpwj9D3cdcWFNmWnwSbcI8 4cCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686179810; x=1688771810; 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=6tBeRX5MpMw8WjkuSBXWaznr5I03T/iX20okQ1VdT1k=; b=Lyp7zWvU9qZ+tI5ncS0A8A7TGyjQQvmDcAqpuoXH5SuH2J4b9GyW9DY5zaMDeMHKKR 8oW3A2V02A8ZHZhymlsJM/sdpPAQTi+wlB5g6v55Gvo30cvJGHhhAxDF2jl154VBgfzL Qh2P70LZuDSAlj8D+FlUFQrDcg39VoazYPAOGcezMjd0f6vyiOp5IuyV24Le9Fn/Pgmf rL92CCi+018TN7Zaarrxi6CZgn7WQta64z1wSAVr4GuJcwKGg7s2yyKBSHYB/qLzB+ag RTU5UIuvh3H0uiQ5SUSKiwvDafryI8zpRCeN5io3DcP/RzjH6ZFIph0X9wf4B2LOtxLv Ix4A== X-Gm-Message-State: AC+VfDwYbqDSn2ae03HAP3HFOGXDcD72+1OQSggoFurD8nGq8JuZ2o78 Jz9NHjlNktZhANM3HsDYC7Apgfz3VYjMwjLW X-Google-Smtp-Source: ACHHUZ6HyOrbqnVGzNh1Z73s8I8bErORUfeGW9ffGI1PWcYffCUqzYIkAxn3cz4ulUvujdFYGDnoUQ== X-Received: by 2002:a5e:dc02:0:b0:777:aa2c:c2ab with SMTP id b2-20020a5edc02000000b00777aa2cc2abmr5443715iok.12.1686179810385; Wed, 07 Jun 2023 16:16:50 -0700 (PDT) Received: from celestia.nettie.lan ([2001:470:42c4:101:928e:2611:457e:59ff]) by smtp.gmail.com with ESMTPSA id g6-20020a0566380c4600b0040f7db6a264sm3560614jal.114.2023.06.07.16.16.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jun 2023 16:16:49 -0700 (PDT) From: Sam Edwards X-Google-Original-From: Sam Edwards To: u-boot@lists.denx.de Cc: Andre Przywara , Jagan Teki , Marek Vasut , Sam Edwards Subject: [PATCH 1/2] usb: musb-new: sunxi: only perform SRAM initialization when necessary Date: Wed, 7 Jun 2023 17:16:43 -0600 Message-Id: <20230607231644.28203-2-CFSworks@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230607231644.28203-1-CFSworks@gmail.com> References: <20230607231644.28203-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 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 = {