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 384EEC0015E for ; Sat, 5 Aug 2023 13:32:16 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2EA8C867EF; Sat, 5 Aug 2023 15:32:15 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kwiboo.se 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=kwiboo.se header.i=@kwiboo.se header.b="U4yNXGEU"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 002A8867FB; Sat, 5 Aug 2023 15:32:13 +0200 (CEST) Received: from s.wrqvtbkv.outbound-mail.sendgrid.net (s.wrqvtbkv.outbound-mail.sendgrid.net [149.72.123.24]) (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 CE9F8867E7 for ; Sat, 5 Aug 2023 15:32:11 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kwiboo.se Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=bounces+31435339-7456-u-boot=lists.denx.de@em2124.kwiboo.se DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kwiboo.se; h=from:subject:mime-version:to:cc:content-transfer-encoding: content-type:cc:content-type:from:subject:to; s=s1; bh=EmLUCGtGfID+OIRfDCWxQFzxWRKGSnbKNoKUD9pEbDY=; b=U4yNXGEUAPJ06bPHpstDHHJJp3y5Z5uL2EdJyFi9bdSS+/HNOjHbGqKg5CpLCrn9HWEF I6KgEvoFVdnaYl6fEhOJ3WVa8kl67LF9fGjnqiDJq5++4cxdv2ZdktBEsjk47N4T5js+Gg 3At3O/EyZRjeDaHf4ZlSsgqX8wNQazc7qHx+zzp57G05CX3dqGKq1KnOsBLqVDAtu3ZZco 5E4atnp+e8y9y4emeorTftePabgB2H746irlcoztxLKGcLwlTRg5JjoJYqfyvgOquonKXt gUVQq9qW7MkwpY9mVaSJBFubAyx4jbEZdu/pjpcnIQX3zcsix+QkrgqOr0L10VxQ== Received: by filterdrecv-66949dbc98-5ngqz with SMTP id filterdrecv-66949dbc98-5ngqz-1-64CE4F5A-6 2023-08-05 13:32:10.117026489 +0000 UTC m=+7480336.322346207 Received: from bionic.localdomain (unknown) by geopod-ismtpd-9 (SG) with ESMTP id iWFXEuJ5T0CZDAsgBwPmnw Sat, 05 Aug 2023 13:32:09.737 +0000 (UTC) From: Jonas Karlman Subject: [RFC] dm: core: Report bootph-pre-ram/sram node as pre-reloc after relocation Date: Sat, 05 Aug 2023 13:32:10 +0000 (UTC) Message-ID: <20230805133208.788000-1-jonas@kwiboo.se> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 X-SG-EID: =?us-ascii?Q?TdbjyGynYnRZWhH+7lKUQJL+ZxmxpowvO2O9SQF5CwCVrYgcwUXgU5DKUU3QxA?= =?us-ascii?Q?fZekEeQsTe+RrMu3cja6a0h5Nfcc4YxdB=2FbB90Z?= =?us-ascii?Q?ss=2Ft7Yngk4F4xLlbRzn=2FmGiu=2Fo6hT0F92Kh1zwl?= =?us-ascii?Q?KFwjsp9SqA38X=2F5w1r+qpgmndtDPh+PafBrf2ht?= =?us-ascii?Q?wjFo8iz3ps5=2FRuqy=2FCQFykwYlYHsnsjHqNTeXgB?= =?us-ascii?Q?iMgtdp5zIWfvdPUTWt4WG190EI=2Fi2nacTsdbOi?= To: Simon Glass Cc: u-boot@lists.denx.de, Jonas Karlman X-Entity-ID: P7KYpSJvGCELWjBME/J5tg== Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.8 at phobos.denx.de X-Virus-Status: Clean Devices for nodes with e.g. bootph-pre-ram are initialized three times. 1. At SPL stage (always bind and probe only if used) 2. At U-Boot proper pre-reloc (always bind and probe) 3. At U-Boot proper normal (always bind and probe only if used) Change ofnode_pre_reloc to report a node with bootph-pre-ram/sram prop with a pre-reloc status only after U-Boot proper pre-relocation stage. This prevents the device from being probed at U-Boot proper pre-reloc. Signed-off-by: Jonas Karlman --- I am not sure if U-Boot proper pre-reloc behaves like this by design and if there is some other way to signal that a device should not be probed during U-Boot proper pre-reloc stage if it has been probed at SPL stage. For my use-case I added bootph-pre-ram prop to my RK8xx device node to make the PMIC usable in SPL. However, I have no need for this device to probe at U-Boot proper pre-reloc stage just after jumping out of TF-A. And moments later bind and probe yet again at U-Boot proper normal stage. The bootph-pre-ram prop was used to have the device usable in SPL, else I could have used bootph-all or added bootph-some-ram prop to indicate use at U-Boot proper pre-reloc stage. drivers/core/ofnode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/core/ofnode.c b/drivers/core/ofnode.c index 8df16e56af5c..ebd5a408ae58 100644 --- a/drivers/core/ofnode.c +++ b/drivers/core/ofnode.c @@ -1353,7 +1353,7 @@ bool ofnode_pre_reloc(ofnode node) */ if (ofnode_read_bool(node, "bootph-pre-ram") || ofnode_read_bool(node, "bootph-pre-sram")) - return true; + return !!(gd->flags & GD_FLG_RELOC); if (IS_ENABLED(CONFIG_OF_TAG_MIGRATE)) { /* detect and handle old tags */ -- 2.41.0