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 D6B6CC7EE25 for ; Wed, 7 Jun 2023 23:29:36 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id EB01D84988; Thu, 8 Jun 2023 01:29:34 +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="T2MVslJx"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 08B1A847D7; Thu, 8 Jun 2023 01:29:33 +0200 (CEST) Received: from mail-il1-x134.google.com (mail-il1-x134.google.com [IPv6:2607:f8b0:4864:20::134]) (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 428E284988 for ; Thu, 8 Jun 2023 01:29:29 +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-x134.google.com with SMTP id e9e14a558f8ab-33b3f2f7989so7486495ab.0 for ; Wed, 07 Jun 2023 16:29:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686180568; x=1688772568; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=TWOHovLqEMFy5O4S3Kjk0scbouauzuKVYoINR+Pqrfg=; b=T2MVslJxbmLMAr8+/WF82O5Wq+XapluYaNMYYQmBAAt0fNuiUgB2rtAsCgIZAZ2Wni n1nZ1GIaZJWu/d/svLGoUh0Fu+MPDJyScF1bBvs3iflb4usovC4c5lJv7mHWTlgRSnOj WnENLPhmRLhGSMp8kci8QztpoWjyDl8FL6FGeFK67KBhuEbuhEIzEvWHAHiOjl/KeLPv fSayux+1T83DrP6vCpzFSUbhMo0ldS6Jub2QkBjUL60VufoTOOKoDxwUXH49UZhNV0fz fuKaQlca2qG1CBc9QyIxTCPLf0wcKvN01ZCyFVzqhLn2aPZuT2naYO/yLgA+ImSFXqDN e5vA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686180568; x=1688772568; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=TWOHovLqEMFy5O4S3Kjk0scbouauzuKVYoINR+Pqrfg=; b=j9K6b2gQkY1dWAUz6GI5PKtxbXhxNMq2H7xVtwQvnQpTrAOwOXt2WyU7mN8VnFWbWR e+S+i0W6EFaA6Uau0WqHxD3WE/+t/ZW4DVBvulhhCTF66l5LWBwwAMm2qqxWVmOjV3ar DuddBSGCkiqNQLvKvkJQ0C4u3rIWbOKX4qFffhrMLUGbKzebjigxO1dUBCeMUDJyMK0J zwj1FdNRFCbkuojIABQyBcDnK7lqP5P2gm716N0e6XraGXqqTkgM+Aol0W/r5ZSWtaAY 7esFh66Jo8fAAlUt0/AzpWOHwxPdDfgkKKY4Um/wIIznRZrDC8iK3l+T6DYIgEOwIIsN hB3g== X-Gm-Message-State: AC+VfDy4RYTTJbDzzSgZnPbAZ77QYqtIeRTam+4brwIta6emHpmwtqwz mX0tyl0TuyfcS5zxrsVgxrA= X-Google-Smtp-Source: ACHHUZ7TUQVDQz6iRv0h/gRUVO1NSskZbMRG7gIUZF4mSfY0wGDVtDRy1cIMAOuxnVj9OCs2SXyG2g== X-Received: by 2002:a92:d484:0:b0:33d:6988:bfea with SMTP id p4-20020a92d484000000b0033d6988bfeamr4461213ilg.21.1686180567855; Wed, 07 Jun 2023 16:29:27 -0700 (PDT) Received: from ?IPV6:2001:470:42c4:101:928e:2611:457e:59ff? ([2001:470:42c4:101:928e:2611:457e:59ff]) by smtp.gmail.com with ESMTPSA id x5-20020a92d305000000b0032aef6b60adsm38898ila.34.2023.06.07.16.29.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 07 Jun 2023 16:29:27 -0700 (PDT) Message-ID: <8848c22c-e83f-a465-b45e-909c57f7c787@gmail.com> Date: Wed, 7 Jun 2023 17:29:26 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [PATCH 1/3] usb: musb-new: sunxi: do not attempt to access NULL SRAMC Content-Language: en-US To: Andre Przywara Cc: u-boot@lists.denx.de, Jagan Teki , Marek Vasut , Maksim Kiselev References: <20230602214958.167909-1-CFSworks@gmail.com> <20230602214958.167909-2-CFSworks@gmail.com> <20230605120424.7ed91fb4@donnerap.cambridge.arm.com> <20230607114505.1eac894d@donnerap.cambridge.arm.com> From: Sam Edwards In-Reply-To: <20230607114505.1eac894d@donnerap.cambridge.arm.com> Content-Type: text/plain; charset=UTF-8; format=flowed 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 Hey Andre, On 6/7/23 04:45, Andre Przywara wrote: > "syscon" really just means "a bunch of gates where AW didn't know where > else to put them". The good ol' "kitchen sink" register block, eh? Its lack of clear, definite purpose is even reflected in the name, because when you think about it, isn't *every* MMIO register for "system control"? :) > Yeah, it seems this way, though nobody knows for sure ;-) I believe this > is code that came from the original Allwinner BSP, which tends to do, > well, weird stuff at times ;-) I've gone ahead and submitted a patch for rewording this in the driver source anyway. In the commit message, I've included a way we could verify this experimentally, though I don't have access to an early Allwinner SoC with which to try it. > Yeah, so there are three steps, in increasing order of complexity: > 1) Change SUNXI_SRAMC_BASE to 0x3000000. That's done already in my tree. I've done it over here as well. > 2) Introduce some has_sram property in U-Boot's MUSB driver and only poke > the SRAM D bit for those SoCs that need it. Done, a patch for that has been sent in. > 3) Follow the allwinner,sram phandle in the MUSB driver and fish out the > syscon base address from the DTB, to avoid hardcoding it, at least for the > MUSB driver. We need it elsewhere, to access the version register and > print the SoC name. One of the patches I just sent in also adds a "TODO" comment to do this. I also kept the function separate specifically so someone coming along later wanting to add this has plenty of breathing room to do so. > Can you confirm that just changing the SUNXI_SRAMC_BASE to 0x3000000 avoids > the crash you saw, and removes the immediate need for this very patch here? Yes: I reverted enough changes to make the crash reappear, and then changed the base register. Updating SUNXI_SRAM_BASE to 0x03000000 resolves the crash with no side effects: it seems (BIT(0) of) 0x03000004 is RAZ/WI. > And if I get this right, you already have 2) implemented? I would love to > see it on the list, then. See Patchwork series #358672. Thanks for your continued efforts, Sam