xref: /linux/drivers/of/Kconfig (revision 6a34dfa15d6edf7e78b8118d862d2db0889cf669)
1af6074fcSRob Herring# SPDX-License-Identifier: GPL-2.0
25ab5fc7eSGrant Likelyconfig DTC
35ab5fc7eSGrant Likely	bool
45ab5fc7eSGrant Likely
5*654102dfSMasahiro Yamadaconfig GENERIC_BUILTIN_DTB
6*654102dfSMasahiro Yamada	bool
7*654102dfSMasahiro Yamada
8*654102dfSMasahiro Yamadaconfig BUILTIN_DTB_ALL
9*654102dfSMasahiro Yamada	bool
10*654102dfSMasahiro Yamada
110166dc11SRob Herringmenuconfig OF
120166dc11SRob Herring	bool "Device Tree and Open Firmware support"
130166dc11SRob Herring	help
140166dc11SRob Herring	  This option enables the device tree infrastructure.
150166dc11SRob Herring	  It is automatically selected by platforms that need it or can
160166dc11SRob Herring	  be enabled manually for unittests, overlays or
170166dc11SRob Herring	  compile-coverage.
18bcbefae2SStephen Rothwell
190166dc11SRob Herringif OF
205ab5fc7eSGrant Likely
2119fd7487SGrant Likelyconfig OF_UNITTEST
2219fd7487SGrant Likely	bool "Device Tree runtime unit tests"
237b937cc2SFrank Rowand	depends on OF_EARLY_FLATTREE
246019a3d0SRob Herring	select IRQ_DOMAIN
252eb46da2SGrant Likely	select OF_RESOLVE
2653a42093SGrant Likely	help
2753a42093SGrant Likely	  This option builds in test cases for the device tree infrastructure
285d927086SGeert Uytterhoeven	  that are executed once at boot time, and the results dumped to the
2953a42093SGrant Likely	  console.
3053a42093SGrant Likely
31f381b31aSFrank Rowand	  This option should only be enabled for a development kernel. The tests
32f381b31aSFrank Rowand	  will taint the kernel with TAINT_TEST. The tests will cause ERROR and
33f381b31aSFrank Rowand	  WARNING messages to print on the console. The tests will cause stack
34f381b31aSFrank Rowand	  traces to print on the console.  It is possible that the tests will
35f381b31aSFrank Rowand	  leave the devicetree in a corrupted state.
36f381b31aSFrank Rowand
37f381b31aSFrank Rowand	  The unittest output will be verbose.  Copy the output to a file
38f381b31aSFrank Rowand	  via capturing the console output or via the dmesg command.  Process
39f381b31aSFrank Rowand	  this file with scripts/dtc/of_unittest_expect to reduce the
40f381b31aSFrank Rowand	  verbosity, test whether expected output is present, and to
41f381b31aSFrank Rowand	  summarize the results.
42f381b31aSFrank Rowand
43f381b31aSFrank Rowand	  If unsure, say N here. This option is not safe to enable.
4453a42093SGrant Likely
45893ecc6dSStephen Boydconfig OF_KUNIT_TEST
46893ecc6dSStephen Boyd	tristate "Devicetree KUnit Test" if !KUNIT_ALL_TESTS
47893ecc6dSStephen Boyd	depends on KUNIT
48893ecc6dSStephen Boyd	default KUNIT_ALL_TESTS
49893ecc6dSStephen Boyd	help
50893ecc6dSStephen Boyd	  This option builds KUnit unit tests for device tree infrastructure.
51893ecc6dSStephen Boyd
52893ecc6dSStephen Boyd	  If unsure, say N here, but this option is safe to enable.
53893ecc6dSStephen Boyd
541b7c501bSRob Herringconfig OF_ALL_DTBS
551b7c501bSRob Herring	bool "Build all Device Tree Blobs"
561b7c501bSRob Herring	depends on COMPILE_TEST
571b7c501bSRob Herring	select DTC
581b7c501bSRob Herring	help
591b7c501bSRob Herring	  This option builds all possible Device Tree Blobs (DTBs) for the
601b7c501bSRob Herring	  current architecture.
611b7c501bSRob Herring
621b7c501bSRob Herring	  If unsure, say N here, but this option is safe to enable.
631b7c501bSRob Herring
64e169cfbeSGrant Likelyconfig OF_FLATTREE
65e169cfbeSGrant Likely	bool
665ab5fc7eSGrant Likely	select DTC
67e6a6928cSRob Herring	select LIBFDT
6808d53aa5SArd Biesheuvel	select CRC32
69e169cfbeSGrant Likely
70e6ce1324SStephen Neuendorfferconfig OF_EARLY_FLATTREE
717b937cc2SFrank Rowand	def_bool OF && !(SPARC || ALPHA || HEXAGON || M68K || PARISC || S390)
727e08baf6SBaoquan He	select DMA_DECLARE_COHERENT if HAS_DMA && HAS_IOMEM
73e6ce1324SStephen Neuendorffer	select OF_FLATTREE
74e6ce1324SStephen Neuendorffer
753cfc535cSAndres Salomonconfig OF_PROMTREE
763cfc535cSAndres Salomon	bool
773cfc535cSAndres Salomon
78b56b5528SRob Herringconfig OF_KOBJ
79b56b5528SRob Herring	def_bool SYSFS
80b56b5528SRob Herring
810f22dd39SGrant Likely# Hardly any platforms need this.  It is safe to select, but only do so if you
820f22dd39SGrant Likely# need it.
83fcdeb7feSGrant Likelyconfig OF_DYNAMIC
84121c92caSGeert Uytterhoeven	bool "Support for dynamic device trees" if OF_UNITTEST
85b56b5528SRob Herring	select OF_KOBJ
86121c92caSGeert Uytterhoeven	help
87121c92caSGeert Uytterhoeven	  On some platforms, the device tree can be manipulated at runtime.
88121c92caSGeert Uytterhoeven	  While this option is selected automatically on such platforms, you
89121c92caSGeert Uytterhoeven	  can enable it manually to improve device tree unit test coverage.
90fcdeb7feSGrant Likely
916b884a8dSGrant Likelyconfig OF_ADDRESS
926b884a8dSGrant Likely	def_bool y
936019a3d0SRob Herring	depends on !SPARC && (HAS_IOMEM || UML)
946b884a8dSGrant Likely
95e3873444SGrant Likelyconfig OF_IRQ
96e3873444SGrant Likely	def_bool y
9763c60e3aSGeert Uytterhoeven	depends on !SPARC && IRQ_DOMAIN
98e3873444SGrant Likely
993f0c8206SMarek Szyprowskiconfig OF_RESERVED_MEM
1001ee292a6SRob Herring	def_bool OF_EARLY_FLATTREE
1013f0c8206SMarek Szyprowski
1027941b27bSPantelis Antoniouconfig OF_RESOLVE
1037941b27bSPantelis Antoniou	bool
1047941b27bSPantelis Antoniou
1057518b589SPantelis Antoniouconfig OF_OVERLAY
1065c776064SMatwey V. Kornilov	bool "Device Tree overlays"
1077518b589SPantelis Antoniou	select OF_DYNAMIC
10839a751a4SFrank Rowand	select OF_FLATTREE
1097518b589SPantelis Antoniou	select OF_RESOLVE
110121c92caSGeert Uytterhoeven	help
111121c92caSGeert Uytterhoeven	  Overlays are a method to dynamically modify part of the kernel's
112121c92caSGeert Uytterhoeven	  device tree with dynamically loaded data.
113121c92caSGeert Uytterhoeven	  While this option is selected automatically when needed, you can
114121c92caSGeert Uytterhoeven	  enable it manually to improve device tree unit test coverage.
1157518b589SPantelis Antoniou
1165c9dd72dSStephen Boydconfig OF_OVERLAY_KUNIT_TEST
1175c9dd72dSStephen Boyd	tristate "Device Tree overlay KUnit tests" if !KUNIT_ALL_TESTS
1185c9dd72dSStephen Boyd	depends on KUNIT
1195c9dd72dSStephen Boyd	default KUNIT_ALL_TESTS
120332857fdSStephen Boyd	select DTC
1215c9dd72dSStephen Boyd	help
1225c9dd72dSStephen Boyd	  This option builds KUnit unit tests for the device tree overlay code.
1235c9dd72dSStephen Boyd
1245c9dd72dSStephen Boyd	  If unsure, say N here, but this option is safe to enable.
1255c9dd72dSStephen Boyd
126298535c0SDavid Daneyconfig OF_NUMA
127298535c0SDavid Daney	bool
128298535c0SDavid Daney
1290166dc11SRob Herringendif # OF
130