From patchwork Sun Sep 25 15:02:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1682197 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=R+xCeZtR; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Mb8PR71YNz1yq1 for ; Mon, 26 Sep 2022 01:07:07 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id CC9B384BD8; Sun, 25 Sep 2022 17:04:23 +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="R+xCeZtR"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 58E0384C49; Sun, 25 Sep 2022 17:03:46 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-il1-x135.google.com (mail-il1-x135.google.com [IPv6:2607:f8b0:4864:20::135]) (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 2A15C84C3F for ; Sun, 25 Sep 2022 17:03:35 +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-il1-x135.google.com with SMTP id y9so2410300ily.11 for ; Sun, 25 Sep 2022 08:03:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=x3+XyVIIOP1Ym/56+3RCmX56Pi1SJ2doxVHm0ynytj0=; b=R+xCeZtRrrauhuRNfibREJY7wuCtRlAGa9tdLiIrBN7QxS4HqClqoVei30NL2zqKno 8VjmAyz2hP2AvbmzLnSYLuv9zRFyzd0xXXAYg9432ey8y0dePtkfzJWi72x3c7UMO9P/ satK7uFadkqA1m+yeb2NvXmjc3MMtRtms04Qs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=x3+XyVIIOP1Ym/56+3RCmX56Pi1SJ2doxVHm0ynytj0=; b=6MOsfN+3tF4meFT58Oa3gBM8VaGnRd7jo7XylxhM9qm1OsoFHRore9kySGp/6a8ARl Nsv+jPEH6e0bONvmAJvy7X17T0HttYxUaVoQxUBdHfvfyIRPdw4OWTYUOPHCtG0S3/Wl qcn7pulf3IgswSOaoiZI2YmKg3XMO3TbwfBP9cVuus0JgfvoBmRtnapCPG/N+TKBcsOj gMp/hWvCoSE7q88JhG3JEzrWJtan8hxYIGu9t6Wmg3LFrScVZyo42BHuoxQ2nCC4VR3t vZYsCL1il6VBdSpKl2T3vplddJKvm+vBa0TPs1pC9/RLWHJZng3ZadzDdk8n23/AxUN8 FFmg== X-Gm-Message-State: ACrzQf1t/vJ21ZXVhvMf5Meds2AhljaL0ONF4l1apfVyBEmAIdWYvExd wjRNbkx2vUJusxHSVnWyit2MDUESxIpSbQ== X-Google-Smtp-Source: AMsMyM4VjM2R2bZizee31MC5F4qCuq2HUos2GqQxsSfyyZeBDZqVncMaLI6GFK59Z0KiiVpAHHVqUQ== X-Received: by 2002:a05:6e02:1caf:b0:2f8:1bc8:3410 with SMTP id x15-20020a056e021caf00b002f81bc83410mr3076882ill.234.1664118213386; Sun, 25 Sep 2022 08:03:33 -0700 (PDT) Received: from sjg1.roam.corp.google.com (c-67-190-102-125.hsd1.co.comcast.net. [67.190.102.125]) by smtp.gmail.com with ESMTPSA id u19-20020a926013000000b002f19d9838c6sm5360578ilb.25.2022.09.25.08.03.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Sep 2022 08:03:32 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass , Alexandru Gagniuc , Andre Przywara , Chia-Wei Wang , Heinrich Schuchardt , Jan Kiszka , Joe Hershberger , Joel Stanley , Marek Vasut , Philippe Reynes , Sean Anderson Subject: [PATCH 22/45] image: Move comment for fit_conf_find_compat() Date: Sun, 25 Sep 2022 09:02:25 -0600 Message-Id: <20220925150248.2524421-23-sjg@chromium.org> X-Mailer: git-send-email 2.37.3.998.g577e59143f-goog In-Reply-To: <20220925150248.2524421-1-sjg@chromium.org> References: <20220925150248.2524421-1-sjg@chromium.org> MIME-Version: 1.0 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 Move this comment to the header file, where the APIs should be defined. Signed-off-by: Simon Glass --- boot/image-fit.c | 43 ------------------------------------------- include/image.h | 43 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 43 deletions(-) diff --git a/boot/image-fit.c b/boot/image-fit.c index a7acd762272..94074515258 100644 --- a/boot/image-fit.c +++ b/boot/image-fit.c @@ -1687,49 +1687,6 @@ int fit_check_format(const void *fit, ulong size) return 0; } -/** - * fit_conf_find_compat - * @fit: pointer to the FIT format image header - * @fdt: pointer to the device tree to compare against - * - * fit_conf_find_compat() attempts to find the configuration whose fdt is the - * most compatible with the passed in device tree. - * - * Example: - * - * / o image-tree - * |-o images - * | |-o fdt-1 - * | |-o fdt-2 - * | - * |-o configurations - * |-o config-1 - * | |-fdt = fdt-1 - * | - * |-o config-2 - * |-fdt = fdt-2 - * - * / o U-Boot fdt - * |-compatible = "foo,bar", "bim,bam" - * - * / o kernel fdt1 - * |-compatible = "foo,bar", - * - * / o kernel fdt2 - * |-compatible = "bim,bam", "baz,biz" - * - * Configuration 1 would be picked because the first string in U-Boot's - * compatible list, "foo,bar", matches a compatible string in the root of fdt1. - * "bim,bam" in fdt2 matches the second string which isn't as good as fdt1. - * - * As an optimization, the compatible property from the FDT's root node can be - * copied into the configuration node in the FIT image. This is required to - * match configurations with compressed FDTs. - * - * returns: - * offset to the configuration to use if one was found - * -1 otherwise - */ int fit_conf_find_compat(const void *fit, const void *fdt) { int ndepth = 0; diff --git a/include/image.h b/include/image.h index b336cfa0842..ca1c6c5b3c2 100644 --- a/include/image.h +++ b/include/image.h @@ -1136,6 +1136,49 @@ int fit_image_check_comp(const void *fit, int noffset, uint8_t comp); */ int fit_check_format(const void *fit, ulong size); +/** + * fit_conf_find_compat + * @fit: pointer to the FIT format image header + * @fdt: pointer to the device tree to compare against + * + * fit_conf_find_compat() attempts to find the configuration whose fdt is the + * most compatible with the passed in device tree. + * + * Example: + * + * / o image-tree + * |-o images + * | |-o fdt-1 + * | |-o fdt-2 + * | + * |-o configurations + * |-o config-1 + * | |-fdt = fdt-1 + * | + * |-o config-2 + * |-fdt = fdt-2 + * + * / o U-Boot fdt + * |-compatible = "foo,bar", "bim,bam" + * + * / o kernel fdt1 + * |-compatible = "foo,bar", + * + * / o kernel fdt2 + * |-compatible = "bim,bam", "baz,biz" + * + * Configuration 1 would be picked because the first string in U-Boot's + * compatible list, "foo,bar", matches a compatible string in the root of fdt1. + * "bim,bam" in fdt2 matches the second string which isn't as good as fdt1. + * + * As an optimization, the compatible property from the FDT's root node can be + * copied into the configuration node in the FIT image. This is required to + * match configurations with compressed FDTs. + * + * returns: + * offset to the configuration to use if one was found + * -1 otherwise + */ int fit_conf_find_compat(const void *fit, const void *fdt); /**