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 X-Spam-Level: X-Spam-Status: No, score=-19.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id ADAF6C4338F for ; Sat, 7 Aug 2021 13:24:58 +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 F38AD610E7 for ; Sat, 7 Aug 2021 13:24:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org F38AD610E7 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 D96258201E; Sat, 7 Aug 2021 15:24:44 +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="L1KkBIBZ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 04152831FE; Sat, 7 Aug 2021 15:24:29 +0200 (CEST) Received: from mail-ot1-x331.google.com (mail-ot1-x331.google.com [IPv6:2607:f8b0:4864:20::331]) (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 3130282C55 for ; Sat, 7 Aug 2021 15:24:21 +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-x331.google.com with SMTP id d10-20020a9d4f0a0000b02904f51c5004e3so7942269otl.9 for ; Sat, 07 Aug 2021 06:24:21 -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=xfaZS0eGt2idkhNJ5EcHwprvafOj4XF64y5M6myY9qs=; b=L1KkBIBZoGHA5kDbChWwZXAGTMxmaXXd3BjSHKSr0ceZMmAIDamPHxBOBzUJr9ph9n tOstZ7rITctFZO6tJKJnAK7oxJuOkqD5ji6wduWAlCBBfy6T/eLUS81vpX6MvFAw4T0k CHfjCevzzbZ0IBvymznL88zf+FHkzInbWBDPk= 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=xfaZS0eGt2idkhNJ5EcHwprvafOj4XF64y5M6myY9qs=; b=VKLvUm1SSyzKXHKphLLVu8SYgSLzA/iO8L6wigOdTPoi4tCOTkkS8nBRXesPoSZ9X6 AUEE/jQ9b4hQJ69MSYzQZHG5neiAq2kvYLBYxIydCIUf7Jfr7LpgPY30CceiGsl4x8gR wlm5Eb2Sx/Nh4wqENvtZSBwssFNdBsx618d71F2Jz3ayElsGnSjBU7iitSGgcspsNcv8 tiM9UE0eBXJjMyfutv9vX7TbPaL247UJ5G4PCO8e30bWwQfR5libOuV1cYou/fxpN/QC u84vEwxvvB74Ba3kr4lFXd5SOIf970/CFopSEkgIBaNJAHelvrIbWkwRFYw5iqlnlPQY FbtA== X-Gm-Message-State: AOAM532eZHduk8+SeQtihIl21i1Jwua9xwh0+C+oY69F7cL1QCs4Ynre /5fE5+YMgHE/Gs1G81l2sOpOANPzqmonjhMs X-Google-Smtp-Source: ABdhPJwCs24KTuaubBh6J2/vk7JnzKhX6kfAgv+f8AMdhoXKHjQSJygnDepUldskamDtam8DYQ6DEA== X-Received: by 2002:a05:6830:348d:: with SMTP id c13mr10747807otu.207.1628342659576; Sat, 07 Aug 2021 06: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 x16sm1866417ooj.1.2021.08.07.06.24.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Aug 2021 06:24:19 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass , Jerry Van Baren Subject: [PATCH 02/12] fdt: Create a new OF_REAL Kconfig Date: Sat, 7 Aug 2021 07:24:02 -0600 Message-Id: <20210807132413.3513724-3-sjg@chromium.org> X-Mailer: git-send-email 2.32.0.605.g8dce9f2422-goog In-Reply-To: <20210807132413.3513724-1-sjg@chromium.org> References: <20210807132413.3513724-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 The condition to indicate whether there is a runtime devicetree available is OF_CONTROL && !OF_PLATDATA. This is a bit unweidly and is repeated in a lot of places. Add a new OF_REAL Kconfig which provides this information directly. Note: This is similar in effect to LIBFDT. We might consider dropping LIBFDT and using this instead, but this is left for now as we also have OF_LIBFDT_OVERLAY which it would not make sense to change. Signed-off-by: Simon Glass --- dts/Kconfig | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/dts/Kconfig b/dts/Kconfig index dabe0080c1e..d853aaafbc1 100644 --- a/dts/Kconfig +++ b/dts/Kconfig @@ -48,6 +48,14 @@ config OF_CONTROL This feature provides for run-time configuration of U-Boot via a flattened device tree. +config OF_REAL + def_bool y + help + Indicates that a real devicetree is available which can be accessed + at runtime. This means that dev_read_...() functions can be used to + read data from the devicetree for each device. This is true if + OF_CONTROL is enabled in U-Boot proper. + config OF_BOARD_FIXUP bool "Board-specific manipulation of Device Tree" help @@ -62,6 +70,7 @@ config SPL_OF_CONTROL bool "Enable run-time configuration via Device Tree in SPL" depends on SPL && OF_CONTROL select SPL_OF_LIBFDT if !SPL_OF_PLATDATA + select SPL_OF_REAL if !SPL_OF_PLATDATA help Some boards use device tree in U-Boot but only have 4KB of SRAM which is not enough to support device tree. Disable this option to @@ -71,6 +80,7 @@ config TPL_OF_CONTROL bool "Enable run-time configuration via Device Tree in TPL" depends on TPL && OF_CONTROL select TPL_OF_LIBFDT if !TPL_OF_PLATDATA + select TPL_OF_REAL if !TPL_OF_PLATDATA help Some boards use device tree in U-Boot but only have 4KB of SRAM which is not enough to support device tree. Enable this option to @@ -236,7 +246,7 @@ config MULTI_DTB_FIT config SPL_MULTI_DTB_FIT - depends on SPL_LOAD_FIT && SPL_OF_CONTROL && !SPL_OF_PLATDATA + depends on SPL_LOAD_FIT && SPL_OF_REAL bool "Support embedding several DTBs in a FIT image for the SPL" help This option provides the SPL with the ability to select its own @@ -374,6 +384,14 @@ config SPL_OF_PLATDATA compatible string, then adding platform data and U_BOOT_DRVINFO declarations for each node. See of-plat.txt for more information. +config SPL_OF_REAL + bool + help + Indicates that a real devicetree is available which can be accessed + at runtime. This means that dev_read_...() functions can be used to + read data from the devicetree for each device. This is true if + SPL_OF_CONTROL is enabled and not SPL_OF_PLATDATA + if SPL_OF_PLATDATA config SPL_OF_PLATDATA_PARENT @@ -421,6 +439,14 @@ config SPL_OF_PLATDATA_DRIVER_RT endif +config TPL_OF_REAL + bool + help + Indicates that a real devicetree is available which can be accessed + at runtime. This means that dev_read_...() functions can be used to + read data from the devicetree for each device. This is true if + TPL_OF_CONTROL is enabled and not TPL_OF_PLATDATA + config TPL_OF_PLATDATA bool "Generate platform data for use in TPL" depends on TPL_OF_CONTROL -- 2.32.0.605.g8dce9f2422-goog