From patchwork Fri Jun 9 21:37:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Edwards X-Patchwork-Id: 1793242 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=Rakz0+2g; 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) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4QdDvw3SYyz20Vx for ; Sat, 10 Jun 2023 07:38:04 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0CE2D860C6; Fri, 9 Jun 2023 23:37:47 +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="Rakz0+2g"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A2D468479A; Fri, 9 Jun 2023 23:37:45 +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=unavailable autolearn_force=no version=3.4.2 Received: from mail-io1-xd36.google.com (mail-io1-xd36.google.com [IPv6:2607:f8b0:4864:20::d36]) (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 C0D51857D0 for ; Fri, 9 Jun 2023 23:37:40 +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-xd36.google.com with SMTP id ca18e2360f4ac-77a62a84855so96091839f.1 for ; Fri, 09 Jun 2023 14:37:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686346659; x=1688938659; 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=Rakz0+2ghrOVJi1+vUiMtgW81iuOI6xq5ZEOf/U7KtyDY4CQrVh+lo+yuDgO8kMWRO ZbkMhLc7hSjz8gCceFM1ZoAw5IIjkJNym9ELTNnmGKatLEJdiejS2zmpKN3baqDSP8sK L5PlSoju61VWI+mz27YoRhCGVnb6noLrMPqsQQapPblypFk9snuSlLt4JeH+0jQXg0YI OYiAuXTJRHXrq1wANHRQNnB/VoxkCmE1GKNUBpWK8Gbs6ggTFJeN3+wm6Bt06Z5wNNhA ab6o/V7OrFYKLDvWdixIlWmK5+xaXZWT5hnZnAMR/iI796GwbhKpIhIVF4tLVIsGqILG 8l/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686346659; x=1688938659; 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=bcglN5ykxaUJOjW/jLDTmqM1BMCmBq6PGdv4euA87vKRsj4KY0HID/Pz69mr6TJ5Sa hwNQRV4GmEeqSORkIZdopqLMyBBIk8lQPllU31LUwkoWgja8IayzeBtTXR9ifPsTcYXS PTdvEdQ+NFwwxjfUceVIeGAIOi3Dm6S/1T1y/loiQUnNrReKIZHSQRKtdhc3uZ7qX12G z4id3QzRl8FNm1xdr/bZ6OxUqJ33tr2KQUmCDtOjmbg9OKuDEpoVdE38D3odfLU0Y0vI rCLwP3mVhLGgKpMwN4+wpjDeqE5jgRMH3NPzOnWAPtd5XfHXWdFz/jOkuOM6rtZf2okP Emxw== X-Gm-Message-State: AC+VfDwFVQ7L9rIrD84D7QISRsEYtnayibr5KRWEXPYyO5QTGT8pxkXV OccUbohkAj/YxNvRVL0xb9/JQsdNYLrJY/1r X-Google-Smtp-Source: ACHHUZ6cyyJHuvKIyRtQr8m/4EV5vlYWtBMgIljm61hsyP6nHDcg/VCDIgUtTMt9zfwERZv5a9DeRA== X-Received: by 2002:a05:6602:2759:b0:76c:6674:243b with SMTP id b25-20020a056602275900b0076c6674243bmr2636326ioe.15.1686346659157; Fri, 09 Jun 2023 14:37:39 -0700 (PDT) Received: from celestia.nettie.lan ([2001:470:42c4:101:d264:8856:b4e9:a431]) by smtp.gmail.com with ESMTPSA id x6-20020a5e8306000000b0077a1b6f73b9sm1309187iom.41.2023.06.09.14.37.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Jun 2023 14:37:38 -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 v2 1/2] usb: musb-new: sunxi: only perform SRAM initialization when necessary Date: Fri, 9 Jun 2023 15:37:15 -0600 Message-Id: <20230609213716.107339-2-CFSworks@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230609213716.107339-1-CFSworks@gmail.com> References: <20230609213716.107339-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 = {