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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 81BFEC433F5 for ; Tue, 26 Oct 2021 00:28:16 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 077EE61039 for ; Tue, 26 Oct 2021 00:28:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 077EE61039 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8EC3B835C2; Tue, 26 Oct 2021 02:27: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="K8fNjp3f"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9C11482127; Tue, 26 Oct 2021 02:24:59 +0200 (CEST) Received: from mail-ot1-x336.google.com (mail-ot1-x336.google.com [IPv6:2607:f8b0:4864:20::336]) (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 EFF43832D6 for ; Tue, 26 Oct 2021 02:24: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-ot1-x336.google.com with SMTP id p6-20020a9d7446000000b0054e6bb223f3so17348455otk.3 for ; Mon, 25 Oct 2021 17:24:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=eAFcMi2MzM4vzmyeyVHQiIzYk8ByxXdGWuBCjMbJ5JM=; b=K8fNjp3feCzfRY3jLLZkPWIES/WeWZmPQEHgmwsX5UJZF0nFNupDa9R4bxMfuQI8fK rLPTHT//Iaf0aFdvcGwkWCv68qi8mDB9svdSDDzIgTjAB8/NSwQRMUYY4ZoQ/xwzHYqt 3t1Td6RTii6meRb6/LnXddMDMOZIuNxkahtn4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=eAFcMi2MzM4vzmyeyVHQiIzYk8ByxXdGWuBCjMbJ5JM=; b=FSHK4wdoSd+V5C3JFcGTTYuBvSTte8buQy0z+pu8a0UyEtdwt4iRq5zLKAQqWxnJj8 YlDhkv+QWtIsq3xpT3SCOC3sOqjTy1vZCvUQyMNF96YHIkrNLoTvgwyBoXMPt4nIUDub s+npM8KUyf9iCimR+IskuEYCO3D1ZGaXPvRV7J910yfL2CkB08cN9hQ+0RcIjo6Uh4NZ DbFZbTjubFD30M33v1f9ombEAxg/dQL96JqIv/8vVzRd2vlMGE3jNU0XDMnUTTlffyRV n4ie0NU6PU5gmq7GffuW9ZUs+IL4ZNSvnOXVp8/efF6yMgrfoqDqnf2zfVk1V+UXG+BN jUew== X-Gm-Message-State: AOAM530Z+zvy5Tv5RdhJTIFJ36Gr4eGVWjdEWcmjgEjYxX7xff6rJWpd AROkzb3M8PUKy2hgwpBMjDrGPp7TZy4= X-Google-Smtp-Source: ABdhPJy7AzEQWwJBu46h7cuE714aV8GFZ91wjahY8m2va7k6PDBom1e/lVaSSEJyn6pJHsZyCbjIQw== X-Received: by 2002:a9d:7644:: with SMTP id o4mr16273947otl.270.1635207859475; Mon, 25 Oct 2021 17:24:19 -0700 (PDT) Received: from kiwi.bld.corp.google.com (c-67-190-101-114.hsd1.co.comcast.net. [67.190.101.114]) by smtp.gmail.com with ESMTPSA id v24sm3331926oou.45.2021.10.25.17.24.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Oct 2021 17:24:19 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Mark Kettenis , Heinrich Schuchardt , Ilias Apalodimas , Tom Rini , Sean Anderson , Simon Glass , Jerry Van Baren Subject: [PATCH v5 25/26] fdt: Drop remaining preprocessor macros in fdtdec_setup() Date: Mon, 25 Oct 2021 18:23:43 -0600 Message-Id: <20211026002344.405160-26-sjg@chromium.org> X-Mailer: git-send-email 2.33.0.1079.g6e70778dc9-goog In-Reply-To: <20211026002344.405160-1-sjg@chromium.org> References: <20211026002344.405160-1-sjg@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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.103.2 at phobos.denx.de X-Virus-Status: Clean We only have two choices for obtaining the devicetree. Simplify the code to make that clear. Signed-off-by: Simon Glass --- (no changes since v1) lib/fdtdec.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/fdtdec.c b/lib/fdtdec.c index 0973cf0690b..067c27d0aa3 100644 --- a/lib/fdtdec.c +++ b/lib/fdtdec.c @@ -1621,13 +1621,13 @@ static void setup_multi_dtb_fit(void) int fdtdec_setup(void) { int ret; -#ifdef CONFIG_OF_EMBED - /* Get a pointer to the FDT */ - gd->fdt_blob = dtb_dt_embedded(); -#elif defined(CONFIG_OF_BOARD) || defined(CONFIG_OF_SEPARATE) - /* Allow the board to override the fdt address. */ - gd->fdt_blob = board_fdt_blob_setup(); -#endif + + /* The devicetree is typically appended to U-Boot */ + if (IS_ENABLED(CONFIG_OF_SEPARATE) || IS_ENABLED(CONFIG_OF_BOARD)) + gd->fdt_blob = board_fdt_blob_setup(); + else /* embed dtb in ELF file for testing / development */ + gd->fdt_blob = dtb_dt_embedded(); + if (!IS_ENABLED(CONFIG_SPL_BUILD)) { /* Allow the early environment to override the fdt address */ gd->fdt_blob = map_sysmem(env_get_ulong("fdtcontroladdr", 16, -- 2.33.0.1079.g6e70778dc9-goog