2007-10-10 09:12:12 +02:00
|
|
|
LIB_TESTS_L = get_mem_rsv \
|
|
|
|
root_node find_property subnode_offset path_offset \
|
2018-11-22 21:15:06 +01:00
|
|
|
get_name getprop get_prop_offset get_phandle \
|
2007-11-12 23:59:38 +01:00
|
|
|
get_path supernode_atdepth_offset parent_offset \
|
|
|
|
node_offset_by_prop_value node_offset_by_phandle \
|
2007-10-16 05:58:25 +02:00
|
|
|
node_check_compatible node_offset_by_compatible \
|
2008-08-20 08:55:14 +02:00
|
|
|
get_alias \
|
2011-09-09 21:16:30 +02:00
|
|
|
char_literal \
|
2011-10-11 19:22:29 +02:00
|
|
|
sized_cells \
|
2007-06-26 04:45:51 +02:00
|
|
|
notfound \
|
2014-05-11 05:13:46 +02:00
|
|
|
addr_size_cells \
|
2018-07-19 08:19:43 +02:00
|
|
|
addr_size_cells2 \
|
2019-03-27 07:15:52 +01:00
|
|
|
appendprop_addrrange \
|
2015-09-30 05:16:12 +02:00
|
|
|
stringlist \
|
2007-06-26 04:45:51 +02:00
|
|
|
setprop_inplace nop_property nop_node \
|
2018-04-10 09:06:18 +02:00
|
|
|
sw_tree1 sw_states \
|
2008-02-18 06:09:25 +01:00
|
|
|
move_and_save mangle-layout nopulate \
|
2008-01-11 04:55:05 +01:00
|
|
|
open_pack rw_tree1 set_name setprop del_property del_node \
|
2012-09-28 01:11:04 +02:00
|
|
|
appendprop1 appendprop2 propname_escapes \
|
Support ePAPR compliant phandle properties
Currently, the Linux kernel, libfdt and dtc, when using flattened
device trees encode a node's phandle into a property named
"linux,phandle". The ePAPR specification, however - aiming as it is
to not be a Linux specific spec - requires that phandles be encoded in
a property named simply "phandle".
This patch adds support for this newer approach to dtc and libfdt.
Specifically:
- fdt_get_phandle() will now return the correct phandle if it
is supplied in either of these properties
- fdt_node_offset_by_phandle() will correctly find a node with
the given phandle encoded in either property.
- By default, when auto-generating phandles, dtc will encode
it into both properties for maximum compatibility. A new -H
option allows either only old-style or only new-style
properties to be generated.
- If phandle properties are explicitly supplied in the dts
file, dtc will not auto-generate ones in the alternate format.
- If both properties are supplied, dtc will check that they
have the same value.
- Some existing testcases are updated to use a mix of old and
new-style phandles, partially testing the changes.
- A new phandle_format test further tests the libfdt support,
and the -H option.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2009-11-26 05:37:13 +01:00
|
|
|
string_escapes references path-references phandle_format \
|
|
|
|
boot-cpuid incbin \
|
2009-09-09 06:38:30 +02:00
|
|
|
extra-terminating-null \
|
2008-02-14 06:50:34 +01:00
|
|
|
dtbs_equal_ordered \
|
2010-04-30 07:30:00 +02:00
|
|
|
dtb_reverse dtbs_equal_unordered \
|
2011-09-22 19:11:02 +02:00
|
|
|
add_subnode_with_nops path_offset_aliases \
|
2012-04-04 04:56:00 +02:00
|
|
|
utilfdt_test \
|
libfdt: Add fdt_next_subnode() to permit easy subnode iteration
Iterating through subnodes with libfdt is a little painful to write as we
need something like this:
for (depth = 0, count = 0,
offset = fdt_next_node(fdt, parent_offset, &depth);
(offset >= 0) && (depth > 0);
offset = fdt_next_node(fdt, offset, &depth)) {
if (depth == 1) {
/* code body */
}
}
Using fdt_next_subnode() we can instead write this, which is shorter and
easier to get right:
for (offset = fdt_first_subnode(fdt, parent_offset);
offset >= 0;
offset = fdt_next_subnode(fdt, offset)) {
/* code body */
}
Also, it doesn't require two levels of indentation for the loop body.
Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
2013-04-26 14:43:31 +02:00
|
|
|
integer-expressions \
|
2016-07-27 14:55:54 +02:00
|
|
|
property_iterate \
|
2016-09-30 15:57:17 +02:00
|
|
|
subnode_iterate \
|
2016-12-07 13:48:19 +01:00
|
|
|
overlay overlay_bad_fixup \
|
2018-09-10 04:59:53 +02:00
|
|
|
check_path check_header check_full \
|
|
|
|
fs_tree1
|
2007-06-26 04:45:51 +02:00
|
|
|
LIB_TESTS = $(LIB_TESTS_L:%=$(TESTS_PREFIX)%)
|
|
|
|
|
2018-03-09 13:28:56 +01:00
|
|
|
LIBTREE_TESTS_L = truncated_property truncated_string truncated_memrsv
|
2007-06-26 04:45:51 +02:00
|
|
|
LIBTREE_TESTS = $(LIBTREE_TESTS_L:%=$(TESTS_PREFIX)%)
|
|
|
|
|
2009-01-08 01:48:48 +01:00
|
|
|
DL_LIB_TESTS_L = asm_tree_dump value-labels
|
2009-01-08 01:47:55 +01:00
|
|
|
DL_LIB_TESTS = $(DL_LIB_TESTS_L:%=$(TESTS_PREFIX)%)
|
|
|
|
|
|
|
|
TESTS = $(LIB_TESTS) $(LIBTREE_TESTS) $(DL_LIB_TESTS)
|
2007-06-26 04:45:51 +02:00
|
|
|
|
|
|
|
TESTS_TREES_L = test_tree1.dtb
|
|
|
|
TESTS_TREES = $(TESTS_TREES_L:%=$(TESTS_PREFIX)%)
|
|
|
|
|
|
|
|
TESTS_TARGETS = $(TESTS) $(TESTS_TREES)
|
|
|
|
|
2007-11-12 23:52:58 +01:00
|
|
|
TESTS_DEPFILES = $(TESTS:%=%.d) \
|
|
|
|
$(addprefix $(TESTS_PREFIX),testutils.d trees.d dumptrees.d)
|
2007-06-26 04:45:51 +02:00
|
|
|
|
2018-11-23 11:33:28 +01:00
|
|
|
TESTS_CLEANFILES_L = $(STD_CLEANFILES) \
|
|
|
|
*.dtb *.test.dts *.test.dt.yaml *.dtsv1 tmp.* \
|
|
|
|
dumptrees
|
2008-10-03 17:49:22 +02:00
|
|
|
TESTS_CLEANFILES = $(TESTS) $(TESTS_CLEANFILES_L:%=$(TESTS_PREFIX)%)
|
2018-09-10 04:59:53 +02:00
|
|
|
TESTS_CLEANDIRS_L = fs
|
|
|
|
TESTS_CLEANDIRS = $(TESTS_CLEANDIRS_L:%=$(TESTS_PREFIX)%)
|
2007-06-26 04:45:51 +02:00
|
|
|
|
|
|
|
.PHONY: tests
|
|
|
|
tests: $(TESTS) $(TESTS_TREES)
|
|
|
|
|
2011-09-22 19:11:02 +02:00
|
|
|
$(LIB_TESTS): %: $(TESTS_PREFIX)testutils.o util.o $(LIBFDT_archive)
|
2007-06-26 04:45:51 +02:00
|
|
|
|
2018-01-04 05:30:13 +01:00
|
|
|
# Not necessary on all platforms; allow -ldl to be excluded instead of forcing
|
|
|
|
# other platforms to patch it out.
|
|
|
|
LIBDL = -ldl
|
2011-09-22 19:11:03 +02:00
|
|
|
$(DL_LIB_TESTS): %: %.o $(TESTS_PREFIX)testutils.o util.o $(LIBFDT_archive)
|
2009-11-12 03:30:02 +01:00
|
|
|
@$(VECHO) LD [libdl] $@
|
2018-01-04 05:30:13 +01:00
|
|
|
$(LINK.c) -o $@ $^ $(LIBDL)
|
2009-01-08 01:47:55 +01:00
|
|
|
|
2011-09-22 19:11:03 +02:00
|
|
|
$(LIBTREE_TESTS): %: $(TESTS_PREFIX)testutils.o $(TESTS_PREFIX)trees.o \
|
|
|
|
util.o $(LIBFDT_archive)
|
2007-06-26 04:45:51 +02:00
|
|
|
|
|
|
|
$(TESTS_PREFIX)dumptrees: $(TESTS_PREFIX)trees.o
|
|
|
|
|
|
|
|
$(TESTS_TREES): $(TESTS_PREFIX)dumptrees
|
|
|
|
@$(VECHO) DUMPTREES
|
|
|
|
cd $(TESTS_PREFIX); ./dumptrees >/dev/null
|
|
|
|
|
|
|
|
tests_clean:
|
|
|
|
@$(VECHO) CLEAN "(tests)"
|
|
|
|
rm -f $(TESTS_CLEANFILES)
|
2018-09-10 04:59:53 +02:00
|
|
|
rm -rf $(TESTS_CLEANDIRS)
|
2007-06-26 04:45:51 +02:00
|
|
|
|
2017-04-07 23:51:32 +02:00
|
|
|
check: tests ${TESTS_BIN} $(TESTS_PYLIBFDT)
|
2018-07-09 12:38:59 +02:00
|
|
|
cd $(TESTS_PREFIX); PYTHON=$(PYTHON) ./run_tests.sh
|
2007-06-26 04:45:51 +02:00
|
|
|
|
2018-09-10 08:46:59 +02:00
|
|
|
ifeq ($(NO_VALGRIND),1)
|
|
|
|
checkm:
|
|
|
|
@echo "make checkm requires valgrind, but NO_VALGRIND=1"
|
|
|
|
else
|
2017-04-07 23:51:32 +02:00
|
|
|
checkm: tests ${TESTS_BIN} $(TESTS_PYLIBFDT)
|
2018-07-09 12:38:59 +02:00
|
|
|
cd $(TESTS_PREFIX); PYTHON=$(PYTHON) ./run_tests.sh -m
|
2018-09-10 08:46:59 +02:00
|
|
|
endif
|
2007-11-21 01:56:14 +01:00
|
|
|
|
2017-04-07 23:51:32 +02:00
|
|
|
checkv: tests ${TESTS_BIN} $(TESTS_PYLIBFDT)
|
2018-07-09 12:38:59 +02:00
|
|
|
cd $(TESTS_PREFIX); PYTHON=$(PYTHON) ./run_tests.sh -v
|
2007-06-26 04:45:51 +02:00
|
|
|
|
|
|
|
ifneq ($(DEPTARGETS),)
|
|
|
|
-include $(TESTS_DEPFILES)
|
|
|
|
endif
|