xref: /linux-6.15/drivers/of/Kconfig (revision 7b937cc2)
1# SPDX-License-Identifier: GPL-2.0
2config DTC
3	bool
4
5menuconfig OF
6	bool "Device Tree and Open Firmware support"
7	help
8	  This option enables the device tree infrastructure.
9	  It is automatically selected by platforms that need it or can
10	  be enabled manually for unittests, overlays or
11	  compile-coverage.
12
13if OF
14
15config OF_UNITTEST
16	bool "Device Tree runtime unit tests"
17	depends on OF_EARLY_FLATTREE
18	select IRQ_DOMAIN
19	select OF_RESOLVE
20	help
21	  This option builds in test cases for the device tree infrastructure
22	  that are executed once at boot time, and the results dumped to the
23	  console.
24
25	  This option should only be enabled for a development kernel. The tests
26	  will taint the kernel with TAINT_TEST. The tests will cause ERROR and
27	  WARNING messages to print on the console. The tests will cause stack
28	  traces to print on the console.  It is possible that the tests will
29	  leave the devicetree in a corrupted state.
30
31	  The unittest output will be verbose.  Copy the output to a file
32	  via capturing the console output or via the dmesg command.  Process
33	  this file with scripts/dtc/of_unittest_expect to reduce the
34	  verbosity, test whether expected output is present, and to
35	  summarize the results.
36
37	  If unsure, say N here. This option is not safe to enable.
38
39config OF_ALL_DTBS
40	bool "Build all Device Tree Blobs"
41	depends on COMPILE_TEST
42	select DTC
43	help
44	  This option builds all possible Device Tree Blobs (DTBs) for the
45	  current architecture.
46
47	  If unsure, say N here, but this option is safe to enable.
48
49config OF_FLATTREE
50	bool
51	select DTC
52	select LIBFDT
53	select CRC32
54
55config OF_EARLY_FLATTREE
56	def_bool OF && !(SPARC || ALPHA || HEXAGON || M68K || PARISC || S390)
57	select DMA_DECLARE_COHERENT if HAS_DMA && HAS_IOMEM
58	select OF_FLATTREE
59
60config OF_PROMTREE
61	bool
62
63config OF_KOBJ
64	def_bool SYSFS
65
66# Hardly any platforms need this.  It is safe to select, but only do so if you
67# need it.
68config OF_DYNAMIC
69	bool "Support for dynamic device trees" if OF_UNITTEST
70	select OF_KOBJ
71	help
72	  On some platforms, the device tree can be manipulated at runtime.
73	  While this option is selected automatically on such platforms, you
74	  can enable it manually to improve device tree unit test coverage.
75
76config OF_ADDRESS
77	def_bool y
78	depends on !SPARC && (HAS_IOMEM || UML)
79
80config OF_IRQ
81	def_bool y
82	depends on !SPARC && IRQ_DOMAIN
83
84config OF_RESERVED_MEM
85	def_bool OF_EARLY_FLATTREE
86
87config OF_RESOLVE
88	bool
89
90config OF_OVERLAY
91	bool "Device Tree overlays"
92	select OF_DYNAMIC
93	select OF_FLATTREE
94	select OF_RESOLVE
95	help
96	  Overlays are a method to dynamically modify part of the kernel's
97	  device tree with dynamically loaded data.
98	  While this option is selected automatically when needed, you can
99	  enable it manually to improve device tree unit test coverage.
100
101config OF_NUMA
102	bool
103
104endif # OF
105