From mboxrd@z Thu Jan 1 00:00:00 1970 From: Simon Glass Date: Mon, 1 Oct 2018 12:22:18 -0600 Subject: [U-Boot] [PATCH 14/45] fdt: Allow indicating a node is for U-Boot proper only In-Reply-To: <20181001182249.129565-1-sjg@chromium.org> References: <20181001182249.129565-1-sjg@chromium.org> Message-ID: <20181001182249.129565-15-sjg@chromium.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de At present it is not possible to specify that a node should be used before relocation (in U-Boot proper) without it also ending up in SPL and TPL device trees. Add a new "u-boot,dm-pre-proper" boolean property for this. Signed-off-by: Simon Glass --- doc/driver-model/README.txt | 4 +++- drivers/core/ofnode.c | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/driver-model/README.txt b/doc/driver-model/README.txt index 6085f927dea..36541630a27 100644 --- a/doc/driver-model/README.txt +++ b/doc/driver-model/README.txt @@ -837,7 +837,9 @@ well, if device tree is enabled there. It is possible to limit this to specific relocation steps, by using the more specialized 'u-boot,dm-spl' and 'u-boot,dm-tpl' flags -in the devicetree. +in the device tree node. For U-Boot proper you can use 'u-boot,dm-pre-proper' +which means that it will be processed (and a driver bound) in U-Boot proper +prior to relocation, but will not be available in SPL or TPL. Then post relocation we throw that away and re-init driver model again. For drivers which require some sort of continuity between pre- and diff --git a/drivers/core/ofnode.c b/drivers/core/ofnode.c index 1e354803b06..825ffc27496 100644 --- a/drivers/core/ofnode.c +++ b/drivers/core/ofnode.c @@ -695,6 +695,8 @@ bool 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")) -- 2.19.0.605.g01d371f741-goog