From patchwork Sat Dec 7 17:23: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: 2019643 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=SXyToBxs; 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) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Y5FR044zfz1yRL for ; Sun, 8 Dec 2024 04:26:20 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D7B2889338; Sat, 7 Dec 2024 18:26:03 +0100 (CET) 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="SXyToBxs"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6240289338; Sat, 7 Dec 2024 18:26:03 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd35.google.com (mail-io1-xd35.google.com [IPv6:2607:f8b0:4864:20::d35]) (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 36063891C3 for ; Sat, 7 Dec 2024 18:26:01 +0100 (CET) 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-io1-xd35.google.com with SMTP id ca18e2360f4ac-843d7f16827so115333739f.0 for ; Sat, 07 Dec 2024 09:26:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1733592359; x=1734197159; 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=5u6BP0JIimx76IlHsUa8ckRXN3uBRnCokz7lYZmC5o8=; b=SXyToBxs6Z0RanUX3Bphgmst6wQSSDxJLJS8pbq3A2TD5a6ih4tTIpUpHbvpaG2xl4 A11kI/5dIKQ7Kjlhpp/Kvn3Rct0AyhEcGGzNQzENhA8K0p9NLpGGC0+Zn7hV5FxJABe5 0GQULPZ7CBUpDEQwogX9W4SUqK+Y9DP7qlGXQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733592359; x=1734197159; 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=5u6BP0JIimx76IlHsUa8ckRXN3uBRnCokz7lYZmC5o8=; b=M8PqR/Dtbm7SCv/w37cyjToYFFJz7WgqZOvbzeVfTFK5KYBOHm+AlHD9I5CXqZFN0W THAMN5HXMmlfs5d+mFuVvU5In6J0KLelP+n3RFlj2g5hMTZt/N/3TvQtusX46aQGAwQ5 BnWLLKue2wv7drW2m0dLwz3M1stgGOT6wKwEq5iIP584xL/A94KbmHrG3N/6CbD4oq3o 8ghBVRJrjB494+dc9L/GELYDlAF8mepgdeCzRiaC7KvxHzAB207uN0KgH5EHw2f76Tc6 1AzmFJ1fx8bPJ4I1x99pgSFLGwJ6+0d3d6HCtSej5d03IMC9NYXaTm4zIo3i3LLVnIpy peHg== X-Gm-Message-State: AOJu0Yys5Tgs4J3ZKBwDsr8SDH8yqCvLd1TMBCh+BT+lChbrDG8KFdlT LZFvFNELYgUv6zPt0yzf/QBYxRc76SRn3J37qYZyA77djbZ36rT78gC4pwYhS5HWUdZ0M4FrdiE = X-Gm-Gg: ASbGncspRwKQ5ET9ZrItFXbFIcTiFf6TSesDxYZxo3ePijOF2mf/wDgWnhima+J54+e cLTVUfJB8KFG7tYiv/alB6N6teNAopXZvw2Az4B1Nj0KsgCy6I3VdQGtPO1871YSZZ1okRpeNsf ToCWTr6U34GYlM04kuvKfykVO0uHxa1hjsuwBpIxwvXEllvRabzqM1TLuotAAD4N1UlpQW3zRye Qjugr94uxzHEmwnfO3YHq1LEZJrw7KGx2BeDfTiAcUULj3IyVp5tMepICUgs04wCcoyeMa8koyL Jbdjj587C4U= X-Google-Smtp-Source: AGHT+IHJHB2QpjUelSnsb+o4+kZGtyxpcNJyRW60CW1uqYCwFK0EKLY0etcFLKOb7YtHq2T1jJ/AYQ== X-Received: by 2002:a05:6602:6410:b0:834:d7b6:4fea with SMTP id ca18e2360f4ac-8447e212591mr843495439f.6.1733592359476; Sat, 07 Dec 2024 09:25:59 -0800 (PST) Received: from chromium.org (c-73-203-119-151.hsd1.co.comcast.net. [73.203.119.151]) by smtp.gmail.com with ESMTPSA id ca18e2360f4ac-84473a7080csm171745739f.45.2024.12.07.09.25.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Dec 2024 09:25:56 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass , Jaehoon Chung , Michael Trimarchi , Peng Fan , Quentin Schulz , Sean Anderson , Tim Harvey , Tom Rini Subject: [PATCH v3 01/19] spl: mmc: Avoid size growth in spl_mmc_find_device() debug Date: Sat, 7 Dec 2024 10:23:54 -0700 Message-Id: <20241207172412.1124558-2-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241207172412.1124558-1-sjg@chromium.org> References: <20241207172412.1124558-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 for() loop ends up being in the code even if the log_debug() does nothing. Add a condition to fix this. Signed-off-by: Simon Glass Reviewed-by: Jaehoon Chung --- Changes in v3: - Add new patch to avoid size growth in spl_mmc_find_device() debug common/spl/spl_mmc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c index 1f696593216..fe4230170a0 100644 --- a/common/spl/spl_mmc.c +++ b/common/spl/spl_mmc.c @@ -81,8 +81,10 @@ static int spl_mmc_find_device(struct mmc **mmcp, int mmc_dev) struct uclass *uc; log_debug("Selecting MMC dev %d; seqs:\n", mmc_dev); - uclass_id_foreach_dev(UCLASS_MMC, dev, uc) - log_debug("%d: %s\n", dev_seq(dev), dev->name); + if (_LOG_DEBUG) { + uclass_id_foreach_dev(UCLASS_MMC, dev, uc) + log_debug("%d: %s\n", dev_seq(dev), dev->name); + } ret = mmc_init_device(mmc_dev); #else ret = mmc_initialize(NULL); From patchwork Sat Dec 7 17:23: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: 2019644 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=V07nc/dP; 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) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Y5FR32NMTz1yRL for ; Sun, 8 Dec 2024 04:26:23 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 47FFA89405; Sat, 7 Dec 2024 18:26:07 +0100 (CET) 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="V07nc/dP"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 67E21891C3; Sat, 7 Dec 2024 18:26:06 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-io1-xd33.google.com (mail-io1-xd33.google.com [IPv6:2607:f8b0:4864:20::d33]) (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 4A9E88939B for ; Sat, 7 Dec 2024 18:26:04 +0100 (CET) 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-io1-xd33.google.com with SMTP id ca18e2360f4ac-843e9db3e65so115100839f.1 for ; Sat, 07 Dec 2024 09:26:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1733592362; x=1734197162; 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=IyZuMFoqZLhbMZy8ftr92p+WXS8xDpo1+GTJBnHgM8k=; b=V07nc/dP8VJI2nokwP4F8hrziqdNGl5VRxL9g4LdJjL9OoD6guivwTC0LQalp6vhAz sS1gNEdkcWZQ6ccMvRWpLxjvdmLmmHi0VaiybZt0TkKeKdfsVDqMvbuoPDqNGjh9qP/e wYaJd3URTUfR52/WGMS75LaabdJfH776OYw6s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733592362; x=1734197162; 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=IyZuMFoqZLhbMZy8ftr92p+WXS8xDpo1+GTJBnHgM8k=; b=lGgf7yRGmE1AEXJ5BONqeSNXdZtFZ2rkTv9IUjec9nrwvq03/cmdHzqzuf7vPp61aS BLqVS6h8WSQMMUwXlOH4MeVKy1YGan2HVOKzzOaf9Ai3oK+izeZbNeb3MLCttAj1ysho GR8ia3Yx+GD3doQr81Vfc76nRBzWHjE7JJ6gcf90+7cAeNzDa5nTzHc//FfW4vIGfV4e +CH324FRO+GfMsoVlzSJJJGYoOCRJflh0TpMlAC0oar2BpZiKp6DkxEumfKJPHq5azDs okOIu60W383ScguU8Kb9iGPevtvfgOJ0RVr0FdQVycLMAA+iW50nXIbEURLAQ6JKZjtV qwJA== X-Gm-Message-State: AOJu0Yww2vyzdeVEnR1/8uxCicno+uWMYrIrrPLM9DxEWH+lr3L/Dix8 XYN1sOl4CLIFdmcSLaApoVxjoDqLSuKtA4zJxym/gv/Co7o8bfX+nvvbMO45UM0e5E7f38PViFU = X-Gm-Gg: ASbGnctweJqRBjZDfXW25lEz0JYp5EaWWad/eGkX1UMglt1gaFlBPon9Juauvf2M4Dq 6G+LvqmqZCbrXha5Hs5wMQ3ToCTauc7Xnb6qgC0a+rrJ5aBnJDg0CGpDBFNFSu7k+GuZflcvK4K jOscaFCn1IRh07lDo3HWIoSvvC9Xsqr2b+csxENo0laJwaoD3BQLM8HOYHdTMUZZCw5vIWc+4WS Hx9Qd6S22u7BpsVZ4RPyJOwAFKNBsBluFOYANh8+gJUQMqqnSoc8PsPMJ4vGYdA325kjh0i+JEW o81ZaTX/qtc= X-Google-Smtp-Source: AGHT+IGP5UIFUJXsnnLqO6cC9dJCIAHLAWYKwBB5FYvivmNGX3/w949lpOxGtryGVrGSbuqfvn8swQ== X-Received: by 2002:a05:6602:148e:b0:7f6:8489:2679 with SMTP id ca18e2360f4ac-8447e06d784mr744092539f.8.1733592362468; Sat, 07 Dec 2024 09:26:02 -0800 (PST) Received: from chromium.org (c-73-203-119-151.hsd1.co.comcast.net. [73.203.119.151]) by smtp.gmail.com with ESMTPSA id ca18e2360f4ac-84473a7080csm171745739f.45.2024.12.07.09.25.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Dec 2024 09:26:01 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass , Joe Hershberger , Julien Masson , Marek Vasut , Marek Vasut , Mattijs Korpershoek , Maxim Moskalets , Roman Stratiienko , Sughosh Ganu , Tom Rini Subject: [PATCH v3 02/19] image: Add a prototype for fit_image_get_phase() Date: Sat, 7 Dec 2024 10:23:55 -0700 Message-Id: <20241207172412.1124558-3-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241207172412.1124558-1-sjg@chromium.org> References: <20241207172412.1124558-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 9be5acd8158..bb15ef69871 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 Sat Dec 7 17:23: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: 2019645 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=nMVMDtmy; 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 4Y5FRD1b4mz1yRL for ; Sun, 8 Dec 2024 04:26:32 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 99F1289376; Sat, 7 Dec 2024 18:26:11 +0100 (CET) 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="nMVMDtmy"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0AD3388FB4; Sat, 7 Dec 2024 18:26:10 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd2a.google.com (mail-io1-xd2a.google.com [IPv6:2607:f8b0:4864:20::d2a]) (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 B70E089428 for ; Sat, 7 Dec 2024 18:26:07 +0100 (CET) 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-io1-xd2a.google.com with SMTP id ca18e2360f4ac-84197c469cfso95432539f.3 for ; Sat, 07 Dec 2024 09:26:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1733592366; x=1734197166; 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=2lG7yZEBrm4ZJcy4WFBOngwrT3gczjb1H7yUaUlX1mg=; b=nMVMDtmyxfVM6ZFAg9kt7ejE1H4b/C12QsdP578qUQj8UHPWu4SFJTuNaQqlXv2CYf nLktUwMpB21UUWz1dTpPhSlIdE6A5f/aQ/5dQb+L+becA59bcQbB3OiyvBy5Tdpk2e4V 6uzh8CAWQ2z6Yiw34HIYW8itdMm6p8arRoWIo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733592366; x=1734197166; 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=2lG7yZEBrm4ZJcy4WFBOngwrT3gczjb1H7yUaUlX1mg=; b=S/TycxnYKPzT9WgO90uLcwywGwiA6eMzv0TX/rrvIUDF+UWiV2+rWgGXz4vgkInXki /RYWTmAtK81+hFimqCrIYXX3qS/kbeM9rBdVfucOAkF2mYY5Das4vnonkzdbzUBLwCew /fYdHEZQ4BTF1Vnvke7+qtTRSFdw2aLffCBgoxwhdh9uPTd/gpy61g2Yu/gJanZyASYw pc/IoFu5eeKwBM/HhVQXlLICHqBL8rUxBdvtjn8ZMT4yjV0QwL0x4EWvTcJO2ywgl99X moDrrp4LoI1hhnPEwimnvFHYcW6uYGNOtBDhSwf/h4So9vPaesmWRvE657zmGuPGUj2/ YDbQ== X-Gm-Message-State: AOJu0Yy+rIUv7sz+mDtMZM8Cv8uA9njzwm1SrhU/wvOHS16Dw1wZ62dy FoTaQ5DFcbxP1oyTJZsALkwXADPSmd1V5zy0nQiPdiuTkPmq5PDsuh0lJbchXhmn45dkL/3Gskw = X-Gm-Gg: ASbGncuVnU4960CGXmF3zJIALyCMtEpTqSGVW0IqB8jZgBYaEnwmlfRssW/2afNToDe Wor+6+sKWBqtNJnH5KR2VkO1C4vhVAl2WGKJfBQ0n1UwgYPmCul9NtAre4BDux0jIeUOsf6uSKk f1yO3zCPzD8E1InkmAwCGX0zI5UYpZ9n+u/pUylsoiblNOo6AvYVnXB/GriWqv34doPLBKgUYVo 7M7xfEa3cBpjBjvLuHVfYEVz6Cb+YFhwlRXBhjnxSLtlrSvZZ1TOMCn0BuUGLcbjIcmH54H3QlJ zZzlxUnAPR8= X-Google-Smtp-Source: AGHT+IEioTJHp4++UT6L5bgtCBboRRmnelWBnuWirBNx9BthNDfC0Yru3B0iwWrMOf/i59S9aSKAMg== X-Received: by 2002:a05:6602:6d01:b0:83a:639b:bc44 with SMTP id ca18e2360f4ac-8447e200059mr709002439f.3.1733592365948; Sat, 07 Dec 2024 09:26:05 -0800 (PST) Received: from chromium.org (c-73-203-119-151.hsd1.co.comcast.net. [73.203.119.151]) by smtp.gmail.com with ESMTPSA id ca18e2360f4ac-84473a7080csm171745739f.45.2024.12.07.09.26.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Dec 2024 09:26:04 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass , Guillaume La Roque , Igor Opaniuk , Ilias Apalodimas , Julien Masson , Mattijs Korpershoek , Maxim Moskalets , Michael Walle , Paul-Erwan Rio , Raymond Mao , Sughosh Ganu , Tom Rini Subject: [PATCH v3 03/19] boot: Allow FIT to fall back from best-match option Date: Sat, 7 Dec 2024 10:23:56 -0700 Message-Id: <20241207172412.1124558-4-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241207172412.1124558-1-sjg@chromium.org> References: <20241207172412.1124558-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 bb15ef69871..ab96510f62c 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 Sat Dec 7 17:23: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: 2019646 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=VDRmHTjA; 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 4Y5FRP4wwmz1yRL for ; Sun, 8 Dec 2024 04:26:41 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id F0F60893C4; Sat, 7 Dec 2024 18:26:13 +0100 (CET) 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="VDRmHTjA"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 7902F893C4; Sat, 7 Dec 2024 18:26:13 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd29.google.com (mail-io1-xd29.google.com [IPv6:2607:f8b0:4864:20::d29]) (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 4D7C888FB4 for ; Sat, 7 Dec 2024 18:26:11 +0100 (CET) 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-io1-xd29.google.com with SMTP id ca18e2360f4ac-843d7f16827so115336439f.0 for ; Sat, 07 Dec 2024 09:26:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1733592369; x=1734197169; 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=D1XAaNvSedXtzjDytN9G4hPZ8eHtnhbLbBuiU//Exkk=; b=VDRmHTjAGn93C25DAst1zb1Yoo+4ooFFBRTKZDtI5uy7mgSJ+g64AbFkg33Wh5uG8A f2RMMX3RGli6WRgVAgLVCvGPbaw2hcU/FdAq/XuhE1JCCmD8of089W5MyYlAUYi+rDdO G0dtxEzrxyl/9mMZE9cnAu2zfTtNhGVoklpqA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733592369; x=1734197169; 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=D1XAaNvSedXtzjDytN9G4hPZ8eHtnhbLbBuiU//Exkk=; b=UFKPOo9lkbPtrDrzgKzpu35SNYJe2SI/8VxIWYKB0/rC1n7XMNQvryV0NwSl3bcU/s 6uGwqHChNSf+8pjLOPwaCsVkv2uSZPF/huczXyY4s+NH+WyvTYghi8yTFgCIQ+ICNAFl P2BV13wYDiVqiVpiy9rick4pYMG1P0BgFxJAmU5eV1R1YOIHSaW7ROC3MdiqUvyXkX6M f9BbHn2yUqwgc9IpfyWWfdED9Xgj0jaSmtjFIVkFL+enfdYMRG7Vz+8YvnGVoUolyplJ hANqG12+5ly6+Yl5RbG40EQB0pFGdX8Hz3pMn7zz1mMQUqPoY3t0znrmpQAM9glcd2cv qesQ== X-Gm-Message-State: AOJu0Yz07tHCrN0ivPGmuzXDkI5vRUUH165kNZoUtQCzQthiOzv92j7W Q7t+NTS8GrYeeE5gJZ7zf6j21pL1PsNTx4VrRE+sKK9OhvOEyjc+2YnHzSJTMnk3giEbBTlUsGI = X-Gm-Gg: ASbGncuZaR9A+LIEIB2dLbp8n2hTz6cAMIMitWov7Epyq3rESKbiwx9ihvJe2FQcVYN p+saacqUWOhOwmE9gt4yvc60mAJTzI1NEoHxJhsvMWb9k6TdA62i/m+iNHILinciJcwEggrIwEz ERfDsGBEMKILnAduoSHu8sarzL6NX0wzLCIrbm0cUYd7Fnlaf641SL/llV6VMJKPnXS2XLjIbhl q/x6erc/uNny1JKAs/V4Ejn7QByXjEAXsocwQBxsoBLxJwGg6ijFpN4D8Q/9IN8s+X8yCeVU/wW AvALYvDXvNs= X-Google-Smtp-Source: AGHT+IEp4aXbzr58ot18Zexek38fTAZsbKy0ZEB7SREG631pfzUMSOmIkaQfS6hLq1dYk47wnAjZBg== X-Received: by 2002:a05:6602:2b01:b0:832:480d:6fe1 with SMTP id ca18e2360f4ac-8447e0ea343mr971409839f.0.1733592368949; Sat, 07 Dec 2024 09:26:08 -0800 (PST) Received: from chromium.org (c-73-203-119-151.hsd1.co.comcast.net. [73.203.119.151]) by smtp.gmail.com with ESMTPSA id ca18e2360f4ac-84473a7080csm171745739f.45.2024.12.07.09.26.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Dec 2024 09:26:07 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass , Caleb Connolly , Dragan Simic , Heinrich Schuchardt , Nam Cao , =?utf-8?q?Thomas_Wei=C3=9Fschuh?= , Tom Rini Subject: [PATCH v3 04/19] bootstd: Avoid sprintf() in SPL when creating bootdevs Date: Sat, 7 Dec 2024 10:23:57 -0700 Message-Id: <20241207172412.1124558-5-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241207172412.1124558-1-sjg@chromium.org> References: <20241207172412.1124558-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 --- Changes in v3: - Use strlcpy() instead of strncpy() 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 65a3b89e40c..c39147940b6 100644 --- a/boot/bootdev-uclass.c +++ b/boot/bootdev-uclass.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -261,8 +262,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 (xpl_phase() < PHASE_BOARD_R) { + strlcpy(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 Sat Dec 7 17:23:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 2019647 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=FaLlrzix; 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 4Y5FRZ4Pn3z1yRL for ; Sun, 8 Dec 2024 04:26:50 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 599E08945C; Sat, 7 Dec 2024 18:26:17 +0100 (CET) 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="FaLlrzix"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D438B893E0; Sat, 7 Dec 2024 18:26:15 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd2b.google.com (mail-io1-xd2b.google.com [IPv6:2607:f8b0:4864:20::d2b]) (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 A2CB988FB4 for ; Sat, 7 Dec 2024 18:26:13 +0100 (CET) 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-io1-xd2b.google.com with SMTP id ca18e2360f4ac-841837213b1so228137839f.1 for ; Sat, 07 Dec 2024 09:26:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1733592372; x=1734197172; 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=WWKtId27HRHoTA4nPIebo6hh5rfBC3NImMIXMw+LeI8=; b=FaLlrzix6gnWCRvhlMFQPvmoeb/b5eHIC2Cqk2aKfIuvqqdLwWvLTN8U8kC8aBZNEq kOtM2ebp1HqERvbM0fOoJ929AbNWT951OElzhNnVMYR7CPnLD1Q3+0uGGJuik82WUbs8 2T9l0kVdNdzWkEBZyAQAS9RzWUVSK89lLlZWY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733592372; x=1734197172; 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=WWKtId27HRHoTA4nPIebo6hh5rfBC3NImMIXMw+LeI8=; b=bfcP0qPvPiFf9c5+SbXV+tFUv8Zpcj2MlX3P+hGESMUeiAfb8xx6VDwpZ/ZaysZX2B 3b6TXmA1c1+25Il6Z6W/LgGS0siMeugL7oPZNbhQuBtQop9JqiE0xCQs8V88OVe7+9ec 57WVt31P54pgsoSwPgRI7juWdgXGt5AWlOlhMuW6Tpz4EGx8Zq4UErSqSVvI4LuewExF yZtT6nfwWr/DtiS4flB69g9e6TBSQTzsQl5E2BR4KmyfukTD4YLB2ZkxEMoHc8QluPEa 1zOljAxwXC5bet8wS7KFZwTBjGP9kZJmm32hEVTsqt2VreU5kjiZYX2jMri7RrMtnsYI dt1Q== X-Gm-Message-State: AOJu0YztFUrD7yRR1cAO5bptpIb5DeIht187HKKY4uS6JhyEQMJ3PYcv g0Ngw5Vw62F3NigMNdd8gIgMnGN3GNQFL50o39asHLIflCKwy0GYvPYeb62N7ZmwjSXivVc5BH0 = X-Gm-Gg: ASbGncsCG1TWQbWwm/+o5SPX2y9anMlETbz9IXhcwQyrLXVYns/tgANYca04BR4ZPHs D++pketxe9IGrhlmLK4BjkpCR+vhiUl4Azq9R9ZXZNHD5lN1A2tgE3sJGissmNSvkJ1gZLRcxZ/ n+qjKlcQJe3MBQw5DWCKoacYaIVBVZGYN5CabmouZkqBeXyyct05nx163C4Ddtdhh2394Nf0Dng GNmA05+6TzOBGFkGZHjycLpiHx6AyuFk/6FRHJ3sIaUgT2Ql0NvHmDMN/fQr1Uw25fjSWsydCo3 Z92ky/e045M= X-Google-Smtp-Source: AGHT+IGMOQfIu6ebzfBeRXjNEQNZ1C3VUDRy4xys7woDlDG50TUs+ByXX605izsQ1O5iQtvXKOYLTw== X-Received: by 2002:a05:6602:3417:b0:843:ebf1:16df with SMTP id ca18e2360f4ac-8447e3bd09bmr680118739f.10.1733592371901; Sat, 07 Dec 2024 09:26:11 -0800 (PST) Received: from chromium.org (c-73-203-119-151.hsd1.co.comcast.net. [73.203.119.151]) by smtp.gmail.com with ESMTPSA id ca18e2360f4ac-84473a7080csm171745739f.45.2024.12.07.09.26.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Dec 2024 09:26:10 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass , Igor Opaniuk , Ilias Apalodimas , Maxim Moskalets , Raymond Mao , Tom Rini Subject: [PATCH v3 05/19] boot: Respect the load_op in fit_image_load() Date: Sat, 7 Dec 2024 10:23:58 -0700 Message-Id: <20241207172412.1124558-6-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241207172412.1124558-1-sjg@chromium.org> References: <20241207172412.1124558-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 Sat Dec 7 17:23:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 2019648 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=MLDciX23; 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 4Y5FRm2Z18z1yRL for ; Sun, 8 Dec 2024 04:27:00 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B40AA88FB4; Sat, 7 Dec 2024 18:26:21 +0100 (CET) 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="MLDciX23"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 28228893D1; Sat, 7 Dec 2024 18:26:20 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd31.google.com (mail-io1-xd31.google.com [IPv6:2607:f8b0:4864:20::d31]) (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 CAA0D89442 for ; Sat, 7 Dec 2024 18:26:16 +0100 (CET) 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-io1-xd31.google.com with SMTP id ca18e2360f4ac-84198253281so203054139f.0 for ; Sat, 07 Dec 2024 09:26:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1733592374; x=1734197174; 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=eeeo3LTMEVCfjxPdDZS28oi5ekOzg9BHJWxs4WVPUYg=; b=MLDciX23klDc9i4PRujjcU9w9iXgp8mtd6iJ97smkNx+6x+50UOEtUw+R/wcFjDgOT fU7Dvh4rk5cFyas9j+fA1CFNbkSbTzcH1pxYMdNv2UyqhgGbxCTyioFsEAC079Fm+x1J Bl5MnPSfH01rP27HUEo30Qou+39sdfq3xE9EU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733592374; x=1734197174; 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=eeeo3LTMEVCfjxPdDZS28oi5ekOzg9BHJWxs4WVPUYg=; b=Rp76H3IRmtrS3PQ+dvcvTa0JNPIe4hBl7ltODih/iSNxN4AFBqDlIFnYhR6/AVfLwo 3eacutAlks8owx8MlGsi/bgm+kRtRoGUjY0sYw6/mqRXU2XtH6+whfdoHmNNKnhTSAvY kOwjvW+xIc7XkEhkjAhoXaqipYyM0/2MzwzoOeG0yuwF0sSrm7eqoSxKQtS5kwU2JlB3 20daHiay7cBLV+Vz7QwNmNaDBZ2zdB062PENthp3jnVwO9lI4rDN/XDAKU/XGMCoTq5/ r2BPvxkISGwPN6ikZo4CfeAy0UuUPhsyd6mBVErhAuqxVSVPdvXV37FmQvlZiVEsKOJc 8Jkw== X-Gm-Message-State: AOJu0Yz5JgtxiVShJMAs+okFHoSVQttcqm+/dm+zmbB582q7TWjDVX/o dUC8ay11u7OOl19w2zgcDeyEi7NZiscJckmyUXUgVj8Vgd8GAXxL5OfI+hdsAeBdMq0DTyvK/BA = X-Gm-Gg: ASbGncsePhoyXA3VS1OTOA5pTZhadnKdeIEc9I7zoQ19D/eS6bNlJHezEhS1lJKt/NJ +A6OuTGznD0lEc8/CAghxWtWEoHKTDfvJppKo08RCxGj5wBfslCcoTkCXYdZ9nSzRn0pyOlxC+j QvxR/P6GpiJA1+qKGttywrQWcSxcYRNOq7YzDE5l7mgDxzVpqGeT7ZZcK/8OM4iiryxvQnTuWNj dDDL71Q8Al7n+/hYLDTqWiviyXeI3hfTz17TDyt+PJCMIJ3ASnTaSh0PckUUWLmHUujU0R5OBw4 YPNzg24Rlf4= X-Google-Smtp-Source: AGHT+IGSGZVxYuoq5MIXasSwS80c1DdTh76bTFHOiNnHYV4/jcxAIwfe49SdWR9rJyP2rpfDjsXRZQ== X-Received: by 2002:a05:6602:640d:b0:843:ea96:f707 with SMTP id ca18e2360f4ac-8447e23ad98mr678143139f.8.1733592374720; Sat, 07 Dec 2024 09:26:14 -0800 (PST) Received: from chromium.org (c-73-203-119-151.hsd1.co.comcast.net. [73.203.119.151]) by smtp.gmail.com with ESMTPSA id ca18e2360f4ac-84473a7080csm171745739f.45.2024.12.07.09.26.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Dec 2024 09:26:13 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass , Tom Rini Subject: [PATCH v3 06/19] malloc: Show amount of used space when memory runs out Date: Sat, 7 Dec 2024 10:23:59 -0700 Message-Id: <20241207172412.1124558-7-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241207172412.1124558-1-sjg@chromium.org> References: <20241207172412.1124558-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 --- (no changes since v2) 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 Sat Dec 7 17:24:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 2019649 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=jGrTZqpE; 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 4Y5FRx5tWWz1yRL for ; Sun, 8 Dec 2024 04:27:09 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1521189428; Sat, 7 Dec 2024 18:26:23 +0100 (CET) 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="jGrTZqpE"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 7DCD488FB4; Sat, 7 Dec 2024 18:26:21 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd2b.google.com (mail-io1-xd2b.google.com [IPv6:2607:f8b0:4864:20::d2b]) (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 4E3FF88DC6 for ; Sat, 7 Dec 2024 18:26:19 +0100 (CET) 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-io1-xd2b.google.com with SMTP id ca18e2360f4ac-8418ecda128so117127539f.2 for ; Sat, 07 Dec 2024 09:26:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1733592377; x=1734197177; 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=6j74QLmzUVfx1nYppzT1UpJ4hWHCPdMUetn6Cp+dtlo=; b=jGrTZqpEga4YZJTOJSqnXCwNCXragTJ+397q5LurIa5b+vNupYv9VIXK9BGBSZiaLU EMyT+BO1qq+9EcXo56CBpHSL2UD87kbtZz/ZDgp8hS1y+dxdstFENncXsWwKVnFCuldu ciVDlQy1P/WGASau+pwKptBa63IWihMxbNdqc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733592377; x=1734197177; 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=6j74QLmzUVfx1nYppzT1UpJ4hWHCPdMUetn6Cp+dtlo=; b=Or5fn92Yk3uscOFo9Z3HzzdQfbkLqvgqexpyJ7I2wVh3lo5vfRsIr7qKZkWiOly/LA Knd1tDHKijc/3EygLd9b3w7b6cxk0fOrUFnCaVnxCl3u5J7nWKuXzZzJnvU0p7W6O1br S6uWwo08DRV/paSNrLYCbUI0cBPG4tN83QrD4vw1GAzeb6vJ8kgFh6FRo1DAFZFPAZsh gAmhF6Dl6wRU1DAce72jUtKgkAO5E8G26qOL540pe6iv+aVBdkxutCWq6A1ML6qjwlS/ S35R6rgV5ER2R9pOaxpygT9+vG2wX1jRknRVZXmIBNOrzhZkOsCuVaTmz1blQG+BAMUd gwZQ== X-Gm-Message-State: AOJu0YxpaJ1EJhzOqSgXTdnPVlA7IBTgCYj/WF2VY80xRH6ihIRdx+lO lsx1460EslBjUzcXUh6jEKtK0AIYeC1sOcGikxEQUtr+NJ5xFPF4xdEmydd/eRNeO3UfFK/W7JM = X-Gm-Gg: ASbGncu/oQDqy6OIJNmzTJ8AeV5wXwiJQT9et613djAVD2crcio6kk8ZTKNneqxwN4F kpldkq2zFyBZmWKp/E8r0Tyaz1ohP5AHJnWLywXRINgAbuczbCEpPX1oU1jPkfn+O4NCbBthKCv JKen2elHek+tzRjRfZuBqnqSZCBbMlBWb0ZA1J/yja1TsiYdtjFmarQps1+ehg6ou/8bu5YyZnc jLY9bmMlnl9uJRz8qxKlKz0/6v/fU7dHc99n0uDZPdAky8cevEImTKonioHZLhuY9TW9yllpqZ5 5Rv2txPw+pY= X-Google-Smtp-Source: AGHT+IET4b4kOyrJ4qvCHRWA3BpXqqiR/z+oH9af3rODXRFhSmeL/MgHmAmnNfQyEi3XOWHGsii8tw== X-Received: by 2002:a05:6602:6c02:b0:83a:7a19:1de0 with SMTP id ca18e2360f4ac-8447e376d6amr1050976339f.14.1733592377579; Sat, 07 Dec 2024 09:26:17 -0800 (PST) Received: from chromium.org (c-73-203-119-151.hsd1.co.comcast.net. [73.203.119.151]) by smtp.gmail.com with ESMTPSA id ca18e2360f4ac-84473a7080csm171745739f.45.2024.12.07.09.26.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Dec 2024 09:26:16 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass , Gary Bisson , Mathieu Othacehe , Peng Fan , Tom Rini Subject: [PATCH v3 07/19] malloc: Provide a simple malloc for VPL Date: Sat, 7 Dec 2024 10:24:00 -0700 Message-Id: <20241207172412.1124558-8-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241207172412.1124558-1-sjg@chromium.org> References: <20241207172412.1124558-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 Sat Dec 7 17:24:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 2019650 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=HJmY4rrD; 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 4Y5FS666DFz1yRL for ; Sun, 8 Dec 2024 04:27:18 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 748DC89486; Sat, 7 Dec 2024 18:26:25 +0100 (CET) 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="HJmY4rrD"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 56BB788DC6; Sat, 7 Dec 2024 18:26:24 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd33.google.com (mail-io1-xd33.google.com [IPv6:2607:f8b0:4864:20::d33]) (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 2D475893D1 for ; Sat, 7 Dec 2024 18:26:22 +0100 (CET) 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-io1-xd33.google.com with SMTP id ca18e2360f4ac-84183532291so218951539f.2 for ; Sat, 07 Dec 2024 09:26:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1733592380; x=1734197180; 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=Ke6QYg+xtnB5Mu9yRGp039weqmWxFSs/11iZzqpG0X8=; b=HJmY4rrDWmmxQ8j03C/wCVjpPG+VRthRXvTlR738uhUA+iajgVXWFrMHSSRtsIIiLf rP4acLZmGHEHpDD/FY9Tq+dSxHU1d1X8W1VzHN1qfyR1xUthSmnPv/s+AgstGpFmEMhg okxvlxPQ4/VLgM8OfzGAgs2jWTbL+WchZhTB4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733592380; x=1734197180; 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=Ke6QYg+xtnB5Mu9yRGp039weqmWxFSs/11iZzqpG0X8=; b=o9sXDzeL+mmg1iM5nRO3Xq0vOg4sCo6ze1WDKHztf/cTQZef2oOlqpcxgCAhYch03o 1LrstnfF6VcSxxqZRkAsmfdmSb1j2+OHF8wsl5INJiadF8XTnEA9vWHiVFqy/WBy5QSQ 7yrSU+P+XAsbGzGAWjlgN8hzH2m2rE7iU3BOTxhE8UD03aGOhlIzlnCCq+9CETb/V2nF x9wwz60PQ1xhLQKAFFKm/RkGUa8tUsE61SOBq9KUAMYH6FiKAU29rrI+BldgJDH3qcG3 ek4vm36IHrIJpb1EoVx4inm2YSdNa7vWnu4TBdFIOLaqTMb7wpAUGnrcszbTGnzcnzYh oa+Q== X-Gm-Message-State: AOJu0Yy0hLkwQiHiJtdQmMZ3DlGOvx+L7mBm4X8zLDQ2f+592j32Au3x HjdvZXxA4woovpKfEGS/LOBXAkVKxogk3uQbHQfrApm1qzr7uRuzNgxk0IcFysWAN+HPDkYw9oQ = X-Gm-Gg: ASbGncvAXkHNdAuRIKYKSQTfiWOpny9qXtbac9gC+CaNdzbFDHOmyhO7evwOyo0uJx8 2/PEqAwApEII8ZwUpfIJbBdBa+7cIxbvKIyFqcDWgU2D1PD3RwVxJHTsiK4P4B0KlKR5DMj+HoA tWhTYGYOFxmPbpTW8NGtVlue7gpyK1M2cdhYdpDN77Z6WoSIzk/lpQQcTrxWmgIkiObQfW9i2GU Do3e9Qnua/fgsYjaHFG+5ktIh6DYC+suODglGtXT2a6S2D8AGd6a32aPgtN/RYeARIK6dX8zkXx 1C+kX+iWRbc= X-Google-Smtp-Source: AGHT+IEeJWrZzCHuT5wr+3DP3JjUekiTSQxsPLKzLDB+1qWiWAGeSV5ch2n2TnbLhfvNEy2Cnez1FA== X-Received: by 2002:a05:6602:6b19:b0:844:7896:a152 with SMTP id ca18e2360f4ac-8447e296ac9mr933726539f.12.1733592380425; Sat, 07 Dec 2024 09:26:20 -0800 (PST) Received: from chromium.org (c-73-203-119-151.hsd1.co.comcast.net. [73.203.119.151]) by smtp.gmail.com with ESMTPSA id ca18e2360f4ac-84473a7080csm171745739f.45.2024.12.07.09.26.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Dec 2024 09:26:19 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass , Gary Bisson , Mathieu Othacehe , Peng Fan , Tom Rini Subject: [PATCH v3 08/19] Support setting a maximum size for the VPL image Date: Sat, 7 Dec 2024 10:24:01 -0700 Message-Id: <20241207172412.1124558-9-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241207172412.1124558-1-sjg@chromium.org> References: <20241207172412.1124558-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 Sat Dec 7 17:24:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 2019651 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=TBJKwcLX; 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 4Y5FSG5CwQz1yRL for ; Sun, 8 Dec 2024 04:27:26 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E10B6893D1; Sat, 7 Dec 2024 18:26:30 +0100 (CET) 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="TBJKwcLX"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 58F3389323; Sat, 7 Dec 2024 18:26:29 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd33.google.com (mail-io1-xd33.google.com [IPv6:2607:f8b0:4864:20::d33]) (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 7D4D9894A7 for ; Sat, 7 Dec 2024 18:26:25 +0100 (CET) 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-io1-xd33.google.com with SMTP id ca18e2360f4ac-841a9c504d4so214356739f.0 for ; Sat, 07 Dec 2024 09:26:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1733592383; x=1734197183; 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=cqj2YVVu9L1AkthObNEdMZy2vUhvoT4ahnmRMzhQ574=; b=TBJKwcLXDukqb55qReht1cLb+ykbimBcqbGGwaUje0kHsEsePhD1buHEvmy5G2yxi9 7dUiFqMOPSiP+n64fWrtpnl2qFGr5/iY9cVSYgnF06+/HtyY1uNWA69SvZTSA7Kt+fsC YxDpXVw0xc9CxI3p49/sdKqIFt4h2yeUmChAY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733592383; x=1734197183; 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=cqj2YVVu9L1AkthObNEdMZy2vUhvoT4ahnmRMzhQ574=; b=c9i3PtbT3nqyds4lFWlO6rHFwXwzADGBRcZE0FTbzG+BCkwQGhA9mqYRIPFEKyM97/ S+wCb3fXcpVdzuL+okULQjWnL+0qDY+SN6U+Dpjfx3zqnp+fiOwQPQTiNoXC621+iuGY 8STvTncIdSg1t66NME3/RJUrSWn9AjFED1RoOyGt8OwWxRODP3LKMFPwDNF3IF/7BTDz OvRXRTAnbsoxDZgZmL6sz+rbWsIDmsHuCOZ8k7wsh7/rFV99rwvgNNwUnQCZNLaO4jNx oWAM5+yizyVloV5p/Snr7Yvig4HT0cwiiE1gNYp02t82U/38I6wxfQH+upyTPo+9GD5n p2kA== X-Gm-Message-State: AOJu0YypC0x7STAEaE5vKlDZTQ0Ca/kWVtW7yin00sEAJkFru6Cvhelz EfkeE92lilwjRtSu7vGYvt97XZqA99SaUg4enVAPZbtsU964/YEid6gcW9VAtIbjKzljaaDWGkQ = X-Gm-Gg: ASbGncuICFylnKWmi6U7V7AwWOVqc1SCFKml92i4t1/d9PfwfTDaMDFggr49xSDOosU 6asMAJ2+tcatRtXP5tMW1rARpaXxq7PRll7S0qR4OgpGzkgplUXCQ03BHeM+76Z7807CQQnvriJ nGL1+ziOcclDinTxa7crHP+bdg00YU4eBOfYP8cTgP03DRE82GjxuqTA9aqIxonXOq9YiotL75L qHU0TBFYZyDaXpcUAK22zac+n/V1dlefye4G+tfe6ESN5+ikzqrz0NyBW1VdBaqf1VQUJhvkRlF GQCmXHC/4M8= X-Google-Smtp-Source: AGHT+IHPAqme6FFrnqDKpUVviCN5piNzdvRPajnSaBhHBDuANAFBDzls/WSzlBasqN4BZoW7Rk3wJA== X-Received: by 2002:a05:6602:6d01:b0:837:7f69:eac2 with SMTP id ca18e2360f4ac-8447e1dac49mr690711539f.1.1733592383392; Sat, 07 Dec 2024 09:26:23 -0800 (PST) Received: from chromium.org (c-73-203-119-151.hsd1.co.comcast.net. [73.203.119.151]) by smtp.gmail.com with ESMTPSA id ca18e2360f4ac-84473a7080csm171745739f.45.2024.12.07.09.26.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Dec 2024 09:26:22 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass , Devarsh Thakkar , Quentin Schulz , Sean Anderson , Sughosh Ganu , Tom Rini Subject: [PATCH v3 09/19] spl: Report a loader failure Date: Sat, 7 Dec 2024 10:24:02 -0700 Message-Id: <20241207172412.1124558-10-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241207172412.1124558-1-sjg@chromium.org> References: <20241207172412.1124558-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 1ceb63daf31..7c57eb8539b 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -612,6 +612,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; @@ -631,10 +632,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 Sat Dec 7 17:24:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 2019652 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=XDAoI7PI; 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 4Y5FSR1w7Sz1yRL for ; Sun, 8 Dec 2024 04:27:35 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 53F7C89462; Sat, 7 Dec 2024 18:26:31 +0100 (CET) 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="XDAoI7PI"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 509688919F; Sat, 7 Dec 2024 18:26:30 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd2f.google.com (mail-io1-xd2f.google.com [IPv6:2607:f8b0:4864:20::d2f]) (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 2187F88DC6 for ; Sat, 7 Dec 2024 18:26:28 +0100 (CET) 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-io1-xd2f.google.com with SMTP id ca18e2360f4ac-84194e90c0fso206975639f.2 for ; Sat, 07 Dec 2024 09:26:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1733592386; x=1734197186; 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=VavxHntR3p2/fvzxP7Xztcud0CIpgaP4QnTEVGJ1nR0=; b=XDAoI7PIfEhdGxWvddK+Si4+ohNfyNT/VgMmvCQcdIJZ7ui74n/XpvHjGsB8ED95dA kund9joT4lxypchqYe4hJ68rD2uMhHfdnUOzkdOYWjk2orTSBqD0XbDSycflhiIMxzcL MkqPn8tp7lAJSzvvNRzG9InTTVK+wJQUp2tRo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733592386; x=1734197186; 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=VavxHntR3p2/fvzxP7Xztcud0CIpgaP4QnTEVGJ1nR0=; b=ILHttaRu1iYM4o3SogRH0mElqGu5uV9RICyf+LhdoC9ml5BhfIU0aG7I6/T56wpEOW rxMp5ObvnbXtDUS6psFkF5rNKEIWGwcFNNi8xCWb0KnIAX3cs7KsZbV9xJLLHEv8fF77 8xb5wTGDIFhW/0A1k0qWrote0/Pwr+EELl6O5W9mWA+qkGtCBiQPwoCjpWO7MaFxucO1 i+KWMDSW5+nMcSJSHm/kWbZl/QdDKStoFbEWvyn1Lg7Pfet/ZidnKUCKvXf8bzk6rE6j wX2c91NBDj+255/UId2axJ7059D3NupzRl1sDlukdoszk/V/DbxcsyMruGJt7yNkHlM+ x4/Q== X-Gm-Message-State: AOJu0YyGrlJBByXn9h5tsYCX7ZwDbwAtc8a+F0/iGex7Yij+vJ6CIeWL g1t2QnhcNRFCHURUVMsRi61rpzEvCPMK1CaWzyioSS9pFyFbvGzlelJZbNVXDvM6T2fdPPJUwpA = X-Gm-Gg: ASbGncuDr5uhFilYq5+6jL+rDAZfNZcH81gMXlZ+Es7utf/pv9kbqhkzPyuUXtLlPCg qWQJMPx0J4JLwpC8ajgjZVkv4wtARBL5/zgyBjQXtSymMpilafwmj0P7iWMWCWllbO0Lmuohnt/ XrARO8R9iBUUFTBMDqfvTMk2HsJ+Bz+u/t/R8kxez0BYs5u8it4o2iypQEV9PMfQctE/hPktIB5 0kuc/73FE7TGX/oxg9nc7FJwV8Mu2vRied/sF1SPsheAdc0qEBgzKTlxiH9Dgr2+ifjezQJ8tuo aoxC11QLiTc= X-Google-Smtp-Source: AGHT+IGbK2vGQt1NgMjyaJKXX2ChOrqbMuhKNj2x84D8gM4HBbPC6QkDlyYCFC1nfpi8hh3ReB3M1A== X-Received: by 2002:a05:6602:2b8e:b0:83a:872f:4b98 with SMTP id ca18e2360f4ac-8447e20126dmr891819439f.2.1733592386401; Sat, 07 Dec 2024 09:26:26 -0800 (PST) Received: from chromium.org (c-73-203-119-151.hsd1.co.comcast.net. [73.203.119.151]) by smtp.gmail.com with ESMTPSA id ca18e2360f4ac-84473a7080csm171745739f.45.2024.12.07.09.26.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Dec 2024 09:26:24 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass , Devarsh Thakkar , Quentin Schulz , Sean Anderson , Sughosh Ganu , Tom Rini Subject: [PATCH v3 10/19] spl: Allow serial to be disabled in any XPL phase Date: Sat, 7 Dec 2024 10:24:03 -0700 Message-Id: <20241207172412.1124558-11-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241207172412.1124558-1-sjg@chromium.org> References: <20241207172412.1124558-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 7c57eb8539b..91ee07f7079 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -837,7 +837,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 Sat Dec 7 17:24:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 2019653 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=A57cb4jn; 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 4Y5FSb4Xrxz1yRL for ; Sun, 8 Dec 2024 04:27:43 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id AB44C89484; Sat, 7 Dec 2024 18:26:33 +0100 (CET) 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="A57cb4jn"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id AF2BD89484; Sat, 7 Dec 2024 18:26:32 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd35.google.com (mail-io1-xd35.google.com [IPv6:2607:f8b0:4864:20::d35]) (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 898AC88DC6 for ; Sat, 7 Dec 2024 18:26:30 +0100 (CET) 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-io1-xd35.google.com with SMTP id ca18e2360f4ac-841a9c504d4so214359639f.0 for ; Sat, 07 Dec 2024 09:26:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1733592388; x=1734197188; 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=wKMRC+5hXVXk1eqUAuIDgrHfbsS/Aw47NS+Be8M+Tg0=; b=A57cb4jnscpG9VNlRoJCfChpsqoOT6y7fu2phpqJQIRkOikeV0uJmAPncUyuUsnbok vWpeXWkRK5nKSzWS0PRDj41JdmEZD3ZMSn3O52tICYD/3AGNLOeMEBmLasA1RIKfx0r1 v0xDETsYJWKtM5/Qzt+n69/UAD5RPCcL7ElQA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733592388; x=1734197188; 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=wKMRC+5hXVXk1eqUAuIDgrHfbsS/Aw47NS+Be8M+Tg0=; b=vriEPtNIvRC3Co2nN56beKXtwfE46CBHahW7I15iPW90VJl2ACqFT9zFJjMi8Brhh4 QIwpfsvbW89yzfrNxWbW+dhqf/KkJgXyYCvVqaH0+9Vq2p3D73zSi1EyF7JMrfqXdlwz eEAsgSkiGZExqA+dSVNef9+yS69PSd+nBslMZIQ2GXEqiSXtL2IJoWb/mJ58GlEjNHMX NYgMVhmVE96OL+UT6zij+40f1eWZ9j0gaFFP7pWSmX7saX2oix1muoGTqD52c6EKbCvW D7hwU9EyjKiMwWXvMIO62wM23ewNBDi9NnYfy18sLlTmYcz6NUHQVqi4S2C3PEOIzqbr VNzA== X-Gm-Message-State: AOJu0YxOTA13uPWc0lH6Ix27m0SF8VMkoe24VYokFrCF1dxI1LdllQQQ US09ZMhH+hjfFFhu1yq2H22+07G00H6sbiXvTcPRiWZ/tXfdqttwfl/hLVIvP694Sn17EuiYh6U = X-Gm-Gg: ASbGncvIWpNZP/NcNQfkCguuHGejiQJPATV4smZmZuSrYQBJanga0nSGtcmMIYCasvq j6STf7N/9Gdx1pGk+4uX/NJ9HJIxjpG/V8mNUC4Am63ghmargePBKjRgFWP0lmVCbTu+tCR1Xx5 wB7hDXqYaHZRPAOftD69vu+VJYF78z5+KLIL18NPIWAFwNzekD8Ck48bq6aPgrBNdfuOqbRQBGV v+wLYrMWjdXAbpH0dQmp+RKvnDxe/7QG7hm8clqZO0L2DW9doXL2Gkt2AqBTmP3cvgysf9Uy9U8 VUP0Cq2yp6s= X-Google-Smtp-Source: AGHT+IFgLRif+UZPxj6iYEdIg8hEZ3BjoRmGB8nfm0AGifA1WchvJMU64TeXC06wpkRI8RO/r+JKTQ== X-Received: by 2002:a05:6602:2c01:b0:843:f220:fc38 with SMTP id ca18e2360f4ac-8447e225cb7mr784943939f.7.1733592388458; Sat, 07 Dec 2024 09:26:28 -0800 (PST) Received: from chromium.org (c-73-203-119-151.hsd1.co.comcast.net. [73.203.119.151]) by smtp.gmail.com with ESMTPSA id ca18e2360f4ac-84473a7080csm171745739f.45.2024.12.07.09.26.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Dec 2024 09:26:27 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass , Devarsh Thakkar , Ilias Apalodimas , Quentin Schulz , Sean Anderson , Sughosh Ganu , Tom Rini Subject: [PATCH v3 11/19] spl: Support a relocated stack in any XPL phase Date: Sat, 7 Dec 2024 10:24:04 -0700 Message-Id: <20241207172412.1124558-12-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241207172412.1124558-1-sjg@chromium.org> References: <20241207172412.1124558-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 91ee07f7079..702920bd2f7 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -896,7 +896,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 Sat Dec 7 17:24:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 2019654 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=nRaLrXSd; 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 4Y5FSl50wSz1yRL for ; Sun, 8 Dec 2024 04:27:51 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 19CD489323; Sat, 7 Dec 2024 18:26:39 +0100 (CET) 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="nRaLrXSd"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1DDF789323; Sat, 7 Dec 2024 18:26:38 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd29.google.com (mail-io1-xd29.google.com [IPv6:2607:f8b0:4864:20::d29]) (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 80DBE88DC6 for ; Sat, 7 Dec 2024 18:26:33 +0100 (CET) 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-io1-xd29.google.com with SMTP id ca18e2360f4ac-843e9db3e65so115106739f.1 for ; Sat, 07 Dec 2024 09:26:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1733592391; x=1734197191; 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=k9FKCNQpzeg7HyEi23UFW0yXEddaB5ql4vSbAJO2ltg=; b=nRaLrXSdhopS6nUJShbpCW2jcjKgGxCHcwUIk3xS3Rv26voL54eQTfflRO5HACDN9g npcTnoG0Tt1Gn5kKJdpyWCilRc18WRq6wjT9DuOK/ccr2ru/CLQwgLyWSOYqd9bm9qCB L785QdKe1pAwB32jAlpcmUKj7kjoRx/Evci0w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733592391; x=1734197191; 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=k9FKCNQpzeg7HyEi23UFW0yXEddaB5ql4vSbAJO2ltg=; b=R8ZRytTzsIjj7i35wVeKhKZYyK0hFDjX6XhF0CC61xDIcIlfDfVJASYaNLx5CEuusJ UpGwU+/jw64lgmDKxLBIG5GJxAqXko+qt4QMkESRWQ79xVVGAF0JgLqWMXLNi2D8uKDl hVhwoafq69EBBAB+5ujPL0vVJuRyOOPCReEx7sgYBT3E1znQLlNKJ7DlXicEedgmze2I /6FRX7xvtA7KBHii9NnHiPl04WlMjtxCUYQhUHIw+bvl2FARYPo7PtIGqW3SAXlD/3EO utZztqYL66LQ7FioF/w07hW2HVEADTMXiR4gXDRA1WH0Avcq1YfHpZS9pLOU5krmBEUi rzgA== X-Gm-Message-State: AOJu0YxeHFbTrapQtThK8EgYsbSrEUcQCnh9shItrYAeWVUidOBgovl0 SV6Rp4EmJetUtCPdm9bsiN+PCNNcZ6AMoZgJ8WQjy7fU9/izGxtLCi349EvJocCdHgO/c/R9rcc = X-Gm-Gg: ASbGnctLis2UqjFhOF/hU8EkuGAdmorsASpnwGc7yndVVWNZUcVcLU4EgpxLmXvGlhX rcRrRpoUBrEfylEN1+TsQiU56rOR4E8Jd4ktVQrMaz/Qjrj++GbtTeFWtqDZwksCl/KtvuR92su czoOJIfPwQoCej81+i8qJVHoHCBUltqD1VWDriUhxQ0/KS4tbQ7gWg+EB+DkIqQlsvhIWpYPaN4 Al1+ug+onaeJQp9XVkqZqvN2o6gj869JvWS8iTrqVtjXH+q9WMRoevt/u/YMdBbHANSbisCOFKQ BWI0ilPsFuA= X-Google-Smtp-Source: AGHT+IFKKki2E4JKEXbcStDOUc7fCsjZfMjN+w+88it/I5nDAtDGx1HvYOFu8R00rmxznxuhko19PA== X-Received: by 2002:a05:6602:2cd2:b0:841:99cb:776f with SMTP id ca18e2360f4ac-844710e7124mr1445078639f.6.1733592391395; Sat, 07 Dec 2024 09:26:31 -0800 (PST) Received: from chromium.org (c-73-203-119-151.hsd1.co.comcast.net. [73.203.119.151]) by smtp.gmail.com with ESMTPSA id ca18e2360f4ac-84473a7080csm171745739f.45.2024.12.07.09.26.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Dec 2024 09:26:30 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass , Devarsh Thakkar , Heinrich Schuchardt , Leo Yu-Chi Liang , Lukas Funke , Marek Vasut , Michal Simek , Tom Rini Subject: [PATCH v3 12/19] spl: Drop use of uintptr_t Date: Sat, 7 Dec 2024 10:24:05 -0700 Message-Id: <20241207172412.1124558-13-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241207172412.1124558-1-sjg@chromium.org> References: <20241207172412.1124558-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 3160f573bfb..ef40a50082c 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 9252b3a3de0..b3efb3e630e 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 269e36bb441..43b344dbc55 100644 --- a/include/spl.h +++ b/include/spl.h @@ -268,8 +268,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 @@ -951,9 +951,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. @@ -972,9 +972,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 @@ -988,9 +988,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. @@ -1007,9 +1007,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 Sat Dec 7 17:24:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 2019655 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=PKYWiY5m; 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 4Y5FSw2Hbvz1yRL for ; Sun, 8 Dec 2024 04:28:00 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6DCA8894C0; Sat, 7 Dec 2024 18:26:39 +0100 (CET) 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="PKYWiY5m"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4D86188DC6; Sat, 7 Dec 2024 18:26:38 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd2d.google.com (mail-io1-xd2d.google.com [IPv6:2607:f8b0:4864:20::d2d]) (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 1DA5F894A7 for ; Sat, 7 Dec 2024 18:26:36 +0100 (CET) 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-io1-xd2d.google.com with SMTP id ca18e2360f4ac-84197c469cfso95437239f.3 for ; Sat, 07 Dec 2024 09:26:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1733592394; x=1734197194; 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=fmYNmrbAeYv0Sh1EWrfaiKx/UwCgZHMfqJoAMoZFvRQ=; b=PKYWiY5mi0Lt7/HHVBZjQyX12Uwe6eQjCZm2dsAXKU//F/SRdov0OiUYYOUfx5jyUH bFNsy3R4aEe9zA/ViGPvuFBDOpz/R5y7pgrjH3GzJUskfKu8D2bGvaM1qbxtP0WaVRZ4 RZ8MYax8DyKUM9/czsF81UQ5g+cwAADZjg6LQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733592394; x=1734197194; 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=fmYNmrbAeYv0Sh1EWrfaiKx/UwCgZHMfqJoAMoZFvRQ=; b=HAaJOjlT6XYsbXJmb1uAIIqnzbFTD4nVKh34S7otD2ZqIJ0yWxC2KnFat5h4V0StEA 08OHHaENkmIoTVzP9Ru1Y4R4WCqeSSCrZsA67fsdyPn87D6eU5IXPAw0XB6XA1tsV8Iv DiRxYcNkMO+IOzZiE9hT3k0fmDM2aMqw2UgvP7Jn6HJJ12XtUrt1XiSzYdex6T/Q7+tp CaOfZ32uCQHBk/Qh4e8lej/0LxPUhPh38b3YuIEnlWLRCrnPOOIsqXFyxuVpqrJDy3Ar yzmFGXiWM3g/VU2WW7jk+u9tDwvhoChpm0dZ3jHWym5Wua89jNt2kC6bZArufywCPPOh S1QA== X-Gm-Message-State: AOJu0YzIGsTn3IX3EwG+a93ll5kZtlezS360tZWdiiKzX+TDAL7EJvX5 PLvZSndwvqkXxlkel75LW2enMgXo5ekhZB/OIaRndjhynDQIED+0R9PTZgr2mHi7O8dwHESibNw = X-Gm-Gg: ASbGnctQGC/2ROt9dpu0R+dFU6/qtY0Ta9R7Gadsm12JlDtTdtikPFW2FIR8ADXgAak ggytL9f7dydsXrOuCImhhuRsoJDpD58aD5CkylvXYC7pBETA4r6LW7wtoo4u62NZPUzqQj7KEz6 YHs5k4IXZTdEtpFNYBn+41sZOmcMKNX/PrJs1A5iyQiOJOOQfQosb9KZinlXIrUq0qLuEBR3XuD DVSaDdY7/IeldYVsXb1hMYWKM2SUQKE0qkm/GLqHCyMDEktWrEVuAPrRP2oiIRQxoCri40OUKYN tQq0K0tLCcA= X-Google-Smtp-Source: AGHT+IE5b3+k2ncmhuweWYO2cFhgkbMuDz5fgcjAeDChl+AvoxSw6zj0zmqWuWqyu25P1yJwOqzMRA== X-Received: by 2002:a05:6602:148b:b0:83a:b901:3150 with SMTP id ca18e2360f4ac-8447e241784mr776081239f.8.1733592394335; Sat, 07 Dec 2024 09:26:34 -0800 (PST) Received: from chromium.org (c-73-203-119-151.hsd1.co.comcast.net. [73.203.119.151]) by smtp.gmail.com with ESMTPSA id ca18e2360f4ac-84473a7080csm171745739f.45.2024.12.07.09.26.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Dec 2024 09:26:32 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass , Devarsh Thakkar , Ilias Apalodimas , Quentin Schulz , Sean Anderson , Sughosh Ganu , Tom Rini Subject: [PATCH v3 13/19] spl: Drop a duplicate variable in boot_from_devices() Date: Sat, 7 Dec 2024 10:24:06 -0700 Message-Id: <20241207172412.1124558-14-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241207172412.1124558-1-sjg@chromium.org> References: <20241207172412.1124558-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 702920bd2f7..ad31a2f8b6c 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -612,7 +612,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 Sat Dec 7 17:24:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 2019656 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=kZfyIXwR; 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 4Y5FT44hHcz1yRL for ; Sun, 8 Dec 2024 04:28:08 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id CC8AD8919F; Sat, 7 Dec 2024 18:26:41 +0100 (CET) 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="kZfyIXwR"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2B17B89338; Sat, 7 Dec 2024 18:26:41 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd2a.google.com (mail-io1-xd2a.google.com [IPv6:2607:f8b0:4864:20::d2a]) (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 EA1A388DC6 for ; Sat, 7 Dec 2024 18:26:38 +0100 (CET) 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-io1-xd2a.google.com with SMTP id ca18e2360f4ac-843e9db3e65so115108339f.1 for ; Sat, 07 Dec 2024 09:26:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1733592396; x=1734197196; 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=7fOVaUbxSDJQRCfCvQ51TYMcbMsmkYpFVeSIAd7BULc=; b=kZfyIXwRgIEVOy6M2EK/QHjSAhS079LxWRCzu/zt4uneNrWnJ8fJL4dtryuA6hW+MP eoUcP93CRm4bdZPHBVkzSgQEtzyUKPBnRzAA3vNjpQQd0ziveINQBLtXikIU+PbmDBIo E7zKsF0lqy0Us9Nt3O0nhaVAn5y8HH7FXbAx4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733592396; x=1734197196; 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=7fOVaUbxSDJQRCfCvQ51TYMcbMsmkYpFVeSIAd7BULc=; b=IE6McKi6twfyQtxlxzkOJqMfsCM4QEbk3ihOOAit8PkR6LqiqUFVv9pZVb0o5QSus0 62ZzYFJJcu+uadNOLRUp56KcttcNywFDQnEzBmJcowhgdhVPZpWVFYa+hxjqE7cbfLB8 NB8378bl5crgWgC+JwXwyqsyAjJgRsknR1L0ZHGFnY6Irk09JWysOevUqB2xwXlrTv2N qQe0kTnvsLx+1wd3LADC+uD8G9SIX5l2ZWivPmEYaiI7EhfaZx5TlsfXMz4GBKyWSPJG zG7wBOH6MDCVNF+K5cTK6nItK1FybGeglo6MB4pdQ1i3LEJgzBMbrqPUltyqXJx6BiHX YTVw== X-Gm-Message-State: AOJu0YwttIuiyDiXvJ/vXRLMKkHHDIea6qzyzP5FlM3hdQGrODJUzGmU YG/SlxXkFOkCvb+SvAJcxT3rUc9VWu92Kw7n3bncjSmZdVL44LB79mPj1RdWgp9VNkmDGOklgE4 = X-Gm-Gg: ASbGnct37X5roxnX7sQ8EI3ZER5+jF1NVnHuMYZCbVxgeXknsl3TcQtLBhgOOg/V5s1 NwJXhQXnNPNhPVIgcSz8+Xk/skkmGJMKKbcaukdmWpPu2IzCyovKfODwGWQA4PwtjxNN0s0B7fE n/OytDAMN2CQHmCcOEPLakByLdszOALvXOpa3qVap2BXLuQZMosUawwi/HxG4L1euzdykeWax94 lNFA8vTl5GV7kPCGaZlK1X6R+sVQ02xLcT1/BIbz5OXs/rVlHGDRgHMQaUbdrEyCF2Z6tzOzx0N C2U8r10A5IQ= X-Google-Smtp-Source: AGHT+IHCwPe1njNqhPQUmFV6SheIl+hLwnw4lM5cf905/6iaobgZhxdxg0sFT8aKjBPJQ3K7oam7Xw== X-Received: by 2002:a05:6602:158c:b0:82c:f7b1:a9fb with SMTP id ca18e2360f4ac-8447e04ccaemr648923039f.5.1733592396425; Sat, 07 Dec 2024 09:26:36 -0800 (PST) Received: from chromium.org (c-73-203-119-151.hsd1.co.comcast.net. [73.203.119.151]) by smtp.gmail.com with ESMTPSA id ca18e2360f4ac-84473a7080csm171745739f.45.2024.12.07.09.26.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Dec 2024 09:26:35 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass , Heinrich Schuchardt , Leo Yu-Chi Liang , Tom Rini Subject: [PATCH v3 14/19] spl: Add some more debugging to load_simple_fit() Date: Sat, 7 Dec 2024 10:24:07 -0700 Message-Id: <20241207172412.1124558-15-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241207172412.1124558-1-sjg@chromium.org> References: <20241207172412.1124558-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 ef40a50082c..ac8462577ff 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 Sat Dec 7 17:24:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 2019657 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=hS/Fu4Lb; 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 4Y5FTD5ZqFz1yRL for ; Sun, 8 Dec 2024 04:28:16 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 38B01895A4; Sat, 7 Dec 2024 18:26:45 +0100 (CET) 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="hS/Fu4Lb"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3C30A89578; Sat, 7 Dec 2024 18:26:44 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd31.google.com (mail-io1-xd31.google.com [IPv6:2607:f8b0:4864:20::d31]) (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 01B47891CF for ; Sat, 7 Dec 2024 18:26:42 +0100 (CET) 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-io1-xd31.google.com with SMTP id ca18e2360f4ac-841a6af60e9so85683639f.0 for ; Sat, 07 Dec 2024 09:26:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1733592399; x=1734197199; 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=VcTQ9iLyQK9+908ud8ys7S8cbFtHSipk+qWONY5Ajmw=; b=hS/Fu4Lbd43eURYdRLbWV2uQpRwiCx+/5+R8ptXdXpydPjO72SOVatwZS63jGBkscA UlBjHbxbsoTlVGxzRQiYD59mEMW/RCD/AJ+SZO7QTlEJLSjWR0gAZLQ+nhjUS8HSlWZi LZ09PcNvX+n7bVaXPetA5XnlnvSrRWew9W+GE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733592399; x=1734197199; 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=VcTQ9iLyQK9+908ud8ys7S8cbFtHSipk+qWONY5Ajmw=; b=s/GnSkzRKlPJh9ptNwdoBp1EOzTMIFglA8HKc0PxRhmRRovOaVfgnq2G0PN8AcBjxZ lcfzAZYwRE+JFxGG5eNzzXlDZy3j2g2t9X5K7NRzNj7WEt0MPMOq1x+NTrUCSXwpHVGh eCqK4ZLm6PqS46wICSufWsEfRjpTl3BqbEP4CM7//OlhH/DF1cU4zyzEgk6+ZyfZqMou SEBAL7VTduvGN9+a/7e1U6OL6eBJ6rD/x6noyK2zr9vPhGfBARcbRJf+VIpQ05Ra8kFT m7p7xPdDIW9O2rsU22QSxnb6aFPB/m9KYk69WfPADEjsoOmvXIms/e+G5AMifj48vvq/ 1ncA== X-Gm-Message-State: AOJu0YwLpwe5SVtcQikZmyUMJIWKdseRjJJue9JynVQQ1P+x/Ohl9Wrt FNzbkecolPPYb+V1T6dCUaUZhOQuChsB0MCDBJg1UR+8jq6ew2L4y75RWI3pzSKW0+vmYtBoIv0 = X-Gm-Gg: ASbGncsMx9lcVer4HH9sbgyXHyU70VTPpwhjZgUB42AR8aarLhE7s9SJDszfZwRekYF pnbKoLiUtAMWJYBYRBbESTIh9bMtY9lxZIAJVhw6MXBLyfZLCXo7G06gJd9ythYMk1ChYn1oiAc tNzn16i6jV8KJX5WuMvP9OuM0qObuEZhHvKdrsyA7YpvxMeIV6SVA633jz3VCpqrn+5JT+SrWfc ci2WrNnqDfzI1o7qwcizIzhJlgvl2VemirVUTVgSCy7OnM4DQZPTsb+Csyz9LV3dvNYe1g7fx+v d/t9hI/kr44= X-Google-Smtp-Source: AGHT+IHFiSC2GFJP164DFLFvXTZMHuBoP41OCT3WByx0sGoAX8rPXJ0U91Ymzo/O764P29dpNbbEYw== X-Received: by 2002:a05:6602:2d81:b0:83a:b52b:5cb5 with SMTP id ca18e2360f4ac-8447e223b79mr843387039f.5.1733592399357; Sat, 07 Dec 2024 09:26:39 -0800 (PST) Received: from chromium.org (c-73-203-119-151.hsd1.co.comcast.net. [73.203.119.151]) by smtp.gmail.com with ESMTPSA id ca18e2360f4ac-84473a7080csm171745739f.45.2024.12.07.09.26.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Dec 2024 09:26:38 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass , Anand Moon , Heinrich Schuchardt , Ilias Apalodimas , Jerome Forissier , Michal Simek , Patrick Rudolph , Raymond Mao , Sughosh Ganu , Tom Rini Subject: [PATCH v3 15/19] spl: lib: Allow for decompression in any SPL build Date: Sat, 7 Dec 2024 10:24:08 -0700 Message-Id: <20241207172412.1124558-16-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241207172412.1124558-1-sjg@chromium.org> References: <20241207172412.1124558-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 | 12 ++++++------ 2 files changed, 41 insertions(+), 6 deletions(-) diff --git a/lib/Kconfig b/lib/Kconfig index 56ffdfa1839..3fa580ab1eb 100644 --- a/lib/Kconfig +++ b/lib/Kconfig @@ -832,12 +832,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 @@ -856,11 +880,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 dbcfa87ebd6..31cfbb67aa0 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -83,12 +83,12 @@ obj-$(CONFIG_$(XPL_)SHA512_LEGACY) += sha512.o obj-$(CONFIG_CRYPT_PW) += crypt/ obj-$(CONFIG_$(XPL_)ASN1_DECODER_LEGACY) += asn1_decoder.o -obj-$(CONFIG_$(XPL_)ZLIB) += zlib/ -obj-$(CONFIG_$(XPL_)ZSTD) += zstd/ -obj-$(CONFIG_$(XPL_)GZIP) += gunzip.o -obj-$(CONFIG_$(XPL_)LZO) += lzo/ -obj-$(CONFIG_$(XPL_)LZMA) += lzma/ -obj-$(CONFIG_$(XPL_)LZ4) += lz4_wrapper.o +obj-$(CONFIG_$(PHASE_)ZLIB) += zlib/ +obj-$(CONFIG_$(PHASE_)ZSTD) += zstd/ +obj-$(CONFIG_$(PHASE_)GZIP) += gunzip.o +obj-$(CONFIG_$(PHASE_)LZO) += lzo/ +obj-$(CONFIG_$(PHASE_)LZMA) += lzma/ +obj-$(CONFIG_$(PHASE_)LZ4) += lz4_wrapper.o obj-$(CONFIG_$(XPL_)LIB_RATIONAL) += rational.o From patchwork Sat Dec 7 17:24:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 2019658 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=loqT0td9; 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 4Y5FTN5c0Yz1yRL for ; Sun, 8 Dec 2024 04:28:24 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 99EDE892B8; Sat, 7 Dec 2024 18:26:47 +0100 (CET) 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="loqT0td9"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E81D988DC6; Sat, 7 Dec 2024 18:26:46 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd2b.google.com (mail-io1-xd2b.google.com [IPv6:2607:f8b0:4864:20::d2b]) (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 9A36689578 for ; Sat, 7 Dec 2024 18:26:44 +0100 (CET) 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-io1-xd2b.google.com with SMTP id ca18e2360f4ac-843df3c4390so97380639f.3 for ; Sat, 07 Dec 2024 09:26:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1733592403; x=1734197203; 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=17hmU392SZZe1Ao2XB7mIXte12oEQvBpxBeRyuWC0/I=; b=loqT0td9pcySbFjOZ0k3IR7Iyp1L3JRoWHKbzPTdEXMEWqy6MlY4I/U+0HlOlp9LsI I1crB343TMzn+ZDpN6+RjR29UWv5VN1t4NSn1uBrGkj+v8GtOB7+utsix4Sqb1v2/JZm 86BgalQBZSC4x+dRIuf9X9zri0E0zvIRnDRp0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733592403; x=1734197203; 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=17hmU392SZZe1Ao2XB7mIXte12oEQvBpxBeRyuWC0/I=; b=CWQ17u75MUBipCtEKYXdS/aiYxSP/j2Pc+tukiYd6lpc6EdVCuXuHYqooc/bGJsA9J 4QR/f6VzMeR0qtg+9RpaPvfsQwPuHM5UnqEBbUY1j8KoDbCHP/NLEhkQH7ArVDlwi1vd fpeovE9Z9p9xVyTK4qhuMSe5JXNhrj0H8/t2BxMUcJjlCqz9VnZXURJEEruWkqlC0vZH z/pSa8mTzH74ImboqLCFZZZgEQztq2IVUbNwfbP4NYBd5E/+MvuUs33TOTIFWsTloWzY BjtsGuaDBc/azgWK0gXaMGrrzPItzH/cv8QIzN4duUaRdMgMC9EThHZ5lY5vRB8tlRYT EAGw== X-Gm-Message-State: AOJu0YwDvXroAsi7KgWTMACphuTuQ7IwAh6nEgAaQqbMkyCygyRWXS83 MJpAy2ecDVybQhF7AhEech2CB6iXEpceupGs48PhezNUqDQeTDSgTBk+uh0hTmVQRwQBcVhWk8U = X-Gm-Gg: ASbGncvs8jRexE8lNzlTZQ4a8RnVVRpeCNVA+op4OMinuwx28Tb8Kt1p9w+kIeY2+Za y8UaeH+TalAY0/yWqadU3WQMb6eMlaf+JdxkCP/n1sNKXVWTlAwJ8uGpoz0T2SRu2Hkwo+LG1V0 WQgPQR8fJFr0L/ZkbZl4i5AD1E07DKcuUNoLXr3U7UKN1wLmnqqIH+CocS4mai4zMpQW3P2/Lxi XCqVx8BMnhCLU8TmIdqlNS4tC39csFd8eteEx5ea903auqn75czJvXv7R2ybn14+AKtHyga6Yn3 mxFBr6PcY3o= X-Google-Smtp-Source: AGHT+IH+IQRMNxeH8DST90zntGdgEfrE1BVD3Os+fm5AfjNxL5DkLAH1pmxs1EYdOgbjD/JJJx96Hg== X-Received: by 2002:a05:6602:6b8c:b0:835:4931:b110 with SMTP id ca18e2360f4ac-8447e21faa8mr992837939f.5.1733592402789; Sat, 07 Dec 2024 09:26:42 -0800 (PST) Received: from chromium.org (c-73-203-119-151.hsd1.co.comcast.net. [73.203.119.151]) by smtp.gmail.com with ESMTPSA id ca18e2360f4ac-84473a7080csm171745739f.45.2024.12.07.09.26.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Dec 2024 09:26:40 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass , Heinrich Schuchardt , Ilias Apalodimas , Marek Vasut , Mattijs Korpershoek , Quentin Schulz , Sughosh Ganu , Tom Rini Subject: [PATCH v3 16/19] boot: Allow use of FIT in TPL and VPL Date: Sat, 7 Dec 2024 10:24:09 -0700 Message-Id: <20241207172412.1124558-17-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241207172412.1124558-1-sjg@chromium.org> References: <20241207172412.1124558-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 ++++++++++++++++++++++++++++++++++- configs/sandbox_vpl_defconfig | 2 + 2 files changed, 70 insertions(+), 1 deletion(-) diff --git a/boot/Kconfig b/boot/Kconfig index 705947cfa95..e8f87e48ee6 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 @@ -268,6 +280,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 @@ -307,6 +341,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 @@ -649,6 +699,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 @@ -727,7 +786,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/configs/sandbox_vpl_defconfig b/configs/sandbox_vpl_defconfig index 84df2b85260..46329395ba5 100644 --- a/configs/sandbox_vpl_defconfig +++ b/configs/sandbox_vpl_defconfig @@ -27,6 +27,8 @@ 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_BOOTSTAGE=y From patchwork Sat Dec 7 17:24:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 2019659 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=Ik34Ho04; 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 4Y5FTX5g7jz1yRL for ; Sun, 8 Dec 2024 04:28:32 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 085CD89522; Sat, 7 Dec 2024 18:26:51 +0100 (CET) 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="Ik34Ho04"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9B81089529; Sat, 7 Dec 2024 18:26:49 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd31.google.com (mail-io1-xd31.google.com [IPv6:2607:f8b0:4864:20::d31]) (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 7149D88DC6 for ; Sat, 7 Dec 2024 18:26:47 +0100 (CET) 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-io1-xd31.google.com with SMTP id ca18e2360f4ac-8418f849466so115714639f.1 for ; Sat, 07 Dec 2024 09:26:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1733592406; x=1734197206; 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=mkz0c06gRRPJZlbLDbF7vNYbw9EquMbF8TIbpry3kCw=; b=Ik34Ho046G7V3oVjlOcxkGknWlGeMhxuY9/1Bjztq3pQLvq95CXAtVjp1rQEpmaHdZ YXJ6U6esxVtXNEnHTs1zh5R+tEFl5RVj2AfDme7WnJttkMXcK4TZ2PfrHkf/mCi6DmGz iTFpXsTS7Km4sR/ChfGAN1EpOfs/qEs27SMtA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733592406; x=1734197206; 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=mkz0c06gRRPJZlbLDbF7vNYbw9EquMbF8TIbpry3kCw=; b=pUYP4eUeipSiEk46nKwes7A2SB3F3G5bm89IuoGjF3bemTImRCIMFbe+lRymVklUmG 3MdJYVuO89FIRLMBgOmHEiA9FROnwpo7hMklEAWu31r+jW17PWy5lk3dE6b3lpkpxbXK LLlTNLIwBeugrOvvMpYzqvcysMJvhKg/x+wmMVibFyxHgTWlSbKQLQuIzHxQl4ZXl/ZK 6wmPVBVeRGZXvzpcZkjYMUG6s5WU4dn68stKgx/lBg+viCSsPTMq8H6GYbrCzKn5ZTlT CSVCAHCoLLbX2ugCkMZZiZoV9QoGMyGiT+JAliQd0T3G2PF6jkZ+drTMueRtMPBzglr4 BvYg== X-Gm-Message-State: AOJu0YwEDVktM/ZxgQ5eY57Y1fceHlCivPBX9NOTQGUC55IT6ulEM/Ic NwNxepuDdf+17l/ctPektFiPbHGzhTsUkgyg141147vaJotq0cLsaGyRVFe/kfnsaaa1/lGx4Xg = X-Gm-Gg: ASbGncu2e28fHiP40odXSQislifE+IxIGRZxeIZGHkKcyHT+QbjBdRYC9nGIHjUIHeq Bu78y/UcuLOVwx1yWYCneYKVuh/WW0VRRi71vGi7KmsJm0vTsqTbWJwZ2d3Lua+IgSbWEEbMNaC OQ71Jpa/N/bF85mzvuBdt7CSMpJWZQgeqikpM9P7ktsAR84cXfg8tx+lTDLIIFK2hqua4byTath XeCZ4tzeGcmiOPjeerfRODJz3jhi15TZxrAn2hQmIWWbRlTksW1YLJh8NQcEdem3JmWMOzNWsz+ wnc+D9RzC5s= X-Google-Smtp-Source: AGHT+IHRAIDD0QjxbXD4njSavbPwlM3FwR5qf2sCG8fSmmNUyUyjUdUjg+aPsxI+upCKn8ecM/8NpQ== X-Received: by 2002:a05:6602:48e:b0:843:f30f:7d77 with SMTP id ca18e2360f4ac-8447e24286bmr870382339f.9.1733592405739; Sat, 07 Dec 2024 09:26:45 -0800 (PST) Received: from chromium.org (c-73-203-119-151.hsd1.co.comcast.net. [73.203.119.151]) by smtp.gmail.com with ESMTPSA id ca18e2360f4ac-84473a7080csm171745739f.45.2024.12.07.09.26.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Dec 2024 09:26:44 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass , Heinrich Schuchardt , Ilias Apalodimas , Michal Simek , Patrick Rudolph , Sughosh Ganu , Tom Rini Subject: [PATCH v3 17/19] lib: Allow crc8 in TPL and VPL Date: Sat, 7 Dec 2024 10:24:10 -0700 Message-Id: <20241207172412.1124558-18-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241207172412.1124558-1-sjg@chromium.org> References: <20241207172412.1124558-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 --- (no changes since v2) 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 3fa580ab1eb..c8ac99df78e 100644 --- a/lib/Kconfig +++ b/lib/Kconfig @@ -719,6 +719,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 Sat Dec 7 17:24:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 2019660 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=nFUjuhgX; 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 4Y5FTh5Qtqz1yRL for ; Sun, 8 Dec 2024 04:28:40 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6DA5F89529; Sat, 7 Dec 2024 18:26:54 +0100 (CET) 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="nFUjuhgX"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9D4C4895BE; Sat, 7 Dec 2024 18:26:52 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd36.google.com (mail-io1-xd36.google.com [IPv6:2607:f8b0:4864:20::d36]) (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 7772388DC6 for ; Sat, 7 Dec 2024 18:26:50 +0100 (CET) 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-io1-xd36.google.com with SMTP id ca18e2360f4ac-841acc8151aso208052039f.1 for ; Sat, 07 Dec 2024 09:26:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1733592409; x=1734197209; 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=la9uV9JGlCvmJGwV0r1ALmFWw5dhDLNTawJTdRGVpgU=; b=nFUjuhgXkJzAb0uyE/mLJIZ6jyugGvDmU3Odt9JMtuBEBb1WGLEZRAtcdhGIliHtWt L5WhHSlPaULPKCBA3parluuxqb0KRdc+/Mh5sYSMoWHz5w5ACyQLeC5vq7iNhTIy5ce6 aVrgMNqqmN/unbLbrtBC8iEPzNVYvqG5Qj7Yw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733592409; x=1734197209; 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=la9uV9JGlCvmJGwV0r1ALmFWw5dhDLNTawJTdRGVpgU=; b=Wgdabyz8MpVxvid8Y1hYZn7a/cJTX7ZMTBwdUp1VYIBdsimph24n1o8Tl+ceTB6WnL yC/GEkBEU0qTCaL19WQSqbm+aGngC1NAGoSdimGE94b8HU6hTi86iFtPB/GR0r/6myRq g34wOaSnj6JLwa9QAORuAjAqW+48Xgk7tY+At7p7iEG0QmwsxvwfzKb/lijl4ZVHNSMU mNOKNAuFAaTuudm86bWc5hrVRAVG1GprdOntTxcWscsr5NCebi0r6M8g1+p52Fqaya/A GPZXf5Qz1N5MsAk4QzJPR7Db69RRDsLeqeZ3LkpKr2qLrdY5+FTszes4INOV/JcgMsRj /LOg== X-Gm-Message-State: AOJu0YzrdaHomcCsVivHcMFbh/SaKvqxilaQjZmVTl4olpk0o1E0j8cl NQ3EFQSbscHAY7xmst4HhWKBBy2FDVGczxqZq5f/vaVO8JFtkC6g3vPqGI9IaxhiKno2+UBGeUs = X-Gm-Gg: ASbGnct1W+uwL+OFZPjZXa3cs0jB5B0Rd4zkvoMt9QWSv6CWLuMWMlGoUy9w6tpQHZA UH4hipyv57TSy7AoajLgBLeoyrGM9ESjKpIpXXtJUtTXmPizxxJ7MDsR63SRDGJKXNSlzee80g6 +QZ2v/E8JTVpugzIDMnLoR+9ko2tBoNoVs2zzf8zovRkaACOBO9aLtQMNo625mDOReK+u2g6z41 zgTdmbJvvMOEHvt11wjZzNGP5bV3KsRzb0ND4hImhb413/rbDVK/oRdsAnpJ7ednDseG6RWPoct 6XZyJkA6Zc8= X-Google-Smtp-Source: AGHT+IEdHliOlKFtEZlH31U7rsbKrYaczdujlJRQtWYLfHn9lIQWtX5DpKw/y4q/5gVzMx6Vq5QIBw== X-Received: by 2002:a05:6602:48b:b0:83a:a82b:f856 with SMTP id ca18e2360f4ac-8447e1fbc29mr932512839f.3.1733592408728; Sat, 07 Dec 2024 09:26:48 -0800 (PST) Received: from chromium.org (c-73-203-119-151.hsd1.co.comcast.net. [73.203.119.151]) by smtp.gmail.com with ESMTPSA id ca18e2360f4ac-84473a7080csm171745739f.45.2024.12.07.09.26.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Dec 2024 09:26:47 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass , Heinrich Schuchardt , Ilias Apalodimas , Marek Vasut , Mattijs Korpershoek , Quentin Schulz , Tom Rini Subject: [PATCH v3 18/19] boot: Imply CRC8 with VBE Date: Sat, 7 Dec 2024 10:24:11 -0700 Message-Id: <20241207172412.1124558-19-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241207172412.1124558-1-sjg@chromium.org> References: <20241207172412.1124558-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 --- (no changes since v2) 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 e8f87e48ee6..73106f7a617 100644 --- a/boot/Kconfig +++ b/boot/Kconfig @@ -733,6 +733,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 Sat Dec 7 17:24:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 2019661 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=bVCTKFi4; 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 4Y5FTs0XdMz1yRL for ; Sun, 8 Dec 2024 04:28:48 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D43DD895A1; Sat, 7 Dec 2024 18:26:55 +0100 (CET) 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="bVCTKFi4"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id CC146895E4; Sat, 7 Dec 2024 18:26:54 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd2a.google.com (mail-io1-xd2a.google.com [IPv6:2607:f8b0:4864:20::d2a]) (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 88A5A895B7 for ; Sat, 7 Dec 2024 18:26:52 +0100 (CET) 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-io1-xd2a.google.com with SMTP id ca18e2360f4ac-843671e1426so121092339f.0 for ; Sat, 07 Dec 2024 09:26:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1733592411; x=1734197211; 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=Ulv0stjlP+4cbSGnOAIl/yn91i+xBY3qRSNdA9wamiI=; b=bVCTKFi4tWTS/Bt8K2kU3pEnnyxux6u+AQiLpAf725hvpNhTHLnNV6efCdvhbdx7oF mkn1JVKNhsSBdGlMP8RZCy8fjOkW0y9roiV/mQfqJkLTOys9/moSUao/dbFLHqyK4paz CIPVgFI9KXbACZAld3pm+jyvQ6O8ZDqBwKOSc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733592411; x=1734197211; 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=Ulv0stjlP+4cbSGnOAIl/yn91i+xBY3qRSNdA9wamiI=; b=BALUmGBCbQuWtePYTDuQz8ovH21qZ8CXf7olR9PATFAOlxa73YCeOmERTBb76MKrHW rdCINQaq6Fve/HRq9XAZKXA3uWDyjf3AEwEtBH7bNgLcM5u047zXTRfYY7Hocmyems1X gfVxknFgbZu98L3dneSpZ52/gPlYZ5rUUnp6D6b84EIwutM+ate+TXV/GixiS0NWUFHd zgyzpaBKetJWQjxVi9D6WU7D1P2Lr6r7QrH6NLEIi4V5vZsiogCBAUfqXPxXPn/eIMkv I2Jx60bEjTMamMYbRrrtJ+oKCZub/b3Lcer+YjIWZw8skweIPRvc0bv6NiGLl5Ncbuyx ZYDA== X-Gm-Message-State: AOJu0Yyr12N0UpV/OwFOSTbXGYB8ahhqT4Jiww9WqucfrUOkq+xxLYb+ BI5bcHAYn/N+B3bGOWE9Xi8dLRfWeOKT74AQAauOoy9k3GAuC0hEf1QJE07Pzhtq4a8Psr31ZXY = X-Gm-Gg: ASbGnctOqpKatC6OTWMAus1xsRxOA1CtQ29vsUoEg6Lrv3i3aJV63NXSL/zNO60OG4C +3yDs6pB1xx8fiA+jTqmuHUJxJfkEi5GOTREUiIdBuKTOu/cIhRboOGY4X6SQggzdCSricyotfZ 2fW2daPzeUFJcCy5IcI9IHBgwJv/7lAqV1ZpKFY2y3R+XR+jWiLltapSC+/tYqIlS+TfbGL2KMx 3z+T4lhZeoivbd1Ayi8FjsdZeviUKQe+RuAgt1giC5RuPFrg5sCV/bxHj/oPzMkeZ/wo62jUiKw OTAHtIO+Oj0= X-Google-Smtp-Source: AGHT+IGAwB4if4TA39HyWqQKQaB4m5w2e0eQLh+1JyIUmu6p3AA+UZazjXs5/RxMWzTIpwjGMz9EfA== X-Received: by 2002:a05:6602:2cc5:b0:837:7d54:acf1 with SMTP id ca18e2360f4ac-8447e200ademr899665539f.2.1733592410826; Sat, 07 Dec 2024 09:26:50 -0800 (PST) Received: from chromium.org (c-73-203-119-151.hsd1.co.comcast.net. [73.203.119.151]) by smtp.gmail.com with ESMTPSA id ca18e2360f4ac-84473a7080csm171745739f.45.2024.12.07.09.26.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Dec 2024 09:26:49 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass , Igor Opaniuk , Joe Hershberger , Tom Rini Subject: [PATCH v3 19/19] hash: Plumb crc8 into the hash functions Date: Sat, 7 Dec 2024 10:24:12 -0700 Message-Id: <20241207172412.1124558-20-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241207172412.1124558-1-sjg@chromium.org> References: <20241207172412.1124558-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 v3: - Rebase to master 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 db6925d6782..5d389420eff 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); +}