xref: /linux/drivers/of/Kconfig (revision 332857fdac73f1c7b74ad962c07bb39e4c0c145a)
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"
177b937cc2SFrank 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
39893ecc6dSStephen Boydconfig OF_KUNIT_TEST
40893ecc6dSStephen Boyd	tristate "Devicetree KUnit Test" if !KUNIT_ALL_TESTS
41893ecc6dSStephen Boyd	depends on KUNIT
42893ecc6dSStephen Boyd	default KUNIT_ALL_TESTS
43893ecc6dSStephen Boyd	help
44893ecc6dSStephen Boyd	  This option builds KUnit unit tests for device tree infrastructure.
45893ecc6dSStephen Boyd
46893ecc6dSStephen Boyd	  If unsure, say N here, but this option is safe to enable.
47893ecc6dSStephen Boyd
481b7c501bSRob Herringconfig OF_ALL_DTBS
491b7c501bSRob Herring	bool "Build all Device Tree Blobs"
501b7c501bSRob Herring	depends on COMPILE_TEST
511b7c501bSRob Herring	select DTC
521b7c501bSRob Herring	help
531b7c501bSRob Herring	  This option builds all possible Device Tree Blobs (DTBs) for the
541b7c501bSRob Herring	  current architecture.
551b7c501bSRob Herring
561b7c501bSRob Herring	  If unsure, say N here, but this option is safe to enable.
571b7c501bSRob Herring
58e169cfbeSGrant Likelyconfig OF_FLATTREE
59e169cfbeSGrant Likely	bool
605ab5fc7eSGrant Likely	select DTC
61e6a6928cSRob Herring	select LIBFDT
6208d53aa5SArd Biesheuvel	select CRC32
63e169cfbeSGrant Likely
64e6ce1324SStephen Neuendorfferconfig OF_EARLY_FLATTREE
657b937cc2SFrank Rowand	def_bool OF && !(SPARC || ALPHA || HEXAGON || M68K || PARISC || S390)
667e08baf6SBaoquan He	select DMA_DECLARE_COHERENT if HAS_DMA && HAS_IOMEM
67e6ce1324SStephen Neuendorffer	select OF_FLATTREE
68e6ce1324SStephen Neuendorffer
693cfc535cSAndres Salomonconfig OF_PROMTREE
703cfc535cSAndres Salomon	bool
713cfc535cSAndres Salomon
72b56b5528SRob Herringconfig OF_KOBJ
73b56b5528SRob Herring	def_bool SYSFS
74b56b5528SRob Herring
750f22dd39SGrant Likely# Hardly any platforms need this.  It is safe to select, but only do so if you
760f22dd39SGrant Likely# need it.
77fcdeb7feSGrant Likelyconfig OF_DYNAMIC
78121c92caSGeert Uytterhoeven	bool "Support for dynamic device trees" if OF_UNITTEST
79b56b5528SRob Herring	select OF_KOBJ
80121c92caSGeert Uytterhoeven	help
81121c92caSGeert Uytterhoeven	  On some platforms, the device tree can be manipulated at runtime.
82121c92caSGeert Uytterhoeven	  While this option is selected automatically on such platforms, you
83121c92caSGeert Uytterhoeven	  can enable it manually to improve device tree unit test coverage.
84fcdeb7feSGrant Likely
856b884a8dSGrant Likelyconfig OF_ADDRESS
866b884a8dSGrant Likely	def_bool y
876019a3d0SRob Herring	depends on !SPARC && (HAS_IOMEM || UML)
886b884a8dSGrant Likely
89e3873444SGrant Likelyconfig OF_IRQ
90e3873444SGrant Likely	def_bool y
9163c60e3aSGeert Uytterhoeven	depends on !SPARC && IRQ_DOMAIN
92e3873444SGrant Likely
933f0c8206SMarek Szyprowskiconfig OF_RESERVED_MEM
941ee292a6SRob Herring	def_bool OF_EARLY_FLATTREE
953f0c8206SMarek Szyprowski
967941b27bSPantelis Antoniouconfig OF_RESOLVE
977941b27bSPantelis Antoniou	bool
987941b27bSPantelis Antoniou
997518b589SPantelis Antoniouconfig OF_OVERLAY
1005c776064SMatwey V. Kornilov	bool "Device Tree overlays"
1017518b589SPantelis Antoniou	select OF_DYNAMIC
10239a751a4SFrank Rowand	select OF_FLATTREE
1037518b589SPantelis Antoniou	select OF_RESOLVE
104121c92caSGeert Uytterhoeven	help
105121c92caSGeert Uytterhoeven	  Overlays are a method to dynamically modify part of the kernel's
106121c92caSGeert Uytterhoeven	  device tree with dynamically loaded data.
107121c92caSGeert Uytterhoeven	  While this option is selected automatically when needed, you can
108121c92caSGeert Uytterhoeven	  enable it manually to improve device tree unit test coverage.
1097518b589SPantelis Antoniou
1105c9dd72dSStephen Boydconfig OF_OVERLAY_KUNIT_TEST
1115c9dd72dSStephen Boyd	tristate "Device Tree overlay KUnit tests" if !KUNIT_ALL_TESTS
1125c9dd72dSStephen Boyd	depends on KUNIT
1135c9dd72dSStephen Boyd	default KUNIT_ALL_TESTS
114*332857fdSStephen Boyd	select DTC
1155c9dd72dSStephen Boyd	help
1165c9dd72dSStephen Boyd	  This option builds KUnit unit tests for the device tree overlay code.
1175c9dd72dSStephen Boyd
1185c9dd72dSStephen Boyd	  If unsure, say N here, but this option is safe to enable.
1195c9dd72dSStephen Boyd
120298535c0SDavid Daneyconfig OF_NUMA
121298535c0SDavid Daney	bool
122298535c0SDavid Daney
1230166dc11SRob Herringendif # OF
124