From patchwork Mon Jun 12 20:03:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Edwards X-Patchwork-Id: 1794056 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=2a01:238:438b:c500:173d:9f52:ddab:ee01; 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=jFqqz/MG; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (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 4Qg2gP35vsz20Wl for ; Tue, 13 Jun 2023 06:03:29 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0E9B086128; Mon, 12 Jun 2023 22:03:19 +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="jFqqz/MG"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B9E9185F4F; Mon, 12 Jun 2023 22:03:10 +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-xd2c.google.com (mail-io1-xd2c.google.com [IPv6:2607:f8b0:4864:20::d2c]) (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 B7EFC85F79 for ; Mon, 12 Jun 2023 22:03: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-io1-xd2c.google.com with SMTP id ca18e2360f4ac-777b0cae9ecso304531339f.2 for ; Mon, 12 Jun 2023 13:03:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686600186; x=1689192186; 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=jFqqz/MGmElX0BviCN/GWARalvyJKy7+0IVX67zC3Q2gu8UATR2XCAt37q1mxThBxJ LsZ5fpYznOk3LtdFT9ds/FxwhmbvChFcg7P+zII1/F8WDSr+dVptDHv6LvUOZZlq6Nki dpTAaSFzQH5IrXQdDhfJlHeuD/kFApjUkJzJ6DMrQra1aHVRrnqSiiYyzzh3cc4JhbGO 03H0mCRcSuqsLXdyGdGxyo+PjST754cCEGIzhxRFmYaQpw1E9ndYz4vKNG/4dii3cbXV ahgzjV0bftrYBHyIAOalf37THJU4VYmocqSiduiUw54S+7r7DUaTcbyAbltiOq+E14b4 80Yw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686600186; x=1689192186; 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=aDVGizvnCyKCdQMR04Eg48kmybyCpqshJkKba3gyQWzuWRsBetU2y6AhPo93qIHafr QhJh4+OT7Lf4uE+QLSKMfYVkAORJjb1ljRaodpMCEKHhXXoh6TBYET8AJSXuBnnswyAk x5jPbX5ktzO9fvY9U6vzsyaKgBU+gVFgv4RU5yYex6HhKyDLNuLG2Mr8+nBGKuwZpqqd Ko45+UoeOLeSfEvbzIBjQAEIEG5rSEbqX99Mt1CtzGFXfoRG5zv9vAJHX0bHyBbQQQok LrCu+G43ZpfrTB3rAW4mb38bnwchHugFPNZMye/7cVPUXnDm6WDzfWuGQffJoGkm3DO4 Sp2w== X-Gm-Message-State: AC+VfDyYZk3sWv6w6IrMR6fyiZSTjfABfZco46oxOQiilB0mC0I972Iz xkoXHVwhQpbh86xY5sUWd6OB6JEr7uuDVJnI X-Google-Smtp-Source: ACHHUZ6iYyMk3O9fMNwTOYmkhVBUKasZTOId7tbl22V/WPmzxbKDhHvKo/wLbv0xZjWAbj2zz+aVEA== X-Received: by 2002:a5e:c017:0:b0:778:735c:9bed with SMTP id u23-20020a5ec017000000b00778735c9bedmr9330623iol.0.1686600186210; Mon, 12 Jun 2023 13:03:06 -0700 (PDT) Received: from celestia.nettie.lan ([2001:470:42c4:101:857:833a:c057:fc99]) by smtp.gmail.com with ESMTPSA id t5-20020a028785000000b0040fa5258658sm2925490jai.77.2023.06.12.13.03.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jun 2023 13:03: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 v3 1/2] usb: musb-new: sunxi: only perform SRAM initialization when necessary Date: Mon, 12 Jun 2023 14:03:01 -0600 Message-Id: <20230612200302.21354-2-CFSworks@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230612200302.21354-1-CFSworks@gmail.com> References: <20230612200302.21354-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 = {