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 DE300C433EF for ; Thu, 3 Mar 2022 21:14:44 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4C274838C7; Thu, 3 Mar 2022 22:14:42 +0100 (CET) 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="TquUCYeR"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9C8B683A34; Thu, 3 Mar 2022 22:14:39 +0100 (CET) Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com [IPv6:2a00:1450:4864:20::534]) (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 0D222838B9 for ; Thu, 3 Mar 2022 22:14:36 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=alpernebiyasak@gmail.com Received: by mail-ed1-x534.google.com with SMTP id p4so8305210edi.1 for ; Thu, 03 Mar 2022 13:14:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:from:subject:to:cc :references:content-language:in-reply-to:content-transfer-encoding; bh=Qm+a8oB1fNG4SMWSvj6H7/XRQ7ATa9HVVUZGPpDdH/A=; b=TquUCYeRSeQ5ALj+aWtm5fi5O9T6SOMQ/ROQvt2N62yd58gnCuDHJ1T9+4NUk9bNEr CkGRZIcJaCZRaRGQqXxEBdZ56Zbw+q93kZ45dvkmOM3OLonkcyajZ1owhjGDAI9afHEU FQm2ejHrcbIpTUTFKzOFLAzHjRQPvzoa3lD7nCxvPDNbN3H6hmm/eHf0ZZGSh26KP7UQ iaq2Nr4oYksQcMoI+v0r/f05MiYGRY81FbVQJ8hhMX2hhcIbgtUi12uCR3E9PV6oBE4n Bz3FL4BZFVnmo5YCL6hCrUgqYOLuiKTJw7uJn1S+ZvTe6Olqf2Zni2d8ExP6Yz9o4GHl aCvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:from :subject:to:cc:references:content-language:in-reply-to :content-transfer-encoding; bh=Qm+a8oB1fNG4SMWSvj6H7/XRQ7ATa9HVVUZGPpDdH/A=; b=plWIHiztyVDy1bPwWwfhr4pv2it5vMlLky+ThGYjYBJ1E0MLed9rxhLmcqIXdI0G00 xVBEQwCSaAVHbR3EDKCmDmAiS7+9wC5RrYS/6uezz317hFSqg7byHzLSo/eZtMYqCy7x Z1cZebMKfKRuIRcl9HszRWi/DHB4LGyf9eYwsTeoN6M/mjC9VX2667XUkJl4brqAvb23 AJdRE3wD36MCsTbTWdlpERCVQj3ATD6QqtHfKlecFwirh7h7sq0fEk/QQ060hpR8guBm tfDOgOlYwihnGwR+aBDGVNIuFFx99uFmddfXDAwLSW/dG+ATMDR8hziBJ0ftIg4ylJzl DLDQ== X-Gm-Message-State: AOAM531WSoiqkFKxMPZ2cxaciNijKZMFex8m/qgkk0RPGfBy1ofgLHOp p+fmxg8OWADOc0ctj9ovjXg= X-Google-Smtp-Source: ABdhPJxyifywc9AJXxM0jJVdGeOMps5lWJYv8cSOwKeu7T2ax+LmpjdTO+O/Ws5gl/Lv3NeiwrBtFw== X-Received: by 2002:a50:d4d2:0:b0:410:9fa2:60d6 with SMTP id e18-20020a50d4d2000000b004109fa260d6mr36284260edj.35.1646342075523; Thu, 03 Mar 2022 13:14:35 -0800 (PST) Received: from [192.168.0.74] ([178.233.26.119]) by smtp.gmail.com with ESMTPSA id f7-20020a17090631c700b006b293ddbca1sm1077772ejf.35.2022.03.03.13.14.31 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 03 Mar 2022 13:14:34 -0800 (PST) Message-ID: <783f2104-eee1-a853-3c02-53a7fb6f92b1@gmail.com> Date: Fri, 4 Mar 2022 00:06:56 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 From: Alper Nebi Yasak Subject: Re: [PATCH 03/24] spl: x86: Correct the binman symbols for SPL To: Simon Glass Cc: U-Boot Mailing List , huang lin , Jeffy Chen , Kever Yang , Tom Rini , Philippe Reynes , Ivan Mikhaylov , Alexandru Gagniuc , Bin Meng , Heiko Schocher , Heiko Thiery , Heinrich Schuchardt , =?UTF-8?Q?Marek_Beh=c3=ban?= , Marek Vasut , =?UTF-8?Q?Pali_Roh=c3=a1r?= , Ricardo Salveti , Stefan Roese References: <20220208185008.35843-1-sjg@chromium.org> <20220208185008.35843-2-sjg@chromium.org> <4f285518-51a9-e1f1-ef77-c014dc81679a@gmail.com> Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8 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.5 at phobos.denx.de X-Virus-Status: Clean On 24/02/2022 01:58, Simon Glass wrote: > Hi Alper, > > On Tue, 15 Feb 2022 at 04:52, Alper Nebi Yasak wrote: >> >> On 08/02/2022 21:49, Simon Glass wrote: >>> These symbols are incorrect, meaning that binman cannot find the >>> associated entry. This leads to errors like: >>> >>> binman: Section '/binman/simple-bin': Symbol '_binman_spl_prop_size' >>> in entry '/binman/simple-bin/u-boot-spl/u-boot-spl-nodtb': >>> Entry 'spl' not found in list (mkimage,u-boot-spl-nodtb, >>> u-boot-spl-bss-pad,u-boot-spl-dtb,u-boot-spl,u-boot-img,main-section) >> >> I can't help but feel like this is a bug with entry expansion where the >> name of the expanded node is ignored (and replaced by its type?) when it >> comes to the symbols. I think I misunderstood that error message. I thought this error was for a board with the x86 dtsi where it wasn't finding an "spl" entry that actually existed. Not seeing "spl" in the list I assumed its name was being lost for some reason. Now I realize it must be for a board where "u-boot-spl" exists instead of "spl" (which the symbol was looking for), and you were correcting the symbol to match that and furthermore fixing the x86 dtsi to match the corrected symbol. (Perhaps it was a Rockchip board, related to the rest of the series :P ) > > The problem is that there is only really one value for a symbol. E.g. > U-Boot has an image-pos and it doesn't matter what you call it; it is > the same value. > > So does it make sense to disallow different names for the same thing? > See testSymbol() which actually creates two SPLs and checks that both > are updated. That is the opposite to what you are talking about, of > course, since it is the properties of the 'u-boot' entry which are > used to write into the SPL entries. > > If we move to using the name instead, we could have two different > copies of U-Boot in the image and each SPL could refer to a different > one. At present this is done by puting the pairs into their own > section. > > I think this needs more discussion....what do you think? I think it's better to use the names, since there are reasonable cases where an image would have multiple entries of the same type: A/B updates and read-only recovery copies (like in Chrome OS firmware, or I guess eventually with your VPL series?). >From what I can tell, the symbols are indeed set based on the entry names (not entry types), so multiple entries of the same type but with different names should already be working fine -- except no symbols are declared on the C side for arbitrary names. I guess putting multiple copies in different sections with different "name-prefix" values works fine the same way. However I lightly suspect this might be breaking down a bit with entry expansion, since the nodes generated in differently-named sections could have the same name (the desired entry type), but didn't test it or anything. I guess it works since the symbol would be declared for the node-to-expand anyway, with the correctly unique name? (Maybe the symbols might be based on the path instead, but that could be very verbose. I see an idea in binman.rst for a C library that can read binman things from device tree, which sounds nice for this as well.)