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 805D5EB64D7 for ; Fri, 23 Jun 2023 12:24:49 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 317F1861CA; Fri, 23 Jun 2023 14:24:15 +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="N+EJyTBc"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 584178638B; Fri, 23 Jun 2023 14:23:14 +0200 (CEST) Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) (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 7CD7D86167 for ; Fri, 23 Jun 2023 14:22:54 +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-wr1-x42b.google.com with SMTP id ffacd0b85a97d-311394406d0so566853f8f.2 for ; Fri, 23 Jun 2023 05:22:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1687522974; x=1690114974; 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=KR7m9MNNHdwWWn0F+6zwCHz3blv5TCc0aG09OFuNWp0=; b=N+EJyTBcTz/HNToGbEb2aM7ga0wiI4TPaQSTHKUfCj90rdaOKv06/bM7y4EQ1H4LgD JKkTAuHS0FEexo59VnUs73HvfyEeM1XIAeIeuIx82twi44bp+z17r/EMs6H8Rfb1mmJT 80JTQYmFv/Lg1vkCj8T5OV/XxqM20dPshNv6A= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687522974; x=1690114974; 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=KR7m9MNNHdwWWn0F+6zwCHz3blv5TCc0aG09OFuNWp0=; b=cbGJp86p8SW51no20aF5uB592hioL4zZ6Hu2fHtE8gfq2a78EpYvaxdJunOCY0z6b8 /c2ehtushchO6H70ASVgkdHq1uPGA/DKtXWNmyXaCV+8P6iA3GBoCPFwT7wu3F9wUSdx l21hSHIJ1in43636UzjKlR13st47qNGjo8xdkvBTmQ/5I86qOcia7JJ1yR1F9tX6toaa t6SgztbpIsAI/VXTvZFTuIBfhZSzBc9LbDakppcFp66dUjSK6nTuGI/KAutmVcH7Xr3h 61SBeb3j+GMSonAFomnniKsEB7feZi4IISPhLY9wXDLaiITGcc5FhdEbs1MV/iAxRov3 YVmQ== X-Gm-Message-State: AC+VfDyE02mNi0lQivU6KL+XdNWSLJ/lQC5PtV8OVWl/YevILl9p/zVA Wew6SiEonP5NLxQ6bar7gLIAeU9dDAuoSDMHXvGxiQ== X-Google-Smtp-Source: ACHHUZ6n9rORIie06l/do29KE3NhitrzMQpk/wgQh2U/5Ap9jUHs8nMdW+626IkUhFESUk6InfYCFQ== X-Received: by 2002:a5d:4811:0:b0:30f:cb38:fcef with SMTP id l17-20020a5d4811000000b0030fcb38fcefmr15214413wrq.39.1687522973872; Fri, 23 Jun 2023 05:22:53 -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.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Jun 2023 05:22:53 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Heinrich Schuchardt , Tom Rini , Simon Glass Subject: [PATCH v2 11/14] doc: Move external FIT docs into the main body Date: Fri, 23 Jun 2023 13:22:11 +0100 Message-ID: <20230623122222.2267003-11-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 Rather than having this as an addition to the end, move this into the main body of the spec, rewriting as needed. Signed-off-by: Simon Glass --- (no changes since v1) doc/usage/fit/source_file_format.rst | 74 ++++++++++++++-------------- 1 file changed, 38 insertions(+), 36 deletions(-) diff --git a/doc/usage/fit/source_file_format.rst b/doc/usage/fit/source_file_format.rst index 1c72230c0604..f1cc1bc4931c 100644 --- a/doc/usage/fit/source_file_format.rst +++ b/doc/usage/fit/source_file_format.rst @@ -81,6 +81,25 @@ is used as it's identifier as it assures uniqueness without additional checking required. +External data +~~~~~~~~~~~~~ + +FIT is normally built initially with image data in the 'data' property of each +image node. It is also possible for this data to reside outside the FIT itself. +This allows the 'FDT' part of the FIT to be quite small, so that it can be +loaded and scanned without loading a large amount of data. Then when an image is +needed it can be loaded from an external source. + +External FITs use 'data-offset' or 'data-position' instead of 'data'. + +The mkimage tool can convert a FIT to use external data using the `-E` argument, +optionally using `-p` to specific a fixed position. + +It is often desirable to align each image to a block size or cache-line size +(e.g. 512 bytes), so that there is no need to copy it to an aligned address when +reading the image data. The mkimage tool provides a `-B` argument to support +this. + Root-node properties -------------------- @@ -215,9 +234,6 @@ type zynqmpimage Xilinx ZynqMP Boot Image } ==================== ================== -data - Path to the external file which contains this node's binary data. - compression Compression used by included data. If no compression is used, the compression property should be set to "none". If the data is compressed but @@ -238,9 +254,28 @@ compression zstd zstd compressed ==================== ================== +data-size + size of the data in bytes + + Conditionally mandatory property ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +data + Path to the external file which contains this node's binary data. Within + the FIT this is the contents of the file. This is mandatory unless + external data is used. + +data-offset + Offset of the data in a separate image store. The image store is placed + immediately after the last byte of the device tree binary, aligned to a + 4-byte boundary. This is mandatory if external data is used, with an offset. + +data-position + Machine address at which the data is to be found. This is a fixed address + not relative to the loading of the FIT. This is mandatory if external data + used with a fixed address. + os OS name, mandatory for types "kernel". Valid OS names are: @@ -478,39 +513,6 @@ Older, 2.4 kernel and 2.6 non-FDT kernel do not use FDT blob, in such cases not* be specified in a configuration node. -External data -------------- - -The above format shows a 'data' property which holds the data for each image. -It is also possible for this data to reside outside the FIT itself. This -allows the FIT to be quite small, so that it can be loaded and scanned -without loading a large amount of data. Then when an image is needed it can -be loaded from an external source. - -In this case the 'data' property is omitted. Instead you can use: - -data-offset - offset of the data in a separate image store. The image - store is placed immediately after the last byte of the device tree binary, - aligned to a 4-byte boundary. - -data-size - size of the data in bytes - -The 'data-offset' property can be substituted with 'data-position', which -defines an absolute position or address as the offset. This is helpful when -booting U-Boot proper before performing relocation. Pass '-p [offset]' to -mkimage to enable 'data-position'. - -Normal kernel FIT image has data embedded within FIT structure. U-Boot image -for SPL boot has external data. Existence of 'data-offset' can be used to -identify which format is used. - -For FIT image with external data, it would be better to align each blob of data -to block(512 byte) for block device, so that we don't need to do the copy when -read the image data in SPL. Pass '-B 0x200' to mkimage to align the FIT -structure and data to 512 byte, other values available for other align size. - Examples -------- -- 2.41.0.162.gfafddb0af9-goog