| 1 | // SPDX-License-Identifier: GPL-2.0 |
|---|---|
| 2 | /* |
| 3 | * Self tests for device tree subsystem |
| 4 | */ |
| 5 | |
| 6 | #define pr_fmt(fmt) "### dt-test ### " fmt |
| 7 | |
| 8 | #include <linux/memblock.h> |
| 9 | #include <linux/clk.h> |
| 10 | #include <linux/dma-direct.h> /* to test phys_to_dma/dma_to_phys */ |
| 11 | #include <linux/err.h> |
| 12 | #include <linux/errno.h> |
| 13 | #include <linux/hashtable.h> |
| 14 | #include <linux/libfdt.h> |
| 15 | #include <linux/of.h> |
| 16 | #include <linux/of_address.h> |
| 17 | #include <linux/of_fdt.h> |
| 18 | #include <linux/of_irq.h> |
| 19 | #include <linux/of_platform.h> |
| 20 | #include <linux/list.h> |
| 21 | #include <linux/mutex.h> |
| 22 | #include <linux/slab.h> |
| 23 | #include <linux/device.h> |
| 24 | #include <linux/platform_device.h> |
| 25 | #include <linux/pci.h> |
| 26 | #include <linux/kernel.h> |
| 27 | |
| 28 | #include <linux/i2c.h> |
| 29 | #include <linux/i2c-mux.h> |
| 30 | #include <linux/gpio/driver.h> |
| 31 | |
| 32 | #include <linux/bitops.h> |
| 33 | |
| 34 | #include "of_private.h" |
| 35 | |
| 36 | static struct unittest_results { |
| 37 | int passed; |
| 38 | int failed; |
| 39 | } unittest_results; |
| 40 | |
| 41 | #define unittest(result, fmt, ...) ({ \ |
| 42 | bool |
