From patchwork Mon Jun 10 14:59:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1945925 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=jVR8ZPvt; 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 4VyZjn4hpmz20Py for ; Tue, 11 Jun 2024 01:00:29 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 42AEF885F4; Mon, 10 Jun 2024 16:59:47 +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="jVR8ZPvt"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 052DB885CF; Mon, 10 Jun 2024 16:59:46 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.3 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-x12c.google.com (mail-il1-x12c.google.com [IPv6:2607:f8b0:4864:20::12c]) (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 E503F885CF for ; Mon, 10 Jun 2024 16:59:43 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x12c.google.com with SMTP id e9e14a558f8ab-36ddf683ad7so222545ab.2 for ; Mon, 10 Jun 2024 07:59:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718031582; x=1718636382; 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=Rch1N+RVGzHMc51Jj2sUeBQ325MDbk8FDnOVAg9COLk=; b=jVR8ZPvtPv8rWIySyrvw8FIwsieBaYSA/T3BjS3rao0efKRUgrsGK4G8bLZIU+Eqr/ M58AMzjjYirMF3Ybi1SffVNvk/Dz0ONPNqLpx/mtUbWaRM3FJaelCW1Qp6CaPanlt9zv bFJK+eXrKOLlwyC7ez78w3ZGtkOuVfzO8WW+s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718031582; x=1718636382; 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=Rch1N+RVGzHMc51Jj2sUeBQ325MDbk8FDnOVAg9COLk=; b=DY1oJgbTIeGMGQl5Mt1dMAYBxT4VrJJEudV1fgtRSQHdFfJrJ84uHEsKvWBk7Odb/o QwnIkCgSUuhHHtlud/Zy9k8ZpYIyA2SoCGT9oxHY/R/BFVmsDsdMIV8HUPROPYMJpxjO yk87VkF8xYKVCRmWivFq+9qO0uXZIPvhZVWxCGrRNllKQnyXr5kXhDb2raa4Ez3El+cF n3JIJH1AtrRLSdhRgY94uFsC3CPAktNyIU0SkwrQzxMnMk4DIxGbCbx+skcS1bLNy8H8 9PTwHQ8iJH0ZVqlx1oTzRPP2Ex2p4TkSi8XF+HBOvDq+5UOmXLFl2loT9H7j8SCCJx7X xIvg== X-Gm-Message-State: AOJu0Yw6IGryAp22EsBZqhZxMIKOHrtLd5sQBMcmqUyvMlW09zVranGl EqYyXmtd3kyTxZOGTbE2QPYhoXcuVmhbp4ELcml5E2hxSKMNYsqXxyzw8o+XHHyzke6xi3CQXcx IaA== X-Google-Smtp-Source: AGHT+IHx98WmdhI2Sc40hP27n9iFEQNKkEdiD0hzPI2ArUzPHGEWAOnHqpOhO/rBxX9gDJO5hMSWpw== X-Received: by 2002:a92:cda9:0:b0:375:aca4:65de with SMTP id e9e14a558f8ab-375aca46883mr16142585ab.7.1718031582531; Mon, 10 Jun 2024 07:59:42 -0700 (PDT) Received: from chromium.org (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-375ac6104dasm2526885ab.4.2024.06.10.07.59.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jun 2024 07:59:42 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass , Ilias Apalodimas , Jerry Van Baren , Shiji Yang Subject: [PATCH v2 5/9] fdt: Correct condition for bloblist existing Date: Mon, 10 Jun 2024 08:59:16 -0600 Message-Id: <20240610145920.3302001-6-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240610145920.3302001-1-sjg@chromium.org> References: <20240610145920.3302001-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 On some boards, the bloblist is created in SPL once SDRAM is ready. It cannot be accessed until that point, so is not available early in SPL. Add a condition to avoid a hang in this case. This fixes a hang in chromebook_coral Fixes: 70fe2385943 ("fdt: Allow the devicetree to come from a bloblist") Signed-off-by: Simon Glass --- Changes in v2: - Use 'phase' instead of 'stage' lib/fdtdec.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/fdtdec.c b/lib/fdtdec.c index b2c59ab3818..79eaa56ea39 100644 --- a/lib/fdtdec.c +++ b/lib/fdtdec.c @@ -1669,8 +1669,16 @@ int fdtdec_setup(void) { int ret = -ENOENT; - /* If allowing a bloblist, check that first */ - if (CONFIG_IS_ENABLED(BLOBLIST)) { + /* + * If allowing a bloblist, check that first. This would be better + * handled with an OF_BLOBLIST Kconfig, but that caused far too much + * argument, so add a hack here, used e.g. by chromebook_coral + * The necessary test is whether the previous phase passed a bloblist, + * not whether this phase creates one. + */ + if (CONFIG_IS_ENABLED(OF_BLOBLIST) && + (spl_prev_phase() != PHASE_TPL || + !IS_ENABLED(CONFIG_TPL_BLOBLIST))) { ret = bloblist_maybe_init(); if (!ret) { gd->fdt_blob = bloblist_find(BLOBLISTT_CONTROL_FDT, 0);