From patchwork Fri Sep 20 08:12:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1987777 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org 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=TUZop3Hc; dkim-atps=neutral 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=patchwork.ozlabs.org) 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 (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4X94sg0fbyz1y27 for ; Fri, 20 Sep 2024 18:13:59 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id AED228942D; Fri, 20 Sep 2024 10:13:32 +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="TUZop3Hc"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6A4EF89382; Fri, 20 Sep 2024 10:13:30 +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=ham autolearn_force=no version=3.4.2 Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [IPv6:2a00:1450:4864:20::52c]) (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 D488389382 for ; Fri, 20 Sep 2024 10:13:20 +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-ed1-x52c.google.com with SMTP id 4fb4d7f45d1cf-5c44e1cde53so2088194a12.0 for ; Fri, 20 Sep 2024 01:13:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1726820000; x=1727424800; darn=lists.denx.de; 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=foPS6tB3S6Bm4uKwaA2l/pXxZfKHgADzo5rV+ccL1nQ=; b=TUZop3Hc2kVOyU2xMKrQGOP5YwY2N7OKmOTXjT3mbISG/5nvsZB58sJ0JwqCEg99xX 51q97sAm7clixuj+No44DLe0T/SZWsgmfgDMhRg+wMM4Ai8X159AuRHinKOBMcecAJjC Rf2wGcAAzI9FWFdXB5Wd0v5RBtp1vmOb1RWAY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726820000; x=1727424800; 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=foPS6tB3S6Bm4uKwaA2l/pXxZfKHgADzo5rV+ccL1nQ=; b=MDCl1pPnRTqKCEWK092gaubiRdXdyFpbDX2gX8Jf3K7ucHoQbIa3B0sMREbZfHb8Vv 5Du2QfqOJl8mRbAqB0/txTtNM64N38CCd7zChicJhjlVvjEiGxgHMbNsU87Mm+qAp/Y3 1kDCg9qXS6T1RuAzT4tbfKLNxQk/rbyJHPhdY2+5Fkp2d+iFb/m/6FQnMO94AMjmQx5N UDAm/YaRhdBUtfK4H/SwxxAwW6nEhugF+lcJLfhXoLcCDDOTPMOI15zhJYCwxGMuy9Zt 6JAfq7fJCe+Rekhyavb1XUjYZ/JQLAStxu9Izh+Z1aJg1jSRyYDdHUJSMv2BwM6Q6Lyr O4Zg== X-Gm-Message-State: AOJu0YzCBod5LdBuKUHQDX99m+CpD7Ywrqy2D00ILgnkRNIJw0KxzHoU 45zFvfjazftreF0936W/Oh1fKTDdBMqccdVo7AIt4ORm7kARNBDP28c+kdvU/Ns+EnxDgBIPyHc QDQii X-Google-Smtp-Source: AGHT+IEqwogJEFRpcivNeXITMPHBcv6y0iCj0GtPMYaFjo7nGUsEGVlCvx0tmy07Hp0lS37W8ow0VA== X-Received: by 2002:a05:6402:51c9:b0:5c4:1320:e5a3 with SMTP id 4fb4d7f45d1cf-5c464a3f71emr1146298a12.16.1726819999906; Fri, 20 Sep 2024 01:13:19 -0700 (PDT) Received: from chromium.org ([83.68.141.146]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c42bc88cf7sm6804447a12.90.2024.09.20.01.13.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Sep 2024 01:13:18 -0700 (PDT) From: Simon Glass To: u-boot@lists.denx.de Cc: Simon Glass , Eddie James , Guillaume La Roque , Heinrich Schuchardt , Julien Masson , Marek Vasut , Mattijs Korpershoek , Paul-Erwan Rio , Sughosh Ganu , Tom Rini Subject: [PATCH v2 01/18] image: Add a prototype for fit_image_get_phase() Date: Fri, 20 Sep 2024 10:12:40 +0200 Message-ID: <20240920081309.140426-2-sjg@chromium.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240920081309.140426-1-sjg@chromium.org> References: <20240920081309.140426-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.8 at phobos.denx.de X-Virus-Status: Clean This function exists but is not exported. Add a prototype so it can be used elsewhere. Signed-off-by: Simon Glass --- (no changes since v1) include/image.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/include/image.h b/include/image.h index c52fced9b40..9da55fe23c2 100644 --- a/include/image.h +++ b/include/image.h @@ -1171,6 +1171,18 @@ int fit_image_get_data_size_unciphered(const void *fit, int noffset, int fit_image_get_data_and_size(const void *fit, int noffset, const void **data, size_t *size); +/** + * fit_image_get_phase() - Get the phase from a FIT image + * + * @fit: FIT to read from + * @offset: offset node to read + * @phasep: Returns phase, if any + * Return: 0 if read OK and *phasep is value, -ENOENT if there was no phase + * property in the node, other -ve value on other error + */ +int fit_image_get_phase(const void *fit, int offset, + enum image_phase_t *phasep); + /** * fit_get_data_node() - Get verified image data for an image * @fit: Pointer to the FIT format image header From patchwork Fri Sep 20 08:12:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1987774 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org 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=WXPoPn8+; dkim-atps=neutral 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=patchwork.ozlabs.org) 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 (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4X94s550c4z1y27 for ; Fri, 20 Sep 2024 18:13:29 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9E9F3893EC; Fri, 20 Sep 2024 10:13:27 +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="WXPoPn8+"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id DBC5B893BE; Fri, 20 Sep 2024 10:13:25 +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=ham autolearn_force=no version=3.4.2 Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com [IPv6:2a00:1450:4864:20::12e]) (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 DD883893C5 for ; Fri, 20 Sep 2024 10:13: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=sjg@chromium.org Received: by mail-lf1-x12e.google.com with SMTP id 2adb3069b0e04-535be093a43so2270425e87.3 for ; Fri, 20 Sep 2024 01:13:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1726820003; x=1727424803; darn=lists.denx.de; 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=0SVQLx15FN6YcUVrnEKqeznpC7TKhyJucaP2+ar0imA=; b=WXPoPn8+rtu+0HMcSRQiTf4mN8qJEze4VxrcTnf26is2C3TjmOUe/obpN6i4/wUlE7 Z40aR+20mIJOOjSJ+QAEpgN7ngeT0QkucZLrQjiTG/PGtjxMmy4YBrTNDzGLSuD0XhqF IBFFniaVmGPpjgRkTsdsqJyTN50DRcgD2BdCM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726820003; x=1727424803; 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=0SVQLx15FN6YcUVrnEKqeznpC7TKhyJucaP2+ar0imA=; b=SFs7p0pP0f9Ry16bAWn+7n0cENfg/DT35hW5Gjp6Cyi5UpB3i4F5YxCRh9YfwehmtK vSC3NwKyaav3YCv0O4V7zuxFAtnnB3duWCiljcp1MvI5yNBklYk+q6Knh2wSKrxRzG44 g6Kpr3jfm3+aikmLxnzUgr18a69Bw1zDqfyf33fwId0Xp8hCvbkgimVQ3Fwk9vNNHhfB VrUY9CLpThqI2Ngp9ociLqGDjcVsiUeZxAIj91YgiUvDiHEkuctpdIltNzSn9UXhrjBj SWR82FKWX1vjtVLXxmdVIvOD/d746ssZ+jk1hDZbYrwu42SXLPBmamnA8RklAgOD6WsN EJVQ== X-Gm-Message-State: AOJu0YxIFBjPaf/0Fc0NJelfWc3fJFmf794lJWlBpxc83M4mB2aTZD2S o9S9T6iuj5he1fqR6fz4IuUImvh1ChAq31+y9//UoivewWBUjj6jc4FbhsRh+7Tp8+qTdVJNv3E 12Dl7 X-Google-Smtp-Source: AGHT+IGTNJdxbNV87pvWNLyiq0sS//F6JekjsJXWCyU7U4f5mf/uJi3I2RxGStnMyL5HV9l2uxhiVg== X-Received: by 2002:a05:6512:398f:b0:535:63a9:9d8c with SMTP id 2adb3069b0e04-536ac2e511cmr793414e87.17.1726820002850; Fri, 20 Sep 2024 01:13:22 -0700 (PDT) Received: from chromium.org ([83.68.141.146]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c42bc88cf7sm6804447a12.90.2024.09.20.01.13.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Sep 2024 01:13:21 -0700 (PDT) From: Simon Glass To: u-boot@lists.denx.de Cc: Simon Glass , Igor Opaniuk , Ilias Apalodimas , Laurent Pinchart , Mattijs Korpershoek , Maxim Moskalets , Michael Walle , Paul-Erwan Rio , Raymond Mao , Sughosh Ganu , Tom Rini Subject: [PATCH v2 02/18] boot: Allow FIT to fall back from best-match option Date: Fri, 20 Sep 2024 10:12:41 +0200 Message-ID: <20240920081309.140426-3-sjg@chromium.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240920081309.140426-1-sjg@chromium.org> References: <20240920081309.140426-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.8 at phobos.denx.de X-Virus-Status: Clean When the best-match feature fails to find something, use the provided config name as a fallback. The allows SPL to select a suitable config when best-match is enabled. Signed-off-by: Simon Glass --- (no changes since v1) boot/image-fit.c | 19 ++++++++++--------- include/image.h | 4 +++- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/boot/image-fit.c b/boot/image-fit.c index 7d56f0b5e6e..439ff51edf6 100644 --- a/boot/image-fit.c +++ b/boot/image-fit.c @@ -1729,13 +1729,13 @@ int fit_conf_find_compat(const void *fit, const void *fdt) images_noffset = fdt_path_offset(fit, FIT_IMAGES_PATH); if (confs_noffset < 0 || images_noffset < 0) { debug("Can't find configurations or images nodes.\n"); - return -1; + return -EINVAL; } fdt_compat = fdt_getprop(fdt, 0, "compatible", &fdt_compat_len); if (!fdt_compat) { debug("Fdt for comparison has no \"compatible\" property.\n"); - return -1; + return -ENXIO; } /* @@ -1812,7 +1812,7 @@ int fit_conf_find_compat(const void *fit, const void *fdt) } if (!best_match_offset) { debug("No match found.\n"); - return -1; + return -ENOENT; } return best_match_offset; @@ -2095,17 +2095,18 @@ int fit_image_load(struct bootm_headers *images, ulong addr, * fit_conf_get_node() will try to find default config node */ bootstage_mark(bootstage_id + BOOTSTAGE_SUB_NO_UNIT_NAME); - if (IS_ENABLED(CONFIG_FIT_BEST_MATCH) && !fit_uname_config) { - cfg_noffset = fit_conf_find_compat(fit, gd_fdt_blob()); - } else { - cfg_noffset = fit_conf_get_node(fit, fit_uname_config); - } - if (cfg_noffset < 0) { + ret = -ENXIO; + if (IS_ENABLED(CONFIG_FIT_BEST_MATCH) && !fit_uname_config) + ret = fit_conf_find_compat(fit, gd_fdt_blob()); + if (ret < 0 && ret != -EINVAL) + ret = fit_conf_get_node(fit, fit_uname_config); + if (ret < 0) { puts("Could not find configuration node\n"); bootstage_error(bootstage_id + BOOTSTAGE_SUB_NO_UNIT_NAME); return -ENOENT; } + cfg_noffset = ret; fit_base_uname_config = fdt_get_name(fit, cfg_noffset, NULL); printf(" Using '%s' configuration\n", fit_base_uname_config); diff --git a/include/image.h b/include/image.h index 9da55fe23c2..5d8bee80053 100644 --- a/include/image.h +++ b/include/image.h @@ -1411,7 +1411,9 @@ int fit_check_format(const void *fit, ulong size); * 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 + * Returns: offset to the configuration to use if one was found, -EINVAL if + * there a /configurations or /images node is missing, -ENOENT if no match was + * found, -ENXIO if the FDT node has no compatible string */ int fit_conf_find_compat(const void *fit, const void *fdt); From patchwork Fri Sep 20 08:12:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1987775 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org 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=ZAsD6BUE; dkim-atps=neutral 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=patchwork.ozlabs.org) 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 (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4X94sG6JMTz1y27 for ; Fri, 20 Sep 2024 18:13:38 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 014EF893CF; Fri, 20 Sep 2024 10:13:30 +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="ZAsD6BUE"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8990989406; Fri, 20 Sep 2024 10:13:28 +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=ham autolearn_force=no version=3.4.2 Received: from mail-lj1-x22d.google.com (mail-lj1-x22d.google.com [IPv6:2a00:1450:4864:20::22d]) (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 9A47B893BE for ; Fri, 20 Sep 2024 10:13:26 +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-lj1-x22d.google.com with SMTP id 38308e7fff4ca-2f75b13c2a8so20929451fa.3 for ; Fri, 20 Sep 2024 01:13:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1726820006; x=1727424806; darn=lists.denx.de; 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=HXyW4pRsSCcVIRcKTWYcvGRzZT6vG8TSb3yXObrbxdM=; b=ZAsD6BUE531KzPBt7sM6xuUYZpgxIG4BhjfzeFvAjbmVAJU62iYGjAYuls7MMuClBr R+jPyyEje3rbZ1wtBLKVerW+s6toixY3xsL7iKLtar8SjcGJ7S1YjgOa66cjRVj2VkAs /ng6yZfVmPVDsu4ZkzBI34cvUGnPX/BOi9+wg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726820006; x=1727424806; 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=HXyW4pRsSCcVIRcKTWYcvGRzZT6vG8TSb3yXObrbxdM=; b=NoZCuUnDbDUbGOTDHTYvcTMIIdRX9YctcZ6QW/JDH6/8dMZvxCTx71AyT+uwsBJIpy nO6txqixOWqKdRWI4c8qsnwZHv+6+OXUtrfCTbNyYBHMTEMaV7JBYIeJcwYmi9qMIbny YwDXjg9yhDNj3IznUEXfy7ZG2Er7NMhK26zjrS42GeEZZQxX9lx4XH28FevMVCsJsvBI xD+BrGSjN0YNlliEx7h20qQXUEcu49zqjnJdJgFEPjxw5XrS1l/xtHsh0RNsgB0BEPtV BXdRjZ1LAzQaB7DjGSogmgjaSBbsXLYPsZSya6H9LJcwNVkF3qD3AOYygV7DjuUUTVIy qUbQ== X-Gm-Message-State: AOJu0Ywp2Kh0MURnFIFjVzDqnXOsTfBWsz+r5h0hxLbHO0P8GLl7fmoJ dvyxlKKMdYApNLQ/wQealuSTiNqRS2VwERtPDJFSXYZfzfFZ+qSw5o6AbUIcHfBNAHP4WfaPQ1D T/X7s X-Google-Smtp-Source: AGHT+IG5mndTc747tTjKNr21MFmDZNFY1zcsV/iDZHmV/9xvPHcPgJe0DpeJiPUJnhHATk7RTEQSPQ== X-Received: by 2002:a2e:bc22:0:b0:2f3:af4b:224 with SMTP id 38308e7fff4ca-2f7cb2f8e66mr13992091fa.8.1726820005594; Fri, 20 Sep 2024 01:13:25 -0700 (PDT) Received: from chromium.org ([83.68.141.146]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c42bc88cf7sm6804447a12.90.2024.09.20.01.13.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Sep 2024 01:13:24 -0700 (PDT) From: Simon Glass To: u-boot@lists.denx.de Cc: Simon Glass , Caleb Connolly , Nam Cao , =?utf-8?q?Thomas_Wei=C3=9Fschuh?= , Tom Rini , Tony Dinh Subject: [PATCH v2 03/18] bootstd: Avoid sprintf() in SPL when creating bootdevs Date: Fri, 20 Sep 2024 10:12:42 +0200 Message-ID: <20240920081309.140426-4-sjg@chromium.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240920081309.140426-1-sjg@chromium.org> References: <20240920081309.140426-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.8 at phobos.denx.de X-Virus-Status: Clean The name of the bootdev device is not that important, particular in SPL. Save a little code space by using a simpler name. Signed-off-by: Simon Glass --- (no changes since v1) boot/bootdev-uclass.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/boot/bootdev-uclass.c b/boot/bootdev-uclass.c index 807f8dfb064..79d4d990edb 100644 --- a/boot/bootdev-uclass.c +++ b/boot/bootdev-uclass.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -278,8 +279,13 @@ int bootdev_setup_for_sibling_blk(struct udevice *blk, const char *drv_name) int ret, len; len = bootdev_get_suffix_start(blk, ".blk"); - snprintf(dev_name, sizeof(dev_name), "%.*s.%s", len, blk->name, - "bootdev"); + if (spl_phase() < PHASE_BOARD_R) { + strncpy(dev_name, blk->name, sizeof(dev_name) - 5); + strcat(dev_name, ".sib"); + } else { + snprintf(dev_name, sizeof(dev_name), "%.*s.%s", len, blk->name, + "bootdev"); + } parent = dev_get_parent(blk); ret = device_find_child_by_name(parent, dev_name, &dev); From patchwork Fri Sep 20 08:12:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1987776 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org 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=OVFGYr+l; dkim-atps=neutral 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=patchwork.ozlabs.org) 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 (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4X94sS5ZsHz1y27 for ; Fri, 20 Sep 2024 18:13:48 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 523378941F; Fri, 20 Sep 2024 10:13:32 +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="OVFGYr+l"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 65654893BE; Fri, 20 Sep 2024 10:13:29 +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=ham autolearn_force=no version=3.4.2 Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [IPv6:2a00:1450:4864:20::62f]) (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 77922893CF for ; Fri, 20 Sep 2024 10:13:27 +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-ej1-x62f.google.com with SMTP id a640c23a62f3a-a8a837cec81so117143166b.2 for ; Fri, 20 Sep 2024 01:13:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1726820007; x=1727424807; darn=lists.denx.de; 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=jFRg3g07zPk9bQyiEd5iJfrn5GXmIn+TMto1AR2XNxI=; b=OVFGYr+lW5MZHzUOtcGFLW8lCKlYz8v8U35EUCslJ4OIhURwNsnWsVDq8tKp5mbFwB vIa0JZ6KDmvowRapt/CKjYPT78bRj8TEmvdQ2qoLYx80cig2wmT+EMt4WG+jhnqxtlCs qZ7DWlJ5ZtXGeelKXwR2rrVIuCznFErc/nje4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726820007; x=1727424807; 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=jFRg3g07zPk9bQyiEd5iJfrn5GXmIn+TMto1AR2XNxI=; b=Bc1gVUeKRYZgYxcMG4e3cE78JOAp2JVEEPtD/vycrbi2v8ViAaXBJN6v+ySBUxpwCc b6SjNJWm2T9HC7y4y57+3uXTQ7/KuBFZJYX6FvHrNTQ8Xt2ZKivk6v51ZdMp4ArABpYG uFIWpUWG1eGR5a0MOh3EUbrKXVl5rfLhNCspcENbYXAebbe+0Qgg5z9s8sWPJ6VuEJMS CxgMm1hMmk4ek5N7UlJ9yKGxAiFJ624dLM98W54FRBH5o9JHayrQ6Hd+HMhb9bIkDSLb uFgWiubl8664vmO9bTmtHvL29/3xOFVOYvJcPrVCGXXX46vNY2fj43+7Gl5VA1/8FltT A+0g== X-Gm-Message-State: AOJu0YxqNWY7pN5k7rMBaB988vX4XeNB3GpekEqN4ZvosfDkKM2Ed9HZ fYDqY5PgLRZfFfZG/sCDJBcjaoxfIJhgEg9U7ewGc3QzcEOGZPwqVYmHqMloqKFVJdYngVRjIqr cxI9q X-Google-Smtp-Source: AGHT+IFbyfT9JisrKPHLE3NIRaqYp/3F4aPh+GRSfZneZt5VU1Q+plV8tjsQ+a1uIdZpj/zoU+U9jA== X-Received: by 2002:a05:6402:3512:b0:5c2:5f24:98bd with SMTP id 4fb4d7f45d1cf-5c464a3cc68mr1772742a12.10.1726820006670; Fri, 20 Sep 2024 01:13:26 -0700 (PDT) Received: from chromium.org ([83.68.141.146]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c42bc88cf7sm6804447a12.90.2024.09.20.01.13.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Sep 2024 01:13:26 -0700 (PDT) From: Simon Glass To: u-boot@lists.denx.de Cc: Simon Glass , Igor Opaniuk , Ilias Apalodimas , Maxim Moskalets , Raymond Mao , Tom Rini Subject: [PATCH v2 04/18] boot: Respect the load_op in fit_image_load() Date: Fri, 20 Sep 2024 10:12:43 +0200 Message-ID: <20240920081309.140426-5-sjg@chromium.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240920081309.140426-1-sjg@chromium.org> References: <20240920081309.140426-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.8 at phobos.denx.de X-Virus-Status: Clean Some code has crept in which ignores this parameter. Fix this and add a little debugging. Signed-off-by: Simon Glass --- (no changes since v1) boot/image-fit.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/boot/image-fit.c b/boot/image-fit.c index 439ff51edf6..db7fb61bca9 100644 --- a/boot/image-fit.c +++ b/boot/image-fit.c @@ -2226,6 +2226,7 @@ int fit_image_load(struct bootm_headers *images, ulong addr, data = map_to_sysmem(buf); load = data; if (load_op == FIT_LOAD_IGNORED) { + log_debug("load_op: not loading\n"); /* Don't load */ } else if (fit_image_get_load(fit, noffset, &load)) { if (load_op == FIT_LOAD_REQUIRED) { @@ -2262,10 +2263,13 @@ int fit_image_load(struct bootm_headers *images, ulong addr, /* Kernel images get decompressed later in bootm_load_os(). */ if (!fit_image_get_comp(fit, noffset, &comp) && comp != IH_COMP_NONE && + load_op != FIT_LOAD_IGNORED && !(image_type == IH_TYPE_KERNEL || image_type == IH_TYPE_KERNEL_NOLOAD || image_type == IH_TYPE_RAMDISK)) { ulong max_decomp_len = len * 20; + + log_debug("decompressing image\n"); if (load == data) { loadbuf = malloc(max_decomp_len); load = map_to_sysmem(loadbuf); @@ -2280,6 +2284,7 @@ int fit_image_load(struct bootm_headers *images, ulong addr, } len = load_end - load; } else if (load != data) { + log_debug("copying\n"); loadbuf = map_sysmem(load, len); memcpy(loadbuf, buf, len); } @@ -2289,8 +2294,9 @@ int fit_image_load(struct bootm_headers *images, ulong addr, " please fix your .its file!\n"); /* verify that image data is a proper FDT blob */ - if (image_type == IH_TYPE_FLATDT && fdt_check_header(loadbuf)) { - puts("Subimage data is not a FDT"); + if (load_op != FIT_LOAD_IGNORED && image_type == IH_TYPE_FLATDT && + fdt_check_header(loadbuf)) { + puts("Subimage data is not a FDT\n"); return -ENOEXEC; } From patchwork Fri Sep 20 08:12:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1987779 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org 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=l3hz5jdN; dkim-atps=neutral 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=patchwork.ozlabs.org) 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 (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4X94t36mXhz1y27 for ; Fri, 20 Sep 2024 18:14:19 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7E1568944E; Fri, 20 Sep 2024 10:13:37 +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="l3hz5jdN"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8577989439; Fri, 20 Sep 2024 10:13:33 +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=ham autolearn_force=no version=3.4.2 Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [IPv6:2a00:1450:4864:20::533]) (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 886758940F for ; Fri, 20 Sep 2024 10:13:28 +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-ed1-x533.google.com with SMTP id 4fb4d7f45d1cf-5c42e7adbddso2178008a12.2 for ; Fri, 20 Sep 2024 01:13:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1726820008; x=1727424808; darn=lists.denx.de; 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=3TThT2ku9dh0XGAXrDsdzEXlzK8cu0L4jeKTpKeP1dY=; b=l3hz5jdN3rmAatGGxyFeOUUaARGHX3euUBo3B5849tPaBT9xsCPV7ANLOpeErqQ2Dx i1uTArJDHBfYzRPs41KN9HOZ9ZGLM/SnGRWbuHNZxfnFb/60HqEEubBNjstxVeeMIGbY gWe221kGuMO6cdXXQ4sw32JGT7pV+OG5ABTDU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726820008; x=1727424808; 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=3TThT2ku9dh0XGAXrDsdzEXlzK8cu0L4jeKTpKeP1dY=; b=C2biJEOqIfSdwqmODF3aIlDUUM4nENp79n0RWgZXAzgcCGKdDvujpXSo2dzlYjy/rR MFVmCif/m/YC01tp3BtZkmKav/MHuekFY5Ctp6K93xGCDo0zRxnzQADMPPtbPSjPMqgI G8Tts2VSb6+bcQRV6lq+CJYQAD7KiNDD6WLm5o2T9EKhgvrp1XjlVf8OPJAsfHCsslNm iDe0YYbvg5J4RPZSgCtwq7ENoS5xtHIL7bLzRfmc04/GSYwyBmspAtkf+kZ2FeVQXdxm CWQVOiaAlRgOPsAnIGlXAacs6jl0hzUu5C3zEOZzKXZo2Tm2JaOmzTU7+aXWxLIswyvo dvAA== X-Gm-Message-State: AOJu0YyQesdjTXNnDCxFjs7fgi7Oqvk1qoTBY0jzHFrIicBMF3NSTpB0 +mWpQQx6MImCwAGZETCg9Ycr94IqABtUqdkhVCKqTRoOEwHWx8ZigXik+UPuSoC1/ZInJbPAGxM qtzHe X-Google-Smtp-Source: AGHT+IEV3o5+faGmsa+QiGKd3x9hAE+cGczDwiMaDQqC4Y0Aq6nO83LNo0aVYzrIKr0UZBDyXB16Gg== X-Received: by 2002:a05:6402:50cf:b0:5c3:d16d:d1a8 with SMTP id 4fb4d7f45d1cf-5c464a7ee0dmr1197240a12.34.1726820007502; Fri, 20 Sep 2024 01:13:27 -0700 (PDT) Received: from chromium.org ([83.68.141.146]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c42bc88cf7sm6804447a12.90.2024.09.20.01.13.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Sep 2024 01:13:27 -0700 (PDT) From: Simon Glass To: u-boot@lists.denx.de Cc: Simon Glass , Tom Rini Subject: [PATCH v2 05/18] malloc: Show amount of used space when memory runs out Date: Fri, 20 Sep 2024 10:12:44 +0200 Message-ID: <20240920081309.140426-6-sjg@chromium.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240920081309.140426-1-sjg@chromium.org> References: <20240920081309.140426-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.8 at phobos.denx.de X-Virus-Status: Clean Show a bit more information when malloc() space is exhausted and debugging is enabled. Signed-off-by: Simon Glass --- Changes in v2: - Add field names into the message common/malloc_simple.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/malloc_simple.c b/common/malloc_simple.c index 5a8ec538f8f..f0f90a095bd 100644 --- a/common/malloc_simple.c +++ b/common/malloc_simple.c @@ -26,7 +26,8 @@ static void *alloc_simple(size_t bytes, int align) log_debug("size=%lx, ptr=%lx, limit=%x: ", (ulong)bytes, new_ptr, gd->malloc_limit); if (new_ptr > gd->malloc_limit) { - log_err("alloc space exhausted\n"); + log_err("alloc space exhausted ptr %lx limit %x\n", new_ptr, + gd->malloc_limit); return NULL; } From patchwork Fri Sep 20 08:12:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1987778 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org 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=ck6JrXtA; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4X94st2fz2z1y27 for ; Fri, 20 Sep 2024 18:14:10 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2726289444; Fri, 20 Sep 2024 10:13:37 +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="ck6JrXtA"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0CCC789436; Fri, 20 Sep 2024 10:13:33 +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=ham autolearn_force=no version=3.4.2 Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com [IPv6:2a00:1450:4864:20::534]) (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 EDF50893BE for ; Fri, 20 Sep 2024 10:13:29 +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-ed1-x534.google.com with SMTP id 4fb4d7f45d1cf-5c260b19f71so2057312a12.1 for ; Fri, 20 Sep 2024 01:13:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1726820009; x=1727424809; darn=lists.denx.de; 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=t75nPGp+HLjNQNLqqcJwJNLYwVOhsfQyUkV50PcqKzk=; b=ck6JrXtAiR91pLEQ/Ag675CHp8btMVGNz+QlDRdk12jeypPf69XMYUJk+kNusmS9/F Ss5je9zQ3T5lPdYOgIU6Fd/cAq47IxG3lgOkVIqlALwIzaZde+2nZKSYzi959Y2Ppd2w GTuNV6WSCAD4ruhO/85YaUUcLKs/OsW0wjdIc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726820009; x=1727424809; 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=t75nPGp+HLjNQNLqqcJwJNLYwVOhsfQyUkV50PcqKzk=; b=ttJuv6IWyhGT2Y1VNpLot32MOfo6IPXir0MU2W353Cc4MzweO3JVstGveI20o6SdP5 XwakPB4PPWIKEfjOQGkmq+mZQEz3Gv0Z3jdb1MKViN7wg8YYrRTWxSGsU9w8aQ3uXsV4 LS0XdoFOnXUwb8DKbU5/i3xu2oO+acTCTd6FgF8FWZqCtxeEaiocEnTW3PnH3eQZNkqm WpaQc1JpW0QfVk3JpJFwM94x3Yp4VKGVaHmwMtbrJliRYROMMx7O1ca8gLf3mvS89wCG F/+Z1LPhtGackDurrV+JH/7+cTgb5/USz+tZJVug3Upn4OEv6j5lbmIwTbd9vgVo/8SS u1/Q== X-Gm-Message-State: AOJu0Yyfs0a99hkRi/nuDiH76X/cMHzKHj82Hf3VQW5JjtFxA3fk2Dhu ST/0I5AKJMiKaWXLtlmeUJo6ZCHAwsXCQs1vBxxqEA3sWpY462RQbY/N6xdjKXNEd4wZ8z9KUMB eAt+H X-Google-Smtp-Source: AGHT+IFVe9orNGMjqxD2J3rwnq0cgjSbUrxqGOXM7ooZMe5F9uVXjnT7IjZ8OHckeKi1S7IkGPfguQ== X-Received: by 2002:a05:6402:2347:b0:5c2:6343:8ddf with SMTP id 4fb4d7f45d1cf-5c464df2910mr1247381a12.33.1726820009167; Fri, 20 Sep 2024 01:13:29 -0700 (PDT) Received: from chromium.org ([83.68.141.146]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c42bc88cf7sm6804447a12.90.2024.09.20.01.13.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Sep 2024 01:13:28 -0700 (PDT) From: Simon Glass To: u-boot@lists.denx.de Cc: Simon Glass , Gary Bisson , Mathieu Othacehe , Peng Fan , Tom Rini Subject: [PATCH v2 06/18] malloc: Provide a simple malloc for VPL Date: Fri, 20 Sep 2024 10:12:45 +0200 Message-ID: <20240920081309.140426-7-sjg@chromium.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240920081309.140426-1-sjg@chromium.org> References: <20240920081309.140426-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.8 at phobos.denx.de X-Virus-Status: Clean The VPL phase may want to use the smaller malloc() implementation, so add an option for this. Signed-off-by: Simon Glass --- (no changes since v1) common/spl/Kconfig.vpl | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/common/spl/Kconfig.vpl b/common/spl/Kconfig.vpl index d06f36d4ee4..3dc0e95e09f 100644 --- a/common/spl/Kconfig.vpl +++ b/common/spl/Kconfig.vpl @@ -222,6 +222,15 @@ config VPL_SPI_FLASH_SUPPORT lines). This enables the drivers in drivers/mtd/spi as part of a VPL build. This normally requires VPL_SPI_SUPPORT. +config VPL_SYS_MALLOC_SIMPLE + bool "Only use malloc_simple functions in the VPL" + default y + help + Say Y here to only use the *_simple malloc functions from + malloc_simple.c, rather then using the versions from dlmalloc.c; + this will make the VPL binary smaller at the cost of more heap + usage as the *_simple malloc functions do not re-use free-ed mem. + config VPL_TEXT_BASE hex "VPL Text Base" default 0x0 From patchwork Fri Sep 20 08:12:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1987780 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org 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=PAR44V5/; dkim-atps=neutral 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=patchwork.ozlabs.org) 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 (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4X94tF3Jdbz1y27 for ; Fri, 20 Sep 2024 18:14:29 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id ECF4A8940F; Fri, 20 Sep 2024 10:13:40 +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="PAR44V5/"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0776589452; Fri, 20 Sep 2024 10:13:38 +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=ham autolearn_force=no version=3.4.2 Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [IPv6:2a00:1450:4864:20::533]) (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 8FFA7893FE for ; Fri, 20 Sep 2024 10:13:31 +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-ed1-x533.google.com with SMTP id 4fb4d7f45d1cf-5c25f01879fso2148076a12.1 for ; Fri, 20 Sep 2024 01:13:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1726820011; x=1727424811; darn=lists.denx.de; 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=tnVxSmVd39vZkuV8QBZP65OCoMo6U+JFZsETny2GllI=; b=PAR44V5/nlgANvWvqn6fAT8gt3/RvCebAKtwxgRl/lx4jOs5eEz8i5l5YAAqwYHW2m 0VmoBR2AIlZjwB8896uSjVWL3G6cPqULSeKSYQgeRa4671+6tfGGusG9vTSoFu7xsmAf innAooG1q+ArdxfFxDzuujV6KfTvgA1a/XSts= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726820011; x=1727424811; 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=tnVxSmVd39vZkuV8QBZP65OCoMo6U+JFZsETny2GllI=; b=edG8oy77Dib2ulKTzypMifkw1YuVI4GqkkuQ1WemiBvC8wlrYv04v4+7mDHlciUsjq Eam+FuWzTlh8RL9Mgc759tQof6LsBTMcuw5BHi0W1pIVCJItkui8FHgi1XRjyrpqycLG l+ohkX8spVFV34bDoFNwBYeyAlqMcyH0JJ73k5S+Xx3QLyhSz2r/dlLUlSgDERCUQsJt BsttTPMvLuj4jBXAHODmtPoFYHhP+qtrmsytCqSzAq4+e+184LPVvDvqAJP6bNZNvxSM /E2cLsU5ngcJrSdKoW+CWImRC3Srh3py+KHrQBnHwpdVY4RjtDEEb3ubRQZk/UuKwWVc RZAw== X-Gm-Message-State: AOJu0YxT9Y75HNvbjxwFI9JdZNI0DR9oQ/IgZso2CTjTZxExuvuatA7T cgX7Otodqy8Vsw6cBJCresaOMzsPndz+rwc6N+ZedTwcTTs4X/UJDAY60poIIC8Px+7uNTjUy5d QAzfS X-Google-Smtp-Source: AGHT+IE739+SjSOWxlaT80zAhza3R0RW+EDNI7R9vw3/8zoPymDrfnAtHxZZPka2N21bPOBg53kHQw== X-Received: by 2002:a05:6402:1ec1:b0:5c2:7727:6109 with SMTP id 4fb4d7f45d1cf-5c464a7f49emr1118771a12.30.1726820010836; Fri, 20 Sep 2024 01:13:30 -0700 (PDT) Received: from chromium.org ([83.68.141.146]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c42bc88cf7sm6804447a12.90.2024.09.20.01.13.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Sep 2024 01:13:29 -0700 (PDT) From: Simon Glass To: u-boot@lists.denx.de Cc: Simon Glass , Gary Bisson , Mathieu Othacehe , Peng Fan , Tom Rini Subject: [PATCH v2 07/18] Support setting a maximum size for the VPL image Date: Fri, 20 Sep 2024 10:12:46 +0200 Message-ID: <20240920081309.140426-8-sjg@chromium.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240920081309.140426-1-sjg@chromium.org> References: <20240920081309.140426-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.8 at phobos.denx.de X-Virus-Status: Clean Add a size limit for VPL, to match those for SPL and TPL Signed-off-by: Simon Glass --- (no changes since v1) common/spl/Kconfig.vpl | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/common/spl/Kconfig.vpl b/common/spl/Kconfig.vpl index 3dc0e95e09f..eb57dfabea5 100644 --- a/common/spl/Kconfig.vpl +++ b/common/spl/Kconfig.vpl @@ -237,6 +237,14 @@ config VPL_TEXT_BASE help The address in memory that VPL will be running from. +config VPL_MAX_SIZE + hex "Maximum size (in bytes) for the VPL stage" + default 0x2e000 if ROCKCHIP_RK3399 + default 0x0 + help + The maximum size (in bytes) of the TPL stage. This size is determined + by the amount of internal SRAM memory. + config VPL_BINMAN_SYMBOLS bool "Declare binman symbols in VPL" depends on VPL_FRAMEWORK && BINMAN From patchwork Fri Sep 20 08:12:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1987781 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org 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=ccNk0t8t; dkim-atps=neutral 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=patchwork.ozlabs.org) 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 (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4X94tQ4xNcz1y27 for ; Fri, 20 Sep 2024 18:14:38 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4EC6E89437; Fri, 20 Sep 2024 10:13:41 +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="ccNk0t8t"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B1B1F893BE; Fri, 20 Sep 2024 10:13:38 +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=ham autolearn_force=no version=3.4.2 Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com [IPv6:2a00:1450:4864:20::52f]) (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 72DBB89438 for ; Fri, 20 Sep 2024 10:13:33 +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-ed1-x52f.google.com with SMTP id 4fb4d7f45d1cf-5c3d209db94so2234054a12.3 for ; Fri, 20 Sep 2024 01:13:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1726820013; x=1727424813; darn=lists.denx.de; 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=bfb3fVBRE4QDu7o1T45Lr8rikHqKiUqDfbNjYxtDrx4=; b=ccNk0t8t9UtOn1VYsxEA2l0n7/Ml3zql+nb2WSLXJ6Zco90EEGHT74dxJiK048FyPj 6sC6WKsKO02HR7k2CEG3GLQto+VNn8B7hsQhyC7yWC28haQWkuc+/NkHOpFGaMhxtt84 PkMJtXgBNKVVEqfpKon5ZChohLcO0MAtxw2Hw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726820013; x=1727424813; 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=bfb3fVBRE4QDu7o1T45Lr8rikHqKiUqDfbNjYxtDrx4=; b=WEGAJKfzB6PfzWgoGxtBgsi4F9e+IZkEprjyThjVmws8qa6ABF+c8MTmRHq2EcwH6S SZe6c2is4pzo/dp3819ijNJagxKmcmgAPNDhTFOSomE5I2zLG/2Kovzvl7eD7GGsXi3n g4csn3iicvL9v9tY91BY3ziRYGVi4NaRpNZ56EMHVIP2kFxIhGhIbSHwNaMb7SRMCj0x JR0sz/GH8Ddm3cAcuhcx6VgytCtLUUA0VCb1qH7ofMqhJTYfdgZuZ9eKBEyY8eCQ0wsc iW5V2ywjV2hBuw2jD254DmscLXOMv61U3JkuJqGzw+O15yKAZybJarQ++ZaFVRjoTDGM 4oUg== X-Gm-Message-State: AOJu0YymJdoOj3ln4AeMQ0GJKpirGSzN08Eq7XXBwU5/h1VzvpKNnRiV RYIIM9WtwRxLLm5OPZ5rfTedWpuDaCAw6qeV38J1wfroEZ2S/nmFWr4LPpbMaEWZPiO9KD2p5XO DLanv X-Google-Smtp-Source: AGHT+IGxx6eaOUcO63+zHbA+wN3m8pp04eFd+52iXAI+AlkoYd71xCuz/829N/I4fnJmwdJNqifZFw== X-Received: by 2002:a05:6402:5c8:b0:5bf:fb:33b8 with SMTP id 4fb4d7f45d1cf-5c464dfbcf3mr1510441a12.34.1726820012590; Fri, 20 Sep 2024 01:13:32 -0700 (PDT) Received: from chromium.org ([83.68.141.146]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c42bc88cf7sm6804447a12.90.2024.09.20.01.13.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Sep 2024 01:13:32 -0700 (PDT) From: Simon Glass To: u-boot@lists.denx.de Cc: Simon Glass , Devarsh Thakkar , Quentin Schulz , Sean Anderson , Sughosh Ganu , Tom Rini Subject: [PATCH v2 08/18] spl: Report a loader failure Date: Fri, 20 Sep 2024 10:12:47 +0200 Message-ID: <20240920081309.140426-9-sjg@chromium.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240920081309.140426-1-sjg@chromium.org> References: <20240920081309.140426-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.8 at phobos.denx.de X-Virus-Status: Clean If a loader returns an error code it is silently ignored. Show a message to at least provide some feedback to the user. Signed-off-by: Simon Glass --- (no changes since v1) common/spl/spl.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/common/spl/spl.c b/common/spl/spl.c index c13b2b8f714..ecd90169f65 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -613,6 +613,7 @@ static int boot_from_devices(struct spl_image_info *spl_image, for (i = 0; i < count && spl_boot_list[i] != BOOT_DEVICE_NONE; i++) { struct spl_image_loader *loader; int bootdev = spl_boot_list[i]; + int ret; if (CONFIG_IS_ENABLED(SHOW_ERRORS)) ret = -ENXIO; @@ -632,10 +633,13 @@ static int boot_from_devices(struct spl_image_info *spl_image, "Unsupported Boot Device!\n"); } } - if (loader && - !spl_load_image(spl_image, loader)) { - spl_image->boot_device = bootdev; - return 0; + if (loader) { + ret = spl_load_image(spl_image, loader); + if (!ret) { + spl_image->boot_device = bootdev; + return 0; + } + printf("Error: %d\n", ret); } } } From patchwork Fri Sep 20 08:12:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1987784 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org 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=X545beM4; dkim-atps=neutral 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=patchwork.ozlabs.org) 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 (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4X94tz687Gz1xrD for ; Fri, 20 Sep 2024 18:15:07 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 81DFF8945C; Fri, 20 Sep 2024 10:13:44 +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="X545beM4"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1F72889449; Fri, 20 Sep 2024 10:13:42 +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=ham autolearn_force=no version=3.4.2 Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) (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 632D28943C for ; Fri, 20 Sep 2024 10:13:34 +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-ej1-x629.google.com with SMTP id a640c23a62f3a-a8a789c4fc5so485593166b.0 for ; Fri, 20 Sep 2024 01:13:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1726820013; x=1727424813; darn=lists.denx.de; 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=it/pukHPW881bhR7MBvKN39WW2isL3vaWa/swL+ElqI=; b=X545beM4WiCHiw6OZ27S/Mg7KcRUtAlE+74OepqkVFTVaK8R31WttgZFBF1pT+4AGJ VV/7WCErBwlcv9BTKJJrWuEb1jBDtK+ZOHCyVoRcTyI1Ieb/7uiTJgNWHJAfaRRhqXbs cQno+pzktiJXjwpGtGJrJXI2gWem07SKv5cmY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726820013; x=1727424813; 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=it/pukHPW881bhR7MBvKN39WW2isL3vaWa/swL+ElqI=; b=FP/7mp4M2AdsjiYux/pvLHqZHIpadLIWApSFmP7dfcyhf9/mQ269n9nLCUOWYa4OR1 hxfrZZZ/Y34s4GScuKYqe4u9Tuj/+pczTypxs/p3muhLBO8TbJSRbZIsFHGbf2fF9FKQ Roq2CH8B6SaITY8OKSJXyU75kpdEbc4Pk3C0Qy62y2JCS4OwInLmQsP3V4JMAkAilalV cXguFbKpL2HetWX6hvbbDcQUVvdVIS2AZXm5qnXHplkYl/lAR609lUmSTRPCQwJO+KoA 06cY6eO08UhitdQbjpO1XKoG7nPVM8XdxcW4xH0tdQpLOW+2E0bVwXm9JYTu3TNqzVN7 hVVw== X-Gm-Message-State: AOJu0YxY/73Xp1P4bQTzvPOLh1zvfAmCuCCtuqMsFmgT5wwR5J3S1WtO ykZ++oOZ1McKoTGPuO9krpzA4ytjEsrCgEFPApX2lsbNJ4BS5SWdmYqh71Y4KJNlXYk+kw+PuZi xHmua X-Google-Smtp-Source: AGHT+IEBDsOLcVlKjRw2IxLXpnebXgewXAomw8p71OPUW4FQSm4+SZZ5cXQ0gvCmXEmGfqmycSc7sA== X-Received: by 2002:a17:907:268e:b0:a8a:754a:e1c1 with SMTP id a640c23a62f3a-a90c1c73fabmr586179866b.8.1726820013592; Fri, 20 Sep 2024 01:13:33 -0700 (PDT) Received: from chromium.org ([83.68.141.146]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c42bc88cf7sm6804447a12.90.2024.09.20.01.13.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Sep 2024 01:13:33 -0700 (PDT) From: Simon Glass To: u-boot@lists.denx.de Cc: Simon Glass , Devarsh Thakkar , Quentin Schulz , Sean Anderson , Sughosh Ganu , Tom Rini Subject: [PATCH v2 09/18] spl: Allow serial to be disabled in any XPL phase Date: Fri, 20 Sep 2024 10:12:48 +0200 Message-ID: <20240920081309.140426-10-sjg@chromium.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240920081309.140426-1-sjg@chromium.org> References: <20240920081309.140426-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.8 at phobos.denx.de X-Virus-Status: Clean The current check looks only at SPL, but TPL or VPL might have a different setting. Update the condition. Signed-off-by: Simon Glass --- (no changes since v1) common/spl/spl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/spl/spl.c b/common/spl/spl.c index ecd90169f65..89a972dfc84 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -840,7 +840,7 @@ void board_init_r(gd_t *dummy1, ulong dummy2) */ void preloader_console_init(void) { -#ifdef CONFIG_SPL_SERIAL +#if CONFIG_IS_ENABLED(SERIAL) gd->baudrate = CONFIG_BAUDRATE; serial_init(); /* serial communications setup */ From patchwork Fri Sep 20 08:12:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1987782 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org 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=ZixXD5/e; dkim-atps=neutral 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=patchwork.ozlabs.org) 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 (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4X94tc36VXz1y27 for ; Fri, 20 Sep 2024 18:14:48 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B60738943E; Fri, 20 Sep 2024 10:13:41 +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="ZixXD5/e"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4849B893C5; Fri, 20 Sep 2024 10:13:40 +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=ham autolearn_force=no version=3.4.2 Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com [IPv6:2a00:1450:4864:20::12b]) (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 93D3B89432 for ; Fri, 20 Sep 2024 10:13:36 +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-lf1-x12b.google.com with SMTP id 2adb3069b0e04-53654e2ed93so2115684e87.0 for ; Fri, 20 Sep 2024 01:13:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1726820016; x=1727424816; darn=lists.denx.de; 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=lTTlPOQegg+W2L1ratawWn2FyL+LYPrJ5I8rHrlN8Bw=; b=ZixXD5/ePW8ulc2Mr8mJRq0nVa1QuhSci/7wLdqJuJVijivmuzKRsssh2wnqTK4xui fNwjdbXrQiPVfr9f1pxtVVgrdy5OzQNILvHGhMnGecfzLTuUEDsynj3OVxyL1B01Eb3b xMT1PoalHliOeFQXsmSRNL/rQyZpBZrXiDiPA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726820016; x=1727424816; 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=lTTlPOQegg+W2L1ratawWn2FyL+LYPrJ5I8rHrlN8Bw=; b=DDGBRKjWUuRB8s3REqW6GiCYq0vViuUdXfMHsW29I+66X7g9PVqB7Y3SPLWr7yqtXQ 5nNC8gjYrlzUjU6Fl5iioJKqI1L/w239ZAY1o8u3kdZBxCsCqAQcNYELghlamn21zaNd AQ28aB0aCIWq/wk1T5Pk64fqQdyYVaxTaBT8gpneptmj+dfYtDd3rk4GxKehoaZm4+RA 8YmAwgJ64S7WGpw+tvZR+T915uiY18nLFrhDYEc2i67Y38jn4/OH2MQYj1h9wINWRsu1 sNSjVEoCxtg450ltgHBLOlNceblP1ZpBcX1QoBbjstplBDq5PP0i9/MEC+yuX7yb7E9n 4HYA== X-Gm-Message-State: AOJu0YwWjMsD5//+T7W6s/2OPrgMMsfd0G6JLnnjhCZiguO3u4SkNFOW 5jlQeegl/C/wT37B4LHQcAZtd4NkVqhfNEf0pmgoLvMwrR6XX1SUq87ZmpnQIvCxZ4utWnabCIn hbHvc X-Google-Smtp-Source: AGHT+IGG5cqTGbJTME8YBj5Qdpyt3wutQGozhJW0aG3sKKdUgwWbNM9byRfcQQ3Cvm8vJcXBZ7d73g== X-Received: by 2002:a05:6512:ba2:b0:536:554a:b9c8 with SMTP id 2adb3069b0e04-536ad3d4ed8mr1113464e87.54.1726820015355; Fri, 20 Sep 2024 01:13:35 -0700 (PDT) Received: from chromium.org ([83.68.141.146]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c42bc88cf7sm6804447a12.90.2024.09.20.01.13.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Sep 2024 01:13:35 -0700 (PDT) From: Simon Glass To: u-boot@lists.denx.de Cc: Simon Glass , Devarsh Thakkar , Quentin Schulz , Sean Anderson , Sughosh Ganu , Tom Rini Subject: [PATCH v2 10/18] spl: Support a relocated stack in any XPL phase Date: Fri, 20 Sep 2024 10:12:49 +0200 Message-ID: <20240920081309.140426-11-sjg@chromium.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240920081309.140426-1-sjg@chromium.org> References: <20240920081309.140426-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.8 at phobos.denx.de X-Virus-Status: Clean The current check looks only at SPL, but TPL or VPL might have a different setting. Update the condition. Signed-off-by: Simon Glass --- (no changes since v1) common/spl/spl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/spl/spl.c b/common/spl/spl.c index 89a972dfc84..3f432d0fa7a 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -899,7 +899,7 @@ __weak void spl_relocate_stack_check(void) */ ulong spl_relocate_stack_gd(void) { -#ifdef CONFIG_SPL_STACK_R +#if CONFIG_IS_ENABLED(STACK_R) gd_t *new_gd; ulong ptr = CONFIG_SPL_STACK_R_ADDR; From patchwork Fri Sep 20 08:12:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1987783 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org 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=axxfsIuL; dkim-atps=neutral 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=patchwork.ozlabs.org) 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 (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4X94tp0Wqmz1y1t for ; Fri, 20 Sep 2024 18:14:58 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1E2DE89456; Fri, 20 Sep 2024 10:13:44 +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="axxfsIuL"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C4A24893FE; Fri, 20 Sep 2024 10:13:41 +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-ed1-x52d.google.com (mail-ed1-x52d.google.com [IPv6:2a00:1450:4864:20::52d]) (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 5E7DB89449 for ; Fri, 20 Sep 2024 10:13:37 +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-ed1-x52d.google.com with SMTP id 4fb4d7f45d1cf-5c46680a71bso396525a12.2 for ; Fri, 20 Sep 2024 01:13:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1726820016; x=1727424816; darn=lists.denx.de; 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=diXCyDopFFvUJSN0rD4GC7RAOWgVv7+UdyCXvWL7ZcA=; b=axxfsIuLsDXJ5Riqcw1YtEjnjxza3RdBz1YM1iN4iQY5NaQshv0rv1h+J+LYbB07IN dZaTy6v28oHqCI7G0Pd///qlSLWfMCfecbVAoXpzaGsf/vTPGZIY2KXrpIClH155O3z3 NmgeTywg4e9/lsgqd8M0r5VsI9PyGFbCbJ/8c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726820016; x=1727424816; 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=diXCyDopFFvUJSN0rD4GC7RAOWgVv7+UdyCXvWL7ZcA=; b=r6K1Cg+5k4PvINrO67TP46UaAj2mGYyAQx6ufgcnQiD7xK1dXFd5s5FU7fvhJpbYIN rOtMKHfehu7pHWiX4Q58yEryKsU4i+SOO0jzUdNhTwR8c6+BRsZrFKsi1RGvKuA3r2A+ LwymcCwxwb38JTMtOWtI+Iwb7f3kOBydF9pTJrUlpekv6+jGQLEIFZZ3x+AW/4DRevWl VHw6RcZBcbmqTBht4uumd4lmAMNLZkwlWVdNCp6Mgl7Vz62TlUoW+hdAInBGYP4u3wHt a1dlfNSXyzEvxyIOPk3w02vTyUJ1NGspZdMyLsE6SwhDVFKtL2679RUTUON6KU1v1AIh DcAw== X-Gm-Message-State: AOJu0YxxyLo8bfBJshNuO/TNDfMVFXlVePFkZ0Da1Bepf+9Qr3glWg8p 9aYM68K2L4Th7xBmfxpNziaM50hIaToZQeQxF9TFyPv5VM3Kf25SD6IpVfu9t4EO0mqDHnGSKGe moXA5 X-Google-Smtp-Source: AGHT+IHOG89FiJvCNwHucVFCaPil2QXCrwva2/G14c9hFAor9yLKfi+kvA40WXzKqassbC7bfw1JHg== X-Received: by 2002:a05:6402:5113:b0:5c4:51b3:d75f with SMTP id 4fb4d7f45d1cf-5c464a56a48mr1163644a12.24.1726820016561; Fri, 20 Sep 2024 01:13:36 -0700 (PDT) Received: from chromium.org ([83.68.141.146]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c42bc88cf7sm6804447a12.90.2024.09.20.01.13.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Sep 2024 01:13:36 -0700 (PDT) From: Simon Glass To: u-boot@lists.denx.de Cc: Simon Glass , Chanho Park , Kever Yang , Manoj Sai , Marek Vasut , Sean Anderson , Suniel Mahesh , Tom Rini Subject: [PATCH v2 11/18] spl: Drop use of uintptr_t Date: Fri, 20 Sep 2024 10:12:50 +0200 Message-ID: <20240920081309.140426-12-sjg@chromium.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240920081309.140426-1-sjg@chromium.org> References: <20240920081309.140426-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.8 at phobos.denx.de X-Virus-Status: Clean U-Boot uses ulong for addresses. It is confusing to use uintptr_t in a few places, since it makes people wonder if the types are compatible. Change the few occurences in SPL to use ulong Signed-off-by: Simon Glass --- (no changes since v1) common/spl/spl_atf.c | 36 ++++++++++++++++++------------------ common/spl/spl_fit.c | 2 +- common/spl/spl_legacy.c | 8 ++++---- include/spl.h | 28 ++++++++++++++-------------- 4 files changed, 37 insertions(+), 37 deletions(-) diff --git a/common/spl/spl_atf.c b/common/spl/spl_atf.c index 0397b86a33b..8bc5db77395 100644 --- a/common/spl/spl_atf.c +++ b/common/spl/spl_atf.c @@ -41,9 +41,9 @@ struct bl2_to_bl31_params_mem_v2 { struct entry_point_info bl31_ep_info; }; -struct bl31_params *bl2_plat_get_bl31_params_default(uintptr_t bl32_entry, - uintptr_t bl33_entry, - uintptr_t fdt_addr) +struct bl31_params *bl2_plat_get_bl31_params_default(ulong bl32_entry, + ulong bl33_entry, + ulong fdt_addr) { static struct bl2_to_bl31_params_mem bl31_params_mem; struct bl31_params *bl2_to_bl31_params; @@ -100,17 +100,17 @@ struct bl31_params *bl2_plat_get_bl31_params_default(uintptr_t bl32_entry, return bl2_to_bl31_params; } -__weak struct bl31_params *bl2_plat_get_bl31_params(uintptr_t bl32_entry, - uintptr_t bl33_entry, - uintptr_t fdt_addr) +__weak struct bl31_params *bl2_plat_get_bl31_params(ulong bl32_entry, + ulong bl33_entry, + ulong fdt_addr) { return bl2_plat_get_bl31_params_default(bl32_entry, bl33_entry, fdt_addr); } -struct bl_params *bl2_plat_get_bl31_params_v2_default(uintptr_t bl32_entry, - uintptr_t bl33_entry, - uintptr_t fdt_addr) +struct bl_params *bl2_plat_get_bl31_params_v2_default(ulong bl32_entry, + ulong bl33_entry, + ulong fdt_addr) { static struct bl2_to_bl31_params_mem_v2 bl31_params_mem; struct bl_params *bl_params; @@ -173,9 +173,9 @@ struct bl_params *bl2_plat_get_bl31_params_v2_default(uintptr_t bl32_entry, return bl_params; } -__weak struct bl_params *bl2_plat_get_bl31_params_v2(uintptr_t bl32_entry, - uintptr_t bl33_entry, - uintptr_t fdt_addr) +__weak struct bl_params *bl2_plat_get_bl31_params_v2(ulong bl32_entry, + ulong bl33_entry, + ulong fdt_addr) { return bl2_plat_get_bl31_params_v2_default(bl32_entry, bl33_entry, fdt_addr); @@ -188,8 +188,8 @@ static inline void raw_write_daif(unsigned int daif) typedef void __noreturn (*atf_entry_t)(struct bl31_params *params, void *plat_params); -static void __noreturn bl31_entry(uintptr_t bl31_entry, uintptr_t bl32_entry, - uintptr_t bl33_entry, uintptr_t fdt_addr) +static void __noreturn bl31_entry(ulong bl31_entry, ulong bl32_entry, + ulong bl33_entry, ulong fdt_addr) { atf_entry_t atf_entry = (atf_entry_t)bl31_entry; void *bl31_params; @@ -238,7 +238,7 @@ static int spl_fit_images_find(void *blob, int os) return -FDT_ERR_NOTFOUND; } -uintptr_t spl_fit_images_get_entry(void *blob, int node) +ulong spl_fit_images_get_entry(void *blob, int node) { ulong val; int ret; @@ -253,10 +253,10 @@ uintptr_t spl_fit_images_get_entry(void *blob, int node) void __noreturn spl_invoke_atf(struct spl_image_info *spl_image) { - uintptr_t bl32_entry = 0; - uintptr_t bl33_entry = CONFIG_TEXT_BASE; + ulong bl32_entry = 0; + ulong bl33_entry = CONFIG_TEXT_BASE; void *blob = spl_image->fdt_addr; - uintptr_t platform_param = (uintptr_t)blob; + ulong platform_param = (ulong)blob; int node; /* diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c index 1ad5a69d807..614dea9ae18 100644 --- a/common/spl/spl_fit.c +++ b/common/spl/spl_fit.c @@ -862,7 +862,7 @@ int spl_load_fit_image(struct spl_image_info *spl_image, { struct bootm_headers images; const char *fit_uname_config = NULL; - uintptr_t fdt_hack; + ulong fdt_hack; const char *uname; ulong fw_data = 0, dt_data = 0, img_data = 0; ulong fw_len = 0, dt_len = 0, img_len = 0; diff --git a/common/spl/spl_legacy.c b/common/spl/spl_legacy.c index a77893455f2..3af7ea33ae9 100644 --- a/common/spl/spl_legacy.c +++ b/common/spl/spl_legacy.c @@ -16,11 +16,11 @@ #define LZMA_LEN (1 << 20) -static void spl_parse_legacy_validate(uintptr_t start, uintptr_t size) +static void spl_parse_legacy_validate(ulong start, ulong size) { - uintptr_t spl_start = (uintptr_t)_start; - uintptr_t spl_end = (uintptr_t)&_image_binary_end; - uintptr_t end = start + size; + ulong spl_start = (ulong)_start; + ulong spl_end = (ulong)&_image_binary_end; + ulong end = start + size; if ((start >= spl_start && start < spl_end) || (end > spl_start && end <= spl_end) || diff --git a/include/spl.h b/include/spl.h index de808ccd413..d90eed956af 100644 --- a/include/spl.h +++ b/include/spl.h @@ -256,8 +256,8 @@ enum spl_sandbox_flags { struct spl_image_info { const char *name; u8 os; - uintptr_t load_addr; - uintptr_t entry_point; + ulong load_addr; + ulong entry_point; #if CONFIG_IS_ENABLED(LOAD_FIT) || CONFIG_IS_ENABLED(LOAD_FIT_FULL) void *fdt_addr; #endif @@ -939,9 +939,9 @@ void __noreturn spl_invoke_atf(struct spl_image_info *spl_image); * * Return: bl31 params structure pointer */ -struct bl31_params *bl2_plat_get_bl31_params(uintptr_t bl32_entry, - uintptr_t bl33_entry, - uintptr_t fdt_addr); +struct bl31_params *bl2_plat_get_bl31_params(ulong bl32_entry, + ulong bl33_entry, + ulong fdt_addr); /** * bl2_plat_get_bl31_params_default() - prepare params for bl31. @@ -960,9 +960,9 @@ struct bl31_params *bl2_plat_get_bl31_params(uintptr_t bl32_entry, * * Return: bl31 params structure pointer */ -struct bl31_params *bl2_plat_get_bl31_params_default(uintptr_t bl32_entry, - uintptr_t bl33_entry, - uintptr_t fdt_addr); +struct bl31_params *bl2_plat_get_bl31_params_default(ulong bl32_entry, + ulong bl33_entry, + ulong fdt_addr); /** * bl2_plat_get_bl31_params_v2() - return params for bl31 @@ -976,9 +976,9 @@ struct bl31_params *bl2_plat_get_bl31_params_default(uintptr_t bl32_entry, * * Return: bl31 params structure pointer */ -struct bl_params *bl2_plat_get_bl31_params_v2(uintptr_t bl32_entry, - uintptr_t bl33_entry, - uintptr_t fdt_addr); +struct bl_params *bl2_plat_get_bl31_params_v2(ulong bl32_entry, + ulong bl33_entry, + ulong fdt_addr); /** * bl2_plat_get_bl31_params_v2_default() - prepare params for bl31. @@ -995,9 +995,9 @@ struct bl_params *bl2_plat_get_bl31_params_v2(uintptr_t bl32_entry, * * Return: bl31 params structure pointer */ -struct bl_params *bl2_plat_get_bl31_params_v2_default(uintptr_t bl32_entry, - uintptr_t bl33_entry, - uintptr_t fdt_addr); +struct bl_params *bl2_plat_get_bl31_params_v2_default(ulong bl32_entry, + ulong bl33_entry, + ulong fdt_addr); /** * spl_optee_entry - entry function for optee * From patchwork Fri Sep 20 08:12:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1987789 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org 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=KHDAdulm; dkim-atps=neutral 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=patchwork.ozlabs.org) 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 (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4X94vy3Jknz1xrD for ; Fri, 20 Sep 2024 18:15:58 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 616B289445; Fri, 20 Sep 2024 10:13:57 +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="KHDAdulm"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id AB82089445; Fri, 20 Sep 2024 10:13:56 +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=ham autolearn_force=no version=3.4.2 Received: from mail-lj1-x22e.google.com (mail-lj1-x22e.google.com [IPv6:2a00:1450:4864:20::22e]) (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 BE260893BE for ; Fri, 20 Sep 2024 10:13:39 +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-lj1-x22e.google.com with SMTP id 38308e7fff4ca-2f75c6ed397so19603921fa.2 for ; Fri, 20 Sep 2024 01:13:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1726820019; x=1727424819; darn=lists.denx.de; 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=Sngx/D9F4PwcGCUI+gO0BlU+bHlIHERBjQcnW0FsO6I=; b=KHDAdulmozqgndPbeocrvl+VEoQQTbm+BzwIT3GQqIwpXmi7yeCRED+JZYSMvy5LA5 ox+BSkCKAkGtWdFyjRcBYVV7MzkHxmnTPkB4wPnAoUhn/GuNkGSpM7aHZaMWY2EcmT0N GbsH75OkySFgUJDafQK4rZnlC3ggFvq6zgwAQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726820019; x=1727424819; 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=Sngx/D9F4PwcGCUI+gO0BlU+bHlIHERBjQcnW0FsO6I=; b=DDYVusjbPgCJ5jELriCV5H1cCxJhaxeBRdugxfMgIGEOuSK+H3I9/c6K/uOdnVNd6S +CmitXEk1N50b9VrODxyAI9f+DhyqwT1frRslJthc3XY8Huy6R4gda33Lxv9chIRyqfh ny9OFn7C2qkxDArmdKmZE/TEPLVvTfO9Twp3m5BFrcWd2YZJynBoKnPcOMPmjKT3SIIw HPWDgors1ykigbD3A6sL+ZkuCeE8kGJe1QHUFQTdaurT7Q/SVYTBalofTKkhUlSFvSAB kBtu6Izv6xVVcO3nb25zpfKLU0QWIokWiEmvpNK1wI6OkmTjVLrtk+BoE6GFNqYZJG4Z avEQ== X-Gm-Message-State: AOJu0YxSlIEMDUjSn2LvO/B43dAMTNwKM+dblabYBp4xpvB68CVfSiSl PJHkB8rgeg3c5wbmPsoRkdba8N+5WcIk5UlIjl/FgN1kMXv1IzlJxyyj/AVk2DrgXeBxRl5diNn GRzG9 X-Google-Smtp-Source: AGHT+IHQaIUWwWnexHV22Im24HO817Elk1zuVDHP895rgYBk/T5cm5L6RsvUWo5rACmOuwxYlwRN7g== X-Received: by 2002:a2e:bc06:0:b0:2f7:939f:a49d with SMTP id 38308e7fff4ca-2f7cc375d60mr9379661fa.24.1726820018782; Fri, 20 Sep 2024 01:13:38 -0700 (PDT) Received: from chromium.org ([83.68.141.146]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c42bc88cf7sm6804447a12.90.2024.09.20.01.13.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Sep 2024 01:13:38 -0700 (PDT) From: Simon Glass To: u-boot@lists.denx.de Cc: Simon Glass , Devarsh Thakkar , Quentin Schulz , Sean Anderson , Sughosh Ganu , Tom Rini Subject: [PATCH v2 12/18] spl: Drop a duplicate variable in boot_from_devices() Date: Fri, 20 Sep 2024 10:12:51 +0200 Message-ID: <20240920081309.140426-13-sjg@chromium.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240920081309.140426-1-sjg@chromium.org> References: <20240920081309.140426-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.8 at phobos.denx.de X-Virus-Status: Clean The variable 'ret' is defined twice, which is not intended. This may have been a local merge error. Signed-off-by: Simon Glass Fixes: 2eefeb6d893 ("spl: Report a loader failure") --- (no changes since v1) common/spl/spl.c | 1 - 1 file changed, 1 deletion(-) diff --git a/common/spl/spl.c b/common/spl/spl.c index 3f432d0fa7a..75938aa63cc 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -613,7 +613,6 @@ static int boot_from_devices(struct spl_image_info *spl_image, for (i = 0; i < count && spl_boot_list[i] != BOOT_DEVICE_NONE; i++) { struct spl_image_loader *loader; int bootdev = spl_boot_list[i]; - int ret; if (CONFIG_IS_ENABLED(SHOW_ERRORS)) ret = -ENXIO; From patchwork Fri Sep 20 08:12:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1987785 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org 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=Itbn6uUL; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4X94vB40fQz1xrD for ; Fri, 20 Sep 2024 18:15:18 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id DDD2B893FE; Fri, 20 Sep 2024 10:13:46 +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="Itbn6uUL"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E7FD489456; Fri, 20 Sep 2024 10:13:43 +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=ham autolearn_force=no version=3.4.2 Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com [IPv6:2a00:1450:4864:20::52e]) (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 EF2F1893FE for ; Fri, 20 Sep 2024 10:13:41 +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-ed1-x52e.google.com with SMTP id 4fb4d7f45d1cf-5c25554ec1eso2296440a12.1 for ; Fri, 20 Sep 2024 01:13:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1726820021; x=1727424821; darn=lists.denx.de; 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=dqrR2g4vRbRxqTzt6nDklN7XppB6y0QBRyTd5zPGYqE=; b=Itbn6uULMUtYX2j6hZqmso8OMagkNOfRF8RNQwfxZee6PFsxrIiCFEHJKm+kaNpXsB WEbHG5M85JWONY1vfyhJrMPSNXEecaD1mEWvz9T/2JIVdy+yAF8g5TPFVf41MLl5NP0i PcBY/QnoOxd0yb7k0W1hvEOdB8f9L9dGLLZN4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726820021; x=1727424821; 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=dqrR2g4vRbRxqTzt6nDklN7XppB6y0QBRyTd5zPGYqE=; b=nHQgntM4hEHlMc5UVAP9gvDOKMPtvnJXbzwoOnJZ+gN5EbNWT+kJwNwUGPO86vqADY vM6hdKijG+1C1MQXEYBeTbW7wwkQ3FIQszoB0nTpMr2zHPBe44AthhofRF9t30uOD2a4 JOZoqiPNO9ZDB/Tqh4zM2R856xXjx5B6ZY7ochdphxBD9bPRNUqQbQSOm6UB2ABvd7b9 O4vr2hrGdgw/riJvtOJ1jhKQL8cVoWNtTkZthXxIegIYc1v018yOgSSnZV6GiRRwCvtQ 3uhDsOVA4it1I6yt/wCxKDmFGTxFkkIIJ5WOYJr4XQErTQwlbS38LrXJp07bKk+8CTYG e94w== X-Gm-Message-State: AOJu0YwGE8MjxZXzw25dTyNZqEVpHX0YM77Qcr/m7XuEoxNT6S4CgOQs JsIR+gM8yQGhL57QqaYEHugrXS94esuuUcO0cJO8KgRiilSqy2DHC8SkAeteKpiS/n7kkbl4cdq xz0pu X-Google-Smtp-Source: AGHT+IGJ3tPDI7T4jOKz3+cIWDxoetGI+nayGrbz/M/4sWk5VW82K5uTD4tNJ9pCDQA1ei5UiWQNIQ== X-Received: by 2002:a05:6402:278b:b0:5c2:6083:6256 with SMTP id 4fb4d7f45d1cf-5c464db69d9mr1116226a12.10.1726820021101; Fri, 20 Sep 2024 01:13:41 -0700 (PDT) Received: from chromium.org ([83.68.141.146]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c42bc88cf7sm6804447a12.90.2024.09.20.01.13.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Sep 2024 01:13:39 -0700 (PDT) From: Simon Glass To: u-boot@lists.denx.de Cc: Simon Glass , Kever Yang , Manoj Sai , Marek Vasut , Sean Anderson , Suniel Mahesh , Tom Rini Subject: [PATCH v2 13/18] spl: Add some more debugging to load_simple_fit() Date: Fri, 20 Sep 2024 10:12:52 +0200 Message-ID: <20240920081309.140426-14-sjg@chromium.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240920081309.140426-1-sjg@chromium.org> References: <20240920081309.140426-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.8 at phobos.denx.de X-Virus-Status: Clean Add debugging of image-loading progress. Fix a stale comment in the function comment while we are here. Signed-off-by: Simon Glass --- (no changes since v1) common/spl/spl_fit.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c index 614dea9ae18..303d5416b59 100644 --- a/common/spl/spl_fit.c +++ b/common/spl/spl_fit.c @@ -190,7 +190,7 @@ static int get_aligned_image_size(struct spl_load_info *info, int data_size, /** * load_simple_fit(): load the image described in a certain FIT node * @info: points to information about the device to load data from - * @sector: the start sector of the FIT image on the device + * @fit_offset: the offset of the FIT image on the device * @ctx: points to the FIT context structure * @node: offset of the DT node describing the image to load (relative * to @fit) @@ -243,11 +243,14 @@ static int load_simple_fit(struct spl_load_info *info, ulong fit_offset, if (!fit_image_get_data_position(fit, node, &offset)) { external_data = true; } else if (!fit_image_get_data_offset(fit, node, &offset)) { + log_debug("read offset %x = offset from fit %lx\n", + offset, (ulong)offset + ctx->ext_data_offset); offset += ctx->ext_data_offset; external_data = true; } if (external_data) { + ulong read_offset; void *src_ptr; /* External data */ @@ -270,6 +273,10 @@ static int load_simple_fit(struct spl_load_info *info, ulong fit_offset, overhead = get_aligned_image_overhead(info, offset); size = get_aligned_image_size(info, length, offset); + read_offset = fit_offset + get_aligned_image_offset(info, + offset); + log_debug("reading from offset %x / %lx size %lx to %p: ", + offset, read_offset, size, src_ptr); if (info->read(info, fit_offset + @@ -336,6 +343,7 @@ static int load_simple_fit(struct spl_load_info *info, ulong fit_offset, else image_info->entry_point = FDT_ERROR; } + log_debug("- done loading\n"); upl_add_image(fit, node, load_addr, length); From patchwork Fri Sep 20 08:12:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1987790 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org 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=ktJkmtQy; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4X94w90DKyz1xrD for ; Fri, 20 Sep 2024 18:16:09 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C4E208945B; Fri, 20 Sep 2024 10:14:02 +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="ktJkmtQy"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D569F893BE; Fri, 20 Sep 2024 10:14:00 +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=ham autolearn_force=no version=3.4.2 Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com [IPv6:2a00:1450:4864:20::52f]) (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 D9FE789436 for ; Fri, 20 Sep 2024 10:13:43 +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-ed1-x52f.google.com with SMTP id 4fb4d7f45d1cf-5c241feb80dso5514983a12.0 for ; Fri, 20 Sep 2024 01:13:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1726820023; x=1727424823; darn=lists.denx.de; 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=StFAs09jWUD1OhI+yKwUVjNmOV2iEgSuChQeHwo+0X4=; b=ktJkmtQy0D3rAckhgpG4K3kjwtP6phARFz8x+5aggZD1H+KSatr4cR5j/fgjAvLM49 6D9wu77SvWtFdT2V4CmMU5hkyeMBPUDoz0fg0fgExL4y4iJZKgtPFZTgjb+EOxNW5h0w B2iLyBlxWfAt9B5RfVzCVV8fZEbkQtjz7CYJM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726820023; x=1727424823; 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=StFAs09jWUD1OhI+yKwUVjNmOV2iEgSuChQeHwo+0X4=; b=OUtu9HTjPu97gwAuZ5ZxbA8QH7pkXwFSpPXypb7dCdBYXtx1zhRPffJmDy+2f5aMoD vpKelnM6tSMmS7cvx+Jh/YBLwXxMpvTCI5NPlv6FHIR/Ukuy54quqQ5kT1LlVKDxd3z1 0YOEl/sB9VEylOpQloaNkIyrC8KdtlpR90kAn/KMq5DCXG3TFLtcduQ/wxxwwt+ql0m5 Nwi8AyIT6xn/SQhegkII+1IrfUvYu+sl/PkqfN/k3+7S1rmaWtDXnuj7kwSH3p0hinal sYDwYx7YT9nrVRY1xbN6n+VfuZWoVGedzaDReDMHYY5LMYNLp9iNe7e7v/LOIQm5d/99 TMAg== X-Gm-Message-State: AOJu0YwXCygb8upMm26/Qdx9Sc7+P84wUvd1DeLAg/pNMU/YVh2OmWTf CdpIoaPkI1mzwftA0LTPv5PAhxUY+rBsHJ+BASjRJ7VCMoy1BYRasmF52JebL75OuQj6Ghxhc8A wFJNp X-Google-Smtp-Source: AGHT+IGI++B5O6XH736fW8G1VSKxy6Dyen6eMJNXDZFw+r5/qxPMgGwcVw5tz3yd6pwmvoVqO7Fbug== X-Received: by 2002:a05:6402:430d:b0:5c4:2b18:2528 with SMTP id 4fb4d7f45d1cf-5c4637c2e38mr2622921a12.5.1726820022958; Fri, 20 Sep 2024 01:13:42 -0700 (PDT) Received: from chromium.org ([83.68.141.146]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c42bc88cf7sm6804447a12.90.2024.09.20.01.13.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Sep 2024 01:13:42 -0700 (PDT) From: Simon Glass To: u-boot@lists.denx.de Cc: Simon Glass , AKASHI Takahiro , Bin Meng , Heinrich Schuchardt , Ilias Apalodimas , Michal Simek , Sean Anderson , Sughosh Ganu , Tom Rini Subject: [PATCH v2 14/18] spl: lib: Allow for decompression in any SPL build Date: Fri, 20 Sep 2024 10:12:53 +0200 Message-ID: <20240920081309.140426-15-sjg@chromium.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240920081309.140426-1-sjg@chromium.org> References: <20240920081309.140426-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.8 at phobos.denx.de X-Virus-Status: Clean Add Kconfig symbols and update the Makefile rules so that decompression can be used in TPL and VPL Signed-off-by: Simon Glass --- (no changes since v1) lib/Kconfig | 35 +++++++++++++++++++++++++++++++++++ lib/Makefile | 8 ++++---- 2 files changed, 39 insertions(+), 4 deletions(-) diff --git a/lib/Kconfig b/lib/Kconfig index 1dd4f271595..4f754c255e8 100644 --- a/lib/Kconfig +++ b/lib/Kconfig @@ -812,12 +812,36 @@ config SPL_LZ4 fast compression and decompression speed. It belongs to the LZ77 family of byte-oriented compression schemes. +config TPL_LZ4 + bool "Enable LZ4 decompression support in TPL" + depends on TPL + help + This enables support for the LZ4 decompression algorithm in TPL. LZ4 + is a lossless data compression algorithm that is focused on + fast compression and decompression speed. It belongs to the LZ77 + family of byte-oriented compression schemes. + +config VPL_LZ4 + bool "Enable LZ4 decompression support in VPL" + depends on VPL + help + This enables support for the LZ4 decompression algorithm in VPL. LZ4 + is a lossless data compression algorithm that is focused on + fast compression and decompression speed. It belongs to the LZ77 + family of byte-oriented compression schemes. + config SPL_LZMA bool "Enable LZMA decompression support for SPL build" depends on SPL help This enables support for LZMA compression algorithm for SPL boot. +config TPL_LZMA + bool "Enable LZMA decompression support for TPL build" + depends on TPL + help + This enables support for LZMA compression algorithm for TPL boot. + config VPL_LZMA bool "Enable LZMA decompression support for VPL build" default y if LZMA @@ -836,11 +860,22 @@ config SPL_GZIP help This enables support for the GZIP compression algorithm for SPL boot. +config TPL_GZIP + bool "Enable gzip decompression support for SPL build" + select TPL_ZLIB + help + This enables support for the GZIP compression algorithm for TPL + config SPL_ZLIB bool help This enables compression lib for SPL boot. +config TPL_ZLIB + bool + help + This enables compression lib for TPL + config SPL_ZSTD bool "Enable Zstandard decompression support in SPL" depends on SPL diff --git a/lib/Makefile b/lib/Makefile index d300249f57c..9478257e634 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -82,12 +82,12 @@ obj-$(CONFIG_$(SPL_)SHA512) += sha512.o obj-$(CONFIG_CRYPT_PW) += crypt/ obj-$(CONFIG_$(SPL_)ASN1_DECODER) += asn1_decoder.o -obj-$(CONFIG_$(SPL_)ZLIB) += zlib/ +obj-$(CONFIG_$(SPL_TPL_)ZLIB) += zlib/ obj-$(CONFIG_$(SPL_)ZSTD) += zstd/ -obj-$(CONFIG_$(SPL_)GZIP) += gunzip.o +obj-$(CONFIG_$(SPL_TPL_)GZIP) += gunzip.o obj-$(CONFIG_$(SPL_)LZO) += lzo/ -obj-$(CONFIG_$(SPL_)LZMA) += lzma/ -obj-$(CONFIG_$(SPL_)LZ4) += lz4_wrapper.o +obj-$(CONFIG_$(SPL_TPL_)LZMA) += lzma/ +obj-$(CONFIG_$(SPL_TPL_)LZ4) += lz4_wrapper.o obj-$(CONFIG_$(SPL_)LIB_RATIONAL) += rational.o From patchwork Fri Sep 20 08:12:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1987786 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org 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=cxO/otw1; dkim-atps=neutral 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=patchwork.ozlabs.org) 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 (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4X94vN3jrfz1xrD for ; Fri, 20 Sep 2024 18:15:28 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4115C893C5; Fri, 20 Sep 2024 10:13:49 +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="cxO/otw1"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4C3F189448; Fri, 20 Sep 2024 10:13:48 +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=ham autolearn_force=no version=3.4.2 Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) (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 4E74189382 for ; Fri, 20 Sep 2024 10:13:46 +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-ed1-x529.google.com with SMTP id 4fb4d7f45d1cf-5c44e1cde53so2088638a12.0 for ; Fri, 20 Sep 2024 01:13:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1726820025; x=1727424825; darn=lists.denx.de; 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=+6FBUOoyMCwX1WqvoSOMxqamLObA4Msus+qAPD9t0YU=; b=cxO/otw1nkitZiZfSdBWzlU6S3fQyyi93CDceYcZfrdaqaIcfRGOf82hSSeA4nFBbp s7UI8CENHmDizNklqicW9X1pdSxrLJq9fV9nfKS38eK1Lsu06L7Ecv5wf4m9z+a5IUU9 I3iD/XJ8SBR4sRj8ZiOPuw70Z9MUG+DEoQ3Ks= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726820025; x=1727424825; 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=+6FBUOoyMCwX1WqvoSOMxqamLObA4Msus+qAPD9t0YU=; b=rfnVKEMyTGJ39GBP8xEIm3YeQZFNLz/TGAQJVoDIbrIpyIsbYZdfcRPACo6OvR1MkU ILDZliuQwATVNZsjW/FKK0fBouKP8dqPpFO9Q5DCglf5poA3NPvgF8kmqSKGrofL8Ia1 k+0ZVHhyVKMO9QkB2/duW5/lwj2kwEtKfjVXaSYamWER9BYugTplTQrTO9eiORQl7fLd Jqf5OUPpoUl8pCcRtcxFwS2+6533J4+0Ntuonb+R97yXsuXOtPdDpeJgYej57CigqUwn 6/IngYEkMWU7gKqjiTv/0avrdBEx5MsUIr+AquPiJzqiwHYCED3Yd5qolSZdS6u/QAFh Wzhw== X-Gm-Message-State: AOJu0Yyh3OqNY5pXhFauX1S+v8dNC+oQqCx2frKNuV0xXhNdvjOh5Pcs uKTyBkeD9/iqJZOo2jYZAoORBodrFDPqKSkf/FdXcHTbaoW8rjYx5TUaQB4A0JQ6UPcH7Z6DNEE +GUwm X-Google-Smtp-Source: AGHT+IHhZPIfaWL+L/2IVqXgjR1xss1mfXmpVSyYwOYiYjwdHBPRSupD8ieNNflaujuN0nh//1Bb5g== X-Received: by 2002:a05:6402:2101:b0:5c4:2d7d:9759 with SMTP id 4fb4d7f45d1cf-5c464a3a1e4mr1628101a12.10.1726820025223; Fri, 20 Sep 2024 01:13:45 -0700 (PDT) Received: from chromium.org ([83.68.141.146]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c42bc88cf7sm6804447a12.90.2024.09.20.01.13.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Sep 2024 01:13:44 -0700 (PDT) From: Simon Glass To: u-boot@lists.denx.de Cc: Simon Glass , AKASHI Takahiro , Eddie James , Heinrich Schuchardt , Ilias Apalodimas , Julien Masson , Mattijs Korpershoek , Quentin Schulz , Sean Anderson , Sughosh Ganu , Tom Rini Subject: [PATCH v2 15/18] boot: Allow use of FIT in TPL and VPL Date: Fri, 20 Sep 2024 10:12:54 +0200 Message-ID: <20240920081309.140426-16-sjg@chromium.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240920081309.140426-1-sjg@chromium.org> References: <20240920081309.140426-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.8 at phobos.denx.de X-Virus-Status: Clean With VBE we want to use FIT in all phases of the boot. Add Kconfig options to support this. Disable the options for sandbox_vpl for now. Signed-off-by: Simon Glass --- (no changes since v1) boot/Kconfig | 69 ++++++++++++++++++++++++++++++++++- boot/Makefile | 4 +- configs/sandbox_vpl_defconfig | 3 +- 3 files changed, 71 insertions(+), 5 deletions(-) diff --git a/boot/Kconfig b/boot/Kconfig index 925afe06a19..9fd1424cd1f 100644 --- a/boot/Kconfig +++ b/boot/Kconfig @@ -163,6 +163,18 @@ config SPL_FIT select SPL_HASH select SPL_OF_LIBFDT +config VPL_FIT + bool "Support Flattened Image Tree within VPL" + depends on VPL + select VPL_HASH + select VPL_OF_LIBFDT + +config TPL_FIT + bool "Support Flattened Image Tree within TPL" + depends on TPL + select TPL_HASH + select TPL_OF_LIBFDT + config SPL_FIT_PRINT bool "Support FIT printing within SPL" depends on SPL_FIT @@ -267,6 +279,28 @@ config SPL_LOAD_FIT_FULL particular it can handle selecting from multiple device tree and passing the correct one to U-Boot. +config TPL_LOAD_FIT + bool "Enable TPL loading U-Boot as a FIT (basic fitImage features)" + depends on TPL + select TPL_FIT + help + Normally with the SPL framework a legacy image is generated as part + of the build. This contains U-Boot along with information as to + where it should be loaded. This option instead enables generation + of a FIT (Flat Image Tree) which provides more flexibility. In + particular it can handle selecting from multiple device tree + and passing the correct one to U-Boot. + + This path has the following limitations: + + 1. "loadables" images, other than FDTs, which do not have a "load" + property will not be loaded. This limitation also applies to FPGA + images with the correct "compatible" string. + 2. For FPGA images, the supported "compatible" list is in the + doc/uImage.FIT/source_file_format.txt. + 3. FDTs are only loaded for images with an "os" property of "u-boot". + "linux" images are also supported with Falcon boot mode. + config SPL_FIT_IMAGE_POST_PROCESS bool "Enable post-processing of FIT artifacts after loading by the SPL" depends on SPL_LOAD_FIT @@ -314,6 +348,22 @@ config VPL_FIT select VPL_HASH select VPL_OF_LIBFDT +config VPL_LOAD_FIT + bool "Enable VPL loading U-Boot as a FIT (basic fitImage features)" + select VPL_FIT + default y + +config VPL_LOAD_FIT_FULL + bool "Enable SPL loading U-Boot as a FIT (full fitImage features)" + select VPL_FIT + help + Normally with the SPL framework a legacy image is generated as part + of the build. This contains U-Boot along with information as to + where it should be loaded. This option instead enables generation + of a FIT (Flat Image Tree) which provides more flexibility. In + particular it can handle selecting from multiple device tree + and passing the correct one to U-Boot. + config VPL_FIT_PRINT bool "Support FIT printing within VPL" depends on VPL_FIT @@ -634,6 +684,15 @@ config VPL_BOOTMETH_VBE supports selection of various firmware components, selection of an OS to boot as well as updating these using fwupd. +config TPL_BOOTMETH_VBE + bool "Bootdev support for Verified Boot for Embedded (TPL)" + depends on TPL + default y + help + Enables support for VBE boot. This is a standard boot method which + supports selection of various firmware components, seleciton of an OS to + boot as well as updating these using fwupd. + if BOOTMETH_VBE config BOOTMETH_VBE_REQUEST @@ -712,7 +771,15 @@ config VPL_BOOTMETH_VBE_SIMPLE_FW This option enabled for VPL, since it is the phase where the SPL decision is made. -endif # BOOTMETH_VBE +config TPL_BOOTMETH_VBE_SIMPLE_FW + bool "Bootdev support for VBE 'simple' method firmware phase (TPL)" + depends on VPL + default y + help + Enables support for the firmware parts of VBE 'simple' boot, in TPL. + TPL loads a FIT containing the VPL binary and a suitable devicetree. + +endif # BOOTMETH_VBE_SIMPLE config EXPO bool "Support for expos - groups of scenes displaying a UI" diff --git a/boot/Makefile b/boot/Makefile index f4675d6ffd5..40e2337de0f 100644 --- a/boot/Makefile +++ b/boot/Makefile @@ -58,9 +58,7 @@ obj-$(CONFIG_$(SPL_TPL_)FIT_CIPHER) += image-cipher.o obj-$(CONFIG_CMD_ADTIMG) += image-android-dt.o -ifdef CONFIG_SPL_BUILD -obj-$(CONFIG_SPL_LOAD_FIT) += common_fit.o -endif +obj-$(CONFIG_$(SPL_TPL_)LOAD_FIT) += common_fit.o obj-$(CONFIG_$(SPL_TPL_)EXPO) += expo.o scene.o expo_build.o obj-$(CONFIG_$(SPL_TPL_)EXPO) += scene_menu.o scene_textline.o diff --git a/configs/sandbox_vpl_defconfig b/configs/sandbox_vpl_defconfig index 96e9211bd19..d18bb7a0353 100644 --- a/configs/sandbox_vpl_defconfig +++ b/configs/sandbox_vpl_defconfig @@ -27,9 +27,10 @@ CONFIG_FIT=y CONFIG_FIT_VERBOSE=y CONFIG_FIT_BEST_MATCH=y CONFIG_SPL_LOAD_FIT=y +# CONFIG_TPL_BOOTMETH_VBE is not set +# CONFIG_TPL_BOOTMETH_VBE_SIMPLE_FW is not set CONFIG_UPL=y CONFIG_UPL_IN=y -CONFIG_SPL_UPL_OUT=y CONFIG_BOOTSTAGE=y CONFIG_BOOTSTAGE_REPORT=y CONFIG_BOOTSTAGE_FDT=y From patchwork Fri Sep 20 08:12:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1987788 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org 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=TtV4ahxX; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4X94vm2fFCz1xrD for ; Fri, 20 Sep 2024 18:15:48 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 085C88946B; Fri, 20 Sep 2024 10:13: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=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="TtV4ahxX"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id F03EB89463; Fri, 20 Sep 2024 10:13:52 +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=ham autolearn_force=no version=3.4.2 Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com [IPv6:2a00:1450:4864:20::12b]) (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 0C76089445 for ; Fri, 20 Sep 2024 10:13:48 +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-lf1-x12b.google.com with SMTP id 2adb3069b0e04-536584f6c84so2372809e87.0 for ; Fri, 20 Sep 2024 01:13:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1726820027; x=1727424827; darn=lists.denx.de; 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=BQPA2oNB9PirJfGQvYQXRZyYTRomUj/E2bnlK+2Zh+k=; b=TtV4ahxXXc8H5mCfl9Hjg1IZrTPxLXS5QbeBAqvw7L+3Lj1ApmdScE/iRi09jVISVb NCccxv59VzJtsWnybjbmuTDRsaEvLXOlNkq6UkcIPe1tverlsZn+QZ7FSFWSenClqb2R 1zi+a45ItziVtGZXe1afD9nnRpaI8Y0Did5Qw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726820027; x=1727424827; 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=BQPA2oNB9PirJfGQvYQXRZyYTRomUj/E2bnlK+2Zh+k=; b=itPkPs3mT7AEZOXvI47A52vDr4GqZpycRwkHOritIQGgry4zyG/qGK7SsHTDrFiILq GmlQi1XlnQjwsTKnliE7eD8XdaDjLy7QoE0bUrId+g3HCBrJHer1GZ8lMwYJMo7YpmUU GFtvQMqTUNtkUltjPzqGJQcHUgzTt8kPlXbQHNcDUef+ty6me7O2Fj7VfQ9oNIa9bnNt Ht+2LgQmKfFcWjzU1LIfHHvwXsvEIvvPsf8w9zC2gBa68fjsryq10esPwMOYUgFPBAme zyTf6DOTYuiXUMhiKrDNhbCdNcRYpGerQXX/l6R7wXpec/NODA45Df79cLPYQFbHQqAG v0Cw== X-Gm-Message-State: AOJu0Yx5CXCDchHcj2lR5owCmloTNXIz1+sg8vvITtBTuaVeebfkLySC 9uPalWz4Kl7gS3Po18LkQM01oomry+r6t+t/inMlhSPlRfCbr2rgO2fY6fMVhAA5jkn8GEZbthq EIfgt X-Google-Smtp-Source: AGHT+IE5Ogq1iiDE9nIzOrwLFmm00tIzmCzzUX2apCGzlktHvkADzR7U2sWXfLqa0V4MFH8QtMlvzw== X-Received: by 2002:a05:6512:3089:b0:536:9ef3:3b0d with SMTP id 2adb3069b0e04-536ac2d64abmr1187325e87.2.1726820027101; Fri, 20 Sep 2024 01:13:47 -0700 (PDT) Received: from chromium.org ([83.68.141.146]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c42bc88cf7sm6804447a12.90.2024.09.20.01.13.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Sep 2024 01:13:46 -0700 (PDT) From: Simon Glass To: u-boot@lists.denx.de Cc: Simon Glass , AKASHI Takahiro , Bin Meng , Heinrich Schuchardt , Ilias Apalodimas , Michal Simek , Sean Anderson , Sughosh Ganu , Tom Rini Subject: [PATCH v2 16/18] lib: Allow crc8 in TPL and VPL Date: Fri, 20 Sep 2024 10:12:55 +0200 Message-ID: <20240920081309.140426-17-sjg@chromium.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240920081309.140426-1-sjg@chromium.org> References: <20240920081309.140426-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.8 at phobos.denx.de X-Virus-Status: Clean Provide options to enable the CRC8 feature in TPL and VPL builds. Signed-off-by: Simon Glass --- Changes in v2: - Fix 'depends on SPL' to depend on TPL lib/Kconfig | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/lib/Kconfig b/lib/Kconfig index 4f754c255e8..eca5f8ecb39 100644 --- a/lib/Kconfig +++ b/lib/Kconfig @@ -699,6 +699,24 @@ config SPL_CRC8 checksum with feedback to produce an 8-bit result. The code is small and it does not require a lookup table (unlike CRC32). +config TPL_CRC8 + bool "Support CRC8 in TPL" + depends on TPL + help + Enables CRC8 support in TPL. This is not normally required. CRC8 is + a simple and fast checksumming algorithm which does a bytewise + checksum with feedback to produce an 8-bit result. The code is small + and it does not require a lookup table (unlike CRC32). + +config VPL_CRC8 + bool "Support CRC8 in VPL" + depends on VPL + help + Enables CRC8 support in VPL. This is not normally required. CRC8 is + a simple and fast checksumming algorithm which does a bytewise + checksum with feedback to produce an 8-bit result. The code is small + and it does not require a lookup table (unlike CRC32). + config SPL_CRC16 bool "Support CRC16 in SPL" depends on SPL From patchwork Fri Sep 20 08:12:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1987791 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org 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=XJ1v3cF4; dkim-atps=neutral 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=patchwork.ozlabs.org) 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 (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4X94wM0W52z1xrD for ; Fri, 20 Sep 2024 18:16:19 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 34A1789382; Fri, 20 Sep 2024 10:14:08 +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="XJ1v3cF4"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1B41A87D1A; Fri, 20 Sep 2024 10:14:07 +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=ham autolearn_force=no version=3.4.2 Received: from mail-ed1-x531.google.com (mail-ed1-x531.google.com [IPv6:2a00:1450:4864:20::531]) (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 F229489382 for ; Fri, 20 Sep 2024 10:13:48 +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-ed1-x531.google.com with SMTP id 4fb4d7f45d1cf-5c413cf5de5so2363087a12.0 for ; Fri, 20 Sep 2024 01:13:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1726820028; x=1727424828; darn=lists.denx.de; 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=6qEJrGnsgLTlE+u/F3aUcEDpzp+/XSfEN73udjDdDls=; b=XJ1v3cF4wCpcTHlSHRi+w3pTRgJpKP7V5b603h1sSaF8D81eVoFiFPvBK7AzynJ0a9 BBMHx4IFEy8MwdX0B1THp/CHPxVq8uyp6nTzUC8IMTjtZuIwHfcRw/aq3/OdVCt8g/2U 2s9xg8r37CsBPdJ4yWWKI3VJHaJzgFoSng+8Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726820028; x=1727424828; 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=6qEJrGnsgLTlE+u/F3aUcEDpzp+/XSfEN73udjDdDls=; b=YjaV1kKoD48OdBgcCgAHRhDxJdRgh7USCiAbfF8rNXFj67FPxlJhgCP6B2zoBPJu9o 3VtJcx1y4B5UkY0iM7Z2nQDWajFbt9UE6P7zLACysFadh3M93HwMd975iUU7fL+GJuPp q7e7r+bjdPkoA7Maq47nZjFzoH0IYhw8GtHHXnVf26Q2ZlLPyEz3pYZ6n8z3eJcdhlpi YqkzN/Z4CQEZWCVXhbN/iviFyWALl823xw/OFbri2lqu724x0Hurrgf6EuAzfIkoMHty bbeF8K91ZetTHLEuyxLdph8zCnhPwZNClq6BLq0lWc34/p0ucmb0iT3BnLfEAkWIor1s Qerw== X-Gm-Message-State: AOJu0YytADsuHwrKcCog2UTulIY7f/4R5xGe587YNpdEBV+/eHGzRMkE MaUjP7RJq/aSYlmbtgAdlcTHGAe8YRRv9aKxM4LfPwXsLksGXS/5YvuHdH73W/JMeBXnJJtom6+ hWYN/ X-Google-Smtp-Source: AGHT+IH+hhS9nFbDwgUXkVRjvhNZJOPWR+TdQSh47auZl+aZdWjymcVjC8CXZ7gMGyDEux12KiMGaw== X-Received: by 2002:a05:6402:1e8b:b0:5a2:5bd2:ca50 with SMTP id 4fb4d7f45d1cf-5c464a5ad55mr1640439a12.25.1726820028123; Fri, 20 Sep 2024 01:13:48 -0700 (PDT) Received: from chromium.org ([83.68.141.146]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c42bc88cf7sm6804447a12.90.2024.09.20.01.13.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Sep 2024 01:13:47 -0700 (PDT) From: Simon Glass To: u-boot@lists.denx.de Cc: Simon Glass , AKASHI Takahiro , Eddie James , Heinrich Schuchardt , Ilias Apalodimas , Mattijs Korpershoek , Quentin Schulz , Tom Rini Subject: [PATCH v2 17/18] boot: Imply CRC8 with VBE Date: Fri, 20 Sep 2024 10:12:56 +0200 Message-ID: <20240920081309.140426-18-sjg@chromium.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240920081309.140426-1-sjg@chromium.org> References: <20240920081309.140426-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.8 at phobos.denx.de X-Virus-Status: Clean VBE uses a crc8 checksum to verify that the nvdata is valid, so make sure it is available if VBE is enabled. Signed-off-by: Simon Glass --- Changes in v2: - Depend on TPL/VPL as well boot/Kconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/boot/Kconfig b/boot/Kconfig index 9fd1424cd1f..48ed86bf13a 100644 --- a/boot/Kconfig +++ b/boot/Kconfig @@ -718,6 +718,8 @@ config SPL_BOOTMETH_VBE_REQUEST config BOOTMETH_VBE_SIMPLE bool "Bootdev support for VBE 'simple' method" default y + imply SPL_CRC8 if SPL + imply VPL_CRC8 if VPL help Enables support for VBE 'simple' boot. This allows updating a single firmware image in boot media such as MMC. It does not support any sort From patchwork Fri Sep 20 08:12:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1987787 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org 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=DdhknYP0; dkim-atps=neutral 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=patchwork.ozlabs.org) 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 (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4X94vZ12JVz1xrD for ; Fri, 20 Sep 2024 18:15:38 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9B78D89466; Fri, 20 Sep 2024 10:13:53 +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="DdhknYP0"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1EC208945A; Fri, 20 Sep 2024 10:13:52 +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=ham autolearn_force=no version=3.4.2 Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) (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 24A5D89452 for ; Fri, 20 Sep 2024 10:13: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-lf1-x12d.google.com with SMTP id 2adb3069b0e04-536a2759f0eso2317639e87.3 for ; Fri, 20 Sep 2024 01:13:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1726820029; x=1727424829; darn=lists.denx.de; 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=OcOfvCyO/5N3kjPO2omuLXBUuqkVueXoyg9VgaloaBE=; b=DdhknYP0hL3Iak/eXNavH/dhGuP7s1FuUHIprHwtQf+Roi4Ewi9NduQNzQmTpnXOaw QH0toaSAj4JKLzqE1nrqfgAbPHIFgC+nKLF231fxsXQq2nILnm4TB6urtDxiSwxLy+72 KpMuNG12dpFlHPJ57c07eL2w9QFkr8BNZ1SOI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726820029; x=1727424829; 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=OcOfvCyO/5N3kjPO2omuLXBUuqkVueXoyg9VgaloaBE=; b=sBZbPu1AHbIbxmcazhoaC9ERGYwEEef2UJ4gFMMyKi1kZ++bg2p9nvXqmo2aSwevcC OLHf7EylbhXo9dBEQE3/MGsykgOh7IZo67QAyGHZUncLyHt2mpSg8MY2PAIBUDOqSVJ4 WZrNw2v2dvesEe7stS92hMd6xv1/NjneY8j4WD/HJBJ9ObdTDm/VAyBYBMTkzed0ClZ9 LC7R4NsGEg7kmd/q+jrCtCmhzm8YIrCowtjWovdyBPF7uSTy3yFk6VEtTDE9Rz/eOvha 9pM0O6UN8ak1NI+ayQbOnrIr7xD6acwspi+C8j14caKWQVI3hv1h0WefShvn+/D7EcrT p3ZQ== X-Gm-Message-State: AOJu0Yz0/qKQ9lV1t7y2Y5KiDTmoXTb65/OtmGD0OTBGqT1gor/RP3Js y2Qv85UNNj8ozh7/YwbxHeVpsDCLfm413X3LMYXk3yefJr2Ml3vgr2E0OfJP+llDWw3wjmZhJlA 0e4Ha X-Google-Smtp-Source: AGHT+IEj8cX5pb6yTj0NFgznZPLAFbntYwVHDPpAhjsiO13K6bglb5suFJ5dGLJmSF495ElS3aQzMw== X-Received: by 2002:a05:6512:12c2:b0:52e:f99e:5dd1 with SMTP id 2adb3069b0e04-536ad3c9abfmr747069e87.47.1726820029111; Fri, 20 Sep 2024 01:13:49 -0700 (PDT) Received: from chromium.org ([83.68.141.146]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c42bc88cf7sm6804447a12.90.2024.09.20.01.13.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Sep 2024 01:13:48 -0700 (PDT) From: Simon Glass To: u-boot@lists.denx.de Cc: Simon Glass , Igor Opaniuk , Tom Rini Subject: [PATCH v2 18/18] hash: Plumb crc8 into the hash functions Date: Fri, 20 Sep 2024 10:12:57 +0200 Message-ID: <20240920081309.140426-19-sjg@chromium.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240920081309.140426-1-sjg@chromium.org> References: <20240920081309.140426-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.8 at phobos.denx.de X-Virus-Status: Clean Add an entry for crc8, with watchdog handling. Signed-off-by: Simon Glass --- Changes in v2: - Drop patch 'serial: ns16550: Allow clocks to be missing' common/hash.c | 8 ++++++++ include/u-boot/crc.h | 3 +++ lib/crc8.c | 6 ++++++ 3 files changed, 17 insertions(+) diff --git a/common/hash.c b/common/hash.c index ac63803fed9..43c4e185750 100644 --- a/common/hash.c +++ b/common/hash.c @@ -304,6 +304,14 @@ static struct hash_algo hash_algo[] = { .hash_update = hash_update_crc16_ccitt, .hash_finish = hash_finish_crc16_ccitt, }, +#if CONFIG_IS_ENABLED(CRC8) + { + .name = "crc8", + .digest_size = 1, + .chunk_size = CHUNKSZ_CRC32, + .hash_func_ws = crc8_wd_buf, + }, +#endif #if CONFIG_IS_ENABLED(CRC32) { .name = "crc32", diff --git a/include/u-boot/crc.h b/include/u-boot/crc.h index 5174bd7ac41..b2badaf6a97 100644 --- a/include/u-boot/crc.h +++ b/include/u-boot/crc.h @@ -25,6 +25,9 @@ */ unsigned int crc8(unsigned int crc_start, const unsigned char *vptr, int len); +void crc8_wd_buf(const unsigned char *input, unsigned int len, + unsigned char output[1], unsigned int chunk_sz); + /* lib/crc16.c - 16 bit CRC with polynomial x^16 + x^15 + x^2 + 1 */ uint16_t crc16(uint16_t crc, const unsigned char *buffer, size_t len); diff --git a/lib/crc8.c b/lib/crc8.c index 20d46d16147..811e19917b4 100644 --- a/lib/crc8.c +++ b/lib/crc8.c @@ -32,3 +32,9 @@ unsigned int crc8(unsigned int crc, const unsigned char *vptr, int len) return crc; } + +void crc8_wd_buf(const unsigned char *input, unsigned int len, + unsigned char output[1], unsigned int chunk_sz) +{ + *output = crc8(0, input, len); +}