docs: dt: unittest: update to current unittest filenames

There have been several renamings and modified Make rules since
introduction of this unittest document.

The file list in the Chinese translation had been extended.
For a change to drivers/of/unittest-data/tests-*.dtsi surrounding
translation has to be updated.

Signed-off-by: Markus Heidelberg <m.heidelberg@cab.de>
Link: https://patch.msgid.link/20260223111207.54640-1-m.heidelberg@cab.de
Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
This commit is contained in:
Markus Heidelberg 2026-02-23 12:12:03 +01:00 committed by Rob Herring (Arm)
parent 0220405d7e
commit be4b91d9aa
2 changed files with 22 additions and 19 deletions

View File

@ -48,30 +48,30 @@ from 'scripts/dtc/of_unittest_expect --help'.
3. Test-data
============
The Device Tree Source file (drivers/of/unittest-data/testcases.dts) contains
The Device Tree Source file (drivers/of/unittest-data/testcases.dtso) contains
the test data required for executing the unit tests automated in
drivers/of/unittest.c. See the content of the folder::
drivers/of/unittest-data/tests-*.dtsi
for the Device Tree Source Include files (.dtsi) included in testcases.dts.
for the Device Tree Source Include files (.dtsi) included in testcases.dtso.
When the kernel is built with CONFIG_OF_UNITTEST enabled, then the following make
rule::
$(obj)/%.dtb: $(src)/%.dts FORCE
$(call if_changed_dep, dtc)
$(obj)/%.dtbo: $(src)/%.dtso $(DTC) FORCE
$(call if_changed_dep,dtc)
is used to compile the DT source file (testcases.dts) into a binary blob
(testcases.dtb), also referred as flattened DT.
is used to compile the DT source file (testcases.dtso) into a binary blob
(testcases.dtbo), also referred as flattened DT.
After that, using the following rule the binary blob above is wrapped as an
assembly file (testcases.dtb.S)::
assembly file (testcases.dtbo.S)::
$(obj)/%.dtb.S: $(obj)/%.dtb
$(call cmd, dt_S_dtb)
$(obj)/%.dtbo.S: $(obj)/%.dtbo FORCE
$(call if_changed,wrap_S_dtb)
The assembly file is compiled into an object file (testcases.dtb.o), and is
The assembly file is compiled into an object file (testcases.dtbo.o), and is
linked into the kernel image.

View File

@ -32,27 +32,30 @@ OF Selftest被设计用来测试提供给设备驱动开发者的接口includ
2. 测试数据
===========
设备树源文件drivers/of/unittest-data/testcases.dts包含执行drivers/of/unittest.c
中自动化单元测试所需的测试数据。目前,以下设备树源包含文件(.dtsi被包含在testcases.dt中::
设备树源文件drivers/of/unittest-data/testcases.dtso包含执行drivers/of/unittest.c
中自动化单元测试所需的测试数据。目前,以下设备树源包含文件(.dtsi被包含在testcases.dtso中::
drivers/of/unittest-data/tests-interrupts.dtsi
drivers/of/unittest-data/tests-platform.dtsi
drivers/of/unittest-data/tests-phandle.dtsi
drivers/of/unittest-data/tests-match.dtsi
drivers/of/unittest-data/tests-address.dtsi
drivers/of/unittest-data/tests-overlay.dtsi
drivers/of/unittest-data/tests-lifecycle.dtsi
当内核在启用CONFIG_OF_UNITTEST的情况下被构建时那么下面的make规则::
$(obj)/%.dtb: $(src)/%.dts FORCE
$(call if_changed_dep, dtc)
$(obj)/%.dtbo: $(src)/%.dtso $(DTC) FORCE
$(call if_changed_dep,dtc)
用于将DT源文件testcases.dts编译成二进制blobtestcases.dtb也被称为扁平化的DT。
用于将DT源文件testcases.dtso编译成二进制blobtestcases.dtbo也被称为扁平化的DT。
之后使用以下规则将上述二进制blob包装成一个汇编文件testcases.dtb.S::
之后使用以下规则将上述二进制blob包装成一个汇编文件testcases.dtbo.S::
$(obj)/%.dtb.S: $(obj)/%.dtb
$(call cmd, dt_S_dtb)
$(obj)/%.dtbo.S: $(obj)/%.dtbo FORCE
$(call if_changed,wrap_S_dtb)
汇编文件被编译成一个对象文件testcases.dtb.o并被链接到内核镜像中。
汇编文件被编译成一个对象文件testcases.dtbo.o并被链接到内核镜像中。
2.1. 添加测试数据