|
|
|
LIB_TESTS_L = get_mem_rsv \
|
|
|
|
root_node find_property subnode_offset path_offset \
|
|
|
|
get_name getprop get_prop_offset get_phandle \
|
|
|
|
get_path supernode_atdepth_offset parent_offset \
|
|
|
|
node_offset_by_prop_value node_offset_by_phandle \
|
|
|
|
node_check_compatible node_offset_by_compatible \
|
|
|
|
get_alias \
|
|
|
|
char_literal \
|
|
|
|
sized_cells \
|
|
|
|
notfound \
|
|
|
|
addr_size_cells \
|
|
|
|
addr_size_cells2 \
|
|
|
|
appendprop_addrrange \
|
|
|
|
stringlist \
|
|
|
|
setprop_inplace nop_property nop_node \
|
|
|
|
sw_tree1 sw_states \
|
|
|
|
move_and_save mangle-layout nopulate \
|
|
|
|
open_pack rw_tree1 rw_oom set_name setprop del_property del_node \
|
|
|
|
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>
15 years ago
|
|
|
string_escapes references path-references phandle_format \
|
|
|
|
boot-cpuid incbin \
|
|
|
|
extra-terminating-null \
|
|
|
|
dtbs_equal_ordered \
|
|
|
|
dtb_reverse dtbs_equal_unordered \
|
|
|
|
add_subnode_with_nops path_offset_aliases \
|
|
|
|
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>
12 years ago
|
|
|
integer-expressions \
|
|
|
|
property_iterate \
|
|
|
|
subnode_iterate \
|
|
|
|
overlay overlay_bad_fixup \
|
|
|
|
check_path check_header check_full \
|
|
|
|
fs_tree1
|
|
|
|
LIB_TESTS = $(LIB_TESTS_L:%=$(TESTS_PREFIX)%)
|
|
|
|
|
|
|
|
LIBTREE_TESTS_L = truncated_property truncated_string truncated_memrsv
|
|
|
|
LIBTREE_TESTS = $(LIBTREE_TESTS_L:%=$(TESTS_PREFIX)%)
|
|
|
|
|
|
|
|
DL_LIB_TESTS_L = asm_tree_dump value-labels
|
|
|
|
DL_LIB_TESTS = $(DL_LIB_TESTS_L:%=$(TESTS_PREFIX)%)
|
|
|
|
|
|
|
|
TESTS = $(LIB_TESTS) $(LIBTREE_TESTS) $(DL_LIB_TESTS)
|
|
|
|
|
|
|
|
TESTS_TREES_L = test_tree1.dtb
|
|
|
|
TESTS_TREES = $(TESTS_TREES_L:%=$(TESTS_PREFIX)%)
|
|
|
|
|
|
|
|
TESTS_TARGETS = $(TESTS) $(TESTS_TREES)
|
|
|
|
|
|
|
|
TESTS_DEPFILES = $(TESTS:%=%.d) \
|
|
|
|
$(addprefix $(TESTS_PREFIX),testutils.d trees.d dumptrees.d)
|
|
|
|
|
|
|
|
TESTS_CLEANFILES_L = $(STD_CLEANFILES) \
|
|
|
|
*.dtb *.test.dts *.test.dt.yaml *.dtsv1 tmp.* \
|
|
|
|
dumptrees
|
|
|
|
TESTS_CLEANFILES = $(TESTS) $(TESTS_CLEANFILES_L:%=$(TESTS_PREFIX)%)
|
|
|
|
TESTS_CLEANDIRS_L = fs
|
|
|
|
TESTS_CLEANDIRS = $(TESTS_CLEANDIRS_L:%=$(TESTS_PREFIX)%)
|
|
|
|
|
|
|
|
.PHONY: tests
|
|
|
|
tests: $(TESTS) $(TESTS_TREES)
|
|
|
|
|
|
|
|
$(LIB_TESTS): %: $(TESTS_PREFIX)testutils.o util.o $(LIBFDT_lib)
|
|
|
|
|
|
|
|
# Not necessary on all platforms; allow -ldl to be excluded instead of forcing
|
|
|
|
# other platforms to patch it out.
|
|
|
|
LIBDL = -ldl
|
|
|
|
$(DL_LIB_TESTS): %: %.o $(TESTS_PREFIX)testutils.o util.o $(LIBFDT_lib)
|
|
|
|
@$(VECHO) LD [libdl] $@
|
|
|
|
$(LINK.c) -o $@ $^ $(LIBDL)
|
|
|
|
|
|
|
|
$(LIBTREE_TESTS): %: $(TESTS_PREFIX)testutils.o $(TESTS_PREFIX)trees.o \
|
|
|
|
util.o $(LIBFDT_lib)
|
|
|
|
|
|
|
|
$(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)
|
|
|
|
rm -rf $(TESTS_CLEANDIRS)
|
|
|
|
|
|
|
|
check: tests ${TESTS_BIN} $(TESTS_PYLIBFDT)
|
|
|
|
cd $(TESTS_PREFIX); PYTHON=$(PYTHON) ./run_tests.sh
|
|
|
|
|
|
|
|
ifeq ($(NO_VALGRIND),1)
|
|
|
|
checkm:
|
|
|
|
@echo "make checkm requires valgrind, but NO_VALGRIND=1"
|
|
|
|
else
|
|
|
|
checkm: tests ${TESTS_BIN} $(TESTS_PYLIBFDT)
|
|
|
|
cd $(TESTS_PREFIX); PYTHON=$(PYTHON) ./run_tests.sh -m
|
|
|
|
endif
|
|
|
|
|
|
|
|
checkv: tests ${TESTS_BIN} $(TESTS_PYLIBFDT)
|
|
|
|
cd $(TESTS_PREFIX); PYTHON=$(PYTHON) ./run_tests.sh -v
|
|
|
|
|
|
|
|
ifneq ($(DEPTARGETS),)
|
|
|
|
-include $(TESTS_DEPFILES)
|
|
|
|
endif
|