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=-11.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,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 3B8A3C07E95 for ; Fri, 16 Jul 2021 04:30:54 +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 1E600613EB for ; Fri, 16 Jul 2021 04:30:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1E600613EB 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 65DD681664; Fri, 16 Jul 2021 06:30:50 +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="Fq7/IcdZ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id BE52881668; Fri, 16 Jul 2021 06:30:47 +0200 (CEST) Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) (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 2C42480C8A for ; Fri, 16 Jul 2021 06:30:44 +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-x436.google.com with SMTP id l7so10478785wrv.7 for ; Thu, 15 Jul 2021 21:30:44 -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=jvBhafb0yZNPlkYGfYrrYhmPEdMQKpbk/756ttTMnLQ=; b=Fq7/IcdZ9w/ms9A0r7FxC+hVf2ft3/+2+Nyu2Vg3W41P3ayXFE6IUgjbpR1aaHSfA5 yGSLHv8rTiW4jMXra03vt2OG9s1vmS9+rdlKSTcFaUkLItsHEuh2WnbEG+jjSLEiHsop P1voChuu2w61d3XamROA5rH7xsartIWayFldk= 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=jvBhafb0yZNPlkYGfYrrYhmPEdMQKpbk/756ttTMnLQ=; b=TNeZVOfnZ6Ql9HiTlvYHELEI5bFrGMBv48V83dSCpf4xFaSRfgNwVXzUPXNySiZM0j SepRWGJRvz9BOH+gM9wZpTXzWlnwLeSj0ffw/YT2Ixk5obeKXxCzyBjoc0zEjEwJp5ua AhuRE9wetyUGtGALoz6eXelMB55Bzbr/437+tZdBfQwYJGaoMr38PfNSvbcpwl+5KKSq 90dzaSCLNzNsTwMdMPw3//eHIsp5aeoR8brAeF8+o+B609F5/7KyNCpNNvSUX/xyazmd UXtWzo9m6I493ovLvgThmGU6hIaqGFeSNUwW1gF1FtscQ9dwQn3Iotg4hw4diLT47HeW vBig== X-Gm-Message-State: AOAM531nvnUb/oFqrikuYFLrGhuu4Qhp9eCXAdZ1ls6J9DiBn1YQx4M4 tDPDouUgDnZ4SVOrjU9ZnRuFnAztIPZ7Z3Q7Ef3z24ap/xMreaJd X-Google-Smtp-Source: ABdhPJy3U2VAagFkOnoJ4ul90bCI2bnCh+oEBx4KloMzNkCsVMaYoQRVsyUp7QCkvLIcOv9Ie2S7n2FtvZX/q+7No8c= X-Received: by 2002:adf:ce83:: with SMTP id r3mr9777881wrn.204.1626409843261; Thu, 15 Jul 2021 21:30:43 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Simon Glass Date: Thu, 15 Jul 2021 22:30:31 -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 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? > > My patch in case I'm missing something obvious is: > diff --git a/arch/arm/dts/imx8mm-venice-u-boot.dtsi > b/arch/arm/dts/imx8mm-venice-u-boot.dtsi > index 42b2903f04..f738ea770e 100644 > --- a/arch/arm/dts/imx8mm-venice-u-boot.dtsi > +++ b/arch/arm/dts/imx8mm-venice-u-boot.dtsi > @@ -6,6 +6,10 @@ > #include "imx8mm-u-boot.dtsi" > > / { > + binman: binman { > + multiple-images; > + }; > + > wdt-reboot { > compatible = "wdt-reboot"; > wdt = <&wdog1>; > @@ -68,3 +72,101 @@ > &wdog1 { > u-boot,dm-spl; > }; > + > +&binman { > + 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_1: blob-ext@1 { > + filename = "lpddr4_pmu_train_1d_imem.bin"; > + size = <0x8000>; > + }; > + > + blob_2: blob-ext@2 { > + filename = "lpddr4_pmu_train_1d_dmem.bin"; > + size = <0x4000>; > + }; > + > + blob_3: blob-ext@3 { > + filename = "lpddr4_pmu_train_2d_imem.bin"; > + size = <0x8000>; > + }; > + > + blob_4: blob-ext@4 { > + filename = "lpddr4_pmu_train_2d_dmem.bin"; > + size = <0x4000>; > + }; > + }; > + > + flash { > + mkimage { > + args = "-n spl/u-boot-spl.cfgout -T imx8mimage > -e 0x7e1000"; > + > + blob { > + filename = "u-boot-spl-ddr.bin"; > + }; > + }; > + }; > + > + itb { > + filename = "u-boot.itb"; > + > + fit { > + description = "Configuration to load ATF before U-Boot"; > + #address-cells = <1>; > + fit,external-offset = ; > + fit,fdt-list = "of-list"; > + > + images { > + uboot { > + description = "U-Boot (64-bit)"; > + type = "standalone"; > + arch = "arm64"; > + compression = "none"; > + load = ; > + > + uboot_blob: blob-ext { > + filename = "u-boot-nodtb.bin"; > + }; > + }; > + > + atf { > + description = "ARM Trusted Firmware"; > + type = "firmware"; > + arch = "arm64"; > + compression = "none"; > + load = <0x920000>; > + entry = <0x920000>; > + > + atf_blob: blob-ext { > + filename = "bl31.bin"; > + }; > + }; > + > + @fdt-SEQ { > + description = "NAME"; > + type = "flat_dt"; > + compression = "none"; > + }; > + }; > + > + configurations { > + default = "@config-DEFAULT-SEQ"; > + > + @config-SEQ { > + description = "NAME"; > + firmware = "uboot"; > + loadables = "atf"; > + fdt = "fdt-SEQ"; > + }; > + }; > + }; > + }; > +}; > diff --git a/arch/arm/mach-imx/imx8m/Kconfig b/arch/arm/mach-imx/imx8m/Kconfig > index 78b6108ff5..71af1bd799 100644 > --- a/arch/arm/mach-imx/imx8m/Kconfig > +++ b/arch/arm/mach-imx/imx8m/Kconfig > @@ -71,6 +71,7 @@ config TARGET_IMX8MM_ICORE_MX8MM > > config TARGET_IMX8MM_VENICE > bool "Support Gateworks Venice iMX8M Mini module" > + select BINMAN > select IMX8MM > select SUPPORT_SPL > select IMX8M_LPDDR4 > diff --git a/board/gateworks/venice/README b/board/gateworks/venice/README > index 6a0ab1ef10..95e35c4734 100644 > --- a/board/gateworks/venice/README > +++ b/board/gateworks/venice/README > @@ -25,10 +25,18 @@ $ cp firmware-imx-8.9/firmware/ddr/synopsys/lpddr4*.bin . > Build U-Boot > ============ > $ make imx8mm_venice_defconfig > -$ make flash.bin CROSS_COMPILE=aarch64-linux-gnu- ATF_LOAD_ADDR=0x920000 > +$ make CROSS_COMPILE=aarch64-linux-gnu- ATF_LOAD_ADDR=0x920000 > > Update eMMC > =========== > => tftpboot $loadaddr flash.bin > => setexpr blkcnt $filesize + 0x1ff && setexpr blkcnt $blkcnt / 0x200 > => mmc dev 2 && mmc write $loadaddr 0x42 $blkcnt > +=> tftpboot $loadaddr u-boot.itb > +=> setexpr blkcnt $filesize + 0x1ff && setexpr blkcnt $blkcnt / 0x200 > +=> mmc dev 2 && mmc write $loadaddr 0x300 $blkcnt > + > +Update uSD: > +=========== > +sudo dd if=flash.bin of=/dev/sd[x] bs=1024 seek=33 conv=notrunc > +sudo dd if=u-boot.itb of=/dev/sd[x] bs=1024 seek=384 conv=sync > diff --git a/board/gateworks/venice/imximage-8mm-lpddr4.cfg > b/board/gateworks/venice/imximage-8mm-lpddr4.cfg > new file mode 100644 > index 0000000000..df3edb17ab > --- /dev/null > +++ b/board/gateworks/venice/imximage-8mm-lpddr4.cfg > @@ -0,0 +1,9 @@ > +/* SPDX-License-Identifier: GPL-2.0+ */ > +/* > + * Copyright 2021 Gateworks Corporation > + */ > + > +#define __ASSEMBLY__ > + > +BOOT_FROM sd > +LOADER mkimage.flash.mkimage 0x7E1000 > diff --git a/configs/imx8mm_venice_defconfig b/configs/imx8mm_venice_defconfig > index 883be27cd7..c6c790734a 100644 > --- a/configs/imx8mm_venice_defconfig > +++ b/configs/imx8mm_venice_defconfig > @@ -26,9 +26,9 @@ CONFIG_DISTRO_DEFAULTS=y > CONFIG_FIT=y > CONFIG_FIT_EXTERNAL_OFFSET=0x3000 > CONFIG_SPL_LOAD_FIT=y > -CONFIG_SPL_FIT_GENERATOR="arch/arm/mach-imx/mkimage_fit_atf.sh" > +# CONFIG_USE_SPL_FIT_GENERATOR is not set > CONFIG_OF_SYSTEM_SETUP=y > -CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/mach-imx/imx8m/imximage-8mm-lpddr4.cfg" > +CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/gateworks/venice/imximage-8mm-lpddr4.cfg" > # CONFIG_USE_BOOTCOMMAND is not set > CONFIG_USE_PREBOOT=y > CONFIG_PREBOOT="gsc wd-disable" > @@ -62,7 +62,7 @@ CONFIG_CMD_EXT4_WRITE=y > # CONFIG_SPL_EFI_PARTITION is not set > CONFIG_OF_CONTROL=y > CONFIG_SPL_OF_CONTROL=y > -CONFIG_OF_LIST="imx8mm-venice-gw71xx-0x imx8mm-venice-gw72xx-0x > imx8mm-venice-gw73xx-0x imx8mm-venice-gw7901 imx8mm-venice-gw7902" > +CONFIG_OF_LIST="imx8mm-venice imx8mm-venice-gw71xx-0x > imx8mm-venice-gw72xx-0x imx8mm-venice-gw73xx-0x imx8mm-venice-gw7901 > imx8mm-venice-gw7902" > CONFIG_ENV_IS_IN_MMC=y > CONFIG_SYS_REDUNDAND_ENVIRONMENT=y > CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y > > 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. Regards, Simon