1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright (c) 2013 Google, Inc
9 #include <linux/libfdt.h>
13 void dm_warn(const char *fmt, ...)
23 int list_count_items(struct list_head *head)
25 struct list_head *node;
28 list_for_each(node, head)
34 bool dm_fdt_pre_reloc(const void *blob, int offset)
36 #if defined(CONFIG_SPL_BUILD) || defined(CONFIG_TPL_BUILD)
37 /* for SPL and TPL the remaining nodes after the fdtgrep 1st pass
38 * had property dm-pre-reloc or u-boot,dm-spl/tpl.
39 * They are removed in final dtb (fdtgrep 2nd pass)
43 if (fdt_getprop(blob, offset, "u-boot,dm-pre-reloc", NULL))
46 * In regular builds individual spl and tpl handling both
47 * count as handled pre-relocation for later second init.
49 if (fdt_getprop(blob, offset, "u-boot,dm-spl", NULL) ||
50 fdt_getprop(blob, offset, "u-boot,dm-tpl", NULL))
57 bool dm_ofnode_pre_reloc(ofnode node)
59 #if defined(CONFIG_SPL_BUILD) || defined(CONFIG_TPL_BUILD)
60 /* for SPL and TPL the remaining nodes after the fdtgrep 1st pass
61 * had property dm-pre-reloc or u-boot,dm-spl/tpl.
62 * They are removed in final dtb (fdtgrep 2nd pass)
66 if (ofnode_read_bool(node, "u-boot,dm-pre-reloc"))
70 * In regular builds individual spl and tpl handling both
71 * count as handled pre-relocation for later second init.
73 if (ofnode_read_bool(node, "u-boot,dm-spl") ||
74 ofnode_read_bool(node, "u-boot,dm-tpl"))