From mboxrd@z Thu Jan 1 00:00:00 1970 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 05582C433EF for ; Thu, 19 May 2022 17:23:29 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id DC08683D0C; Thu, 19 May 2022 19:23:27 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org 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=linaro.org header.i=@linaro.org header.b="h+sPOe3S"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D0E8483D0C; Thu, 19 May 2022 19:23:25 +0200 (CEST) Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) (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 3201B83C2F for ; Thu, 19 May 2022 19:23:19 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=lee.jones@linaro.org Received: by mail-wr1-x433.google.com with SMTP id r23so8189645wrr.2 for ; Thu, 19 May 2022 10:23:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=NPCjxkK0fcdy9Hc1SRj7CcekHol/84J4BuMTNzss09o=; b=h+sPOe3SwizaDfXn9d4QcIL7tuqdzjDZ/k22EqaqENRa8ElsPSiVj8GsTKNygz4JUl bWYV7mNnzgSfcQb4nmuWemrXTRgC7OtDi0onXi7YxCRd4XoMje3s+H5RjCe8m+Pzu8/X fIjCOXxliSnWol4zAz1JTXe6E282oEAuWaK9ZpEVT+5AR82RJaMb+Jssa3xBdaEhCJIF SrtWw2ZEgbJFij3iU8HEiE8oJy+C71EXh7NYMI0GMoYGgMuV/moQkOyEh39UuJh1Ak1Z ZQOtDlkj23ZFlJpZrWcc7B2hJIXL2u5p8JDFj0P92od5Bag0nwnkrgYZfPf2lDMf8WD9 XbxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=NPCjxkK0fcdy9Hc1SRj7CcekHol/84J4BuMTNzss09o=; b=5Jp7bfUHymzeTFSyDHR0EI1FHmFCnfX4005bMwKsn4VCmunQhG94H4Ohk6AxOeSN3T lwH3j1CJRXngsCrfurIXJQMBZQNq6t4jnYLE9GulFS7Qe9zOTBPLLaUqaeM2feSRvd48 H4NHfz4CVgccAlXRu5PWAFfEzj19enzcnB1EGIQqVFzVKitIc0R3oHtmoIE6pa429q78 NMT9lFDIXVUW7IwdEiC0M4YQ3fQg6Xq3lwrroEl7ZAhvBkgY9CbjYKO3sT67lkH1u4gj UHmB37UgSlXlJcW3Lv8KqyVjNDgWmsMrn4k79Jv+dc3FSGP+MjyUSAbcJGptAjEJEXk8 ulVA== X-Gm-Message-State: AOAM532g5oiCczME1T/LvdIgSrm7Pvq/iDTu6mfgbXYyT/jf2k7ri9Pw 1bzWpM+97c6yESiGkaWGoOvogBm7vxCpzQ== X-Google-Smtp-Source: ABdhPJxEImLDPrgl2Dg4youLs3o6FCerpvBTK03EIn0cWFhCMDvMopyGWVkKSpyZfUImMxZHumnu5w== X-Received: by 2002:adf:dd06:0:b0:20d:c4b:e76f with SMTP id a6-20020adfdd06000000b0020d0c4be76fmr4966135wrm.581.1652980998686; Thu, 19 May 2022 10:23:18 -0700 (PDT) Received: from google.com (cpc155339-bagu17-2-0-cust87.1-3.cable.virginm.net. [86.27.177.88]) by smtp.gmail.com with ESMTPSA id s5-20020a7bc0c5000000b00397348aed2dsm77041wmh.34.2022.05.19.10.23.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 May 2022 10:23:18 -0700 (PDT) Date: Thu, 19 May 2022 18:23:15 +0100 From: Lee Jones To: Peter Geis Cc: Hugh Cole-Baker , U-Boot Mailing List , Caesar Wang , Vasily Khoruzhick , Kever Yang , Heiko Stuebner , Elaine Zhang , Brian Norris , "open list:ARM/Rockchip SoC..." , arm-mail-list Subject: Re: [U-Boot] [PATCH 2/2] rockchip: rk3399: rockpro64: enable force power on reset workaround Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: 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.5 at phobos.denx.de X-Virus-Status: Clean On Thu, 19 May 2022, Lee Jones wrote: > On Thu, 19 May 2022, Peter Geis wrote: > > > On Thu, May 19, 2022 at 11:47 AM Lee Jones wrote: > > > > > > On Thu, 19 May 2022, Lee Jones wrote: > > > > > > > On Thu, 19 May 2022, Peter Geis wrote: > > > > > > > > > On Thu, May 19, 2022 at 10:56 AM Lee Jones wrote: > > > > > > > > > > > > > > > > It's not clear how this issue (present 3 years ago) was finally > > > > > > > > > > resolved. From the thread, it looks as if the fix might have made its > > > > > > > > > > way into ATF, but I'm 87.6% sure ATF is not running on this platform > > > > > > > > > > (yet). > > > > > > > > > > > > > > > > > > The rk3399 SoC has a hardware bug where the power domains are not > > > > > > > > > reset upon a soft reset. This leads to situations like this one where > > > > > > > > > power domains are shut down during shutdown but aren't restored on > > > > > > > > > reboot. > > > > > > > > > > > > > > > > I assume this isn't something we can patch in the kernel driver? > > > > > > > > > > > > > > As far as I know it's being worked on by others, I have some ideas for > > > > > > > this as well but I've been focused on rk356x lately. > > > > > > > > > > > > Thanks for the update. > > > > > > > > > > > > > > > Mainline TF-A was patched to force all power domains online > > > > > > > > > when a soft reboot is triggered, which solved that issue. > > > > > > > > > > > > > > > > Okay, this is what I figured. > > > > > > > > > > > > > > > > > What particular issues are you having initializing modern u-boot on > > > > > > > > > this device? > > > > > > > > > > > > > > > > This is the output: https://pastebin.ubuntu.com/p/d5DmsSBnrR/ > > > > > > > > > > > > > > > > Speaking with one of the guys who supports RockPi 4 in AOSP, he > > > > > > > > suspects the DDR settings. Apparently settings for older SoCs > > > > > > > > sometimes get clobbered when support for newer SoCs is added. > > > > > > > > > > > > > > The rk3399 TPL code is specific to the rk3399 and it really hasn't > > > > > > > been touched much recently. I'm using the latest Mainline U-Boot on > > > > > > > both my Rockpro64 and Pinephone-Pro. I don't see TF-A being loaded, > > > > > > > which should happen between: > > > > > > > > > > > > > > Trying to boot from BOOTROM > > > > > > > Returning to boot ROM... > > > > > > > > > > > > > > Otherwise it just looks like the TPL code doesn't like being in a > > > > > > > single channel configuration. Does the 2GB model just forgo the second > > > > > > > ram chip? Or is this actually a 4GB model and it isn't detecting the > > > > > > > second chip in both downstream and mainline? Could you include the > > > > > > > TPL/SPL portion of downstream's output? > > > > > > > > > > > > TPL/SPL are mostly silent on the downstream build: > > > > > > > > > > > > https://pastebin.ubuntu.com/p/m2bBdjF8Wq/ > > > > > > > > > > > > Not sure if it helps at all, but ArmBian is pretty noisy: > > > > > > > > > > > > https://pastebin.ubuntu.com/p/fdPjmmqBDM/ > > > > > > > > > > Weird that downstream and mainline are being built with none of the > > > > > debug stuff enabled. Armbian clearly shows the initial setup occuring > > > > > correctly, and that it's a 4GB board. It's using both the Rockchip > > > > > miniloader with a Rockchip TF-A blob as well. > > > > > > > > > > > > > > > > > > > I am yet to investigate the u-boot story in any detail. > > > > > > > > > > > > > > > > It's on my TODO list for today. > > > > > > > > > > > > > > > > > Is there a particular reason it isn't using Mainline TF-A? > > > > > > > > > > > > > > > > We're not using Trusted Firmware yet. > > > > > > > > > > > > > > This platform does not work at all without TF-A. Optee is optional. > > > > > > > Either you are using the downstream blob from Rockchip or Mainline > > > > > > > built yourself. Personally I prefer using Mainline everything. If you > > > > > > > build Mainline U-Boot without TF-A it will throw a warning at the end > > > > > > > that says the created binary is non-functional. > > > > > > > > > > > > Right. Played a lot with this today. > > > > > > > > > > > > Our build was using TF-A which was built-in to the primary loader. > > > > > > > > > > > > I had 2 interesting results today. No idea how to explain them. > > > > > > > > > > > > First one was with Mainline u-boot and Mainline TF-A, which found, but > > > > > > was seemingly unable to boot the kernel: > > > > > > > > > > > > https://pastebin.ubuntu.com/p/9HRhPyfjYK/ > > > > > > > > > > > > The second interesting result I had was using our downstream u-boot > > > > > > with Mainline TF-A. It booted perfectly from cold, but managed to get > > > > > > stuck in the TPL on soft reboot in a very similar way to the one I > > > > > > reported earlier when not booting with TF-A ("Channel 1: col error"): > > > > > > > > > > > > > > > Mainline TF-A defaults to 115200 for its uart messages, so you need to > > > > > either A. pass the uart config from U-Boot to TF-A with a platform > > > > > config option (unreliable in my experience), B. change U-Boot to > > > > > 115200, or C. change TF-A to 1.5M (the path I take). Your mainline > > > > > > > > Hopefully this is enough: > > > > > > > > diff --git a/plat/rockchip/rk3399/rk3399_def.h b/plat/rockchip/rk3399/rk3399_def.h > > > > index ba83242eb..24ad94ae7 100644 > > > > --- a/plat/rockchip/rk3399/rk3399_def.h > > > > +++ b/plat/rockchip/rk3399/rk3399_def.h > > > > @@ -17,7 +17,8 @@ > > > > /************************************************************************** > > > > * UART related constants > > > > **************************************************************************/ > > > > -#define RK3399_BAUDRATE 115200 > > > > +//#define RK3399_BAUDRATE 115200 > > > > +#define RK3399_BAUDRATE 1500000 > > > > #define RK3399_UART_CLOCK 24000000 > > > > > > > > /****************************************************************************** > > > > Yes, that is sufficient. That's interesting. Would this change result in me now being able to see the console output from this (apparently) failed attempt: https://pastebin.ubuntu.com/p/9HRhPyfjYK/ However the result is the same as the downstream kernel where it fails in the TPL on soft reboot: https://pastebin.ubuntu.com/p/TZBYqTMCnN/ No TF-A messages seen though still. Is it possible that u-boot only runs TF-A on cold boot? Seems odd. What was the extra logging you mentioned before? -- Lee Jones [李琼斯] Principal Technical Lead - Developer Services Linaro.org │ Open source software for Arm SoCs Follow Linaro: Facebook | Twitter | Blog