Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

of: unittest: Statically apply overlays using fdtoverlay

Now that fdtoverlay is part of the kernel build, start using it to test
the unitest overlays we have by applying them statically. Create two new
base files static_base_1.dts and static_base_2.dts which includes other
.dtsi files.

Some unittest overlays deliberately contain errors that unittest checks
for. These overlays will cause fdtoverlay to fail, and are thus not
included for static builds.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Frank Rowand <frank.rowand@sony.com>
Tested-by: Frank Rowand <frank.rowand@sony.com>
Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/da6b4e6429aae2e7832a8be2ba2da473d449895b.1615354376.git.viresh.kumar@linaro.org

authored by

Viresh Kumar and committed by
Rob Herring
3b2dccc6 d92e2443

+56
+48
drivers/of/unittest-data/Makefile
··· 38 38 39 39 # suppress warnings about intentional errors 40 40 DTC_FLAGS_testcases += -Wno-interrupts_property 41 + 42 + # Apply overlays statically with fdtoverlay. This is a build time test that 43 + # the overlays can be applied successfully by fdtoverlay. This does not 44 + # guarantee that the overlays can be applied successfully at run time by 45 + # unittest, but it provides a bit of build time test coverage for those 46 + # who do not execute unittest. 47 + # 48 + # The overlays are applied on top of static_base_1.dtb and static_base_2.dtb to 49 + # create static_test_1.dtb and static_test_2.dtb. If fdtoverlay detects an 50 + # error than the kernel build will fail. static_test_1.dtb and 51 + # static_test_2.dtb are not consumed by unittest. 52 + # 53 + # Some unittest overlays deliberately contain errors that unittest checks for. 54 + # These overlays will cause fdtoverlay to fail, and are thus not included 55 + # in the static test: 56 + # overlay_bad_add_dup_node.dtbo \ 57 + # overlay_bad_add_dup_prop.dtbo \ 58 + # overlay_bad_phandle.dtbo \ 59 + # overlay_bad_symbol.dtbo \ 60 + 61 + apply_static_overlay_1 := overlay_0.dtbo \ 62 + overlay_1.dtbo \ 63 + overlay_2.dtbo \ 64 + overlay_3.dtbo \ 65 + overlay_4.dtbo \ 66 + overlay_5.dtbo \ 67 + overlay_6.dtbo \ 68 + overlay_7.dtbo \ 69 + overlay_8.dtbo \ 70 + overlay_9.dtbo \ 71 + overlay_10.dtbo \ 72 + overlay_11.dtbo \ 73 + overlay_12.dtbo \ 74 + overlay_13.dtbo \ 75 + overlay_15.dtbo \ 76 + overlay_gpio_01.dtbo \ 77 + overlay_gpio_02a.dtbo \ 78 + overlay_gpio_02b.dtbo \ 79 + overlay_gpio_03.dtbo \ 80 + overlay_gpio_04a.dtbo \ 81 + overlay_gpio_04b.dtbo 82 + 83 + apply_static_overlay_2 := overlay.dtbo 84 + 85 + static_test_1-dtbs := static_base_1.dtb $(apply_static_overlay_1) 86 + static_test_2-dtbs := static_base_2.dtb $(apply_static_overlay_2) 87 + 88 + dtb-$(CONFIG_OF_OVERLAY) += static_test_1.dtb static_test_2.dtb
+4
drivers/of/unittest-data/static_base_1.dts
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + /dts-v1/; 3 + 4 + #include "testcases_common.dtsi"
+4
drivers/of/unittest-data/static_base_2.dts
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + /dts-v1/; 3 + 4 + #include "overlay_common.dtsi"