fdt: Allow indicating a node is for U-Boot proper only
authorSimon Glass <sjg@chromium.org>
Mon, 1 Oct 2018 18:22:18 +0000 (12:22 -0600)
committerSimon Glass <sjg@chromium.org>
Tue, 9 Oct 2018 10:40:27 +0000 (04:40 -0600)
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 <sjg@chromium.org>
doc/driver-model/README.txt
drivers/core/ofnode.c

index 6085f92..3654163 100644 (file)
@@ -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
index fbc6751..b7b7ad3 100644 (file)
@@ -699,6 +699,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"))