From patchwork Mon Feb 4 10:14:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick DELAUNAY X-Patchwork-Id: 1035799 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=st.com Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 43tNrQ5bDlz9s3l for ; Mon, 4 Feb 2019 21:15:34 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 6A56AC21F3F; Mon, 4 Feb 2019 10:15:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 02F41C21F1F; Mon, 4 Feb 2019 10:15:15 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 299ADC21F32; Mon, 4 Feb 2019 10:15:09 +0000 (UTC) Received: from mx07-00178001.pphosted.com (mx07-00178001.pphosted.com [62.209.51.94]) by lists.denx.de (Postfix) with ESMTPS id A876EC21F04 for ; Mon, 4 Feb 2019 10:15:06 +0000 (UTC) Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x14A1Fxl019564; Mon, 4 Feb 2019 11:15:06 +0100 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2qdjdndt27-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 04 Feb 2019 11:15:06 +0100 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 54C633A; Mon, 4 Feb 2019 10:15:05 +0000 (GMT) Received: from Webmail-eu.st.com (Safex1hubcas24.st.com [10.75.90.94]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id E2AAB25FF; Mon, 4 Feb 2019 10:15:04 +0000 (GMT) Received: from SAFEX1HUBCAS21.st.com (10.75.90.45) by Safex1hubcas24.st.com (10.75.90.94) with Microsoft SMTP Server (TLS) id 14.3.361.1; Mon, 4 Feb 2019 11:15:04 +0100 Received: from localhost (10.201.23.85) by Webmail-ga.st.com (10.75.90.48) with Microsoft SMTP Server (TLS) id 14.3.361.1; Mon, 4 Feb 2019 11:15:03 +0100 From: Patrick Delaunay To: Date: Mon, 4 Feb 2019 11:14:52 +0100 Message-ID: <1549275292-3134-2-git-send-email-patrick.delaunay@st.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1549275292-3134-1-git-send-email-patrick.delaunay@st.com> References: <1549275292-3134-1-git-send-email-patrick.delaunay@st.com> MIME-Version: 1.0 X-Originating-IP: [10.201.23.85] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-02-04_07:, , signatures=0 Cc: U-Boot STM32 Subject: [U-Boot] [PATCH 2/2] dm: core: remove the duplicated function dm_ofnode_pre_reloc X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 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" The content dm_ofnode_pre_reloc() is identical with ofnode_pre_reloc() defined in drivers/core/ofnode.c and used only one time in drivers/core/lists.c:lists_bind_fdt(). So the function can be removed and directly call ofnode_pre_reloc. Signed-off-by: Patrick Delaunay --- drivers/core/lists.c | 2 +- drivers/core/util.c | 26 -------------------------- include/dm/util.h | 27 --------------------------- 3 files changed, 1 insertion(+), 54 deletions(-) diff --git a/drivers/core/lists.c b/drivers/core/lists.c index a1f8284..67edf0f 100644 --- a/drivers/core/lists.c +++ b/drivers/core/lists.c @@ -173,7 +173,7 @@ int lists_bind_fdt(struct udevice *parent, ofnode node, struct udevice **devp, continue; if (pre_reloc_only) { - if (!dm_ofnode_pre_reloc(node) && + if (!ofnode_pre_reloc(node) && !(entry->flags & DM_FLAG_PRE_RELOC)) return 0; } diff --git a/drivers/core/util.c b/drivers/core/util.c index 6bedc8a..fa9ccbd 100644 --- a/drivers/core/util.c +++ b/drivers/core/util.c @@ -56,29 +56,3 @@ bool dm_fdt_pre_reloc(const void *blob, int offset) return false; } - -bool dm_ofnode_pre_reloc(ofnode node) -{ - if (ofnode_read_bool(node, "u-boot,dm-pre-reloc")) - return true; - if (ofnode_read_bool(node, "u-boot,dm-pre-proper")) - return true; - -#ifdef CONFIG_TPL_BUILD - if (ofnode_read_bool(node, "u-boot,dm-tpl")) - return true; -#elif defined(CONFIG_SPL_BUILD) - if (ofnode_read_bool(node, "u-boot,dm-spl")) - return true; -#else - /* - * In regular builds individual spl and tpl handling both - * count as handled pre-relocation for later second init. - */ - if (ofnode_read_bool(node, "u-boot,dm-spl") || - ofnode_read_bool(node, "u-boot,dm-tpl")) - return true; -#endif - - return false; -} diff --git a/include/dm/util.h b/include/dm/util.h index cbc209d..9b1128f 100644 --- a/include/dm/util.h +++ b/include/dm/util.h @@ -67,31 +67,4 @@ static inline void dm_dump_devres(void) */ bool dm_fdt_pre_reloc(const void *blob, int offset); -/** - * Check if an of node should be or was bound before relocation. - * - * Devicetree nodes can be marked as needed to be bound - * in the loader stages via special devicetree properties. - * - * Before relocation this function can be used to check if nodes - * are required in either SPL or TPL stages. - * - * After relocation and jumping into the real U-Boot binary - * it is possible to determine if a node was bound in one of - * SPL/TPL stages. - * - * There are 4 settings currently in use - * - u-boot,dm-pre-proper: U-Boot proper pre-relocation only - * - u-boot,dm-pre-reloc: legacy and indicates any of TPL or SPL - * Existing platforms only use it to indicate nodes needed in - * SPL. Should probably be replaced by u-boot,dm-spl for - * existing platforms. - * - u-boot,dm-spl: SPL and U-Boot pre-relocation - * - u-boot,dm-tpl: TPL and U-Boot pre-relocation - * @node: of node - * - * Returns true if node is needed in SPL/TL, false otherwise. - */ -bool dm_ofnode_pre_reloc(ofnode node); - #endif