Kconfig 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494
  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. config BINMAN_STANDALONE_FDT
  17. bool
  18. depends on BINMAN
  19. default y if OF_BOARD || OF_PRIOR_STAGE
  20. help
  21. This option tells U-Boot build system that a standalone device tree
  22. source is explicitly required when using binman to package U-Boot.
  23. This is not necessary in a common scenario where a device tree source
  24. that contains the binman node is provided in the arch/<arch>/dts
  25. directory for a specific board. Such device tree sources are built for
  26. OF_SEPARATE or OF_EMBED. However for a scenario like the board device
  27. tree blob is not provided in the U-Boot build tree, but fed to U-Boot
  28. in the runtime, e.g.: in the OF_PRIOR_STAGE case that it is passed by
  29. a prior stage bootloader. For such scenario, a standalone device tree
  30. blob containing binman node to describe how to package U-Boot should
  31. be provided explicitly.
  32. menu "Device Tree Control"
  33. depends on SUPPORT_OF_CONTROL
  34. config OF_CONTROL
  35. bool "Run-time configuration via Device Tree"
  36. select DTC
  37. select OF_LIBFDT if !OF_PLATDATA
  38. help
  39. This feature provides for run-time configuration of U-Boot
  40. via a flattened device tree.
  41. config OF_BOARD_FIXUP
  42. bool "Board-specific manipulation of Device Tree"
  43. help
  44. In certain circumstances it is necessary to be able to modify
  45. U-Boot's device tree (e.g. to delete device from it). This option
  46. make the Device Tree writeable and provides a board-specific
  47. "board_fix_fdt" callback (called during pre-relocation time), which
  48. enables the board initialization to modifiy the Device Tree. The
  49. modified copy is subsequently used by U-Boot after relocation.
  50. config SPL_OF_CONTROL
  51. bool "Enable run-time configuration via Device Tree in SPL"
  52. depends on SPL && OF_CONTROL
  53. select SPL_OF_LIBFDT if !SPL_OF_PLATDATA
  54. help
  55. Some boards use device tree in U-Boot but only have 4KB of SRAM
  56. which is not enough to support device tree. Disable this option to
  57. allow such boards to be supported by U-Boot SPL.
  58. config TPL_OF_CONTROL
  59. bool "Enable run-time configuration via Device Tree in TPL"
  60. depends on TPL && OF_CONTROL
  61. select TPL_OF_LIBFDT if !TPL_OF_PLATDATA
  62. help
  63. Some boards use device tree in U-Boot but only have 4KB of SRAM
  64. which is not enough to support device tree. Enable this option to
  65. allow such boards to be supported by U-Boot TPL.
  66. config OF_LIVE
  67. bool "Enable use of a live tree"
  68. depends on DM && OF_CONTROL
  69. help
  70. Normally U-Boot uses a flat device tree which saves space and
  71. avoids the need to unpack the tree before use. However a flat
  72. tree does not support modification from within U-Boot since it
  73. can invalidate driver-model device tree offsets. This option
  74. enables a live tree which is available after relocation,
  75. and can be adjusted as needed.
  76. choice
  77. prompt "Provider of DTB for DT control"
  78. depends on OF_CONTROL
  79. config OF_SEPARATE
  80. bool "Separate DTB for DT control"
  81. depends on !SANDBOX
  82. help
  83. If this option is enabled, the device tree will be built and
  84. placed as a separate u-boot.dtb file alongside the U-Boot image.
  85. config OF_EMBED
  86. bool "Embedded DTB for DT control"
  87. help
  88. If this option is enabled, the device tree will be picked up and
  89. built into the U-Boot image. This is suitable for local debugging
  90. and development only and is not recommended for production devices.
  91. Boards in the mainline U-Boot tree should not use it.
  92. config OF_BOARD
  93. bool "Provided by the board at runtime"
  94. depends on !SANDBOX
  95. help
  96. If this option is enabled, the device tree will be provided by
  97. the board at runtime if the board supports it, instead of being
  98. bundled with the image.
  99. config OF_HOSTFILE
  100. bool "Host filed DTB for DT control"
  101. depends on SANDBOX
  102. help
  103. If this option is enabled, DTB will be read from a file on startup.
  104. This is only useful for Sandbox. Use the -d flag to U-Boot to
  105. specify the file to read.
  106. config OF_PRIOR_STAGE
  107. bool "Prior stage bootloader DTB for DT control"
  108. help
  109. If this option is enabled, the device tree used for DT
  110. control will be read from a device tree binary, at a memory
  111. location passed to U-Boot by the prior stage bootloader.
  112. endchoice
  113. config DEFAULT_DEVICE_TREE
  114. string "Default Device Tree for DT control"
  115. depends on OF_CONTROL
  116. help
  117. This option specifies the default Device Tree used for DT control.
  118. It can be overridden from the command line:
  119. $ make DEVICE_TREE=<device-tree-name>
  120. config OF_LIST
  121. string "List of device tree files to include for DT control"
  122. depends on SPL_LOAD_FIT || MULTI_DTB_FIT
  123. default DEFAULT_DEVICE_TREE
  124. help
  125. This option specifies a list of device tree files to use for DT
  126. control. These will be packaged into a FIT. At run-time, U-boot
  127. or SPL will select the correct DT to use by examining the
  128. hardware (e.g. reading a board ID value). This is a list of
  129. device tree files (without the directory or .dtb suffix)
  130. separated by <space>.
  131. config OF_OVERLAY_LIST
  132. string "List of device tree overlays to include for DT control"
  133. depends on SPL_LOAD_FIT_APPLY_OVERLAY
  134. help
  135. This option specifies a list of device tree overlays to use for DT
  136. control. This option can then be used by a FIT generator to include
  137. the overlays in the FIT image.
  138. choice
  139. prompt "OF LIST compression"
  140. depends on MULTI_DTB_FIT
  141. default MULTI_DTB_FIT_NO_COMPRESSION
  142. config MULTI_DTB_FIT_LZO
  143. bool "LZO"
  144. depends on SYS_MALLOC_F
  145. select LZO
  146. help
  147. Compress the FIT image containing the DTBs available for the SPL
  148. using LZO compression. (requires lzop on host).
  149. config MULTI_DTB_FIT_GZIP
  150. bool "GZIP"
  151. depends on SYS_MALLOC_F
  152. select GZIP
  153. help
  154. Compress the FIT image containing the DTBs available for the SPL
  155. using GZIP compression. (requires gzip on host)
  156. config MULTI_DTB_FIT_NO_COMPRESSION
  157. bool "No compression"
  158. help
  159. Do not compress the FIT image containing the DTBs available for the SPL.
  160. Use this options only if LZO is not available and the DTBs are very small.
  161. endchoice
  162. choice
  163. prompt "Location of uncompressed DTBs"
  164. depends on (MULTI_DTB_FIT_GZIP || MULTI_DTB_FIT_LZO)
  165. default MULTI_DTB_FIT_DYN_ALLOC if SYS_MALLOC_F
  166. config MULTI_DTB_FIT_DYN_ALLOC
  167. bool "Dynamically allocate the memory"
  168. depends on SYS_MALLOC_F
  169. config MULTI_DTB_FIT_USER_DEFINED_AREA
  170. bool "User-defined location"
  171. endchoice
  172. config MULTI_DTB_FIT_UNCOMPRESS_SZ
  173. hex "Size of memory reserved to uncompress the DTBs"
  174. depends on (MULTI_DTB_FIT_GZIP || MULTI_DTB_FIT_LZO)
  175. default 0x8000
  176. help
  177. This is the size of this area where the DTBs are uncompressed.
  178. If this area is dynamically allocated, make sure that
  179. SYS_MALLOC_F_LEN is big enough to contain it.
  180. config MULTI_DTB_FIT_USER_DEF_ADDR
  181. hex "Address of memory where dtbs are uncompressed"
  182. depends on MULTI_DTB_FIT_USER_DEFINED_AREA
  183. help
  184. the FIT image containing the DTBs is uncompressed in an area defined
  185. at compilation time. This is the address of this area. It must be
  186. aligned on 2-byte boundary.
  187. config DTB_RESELECT
  188. bool "Support swapping dtbs at a later point in boot"
  189. depends on MULTI_DTB_FIT
  190. help
  191. It is possible during initial boot you may need to use a generic
  192. dtb until you can fully determine the board your running on. This
  193. config allows boards to implement a function at a later point
  194. during boot to switch to the "correct" dtb.
  195. config MULTI_DTB_FIT
  196. bool "Support embedding several DTBs in a FIT image for u-boot"
  197. help
  198. This option provides hooks to allow U-boot to parse an
  199. appended FIT image and enable board specific code to then select
  200. the correct DTB to be used. Use this if you need to support
  201. multiple DTBs but don't use the SPL.
  202. config SPL_MULTI_DTB_FIT
  203. depends on SPL_LOAD_FIT && SPL_OF_CONTROL && !SPL_OF_PLATDATA
  204. bool "Support embedding several DTBs in a FIT image for the SPL"
  205. help
  206. This option provides the SPL with the ability to select its own
  207. DTB at runtime from an appended FIT image containing several DTBs.
  208. This allows using the same SPL binary on multiple platforms.
  209. The primary purpose is to handle different versions of
  210. the same platform without tweaking the platform code if the
  211. differences can be expressed in the DTBs (common examples are: bus
  212. capabilities, pad configurations).
  213. config SPL_OF_LIST
  214. string "List of device tree files to include for DT control in SPL"
  215. depends on SPL_MULTI_DTB_FIT
  216. default OF_LIST
  217. help
  218. This option specifies a list of device tree files to use for DT
  219. control in the SPL. These will be packaged into a FIT. At run-time,
  220. the SPL will select the correct DT to use by examining the
  221. hardware (e.g. reading a board ID value). This is a list of
  222. device tree files (without the directory or .dtb suffix)
  223. separated by <space>.
  224. choice
  225. prompt "SPL OF LIST compression"
  226. depends on SPL_MULTI_DTB_FIT
  227. default SPL_MULTI_DTB_FIT_LZO
  228. config SPL_MULTI_DTB_FIT_LZO
  229. bool "LZO"
  230. depends on SYS_MALLOC_F
  231. select SPL_LZO
  232. help
  233. Compress the FIT image containing the DTBs available for the SPL
  234. using LZO compression. (requires lzop on host).
  235. config SPL_MULTI_DTB_FIT_GZIP
  236. bool "GZIP"
  237. depends on SYS_MALLOC_F
  238. select SPL_GZIP
  239. help
  240. Compress the FIT image containing the DTBs available for the SPL
  241. using GZIP compression. (requires gzip on host)
  242. config SPL_MULTI_DTB_FIT_NO_COMPRESSION
  243. bool "No compression"
  244. help
  245. Do not compress the FIT image containing the DTBs available for the SPL.
  246. Use this options only if LZO is not available and the DTBs are very small.
  247. endchoice
  248. choice
  249. prompt "Location of uncompressed DTBs"
  250. depends on (SPL_MULTI_DTB_FIT_GZIP || SPL_MULTI_DTB_FIT_LZO)
  251. default SPL_MULTI_DTB_FIT_DYN_ALLOC if SYS_MALLOC_F
  252. config SPL_MULTI_DTB_FIT_DYN_ALLOC
  253. bool "Dynamically allocate the memory"
  254. depends on SYS_MALLOC_F
  255. config SPL_MULTI_DTB_FIT_USER_DEFINED_AREA
  256. bool "User-defined location"
  257. endchoice
  258. config SPL_MULTI_DTB_FIT_UNCOMPRESS_SZ
  259. hex "Size of memory reserved to uncompress the DTBs"
  260. depends on (SPL_MULTI_DTB_FIT_GZIP || SPL_MULTI_DTB_FIT_LZO)
  261. default 0x8000
  262. help
  263. This is the size of this area where the DTBs are uncompressed.
  264. If this area is dynamically allocated, make sure that
  265. SPL_SYS_MALLOC_F_LEN is big enough to contain it.
  266. config SPL_MULTI_DTB_FIT_USER_DEF_ADDR
  267. hex "Address of memory where dtbs are uncompressed"
  268. depends on SPL_MULTI_DTB_FIT_USER_DEFINED_AREA
  269. help
  270. the FIT image containing the DTBs is uncompressed in an area defined
  271. at compilation time. This is the address of this area. It must be
  272. aligned on 2-byte boundary.
  273. config OF_SPL_REMOVE_PROPS
  274. string "List of device tree properties to drop for SPL"
  275. depends on SPL_OF_CONTROL
  276. default "interrupt-parent interrupts" if SPL_PINCTRL && SPL_CLK
  277. default "clocks clock-names interrupt-parent interrupts" if SPL_PINCTRL
  278. default "pinctrl-0 pinctrl-names interrupt-parent interrupts" if SPL_CLK
  279. default "pinctrl-0 pinctrl-names clocks clock-names interrupt-parent interrupts"
  280. help
  281. Since SPL normally runs in a reduced memory space, the device tree
  282. is cut down to only what is needed to load and start U-Boot. Only
  283. nodes marked with the property "u-boot,dm-pre-reloc" will be
  284. included. In addition, some properties are not used by U-Boot and
  285. can be discarded. This option defines the list of properties to
  286. discard.
  287. config OF_DTB_PROPS_REMOVE
  288. bool "Enable removal of device tree properties"
  289. depends on OF_CONTROL
  290. help
  291. Some boards have restricted amount of storage for U-Boot image.
  292. If the generated binary doesn't fit into available image storage,
  293. the built-in device tree could probably be cut down by removing
  294. some not required device tree properties to reduce the image size.
  295. Enable this option and define the properties to be removed in the
  296. CONFIG_OF_REMOVE_PROPS list. Do not enable this option if you must
  297. pass the built-in DTB directly to the kernel!
  298. config OF_REMOVE_PROPS
  299. string "List of device tree properties to drop"
  300. depends on OF_DTB_PROPS_REMOVE
  301. default "interrupt-parent interrupts" if PINCTRL
  302. help
  303. Some properties are not used by U-Boot and can be discarded.
  304. This option defines the list of properties to discard.
  305. config SPL_OF_PLATDATA
  306. bool "Generate platform data for use in SPL"
  307. depends on SPL_OF_CONTROL
  308. select DTOC
  309. select SPL_OF_PLATDATA_DRIVER_RT if !SPL_OF_PLATDATA_INST
  310. help
  311. For very constrained SPL environments the overhead of decoding
  312. device tree nodes and converting their contents into platform data
  313. is too large. This overhead includes libfdt code as well as the
  314. device tree contents itself. The latter is fairly compact, but the
  315. former can add 3KB or more to a Thumb 2 Image.
  316. This option enables generation of platform data from the device
  317. tree as C code. This code creates devices using U_BOOT_DRVINFO()
  318. declarations. The benefit is that it allows driver code to access
  319. the platform data directly in C structures, avoidin the libfdt
  320. overhead.
  321. This option works by generating C structure declarations for each
  322. compatible string, then adding platform data and U_BOOT_DRVINFO
  323. declarations for each node. See of-plat.txt for more information.
  324. if SPL_OF_PLATDATA
  325. config SPL_OF_PLATDATA_PARENT
  326. bool "Support parent information in devices"
  327. default y
  328. help
  329. Generally it is useful to be able to access the parent of a device
  330. with of-platdata. To save space this can be disabled, but in that
  331. case dev_get_parent() will always return NULL;
  332. config SPL_OF_PLATDATA_INST
  333. bool "Declare devices at build time"
  334. help
  335. Declare devices as udevice instances so that they do not need to be
  336. bound when U-Boot starts. This can save time and code space.
  337. config SPL_OF_PLATDATA_NO_BIND
  338. bool "Don't allow run-time binding of devices"
  339. depends on SPL_OF_PLATDATA_INST
  340. default y
  341. help
  342. This removes the ability to bind devices at run time, thus saving
  343. some code space in U-Boot. This can be disabled if binding is needed,
  344. at the code of some code size increase.
  345. config SPL_OF_PLATDATA_RT
  346. bool "Use a separate struct for device runtime data"
  347. depends on SPL_OF_PLATDATA_INST
  348. default y
  349. help
  350. For systems running SPL from read-only memory it is convenient to
  351. separate out the runtime information, so that the devices don't need
  352. to be copied before being used. This moves the read-write parts of
  353. struct udevice (at present just the flags) into a separate struct,
  354. which is allocated at runtime.
  355. config SPL_OF_PLATDATA_DRIVER_RT
  356. bool
  357. help
  358. Use a separate struct for driver runtime data.
  359. This enables the driver_rt information, used with of-platdata when
  360. of-platdata-inst is not used. It allows finding devices by their
  361. driver data.
  362. endif
  363. config TPL_OF_PLATDATA
  364. bool "Generate platform data for use in TPL"
  365. depends on TPL_OF_CONTROL
  366. select DTOC
  367. select TPL_OF_PLATDATA_DRIVER_RT if !TPL_OF_PLATDATA_INST
  368. help
  369. For very constrained SPL environments the overhead of decoding
  370. device tree nodes and converting their contents into platform data
  371. is too large. This overhead includes libfdt code as well as the
  372. device tree contents itself. The latter is fairly compact, but the
  373. former can add 3KB or more to a Thumb 2 Image.
  374. This option enables generation of platform data from the device
  375. tree as C code. This code creates devices using U_BOOT_DRVINFO()
  376. declarations. The benefit is that it allows driver code to access
  377. the platform data directly in C structures, avoidin the libfdt
  378. overhead.
  379. This option works by generating C structure declarations for each
  380. compatible string, then adding platform data and U_BOOT_DRVINFO
  381. declarations for each node. See of-plat.txt for more information.
  382. if TPL_OF_PLATDATA
  383. config TPL_OF_PLATDATA_PARENT
  384. bool "Support parent information in devices"
  385. default y
  386. help
  387. Generally it is useful to be able to access the parent of a device
  388. with of-platdata. To save space this can be disabled, but in that
  389. case dev_get_parent() will always return NULL;
  390. config TPL_OF_PLATDATA_INST
  391. bool "Declare devices at build time"
  392. help
  393. Declare devices as udevice instances so that they do not need to be
  394. bound when U-Boot starts. This can save time and code space.
  395. config TPL_OF_PLATDATA_NO_BIND
  396. bool "Don't allow run-time binding of devices"
  397. depends on TPL_OF_PLATDATA_INST
  398. default y
  399. help
  400. This removes the ability to bind devices at run time, thus saving
  401. some code space in U-Boot. This can be disabled if binding is needed,
  402. at the code of some code size increase.
  403. config TPL_OF_PLATDATA_RT
  404. bool "Use a separate struct for device runtime data"
  405. depends on TPL_OF_PLATDATA_INST
  406. default y
  407. help
  408. For systems running TPL from read-only memory it is convenient to
  409. separate out the runtime information, so that the devices don't need
  410. to be copied before being used. This moves the read-write parts of
  411. struct udevice (at present just the flags) into a separate struct,
  412. which is allocated at runtime.
  413. config TPL_OF_PLATDATA_DRIVER_RT
  414. bool
  415. help
  416. Use a separate struct for driver runtime data.
  417. This enables the driver_rt information, used with of-platdata when
  418. of-platdata-inst is not used. It allows finding devices by their
  419. driver data.
  420. endif
  421. endmenu