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 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 B4E11C433FE for ; Tue, 15 Feb 2022 12:27:16 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 43491836D2; Tue, 15 Feb 2022 13:27:14 +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="GIEzeHKh"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id EB125836D2; Tue, 15 Feb 2022 13:27:12 +0100 (CET) Received: from mail-ej1-x634.google.com (mail-ej1-x634.google.com [IPv6:2a00:1450:4864:20::634]) (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 6263083689 for ; Tue, 15 Feb 2022 13:27:08 +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-x634.google.com with SMTP id jg20so18931502ejc.3 for ; Tue, 15 Feb 2022 04:27:08 -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=Cpube51Qfz3tf0SX8PnfO7G6xQ3x2zVbYTh9yBMRwHY=; b=GIEzeHKh129g2Y82RBiFq4eqkFf64Uw6N7J7W3T9JdQzGSwS4dMC841m4oWe7A4mOB QqMorsWdPpMkl+h2qA41IhQksLdGZsH5WgEeIq0JIpX+cTp3/62j3F2QEmwHr4oPrpqH E4TVleV4MHjhfQLXCDuEy/TEmu+ZRrzDhyL7ESwp72kxozAxHVpei+7/qnXvsn4bzsnE yapE7g0nue2HcpcUkZHXm9MQKMoh2BYv1p0q6C109toduc8mwt8PZUtGMoUcWpxf6aWq +HjI0AUucMAud6RdttIzsi1O8gOPseAxHRaU+P7h+lu0mvaI+fQRPbyUADTBC0tViwvl yAwA== 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=Cpube51Qfz3tf0SX8PnfO7G6xQ3x2zVbYTh9yBMRwHY=; b=5RERKEZYe1gK1jJiRhqIy0onf0nW1CTvgteUzpaRJArb+1qZsw76FSBL4Xj39vpZu9 9FMWSgjOaYswQrFxI6I861fJ0iUkeaa1zZ4/OVJ8ADn1lX4bOP87TTE9E6MwVByjRRRA sHYKecoC03k8CTEAoUKmOinCOHrzg6BfFtNHJUaKJl6CRJYifVed+dzAioW/mxqxk11x b2j+vb6HDXiD6kjMx5PcqeiAYNzOGsCxlbrNwM857otcqBXir30u9gAslude9W+65hzO eDl7Di2fviBXSlbSXVOfGOJR/DjV/EDdbAN+hkgqsvW1yILhkxWXpV7lcUs+pKpViZYj Iklg== X-Gm-Message-State: AOAM533wxgQ2MkyJnJ/y9gy1aDtwoxkJzv8DCRqZghZlEKaH3Q3JrA5K /2xUdXtV+h2L8Ma86mMvXsE= X-Google-Smtp-Source: ABdhPJyZwJru52QxapZJWdJHkmW3+sW4lTD6DR+V9veZleg1E9UTJVfLT9UGR0GwQppXVP0ybnlmZg== X-Received: by 2002:a17:906:d283:: with SMTP id ay3mr2718696ejb.249.1644928027897; Tue, 15 Feb 2022 04:27:07 -0800 (PST) Received: from [192.168.0.74] ([178.233.26.119]) by smtp.gmail.com with ESMTPSA id y16sm4552107edd.0.2022.02.15.04.27.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 15 Feb 2022 04:27:07 -0800 (PST) Message-ID: Date: Tue, 15 Feb 2022 15:27:04 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:91.0) Gecko/20100101 Thunderbird/91.6.0 From: Alper Nebi Yasak Subject: Re: [PATCH v2 4/5] binman: Convert FIT entry type to a subclass of Section entry type To: Jan Kiszka , u-boot@lists.denx.de Cc: Heiko Thiery , Simon Glass References: <20220207220809.4497-1-alpernebiyasak@gmail.com> <20220207220809.4497-5-alpernebiyasak@gmail.com> <1c7e5656-87f8-7d87-cb50-aead7b9a5ff1@siemens.com> Content-Language: en-US In-Reply-To: <1c7e5656-87f8-7d87-cb50-aead7b9a5ff1@siemens.com> 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 14/02/2022 12:09, Jan Kiszka wrote: > On 07.02.22 23:08, Alper Nebi Yasak wrote: >> The binman FIT entry type shares some code with the Section entry type. >> This shared code is bound to grow, since FIT entries are conceptually a >> variation of Section entries. >> >> Make FIT entry type a subclass of Section entry type, simplifying it a >> bit and providing us the features that Section implements. Also fix the >> subentry alignment test which now attempts to write symbols to a >> nonexistent SPL ELF test file by creating it first. >> >> Signed-off-by: Alper Nebi Yasak >> Reviewed-by: Simon Glass >> --- > > Only came to testing this now, and it causes a regression. > > Before this commit (I've added fdtmap to > arch/arm/dts/k3-am65-iot2050-boot-image.dtsi for this): > > $ source/tools/binman/binman -D ls -i flash.bin > Name Image-pos Size Entry-type Offset Uncomp-size > ---------------------------------------------------------------------------------- > main-section 0 8c0000 section 0 > blob-ext@0x000000 0 37373 blob-ext@0x000000 0 > blob@0x080000 80000 84484 blob@0x080000 80000 > fit@0x280000 280000 f445f fit@0x280000 280000 > fdtmap 37445f cf9 fdtmap 37445f > fill@0x680000 680000 20000 fill@0x680000 680000 > fill@0x6a0000 6a0000 20000 fill@0x6a0000 6a0000 > blob-ext@0x6c0000 6c0000 415de blob-ext@0x6c0000 6c0000 > blob-ext@0x740000 740000 43952 blob-ext@0x740000 740000 > blob-ext@0x7c0000 7c0000 415e2 blob-ext@0x7c0000 7c0000 > blob-ext@0x840000 840000 4395a blob-ext@0x840000 840000 > > With this commit: > > $ source/tools/binman/binman -D ls -i flash.bin > Name Image-pos Size Entry-type Offset Uncomp-size > ------------------------------------------------------------------------------------------- > main-section 0 8c0000 section 0 > blob-ext@0x000000 0 37373 blob-ext@0x000000 0 > blob@0x080000 80000 84484 blob@0x080000 80000 > fit@0x280000 fit@0x280000 280000 > u-boot section > u-boot-nodtb u-boot-nodtb > fdt-iot2050-basic section > blob blob > fdt-iot2050-basic-pg2 section > blob blob > fdt-iot2050-advanced section > blob blob > fdt-iot2050-advanced-pg2 section > blob blob > k3-rti-wdt-firmware section > blob-ext blob-ext > fdtmap 37445f cd9 fdtmap 37445f > fill@0x680000 680000 20000 fill@0x680000 680000 > fill@0x6a0000 6a0000 20000 fill@0x6a0000 6a0000 > blob-ext@0x6c0000 6c0000 415de blob-ext@0x6c0000 6c0000 > blob-ext@0x740000 740000 43952 blob-ext@0x740000 740000 > blob-ext@0x7c0000 7c0000 415e2 blob-ext@0x7c0000 7c0000 > blob-ext@0x840000 840000 4395a blob-ext@0x840000 840000 > The AddMissingProperties() and SetCalculatedProperties() methods were disabled for FIT as a fixup to this patch, that's why image-pos etc. aren't available. See comments at [1] for some context. Hopefully my two patches [2][3] fix things, can you test with them? [1] "binman: Correct the error message for a bad hash algorithm" https://patchwork.ozlabs.org/project/uboot/patch/20220208105941.1.I8f212a1150defebaf8b7b15a79f7a2fc62c276b2@changeid/ [2] "binman: Skip processing "hash" subnodes of FIT subsections" https://patchwork.ozlabs.org/project/uboot/patch/20220209190236.26479-1-alpernebiyasak@gmail.com/ [3] "binman: Update image positions of FIT subentries" https://patchwork.ozlabs.org/project/uboot/patch/20220207220809.4497-6-alpernebiyasak@gmail.com/ > The fit is nicely shown but its Image-pos column is now empty. And that > leads to: > > $ source/tools/binman/binman -D extract -i flash.bin -f extr.bin fit@0x280000 > binman: unsupported operand type(s) for +: 'int' and 'NoneType' > > Traceback (most recent call last): > File "source/tools/binman/binman", line 141, in RunBinman > ret_code = control.Binman(args) > File "/data/u-boot/tools/binman/control.py", line 639, in Binman > not args.uncompressed, args.format) > File "/data/u-boot/tools/binman/control.py", line 260, in ExtractEntries > data = entry.ReadData(decomp, alt_format) > File "/data/u-boot/tools/binman/etype/section.py", line 763, in ReadData > data = parent_data[offset:offset + self.size] > TypeError: unsupported operand type(s) for +: 'int' and 'NoneType' > > Similar breakages for "replace" and likely more sub-commands. OTOH, Entry_section docstring does say subentry offsets can be None, so it might be a good idea to fix these TypeErrors regardless. > > I have to revert this locally for now - no time to debug. > > Jan >