Kconfig 17 KB

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