Kconfig 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388
  1. #
  2. # Device Tree Control
  3. #
  4. config SUPPORT_OF_CONTROL
  5. bool
  6. config DTC
  7. bool
  8. config PYLIBFDT
  9. bool
  10. config DTOC
  11. bool
  12. select PYLIBFDT
  13. config BINMAN
  14. bool
  15. select DTOC
  16. menu "Device Tree Control"
  17. depends on SUPPORT_OF_CONTROL
  18. config OF_CONTROL
  19. bool "Run-time configuration via Device Tree"
  20. select DTC
  21. select OF_LIBFDT if !OF_PLATDATA
  22. help
  23. This feature provides for run-time configuration of U-Boot
  24. via a flattened device tree.
  25. config OF_BOARD_FIXUP
  26. bool "Board-specific manipulation of Device Tree"
  27. help
  28. In certain circumstances it is necessary to be able to modify
  29. U-Boot's device tree (e.g. to delete device from it). This option
  30. make the Device Tree writeable and provides a board-specific
  31. "board_fix_fdt" callback (called during pre-relocation time), which
  32. enables the board initialization to modifiy the Device Tree. The
  33. modified copy is subsequently used by U-Boot after relocation.
  34. config SPL_OF_CONTROL
  35. bool "Enable run-time configuration via Device Tree in SPL"
  36. depends on SPL && OF_CONTROL
  37. select SPL_OF_LIBFDT if !SPL_OF_PLATDATA
  38. help
  39. Some boards use device tree in U-Boot but only have 4KB of SRAM
  40. which is not enough to support device tree. Disable this option to
  41. allow such boards to be supported by U-Boot SPL.
  42. config TPL_OF_CONTROL
  43. bool "Enable run-time configuration via Device Tree in TPL"
  44. depends on TPL && OF_CONTROL
  45. select TPL_OF_LIBFDT if !TPL_OF_PLATDATA
  46. help
  47. Some boards use device tree in U-Boot but only have 4KB of SRAM
  48. which is not enough to support device tree. Enable this option to
  49. allow such boards to be supported by U-Boot TPL.
  50. config OF_LIVE
  51. bool "Enable use of a live tree"
  52. depends on OF_CONTROL
  53. help
  54. Normally U-Boot uses a flat device tree which saves space and
  55. avoids the need to unpack the tree before use. However a flat
  56. tree does not support modification from within U-Boot since it
  57. can invalidate driver-model device tree offsets. This option
  58. enables a live tree which is available after relocation,
  59. and can be adjusted as needed.
  60. choice
  61. prompt "Provider of DTB for DT control"
  62. depends on OF_CONTROL
  63. config OF_SEPARATE
  64. bool "Separate DTB for DT control"
  65. depends on !SANDBOX
  66. help
  67. If this option is enabled, the device tree will be built and
  68. placed as a separate u-boot.dtb file alongside the U-Boot image.
  69. config OF_EMBED
  70. bool "Embedded DTB for DT control"
  71. help
  72. If this option is enabled, the device tree will be picked up and
  73. built into the U-Boot image. This is suitable for local debugging
  74. and development only and is not recommended for production devices.
  75. Boards in the mainline U-Boot tree should not use it.
  76. config OF_BOARD
  77. bool "Provided by the board at runtime"
  78. depends on !SANDBOX
  79. help
  80. If this option is enabled, the device tree will be provided by
  81. the board at runtime if the board supports it, instead of being
  82. bundled with the image.
  83. config OF_HOSTFILE
  84. bool "Host filed DTB for DT control"
  85. depends on SANDBOX
  86. help
  87. If this option is enabled, DTB will be read from a file on startup.
  88. This is only useful for Sandbox. Use the -d flag to U-Boot to
  89. specify the file to read.
  90. config OF_PRIOR_STAGE
  91. bool "Prior stage bootloader DTB for DT control"
  92. help
  93. If this option is enabled, the device tree used for DT
  94. control will be read from a device tree binary, at a memory
  95. location passed to U-Boot by the prior stage bootloader.
  96. endchoice
  97. config DEFAULT_DEVICE_TREE
  98. string "Default Device Tree for DT control"
  99. depends on OF_CONTROL
  100. help
  101. This option specifies the default Device Tree used for DT control.
  102. It can be overridden from the command line:
  103. $ make DEVICE_TREE=<device-tree-name>
  104. config OF_LIST
  105. string "List of device tree files to include for DT control"
  106. depends on SPL_LOAD_FIT || MULTI_DTB_FIT
  107. default DEFAULT_DEVICE_TREE
  108. help
  109. This option specifies a list of device tree files to use for DT
  110. control. These will be packaged into a FIT. At run-time, U-boot
  111. or SPL will select the correct DT to use by examining the
  112. hardware (e.g. reading a board ID value). This is a list of
  113. device tree files (without the directory or .dtb suffix)
  114. separated by <space>.
  115. config OF_OVERLAY_LIST
  116. string "List of device tree overlays to include for DT control"
  117. depends on SPL_LOAD_FIT_APPLY_OVERLAY
  118. help
  119. This option specifies a list of device tree overlays to use for DT
  120. control. This option can then be used by a FIT generator to include
  121. the overlays in the FIT image.
  122. choice
  123. prompt "OF LIST compression"
  124. depends on MULTI_DTB_FIT
  125. default MULTI_DTB_FIT_NO_COMPRESSION
  126. config MULTI_DTB_FIT_LZO
  127. bool "LZO"
  128. depends on SYS_MALLOC_F
  129. select LZO
  130. help
  131. Compress the FIT image containing the DTBs available for the SPL
  132. using LZO compression. (requires lzop on host).
  133. config MULTI_DTB_FIT_GZIP
  134. bool "GZIP"
  135. depends on SYS_MALLOC_F
  136. select GZIP
  137. help
  138. Compress the FIT image containing the DTBs available for the SPL
  139. using GZIP compression. (requires gzip on host)
  140. config MULTI_DTB_FIT_NO_COMPRESSION
  141. bool "No compression"
  142. help
  143. Do not compress the FIT image containing the DTBs available for the SPL.
  144. Use this options only if LZO is not available and the DTBs are very small.
  145. endchoice
  146. choice
  147. prompt "Location of uncompressed DTBs"
  148. depends on (MULTI_DTB_FIT_GZIP || MULTI_DTB_FIT_LZO)
  149. default MULTI_DTB_FIT_DYN_ALLOC if SYS_MALLOC_F
  150. config MULTI_DTB_FIT_DYN_ALLOC
  151. bool "Dynamically allocate the memory"
  152. depends on SYS_MALLOC_F
  153. config MULTI_DTB_FIT_USER_DEFINED_AREA
  154. bool "User-defined location"
  155. endchoice
  156. config MULTI_DTB_FIT_UNCOMPRESS_SZ
  157. hex "Size of memory reserved to uncompress the DTBs"
  158. depends on (MULTI_DTB_FIT_GZIP || MULTI_DTB_FIT_LZO)
  159. default 0x8000
  160. help
  161. This is the size of this area where the DTBs are uncompressed.
  162. If this area is dynamically allocated, make sure that
  163. SYS_MALLOC_F_LEN is big enough to contain it.
  164. config MULTI_DTB_FIT_USER_DEF_ADDR
  165. hex "Address of memory where dtbs are uncompressed"
  166. depends on MULTI_DTB_FIT_USER_DEFINED_AREA
  167. help
  168. the FIT image containing the DTBs is uncompressed in an area defined
  169. at compilation time. This is the address of this area. It must be
  170. aligned on 2-byte boundary.
  171. config DTB_RESELECT
  172. bool "Support swapping dtbs at a later point in boot"
  173. depends on MULTI_DTB_FIT
  174. help
  175. It is possible during initial boot you may need to use a generic
  176. dtb until you can fully determine the board your running on. This
  177. config allows boards to implement a function at a later point
  178. during boot to switch to the "correct" dtb.
  179. config MULTI_DTB_FIT
  180. bool "Support embedding several DTBs in a FIT image for u-boot"
  181. help
  182. This option provides hooks to allow U-boot to parse an
  183. appended FIT image and enable board specific code to then select
  184. the correct DTB to be used. Use this if you need to support
  185. multiple DTBs but don't use the SPL.
  186. config SPL_MULTI_DTB_FIT
  187. depends on SPL_LOAD_FIT && SPL_OF_CONTROL && !SPL_OF_PLATDATA
  188. bool "Support embedding several DTBs in a FIT image for the SPL"
  189. help
  190. This option provides the SPL with the ability to select its own
  191. DTB at runtime from an appended FIT image containing several DTBs.
  192. This allows using the same SPL binary on multiple platforms.
  193. The primary purpose is to handle different versions of
  194. the same platform without tweaking the platform code if the
  195. differences can be expressed in the DTBs (common examples are: bus
  196. capabilities, pad configurations).
  197. config SPL_OF_LIST
  198. string "List of device tree files to include for DT control in SPL"
  199. depends on SPL_MULTI_DTB_FIT
  200. default OF_LIST
  201. help
  202. This option specifies a list of device tree files to use for DT
  203. control in the SPL. These will be packaged into a FIT. At run-time,
  204. the SPL will select the correct DT to use by examining the
  205. hardware (e.g. reading a board ID value). This is a list of
  206. device tree files (without the directory or .dtb suffix)
  207. separated by <space>.
  208. choice
  209. prompt "SPL OF LIST compression"
  210. depends on SPL_MULTI_DTB_FIT
  211. default SPL_MULTI_DTB_FIT_LZO
  212. config SPL_MULTI_DTB_FIT_LZO
  213. bool "LZO"
  214. depends on SYS_MALLOC_F
  215. select SPL_LZO
  216. help
  217. Compress the FIT image containing the DTBs available for the SPL
  218. using LZO compression. (requires lzop on host).
  219. config SPL_MULTI_DTB_FIT_GZIP
  220. bool "GZIP"
  221. depends on SYS_MALLOC_F
  222. select SPL_GZIP
  223. help
  224. Compress the FIT image containing the DTBs available for the SPL
  225. using GZIP compression. (requires gzip on host)
  226. config SPL_MULTI_DTB_FIT_NO_COMPRESSION
  227. bool "No compression"
  228. help
  229. Do not compress the FIT image containing the DTBs available for the SPL.
  230. Use this options only if LZO is not available and the DTBs are very small.
  231. endchoice
  232. choice
  233. prompt "Location of uncompressed DTBs"
  234. depends on (SPL_MULTI_DTB_FIT_GZIP || SPL_MULTI_DTB_FIT_LZO)
  235. default SPL_MULTI_DTB_FIT_DYN_ALLOC if SYS_MALLOC_F
  236. config SPL_MULTI_DTB_FIT_DYN_ALLOC
  237. bool "Dynamically allocate the memory"
  238. depends on SYS_MALLOC_F
  239. config SPL_MULTI_DTB_FIT_USER_DEFINED_AREA
  240. bool "User-defined location"
  241. endchoice
  242. config SPL_MULTI_DTB_FIT_UNCOMPRESS_SZ
  243. hex "Size of memory reserved to uncompress the DTBs"
  244. depends on (SPL_MULTI_DTB_FIT_GZIP || SPL_MULTI_DTB_FIT_LZO)
  245. default 0x8000
  246. help
  247. This is the size of this area where the DTBs are uncompressed.
  248. If this area is dynamically allocated, make sure that
  249. SPL_SYS_MALLOC_F_LEN is big enough to contain it.
  250. config SPL_MULTI_DTB_FIT_USER_DEF_ADDR
  251. hex "Address of memory where dtbs are uncompressed"
  252. depends on SPL_MULTI_DTB_FIT_USER_DEFINED_AREA
  253. help
  254. the FIT image containing the DTBs is uncompressed in an area defined
  255. at compilation time. This is the address of this area. It must be
  256. aligned on 2-byte boundary.
  257. config OF_SPL_REMOVE_PROPS
  258. string "List of device tree properties to drop for SPL"
  259. depends on SPL_OF_CONTROL
  260. default "interrupt-parent interrupts" if SPL_PINCTRL && SPL_CLK
  261. default "clocks clock-names interrupt-parent interrupts" if SPL_PINCTRL
  262. default "pinctrl-0 pinctrl-names interrupt-parent interrupts" if SPL_CLK
  263. default "pinctrl-0 pinctrl-names clocks clock-names interrupt-parent interrupts"
  264. help
  265. Since SPL normally runs in a reduced memory space, the device tree
  266. is cut down to only what is needed to load and start U-Boot. Only
  267. nodes marked with the property "u-boot,dm-pre-reloc" will be
  268. included. In addition, some properties are not used by U-Boot and
  269. can be discarded. This option defines the list of properties to
  270. discard.
  271. config OF_DTB_PROPS_REMOVE
  272. bool "Enable removal of device tree properties"
  273. depends on OF_CONTROL
  274. help
  275. Some boards have restricted amount of storage for U-Boot image.
  276. If the generated binary doesn't fit into available image storage,
  277. the built-in device tree could probably be cut down by removing
  278. some not required device tree properties to reduce the image size.
  279. Enable this option and define the properties to be removed in the
  280. CONFIG_OF_REMOVE_PROPS list. Do not enable this option if you must
  281. pass the built-in DTB directly to the kernel!
  282. config OF_REMOVE_PROPS
  283. string "List of device tree properties to drop"
  284. depends on OF_DTB_PROPS_REMOVE
  285. default "interrupt-parent interrupts" if PINCTRL
  286. help
  287. Some properties are not used by U-Boot and can be discarded.
  288. This option defines the list of properties to discard.
  289. config SPL_OF_PLATDATA
  290. bool "Generate platform data for use in SPL"
  291. depends on SPL_OF_CONTROL
  292. select DTOC
  293. help
  294. For very constrained SPL environments the overhead of decoding
  295. device tree nodes and converting their contents into platform data
  296. is too large. This overhead includes libfdt code as well as the
  297. device tree contents itself. The latter is fairly compact, but the
  298. former can add 3KB or more to a Thumb 2 Image.
  299. This option enables generation of platform data from the device
  300. tree as C code. This code creates devices using U_BOOT_DEVICE()
  301. declarations. The benefit is that it allows driver code to access
  302. the platform data directly in C structures, avoidin the libfdt
  303. overhead.
  304. This option works by generating C structure declarations for each
  305. compatible string, then adding platform data and U_BOOT_DEVICE
  306. declarations for each node. See of-plat.txt for more information.
  307. config TPL_OF_PLATDATA
  308. bool "Generate platform data for use in TPL"
  309. depends on TPL_OF_CONTROL
  310. select DTOC
  311. help
  312. For very constrained SPL environments the overhead of decoding
  313. device tree nodes and converting their contents into platform data
  314. is too large. This overhead includes libfdt code as well as the
  315. device tree contents itself. The latter is fairly compact, but the
  316. former can add 3KB or more to a Thumb 2 Image.
  317. This option enables generation of platform data from the device
  318. tree as C code. This code creates devices using U_BOOT_DEVICE()
  319. declarations. The benefit is that it allows driver code to access
  320. the platform data directly in C structures, avoidin the libfdt
  321. overhead.
  322. This option works by generating C structure declarations for each
  323. compatible string, then adding platform data and U_BOOT_DEVICE
  324. declarations for each node. See of-plat.txt for more information.
  325. endmenu
  326. config MKIMAGE_DTC_PATH
  327. string "Path to dtc binary for use within mkimage"
  328. default "dtc"
  329. help
  330. The mkimage host tool will, in order to generate FIT images make
  331. calls to the dtc application in order to create the output. In
  332. some cases the system dtc may not support all required features
  333. and the path to a different version should be given here.