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 D7A97C433F5 for ; Thu, 3 Mar 2022 21:15:20 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id ECEE783CAF; Thu, 3 Mar 2022 22:15:12 +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="owVBcyhb"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C621A83A08; Thu, 3 Mar 2022 22:15:08 +0100 (CET) Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) (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 49C2983A34 for ; Thu, 3 Mar 2022 22:14:52 +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-ej1-x631.google.com with SMTP id kt27so13471696ejb.0 for ; Thu, 03 Mar 2022 13:14:52 -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=muYgydCT7ZrD2GfgzRrxeh+RN5abMYzDTl9foBRhchg=; b=owVBcyhbn4m4c4vXVeqz5FvOCaiY+q9BNX5OHCbuTRtduh+3WbbCETEnPexysDiYC3 kryE3uk1V43/jPfSX9DFB368T2hI+Ll/79C3Y3F9ZkBuooKx8Ms1Omky7cz1n8+s4xEu CVz1WufBy9Zql1PCXFAt1PDiHsaJjWnKWkM2p4Pxrz91EqQcMPKXBG8pRZkSGCZbn/p9 1VXkvyE9W2eDwpsLmAgfssCR0DBBKXr9pOsctidQAn+FHsl3aQ031i5nj0jVrxPZd2O8 c+47lNUyuuQnIgEUYVbigrTwxL0stfdQMZ2F3pWn1NG7xLe1oWQY21RD5M1aDmGJ8Pkb Wv2w== 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=muYgydCT7ZrD2GfgzRrxeh+RN5abMYzDTl9foBRhchg=; b=0xR0kDCPxf+NAfGv7ucOH3RK4YHKYwXnVebNrxbLmoRpiCN4SQpEzOFd05IPCLQP26 aRov3ivl6S/06M/2PD0rj5FCUFaNoGnHDhcb/pTzrXPhwJMKubiHQ14YcrK4K9ox77EV MePN8a28IfnD7gOPsx0nzAwwuZazgxBJqDpN2l8ELM3513Dh+n0zgxeeYDU5BqQghSvJ 3EHLNHwyqD0Esn0fzVxaZ4kVWPn4LiToo4fNaY/fCchcbE6e36zkdzjYpyFz/4CWbdgj +hmesGUsFZvV+TdnOAmKTUf7dRSYM3hW7cdpMGr9hnoUtUhxAe2A0DVeFVavoljP53uV IAOA== X-Gm-Message-State: AOAM5310XHRo9emoI4pSJyjViMk/buW+L1dqjyQm1W/A6s08muV+pxRE kMzvSzn+lny5wZXSqXqGl9s= X-Google-Smtp-Source: ABdhPJwqhQ9EgvZMo3/0QPVVvOUTY/z5Jm2Cxt0AIxE2hwGhwKixDaCGyVYk6BU3EzBpav8hiHHcAg== X-Received: by 2002:a17:906:360a:b0:6a6:a997:8297 with SMTP id q10-20020a170906360a00b006a6a9978297mr27952503ejb.180.1646342091231; Thu, 03 Mar 2022 13:14:51 -0800 (PST) Received: from [192.168.0.74] ([178.233.26.119]) by smtp.gmail.com with ESMTPSA id 17-20020a170906059100b006cee1bceddasm1088618ejn.130.2022.03.03.13.14.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 03 Mar 2022 13:14:50 -0800 (PST) Message-ID: <4829ce0f-89ef-59c6-864a-2af5f0140183@gmail.com> Date: Fri, 4 Mar 2022 00:07:30 +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 20/24] binman: Support splitting an ELF file into multiple nodes To: Simon Glass Cc: U-Boot Mailing List , huang lin , Jeffy Chen , Kever Yang , Tom Rini , Philippe Reynes , Ivan Mikhaylov , Jan Kiszka References: <20220208185008.35843-1-sjg@chromium.org> <20220208185008.35843-16-sjg@chromium.org> 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:59, Simon Glass wrote: > On Tue, 15 Feb 2022 at 04:53, Alper Nebi Yasak wrote: >> On 08/02/2022 21:50, Simon Glass wrote: >>> + fit,load >>> + Generates a `load = <...>` property with the load address of the >>> + segmnet >>> + >>> + fit,entry >>> + Generates a `entry = <...>` property with the entry address of the >>> + ELF. This is only produced for the first entry >>> + >>> + fit,data >>> + Generates a `data = <...>` property with the contents of the segment >> >> I think all these should be done by default. I don't see the point of >> not setting the properties, or setting them manually to values that will >> be the same for multiple nodes. > > My intent is to make things discoverable and obvious, so that magic > processing is explicit. OK then. >> Instead of putting these into the images subnode, we could have >> images-level subnodes for the operations. For example, instead of the above: >> >> images@gen-fdt-nodes { >> fdt-list = "of-list"; >> >> fdt { >> type = "flat_dt"; >> compression = "none"; >> }; >> }; > > What does that mean, though? I presume it creates a second images {} > node, which is fine as dtc will merge them. But what about ordering? I imagined images@oper, configurations@oper would be binman-only control nodes that generate and append arbitrary nodes/entries inside whatever node name precedes the @oper. The meaning of what's inside the @oper nodes and what's generated would be solely defined by the operation. Honestly, I didn't think of ordering because I assumed it didn't matter inside FIT. It's a shortcoming of this design if it's important. > I certainly prefer this in terms of elegance. I'm just not convinced > that people will understand it as well. > >> >> We can remove the -SEQ if we always append a sequence number, and we can >> set "description" to "NAME.dtb" when it's missing, or do the replacement >> when it's given. We can go further and use "%s", "%(name)s" or "{name}" >> instead of "NAME" for python-ish formatting and likewise for the >> sequence number. > > Yes, but again this adds more magic. For the Python formatting, we > still need to restrict what is put in there - e.g. we cannot just eval > an arbitrary varaible. Python only formats with what you give it (except for f-strings): >>> val = "test" >>> vals = {"name": "rk3399-gru-kevin", "seq": 1} >>> "conf-%(seq)d: %(name)s.dtb" % vals 'conf-1: rk3399-gru-kevin.dtb' >>> "%(val)s" % vals KeyError: 'val' >>> "conf-{seq}: {name}.dtb".format(**vals) 'conf-1: rk3399-gru-kevin.dtb' >>> "{val}".format(**vals) KeyError: 'val' But neither format style can go in a node name, so if you want the sequence number explicit in those I guess we're stuck with -SEQ and everything consistent with it. >>> [...] > > We should talk about this some more though. I'm a bit worried it will > get complaints about too much magic. I am trying to make it obvious > that nodes get generated in certain places. OK. I know I'm too biased towards magic, so won't insist much on those parts. > [...] > > Thanks for all the comments and ideas. I think this all need a little > more thought... I'll try replying to the v2 for the things changed in v2.