xref: /openbmc/linux/drivers/of/Kconfig (revision 7e08baf6)
1af6074fcSRob Herring# SPDX-License-Identifier: GPL-2.0
25ab5fc7eSGrant Likelyconfig DTC
35ab5fc7eSGrant Likely	bool
45ab5fc7eSGrant Likely
50166dc11SRob Herringmenuconfig OF
60166dc11SRob Herring	bool "Device Tree and Open Firmware support"
70166dc11SRob Herring	help
80166dc11SRob Herring	  This option enables the device tree infrastructure.
90166dc11SRob Herring	  It is automatically selected by platforms that need it or can
100166dc11SRob Herring	  be enabled manually for unittests, overlays or
110166dc11SRob Herring	  compile-coverage.
12bcbefae2SStephen Rothwell
130166dc11SRob Herringif OF
145ab5fc7eSGrant Likely
1519fd7487SGrant Likelyconfig OF_UNITTEST
1619fd7487SGrant Likely	bool "Device Tree runtime unit tests"
176019a3d0SRob Herring	depends on !SPARC
186019a3d0SRob Herring	select IRQ_DOMAIN
19649e0a77SRob Herring	select OF_EARLY_FLATTREE
202eb46da2SGrant Likely	select OF_RESOLVE
2153a42093SGrant Likely	help
2253a42093SGrant Likely	  This option builds in test cases for the device tree infrastructure
235d927086SGeert Uytterhoeven	  that are executed once at boot time, and the results dumped to the
2453a42093SGrant Likely	  console.
2553a42093SGrant Likely
26f381b31aSFrank Rowand	  This option should only be enabled for a development kernel. The tests
27f381b31aSFrank Rowand	  will taint the kernel with TAINT_TEST. The tests will cause ERROR and
28f381b31aSFrank Rowand	  WARNING messages to print on the console. The tests will cause stack
29f381b31aSFrank Rowand	  traces to print on the console.  It is possible that the tests will
30f381b31aSFrank Rowand	  leave the devicetree in a corrupted state.
31f381b31aSFrank Rowand
32f381b31aSFrank Rowand	  The unittest output will be verbose.  Copy the output to a file
33f381b31aSFrank Rowand	  via capturing the console output or via the dmesg command.  Process
34f381b31aSFrank Rowand	  this file with scripts/dtc/of_unittest_expect to reduce the
35f381b31aSFrank Rowand	  verbosity, test whether expected output is present, and to
36f381b31aSFrank Rowand	  summarize the results.
37f381b31aSFrank Rowand
38f381b31aSFrank Rowand	  If unsure, say N here. This option is not safe to enable.
3953a42093SGrant Likely
401b7c501bSRob Herringconfig OF_ALL_DTBS
411b7c501bSRob Herring	bool "Build all Device Tree Blobs"
421b7c501bSRob Herring	depends on COMPILE_TEST
431b7c501bSRob Herring	select DTC
441b7c501bSRob Herring	help
451b7c501bSRob Herring	  This option builds all possible Device Tree Blobs (DTBs) for the
461b7c501bSRob Herring	  current architecture.
471b7c501bSRob Herring
481b7c501bSRob Herring	  If unsure, say N here, but this option is safe to enable.
491b7c501bSRob Herring
50e169cfbeSGrant Likelyconfig OF_FLATTREE
51e169cfbeSGrant Likely	bool
525ab5fc7eSGrant Likely	select DTC
53e6a6928cSRob Herring	select LIBFDT
5408d53aa5SArd Biesheuvel	select CRC32
55e169cfbeSGrant Likely
56e6ce1324SStephen Neuendorfferconfig OF_EARLY_FLATTREE
57e6ce1324SStephen Neuendorffer	bool
58*7e08baf6SBaoquan He	select DMA_DECLARE_COHERENT if HAS_DMA && HAS_IOMEM
59e6ce1324SStephen Neuendorffer	select OF_FLATTREE
60e6ce1324SStephen Neuendorffer
613cfc535cSAndres Salomonconfig OF_PROMTREE
623cfc535cSAndres Salomon	bool
633cfc535cSAndres Salomon
64b56b5528SRob Herringconfig OF_KOBJ
65b56b5528SRob Herring	def_bool SYSFS
66b56b5528SRob Herring
670f22dd39SGrant Likely# Hardly any platforms need this.  It is safe to select, but only do so if you
680f22dd39SGrant Likely# need it.
69fcdeb7feSGrant Likelyconfig OF_DYNAMIC
70121c92caSGeert Uytterhoeven	bool "Support for dynamic device trees" if OF_UNITTEST
71b56b5528SRob Herring	select OF_KOBJ
72121c92caSGeert Uytterhoeven	help
73121c92caSGeert Uytterhoeven	  On some platforms, the device tree can be manipulated at runtime.
74121c92caSGeert Uytterhoeven	  While this option is selected automatically on such platforms, you
75121c92caSGeert Uytterhoeven	  can enable it manually to improve device tree unit test coverage.
76fcdeb7feSGrant Likely
776b884a8dSGrant Likelyconfig OF_ADDRESS
786b884a8dSGrant Likely	def_bool y
796019a3d0SRob Herring	depends on !SPARC && (HAS_IOMEM || UML)
806b884a8dSGrant Likely
81e3873444SGrant Likelyconfig OF_IRQ
82e3873444SGrant Likely	def_bool y
8363c60e3aSGeert Uytterhoeven	depends on !SPARC && IRQ_DOMAIN
84e3873444SGrant Likely
853f0c8206SMarek Szyprowskiconfig OF_RESERVED_MEM
861ee292a6SRob Herring	def_bool OF_EARLY_FLATTREE
873f0c8206SMarek Szyprowski
887941b27bSPantelis Antoniouconfig OF_RESOLVE
897941b27bSPantelis Antoniou	bool
907941b27bSPantelis Antoniou
917518b589SPantelis Antoniouconfig OF_OVERLAY
925c776064SMatwey V. Kornilov	bool "Device Tree overlays"
937518b589SPantelis Antoniou	select OF_DYNAMIC
9439a751a4SFrank Rowand	select OF_FLATTREE
957518b589SPantelis Antoniou	select OF_RESOLVE
96121c92caSGeert Uytterhoeven	help
97121c92caSGeert Uytterhoeven	  Overlays are a method to dynamically modify part of the kernel's
98121c92caSGeert Uytterhoeven	  device tree with dynamically loaded data.
99121c92caSGeert Uytterhoeven	  While this option is selected automatically when needed, you can
100121c92caSGeert Uytterhoeven	  enable it manually to improve device tree unit test coverage.
1017518b589SPantelis Antoniou
102298535c0SDavid Daneyconfig OF_NUMA
103298535c0SDavid Daney	bool
104298535c0SDavid Daney
1050166dc11SRob Herringendif # OF
106