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 X-Spam-Level: X-Spam-Status: No, score=-3.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 19C91C4338F for ; Fri, 20 Aug 2021 02:06:53 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 3CBA661056 for ; Fri, 20 Aug 2021 02:06:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 3CBA661056 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 98CAE81E14; Fri, 20 Aug 2021 04:06:49 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (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=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="URoVEe6s"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 50602801FD; Fri, 20 Aug 2021 04:06:47 +0200 (CEST) Received: from mail-qk1-x72f.google.com (mail-qk1-x72f.google.com [IPv6:2607:f8b0:4864:20::72f]) (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 1B65782DB2 for ; Fri, 20 Aug 2021 04:06:38 +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=paul.liu@linaro.org Received: by mail-qk1-x72f.google.com with SMTP id bj38so9367316qkb.9 for ; Thu, 19 Aug 2021 19:06:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=4oLG6L99vfXPG1zmyxf3DJvGGOgxLcpxtp6dggV+IpU=; b=URoVEe6sLc7KG0Z8aSYs8MTtVDnYiOv5re7djk+0h8aIRZMMehZx1Fhj80UywUwIET 4hA5VxVwrK0WoTPpfI0oKokcv34UCycVO4Rf4u6TO7UbV0Lb42z3d74wfE4Scp8VLqPo nOYB2DjibyQG/K5NrdQWNZf4iTo17c6G07blKS7zzBr+yY7JTUej9ClyKojFGoeQbvYD 11ZnuM1GqB+WgT6RNBYvu433cpfPiS7oWii3+OVpzkeOdXMzPh8/Jrs/qBEEBbWmEfIR S74uIRbHjPZ0TEa2gl37PlR2Fl9708J685VBmCMTnfcCjLPIpQttgddzmRiX2J0XWhl9 v3ew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=4oLG6L99vfXPG1zmyxf3DJvGGOgxLcpxtp6dggV+IpU=; b=t0PvRKVg3h/6eT7/AjewG7DLqcOBfDDzLpOHtG/0Y2Y/bI7Wqhc9206bWvWzwrT0FV rr7mMFkPb6YLlquxU5vgPBcINXG8sWkQAIkeMs/0WqaSydeh6DPjQB0KBf5DS4u7WQcL ZSeUxODqpeJGisFEltNi4Hyi7oFkcyq3IckkaAs7HzHcnDLzyITlBY3Qx6sAyh3qW9n8 Yw8RGImEH7K9qogb/3BjwaYQmEjrkIIBw0XkWDnRRx/BmfS1H14g4po4RM0CTYSGcoNj J8pg0WRvbimjAskTAQwZO33EGeDYkoI9ZEgthDR7b4PuvCV4oSXchPbF9DPyRj4i82b1 sG2g== X-Gm-Message-State: AOAM531oyY05SsIp2ax2/Lz7QI74HmRM3HWDm6I7miCTRuVtHGtWfxNs KI7i/2k0Be0rKZJ+stPueH1EeMNzg7TS613TQGDM/g== X-Google-Smtp-Source: ABdhPJzPGMtAJdfxFExMSuqVtUzSWCiIDzRQUxdrqOd0dWJEyr6srOxFi7SMc+ZgEL8y9R8sdJJBgeykteeJZWyrPCE= X-Received: by 2002:a37:de15:: with SMTP id h21mr6639207qkj.124.1629425196380; Thu, 19 Aug 2021 19:06:36 -0700 (PDT) MIME-Version: 1.0 References: <20210813005901.16839-1-festevam@denx.de> <04480f602808792b607089e5c2868ec9@denx.de> <88d0c3c4-5596-32e9-0434-cd0316227a3f@kontron.de> In-Reply-To: From: Paul Liu Date: Fri, 20 Aug 2021 10:06:25 +0800 Message-ID: Subject: Re: [PATCH 1/2] imx8mm-cl-iot-gate: Do not build fip.bin by default To: Frieder Schrempf Cc: Fabio Estevam , Marek Vasut , Fabio Estevam , Stefano Babic , Kirill Kapranov , Uri Mashiach , Valentin Raevsky , U-Boot-Denx , Harald Seiler Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.2 at phobos.denx.de X-Virus-Status: Clean Hi Frieder, I think I might have found a reason. The problem might be that the board_get_usable_ram_top() doesn't subtract the memory used by optee. Optee on imx8m uses the end of the memory. It is passed by arguments. VERBOSE: Argument #1 = 0x7e000000 VERBOSE: Argument #2 = 0x2000000 So if I extract 0x80000000 by 0x2000000 then the board boots. That also explains why Fabio can boot his board because he doesn't use OPTEE. What I'm doing is I implemented a board_phys_sdram_size(). However because all of my boards are 2G memory. And I did set PHYS_SDRAM_SIZE to 2G when upstreaming Compulab's support previously. That means with or without board_phys_sdram_size() the board just doesn't boot on the master branch because the gd->ram_size is the same, 2GB. But you are correct, we do need to have board_phys_sdram_size() implemented because on Compulab's page we know that they have multiple choices. The memory could be 1G/2G/4G. So this function is needed to tell how much memory we have. But the hang problem is just not related to this function. The problem I think is we need to deal with rom_pointer that contains the OPTEE address in board_get_usable_ram_top(). Yours, Paul On Fri, 20 Aug 2021 at 04:51, Paul Liu wrote: > Hi Frieder, > > I'll confirm it. But I guess you are correct. I'll send a patch soon when > I implement this right. > > Yours, > Paul > > > On Thu, 19 Aug 2021 at 15:14, Frieder Schrempf < > frieder.schrempf@kontron.de> wrote: > >> On 19.08.21 02:27, Fabio Estevam wrote: >> > [Adding Marek] >> > >> > On Wed, Aug 18, 2021 at 6:39 PM Fabio Estevam >> wrote: >> >> >> >> Hi Paul, >> >> >> >> On Wed, Aug 18, 2021 at 6:32 PM Paul Liu wrote: >> >>> >> >>> Hi Fabio, >> >>> >> >>> I got several boards. With all different PN. But all of them are 2GB >> memory. And the recent master doesn't boot on one of my board. I haven't >> tried all of the combinations. >> >> >> >> With the U-Boot from Compulab, it reports 4GB. With mainline U-Boot it >> >> reports 2GB, so yes, there is an issue indeed. >> >> >> >> However, I don't see a hang. >> >> >> >>> After bisect, I found commit e27bddff breaks the boot. It just hang >> there. >> >> >> >> Adding Frieder as the author of the patch. >> > >> > Marek objected to this change, which is now: >> > e27bdd ff4b97 ("imx8m: Restrict usable memory to space below 4G >> boundary") >> >> Yes, Marek objected and it was still pulled in for some reason. >> >> > >> > As this causes a regression on Paul's i.MX8MM IoT Gateway board, >> > should this be reverted? >> >> Maybe, yes. I'll leave that decision to the maintainers. >> >> For the failure: The change in e27bddff4b97 assumes that gd->ram_size was >> set during initialization/detection of the DDR. Could it be that the >> Compulab board doesn't do this and gd->ram_size is 0 or differs from the >> actual DDR size? That would probably cause some kind of issue. >> >> Paul, maybe you could check if gd->ram_size is set properly. Other boards >> do this by implementing board_phys_sdram_size() [1], which also makes sure >> that the memory map is updated with the detected size in dram_init() [2]. >> >> [1] >> https://elixir.bootlin.com/u-boot/latest/source/board/gateworks/venice/imx8mm_venice.c#L21 >> [2] >> https://elixir.bootlin.com/u-boot/latest/source/arch/arm/mach-imx/imx8m/soc.c#L218 >> >