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 BACF6C46467 for ; Sat, 7 Jan 2023 21:07:40 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8ED8D854E5; Sat, 7 Jan 2023 22:07:37 +0100 (CET) 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="UmiBAr3p"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1B8ED85479; Sat, 7 Jan 2023 22:07:35 +0100 (CET) Received: from mail-il1-x12d.google.com (mail-il1-x12d.google.com [IPv6:2607:f8b0:4864:20::12d]) (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 E76A585355 for ; Sat, 7 Jan 2023 22:07:29 +0100 (CET) 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@chromium.org Received: by mail-il1-x12d.google.com with SMTP id m15so2807129ilj.8 for ; Sat, 07 Jan 2023 13:07:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=D8+RMBca7MhyKVIU37rgpN52Bt1fcrnYZ3+gI21l1KU=; b=UmiBAr3pfX1Cyqb5QsiuZrlF3f5VUmd4Kg9STWxay2pdGj2EuZ1YxfYZYbThGrgTwY QPqRw0Q/XEZ33WyZPKmfNyINIgudo/KcMq7f0mliRM6tWAFgqH1YPp7ts396ewvgpy4+ eKvTQHpcU8WYjWoy1MQEmmuoiPfpIvwKJHB0w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=D8+RMBca7MhyKVIU37rgpN52Bt1fcrnYZ3+gI21l1KU=; b=JE7fOaN7KbTjmt3sS0F4vhcRjUTlbw1aKO/QheYsSht67J/AxwUPvGX1dOtCdR+bLj 8g8Xo0JXv5XExQwQPttyv71sRnDfMEkFnxNlo89sV73SH8OIAlquv9j3N6KOXHI0xJN1 rMZLCmD3LPPfIHX48CgcKl5rac6u/dOLKKBqtv0Yrz3mNCXHWUSfxyGroVljpBbV2Jah kQk3Tf298Mseo4y2mEd5+SZ1mAgc9RYGoYvH/XaTifNPHi4JCaR5/nfWhn33BHv4dUOJ p77TROe4IWlmh4QQmIzRx8HfFTodptdlez+mzbXF6L5X0knIajy9P6WjDjGrNDjup4Xc wvHA== X-Gm-Message-State: AFqh2ko9KK0YJQ64u7Ga0alX/YUSusD6P3oWEvbFM3ODUOaCOy2mRTXI f9fwiGCcnL9qSzVZo+OvCaYyAXtOfa16Pz0s X-Google-Smtp-Source: AMrXdXvBlVF2AeKrvUvaA/r4thKElMFT4dzF2QSGKoiS0eJNPOIVQAjBSnLFXaIt7fXouBTmoXV17g== X-Received: by 2002:a92:ce44:0:b0:30d:7c44:ec6 with SMTP id a4-20020a92ce44000000b0030d7c440ec6mr8382942ilr.12.1673125648310; Sat, 07 Jan 2023 13:07:28 -0800 (PST) Received: from sjg1.roam.corp.google.com (c-71-56-217-229.hsd1.co.comcast.net. [71.56.217.229]) by smtp.gmail.com with ESMTPSA id l10-20020a92d94a000000b0030c00897497sm1465825ilq.19.2023.01.07.13.07.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Jan 2023 13:07:28 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Roger Quadros , Tom Rini , Alper Nebi Yasak , Peter Geis , Jerome Forissier , huang lin , Jeffy Chen , Simon Glass , Kever Yang , Philipp Tomsich , Ivan Mikhaylov , Quentin Schulz , Philippe Reynes Subject: [PATCH v9 00/14] binman: rockchip: Migrate from rockchip SPL_FIT_GENERATOR script Date: Sat, 7 Jan 2023 14:07:07 -0700 Message-Id: <20230107210721.478062-1-sjg@chromium.org> X-Mailer: git-send-email 2.39.0.314.g84b9a713c41-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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.6 at phobos.denx.de X-Virus-Status: Clean At present rockchip 64-bit boards make use of a FIT-generator script written in Python. The script supports splitting an ELF file into several 'loadable' nodes in the FIT. Binman does not current support this feature. This series adds binman support for ELF splitting. This works by adding a new 'fit,operation' property to the FIT subnodes, allowing this new way of generating nodes. It also provides support for optional entries, by allowing them to be marked absent when the contents are obtained. Some other fixes and improvements are needed along the way. A new, common binman description is added for 64-bit boards which includes the required u-boot.itb file. The existing script is removed, so that only a few zynq boards are now using a SPL_FIT_GENERATOR script: avnet_ultrazedev_cc_v1_0_ultrazedev_som_v1_0 xilinx_zynqmp_virt Migration of those is hopefully in progress. Note however that tools/k3_fit_atf.sh remains, used by a few boards that enable CONFIG_TI_SECURE_DEVICE so this series is copied there too: am335x_hs_evm am335x_hs_evm_uart am43xx_hs_evm am57xx_hs_evm am57xx_hs_evm_usb am65x_hs_evm_a53 am65x_hs_evm_r5 dra7xx_hs_evm dra7xx_hs_evm_usb j721e_hs_evm_a72 j721e_hs_evm_r5 k2e_hs_evm k2g_hs_evm k2hk_hs_evm k2l_hs_evm Ivan Mikhaylov has sent a patch to help with these, but I need to take a look at the testing side. In any case they should really be using binman for the image generation. This series is available at u-boot-dm/fit-working Changes in v9: - Add new patch to use a reference for binman symbols docs - Drop unnecessary import and fully qualified symbol - Update msc_sm2s_imx8mp also Changes in v8: - Fix 'anb', 'provide' and 'second' typos - Don't silence the return code from tee_os.ObtainContents() - Rename is_optee_bin() - Improve various comments - Move support for optional external blobs into this series - Support optional FIT images - Make OP-TEE image optional - Specify an entry address for U-Boot Changes in v7: - Correct an rST formatting error - Correct missing test coverage Changes in v6: - Add new patch to update entry docs - Update op-tee to support new v1 binary header - Add new patch to disable USE_SPL_FIT_GENERATOR by default - Add new patch to allow a binman entry to be marked absent Changes in v5: - Update commit message to mention using parts of one image in another - Rename from 'Include binman script in 64-bit boards' - Drop duplicate #include in rk3368-u-boot.dtsi - Keep the name as fit for puma - Drop redundant check for CONFIG_ROCKCHIP_SPI_IMAGE - Drop imply of BINMAN in Kconfig (rely on ARCH_ROCKCHIP instead) - Rename blob to fit for puma and also SPI image Changes in v3: - Add an offset to the FIT description - Add support for writing sections in binman - Rebase to master Changes in v2: - Rename op-tee to tee-os - Drop use of .itb2 - Drop patches previously applied - Add various suggestions from Alper Nebi Yasak - Add patches to refactor binman's FIT support Simon Glass (14): binman: Allow writing section contents to a file binman: Tidy up comment in fit _gen_node binman: Update entry docs binman: Use a reference for binman symbols docs binman: Support optional entries binman: Add a way to check for a valid ELF file binman: Support new op-tee binary format binman: Support optional external blobs rockchip: evb-rk3288: Drop raw-image support rockchip: Use multiple-images for rk3399 rockchip: Support building the all output files in binman rockchip: Convert all boards to use binman rockchip: Drop the FIT generator script treewide: Disable USE_SPL_FIT_GENERATOR by default Makefile | 11 +- arch/arm/dts/rk3399-puma-haikou-u-boot.dtsi | 4 +- arch/arm/dts/rk3399-u-boot.dtsi | 3 +- arch/arm/dts/rockchip-u-boot.dtsi | 78 ++++- arch/arm/mach-rockchip/make_fit_atf.py | 267 ------------------ boot/Kconfig | 6 +- configs/am335x_evm_defconfig | 1 - configs/am335x_hs_evm_defconfig | 1 - configs/am335x_hs_evm_uart_defconfig | 1 - configs/am43xx_evm_defconfig | 1 - configs/am43xx_evm_rtconly_defconfig | 1 - configs/am43xx_evm_usbhost_boot_defconfig | 1 - configs/am43xx_hs_evm_defconfig | 1 - configs/am57xx_evm_defconfig | 1 - configs/am57xx_hs_evm_defconfig | 1 - configs/am57xx_hs_evm_usb_defconfig | 1 - configs/am65x_evm_a53_defconfig | 1 - configs/am65x_evm_r5_defconfig | 1 - configs/am65x_hs_evm_a53_defconfig | 1 - configs/am65x_hs_evm_r5_defconfig | 1 - ...edev_cc_v1_0_ultrazedev_som_v1_0_defconfig | 1 + configs/cgtqmx8_defconfig | 1 - configs/chromebook_link64_defconfig | 1 - configs/dh_imx6_defconfig | 1 - configs/display5_defconfig | 1 - configs/display5_factory_defconfig | 1 - configs/dra7xx_evm_defconfig | 1 - configs/dra7xx_hs_evm_defconfig | 1 - configs/dra7xx_hs_evm_usb_defconfig | 1 - configs/evb-ast2600_defconfig | 1 - configs/evb-rk3229_defconfig | 1 - configs/evb-rk3288_defconfig | 2 +- configs/gwventana_emmc_defconfig | 1 - configs/gwventana_gw5904_defconfig | 1 - configs/gwventana_nand_defconfig | 1 - configs/imx6qdl_icore_mipi_defconfig | 1 - configs/imx6qdl_icore_mmc_defconfig | 1 - configs/imx6qdl_icore_rqs_defconfig | 1 - configs/imx8mm-cl-iot-gate-optee_defconfig | 1 - configs/imx8mm-cl-iot-gate_defconfig | 1 - configs/imx8mm-icore-mx8mm-ctouch2_defconfig | 1 - configs/imx8mm-icore-mx8mm-edimm2.2_defconfig | 1 - configs/imx8mm-mx8menlo_defconfig | 1 - configs/imx8mm_beacon_defconfig | 1 - configs/imx8mm_data_modul_edm_sbc_defconfig | 1 - configs/imx8mm_evk_defconfig | 1 - configs/imx8mm_evk_fspi_defconfig | 1 - configs/imx8mm_venice_defconfig | 1 - configs/imx8mn_beacon_2g_defconfig | 1 - configs/imx8mn_beacon_defconfig | 1 - configs/imx8mn_bsh_smm_s2_defconfig | 1 - configs/imx8mn_bsh_smm_s2pro_defconfig | 1 - configs/imx8mn_ddr4_evk_defconfig | 1 - configs/imx8mn_evk_defconfig | 1 - configs/imx8mn_var_som_defconfig | 1 - configs/imx8mn_venice_defconfig | 1 - configs/imx8mp-icore-mx8mp-edimm2.2_defconfig | 1 - configs/imx8mp_dhcom_pdk2_defconfig | 1 - configs/imx8mp_evk_defconfig | 1 - configs/imx8mp_rsb3720a1_4G_defconfig | 1 - configs/imx8mp_rsb3720a1_6G_defconfig | 1 - configs/imx8mp_venice_defconfig | 1 - configs/imx8mq_cm_defconfig | 1 - configs/imx8mq_evk_defconfig | 1 - configs/imx8mq_phanbell_defconfig | 1 - configs/imx8qm_rom7720_a1_4G_defconfig | 1 - configs/iot2050_defconfig | 1 - configs/j7200_evm_a72_defconfig | 1 - configs/j7200_evm_r5_defconfig | 1 - configs/j7200_hs_evm_a72_defconfig | 1 - configs/j7200_hs_evm_r5_defconfig | 1 - configs/j721e_evm_a72_defconfig | 1 - configs/j721e_evm_r5_defconfig | 1 - configs/j721e_hs_evm_a72_defconfig | 1 - configs/j721e_hs_evm_r5_defconfig | 1 - configs/j721s2_evm_a72_defconfig | 1 - configs/j721s2_evm_r5_defconfig | 1 - configs/j721s2_hs_evm_a72_defconfig | 1 - configs/j721s2_hs_evm_r5_defconfig | 1 - configs/kontron-sl-mx6ul_defconfig | 1 - configs/kontron-sl-mx8mm_defconfig | 1 - configs/kontron_pitx_imx8m_defconfig | 1 - configs/kontron_sl28_defconfig | 1 - configs/librem5_defconfig | 1 - configs/ls1046ardb_qspi_spl_defconfig | 1 - configs/mccmon6_nor_defconfig | 1 - configs/mccmon6_sd_defconfig | 1 - configs/msc_sm2s_imx8mp_defconfig | 1 - configs/mx6sabreauto_defconfig | 1 - configs/mx6sabresd_defconfig | 1 - configs/phycore-imx8mm_defconfig | 1 - configs/phycore-imx8mp_defconfig | 1 - configs/pico-imx6_defconfig | 1 - configs/pico-imx8mq_defconfig | 1 - configs/qemu-x86_64_defconfig | 1 - configs/sandbox_noinst_defconfig | 1 - configs/sandbox_spl_defconfig | 1 - configs/sandbox_vpl_defconfig | 1 - configs/socfpga_agilex_atf_defconfig | 1 - configs/socfpga_agilex_vab_defconfig | 1 - configs/socfpga_arria10_defconfig | 1 - configs/socfpga_chameleonv3_defconfig | 1 - configs/socfpga_n5x_atf_defconfig | 1 - configs/socfpga_n5x_vab_defconfig | 1 - configs/socfpga_stratix10_atf_defconfig | 1 - configs/stm32mp15_dhcom_basic_defconfig | 1 - configs/stm32mp15_dhcor_basic_defconfig | 1 - configs/verdin-imx8mm_defconfig | 1 - configs/verdin-imx8mp_defconfig | 1 - configs/wandboard_defconfig | 1 - configs/xilinx_zynq_virt_defconfig | 1 - configs/xilinx_zynqmp_virt_defconfig | 1 + tools/binman/binman.rst | 37 +++ tools/binman/control.py | 12 + tools/binman/elf.py | 15 + tools/binman/elf_test.py | 10 + tools/binman/entries.rst | 224 ++++++++++++--- tools/binman/entry.py | 47 ++- tools/binman/etype/_testing.py | 3 + tools/binman/etype/blob.py | 2 +- tools/binman/etype/fit.py | 99 ++++--- tools/binman/etype/mkimage.py | 28 +- tools/binman/etype/section.py | 42 ++- tools/binman/etype/tee_os.py | 76 ++++- tools/binman/etype/u_boot.py | 6 +- tools/binman/etype/u_boot_spl.py | 4 +- tools/binman/etype/u_boot_spl_nodtb.py | 4 +- tools/binman/etype/u_boot_tpl.py | 4 +- tools/binman/etype/u_boot_tpl_nodtb.py | 4 +- tools/binman/etype/u_boot_vpl.py | 4 +- tools/binman/etype/u_boot_vpl_nodtb.py | 6 +- tools/binman/ftest.py | 112 ++++++++ tools/binman/image.py | 3 - tools/binman/test/261_section_fname.dts | 29 ++ tools/binman/test/262_absent.dts | 20 ++ tools/binman/test/263_tee_os_opt.dts | 22 ++ tools/binman/test/264_tee_os_opt_fit.dts | 33 +++ tools/binman/test/265_tee_os_opt_fit_bad.dts | 40 +++ tools/binman/test/266_blob_ext_opt.dts | 21 ++ 139 files changed, 865 insertions(+), 518 deletions(-) delete mode 100755 arch/arm/mach-rockchip/make_fit_atf.py create mode 100644 tools/binman/test/261_section_fname.dts create mode 100644 tools/binman/test/262_absent.dts create mode 100644 tools/binman/test/263_tee_os_opt.dts create mode 100644 tools/binman/test/264_tee_os_opt_fit.dts create mode 100644 tools/binman/test/265_tee_os_opt_fit_bad.dts create mode 100644 tools/binman/test/266_blob_ext_opt.dts -- 2.39.0.314.g84b9a713c41-goog