u-boot/doc/develop/driver-model
Simon Glass 0e4b697f88 test: Make a copy of the device tree before running a test
When the flat device tree changes it can mess up the live tree since that
uses the flat tree for its strings. This affects only a few sandbox tests
which modify the device tree, but the number will grow as ofnode support
for writing improves.

While the control FDT is not intended to change while U-Boot is running,
some tests do so. For example, the ofnode interface only supports
modifying properties in the control FDT, so tests must use that.

To solve this problem, keep a copy of the FDT and restore it as needed
when the test is finished. The copy only happens on sandbox (except SPL
builds), to reduce memory usage and because these tests are not useful on
other boards. For other boards, a checksum is taken to ensure that nothing
changes.

It would be possible to always checksum the FDT on sandbox and only
restore it if needed, but this is slightly slower than restoring it every
time, at least with crc8.

Move the code which checks for success to the very end, for clarity.

Signed-off-by: Simon Glass <sjg@chromium.org>
2022-09-29 16:09:56 -04:00
..
bind.rst doc: Move driver model docs under develop/ 2021-03-26 17:03:10 +13:00
debugging.rst doc: Move driver model docs under develop/ 2021-03-26 17:03:10 +13:00
design.rst doc: dm: clarify activation. 2022-08-20 08:38:12 +02:00
ethernet.rst doc: Move driver model docs under develop/ 2021-03-26 17:03:10 +13:00
fdt-fixup.rst doc: Move driver model docs under develop/ 2021-03-26 17:03:10 +13:00
fs_firmware_loader.rst doc: Move driver model docs under develop/ 2021-03-26 17:03:10 +13:00
i2c-howto.rst doc: Move driver model docs under develop/ 2021-03-26 17:03:10 +13:00
index.rst doc: develop: Convert README.nvme to reST 2021-06-23 17:21:14 +08:00
livetree.rst test: Make a copy of the device tree before running a test 2022-09-29 16:09:56 -04:00
migration.rst blk: Rename HAVE_BLOCK_DEVICE 2022-09-16 11:05:16 -04:00
nvme.rst nvme: Split out PCI support 2022-02-10 16:44:23 -05:00
of-plat.rst linker_lists: Rename sections to remove . prefix 2022-06-23 12:58:18 -04:00
pci-info.rst doc: Move driver model docs under develop/ 2021-03-26 17:03:10 +13:00
pmic-framework.rst doc: Move driver model docs under develop/ 2021-03-26 17:03:10 +13:00
remoteproc-framework.rst doc: Move driver model docs under develop/ 2021-03-26 17:03:10 +13:00
serial-howto.rst arm: Remove PXA architecture support 2022-07-07 09:29:08 -04:00
soc-framework.rst doc: Move driver model docs under develop/ 2021-03-26 17:03:10 +13:00
spi-howto.rst doc: Move driver model docs under develop/ 2021-03-26 17:03:10 +13:00
usb-info.rst doc: Move driver model docs under develop/ 2021-03-26 17:03:10 +13:00
virtio.rst doc: develop: Convert README.virtio to reST 2021-05-10 13:56:12 +08:00