From patchwork Thu Aug 29 14:57:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1978510 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=GZa43/vN; 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 4WvktT0MkLz1yZ9 for ; Fri, 30 Aug 2024 00:58:24 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 24CF388C35; Thu, 29 Aug 2024 16:58:22 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="GZa43/vN"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A311A88C0B; Thu, 29 Aug 2024 16:58:20 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-il1-x12d.google.com (mail-il1-x12d.google.com [IPv6:2607:f8b0:4864:20::12d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id DB77688C44 for ; Thu, 29 Aug 2024 16:58:17 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x12d.google.com with SMTP id e9e14a558f8ab-39d2044b522so2698645ab.0 for ; Thu, 29 Aug 2024 07:58:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1724943496; x=1725548296; 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=WsX9jb99takRUHMQMWW+Mt2APc0hODiE34uAeBg6oSg=; b=GZa43/vN4Jfn1ZznN7Ebu/3V+NdPkBvnSsR+GURNfv3mn6UmPCYx+FPAIMRJuoOgH+ umvIg7RQ+Coydk1I7zQdViIa9ZijJi3DjVfX5fTI7wOjTEwYC6hcV473NbypZS89Rm++ KKUJr/WXHyEGQfToskMjuOenyIX3pPGcdk5bg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724943496; x=1725548296; 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=WsX9jb99takRUHMQMWW+Mt2APc0hODiE34uAeBg6oSg=; b=l0xU2/41cMZTAMZ43yzt1O2h3ZakkgwpdRg8G6SiYyqPTTHw8KqI5K3qHgjXWmlXxS F9Q8G+kHpkdNrrs2BFwu745Zh3b+HxxMBlDxM/i47gESO1hMCyZ3T/PmLmrtN/ZYlR6X gT1cuzbtWHSTm5uzJc5Wz1G3rTej/PMeEF0zPPJHQNH0D1xet2cjheGxOQ37yM39D3h7 jKo/+wiLyQ3Z5Q3DollUo2E7GiWHZc4R7o2Jfkk/OTWBb6FoUCivvpblZXS4BLOZHdTY TFvvhs/GT7RxLG/uthIp9U9qWKTW92K/0vxfB16UOVM2YOacSrMISirhYEP63M1zEoO9 43vA== X-Gm-Message-State: AOJu0Yxg/buXmQY/Ek02I0Yudaxx/l/oTlx+UMjWQHj3mJuUGSx8isPv WRTaAjypijXCWizCkQcdo54wzGz/sb80zfzPTRaUEuWRvgBnkT7GgauzmOUTvtImvPeojUEjxD8 = X-Google-Smtp-Source: AGHT+IHFMn5vSFuwxife2vZieBwo69Fy+BYiz/vP+L35Q/+M7Nx+bGUX6chCBVQv7y5GWqsciI4p0Q== X-Received: by 2002:a05:6e02:b27:b0:39f:36f3:1957 with SMTP id e9e14a558f8ab-39f377ce412mr38220065ab.3.1724943496462; Thu, 29 Aug 2024 07:58:16 -0700 (PDT) Received: from chromium.org (c-107-2-138-191.hsd1.co.comcast.net. [107.2.138.191]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4ced2dcdd2bsm284900173.21.2024.08.29.07.58.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Aug 2024 07:58:16 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass , Eddie James , Ilias Apalodimas , Joe Hershberger , Julien Masson , Marek Vasut , Marek Vasut , Mattijs Korpershoek , Paul-Erwan Rio , Roman Stratiienko , Tom Rini Subject: [PATCH 01/19] image: Add a prototype for fit_image_get_phase() Date: Thu, 29 Aug 2024 08:57:44 -0600 Message-Id: <20240829145802.1827952-2-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240829145802.1827952-1-sjg@chromium.org> References: <20240829145802.1827952-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 --- include/image.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/include/image.h b/include/image.h index dd4042d1bd9..dbf8d0e7ba9 100644 --- a/include/image.h +++ b/include/image.h @@ -1183,6 +1183,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 Thu Aug 29 14:57:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1978511 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=goggEmrc; 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 4Wvktg2lP0z1yZ9 for ; Fri, 30 Aug 2024 00:58:35 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8625788C61; Thu, 29 Aug 2024 16:58:22 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="goggEmrc"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 24FF488C4C; Thu, 29 Aug 2024 16:58:21 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-il1-x135.google.com (mail-il1-x135.google.com [IPv6:2607:f8b0:4864:20::135]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id A29CD88C39 for ; Thu, 29 Aug 2024 16:58:18 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x135.google.com with SMTP id e9e14a558f8ab-37636c3872bso3037325ab.3 for ; Thu, 29 Aug 2024 07:58:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1724943497; x=1725548297; 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=BDwgz+tv41oZ9rFU6Vfvvgb6pdQt8SEam8Fm1feulPQ=; b=goggEmrcE6MKJckubrU88TCvnvYJPWCnL+Hk1dvvVbWDr1A1jymoCC7OrR4badlpV5 zz8CY/oxWwK1Fb0uUoyyQHq+BTXopw0jXoWcKQn6PqfQ3fv0R0kzloi1PKZlOGvJGc0R lPUURCyfGQrSPWuqtLLZJ/FUtEl0k3KB+4zbk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724943497; x=1725548297; 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=BDwgz+tv41oZ9rFU6Vfvvgb6pdQt8SEam8Fm1feulPQ=; b=SD2Hef+wvnBofJ/0gABIxxyZoc0DXRHtog00KoCjh5I5ZKpi1sXMVx785XOLxswoy4 YM7z7rOZinmtmv026dd7lrA0gc5fbu2mXksvcM59uc5jJ5d2LYcEpZSokgh8amqM6/2p lWH5vw39l693bXYaMIR81QvGWDeF+VdOsYB/zB/AdfnBgpc2OPvNxlb+GQdrP0AL5e+f +jQrLnTjRVkQzwdsos5VYTTbE5VlMACOE8fhN+bpFoTYzBHu8O7kNe9jUWaoEmFu5Abd a/inNnEOolHUHGWXWwHcTMy4Kt5ynkT0sWUMEv/E8gP/+ZoCF6Uxd89wrDSIvTTybMV+ +9Sg== X-Gm-Message-State: AOJu0Ywhca9cAbWwg1Wx8FhiXAZkfuW3wqBY9OX16aF447oGaPw+nGRK 5/EqCqTXVViLSAK0R4j3chT2YBu66YbF9gVEaN2GlMsr94NvgXn+9GfyaBC9dzI0PmHAxCOAD+k = X-Google-Smtp-Source: AGHT+IG4nzoEmdivdrqc+KUV0oLiUT98XCk1Bs2O2FZAEZN7/WmlhIlxZOtLQW6Fgt/IHfQCiCefHQ== X-Received: by 2002:a05:6e02:1d04:b0:39d:286c:5b72 with SMTP id e9e14a558f8ab-39f378acb8emr33096525ab.28.1724943497263; Thu, 29 Aug 2024 07:58:17 -0700 (PDT) Received: from chromium.org (c-107-2-138-191.hsd1.co.comcast.net. [107.2.138.191]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4ced2dcdd2bsm284900173.21.2024.08.29.07.58.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Aug 2024 07:58:16 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass , Peter Robinson , Rasmus Villemoes , Stefan Roese , Tom Rini Subject: [PATCH 02/19] serial: ns16550: Allow clocks to be missing Date: Thu, 29 Aug 2024 08:57:45 -0600 Message-Id: <20240829145802.1827952-3-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240829145802.1827952-1-sjg@chromium.org> References: <20240829145802.1827952-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 Allow serial init when clock support is not enabled in a particular phase. Signed-off-by: Simon Glass --- drivers/serial/ns16550.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/serial/ns16550.c b/drivers/serial/ns16550.c index 6fcb5b523ac..5cda273623d 100644 --- a/drivers/serial/ns16550.c +++ b/drivers/serial/ns16550.c @@ -570,7 +570,7 @@ int ns16550_serial_of_to_plat(struct udevice *dev) err = clk_get_rate(&clk); if (!IS_ERR_VALUE(err)) plat->clock = err; - } else if (err != -ENOENT && err != -ENODEV && err != -ENOSYS) { + } else if (err != -ENOENT && err != -ENODEV && err != -ENOSYS && err != -EALREADY) { debug("ns16550 failed to get clock\n"); return err; } From patchwork Thu Aug 29 14:57:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1978512 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=LjohDyRd; 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 4Wvkts1djQz1yZ9 for ; Fri, 30 Aug 2024 00:58:45 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 16E7E88C55; Thu, 29 Aug 2024 16:58:25 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="LjohDyRd"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2311388C2A; Thu, 29 Aug 2024 16:58:22 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x131.google.com (mail-il1-x131.google.com [IPv6:2607:f8b0:4864:20::131]) (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 06F5D88C2A for ; Thu, 29 Aug 2024 16:58:20 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x131.google.com with SMTP id e9e14a558f8ab-39d30f0f831so2669385ab.0 for ; Thu, 29 Aug 2024 07:58:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1724943498; x=1725548298; 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=keDK8WpoxdnmmrGjty9ESHIp4bSmIGar8WQ+2qG+S3g=; b=LjohDyRd6buFHRFtHxfg92WwTPB30AsUkPzhxno0sK/0PQUSbZfTr5ZaJnlmK2rEbN l7S6revG7hipgiw80M1thIl6Jk4WyMj6O1pZ2UoUpurKqZcQPn3JBfbqPIHCRvBq/ySD fPqrRyVAA5jkWN437bNnrjEpO/H7JStN55PWM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724943498; x=1725548298; 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=keDK8WpoxdnmmrGjty9ESHIp4bSmIGar8WQ+2qG+S3g=; b=Oh+0WloYoiPvMD3RvmbLv7RGCCYR0/Whog+BHtUyQ6tya7/x1Hcr0Vwg8gsKauoIr2 O/kLGwbGRjVSasrJC84xeKM9wOXMHTC2K2gwCxCp+sfj+JQW6/6AWXS2FbjQWHL1/Js9 ffvGPZfqo29/3gPenznbQvxQC2WaFmR4yByAUQz95pUKJLxfJiia+kcsc1RINPGDJMVd haIAt+Y9kmgjKbQIxCGsZm+a9xw75duq9UGH+74P16UzRZFnyw1pUGmulFGoYVwTdqfE t9vjBYPQ7hrbZBo0+Yjf/Wdmnp+oSZlfAGaYB6nPnwUNX6usHszzMz42tMdYBXv1bA7d VHpA== X-Gm-Message-State: AOJu0YwsQCGwyWziPD3xNjyGa53v43Qfj6FCSciimOcbY8rpds0Nm4Yf FXzcxquRrJG5m5J70EclvDyIl4aGuUYxM4uXaRb18Xq0KtfbX6Jaq7OYlv3UokTCGhLHB+Pkh1M = X-Google-Smtp-Source: AGHT+IGn6D9AoY6Uurr3jbgC/eeRWGlQrmySf+iufriJPnz9xmeELXELcLBfwvVYa4gewU9QFjDeIg== X-Received: by 2002:a05:6e02:2183:b0:39f:3692:7cdd with SMTP id e9e14a558f8ab-39f377cb8ffmr36416865ab.3.1724943498439; Thu, 29 Aug 2024 07:58:18 -0700 (PDT) Received: from chromium.org (c-107-2-138-191.hsd1.co.comcast.net. [107.2.138.191]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4ced2dcdd2bsm284900173.21.2024.08.29.07.58.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Aug 2024 07:58:18 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass , Eddie James , Igor Opaniuk , Ilias Apalodimas , Laurent Pinchart , Marek Vasut , Mattijs Korpershoek , Maxim Moskalets , Paul-Erwan Rio , Raymond Mao , Roman Stratiienko , Tom Rini Subject: [PATCH 03/19] boot: Allow FIT to fall back from best-match option Date: Thu, 29 Aug 2024 08:57:46 -0600 Message-Id: <20240829145802.1827952-4-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240829145802.1827952-1-sjg@chromium.org> References: <20240829145802.1827952-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 --- 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 dbf8d0e7ba9..92128180e0f 100644 --- a/include/image.h +++ b/include/image.h @@ -1423,7 +1423,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 Thu Aug 29 14:57:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1978513 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=Q4AE2vGu; 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 4Wvkv53q4Fz1yZ9 for ; Fri, 30 Aug 2024 00:58:57 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6F55B88C69; Thu, 29 Aug 2024 16:58:25 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="Q4AE2vGu"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B42E488C69; Thu, 29 Aug 2024 16:58:22 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE 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 A34AB88C3E for ; Thu, 29 Aug 2024 16:58:20 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd2a.google.com with SMTP id ca18e2360f4ac-82a1abff760so31381439f.0 for ; Thu, 29 Aug 2024 07:58:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1724943499; x=1725548299; 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=CAyQ5q/rb1NxsQWSkhs8fvm4cK+DeCRQaU1y8WJrLss=; b=Q4AE2vGufua1E+10VC7GoY7NSiAx0MSxg5C6YOYmtChi1g2UlZDZmuU9G/GP+TwjSz MeEWodp5kUt8uHBGn/YaMIHIRYnJ9CwoHcnk7ThTUfyHH7BpOoDKhUUeub0GsHsx1elP /PPUC31Omy8Ip4KdtRLPw6XoxW2ephSVzWMko= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724943499; x=1725548299; 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=CAyQ5q/rb1NxsQWSkhs8fvm4cK+DeCRQaU1y8WJrLss=; b=K5Bk/oiYK3Al7coAbAZQEgNtvATd4XFOXPdqqK1LpQGwti6V6jBhzB1gbQEPYpM531 wL6se3UpQR0qb4yhUuOMfwOoFa7dDr5PvSYPvjlK9vc7H1VXF8Qbo8X1M/e1/FNhZmEI miA5m4aw3TZrv59Qir9VqRKkGDVkCKWo5X2MwrKLFNvHP6Z0Aw/XI3z5/Iff611Pohjd rIrZeLGEf7quGp9ZMtlSCrK6PpvXuW0V93ZEPg6eunNhgHbaCF6JDUVjiZx9WdX/XcLt /CPtzq2UIfi//AU6uD2xk4mbv8Ot0Xf/d9GinevWX8MwFOzxqH1Uo28FnAs0XP6GkXvw fFDA== X-Gm-Message-State: AOJu0Yyqxa6trKnRkapPPhB8JDJXwvUy8kDWaAf4fEyfy5cvYsKX/OjE gDjoR4Lh5PURdraN0sqBb+x0/zWk+VzYzq78cQm5IWLDQS8bwX+oepgYhY2HLRiXO6Q8F7Ka7uQ = X-Google-Smtp-Source: AGHT+IFmeTSeq9ewjrvDzUru+YlQSg72Vg/bIhvk7xa0xBOFLSd/X1N+fszr0ZV4pk9grOWAN8vPnQ== X-Received: by 2002:a05:6602:29cf:b0:803:f97f:59d8 with SMTP id ca18e2360f4ac-82a10d7d132mr398362539f.0.1724943499297; Thu, 29 Aug 2024 07:58:19 -0700 (PDT) Received: from chromium.org (c-107-2-138-191.hsd1.co.comcast.net. [107.2.138.191]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4ced2dcdd2bsm284900173.21.2024.08.29.07.58.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Aug 2024 07:58:19 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass , Caleb Connolly , Nam Cao , =?utf-8?q?Thomas_Wei=C3=9Fschuh?= , Tom Rini , Tony Dinh Subject: [PATCH 04/19] bootstd: Avoid sprintf() in SPL when creating bootdevs Date: Thu, 29 Aug 2024 08:57:47 -0600 Message-Id: <20240829145802.1827952-5-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240829145802.1827952-1-sjg@chromium.org> References: <20240829145802.1827952-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 --- 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 7c7bba088c9..6a0d8466e95 100644 --- a/boot/bootdev-uclass.c +++ b/boot/bootdev-uclass.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -278,8 +279,13 @@ int bootdev_setup_for_sibling_blk(struct udevice *blk, const char *drv_name) int ret, len; len = bootdev_get_suffix_start(blk, ".blk"); - snprintf(dev_name, sizeof(dev_name), "%.*s.%s", len, blk->name, - "bootdev"); + if (spl_phase() < PHASE_BOARD_R) { + strlcpy(dev_name, blk->name, sizeof(dev_name) - 4); + 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 Thu Aug 29 14:57:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1978514 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=apBpEvcx; 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 4WvkvK1wjHz1yZ9 for ; Fri, 30 Aug 2024 00:59:09 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C8D0C88C71; Thu, 29 Aug 2024 16:58:25 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="apBpEvcx"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 92CB688C55; Thu, 29 Aug 2024 16:58:23 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x12b.google.com (mail-il1-x12b.google.com [IPv6:2607:f8b0:4864:20::12b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 8244488C39 for ; Thu, 29 Aug 2024 16:58:21 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x12b.google.com with SMTP id e9e14a558f8ab-39d311d8091so2721095ab.3 for ; Thu, 29 Aug 2024 07:58:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1724943500; x=1725548300; 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=TdSYGK256+/2deGqh9wx5leXr+QjWnQlcourSWu9eXo=; b=apBpEvcxIsB9iHVCC+eBRBuBTDW756+pYoAaHbL66+voLvTO/53aZ1p+ff53O6drsc Ke3hAm36RKQRMToW/t+JFWOdKjS/eRocyrqb34EiHf0fsx9MLUFRMlRu45UP+UjDIRv5 SO5U00jNfsgeKwz/P1A0aN/ocdjbz8xW/v+64= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724943500; x=1725548300; 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=TdSYGK256+/2deGqh9wx5leXr+QjWnQlcourSWu9eXo=; b=lhvPyMsffTFTAJmA0BshksFhvXba4wAO7kR9JsSlcVUFEf5sVkBXyZSzjH388Itzeh j9cgl1rLzVOQI1MOKACshZO8+76ENMZcH4UqX9H0F7pRddQdkys+9Y8M0ggATdscjecr URWAxgvWyuCRrxx37RkP93byWTPIYvyhpWe4AMHl8xkXad6QLS71sg2FvDi3GEz/HLhr XUR5/LqaOIn00hcmtF9f/GVCXK3F/VkXotK5lx7wgi1Sn4LUHvG0U3z9YV7aw+Mf7zRu dpk+06bFJN/UrDQlQU7ILzgmcoejFR7JgeYg74VRPAWzEneCawqAAUQSMqVQ2yTuUacZ lG4g== X-Gm-Message-State: AOJu0Yy1Ak/Mg0+kWA6RTrQRh56c/T7kLufiXk27q+59aickOQjJuqsh Hixu4Dei0cJB5Sm6ZR4RjMbw0AnB4elCNR7QOgrjnuKx2Q9fiVjkNB0zStSKJIxUVyuvsjAl2uQ = X-Google-Smtp-Source: AGHT+IGsviBdscJcxkZdY29bM/eevMWwIoeNqy/fHeLImBzqzeSRlIyLMzjQeW0Tf/eOTnqg2FImiw== X-Received: by 2002:a05:6e02:4b2:b0:39d:4c8a:370d with SMTP id e9e14a558f8ab-39f37837f5fmr33694535ab.18.1724943500134; Thu, 29 Aug 2024 07:58:20 -0700 (PDT) Received: from chromium.org (c-107-2-138-191.hsd1.co.comcast.net. [107.2.138.191]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4ced2dcdd2bsm284900173.21.2024.08.29.07.58.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Aug 2024 07:58:19 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass , Igor Opaniuk , Ilias Apalodimas , Maxim Moskalets , Raymond Mao , Tom Rini Subject: [PATCH 05/19] boot: Respect the load_op in fit_image_load() Date: Thu, 29 Aug 2024 08:57:48 -0600 Message-Id: <20240829145802.1827952-6-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240829145802.1827952-1-sjg@chromium.org> References: <20240829145802.1827952-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 --- 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 Thu Aug 29 14:57:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1978515 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=b4Ae/waI; 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 4WvkvY65xnz1yZ9 for ; Fri, 30 Aug 2024 00:59:21 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2D71D88C7D; Thu, 29 Aug 2024 16:58:28 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=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="b4Ae/waI"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 7B14188C4C; Thu, 29 Aug 2024 16:58:24 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE 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 6A5D988C4F for ; Thu, 29 Aug 2024 16:58:22 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd2b.google.com with SMTP id ca18e2360f4ac-829e856a159so36152639f.0 for ; Thu, 29 Aug 2024 07:58:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1724943501; x=1725548301; 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=fbFHuo366UOzjd1TopN6GKVwDGnUsMhtI4cdRsRc2Ac=; b=b4Ae/waIiG5Q+5DyV7uYkEA8+ZerorT8Lt2tN5eN5npYnBK5aElnfNriiQHpS+sYQk YCr06uDf6d0jMJhQhYUHys14O4QHlXVDbTGsLhbLR7S5QFddOTac0ngddolxhTb4zeyh fV+bKdPxVtc5H56JR/dcQpEDjed/alTJmbZdo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724943501; x=1725548301; 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=fbFHuo366UOzjd1TopN6GKVwDGnUsMhtI4cdRsRc2Ac=; b=W/cUwhvBMmEIlX7m6i/DHlLRhxcCC2NoyUvh10P1PnGvrxi3KAu3P7QGPixADOJfwC r3Wwc9telFeeATVosH1i1C7Pdp+PIOQBgrd+iXnjiFihb7oVADsG91ArFcdGfD3i1JWm 0PIwsFTn0gWU4v2vSd4+HpHaCKYJb82NiD3a8Ebkb50xIT9fUUen2HoxOBBXQpZF/+pi WYbj13n7UxMWTxcZM1QfKeA9mDY8kU3NaGamyDlTKYbV3AxrFSIeu83s5YdEAGcKdOqa vlMS9O9+GJswg2wboDSKKd2dgqhTP/M/+lu587e5wYK1Z3/6/jnRcl9JQsWUi4xnnW85 sGlA== X-Gm-Message-State: AOJu0YxD0vtXgbn1ve8+hLVaWSOPUMiZRu5pT6jND4Mvciz45aWQMIKB pUfLDY2zBZBI/pANqjepmaNEvbG77aGkGKLcQfsuFTgpDZLvFVeWBEIFnFEYrsJRJFF75kBbmIw = X-Google-Smtp-Source: AGHT+IFlkAelaZ071Iei/XGK4Fa6t1cZtNifJhc4GG4crvVrm8VOmJY2pU+PeH49KWjJ+jpugS8Y8g== X-Received: by 2002:a05:6e02:16cb:b0:37a:9ab7:ce34 with SMTP id e9e14a558f8ab-39f378608f1mr40809105ab.19.1724943500922; Thu, 29 Aug 2024 07:58:20 -0700 (PDT) Received: from chromium.org (c-107-2-138-191.hsd1.co.comcast.net. [107.2.138.191]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4ced2dcdd2bsm284900173.21.2024.08.29.07.58.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Aug 2024 07:58:20 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass , Tom Rini Subject: [PATCH 06/19] malloc: Show amount of used space when memory runs out Date: Thu, 29 Aug 2024 08:57:49 -0600 Message-Id: <20240829145802.1827952-7-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240829145802.1827952-1-sjg@chromium.org> References: <20240829145802.1827952-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 --- 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..f2b3dc53689 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 %lx %x\n", new_ptr, + gd->malloc_limit); return NULL; } From patchwork Thu Aug 29 14:57:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1978516 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=Cxb7DKbE; 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 4Wvkvp72vDz1yZ9 for ; Fri, 30 Aug 2024 00:59:34 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8B0FA88C7C; Thu, 29 Aug 2024 16:58:28 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=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="Cxb7DKbE"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 38FB388C68; Thu, 29 Aug 2024 16:58:25 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE 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 271A588C3E for ; Thu, 29 Aug 2024 16:58:23 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd29.google.com with SMTP id ca18e2360f4ac-82a22127e97so18153839f.0 for ; Thu, 29 Aug 2024 07:58:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1724943502; x=1725548302; 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=RHNHz6op4mTjIk24HuuufD1kSTRfTm/UKGJmAiYD1pI=; b=Cxb7DKbEXrUXsiTk3NIjxTd39/ZDvT87aQRFhdPdOqzhTSVTl8hZbSygcm1pLS+8T7 wruJlWnBVmPU4RUZTO6LAW0OsUu1DjNhvtVmDYqMeTjchcdBJBQB5PWwb9gLrt+qVTUj n7Ycl6QiIIEEA19ZJHxu6M9bWvnPplwMJ0cR0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724943502; x=1725548302; 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=RHNHz6op4mTjIk24HuuufD1kSTRfTm/UKGJmAiYD1pI=; b=k+T4BWKoOrr35v3MFvtRL2xdbc9DegOjlskoEk/oVvs8659uUo8XubNZYQu4HM4ztt aq4xgmj9Cz+VXIvn1Y5d3YAvAdhBHpiIhwqghHOXgu55shZ0pthKwd8dVnAN0kNjthBG gIEi4jMSipZn0vlseznjR+tI8HZfv/OjX2++6Vnl0MAks8AiEsfIVcuQ4Jv8lI2g1rX1 dN5ne5AQOVUxa5qHSvRyZgtvmuLuxP+E4t9rnIPiQZYka8hW/4xLXo2qESAVzmeB8UGU ttzravclpO5JCr1pLFEAfpQjAWJN6sP7k90SOqLqBsW86ilXmWR8KvUqMO/JvhHekS/n 81tA== X-Gm-Message-State: AOJu0YyKdf4NU7fAFDDJOsl1L9U2oXZvhpa3VLZy33MIJpb3zPXVHNod osQTkRxwJs2RVZBjpjaQctGKceypAoFSttd2jyD42mLJXe5iCbvXqHexOyaFMS44aXDaeeGACB0 = X-Google-Smtp-Source: AGHT+IGRFHbSO5aGqMg0sq3/Ta+9aVhsXmqvfeDiGsuNNHP5yogBRff73LWWxrXrVWHnIGR0QSjLJw== X-Received: by 2002:a05:6e02:194a:b0:396:f026:b0ac with SMTP id e9e14a558f8ab-39f3781de65mr43424885ab.14.1724943501714; Thu, 29 Aug 2024 07:58:21 -0700 (PDT) Received: from chromium.org (c-107-2-138-191.hsd1.co.comcast.net. [107.2.138.191]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4ced2dcdd2bsm284900173.21.2024.08.29.07.58.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Aug 2024 07:58:21 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass , Gary Bisson , Mathieu Othacehe , Peng Fan , Tom Rini Subject: [PATCH 07/19] malloc: Provide a simple malloc for VPL Date: Thu, 29 Aug 2024 08:57:50 -0600 Message-Id: <20240829145802.1827952-8-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240829145802.1827952-1-sjg@chromium.org> References: <20240829145802.1827952-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 --- 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 Thu Aug 29 14:57:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1978517 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=T3ne8dZW; 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 4Wvkw30yGpz1yZ9 for ; Fri, 30 Aug 2024 00:59:47 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E927988C8A; Thu, 29 Aug 2024 16:58:28 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=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="T3ne8dZW"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3595188C7B; Thu, 29 Aug 2024 16:58:26 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x131.google.com (mail-il1-x131.google.com [IPv6:2607:f8b0:4864:20::131]) (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 2085D88C39 for ; Thu, 29 Aug 2024 16:58:24 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x131.google.com with SMTP id e9e14a558f8ab-39d46ae7863so2584065ab.0 for ; Thu, 29 Aug 2024 07:58:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1724943503; x=1725548303; 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=TzDaMWdoHFXaO7z6pyFLFNlODf2IMqS2NYtlhl5U9eU=; b=T3ne8dZWNpl70c/yzbGi47GMHV3BUTTjGI5SdDXxvl/D7g2iCTFJoSrZTJ52y6tXoH TP5qaCMsr3O3MoF81l0fZG4wfn2sLvDR9i/iuTzP6ddOQJtXxI8leZMkHMlIIvB70dci gSPUvz5eOPkYihs6YIrHpvyqzbvIVvbvqsS6o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724943503; x=1725548303; 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=TzDaMWdoHFXaO7z6pyFLFNlODf2IMqS2NYtlhl5U9eU=; b=w2Y4NaG5RXP4SKS2wPN8EiCA+lFS2xs+b8eXwz6fmFYEduE/ifsXuJ+HMdEaNst1WV b41tN7v/7jMqV8tmmRaFlFGLYNUjxUFV02CYVwOv57JB09Erk8EDHTCb/HsbDUZzXHuR yUhYDhWRiypPRPwfQI8TagwjVSS7fmSZf94eGhDe957/lLn8BNS/FpOIHJY+oquYTFV+ FAWFfGvqfWBsR7BFSJxFKe/XEJmfXWEvSsWFf7GhlqJKhvu5Lp51GCCmk8HqvQeyHDVQ iTapYgzrcpsqgYqU22SO5gOPxmLZYsExu3oZJciQw0vW1VZ19Svkar4HHsd22E1qaqru +EPw== X-Gm-Message-State: AOJu0Yy7KSN1VdQBBobdFWii7LlADKvM/sNJCIg0zDXAr4P1LNSOIpxS g7XKVarlGr1XJj9+H4DbEbP9lz7mffXZjzEx3DlT8Y9QIEhd9r5rhCQp7UGs5VsyqOj6pU5ZFIo = X-Google-Smtp-Source: AGHT+IGYuhKic8CCIOn9HHQHIx+H+kYS9or080aN10oYFx+rHlxPBZoYfxlo5RIhzx9f5EIoVxyw8g== X-Received: by 2002:a05:6e02:1585:b0:39b:3a29:b860 with SMTP id e9e14a558f8ab-39f3b32c17cmr14313925ab.4.1724943502705; Thu, 29 Aug 2024 07:58:22 -0700 (PDT) Received: from chromium.org (c-107-2-138-191.hsd1.co.comcast.net. [107.2.138.191]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4ced2dcdd2bsm284900173.21.2024.08.29.07.58.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Aug 2024 07:58:22 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass , Gary Bisson , Mathieu Othacehe , Peng Fan , Tom Rini Subject: [PATCH 08/19] Support setting a maximum size for the VPL image Date: Thu, 29 Aug 2024 08:57:51 -0600 Message-Id: <20240829145802.1827952-9-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240829145802.1827952-1-sjg@chromium.org> References: <20240829145802.1827952-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 --- 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 Thu Aug 29 14:57:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1978518 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=BNPkOiWq; 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 4WvkwH2fH9z1yZ9 for ; Fri, 30 Aug 2024 00:59:59 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4C91388C90; Thu, 29 Aug 2024 16:58:29 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=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="BNPkOiWq"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1B96588C7D; Thu, 29 Aug 2024 16:58:27 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE 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 050BF88C4C for ; Thu, 29 Aug 2024 16:58:25 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd2a.google.com with SMTP id ca18e2360f4ac-82a13d1c8f9so36713439f.1 for ; Thu, 29 Aug 2024 07:58:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1724943504; x=1725548304; 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=ixclGoSsfN1D7gNPxGNFkSpMFxxd4DaA+G5KLLTyiG8=; b=BNPkOiWqJKSA9zvUh6xxedUGFJ/HoOGwADjqyIFdO/5d82OkvtEuYFYMPOagyfEf9+ gbfl+ZQfxSDs/0I636NC94FM28leI/NQmF1f4/9aSbZyo4c4ZNwkXECy03KVBpJL8Wk/ DaylJaLShIc4Ac48sNFJhC5JZY1PWWe8FklVc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724943504; x=1725548304; 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=ixclGoSsfN1D7gNPxGNFkSpMFxxd4DaA+G5KLLTyiG8=; b=Jw0I5ey1bMBr16aFFUAOfdH9eiWKfr8VCiPEe0QMahIwLwqIoFh4EI40dUFNE1toE2 Lm6/Aic8hWTpR9n2pDaEzswuOKUqZrxwb/KJDYMaadBdE19Ncjv2x8nAMZ4+0ES/SlT3 cmwvR35MWFq0E4hO5WTcclIEiHFHaAud+5OwR3xCe5oJbPfgf9z5YG/nHUtVAN4gxl86 FC1IxX52CxYNvP3/9CgtRaH/50xfHmLWvmAUXB7hT4LRH+w17smCJiTVnoMTym/RyXVb lXM4dux+FqOWxnMAnJ7yzC2R7zTK8q3UwNjqq7XrV3uQHZoD2zxEqjZZMjbmKDdwHCQp b4YQ== X-Gm-Message-State: AOJu0Ywe69SFDjDinKDWbP3UWrQ3C4YR2n+CqJVLmtv1Uvc5gJCzOjQf 7mJ58VG1qqIT4yeaDqvbcM53GwO7qn82xwhjInW56hQFQiOHKO38OrgZQ2LmbG7Emqs+bDyTRAo = X-Google-Smtp-Source: AGHT+IFSXe/fd8mujhoX7HwK8FG0m4GbAljQNTc9HHsDeUP4iLEQIMfATjlxgx96bIvBvFuaEn/+gg== X-Received: by 2002:a05:6602:150c:b0:803:4fcb:6e10 with SMTP id ca18e2360f4ac-82a1109b3a7mr281119339f.15.1724943503622; Thu, 29 Aug 2024 07:58:23 -0700 (PDT) Received: from chromium.org (c-107-2-138-191.hsd1.co.comcast.net. [107.2.138.191]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4ced2dcdd2bsm284900173.21.2024.08.29.07.58.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Aug 2024 07:58:23 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass , Devarsh Thakkar , Quentin Schulz , Sean Anderson , Tom Rini Subject: [PATCH 09/19] spl: Report a loader failure Date: Thu, 29 Aug 2024 08:57:52 -0600 Message-Id: <20240829145802.1827952-10-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240829145802.1827952-1-sjg@chromium.org> References: <20240829145802.1827952-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 --- 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 da110ee0783..143ae96baf0 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -613,6 +613,7 @@ static int boot_from_devices(struct spl_image_info *spl_image, for (i = 0; i < count && spl_boot_list[i] != BOOT_DEVICE_NONE; i++) { struct spl_image_loader *loader; int bootdev = spl_boot_list[i]; + int ret; if (CONFIG_IS_ENABLED(SHOW_ERRORS)) ret = -ENXIO; @@ -632,10 +633,13 @@ static int boot_from_devices(struct spl_image_info *spl_image, "Unsupported Boot Device!\n"); } } - if (loader && - !spl_load_image(spl_image, loader)) { - spl_image->boot_device = bootdev; - return 0; + if (loader) { + ret = spl_load_image(spl_image, loader); + if (!ret) { + spl_image->boot_device = bootdev; + return 0; + } + printf("Error: %d\n", ret); } } } From patchwork Thu Aug 29 14:57:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1978519 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=bHadsfLX; 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 4WvkwX21xZz1yXd for ; Fri, 30 Aug 2024 01:00:12 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id AB62B88CA8; Thu, 29 Aug 2024 16:58:32 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="bHadsfLX"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 69C3D88C81; Thu, 29 Aug 2024 16:58:28 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE 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 5C68C88C39 for ; Thu, 29 Aug 2024 16:58:26 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd2b.google.com with SMTP id ca18e2360f4ac-829e856a14eso37559239f.2 for ; Thu, 29 Aug 2024 07:58:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1724943505; x=1725548305; 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=B2I1C3LfZG41zfMr9SHsIZt4dxxjWSVcsp5C/TUHF08=; b=bHadsfLXnKKh+UnG2H6/gaZDQFQqN1vIh4eCiT+IQ1iGHVpNGCLYfQMvHKkajkDRLR KZcp3YwHHTuZRzVeeVG4Kw4TypIVTR4it9VXpecynNOGyPjSxVhDwT65Ywf0Q37IbQRE 2te/zTOUqA2q1Vd35rOpHlK3Od6Xvz9kKb9Vg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724943505; x=1725548305; 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=B2I1C3LfZG41zfMr9SHsIZt4dxxjWSVcsp5C/TUHF08=; b=OPrqAqBr26OLZSSgKYAQ1qfDke46wUjTPn54DNiqifYrqk7PSMsipTwyo1fXdxa38F FnqMlE2p+DH4sjR8ZTzSbf23/n1TLi8etl2pcccNtU2rkYFCACXZHaw6W01OPRCTR3ts 5SJV4i/r2KJXHEYmfnKrDVZ2YeoA2dqoD/825AOnwWx0jqBXIzWGqv4L3inz7SBRLeYe Jur4o1h6SvwzWCBl/pTiuk4NTH/HuFmHFQrF38ckZlQJCH7YDRpEYZOIYqg7Nb+xVmY0 DNt73pd/isxJU/v9unHAT2f7MthBobgXF1z9UlJ8i+USwQ57jXGImDrFcz8Dxrm6OrU6 pZqw== X-Gm-Message-State: AOJu0YywMgJHb2VpRTQuK+HAqrylDlHyLUSHRHVUE/lydQkD+bxx2l6p yaNA8KMORjr0kXiUhg7hmAisJYxf1UdMgDTehoN+wd1DQnwfeRGytLMbR3a+LEwjfdOmqBkcjDw = X-Google-Smtp-Source: AGHT+IENo1UUwWHZnxI/cViU8AICusBJ44IO4NbRRgIkxhFh8VTlD7jJbovQvSNLiKbS7+CQ9gSaMA== X-Received: by 2002:a05:6602:2d8e:b0:825:2c2c:bd8f with SMTP id ca18e2360f4ac-82a11094862mr396923839f.14.1724943504361; Thu, 29 Aug 2024 07:58:24 -0700 (PDT) Received: from chromium.org (c-107-2-138-191.hsd1.co.comcast.net. [107.2.138.191]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4ced2dcdd2bsm284900173.21.2024.08.29.07.58.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Aug 2024 07:58:24 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass , Devarsh Thakkar , Quentin Schulz , Sean Anderson , Tom Rini Subject: [PATCH 10/19] spl: Allow serial to be disabled in any XPL phase Date: Thu, 29 Aug 2024 08:57:53 -0600 Message-Id: <20240829145802.1827952-11-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240829145802.1827952-1-sjg@chromium.org> References: <20240829145802.1827952-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 --- 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 143ae96baf0..8b868a298f2 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 Thu Aug 29 14:57: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: 1978520 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=L16Z9A1u; 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 4Wvkwn2J6Zz1yXd for ; Fri, 30 Aug 2024 01:00:25 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0E30788CB5; Thu, 29 Aug 2024 16:58:33 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=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="L16Z9A1u"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 86A1D88C7B; Thu, 29 Aug 2024 16:58:28 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x135.google.com (mail-il1-x135.google.com [IPv6:2607:f8b0:4864:20::135]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 7E3DA88C44 for ; Thu, 29 Aug 2024 16:58:26 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x135.google.com with SMTP id e9e14a558f8ab-39e6a1e0079so3035285ab.0 for ; Thu, 29 Aug 2024 07:58:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1724943505; x=1725548305; 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=85NKdbRzECFFiLrs7Zk1lTb+EsF7zKuVVuVy4v3EsqM=; b=L16Z9A1upZeX15QtXD0+kA2JSPVZnSgCNZQhED704Tks91HvPNsJlruv82gEc2ZQgJ 8RMoeiAElXdwJZTiHYxZZnF+nqu+9MWkDUu3sJ8edwWW+jnQJQBcSYS+plj13BjJvC4z l9lWuYLWxsNtkyBp6Dkvuf71KhkE0mcpmh3yU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724943505; x=1725548305; 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=85NKdbRzECFFiLrs7Zk1lTb+EsF7zKuVVuVy4v3EsqM=; b=ZRvPpV6NjOcZDR1nj/Z2/IRAEMbMbG75lgU2YyMS5ZOUSA68Dnx5wTi37LqKSrJaQI 9B4/Me1zEUKS1JTfI9QbtxEfXSTYATZnYmlQZ3rZZ3ov21tO+zm7JWWKud6l72HugnFl Vr8iVEzbA40oDtUMtsT/jbrI8p//NxN1WUPR/K7Wt9IbVZqnS5ssPEr5SVrtS4fH3epp ihRe1802CYrCP68uL3NVdDuQleiGT1vbs3w0Rmd8aRUf7x8iv/R+qsHZuUEPmig4+rLA VNM5qHeWYKUCand5KVq5heuGDsgsgKE5ma/ArGmWJGHB1PEiKjZERgSbcCNSmmsm0dOm 5dQQ== X-Gm-Message-State: AOJu0Yz9sXVdKmu8abSPurAK5IqAtIfWVAksKehuZV7m53uVmi9S5B7C QMYxR16Qb/3oJCNpcviXP2F8Xtze4Pe6MTpCYnzITHezIC6DiIrDQX7rjUfZLHVdji6Eu/ZMbOY = X-Google-Smtp-Source: AGHT+IHMmkQuc98S9X+gW3Mp5SBxICtAJ2H6Tl2oGvo3SBIO7HfbcL3IoycadEz7oRsIASe2R80azg== X-Received: by 2002:a92:cd82:0:b0:396:d1c5:e5f with SMTP id e9e14a558f8ab-39f377cb444mr39013515ab.6.1724943505188; Thu, 29 Aug 2024 07:58:25 -0700 (PDT) Received: from chromium.org (c-107-2-138-191.hsd1.co.comcast.net. [107.2.138.191]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4ced2dcdd2bsm284900173.21.2024.08.29.07.58.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Aug 2024 07:58:24 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass , Devarsh Thakkar , Quentin Schulz , Sean Anderson , Tom Rini Subject: [PATCH 11/19] spl: Support a relocated stack in any XPL phase Date: Thu, 29 Aug 2024 08:57:54 -0600 Message-Id: <20240829145802.1827952-12-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240829145802.1827952-1-sjg@chromium.org> References: <20240829145802.1827952-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 --- 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 8b868a298f2..5c687cfc73b 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 Thu Aug 29 14:57: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: 1978522 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=Y43iISrf; 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 4Wvkx22rqSz1yXd for ; Fri, 30 Aug 2024 01:00:38 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 61E5088CC0; Thu, 29 Aug 2024 16:58:33 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=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="Y43iISrf"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6B20888C4F; Thu, 29 Aug 2024 16:58:30 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-io1-xd34.google.com (mail-io1-xd34.google.com [IPv6:2607:f8b0:4864:20::d34]) (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 9DA8888C4C for ; Thu, 29 Aug 2024 16:58:27 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd34.google.com with SMTP id ca18e2360f4ac-81f9339e534so33879839f.3 for ; Thu, 29 Aug 2024 07:58:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1724943506; x=1725548306; 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=ruIV0gP0m5I6cDk2IbmBk1GQluxfzSR0nxQN7a6yGGM=; b=Y43iISrfu348xLhxQ/vT8oudvbHwyzybz3BslfJ6q825Xt8XsiAYVNPueQCqzHZroR GEvSCvXJKH3KvBYg62yBTCK5XDiRK2mHR/JL7D/colBGkQWl2OPbrLUJp5dv+9W7KVKb +9itWxgG1Uq3oB9N2abGORHw6rChrTL/HbGxM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724943506; x=1725548306; 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=ruIV0gP0m5I6cDk2IbmBk1GQluxfzSR0nxQN7a6yGGM=; b=i5P6U+LBjYb98+IantiUL5IQOL3wJXes2UlFugzPSd1FGsh5j0+7wCDnTR8Zkmctqx SgMz+FVoRbyvOB4FjlOzO6irhZMSihBI4uY0m8LKWTD+qjLDuAMYUIJ6ltBgHDZuYvhj UUwu/IvesllUBVTZOQ2Fi+yKfDj3bBNFuxGywZBkR8rgyybEHbuEnP7rX6AFhfw75FLh sWcg/rO/BHD/NTuo++4Ff68EXQXfWPeKQp2Rbe8EP8rkRtpeYPdbKuhoQrLkVODxt/aq 5oADOO8Aj2psOMM5SxTNrOACsD2DkCIB0S9aUdY+SHcIShgZrkGC3pGXcJclpSrGlXyn tHrg== X-Gm-Message-State: AOJu0YyTnG7IApYDAM6df/asJ7uXhEkFdl07KsETXW4SS1EXZi3+HT7a a0nWRlaVOuMpNeskFedE/tIB8B6xXS6w+wBkWE0fA7VFKBb9XiyNr58JbMuXjKfI/2rUplYegTM = X-Google-Smtp-Source: AGHT+IGxdCULi38sZQ+H52zJyDa8CX0OmFGoxYWaZW23cdYCUNLaM3uLUkx7TR2nzauCI8sIQROBgw== X-Received: by 2002:a05:6602:1485:b0:81f:880d:ec18 with SMTP id ca18e2360f4ac-82a10e140cemr317175339f.3.1724943506218; Thu, 29 Aug 2024 07:58:26 -0700 (PDT) Received: from chromium.org (c-107-2-138-191.hsd1.co.comcast.net. [107.2.138.191]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4ced2dcdd2bsm284900173.21.2024.08.29.07.58.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Aug 2024 07:58:25 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass , Chanho Park , Kever Yang , Manoj Sai , Marek Vasut , Sean Anderson , Suniel Mahesh , Tom Rini Subject: [PATCH 12/19] spl: Drop use of uintptr_t Date: Thu, 29 Aug 2024 08:57:55 -0600 Message-Id: <20240829145802.1827952-13-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240829145802.1827952-1-sjg@chromium.org> References: <20240829145802.1827952-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 --- common/spl/spl_atf.c | 36 ++++++++++++++++++------------------ common/spl/spl_fit.c | 2 +- common/spl/spl_legacy.c | 8 ++++---- include/spl.h | 28 ++++++++++++++-------------- 4 files changed, 37 insertions(+), 37 deletions(-) diff --git a/common/spl/spl_atf.c b/common/spl/spl_atf.c index 0397b86a33b..8bc5db77395 100644 --- a/common/spl/spl_atf.c +++ b/common/spl/spl_atf.c @@ -41,9 +41,9 @@ struct bl2_to_bl31_params_mem_v2 { struct entry_point_info bl31_ep_info; }; -struct bl31_params *bl2_plat_get_bl31_params_default(uintptr_t bl32_entry, - uintptr_t bl33_entry, - uintptr_t fdt_addr) +struct bl31_params *bl2_plat_get_bl31_params_default(ulong bl32_entry, + ulong bl33_entry, + ulong fdt_addr) { static struct bl2_to_bl31_params_mem bl31_params_mem; struct bl31_params *bl2_to_bl31_params; @@ -100,17 +100,17 @@ struct bl31_params *bl2_plat_get_bl31_params_default(uintptr_t bl32_entry, return bl2_to_bl31_params; } -__weak struct bl31_params *bl2_plat_get_bl31_params(uintptr_t bl32_entry, - uintptr_t bl33_entry, - uintptr_t fdt_addr) +__weak struct bl31_params *bl2_plat_get_bl31_params(ulong bl32_entry, + ulong bl33_entry, + ulong fdt_addr) { return bl2_plat_get_bl31_params_default(bl32_entry, bl33_entry, fdt_addr); } -struct bl_params *bl2_plat_get_bl31_params_v2_default(uintptr_t bl32_entry, - uintptr_t bl33_entry, - uintptr_t fdt_addr) +struct bl_params *bl2_plat_get_bl31_params_v2_default(ulong bl32_entry, + ulong bl33_entry, + ulong fdt_addr) { static struct bl2_to_bl31_params_mem_v2 bl31_params_mem; struct bl_params *bl_params; @@ -173,9 +173,9 @@ struct bl_params *bl2_plat_get_bl31_params_v2_default(uintptr_t bl32_entry, return bl_params; } -__weak struct bl_params *bl2_plat_get_bl31_params_v2(uintptr_t bl32_entry, - uintptr_t bl33_entry, - uintptr_t fdt_addr) +__weak struct bl_params *bl2_plat_get_bl31_params_v2(ulong bl32_entry, + ulong bl33_entry, + ulong fdt_addr) { return bl2_plat_get_bl31_params_v2_default(bl32_entry, bl33_entry, fdt_addr); @@ -188,8 +188,8 @@ static inline void raw_write_daif(unsigned int daif) typedef void __noreturn (*atf_entry_t)(struct bl31_params *params, void *plat_params); -static void __noreturn bl31_entry(uintptr_t bl31_entry, uintptr_t bl32_entry, - uintptr_t bl33_entry, uintptr_t fdt_addr) +static void __noreturn bl31_entry(ulong bl31_entry, ulong bl32_entry, + ulong bl33_entry, ulong fdt_addr) { atf_entry_t atf_entry = (atf_entry_t)bl31_entry; void *bl31_params; @@ -238,7 +238,7 @@ static int spl_fit_images_find(void *blob, int os) return -FDT_ERR_NOTFOUND; } -uintptr_t spl_fit_images_get_entry(void *blob, int node) +ulong spl_fit_images_get_entry(void *blob, int node) { ulong val; int ret; @@ -253,10 +253,10 @@ uintptr_t spl_fit_images_get_entry(void *blob, int node) void __noreturn spl_invoke_atf(struct spl_image_info *spl_image) { - uintptr_t bl32_entry = 0; - uintptr_t bl33_entry = CONFIG_TEXT_BASE; + ulong bl32_entry = 0; + ulong bl33_entry = CONFIG_TEXT_BASE; void *blob = spl_image->fdt_addr; - uintptr_t platform_param = (uintptr_t)blob; + ulong platform_param = (ulong)blob; int node; /* diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c index 1ad5a69d807..614dea9ae18 100644 --- a/common/spl/spl_fit.c +++ b/common/spl/spl_fit.c @@ -862,7 +862,7 @@ int spl_load_fit_image(struct spl_image_info *spl_image, { struct bootm_headers images; const char *fit_uname_config = NULL; - uintptr_t fdt_hack; + ulong fdt_hack; const char *uname; ulong fw_data = 0, dt_data = 0, img_data = 0; ulong fw_len = 0, dt_len = 0, img_len = 0; diff --git a/common/spl/spl_legacy.c b/common/spl/spl_legacy.c index a77893455f2..3af7ea33ae9 100644 --- a/common/spl/spl_legacy.c +++ b/common/spl/spl_legacy.c @@ -16,11 +16,11 @@ #define LZMA_LEN (1 << 20) -static void spl_parse_legacy_validate(uintptr_t start, uintptr_t size) +static void spl_parse_legacy_validate(ulong start, ulong size) { - uintptr_t spl_start = (uintptr_t)_start; - uintptr_t spl_end = (uintptr_t)&_image_binary_end; - uintptr_t end = start + size; + ulong spl_start = (ulong)_start; + ulong spl_end = (ulong)&_image_binary_end; + ulong end = start + size; if ((start >= spl_start && start < spl_end) || (end > spl_start && end <= spl_end) || diff --git a/include/spl.h b/include/spl.h index de808ccd413..d90eed956af 100644 --- a/include/spl.h +++ b/include/spl.h @@ -256,8 +256,8 @@ enum spl_sandbox_flags { struct spl_image_info { const char *name; u8 os; - uintptr_t load_addr; - uintptr_t entry_point; + ulong load_addr; + ulong entry_point; #if CONFIG_IS_ENABLED(LOAD_FIT) || CONFIG_IS_ENABLED(LOAD_FIT_FULL) void *fdt_addr; #endif @@ -939,9 +939,9 @@ void __noreturn spl_invoke_atf(struct spl_image_info *spl_image); * * Return: bl31 params structure pointer */ -struct bl31_params *bl2_plat_get_bl31_params(uintptr_t bl32_entry, - uintptr_t bl33_entry, - uintptr_t fdt_addr); +struct bl31_params *bl2_plat_get_bl31_params(ulong bl32_entry, + ulong bl33_entry, + ulong fdt_addr); /** * bl2_plat_get_bl31_params_default() - prepare params for bl31. @@ -960,9 +960,9 @@ struct bl31_params *bl2_plat_get_bl31_params(uintptr_t bl32_entry, * * Return: bl31 params structure pointer */ -struct bl31_params *bl2_plat_get_bl31_params_default(uintptr_t bl32_entry, - uintptr_t bl33_entry, - uintptr_t fdt_addr); +struct bl31_params *bl2_plat_get_bl31_params_default(ulong bl32_entry, + ulong bl33_entry, + ulong fdt_addr); /** * bl2_plat_get_bl31_params_v2() - return params for bl31 @@ -976,9 +976,9 @@ struct bl31_params *bl2_plat_get_bl31_params_default(uintptr_t bl32_entry, * * Return: bl31 params structure pointer */ -struct bl_params *bl2_plat_get_bl31_params_v2(uintptr_t bl32_entry, - uintptr_t bl33_entry, - uintptr_t fdt_addr); +struct bl_params *bl2_plat_get_bl31_params_v2(ulong bl32_entry, + ulong bl33_entry, + ulong fdt_addr); /** * bl2_plat_get_bl31_params_v2_default() - prepare params for bl31. @@ -995,9 +995,9 @@ struct bl_params *bl2_plat_get_bl31_params_v2(uintptr_t bl32_entry, * * Return: bl31 params structure pointer */ -struct bl_params *bl2_plat_get_bl31_params_v2_default(uintptr_t bl32_entry, - uintptr_t bl33_entry, - uintptr_t fdt_addr); +struct bl_params *bl2_plat_get_bl31_params_v2_default(ulong bl32_entry, + ulong bl33_entry, + ulong fdt_addr); /** * spl_optee_entry - entry function for optee * From patchwork Thu Aug 29 14:57: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: 1978524 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=JV5iVOWq; 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 4WvkxG2vCLz1yXd for ; Fri, 30 Aug 2024 01:00:50 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C264D88C4C; Thu, 29 Aug 2024 16:58:33 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=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="JV5iVOWq"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id ABA4C88C4C; Thu, 29 Aug 2024 16:58:30 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x12a.google.com (mail-il1-x12a.google.com [IPv6:2607:f8b0:4864:20::12a]) (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 9A86B88C86 for ; Thu, 29 Aug 2024 16:58:28 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x12a.google.com with SMTP id e9e14a558f8ab-37636c3872bso3038725ab.3 for ; Thu, 29 Aug 2024 07:58:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1724943507; x=1725548307; 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=CpY01vtWeQWV4YFYTzBjjbUmiD70J5DE6H5skAh2DVc=; b=JV5iVOWqsg/hlhbq9TX7WUxUSO3NJK9aXXqhS4w1fIOAABHI68nFbF4WBgaujXAEQz AGi6V3cn1/1QNlIVyU65cwXJ7bnr/Vp1lPUPzv/Hhyc78B/OUfxhWCT6DpXW/YgMU/4A 5lMLRBvltf3G5ZruJpKF/lYA5R3BEZDCLidik= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724943507; x=1725548307; 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=CpY01vtWeQWV4YFYTzBjjbUmiD70J5DE6H5skAh2DVc=; b=aS9r1EjIlUiR9yMppk7PLk2Ll9FkvQQYjIMImoosGtsVSuw2seZHrLChhueHsdOUIQ CND9yGLc/f3sLDpLI1zZuwAR7KiN8glWXwVrYD6TtTJaM2xz0lxFYcSRw7MI8/DZVMLM tfFk/1o9FcA3hHDDZ4L9/CR48MyA1VYDJ8DnzAE4njWctFzwSoAWWDOiF1FXwGKwP7FF WxSfkv7eN3CwjInYYiqKty9VHcE2XcAeKav9reJkBc8ltfhnvuEyWhZBmJpKLrBhQtLq wODBibJKuf1qgXRwBPwWxBumlTi2rVc17uc84bpAh3itdabDYyUACdsYvKomttEV1q4S XFOw== X-Gm-Message-State: AOJu0YzMkrdR2bYcqdfEXnBWWbMatFhVMhqIVCDYKTQ7gfDSNF8yVuC/ dC5x9sxlGt0gBaUirUGS5rSTi0edgBHjsQiuRRxy7blnz6zlzsph/ieA1c0cMPbV1Y9MWeK7Y4M = X-Google-Smtp-Source: AGHT+IElHByrCGST4KRkYU/7LbSly01d1mWSCZ8cNvxAbzPbJ22ToDYH8Dfy6BbbQoeyBl0xXNzZUQ== X-Received: by 2002:a05:6e02:1607:b0:39b:649:f5e2 with SMTP id e9e14a558f8ab-39f3780c2fbmr42824825ab.13.1724943507131; Thu, 29 Aug 2024 07:58:27 -0700 (PDT) Received: from chromium.org (c-107-2-138-191.hsd1.co.comcast.net. [107.2.138.191]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4ced2dcdd2bsm284900173.21.2024.08.29.07.58.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Aug 2024 07:58:26 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass , Devarsh Thakkar , Quentin Schulz , Sean Anderson , Tom Rini Subject: [PATCH 13/19] spl: Drop a duplicate variable in boot_from_devices() Date: Thu, 29 Aug 2024 08:57:56 -0600 Message-Id: <20240829145802.1827952-14-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240829145802.1827952-1-sjg@chromium.org> References: <20240829145802.1827952-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") --- common/spl/spl.c | 1 - 1 file changed, 1 deletion(-) diff --git a/common/spl/spl.c b/common/spl/spl.c index 5c687cfc73b..d60e60e708e 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -613,7 +613,6 @@ static int boot_from_devices(struct spl_image_info *spl_image, for (i = 0; i < count && spl_boot_list[i] != BOOT_DEVICE_NONE; i++) { struct spl_image_loader *loader; int bootdev = spl_boot_list[i]; - int ret; if (CONFIG_IS_ENABLED(SHOW_ERRORS)) ret = -ENXIO; From patchwork Thu Aug 29 14:57: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: 1978525 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=UQ+k5xSL; 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 4WvkxV4b2rz1yXd for ; Fri, 30 Aug 2024 01:01:02 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4055488CC5; Thu, 29 Aug 2024 16:58:34 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=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="UQ+k5xSL"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A75CE88C8F; Thu, 29 Aug 2024 16:58:31 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 71C5C88C9A for ; Thu, 29 Aug 2024 16:58:29 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd2d.google.com with SMTP id ca18e2360f4ac-829e3fbcae0so34922339f.0 for ; Thu, 29 Aug 2024 07:58:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1724943508; x=1725548308; 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=zIv81WrdEaGFh4AlWO6uZxqWOl3pcyfYnBqBpExsB1E=; b=UQ+k5xSLXjRk6X4hBtKeVCVWGrG97czXLt5AZsgEIoHg78HXchGOfneSole50UXeoL R92oWRwTZMYs2Q0/raAoAERrbdU/zE9NlOh1x0UCsbGNQyPtfK5d4SlufYgWneOPgUWl oBy3e7OjpDDG4OfInR8L9DX4ZIhbnBjo1bSkU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724943508; x=1725548308; 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=zIv81WrdEaGFh4AlWO6uZxqWOl3pcyfYnBqBpExsB1E=; b=fPYsOxECRFvBSZ1+gCbCwtFHItQ2wF2Lbrk7z3OFi4uCnuZ2heFA746JLq8ejSMTKG lA/XtsssZ4tJxeyS9FISVAte/ivRvqgTxWWsr7Psl1aML9gZGGfiaTYbICPr8QhG3E+O bKB/CzR6pGq3Bv2G29FyFNBTcV32gCajnI4jsVVD8pSibaMYpsvMmAqLOcaTJvY7L9qW X3ZFed1DgL4zPjJfjGSV7a7HXqXd0Hl3CyTyAT0WEhREy6ki9BM30kA6pEj3KdgNX2Nv AHJGnR/aLTh/v/SopKkrbGRe1gVi/NB0VdEEBfN0jLINL7iy7dvn9sTJdDrudAFvIKw6 LPZQ== X-Gm-Message-State: AOJu0YxQHtLrELJEn6vgOY0/gOLApBtN0bxONTsUUdzEgNzw32ABtTmC GUk2cXtE8ZYzH3D9KuROHc6FN0sX+dbvg1WrnORuI5mH7xHkUzshsISoM+ijdaGlLpVvTR5JCiU = X-Google-Smtp-Source: AGHT+IGQAUOHip+5tlDUIXkbbUUmg9d7n6/gjPdv2J/1Z3ORR+pNs+X/etDCkUWDX9maO35jbjutXA== X-Received: by 2002:a05:6602:29d3:b0:803:f97f:59e0 with SMTP id ca18e2360f4ac-82a10d8820bmr396288339f.0.1724943507999; Thu, 29 Aug 2024 07:58:27 -0700 (PDT) Received: from chromium.org (c-107-2-138-191.hsd1.co.comcast.net. [107.2.138.191]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4ced2dcdd2bsm284900173.21.2024.08.29.07.58.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Aug 2024 07:58:27 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass , Kever Yang , Manoj Sai , Marek Vasut , Sean Anderson , Suniel Mahesh , Tom Rini Subject: [PATCH 14/19] spl: Add some more debugging to load_simple_fit() Date: Thu, 29 Aug 2024 08:57:57 -0600 Message-Id: <20240829145802.1827952-15-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240829145802.1827952-1-sjg@chromium.org> References: <20240829145802.1827952-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 --- common/spl/spl_fit.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c index 614dea9ae18..303d5416b59 100644 --- a/common/spl/spl_fit.c +++ b/common/spl/spl_fit.c @@ -190,7 +190,7 @@ static int get_aligned_image_size(struct spl_load_info *info, int data_size, /** * load_simple_fit(): load the image described in a certain FIT node * @info: points to information about the device to load data from - * @sector: the start sector of the FIT image on the device + * @fit_offset: the offset of the FIT image on the device * @ctx: points to the FIT context structure * @node: offset of the DT node describing the image to load (relative * to @fit) @@ -243,11 +243,14 @@ static int load_simple_fit(struct spl_load_info *info, ulong fit_offset, if (!fit_image_get_data_position(fit, node, &offset)) { external_data = true; } else if (!fit_image_get_data_offset(fit, node, &offset)) { + log_debug("read offset %x = offset from fit %lx\n", + offset, (ulong)offset + ctx->ext_data_offset); offset += ctx->ext_data_offset; external_data = true; } if (external_data) { + ulong read_offset; void *src_ptr; /* External data */ @@ -270,6 +273,10 @@ static int load_simple_fit(struct spl_load_info *info, ulong fit_offset, overhead = get_aligned_image_overhead(info, offset); size = get_aligned_image_size(info, length, offset); + read_offset = fit_offset + get_aligned_image_offset(info, + offset); + log_debug("reading from offset %x / %lx size %lx to %p: ", + offset, read_offset, size, src_ptr); if (info->read(info, fit_offset + @@ -336,6 +343,7 @@ static int load_simple_fit(struct spl_load_info *info, ulong fit_offset, else image_info->entry_point = FDT_ERROR; } + log_debug("- done loading\n"); upl_add_image(fit, node, load_addr, length); From patchwork Thu Aug 29 14:57: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: 1978526 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=AkT3pYCr; 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 4Wvkxm3y84z1yfy for ; Fri, 30 Aug 2024 01:01:16 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9850488CB6; Thu, 29 Aug 2024 16:58:38 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="AkT3pYCr"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8DF3E88CA8; Thu, 29 Aug 2024 16:58:32 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x134.google.com (mail-il1-x134.google.com [IPv6:2607:f8b0:4864:20::134]) (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 60FF988C3E for ; Thu, 29 Aug 2024 16:58:30 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x134.google.com with SMTP id e9e14a558f8ab-39f370a944bso2610895ab.1 for ; Thu, 29 Aug 2024 07:58:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1724943509; x=1725548309; 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=fN1LFjtOGpMay28yScUBX9npNVOkoNtSLy1JSwW+LYo=; b=AkT3pYCri7/Ce5R54uA3CkADsqN1zwbuClKI93weayHPneVCqbcHMmSVXRZAngtabQ pRNNPxsA10AlAJnRMTZlhWHe6YO84lM6O5SZQWE9QmQrOm5wRIEnW5OPkUmbzjSQsk4B JSSGkPIFUPSrJfGRO6NxY5KOwGYxle/PtDFkI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724943509; x=1725548309; 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=fN1LFjtOGpMay28yScUBX9npNVOkoNtSLy1JSwW+LYo=; b=Z1BQ4khJFjcPb6jQrqqUUtjfkzn8sEZ9SQ3nUH5RvfQqfBF6HOnb3kM4Y8sZeeGdRH DumP1MslJXkQyVPoWlTX1U2NaNO+C10NZXSqrFHqhju1gor3rbGDj8p6UKZAFOMWOF4h cWh1IdVZQ6JLpZag+5kf1u28akwRO7xuozX/nR6TLdMjPuRe89rt867CwB436sy8y7bV NfxUoV2hh+d/28jOmnjVkCVHmmYY8/u60TtTeBI2J1dCAXQlFQTIZTH7OQAsfX5WzVpk PRMQymoN4OHVeVwY99e0kn4eMGClZ4BJVib6ZiWzpfuhTrrI8fHeK5VfnY8Bgu2v/7qV /AVw== X-Gm-Message-State: AOJu0YwmTx4saLAdotLxTr1XTBReKWBihYThZlvv1b59iVxexknKuXGE Sj6M2WaoO/26Zv9DstjGHWbopjeQyOMC+u4n6KXl6RPUNE+KFZMLdYFmb1eVVTf/CIcVl1qgTxQ = X-Google-Smtp-Source: AGHT+IGXb/VpkR5bzWXODGmgmkSR7e1kbK/GYDnPtY6FzMrhH0gMP//NJuFZXBEhg4rHx3LMfl5BLA== X-Received: by 2002:a05:6e02:1b09:b0:382:b3f8:9f72 with SMTP id e9e14a558f8ab-39f37820a2emr42453005ab.15.1724943508944; Thu, 29 Aug 2024 07:58:28 -0700 (PDT) Received: from chromium.org (c-107-2-138-191.hsd1.co.comcast.net. [107.2.138.191]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4ced2dcdd2bsm284900173.21.2024.08.29.07.58.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Aug 2024 07:58:28 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass , AKASHI Takahiro , Bin Meng , Eddie James , Heinrich Schuchardt , Ilias Apalodimas , Michal Simek , Sean Anderson , Tom Rini Subject: [PATCH 15/19] spl: lib: Allow for decompression in any SPL build Date: Thu, 29 Aug 2024 08:57:58 -0600 Message-Id: <20240829145802.1827952-16-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240829145802.1827952-1-sjg@chromium.org> References: <20240829145802.1827952-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 --- lib/Kconfig | 35 +++++++++++++++++++++++++++++++++++ lib/Makefile | 8 ++++---- 2 files changed, 39 insertions(+), 4 deletions(-) diff --git a/lib/Kconfig b/lib/Kconfig index 2059219a120..72a5f3cb04f 100644 --- a/lib/Kconfig +++ b/lib/Kconfig @@ -811,12 +811,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 @@ -835,11 +859,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 81b503ab526..d122f764f9f 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -82,12 +82,12 @@ obj-$(CONFIG_$(SPL_)SHA512) += sha512.o obj-$(CONFIG_CRYPT_PW) += crypt/ obj-$(CONFIG_$(SPL_)ASN1_DECODER) += asn1_decoder.o -obj-$(CONFIG_$(SPL_)ZLIB) += zlib/ +obj-$(CONFIG_$(SPL_TPL_)ZLIB) += zlib/ obj-$(CONFIG_$(SPL_)ZSTD) += zstd/ -obj-$(CONFIG_$(SPL_)GZIP) += gunzip.o +obj-$(CONFIG_$(SPL_TPL_)GZIP) += gunzip.o obj-$(CONFIG_$(SPL_)LZO) += lzo/ -obj-$(CONFIG_$(SPL_)LZMA) += lzma/ -obj-$(CONFIG_$(SPL_)LZ4) += lz4_wrapper.o +obj-$(CONFIG_$(SPL_TPL_)LZMA) += lzma/ +obj-$(CONFIG_$(SPL_TPL_)LZ4) += lz4_wrapper.o obj-$(CONFIG_$(SPL_)LIB_RATIONAL) += rational.o From patchwork Thu Aug 29 14:57: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: 1978527 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=hk7Oq8/T; 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 4Wvky26Pysz1yXd for ; Fri, 30 Aug 2024 01:01:30 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 16F8C88C88; Thu, 29 Aug 2024 16:58:39 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=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="hk7Oq8/T"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 82FA888CCA; Thu, 29 Aug 2024 16:58:34 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-il1-x136.google.com (mail-il1-x136.google.com [IPv6:2607:f8b0:4864:20::136]) (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 7888988C88 for ; Thu, 29 Aug 2024 16:58:31 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x136.google.com with SMTP id e9e14a558f8ab-39d3636e955so2677985ab.3 for ; Thu, 29 Aug 2024 07:58:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1724943510; x=1725548310; 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=umguDeUwn9N9p/E+qVSByJL6Fw72fYu+qjzrR9ckJeA=; b=hk7Oq8/TDgdyxpv4MLQXFxIdmN+fmAfbZo8YjrKJj1HeRMybHZq1vxI2dCzagF0B1b yoQCWUucihniEyobWiI0XFCP+MsOe8iUq35cM/ZSuIohZsYpEC7a4N3ftWsjWQXt9mMG +Ga78tPRni55it5YS7Gha/c3OrnKewxrDjtwQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724943510; x=1725548310; 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=umguDeUwn9N9p/E+qVSByJL6Fw72fYu+qjzrR9ckJeA=; b=YsudIFTAKOAVYsN/xP8iNYnFkj3jLdIe5ZfYDlcivp5p13kEWEqTyRyNZ7M5T6rvKE 5vlYYoYtTgfMh9FpkD4Iz4C6IDyREzPsjRU43n9vN1HR+V/7BZRd2lSbUNNtlrQgZja0 jbprHGNb1KipJipPXZgaazcXQNU1l1UP1VIXSyIKWiyo7VHfxgkd+TwI6sbmCldjWRNV Tyvy+OYVBu0Umkfe89av7VMD7nO63UuZWtXbUxbtkPJ9IuGgOFhjzh3EE/tRui01hGbJ NNkJcaOoVpsZ2RJq+Rri+yo7GLKl2utCFt/nAwr3OAOx9/UKE64pEz8vq+e3F4xxDQ9N EJng== X-Gm-Message-State: AOJu0YzjlzQZu92NeCuZ86w1Cn7TaC57GI1O2Px6xhtSmCD9hC9KNhVa o6qSimEpT+Uu80ewea4Jpwh1DTr0RDF5w6rq/nsvJNFSDt/AeYWbFzV6580ugzW58nAsMWw13ww = X-Google-Smtp-Source: AGHT+IGYTS1/Ll+6HsE5nD+sEgrDi05BInDfaC+1P4B/hwcDGh7o5kn58VaQlnPZxy/Lz2L0sumz9w== X-Received: by 2002:a05:6e02:1b09:b0:382:b3f8:9f72 with SMTP id e9e14a558f8ab-39f37820a2emr42453335ab.15.1724943509897; Thu, 29 Aug 2024 07:58:29 -0700 (PDT) Received: from chromium.org (c-107-2-138-191.hsd1.co.comcast.net. [107.2.138.191]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4ced2dcdd2bsm284900173.21.2024.08.29.07.58.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Aug 2024 07:58:29 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass , AKASHI Takahiro , Eddie James , Heinrich Schuchardt , Ilias Apalodimas , Marek Vasut , Mattijs Korpershoek , Sean Anderson , Sughosh Ganu , Tom Rini Subject: [PATCH 16/19] boot: Allow use of FIT in TPL and VPL Date: Thu, 29 Aug 2024 08:57:59 -0600 Message-Id: <20240829145802.1827952-17-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240829145802.1827952-1-sjg@chromium.org> References: <20240829145802.1827952-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 --- boot/Kconfig | 69 ++++++++++++++++++++++++++++++++++- boot/Makefile | 4 +- configs/sandbox_vpl_defconfig | 3 +- 3 files changed, 71 insertions(+), 5 deletions(-) diff --git a/boot/Kconfig b/boot/Kconfig index 7ac34574079..afe04c7327a 100644 --- a/boot/Kconfig +++ b/boot/Kconfig @@ -161,6 +161,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 @@ -265,6 +277,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 @@ -312,6 +346,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 @@ -632,6 +682,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 @@ -710,7 +769,15 @@ config VPL_BOOTMETH_VBE_SIMPLE_FW This option enabled for VPL, since it is the phase where the SPL decision is made. -endif # BOOTMETH_VBE +config TPL_BOOTMETH_VBE_SIMPLE_FW + bool "Bootdev support for VBE 'simple' method firmware phase (TPL)" + depends on VPL + default y + help + Enables support for the firmware parts of VBE 'simple' boot, in TPL. + TPL loads a FIT containing the VPL binary and a suitable devicetree. + +endif # BOOTMETH_VBE_SIMPLE config EXPO bool "Support for expos - groups of scenes displaying a UI" diff --git a/boot/Makefile b/boot/Makefile index f4675d6ffd5..40e2337de0f 100644 --- a/boot/Makefile +++ b/boot/Makefile @@ -58,9 +58,7 @@ obj-$(CONFIG_$(SPL_TPL_)FIT_CIPHER) += image-cipher.o obj-$(CONFIG_CMD_ADTIMG) += image-android-dt.o -ifdef CONFIG_SPL_BUILD -obj-$(CONFIG_SPL_LOAD_FIT) += common_fit.o -endif +obj-$(CONFIG_$(SPL_TPL_)LOAD_FIT) += common_fit.o obj-$(CONFIG_$(SPL_TPL_)EXPO) += expo.o scene.o expo_build.o obj-$(CONFIG_$(SPL_TPL_)EXPO) += scene_menu.o scene_textline.o diff --git a/configs/sandbox_vpl_defconfig b/configs/sandbox_vpl_defconfig index 96e9211bd19..d18bb7a0353 100644 --- a/configs/sandbox_vpl_defconfig +++ b/configs/sandbox_vpl_defconfig @@ -27,9 +27,10 @@ CONFIG_FIT=y CONFIG_FIT_VERBOSE=y CONFIG_FIT_BEST_MATCH=y CONFIG_SPL_LOAD_FIT=y +# CONFIG_TPL_BOOTMETH_VBE is not set +# CONFIG_TPL_BOOTMETH_VBE_SIMPLE_FW is not set CONFIG_UPL=y CONFIG_UPL_IN=y -CONFIG_SPL_UPL_OUT=y CONFIG_BOOTSTAGE=y CONFIG_BOOTSTAGE_REPORT=y CONFIG_BOOTSTAGE_FDT=y From patchwork Thu Aug 29 14:58: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: 1978529 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=MLqrsu7W; 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 4WvkyY1M98z1yXd for ; Fri, 30 Aug 2024 01:01:57 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D51C088CA0; Thu, 29 Aug 2024 16:58:39 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=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="MLqrsu7W"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 62A6388C70; Thu, 29 Aug 2024 16:58:36 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x130.google.com (mail-il1-x130.google.com [IPv6:2607:f8b0:4864:20::130]) (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 4AB0388CA3 for ; Thu, 29 Aug 2024 16:58:32 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x130.google.com with SMTP id e9e14a558f8ab-39d311d8091so2722275ab.3 for ; Thu, 29 Aug 2024 07:58:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1724943511; x=1725548311; 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=CtfFvJonR1FqlwlBLZ5CXEmdeAHhHB31QymJzP/cOYI=; b=MLqrsu7WADETYl03TuUwVNKNjGtWQ1ybUCiec+uw5dOao/szU+FNvGm/ZOqrgGiYow QEV2JoMYrmPlSyah8U3K055FYTQV8KN78HIr9CD2sgDVY9719H/v6YW6VERJ6XnaKQyl FW5Kwd2mTJqy+KYhcSauf9ydO2iXRB+USTfPQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724943511; x=1725548311; 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=CtfFvJonR1FqlwlBLZ5CXEmdeAHhHB31QymJzP/cOYI=; b=Kss4d4d45yUDx6naXIpabk+Ca5u06D/Mujt7zzWYynhMm6fhUEIx23pRhAzV3qNQm9 PZ6oHvWarFCXvK6wmzyE7Cdg6f2eLkEfhlkwTTYQdvjIyisKhRZ2cmpDP6FNILoDMn9q OiGJBna5VD3SIKDuxZumKtzMjzn6iShskguCqa0A+vHJVlqNqRW1sVZQA+HUzmIsHdm6 wJFLAZd38XgfQsjz+OBmsM8IPQye5hslQBqyktpVw6ihzMLQPTF/IiI8Odw8JD6jJ/E6 l0uVh226cjojwS2gmd2SNZZLvKwhJifOgCy+0EbE4NZS/skarAfNmi44X2IM6HTpd1Nb 1UoA== X-Gm-Message-State: AOJu0YypHkdP/n2pD5o6OOyAuvt2BMJA1hRE9KgMzPXXAhoGwhOLpvm8 K9Y5rGsYvIqobR8PpTj0Yy897246L0I27gojoeU+Mh03Qi6XDxuBFmKJO4lqF9rZkoLag7/hW44 = X-Google-Smtp-Source: AGHT+IHsknD4n6/fr1p2nRORVngXbnf3q8D7vR+DcMzDFeioOXCjZ/NBdOkafT9UBAX6hizzCX0gow== X-Received: by 2002:a92:c56f:0:b0:396:c825:4db6 with SMTP id e9e14a558f8ab-39f378693cdmr38580225ab.26.1724943510838; Thu, 29 Aug 2024 07:58:30 -0700 (PDT) Received: from chromium.org (c-107-2-138-191.hsd1.co.comcast.net. [107.2.138.191]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4ced2dcdd2bsm284900173.21.2024.08.29.07.58.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Aug 2024 07:58:30 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass , AKASHI Takahiro , Bin Meng , Heinrich Schuchardt , Ilias Apalodimas , Michal Simek , Sean Anderson , Tom Rini , =?utf-8?q?Vincent_Stehl=C3=A9?= Subject: [PATCH 17/19] lib: Allow crc8 in TPL and VPL Date: Thu, 29 Aug 2024 08:58:00 -0600 Message-Id: <20240829145802.1827952-18-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240829145802.1827952-1-sjg@chromium.org> References: <20240829145802.1827952-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 --- lib/Kconfig | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/lib/Kconfig b/lib/Kconfig index 72a5f3cb04f..b2d5e8d04a7 100644 --- a/lib/Kconfig +++ b/lib/Kconfig @@ -698,6 +698,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 SPL + 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 Thu Aug 29 14:58: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: 1978528 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=Kd03oYgU; 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 4WvkyH1sZYz1yXd for ; Fri, 30 Aug 2024 01:01:43 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7439C88CC3; Thu, 29 Aug 2024 16:58:39 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=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="Kd03oYgU"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9E1A388C70; Thu, 29 Aug 2024 16:58:35 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x12b.google.com (mail-il1-x12b.google.com [IPv6:2607:f8b0:4864:20::12b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 145F888CB6 for ; Thu, 29 Aug 2024 16:58:33 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x12b.google.com with SMTP id e9e14a558f8ab-39d254187daso2873975ab.0 for ; Thu, 29 Aug 2024 07:58:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1724943512; x=1725548312; 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=AhKSnMx0yhM2r+nFK5gE+AcCQNLYQP8EvRWZxqAW44E=; b=Kd03oYgUdRhLj2n+kbSonA5eRiUbYR7JU7TwiKD/JrEeIxfLscb9MmZ6APE/x+r+Yq VHsmWi2WuP8IR2gIq9jGQSNQJYJcp4qXCHu/L0XdoTXxKsMe5STEpdQcg9Ab+lrQeChh wrIp4IQsk57XITrC/V3nPQltRFP6e4pMaFBvo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724943512; x=1725548312; 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=AhKSnMx0yhM2r+nFK5gE+AcCQNLYQP8EvRWZxqAW44E=; b=W5DfS5YF96Ik6WFhK1jWgZiYEwBm10/YKYkcmXpL43UsF2IHy9OW+yufOx8DvXTOjQ x7GOfoxRlStsvuQZBlcP26lfghMIiO4TYyPB6WDdP+d78dNqm67NMrba2TWcusfX6lFz YZ1OI/bWqkpcoH2xGHEtw7sswhCXrRwZqL3zf4GrDwiA2tvdK25Uc2lYP7lGly6Lca8F yBKVRydjJ/I/hcGBYr4TTdjIxOEPfq9GiDF1y4AQMhEhy76zLGV+A2biA/z82QshvQ/V iHFg2qFuOECAgRcTGYzaY9Wl93+YpDgQIUGrR4t9NEm5FAjv3WHgsXlvfcoPhIgX8MQF 0wLA== X-Gm-Message-State: AOJu0YxegiQBkyqAaRU012dzkYY3BkCWvmGnhUzT+V6ll/86nAMjrVPv GEluioXjJvAXyRfcZ/iYODeDj2U+L80orZNFLNwnxPL77pEWhCZ20ecEPe7nP5DgKGysX9K0aNc = X-Google-Smtp-Source: AGHT+IFZjGVyPETjkzRkNPwEueDiBgqdaQksXwxb3CwaU4bgcQszl2ZsaMSYCHpiZymOwceHlxQj6g== X-Received: by 2002:a05:6e02:1a01:b0:39f:36f3:1959 with SMTP id e9e14a558f8ab-39f377d827emr41059915ab.3.1724943511677; Thu, 29 Aug 2024 07:58:31 -0700 (PDT) Received: from chromium.org (c-107-2-138-191.hsd1.co.comcast.net. [107.2.138.191]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4ced2dcdd2bsm284900173.21.2024.08.29.07.58.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Aug 2024 07:58:31 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass , Eddie James , Heinrich Schuchardt , Ilias Apalodimas , Mattijs Korpershoek , Tom Rini Subject: [PATCH 18/19] boot: Imply CRC8 with VBE Date: Thu, 29 Aug 2024 08:58:01 -0600 Message-Id: <20240829145802.1827952-19-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240829145802.1827952-1-sjg@chromium.org> References: <20240829145802.1827952-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 --- boot/Kconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/boot/Kconfig b/boot/Kconfig index afe04c7327a..49e99e5e155 100644 --- a/boot/Kconfig +++ b/boot/Kconfig @@ -716,6 +716,8 @@ config SPL_BOOTMETH_VBE_REQUEST config BOOTMETH_VBE_SIMPLE bool "Bootdev support for VBE 'simple' method" default y + imply SPL_CRC8 + imply VPL_CRC8 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 Thu Aug 29 14:58: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: 1978530 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=jbKiWLDV; 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 4Wvkyq6gPlz1yXd for ; Fri, 30 Aug 2024 01:02:11 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3AE0A88CCB; Thu, 29 Aug 2024 16:58:40 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="jbKiWLDV"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 81FEB88C44; Thu, 29 Aug 2024 16:58:37 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x131.google.com (mail-il1-x131.google.com [IPv6:2607:f8b0:4864:20::131]) (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 DA2F188C9C for ; Thu, 29 Aug 2024 16:58:33 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x131.google.com with SMTP id e9e14a558f8ab-39d30564949so2750685ab.2 for ; Thu, 29 Aug 2024 07:58:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1724943512; x=1725548312; 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=Z0qUbpteAyA1vbeFCITLlL6Vvc8C3sWCWgjlMOTA6kc=; b=jbKiWLDVViSaDE/u0IU6J8WgJPrLEfFe3UAwQrf2xlWPm25OlVNyzOEcrqRGez8z5u GoaF8I95Sm4rE9GwaR2NKkCXM4V9/qHWeRtOkpwwYc2pneFb4/oF726djdurxUuKtF5z t8+EdxuNndU7UEgUBnyNu4nsvJQ/2T+Zl/UL4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724943512; x=1725548312; 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=Z0qUbpteAyA1vbeFCITLlL6Vvc8C3sWCWgjlMOTA6kc=; b=EJYOhbbN5KjFlJc/yStgvVJe1JONRgjxfvbJ1FvZ0JCFrg7pWCiZt3sklgO7bCmaqa f2IpDbX6TL5/8cIIctLtQV9rJJe//oSoUcVsNWOdVBQ/+ZgdZGx/tuFiG8y7UCGwMtAP d4V1hmoMKXHzG6XMQVpJMLHOk2BNOHKnPqlK0pB6iIa1IZ86zrNGcPRsIidHUBUyStWS JhtRC5WdynXGqwuWfl7E8FL1ivNb1QYfhi16qVwk+bnz9nu3ijF4zQXExfZyASTiKFSn O9JOaLKE3DWjFLLc3YTMFzOad4qsLUD9OaLWSbyoQchKbe4LQtrSirCnE44W36zzWLUQ KP4Q== X-Gm-Message-State: AOJu0Ywv6sIZeeuaMvAZafHzW9E7J3CX/fdq7AKkLu/ywUJOAyFfDca1 ey+pGnW28VuDS4ge+8uAx/+8Ubs+kveEgUH1LtybUB28uaJdn/K5XKcPI7laJAzhxhG6PswGjyM = X-Google-Smtp-Source: AGHT+IHsTVm+7co+H61tzAPJ2VXEvzGI6kzL31TkH8nUcCei/tusNC8qxBuvuUW/K7wMUntpGDBVqg== X-Received: by 2002:a05:6e02:148c:b0:39a:eb81:ff9a with SMTP id e9e14a558f8ab-39f377f52a1mr39797765ab.10.1724943512567; Thu, 29 Aug 2024 07:58:32 -0700 (PDT) Received: from chromium.org (c-107-2-138-191.hsd1.co.comcast.net. [107.2.138.191]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4ced2dcdd2bsm284900173.21.2024.08.29.07.58.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Aug 2024 07:58:32 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass , Igor Opaniuk , Joe Hershberger , Marek Vasut , Tom Rini Subject: [PATCH 19/19] hash: Plumb crc8 into the hash functions Date: Thu, 29 Aug 2024 08:58:02 -0600 Message-Id: <20240829145802.1827952-20-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240829145802.1827952-1-sjg@chromium.org> References: <20240829145802.1827952-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 --- common/hash.c | 8 ++++++++ include/u-boot/crc.h | 3 +++ lib/crc8.c | 6 ++++++ 3 files changed, 17 insertions(+) diff --git a/common/hash.c b/common/hash.c index ac63803fed9..43c4e185750 100644 --- a/common/hash.c +++ b/common/hash.c @@ -304,6 +304,14 @@ static struct hash_algo hash_algo[] = { .hash_update = hash_update_crc16_ccitt, .hash_finish = hash_finish_crc16_ccitt, }, +#if CONFIG_IS_ENABLED(CRC8) + { + .name = "crc8", + .digest_size = 1, + .chunk_size = CHUNKSZ_CRC32, + .hash_func_ws = crc8_wd_buf, + }, +#endif #if CONFIG_IS_ENABLED(CRC32) { .name = "crc32", diff --git a/include/u-boot/crc.h b/include/u-boot/crc.h index 5174bd7ac41..b2badaf6a97 100644 --- a/include/u-boot/crc.h +++ b/include/u-boot/crc.h @@ -25,6 +25,9 @@ */ unsigned int crc8(unsigned int crc_start, const unsigned char *vptr, int len); +void crc8_wd_buf(const unsigned char *input, unsigned int len, + unsigned char output[1], unsigned int chunk_sz); + /* lib/crc16.c - 16 bit CRC with polynomial x^16 + x^15 + x^2 + 1 */ uint16_t crc16(uint16_t crc, const unsigned char *buffer, size_t len); diff --git a/lib/crc8.c b/lib/crc8.c index 20d46d16147..811e19917b4 100644 --- a/lib/crc8.c +++ b/lib/crc8.c @@ -32,3 +32,9 @@ unsigned int crc8(unsigned int crc, const unsigned char *vptr, int len) return crc; } + +void crc8_wd_buf(const unsigned char *input, unsigned int len, + unsigned char output[1], unsigned int chunk_sz) +{ + *output = crc8(0, input, len); +}