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=-16.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham 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 9AAF8C636C9 for ; Sun, 18 Jul 2021 02:22:34 +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 7ECA16109E for ; Sun, 18 Jul 2021 02:22:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7ECA16109E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4506C80F4B; Sun, 18 Jul 2021 04:22:31 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="TsvLIzrq"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8C0CC81E47; Sun, 18 Jul 2021 04:22:29 +0200 (CEST) Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) (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 08A1D80F0E for ; Sun, 18 Jul 2021 04:22:26 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@google.com Received: by mail-wr1-x42c.google.com with SMTP id d12so16788737wre.13 for ; Sat, 17 Jul 2021 19:22:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=iX9YEOfZxOSrG47WT3Wf2dpb8TSrUrPGuagRt3Tp8dk=; b=TsvLIzrq6nOqSZfXgps/ZcfszdQNIWD24eZwTU835pFYnwINSpqWuMbdOiHJEbRmgr WYPA9qhhK5Wx6rJlVqou9QsLimNUl5+4i4RDXiMUgBnbU80llUnpuLmS4BD3ik2lgcua uY/gixX4yanF4ZgalSjgyGv/qwAb4LMk1zZ14= 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=iX9YEOfZxOSrG47WT3Wf2dpb8TSrUrPGuagRt3Tp8dk=; b=XHcrkzJRDzphgRpdayUOVsezlY6Q+HEUlIsPOHDwW3t10q5QTY/DEysvRJHx2ru0uj Ri842s+3ipuLKBPEO2L0rVeTsHpv9hEK75nFaQk2GjJK90C7DvtDBqpW5zsS2KmURWLi naRnXLk92icDTKX+x7JbGAgG4qcmdDAbAJxXfHarEGv+12D/e8KRgBO9anUlmwoJ1Ikx JTI6QGwWMOZOOWuvr6nPQEPkhhyBuG7SfRfApBpd2TSKZtXe4QaodU2ePpxWLCNWW3oW HbiuqLoTrJTg8KylH2qF7CidXBklA0MTffhTayPSeKufhOpda6TE0pcGfWDHwFgBFBZ3 R50A== X-Gm-Message-State: AOAM531BppcfzCL3LiY8dHoWZrhgt8Nge5I7CEugRoWtPowNgDb3Ki8r uEFpTe3ZIHBNMazwTh4RUyc5KndP634G/E7AzfHGJg== X-Google-Smtp-Source: ABdhPJzddz3h9ZG9w3QroubhZHJRqkcYyk4Enu3YpW5HNfUpCKY/GiUkIba23qr3PRZQ2GIx/gY4g14E4UwpLH3/Dwc= X-Received: by 2002:adf:ce83:: with SMTP id r3mr21998384wrn.204.1626574945077; Sat, 17 Jul 2021 19:22:25 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Simon Glass Date: Sat, 17 Jul 2021 20:22:12 -0600 Message-ID: Subject: Re: using binman fails boot To: Tim Harvey Cc: u-boot Content-Type: text/plain; charset="UTF-8" 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 Tim, On Fri, 16 Jul 2021 at 17:15, Tim Harvey wrote: > > On Fri, Jul 16, 2021 at 3:11 PM Simon Glass wrote: > > > > () which has > > Hi Tim, > > > > On Fri, 16 Jul 2021 at 15:43, Tim Harvey wrote: > > > > > > On Thu, Jul 15, 2021 at 9:30 PM Simon Glass wrote: > > > > > > > > Hi Tim, > > > > > > > > On Thu, 15 Jul 2021 at 16:58, Tim Harvey wrote: > > > > > > > > > > Greetings, > > > > > > > > > > I'm taking a look at moving imx8mm-venice to use binman for packaging. > > > > > After doing so U-Boot proper fails to boot: > > > > > > > > > > U-Boot SPL 2021.07-00475-g1126252f40 (Jul 15 2021 - 11:09:02 -0700) > > > > > GSC : v58 0xf098 RST:VIN Thermal Protection Disabled > > > > > Model : GW7300-00-B1B > > > > > Serial : 852420 > > > > > MFGDate : 10-26-2020 > > > > > RTC : 122 > > > > > PMIC : MP5416 > > > > > DRAM : LPDDR4 1 GiB > > > > > WDT: Not starting > > > > > Trying to boot from MMC1 > > > > > DTB : imx8mm-venice-gw73xx-0x > > > > > > > > > > > > > > > U-Boot 2021.07-00475-g1126252f40 (Jul 15 2021 - 11:09:02 -0700) > > > > > > > > > > CPU: Freescale i.MX8MMQ rev1.0 1600 MHz (running at 1200 MHz) > > > > > CPU: Industrial temperature grade (-40C to 105C) at 43C > > > > > Reset cause: POR > > > > > Model: Gateworks Venice GW73xx-0x i.MX8MM Development Kit > > > > > DRAM: 1 GiB > > > > > temp : 38.3C > > > > > vdd_bat : 0.000V > > > > > vdd_vin : 15.731V > > > > > vdd_adc1: 0.000V > > > > > vdd_adc2: 0.000V > > > > > vdd_dram: 1.093V > > > > > vdd_1p2 : 1.193V > > > > > vdd_1p0 : 0.985V > > > > > vdd_2p5 : 2.470V > > > > > vdd_3p3 : 3.250V > > > > > vdd_0p95: 0.948V > > > > > vdd_1p8 : 1.799V > > > > > vdd_gsc : 3.262V > > > > > initcall sequence 000000007ffc4f58 failed at call 0000000040255910 (err=-2) > > > > > ### ERROR ### Please RESET the board ### > > > > > > > > > > Any ideas what this could be? > > > > > > > > I don't have much idea. What is the initcall that is failing? Can you > > > > check u-boot.map ? That might give a clue as to what is failing. I > > > > assume the DT is passed to U-Boot somehow from SPL? > > > > > > > > > > Simon, > > > > > > Thanks for the help! > > > > > > The initcall addr doesn't match anything in u-boot.map (maybe > > > u-boot.map doesn't show what's in lib/binman.o?) but I was able to > > > > It certainly should show up, but if you have CONFIG_LTO enabled lots > > of functions disappear. Still if you get an initcall address I would > > expect a function to be present. Make sure you use the unallocated > > address. > > I'm not sure what you mean by 'Make sure you use the unallocated address' Sorry I mean unrelocated address. After U-Boot relocates the addresses change but it still prints out the original addresses. > > > > > > track it down to initr_binman() failing due to > > > binman_init()->find_image_node(&binman->image)' returning -EINVAL. > > > This is because my imx8mm-venice-gw73xx-0x-uboot.dtsi doesn't have a > > > binman node (my CONFIG_DEFAULT_DEVICE_TREE did but not my actual > > > dtbs). So I have it working now! > > > > OK good progress! Perhaps we should put an error message in initr_binman() ? > > > > sure - I just sent a patch > > > > > > > > > > > > > > > > > > > > > > A follow-on question is that I would like to investigate using binman > > > > > in the SPL to dynamically access the IMX8M ddr training blobs so that > > > > > we don't have to waste padding space taking them onto the end of the > > > > > SPL which is currently done. The lpddr4 training blobs I'm using > > > > > currently take up 57k without padding compared to 81k with padding. > > > > > The location of them is handled in ddr_load_train_firmware. > > > > > > > > > > If I add the following to my SPL: > > > > > diff --git a/board/gateworks/venice/spl.c b/board/gateworks/venice/spl.c > > > > > index d0a490b0e6..62eb67fa5e 100644 > > > > > --- a/board/gateworks/venice/spl.c > > > > > +++ b/board/gateworks/venice/spl.c > > > > > @@ -3,6 +3,7 @@ > > > > > * Copyright 2021 Gateworks Corporation > > > > > */ > > > > > > > > > > +#include > > > > > #include > > > > > #include > > > > > #include > > > > > @@ -252,6 +253,8 @@ static int power_init_board(void) > > > > > return 0; > > > > > } > > > > > > > > > > +binman_sym_declare(ulong, blob_1, image_pos); > > > > > + > > > > > void board_init_f(ulong dummy) > > > > > { > > > > > struct udevice *dev; > > > > > @@ -291,6 +294,8 @@ void board_init_f(ulong dummy) > > > > > gpio_request(PCIE_RSTN, "perst#"); > > > > > gpio_direction_output(PCIE_RSTN, 0); > > > > > > > > > > + printf("%s: blob_1:0x%0lx\n", __func__, binman_sym(ulong, > > > > > blob_1, image_pos)); > > > > > + > > > > > /* GSC */ > > > > > dram_sz = gsc_init(0); > > > > > > > > > > I get 'blob_1:0x0' which is not what I expected. > > > > > > > > > > If I understand correctly binman is using linker symbols to determine > > > > > where things are in the image? What I don't quite understand is what > > > > > symbols are valid to use assuming my dtsi above. The binman.rst docs > > > > > talk use 'u_boot_any' as an example which apparently can match > > > > > 'u-boot.bin', 'u-boot.img', and 'u-boot-nodtb.bin' but I can't find > > > > > the code that somehow translates this meaning. > > > > > > > > Actually any symbol can be used. It basically depends on the name of > > > > the entry in your image description. So here it would be > > > > blob-ext@1...I think that translates to blob_ext_1 but I'm not sure > > > > about the @. You could try blob-ext-1 instead. It does not know about > > > > phandles or labels. > > > > > > > > If you pass BINMAN_VERBOSE=4 to the build you should see it talking > > > > about writing symbols into the SPL image. > > > > > > > > > > For the following: > > > u-boot-spl-ddr { > > > filename = "u-boot-spl-ddr.bin"; > > > pad-byte = <0xff>; > > > align-size = <4>; > > > align = <4>; > > > > > > u-boot-spl { > > > align-end = <4>; > > > }; > > > > > > blob-ext@1 { > > > filename = "lpddr4_pmu_train_1d_imem.bin"; > > > size = <0x8000>; > > > }; > > > > > > blob-ext@2 { > > > filename = "lpddr4_pmu_train_1d_dmem.bin"; > > > size = <0x4000>; > > > }; > > > > > > blob-ext@3 { > > > filename = "lpddr4_pmu_train_2d_imem.bin"; > > > size = <0x8000>; > > > }; > > > > > > blob-ext@4 { > > > filename = "lpddr4_pmu_train_2d_dmem.bin"; > > > size = <0x4000>; > > > }; > > > }; > > > > > > I tried 'blob_ext_1' and 'blob_ext1' and both formats resolve to 0x0. > > > The 'ext-blob' is an entry type supported by binman so if I had > > > multiple they must be called blob-ext@1, blob-ext@2, ... right? > > > > > > The entry_name used in binman_sym_declare/binman_sym certainly can't > > > support non C varname characters so '-' and '@' characters must get > > > translated somewhere. Where would that be done in order to figure out > > > what to use? > > > > If you want to look at the internals, see section.py LookupSymbol(). > > > > It takes the ELF symbol and replaces _ by - but does not (cannot) > > replace _ with @. So I think you'll have to use - instead of @ > > > > I suppose we could do the search in the other direction (take the > > entry and try to find the symbol that matches it), but I'd need to > > think about it. A simple translation is easier. > > > > In this case binman should really give an error for your chosen entry > > name (blob-ext@4) but it doesn't know you are using it as a symbol. I > > think it should complain about this (see the Warning in section.py > > LookupSymbol()) but apparently it does not in your case. > > But isn't blob-ext@4 a correct name? I can't use 'blob-ext-4' as > that's an unknown entry type. Well you can use any name and specify the type: my-name { type = "blob-ext"; }; > > > > > If you can push your tree somewhere (with this problem) I'll see if I > > can figure out why. > > > > Sure, I pushed it to > https://github.com/Gateworks/uboot-venice/tree/WIP-venice-binman > make imx8mm_venice_defconfig > make OK > > > > > > > BINMAN_VERBOSE=4 indeed prints out a tone of stuff but I'm not seeing > > > anything for 'blob' below that would seem to indicate one node name vs > > > another: > > > > Oops you need BINMAN_VERBOSE=5 - see elf.py LookupAndWriteSymbols() > > which has tout.Debug() which is level 5. > > > > LookupAndWriteSymbols ends up doing nothing because > syms.get('__image_copy_start') returns None. Well that is likely the problem. Regards, Simon