xref: /linux/drivers/of/Kconfig (revision 7b937cc243e5b1df8780a0aa743ce800df6c68d1)
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"
17*7b937cc2SFrank Rowand	depends on OF_EARLY_FLATTREE
186019a3d0SRob Herring	select IRQ_DOMAIN
192eb46da2SGrant Likely	select OF_RESOLVE
2053a42093SGrant Likely	help
2153a42093SGrant Likely	  This option builds in test cases for the device tree infrastructure
225d927086SGeert Uytterhoeven	  that are executed once at boot time, and the results dumped to the
2353a42093SGrant Likely	  console.
2453a42093SGrant Likely
25f381b31aSFrank Rowand	  This option should only be enabled for a development kernel. The tests
26f381b31aSFrank Rowand	  will taint the kernel with TAINT_TEST. The tests will cause ERROR and
27f381b31aSFrank Rowand	  WARNING messages to print on the console. The tests will cause stack
28f381b31aSFrank Rowand	  traces to print on the console.  It is possible that the tests will
29f381b31aSFrank Rowand	  leave the devicetree in a corrupted state.
30f381b31aSFrank Rowand
31f381b31aSFrank Rowand	  The unittest output will be verbose.  Copy the output to a file
32f381b31aSFrank Rowand	  via capturing the console output or via the dmesg command.  Process
33f381b31aSFrank Rowand	  this file with scripts/dtc/of_unittest_expect to reduce the
34f381b31aSFrank Rowand	  verbosity, test whether expected output is present, and to
35f381b31aSFrank Rowand	  summarize the results.
36f381b31aSFrank Rowand
37f381b31aSFrank Rowand	  If unsure, say N here. This option is not safe to enable.
3853a42093SGrant Likely
391b7c501bSRob Herringconfig OF_ALL_DTBS
401b7c501bSRob Herring	bool "Build all Device Tree Blobs"
411b7c501bSRob Herring	depends on COMPILE_TEST
421b7c501bSRob Herring	select DTC
431b7c501bSRob Herring	help
441b7c501bSRob Herring	  This option builds all possible Device Tree Blobs (DTBs) for the
451b7c501bSRob Herring	  current architecture.
461b7c501bSRob Herring
471b7c501bSRob Herring	  If unsure, say N here, but this option is safe to enable.
481b7c501bSRob Herring
49e169cfbeSGrant Likelyconfig OF_FLATTREE
50e169cfbeSGrant Likely	bool
515ab5fc7eSGrant Likely	select DTC
52e6a6928cSRob Herring	select LIBFDT
5308d53aa5SArd Biesheuvel	select CRC32
54e169cfbeSGrant Likely
55e6ce1324SStephen Neuendorfferconfig OF_EARLY_FLATTREE
56*7b937cc2SFrank Rowand	def_bool OF && !(SPARC || ALPHA || HEXAGON || M68K || PARISC || S390)
577e08baf6SBaoquan He	select DMA_DECLARE_COHERENT if HAS_DMA && HAS_IOMEM
58e6ce1324SStephen Neuendorffer	select OF_FLATTREE
59e6ce1324SStephen Neuendorffer
603cfc535cSAndres Salomonconfig OF_PROMTREE
613cfc535cSAndres Salomon	bool
623cfc535cSAndres Salomon
63b56b5528SRob Herringconfig OF_KOBJ
64b56b5528SRob Herring	def_bool SYSFS
65b56b5528SRob Herring
660f22dd39SGrant Likely# Hardly any platforms need this.  It is safe to select, but only do so if you
670f22dd39SGrant Likely# need it.
68fcdeb7feSGrant Likelyconfig OF_DYNAMIC
69121c92caSGeert Uytterhoeven	bool "Support for dynamic device trees" if OF_UNITTEST
70b56b5528SRob Herring	select OF_KOBJ
71121c92caSGeert Uytterhoeven	help
72121c92caSGeert Uytterhoeven	  On some platforms, the device tree can be manipulated at runtime.
73121c92caSGeert Uytterhoeven	  While this option is selected automatically on such platforms, you
74121c92caSGeert Uytterhoeven	  can enable it manually to improve device tree unit test coverage.
75fcdeb7feSGrant Likely
766b884a8dSGrant Likelyconfig OF_ADDRESS
776b884a8dSGrant Likely	def_bool y
786019a3d0SRob Herring	depends on !SPARC && (HAS_IOMEM || UML)
796b884a8dSGrant Likely
80e3873444SGrant Likelyconfig OF_IRQ
81e3873444SGrant Likely	def_bool y
8263c60e3aSGeert Uytterhoeven	depends on !SPARC && IRQ_DOMAIN
83e3873444SGrant Likely
843f0c8206SMarek Szyprowskiconfig OF_RESERVED_MEM
851ee292a6SRob Herring	def_bool OF_EARLY_FLATTREE
863f0c8206SMarek Szyprowski
877941b27bSPantelis Antoniouconfig OF_RESOLVE
887941b27bSPantelis Antoniou	bool
897941b27bSPantelis Antoniou
907518b589SPantelis Antoniouconfig OF_OVERLAY
915c776064SMatwey V. Kornilov	bool "Device Tree overlays"
927518b589SPantelis Antoniou	select OF_DYNAMIC
9339a751a4SFrank Rowand	select OF_FLATTREE
947518b589SPantelis Antoniou	select OF_RESOLVE
95121c92caSGeert Uytterhoeven	help
96121c92caSGeert Uytterhoeven	  Overlays are a method to dynamically modify part of the kernel's
97121c92caSGeert Uytterhoeven	  device tree with dynamically loaded data.
98121c92caSGeert Uytterhoeven	  While this option is selected automatically when needed, you can
99121c92caSGeert Uytterhoeven	  enable it manually to improve device tree unit test coverage.
1007518b589SPantelis Antoniou
101298535c0SDavid Daneyconfig OF_NUMA
102298535c0SDavid Daney	bool
103298535c0SDavid Daney
1040166dc11SRob Herringendif # OF
105