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 02F40EB64D7 for ; Fri, 23 Jun 2023 12:24:11 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C8F20863E2; Fri, 23 Jun 2023 14:23:38 +0200 (CEST) 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="C0SNzqhV"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C575B863DB; Fri, 23 Jun 2023 14:23:06 +0200 (CEST) Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) (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 4E8CB865BC for ; Fri, 23 Jun 2023 14:22:50 +0200 (CEST) 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-wm1-x329.google.com with SMTP id 5b1f17b1804b1-3fa23c3e618so7542365e9.0 for ; Fri, 23 Jun 2023 05:22:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1687522969; x=1690114969; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=wySah4Y7rqReF+2AIL3EF9VFlG1wyU5/xCZ6+j5op8g=; b=C0SNzqhVUrYxltvijrmjz7Le0h3z3pkPS8O8XjANUvPR4u/JH6Y/5r4chBl4SQqFWu gO+GQFY5UPenw6saq4MeniQqAcMlBhQQa2KCa/4bLTuiMCKoa1+rbzXZR6XN/2FkMWBk sXCnc7fgTCeN5H7wW0OFVh6CYTyz0RtRtt9Xw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687522969; x=1690114969; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wySah4Y7rqReF+2AIL3EF9VFlG1wyU5/xCZ6+j5op8g=; b=k0XYwRKo3ZpTtqzYSpu59se28VondWTdQ/m87HsF6wQy2xWE+mn72IivP8zcS07O0n GpZEZem9W+x9H2kdfKh35iwOncBmSm97U6s8XglgyhsG8sei2+IBWlSW9vyRSATEzjxG jAOB/vWHjGYIhh6Uf4JnWqP4Gx2RASuTeS9KnGesyJSmzpGaqqO/1PIE96302YNWcIkK V3/QlJjJJIKo/MAyGe4EqIq8wEik1F1uf2GPb723a4/qvtNk/wPGX6bCu34D0RYp0AZ0 0VWALrlcVGuQMKzQKjQvifNMz6AKRJX/g8n0u3zz4oWvtEIYvsBqPmXqL0Du5zfvDUjG NrYA== X-Gm-Message-State: AC+VfDwgN/07paPRVS/fP47Iq7xGW0TGCyFpH2/kobiwwIx353/afhjZ TcImRgT01U7bX7y6NmIKMfMi+SxP3OyREtStfByXsQ== X-Google-Smtp-Source: ACHHUZ4ypcTbkkHw/ppU4fYwIi7x0DqHEeKaesqzMMYMOlMppDNCK6qb4KYnKDcxGMgGOrGAPESM7g== X-Received: by 2002:a05:600c:ada:b0:3f9:bb9:e3be with SMTP id c26-20020a05600c0ada00b003f90bb9e3bemr13948183wmr.41.1687522969590; Fri, 23 Jun 2023 05:22:49 -0700 (PDT) Received: from sjg1.roam.corp.google.com (ip-185-104-136-50.ptr.icomera.net. [185.104.136.50]) by smtp.gmail.com with ESMTPSA id c11-20020a056000104b00b003063a92bbf5sm9499866wrx.70.2023.06.23.05.22.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Jun 2023 05:22:49 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Heinrich Schuchardt , Tom Rini , Simon Glass Subject: [PATCH v2 09/14] doc: Tidy up the format docs to be more generic Date: Fri, 23 Jun 2023 13:22:09 +0100 Message-ID: <20230623122222.2267003-9-sjg@chromium.org> X-Mailer: git-send-email 2.41.0.162.gfafddb0af9-goog In-Reply-To: <20230623122222.2267003-1-sjg@chromium.org> References: <20230623122222.2267003-1-sjg@chromium.org> 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.8 at phobos.denx.de X-Virus-Status: Clean Avoid reference to uImage which is the old format. Drop the historical language at the top and rewrite a few other sections. Correct the U-Boot filename which is now in the boot/ directory. Signed-off-by: Simon Glass --- (no changes since v1) doc/usage/fit/source_file_format.rst | 82 +++++++++++----------------- 1 file changed, 31 insertions(+), 51 deletions(-) diff --git a/doc/usage/fit/source_file_format.rst b/doc/usage/fit/source_file_format.rst index e27377342a15..986ccdfe3256 100644 --- a/doc/usage/fit/source_file_format.rst +++ b/doc/usage/fit/source_file_format.rst @@ -1,61 +1,41 @@ .. SPDX-License-Identifier: GPL-2.0+ -U-Boot new uImage source file format (bindings definition) -========================================================== +Flattened Image Tree (FIT) Format +================================= Introduction ------------ -Evolution of the 2.6 Linux kernel for embedded PowerPC systems introduced new -booting method which requires that hardware description is available to the -kernel in the form of Flattened Device Tree. +The number of elements playing a role in the kernel booting process has +increased over time and now typically includes the devicetree, kernel image and +possibly a ramdisk image. Generally, all must be placed in the system memory and +booted together. -Booting with a Flattened Device Tree is much more flexible and is intended to -replace direct passing of 'struct bd_info' which was used to boot pre-FDT -kernels. +For firmware images a similar process has taken place, with various binaries +loaded at different addresses, such as ARM's ATF, OpenSBI, FPGA and U-Boot +itself. -However, U-Boot needs to support both techniques to provide backward -compatibility for platforms which are not FDT ready. Number of elements -playing role in the booting process has increased and now includes the FDT -blob. Kernel image, FDT blob and possibly ramdisk image - all must be placed -in the system memory and passed to bootm as a arguments. Some of them may be -missing: FDT is not present for legacy platforms, ramdisk is always optional. -Additionally, old uImage format has been extended to support multi sub-images -but the support is limited by simple format of the legacy uImage structure. -Single binary header 'struct legacy_img_hdr' is not flexible enough to cover all -possible scenarios. - -All those factors combined clearly show that there is a need for new, more -flexible, multi component uImage format. - - -New uImage format assumptions ------------------------------ - -Implementation -~~~~~~~~~~~~~~ - -Libfdt has been selected for the new uImage format implementation as (1) it -provides needed functionality, (2) is actively maintained and developed and -(3) increases code reuse as it is already part of the U-Boot source tree. +FIT provides a flexible and extensible format to deal with this complexity. It +provides support for multiple components. It also supports multiple +configurations, so that the same FIT can be used to boot multiple boards, with +some components in common (e.g. kernel) and some specific to that board (e.g. +devicetree). Terminology ~~~~~~~~~~~ -This document defines new uImage structure by providing FDT bindings for new -uImage internals. Bindings are defined from U-Boot perspective, i.e. describe -final form of the uImage at the moment when it reaches U-Boot. User +This document defines FIT by providing FDT (Flat Device Tree) bindings. These +describe the final form of the FIT at the moment when it is used. The user perspective may be simpler, as some of the properties (like timestamps and -hashes) will need to be filled in automatically by the U-Boot mkimage tool. +hashes) are filled in automatically by the U-Boot mkimage tool. -To avoid confusion with the kernel FDT the following naming convention is -proposed for the new uImage format related terms: +To avoid confusion with the kernel FDT the following naming convention is used: FIT - Flattened uImage Tree + Flattened Image Tree -FIT is formally a flattened device tree (in the libfdt meaning), which -conforms to bindings defined in this document. +FIT is formally a flattened devicetree (in the libfdt meaning), which conforms +to bindings defined in this document. .its image tree source @@ -63,22 +43,22 @@ conforms to bindings defined in this document. .itb flattened image tree blob -Image building procedure +Image-building procedure ~~~~~~~~~~~~~~~~~~~~~~~~ -The following picture shows how the new uImage is prepared. Input consists of +The following picture shows how the FIT is prepared. Input consists of image source file (.its) and a set of data files. Image is created with the help of standard U-Boot mkimage tool which in turn uses dtc (device tree -compiler) to produce image tree blob (.itb). Resulting .itb file is the -actual binary of a new uImage:: +compiler) to produce image tree blob (.itb). The resulting .itb file is the +actual binary of a new FIT:: tqm5200.its + vmlinux.bin.gz mkimage + dtc xfer to target - eldk-4.2-ramdisk --------------> tqm5200.itb --------------> bootm + eldk-4.2-ramdisk --------------> tqm5200.itb --------------> boot tqm5200.dtb /|\ | - 'new uImage' + 'new FIT' Steps: @@ -89,7 +69,7 @@ Steps: #. mkimage calls dtc to create .itb image and assures that missing properties are added -#. .itb (new uImage) is uploaded onto the target and used therein +#. .itb (new FIT) is uploaded onto the target and used therein Unique identifiers @@ -101,10 +81,10 @@ is used as it's identifier as it assures uniqueness without additional checking required. -Root node properties +Root-node properties -------------------- -Root node of the uImage Tree should have the following layout:: +The root node of the FIT should have the following layout:: / o image-tree |- description = "image description" @@ -128,7 +108,7 @@ Optional property ~~~~~~~~~~~~~~~~~ description - Textual description of the uImage + Textual description of the FIT Mandatory property ~~~~~~~~~~~~~~~~~~ -- 2.41.0.162.gfafddb0af9-goog