From patchwork Thu Jun 27 09:19:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1953099 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=Ykfm6Lty; 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 4W8tMx0cNlz20Xg for ; Thu, 27 Jun 2024 19:20:45 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6948488582; Thu, 27 Jun 2024 11:19:41 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="Ykfm6Lty"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A38288855B; Thu, 27 Jun 2024 11:19:38 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.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 autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-lj1-x22a.google.com (mail-lj1-x22a.google.com [IPv6:2a00:1450:4864:20::22a]) (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 BC43F8852E for ; Thu, 27 Jun 2024 11:19:36 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-lj1-x22a.google.com with SMTP id 38308e7fff4ca-2ec52fbb50cso55074851fa.2 for ; Thu, 27 Jun 2024 02:19:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1719479976; x=1720084776; 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=AOduDstwRx9JFHQGUTamaoAoIgSOooUTdQ8x/X0aOHc=; b=Ykfm6LtyvIzrZwGEQ5LabFH2erhBbmXY8+ZbHS30b1lsbT/R15guDfix7L7X9Hqk/i C/uWbRDS8EEsclp5BIha9G1ykxN7R+5qxLreaDQmvLXGcfxdWlT6HiUcGh0mbHipvqwI sHrYDRO/eoTuwvVGMdkjQUMsQW2ieHB7abb0E= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719479976; x=1720084776; 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=AOduDstwRx9JFHQGUTamaoAoIgSOooUTdQ8x/X0aOHc=; b=FQu6DzjLsUYEef411yfabxnttZVxwUmUTdYimLcC6T1Tai3KPAeLmfKL6K/pRhdg8j IzuP6XhMrZrrTAU/4ljU18eOjAEgyrpd0pMOWc06hlit3Uy2KTTfP+NnMaBNZqEOuuCn cgamkWjBu4MJQleu+sOe3q+SZvExI46oq40SXJpwYGNZPuRjrBuIZtp1JA12dklwUM4w /6Hp7zH4gS+xSeFur4b+MatwswTXhGgVS1+NgegXyj3fHXGdGKzicTZo6e1rIY22qBna cXUQMqEsVi8y/gy0zvhawapVAIgGJVnF0r+fV672KpYzPBbZB9XF5EXPmRd+EgtJdYfd QTLQ== X-Gm-Message-State: AOJu0YzlDkhN1dD1n/uYXE0PQt1Hr05M68OfeMylE1virvaoCe6BHWFv NpGRb0DMmelGDeVoW88UGP0EjMNAz/2qJAzFf571anbXfxjAbxffjzzG3obb7P9Q+S4/qtkTNMz 5bQ== X-Google-Smtp-Source: AGHT+IG9V/3wcXRobw3JVKwex/ISt2dC/19BB+S/d/yDbDi27PxqtqAmMzBV+cpz1lcx9s0hFPnvzw== X-Received: by 2002:a2e:3002:0:b0:2ee:46fd:7ab9 with SMTP id 38308e7fff4ca-2ee46fd7fd9mr16655111fa.30.1719479975983; Thu, 27 Jun 2024 02:19:35 -0700 (PDT) Received: from tasman.. (host-92-15-194-143.as13285.net. [92.15.194.143]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-367436a28f7sm1199818f8f.117.2024.06.27.02.19.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Jun 2024 02:19:35 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass , Jerry Van Baren Subject: [PATCH v6 6/8] fdt: Correct condition for bloblist existing Date: Thu, 27 Jun 2024 10:19:24 +0100 Message-Id: <20240627091926.374633-7-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240627091926.374633-1-sjg@chromium.org> References: <20240627091926.374633-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 --- (no changes since v3) Changes in v3: - Use BLOBLIST instead of OF_BLOBLIST 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..e16d1819449 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(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);