Kconfig 12 KB

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