From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0E619C433EF for ; Wed, 5 Jan 2022 01:08:14 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B19BE830AB; Wed, 5 Jan 2022 02:08:12 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="kYqA7eud"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id F25EF830AF; Wed, 5 Jan 2022 02:08:10 +0100 (CET) Received: from mail-pg1-x52c.google.com (mail-pg1-x52c.google.com [IPv6:2607:f8b0:4864:20::52c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id D827D83095 for ; Wed, 5 Jan 2022 02:08:07 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=bmeng.cn@gmail.com Received: by mail-pg1-x52c.google.com with SMTP id s1so32601333pga.5 for ; Tue, 04 Jan 2022 17:08:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=Zi+4y7Au9P8x1GZp3ZCS9WoE1fJU2qRR7I+xswhIYms=; b=kYqA7eudYydMFfxEhC5b5TKWGwPOzv2SC+nu9Su7LtHaJdDP7ZUp3U47s68Qyb+Lh9 Qcjyi1gOgjzrA0CsJ8md2nMTzAi58T9XQP1yLrWzhDtkjVaQpBRXF30xZgRI9Vl+SKr9 Y58fBonsBzr3fCPogOvXPlbbkO8WrKtCmUtaFCFkrMARX0MLXjoU8IX/ComGCQG4m/ao syaW+BMI0w+A8SJjimohz6Dovq9MtJg9Q/gyCxoMYKJFY5E9hqDWo1JFvapF80ntBwO6 7MBIAh6fkUFD+yh/fJQqEomUHYE8Z+i6uFQuHdLDDZ4cFgU5gijAJoxsYMWRermDLioA co7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=Zi+4y7Au9P8x1GZp3ZCS9WoE1fJU2qRR7I+xswhIYms=; b=U2GPAHYDvSkphABq90635ONqONdjEHl6FeMiM99F+zxwl2LPqYa6xETi0fFtH6Ego0 eAoWFly64GBMv4yK825Nm/93ygg2FjPLG/2FeQyGV7t0tWG6OF5VQCk9Hnu81pTZoZwR TYFwu/xQ6eVI3Hpi4BGGrAOw7PiUKjaLq4g89lOL1bSUW9R9lG99QN7GI27N4znkb2nL ZQrga4KbS8LUJMH2+mHgNZeBHbQZG0Rc4ttQhI9CMjaiF01GXFU2oMpZefSLNCRvWDgR JuL5AdnZVsc0hVgySrHf4yJHukCeMqrREoWYg6BYj4552GePW9gh15lvF/IOER+VRade my5w== X-Gm-Message-State: AOAM5318tGVGE653P1DFDGjuVvNk5XYI3ZorhOcuEsJerU6/Ey6l+oiZ hP9jsr1Km8WOLNitZVY8Izk= X-Google-Smtp-Source: ABdhPJzxkLm4u0WqvmD8RQ4j+P/kN1Mp0yWJUtuCdJy2w/mBayXx9lZHM4TousfXaZlt19/pqU93vQ== X-Received: by 2002:a63:4864:: with SMTP id x36mr47288312pgk.96.1641344886079; Tue, 04 Jan 2022 17:08:06 -0800 (PST) Received: from pek-vx-bsp2.wrs.com (unknown-176-192.windriver.com. [147.11.176.192]) by smtp.gmail.com with ESMTPSA id gg23sm473576pjb.31.2022.01.04.17.08.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jan 2022 17:08:05 -0800 (PST) From: Bin Meng To: Ilias Apalodimas , Simon Glass , Leo Yu-Chi Liang , Rick Chen , Tom Rini , U-Boot Mailing List Subject: [PATCH] riscv: sifive: Fix OF_BOARD boot failure Date: Wed, 5 Jan 2022 09:07:57 +0800 Message-Id: <20220105010757.750589-1-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.38 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.2 at phobos.denx.de X-Virus-Status: Clean When using QEMU to have a quick test of booting U-Boot S-mode payload directly without the needs of preparing the SPI flash or SD card images for SiFive Unleashed board, as per the instructions [1], it currently does not boot any more. This was caused by the OF_PRIOR_STAGE removal, as gd->fdt_blob no longer points to a valid DTB. OF_BOARD is supposed to replace OF_PRIOR_STAGE, hence we need to add the OF_BOARD logic in board_fdt_blob_setup(). [1] https://qemu.readthedocs.io/en/latest/system/riscv/sifive_u.html#running-u-boot Fixes: 2e8d2f88439d ("riscv: Remove OF_PRIOR_STAGE from RISC-V boards") Fixes: d6f8ab30a2af ("treewide: Remove OF_PRIOR_STAGE") Signed-off-by: Bin Meng --- board/sifive/unleashed/unleashed.c | 2 +- board/sifive/unmatched/unmatched.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/board/sifive/unleashed/unleashed.c b/board/sifive/unleashed/unleashed.c index 3c3e0e1d0d..f8aad862c6 100644 --- a/board/sifive/unleashed/unleashed.c +++ b/board/sifive/unleashed/unleashed.c @@ -117,7 +117,7 @@ int misc_init_r(void) void *board_fdt_blob_setup(int *err) { *err = 0; - if (IS_ENABLED(CONFIG_OF_SEPARATE)) { + if (IS_ENABLED(CONFIG_OF_SEPARATE) || IS_ENABLED(CONFIG_OF_BOARD)) { if (gd->arch.firmware_fdt_addr) return (ulong *)(uintptr_t)gd->arch.firmware_fdt_addr; } diff --git a/board/sifive/unmatched/unmatched.c b/board/sifive/unmatched/unmatched.c index 4895909f8d..6295deeae2 100644 --- a/board/sifive/unmatched/unmatched.c +++ b/board/sifive/unmatched/unmatched.c @@ -14,7 +14,7 @@ void *board_fdt_blob_setup(int *err) { *err = 0; - if (IS_ENABLED(CONFIG_OF_SEPARATE)) { + if (IS_ENABLED(CONFIG_OF_SEPARATE) || IS_ENABLED(CONFIG_OF_BOARD)) { if (gd->arch.firmware_fdt_addr) return (ulong *)(uintptr_t)gd->arch.firmware_fdt_addr; } -- 2.25.1