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 9A279C433FE for ; Fri, 27 May 2022 18:53:52 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0C7B384361; Fri, 27 May 2022 20:53:41 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=quarantine dis=none) header.from=mcrowe.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=mcrowe.com header.i=@mcrowe.com header.b="Y97uOXr/"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 64A9883345; Fri, 27 May 2022 18:37:55 +0200 (CEST) Received: from avasout-ptp-004.plus.net (avasout-ptp-004.plus.net [84.93.230.250]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 7597583EFE for ; Fri, 27 May 2022 18:37:52 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=mcrowe.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=mac@mcrowe.com Received: from deneb.mcrowe.com ([80.229.24.9]) by smtp with ESMTP id ucyBnako6AcBnucyCnS8gx; Fri, 27 May 2022 17:37:51 +0100 X-Clacks-Overhead: "GNU Terry Pratchett" X-CM-Score: 0.00 X-CNFS-Analysis: v=2.4 cv=JPUoDuGb c=1 sm=1 tr=0 ts=6290fe5f a=E/9URZZQ5L3bK/voZ0g0HQ==:117 a=E/9URZZQ5L3bK/voZ0g0HQ==:17 a=kj9zAlcOel0A:10 a=oZkIemNP1mAA:10 a=9tn5foX_U8PNt5b4YDgA:9 a=CjuIK1q_8ugA:10 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mcrowe.com; s=20191005; h=Content-Type:MIME-Version:Message-ID:Subject:To:From:Date: Sender:Reply-To:CC:Content-Transfer-Encoding:Content-ID:Content-Description: In-Reply-To:References; bh=qXoI46fCMyEIjxaQVxUcjkWckWUb6PlDR4kGiqi3z3k=; b=Y9 7uOXr/sUvTDSUxHAE/FeBD9MenY+svT2uS+DHri152+XKFtF/tk4Vc9Y4hFgZCeF7Sj9IWTbpBbGF Fb8PjX34tYEPCI6JRDMKea9Zv999Anh4XFsLDK0VaySS2m+DJDnTDkaN0BGdpTUTnGxAcaUqlIuMV OxRfVNf2Qpg8Oh9c8tHsgneTCZLcb35/c+VfwXo9QzR1lJzvr7q9nAUN3/jW6YV5EebMg9W4ANMiw PWqkdnQmlnRtJL6SVbex5VoFE0et3fQEsmK/8kmSD+/4KjYeuZwI/vnjoToRzsOFMTV0TiSI/xZuo 0W4Q9c+smoGVo9p/EczxkureZs2IH+kQ==; Received: from mac by deneb.mcrowe.com with local (Exim 4.94.2) (envelope-from ) id 1nucyB-0087Lq-8p for u-boot@lists.denx.de; Fri, 27 May 2022 17:37:47 +0100 Date: Fri, 27 May 2022 17:37:47 +0100 From: Mike Crowe To: U-Boot Mailing List Subject: Finding x86_setup among FIT configurations Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-CMAE-Envelope: MS4xfGceV5N6iOQn6nfV8873pKjOP+1EXsPtumLPJEttj/Zy/9niXHUAOUR4L7PoY1qm25RyIK19Hkdgh0C2qV5jVrCg9uHon84Z8JnTSUdXlkGRCxJVgc57 RB0sVvDiLBqXBAFR8g2BtW4Bed4k7+pJHdeWQaOohXA+9HfdngjJ0ulyK7SgQZqvbg2m7ZLiTtMebA== X-Mailman-Approved-At: Fri, 27 May 2022 20:53:35 +0200 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.5 at phobos.denx.de X-Virus-Status: Clean I'm trying to boot a FIT image on x86 and fit_image_load is having trouble finding the setup binary. My FIT image looks similar to the one in doc/uImage.FIT/kernel.its: / { images { kernel-1 { description = "Linux kernel"; data = <...> type = "kernel"; arch = "x86"; os = "linux"; compression = "none"; load = <0x1314c40>; entry = <0x1314c40>; hash-1 { value = <...> algo = "sha256"; }; }; setup-1 { description = "Linux setup.bin"; data = <...> type = "x86_setup"; arch = "x86"; os = "linux"; compression = "none"; load = <0x90000>; entry = <0x90000>; hash-1 { value = <...> algo = "sha256"; }; }; }; configurations { conf-0 { description = "Configuration for board 0"; kernel = "kernel-1"; setup = "setup-1"; }; conf-1 { description = "Configuration for board 1"; kernel = "kernel-1"; setup = "setup-1"; }; }; }; I'm trying to run it with: bootm ${loadaddr}#conf-0 I get: ## Loading kernel from FIT Image at 10000000 ... Using 'conf-0' configuration Trying 'kernel-1' kernel subimage Description: Linux kernel Created: 2022-05-27 14:03:08 UTC Type: Kernel Image Compression: uncompressed Data Start: 0x100000f4 Data Size: 13990516 Bytes = 13.3 MiB Architecture: Intel x86 OS: Linux Load Address: 0x01314c40 Entry Point: 0x01314c40 Hash algo: sha256 Hash value: 1f4167a38aed74edb02bedf021fc8dbc4a9d0c0a84e886006de22c8b11714645 Verifying Hash Integrity ... sha256+ OK ## Loading setup from FIT Image at 10000000 ... Could not find configuration node Loading Kernel Image ## Kernel loading failed (missing x86 kernel setup) ... subcommand not supported "could not find configuration node" is emitted because fit_uname_config is NULL inside image-fit.c:fit-image-load when loading the setup binary. I don't have CONFIG_FIT_BEST_MATCH enabled, but enabling it didn't seem to change the observed behaviour. It appears that the parsing of the configuration name after the load address is done separately inside bootm.c:boot_get_kernel (for the kernel) and image-fit.c:boot_get_fdt_fit (for the device tree) and the command arguments aren't even passed to image-fit.c:boot_get_setup_fit, so it just passes NULL as fit_uname_config. If I add: if (!fit_uname_config) fit_uname_config = "conf-0"; to image-fit.c:fit_image_load then the setup binary is found and my device can boot the kernel successfully. I can't see how this can ever work, so I think I must be missing something. Can anyone enlighten me as to what that might be? Thanks. Mike.