From patchwork Sat Sep 5 13:22:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 1357997 X-Patchwork-Delegate: uboot@andestech.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: 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=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=aer3QOyl; dkim-atps=neutral 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 RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BkFb436gDz9sSJ for ; Sat, 5 Sep 2020 23:22:37 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C4AFB822A3; Sat, 5 Sep 2020 15:22:30 +0200 (CEST) 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="aer3QOyl"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A89F6822A7; Sat, 5 Sep 2020 15:22:29 +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.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-qv1-xf42.google.com (mail-qv1-xf42.google.com [IPv6:2607:f8b0:4864:20::f42]) (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 2AC8582286 for ; Sat, 5 Sep 2020 15:22:27 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=seanga2@gmail.com Received: by mail-qv1-xf42.google.com with SMTP id h1so4443577qvo.9 for ; Sat, 05 Sep 2020 06:22:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=C+fGAmuy7CZxHEElWi68bR5EMC39dPrJRa+sdSgik8A=; b=aer3QOylTyHdEHvrua5i3MsxJWEkOjchDrEWkvxG9cR/L4KQX1VF1tcULZpiRDMFf/ VGzcY2jWtxBpLFB4J0yG4bw/8EdkMsUtHvm57FiLIN5RgZsxyqgv+yWnv+wYYSApu7hZ hpwVKTVBStNHmn1miIM/dEc1YS01CqUUTnNL1LuZI67NoJ9HHkCvqxzEFk73W3EbwtYU SL+Nmkpe2K9sHjfMxAAo+NneQBVzxc+2mnsxhnGfUXPVlWZJBLbKzBdRIYepaHYa7bX5 KR3wLNgmruEuL0sxHb6EeMVt70tOCmX+85o+KP1JN9xOG0ACQjkr22SFoo1+SK6XVKZJ 81qQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=C+fGAmuy7CZxHEElWi68bR5EMC39dPrJRa+sdSgik8A=; b=EkCYp5BGrQW0caCkN65BzSfK3/5KRaXW0BeX5Ll0+RJbiX86fw0CLdasgnAdTEzmvr YUplTncFHmuzgR6pFmCfq+oBA/BAFVsaVtjKZCnkmtQPROL6iO5mTub00AafaAZH3i63 1ArGu14+BCuyx1HVQCF+o8u1Ixe/QzVpxjPdk+7RG+9VjgIVxX7jodjw4BnHTi+a0YWJ IvST1w9IG5b9srbwHptsTMvAdbOo3Npq/MYj3yeIZ6a1iuwvPztJAzWHHxQm49Uv0oEe /a6ElgpZM1efHZDuH4sC8HugXHm4LGmXt4cL3LJQic081XcXQbV1Ai/bkY65LaJ0z1yO tpkw== X-Gm-Message-State: AOAM531x+klvEs+St8cDgpwj3yzVQ8KUN/MlCAyLJFAHv3BNNIpZS+DG YKD3L9D52stH5c9j50IMjdm44B5TUWRd6Q== X-Google-Smtp-Source: ABdhPJyUQZ1Fp2dM9CoE0rmpu8h4h5l27VJuFBiBfl1cdWVpQzo9owHJ1BTwCwEnhQDuzbgDdMNdAQ== X-Received: by 2002:a0c:b38a:: with SMTP id t10mr12408540qve.94.1599312145873; Sat, 05 Sep 2020 06:22:25 -0700 (PDT) Received: from godwin.fios-router.home (pool-108-51-35-162.washdc.fios.verizon.net. [108.51.35.162]) by smtp.gmail.com with ESMTPSA id f127sm6479240qke.133.2020.09.05.06.22.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Sep 2020 06:22:25 -0700 (PDT) From: Sean Anderson To: u-boot@lists.denx.de Cc: Heinrich Schuchardt , Atish Patra , Bin Meng , Rick Chen , Sean Anderson Subject: [PATCH] riscv: Only enable OF_BOARD_FIXUP for S-Mode Date: Sat, 5 Sep 2020 09:22:11 -0400 Message-Id: <20200905132211.412711-1-seanga2@gmail.com> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.102.3 at phobos.denx.de X-Virus-Status: Clean It is unsafe to enable OF_BOARD_FIXUP only based on OF_SEPARATE. OF_SEPARATE may indicate that the user wishes U-Boot to use a different device tree than one obtained via OF_PRIOR_STAGE. However, OF_SEPARATE may also indicate that the device tree which would be obtained via OF_PRIOR_STAGE is invalid, nonexistant, or otherwise unusable. In this latter case, enabling OF_BOARD_FIXUP will result in corruption of the device tree. To remedy this, only enable OF_BOARD_FIXUP if U-Boot is configured for S-Mode. Fixes: 1c17e55594a394ced7de88d91be294eaf8c564c1 Signed-off-by: Sean Anderson Reviewed-by: Leo Liang --- arch/riscv/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index 009a545fcf..13fac51483 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -288,6 +288,6 @@ config STACK_SIZE_SHIFT default 14 config OF_BOARD_FIXUP - default y if OF_SEPARATE + default y if OF_SEPARATE && RISCV_SMODE endmenu