From patchwork Thu Nov 20 02:55:35 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 52 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1763607395; bh=QvSFvjSRjRqOGmRKxPlAWrzE7yuy5Yd8Y5O3jB6m+fM=; h=From:To:Date:CC:Subject:List-Id:List-Archive:List-Help:List-Owner: List-Post:List-Subscribe:List-Unsubscribe:From; b=OoTOgOpex4PcQrGVQIbq6Q/nHeW/BXhr31Ia9LcxFJmnRPfGsTlMylVt8KeQrUvBt tj2u5U6egSAUPfyQ73JMSs36n+Bli9BiLAIiTLYd9WyaDNAjAZHUh/CpzvDacv+vXA ZRxg+uSfptTtA3RsHPJ84wyi6IztM+xR0dPZa4f0FGkc6uKNSdMLT3TDyWu/NaukEq XmaMujKF+PNoysS1muYl73BV6OAKAIbRUGZJ57T94/l7UB66utaG7XLTVVeL4M3Bsx FZUkE/Elxgipaom3OfHAcfJvgiQQelbe2k7aj6gL+RepCI48pwyebdHMIug1NKdXdJ PXjjLZJtde/gg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 47F28686C4 for ; Wed, 19 Nov 2025 19:56:35 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 89XOWYydtlpM for ; Wed, 19 Nov 2025 19:56:35 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1763607395; bh=QvSFvjSRjRqOGmRKxPlAWrzE7yuy5Yd8Y5O3jB6m+fM=; h=From:To:Date:CC:Subject:List-Id:List-Archive:List-Help:List-Owner: List-Post:List-Subscribe:List-Unsubscribe:From; b=OoTOgOpex4PcQrGVQIbq6Q/nHeW/BXhr31Ia9LcxFJmnRPfGsTlMylVt8KeQrUvBt tj2u5U6egSAUPfyQ73JMSs36n+Bli9BiLAIiTLYd9WyaDNAjAZHUh/CpzvDacv+vXA ZRxg+uSfptTtA3RsHPJ84wyi6IztM+xR0dPZa4f0FGkc6uKNSdMLT3TDyWu/NaukEq XmaMujKF+PNoysS1muYl73BV6OAKAIbRUGZJ57T94/l7UB66utaG7XLTVVeL4M3Bsx FZUkE/Elxgipaom3OfHAcfJvgiQQelbe2k7aj6gL+RepCI48pwyebdHMIug1NKdXdJ PXjjLZJtde/gg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 2FDB068656 for ; Wed, 19 Nov 2025 19:56:35 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1763607391; bh=Vx18Z7jusLaE+ZKR7lPkt6FeXxgnJTTfDbZm2LYjdNo=; h=From:To:Cc:Subject:Date:From; b=ivvALZOvmv3OwmNM7/O5edeikBU9zpkl/m8zDYUb2Vf15BpYSD3mNR92uEJV9kmrz uu2VFLOgvI+h8nuUzd8aoWQRgwNioUcuSR3HcWwdYmr+uCxDDj2vKz7p1uRqvQIVNw N9p0cscvIb1TkifbsB36y04GdsP40yhiIp+g7ah3D5GwbyZVcVTRvusqESjaqRQ7dT jnWVEs3KkkXR4nNseB+N69Gc2mFmFmJn9Xm1NhMb60lE/mIOAvYce9QvIcbKKVvTnF Bbv1Qph2ngsQBgG73kivVnsQCFEqt1u6+wWNIA4J276vSMquFP8B63sxhF8wcZbT/K 38PVL/yiy8QRw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 4F05068631; Wed, 19 Nov 2025 19:56:31 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id dafqy_aqTQgh; Wed, 19 Nov 2025 19:56:31 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1763607387; bh=H0zE8r0qVAwwmjjLIodCA7TPx+yCJ0qq05FHq87xq7k=; h=From:To:Cc:Subject:Date:From; b=TMe5ZtZEXak1z90u6hgteygVkxmctR6Ce68bBlktWwas+Eq2tPVIzjjX7YliM1uc9 eXm5k9aKgRMw0jgbYeYR9FfgDBD8d7HAcLYSFOpKhTn/XuvIjeNJFdswN+VA4K9YIH VP850Wln9CY+RB4+eyfFS5wIQUKkqJTn8S7fDbXTJAVwZGvrt+5TfnC4CnU8+SX75X d2ggO2ev3RvxNItlqoX3I/cG0U/lTi8qfloRPlPBNLOeUy7VuB888meRFw14I08kHI 5CkWgJfzqawkEEf35L1evhMlXYm7kBEoGhkcBagva+no/l5dAYxtYqG73NgfjHWfyn MwxWNwt2Idc+Q== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id B12615E7DA; Wed, 19 Nov 2025 19:56:26 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 19 Nov 2025 19:55:35 -0700 Message-ID: <20251120025614.2215587-1-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Message-ID-Hash: 7KUBCG4SA5KOWALYNZBXRJFALSQ52OXV X-Message-ID-Hash: 7KUBCG4SA5KOWALYNZBXRJFALSQ52OXV X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 00/30] fit: Improve and test the code to print FIT info List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass The code for printing information about FITs is fairly old and not that easy to maintain. It also lacks tests. This series adds some tests, moves the code into its own file and then adds a series of helpers to deal with the intricacies of printing each item. This provides a binary-size reduction of about 320 bytes on aarch64. Simon Glass (30): docs: Merge .claude/README.md into CLAUDE.md tools: Fix debug() to avoid unused-variable warnings test: Increase expect_str/actual_str buffer size fit: Remove unused len parameter from fit_get_name() test: Add a test for FIT image printing test: Add signature-testing to the FIT-printing test test: fit: Test printing a FIT with multiple FDTs test: fit: Test the remaining features and edge cases test: fit: Add test for missing FIT description test: fit: Add pytest for mkimage output fit: Refactor fit_print_contents() to use new fit_print() fit: Move printing code to its own file fit: Drop showing an unused 'required' property fit: Add a context struct for FIT-printing fit: Put the indent string into print context fit: Create some helpers for printing fit: Use emit_label() helper in fit_image_print() fit: Use emit_label() helper in fit_conf_print() fit: Add a a function to print labels with values fit: Change indent from string to int fit: Move values one column to the right fit: Use emit_label_val() where possible fit: Add a helper to output optional properties fit: Add a helper for timestamp printing fit: Add a helper for stringlist properties fit: Add a helper for printing descriptions fit: Add a helper for address printing fit: Use a boolean to simplify type checks fit: Add a helper to iterate through hash/signature nodes fit: Use the libfdt subnode iterator .claude/README.md => CLAUDE.md | 3 + boot/Makefile | 1 + boot/fit_print.c | 494 ++++++++++++++++++++++++++++++++ boot/image-cipher.c | 2 +- boot/image-fit-sig.c | 24 +- boot/image-fit.c | 442 +--------------------------- common/spl/spl_fit.c | 12 +- common/update.c | 4 +- drivers/fpga/socfpga_arria10.c | 2 +- include/image.h | 84 +++++- include/test/test.h | 4 +- test/boot/Makefile | 1 + test/boot/fit_print.c | 192 +++++++++++++ test/py/tests/test_fit_print.py | 431 ++++++++++++++++++++++++++++ tools/Makefile | 1 + tools/fit_image.c | 15 +- tools/fit_info.c | 2 +- tools/image-host.c | 30 +- tools/mkimage.h | 8 +- 19 files changed, 1272 insertions(+), 480 deletions(-) rename .claude/README.md => CLAUDE.md (93%) create mode 100644 boot/fit_print.c create mode 100644 test/boot/fit_print.c create mode 100644 test/py/tests/test_fit_print.py