2007-10-10 09:12:12 +02:00
|
|
|
LIB_TESTS_L = get_mem_rsv \
|
|
|
|
root_node find_property subnode_offset path_offset \
|
2007-11-12 23:59:38 +01:00
|
|
|
get_name getprop get_phandle \
|
|
|
|
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 \
|
2007-06-26 04:45:51 +02:00
|
|
|
setprop_inplace nop_property nop_node \
|
|
|
|
sw_tree1 \
|
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 \
|
|
|
|
subnode_iterate
|
2007-06-26 04:45:51 +02:00
|
|
|
LIB_TESTS = $(LIB_TESTS_L:%=$(TESTS_PREFIX)%)
|
|
|
|
|
|
|
|
LIBTREE_TESTS_L = truncated_property
|
|
|
|
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
|
|
|
|
2008-05-15 08:39:12 +02:00
|
|
|
TESTS_CLEANFILES_L = *.output vglog.* vgcore.* *.dtb *.test.dts *.dtsv1 tmp.*
|
2008-10-03 17:49:22 +02:00
|
|
|
TESTS_CLEANFILES_L += dumptrees
|
|
|
|
TESTS_CLEANFILES = $(TESTS) $(TESTS_CLEANFILES_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
|
|
|
|
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] $@
|
|
|
|
$(LINK.c) -o $@ $^ -ldl
|
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 $(STD_CLEANFILES:%=$(TESTS_PREFIX)%)
|
|
|
|
rm -f $(TESTS_CLEANFILES)
|
|
|
|
|
2012-01-21 22:24:51 +01:00
|
|
|
check: tests ${TESTS_BIN}
|
2007-06-26 04:45:51 +02:00
|
|
|
cd $(TESTS_PREFIX); ./run_tests.sh
|
|
|
|
|
2012-01-21 22:24:51 +01:00
|
|
|
checkm: tests ${TESTS_BIN}
|
2007-11-21 01:56:14 +01:00
|
|
|
cd $(TESTS_PREFIX); ./run_tests.sh -m 2>&1 | tee vglog.$$$$
|
|
|
|
|
2012-01-21 22:24:51 +01:00
|
|
|
checkv: tests ${TESTS_BIN}
|
2007-06-26 04:45:51 +02:00
|
|
|
cd $(TESTS_PREFIX); ./run_tests.sh -v
|
|
|
|
|
|
|
|
ifneq ($(DEPTARGETS),)
|
|
|
|
-include $(TESTS_DEPFILES)
|
|
|
|
endif
|
|
|
|
|