Kconfig 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394
  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. if ARCH_SUNXI
  209. config BOOT_PROCESS_MULTI_DTB
  210. bool "Adjust default board DT as necessary at boot"
  211. default n
  212. endif
  213. choice
  214. prompt "SPL OF LIST compression"
  215. depends on SPL_MULTI_DTB_FIT
  216. default SPL_MULTI_DTB_FIT_LZO
  217. config SPL_MULTI_DTB_FIT_LZO
  218. bool "LZO"
  219. depends on SYS_MALLOC_F
  220. select SPL_LZO
  221. help
  222. Compress the FIT image containing the DTBs available for the SPL
  223. using LZO compression. (requires lzop on host).
  224. config SPL_MULTI_DTB_FIT_GZIP
  225. bool "GZIP"
  226. depends on SYS_MALLOC_F
  227. select SPL_GZIP
  228. help
  229. Compress the FIT image containing the DTBs available for the SPL
  230. using GZIP compression. (requires gzip on host)
  231. config SPL_MULTI_DTB_FIT_NO_COMPRESSION
  232. bool "No compression"
  233. help
  234. Do not compress the FIT image containing the DTBs available for the SPL.
  235. Use this options only if LZO is not available and the DTBs are very small.
  236. endchoice
  237. choice
  238. prompt "Location of uncompressed DTBs"
  239. depends on (SPL_MULTI_DTB_FIT_GZIP || SPL_MULTI_DTB_FIT_LZO)
  240. default SPL_MULTI_DTB_FIT_DYN_ALLOC if SYS_MALLOC_F
  241. config SPL_MULTI_DTB_FIT_DYN_ALLOC
  242. bool "Dynamically allocate the memory"
  243. depends on SYS_MALLOC_F
  244. config SPL_MULTI_DTB_FIT_USER_DEFINED_AREA
  245. bool "User-defined location"
  246. endchoice
  247. config SPL_MULTI_DTB_FIT_UNCOMPRESS_SZ
  248. hex "Size of memory reserved to uncompress the DTBs"
  249. depends on (SPL_MULTI_DTB_FIT_GZIP || SPL_MULTI_DTB_FIT_LZO)
  250. default 0x8000
  251. help
  252. This is the size of this area where the DTBs are uncompressed.
  253. If this area is dynamically allocated, make sure that
  254. SPL_SYS_MALLOC_F_LEN is big enough to contain it.
  255. config SPL_MULTI_DTB_FIT_USER_DEF_ADDR
  256. hex "Address of memory where dtbs are uncompressed"
  257. depends on SPL_MULTI_DTB_FIT_USER_DEFINED_AREA
  258. help
  259. the FIT image containing the DTBs is uncompressed in an area defined
  260. at compilation time. This is the address of this area. It must be
  261. aligned on 2-byte boundary.
  262. config OF_SPL_REMOVE_PROPS
  263. string "List of device tree properties to drop for SPL"
  264. depends on SPL_OF_CONTROL
  265. default "interrupt-parent interrupts" if SPL_PINCTRL && SPL_CLK
  266. default "clocks clock-names interrupt-parent interrupts" if SPL_PINCTRL
  267. default "pinctrl-0 pinctrl-names interrupt-parent interrupts" if SPL_CLK
  268. default "pinctrl-0 pinctrl-names clocks clock-names interrupt-parent interrupts"
  269. help
  270. Since SPL normally runs in a reduced memory space, the device tree
  271. is cut down to only what is needed to load and start U-Boot. Only
  272. nodes marked with the property "u-boot,dm-pre-reloc" will be
  273. included. In addition, some properties are not used by U-Boot and
  274. can be discarded. This option defines the list of properties to
  275. discard.
  276. config OF_DTB_PROPS_REMOVE
  277. bool "Enable removal of device tree properties"
  278. depends on OF_CONTROL
  279. help
  280. Some boards have restricted amount of storage for U-Boot image.
  281. If the generated binary doesn't fit into available image storage,
  282. the built-in device tree could probably be cut down by removing
  283. some not required device tree properties to reduce the image size.
  284. Enable this option and define the properties to be removed in the
  285. CONFIG_OF_REMOVE_PROPS list. Do not enable this option if you must
  286. pass the built-in DTB directly to the kernel!
  287. config OF_REMOVE_PROPS
  288. string "List of device tree properties to drop"
  289. depends on OF_DTB_PROPS_REMOVE
  290. default "interrupt-parent interrupts" if PINCTRL
  291. help
  292. Some properties are not used by U-Boot and can be discarded.
  293. This option defines the list of properties to discard.
  294. config SPL_OF_PLATDATA
  295. bool "Generate platform data for use in SPL"
  296. depends on SPL_OF_CONTROL
  297. select DTOC
  298. help
  299. For very constrained SPL environments the overhead of decoding
  300. device tree nodes and converting their contents into platform data
  301. is too large. This overhead includes libfdt code as well as the
  302. device tree contents itself. The latter is fairly compact, but the
  303. former can add 3KB or more to a Thumb 2 Image.
  304. This option enables generation of platform data from the device
  305. tree as C code. This code creates devices using U_BOOT_DEVICE()
  306. declarations. The benefit is that it allows driver code to access
  307. the platform data directly in C structures, avoidin the libfdt
  308. overhead.
  309. This option works by generating C structure declarations for each
  310. compatible string, then adding platform data and U_BOOT_DEVICE
  311. declarations for each node. See of-plat.txt for more information.
  312. config TPL_OF_PLATDATA
  313. bool "Generate platform data for use in TPL"
  314. depends on TPL_OF_CONTROL
  315. select DTOC
  316. help
  317. For very constrained SPL environments the overhead of decoding
  318. device tree nodes and converting their contents into platform data
  319. is too large. This overhead includes libfdt code as well as the
  320. device tree contents itself. The latter is fairly compact, but the
  321. former can add 3KB or more to a Thumb 2 Image.
  322. This option enables generation of platform data from the device
  323. tree as C code. This code creates devices using U_BOOT_DEVICE()
  324. declarations. The benefit is that it allows driver code to access
  325. the platform data directly in C structures, avoidin the libfdt
  326. overhead.
  327. This option works by generating C structure declarations for each
  328. compatible string, then adding platform data and U_BOOT_DEVICE
  329. declarations for each node. See of-plat.txt for more information.
  330. endmenu
  331. config MKIMAGE_DTC_PATH
  332. string "Path to dtc binary for use within mkimage"
  333. default "dtc"
  334. help
  335. The mkimage host tool will, in order to generate FIT images make
  336. calls to the dtc application in order to create the output. In
  337. some cases the system dtc may not support all required features
  338. and the path to a different version should be given here.