From patchwork Sun Nov 19 15:01:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 16764 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9910:0:b0:403:3b70:6f57 with SMTP id i16csp1690213vqn; Sun, 19 Nov 2023 07:03:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IH/jPGnTUwaNSk3mA3lSTgOpo7Q8xmsLjF0Bb6LOKnXYGbw9kPse0QZxOYMDvL2SV6v0k3T X-Received: by 2002:a17:903:2382:b0:1ce:89a7:4403 with SMTP id v2-20020a170903238200b001ce89a74403mr4942237plh.58.1700406194134; Sun, 19 Nov 2023 07:03:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700406194; cv=none; d=google.com; s=arc-20160816; b=PInbT5G/AOgXPQTfum1mYzuX45ZYBvjyBmgNNyfKGzSaHbytHsOzH3oHUbeIwaGNVQ YpXhs9Mm5jGAxgymf+KWov0dp+5QUqNF5SS/PHTghJk2AUq6mz1JoVdGCimr2OFE0eme gnyJqK8f51sA2VNkXoZMrJwnJMeh8bA1wveCvg2RUKLSQywstUNDyR2GBc1yNqzUvu8n TeOTnc6NiK4rCaGunZmyabFRwDaMgZRshhYjKtFQYXjN9XmdT9FRxMa4xtudZAjYyIUn AecyRmAr26voDOCii7aZVQ1SmCbC7Jm20K8kPIGvhvuv4n0eb7cf9pOJtuuYGbUJeg6O LvLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=N51tl/zj6hx3y8C/i7pvWONxuVI4d2CkVjaNAa9KVfw=; fh=YQikNudVzmYXrMB39s06Lqfy92WQR80MxG1JQiZOKl8=; b=PrlEhMZMmk38j8uLMKzrvk/hobOOxJT+vZdk1sJoQ1/wokszEGd5yZmbKuM/6fANHU TU2hm1IPFenF08cKTx7FLHUrZhQqJhzzfDuiEuxomW7KE6xO3wgw95Na2MeKVabV+NyZ KmfIwPSwk7nt2qmXK8KOnlh9ZDOAx0m4XS1Xn8inZ8fJe3TyIaKuIih0rldU8k4O330V nDnNbyAhuH+wKNimvVXGzYZdqr7Zy8vTJf/wkLtCW2C9RopFEtZsSvv4axwkmrIMi5ip 4kBihNqg/RCVq8tJ1Cr8+kaoUybU+OkBnwGz0FLg16ljMOdOVROEOnLjsHVknkXibiFH LJ0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=KEzJhvN0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id n13-20020a170902d2cd00b001c9b2c2644bsi6560436plc.451.2023.11.19.07.02.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Nov 2023 07:03:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=KEzJhvN0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 548C38094D4D; Sun, 19 Nov 2023 07:02:42 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230027AbjKSPCi (ORCPT + 99 others); Sun, 19 Nov 2023 10:02:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36758 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229441AbjKSPCh (ORCPT ); Sun, 19 Nov 2023 10:02:37 -0500 Received: from mail-io1-xd35.google.com (mail-io1-xd35.google.com [IPv6:2607:f8b0:4864:20::d35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 03635E1 for ; Sun, 19 Nov 2023 07:02:34 -0800 (PST) Received: by mail-io1-xd35.google.com with SMTP id ca18e2360f4ac-7a6889f33b9so131702239f.0 for ; Sun, 19 Nov 2023 07:02:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1700406153; x=1701010953; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=N51tl/zj6hx3y8C/i7pvWONxuVI4d2CkVjaNAa9KVfw=; b=KEzJhvN0vrEgKamwqdG9mDVInm4xSfTFPMFqyjZgwOisiumSyX8gix15ChoNUpIZJw DrtSJvpIScPxlikJbrLrSF8lipP4Tk5UXy7EwYvAZi4RDHiy8dAE90jxnZdK7HM1i9C8 ydth7g3Joi5uMnmY81yhw8cIugvWy1p2GBjp8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700406153; x=1701010953; 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=N51tl/zj6hx3y8C/i7pvWONxuVI4d2CkVjaNAa9KVfw=; b=UyBYybvpaQlZn5veJwzAum2RvYktQ5LAYjc3R2MhxjYZK34IrMAQd0NwNZF3BPvLK7 lSV5BIC+r46HiKA5xmzxX2l5a8qYs5Xvgk1MqnXlqGopsYiuYvOdVedML8e9UJljKK4O UUnznV148MfYtSk47K6X5KRTZTTVysANiImHyGviKBVqwuuv/p9VzoG7Y80MUHJs4Q4E hTEWJHYJnN+GFq1IjvPYRzUJIKdG2WjD6DabBf6LdderEaHnj0Gdt8Lrk+D1jiFT3XE6 KM1FhsUquggFzd71syb11WX1cYCz8TQ0xIotGwr8hVbqN0cWTcMSWtljXw5kL8PdP1B+ ZJnA== X-Gm-Message-State: AOJu0Yw2iTRUfn+4w35NMsyRBi7FjBZ5WA+uPqCx+OjJJSjPrQsH3CTj lBTmpbmA8IvKq5z7dCV3A4d6k8fbh3kQyqjRyQJEhQ== X-Received: by 2002:a6b:c505:0:b0:7b0:aee5:f9c2 with SMTP id v5-20020a6bc505000000b007b0aee5f9c2mr3285969iof.14.1700406153095; Sun, 19 Nov 2023 07:02:33 -0800 (PST) Received: from sjg1.lan (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id w24-20020a056638379800b004665bec29d1sm79923jal.128.2023.11.19.07.02.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Nov 2023 07:02:32 -0800 (PST) From: Simon Glass To: linux-arm-kernel@lists.infradead.org Cc: U-Boot Mailing List , Masahiro Yamada , Tom Rini , Simon Glass , Catalin Marinas , Nathan Chancellor , Nick Desaulniers , Nick Terrell , Nicolas Schier , Will Deacon , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v6 0/2] arm64: Add a build target for Flat Image Tree Date: Sun, 19 Nov 2023 08:01:13 -0700 Message-ID: <20231119150229.634424-1-sjg@chromium.org> X-Mailer: git-send-email 2.43.0.rc0.421.g78406f8d94-goog MIME-Version: 1.0 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Sun, 19 Nov 2023 07:02:42 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783005125183290799 X-GMAIL-MSGID: 1783005125183290799 Flat Image Tree (FIT) is a widely used file format for packaging a kernel and associated devicetree files[1]. It is not specific to any one bootloader, as it is supported by U-Boot, coreboot, Linuxboot, Tianocore and Barebox. This series adds support for building a FIT as part of the kernel build. This makes it easy to try out the kernel - just load the FIT onto your tftp server and it will run automatically on any supported arm64 board. The script is written in Python, since it is easy to build a FIT using the Python libfdt bindings. For now, no attempt is made to compress files in parallel, so building the 900-odd files takes a while, about 6 seconds with my testing. The series also includes a few minor clean-up patches. [1] https://github.com/open-source-firmware/flat-image-tree Changes in v6: - Drop the unwanted .gz suffix Changes in v5: - Drop patch previously applied - Correct compression rule which was broken in v4 Changes in v4: - Use single quotes for UIMAGE_NAME Changes in v3: - Drop temporary file image.itk - Drop patch 'Use double quotes for image name' - Drop double quotes in use of UIMAGE_NAME - Drop unnecessary CONFIG_EFI_ZBOOT condition for help - Avoid hard-coding "arm64" for the DT architecture Changes in v2: - Drop patch previously applied - Add .gitignore file - Move fit rule to Makefile.lib using an intermediate file - Drop dependency on CONFIG_EFI_ZBOOT - Pick up .dtb files separately from the kernel - Correct pylint too-many-args warning for write_kernel() - Include the kernel image in the file count - Add a pointer to the FIT spec and mention of its wide industry usage - Mention the kernel version in the FIT description Simon Glass (2): kbuild: arm64: Add BOOT_TARGETS variable arm64: boot: Support Flat Image Tree MAINTAINERS | 7 + arch/arm64/Makefile | 7 +- arch/arm64/boot/.gitignore | 1 + arch/arm64/boot/Makefile | 6 +- scripts/Makefile.lib | 13 ++ scripts/make_fit.py | 289 +++++++++++++++++++++++++++++++++++++ 6 files changed, 321 insertions(+), 2 deletions(-) create mode 100755 scripts/make_fit.py