Kconfig 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510
  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. config OF_SEPARATE
  87. bool "Separate DTB for DT control"
  88. depends on !SANDBOX
  89. help
  90. If this option is enabled, the device tree will be built and
  91. placed as a separate u-boot.dtb file alongside the U-Boot image.
  92. config OF_EMBED
  93. bool "Embedded DTB for DT control"
  94. help
  95. If this option is enabled, the device tree will be picked up and
  96. built into the U-Boot image. This is suitable for local debugging
  97. and development only and is not recommended for production devices.
  98. Boards in the mainline U-Boot tree should not use it.
  99. config OF_BOARD
  100. bool "Provided by the board (e.g a previous loader) at runtime"
  101. depends on !SANDBOX
  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. config OF_HOSTFILE
  107. bool "Host filed DTB for DT control"
  108. depends on SANDBOX
  109. help
  110. If this option is enabled, DTB will be read from a file on startup.
  111. This is only useful for Sandbox. Use the -d flag to U-Boot to
  112. specify the file to read.
  113. endchoice
  114. config DEFAULT_DEVICE_TREE
  115. string "Default Device Tree for DT control"
  116. depends on OF_CONTROL
  117. help
  118. This option specifies the default Device Tree used for DT control.
  119. It can be overridden from the command line:
  120. $ make DEVICE_TREE=<device-tree-name>
  121. config OF_LIST
  122. string "List of device tree files to include for DT control"
  123. depends on SPL_LOAD_FIT || MULTI_DTB_FIT
  124. default DEFAULT_DEVICE_TREE
  125. help
  126. This option specifies a list of device tree files to use for DT
  127. control. These will be packaged into a FIT. At run-time, U-boot
  128. or SPL will select the correct DT to use by examining the
  129. hardware (e.g. reading a board ID value). This is a list of
  130. device tree files (without the directory or .dtb suffix)
  131. separated by <space>.
  132. config OF_OVERLAY_LIST
  133. string "List of device tree overlays to include for DT control"
  134. depends on SPL_LOAD_FIT_APPLY_OVERLAY
  135. help
  136. This option specifies a list of device tree overlays to use for DT
  137. control. This option can then be used by a FIT generator to include
  138. the overlays in the FIT image.
  139. choice
  140. prompt "OF LIST compression"
  141. depends on MULTI_DTB_FIT
  142. default MULTI_DTB_FIT_NO_COMPRESSION
  143. config MULTI_DTB_FIT_LZO
  144. bool "LZO"
  145. depends on SYS_MALLOC_F
  146. select LZO
  147. help
  148. Compress the FIT image containing the DTBs available for the SPL
  149. using LZO compression. (requires lzop on host).
  150. config MULTI_DTB_FIT_GZIP
  151. bool "GZIP"
  152. depends on SYS_MALLOC_F
  153. select GZIP
  154. help
  155. Compress the FIT image containing the DTBs available for the SPL
  156. using GZIP compression. (requires gzip on host)
  157. config MULTI_DTB_FIT_NO_COMPRESSION
  158. bool "No compression"
  159. help
  160. Do not compress the FIT image containing the DTBs available for the SPL.
  161. Use this options only if LZO is not available and the DTBs are very small.
  162. endchoice
  163. choice
  164. prompt "Location of uncompressed DTBs"
  165. depends on (MULTI_DTB_FIT_GZIP || MULTI_DTB_FIT_LZO)
  166. default MULTI_DTB_FIT_DYN_ALLOC if SYS_MALLOC_F
  167. config MULTI_DTB_FIT_DYN_ALLOC
  168. bool "Dynamically allocate the memory"
  169. depends on SYS_MALLOC_F
  170. config MULTI_DTB_FIT_USER_DEFINED_AREA
  171. bool "User-defined location"
  172. endchoice
  173. config MULTI_DTB_FIT_UNCOMPRESS_SZ
  174. hex "Size of memory reserved to uncompress the DTBs"
  175. depends on (MULTI_DTB_FIT_GZIP || MULTI_DTB_FIT_LZO)
  176. default 0x8000
  177. help
  178. This is the size of this area where the DTBs are uncompressed.
  179. If this area is dynamically allocated, make sure that
  180. SYS_MALLOC_F_LEN is big enough to contain it.
  181. config MULTI_DTB_FIT_USER_DEF_ADDR
  182. hex "Address of memory where dtbs are uncompressed"
  183. depends on MULTI_DTB_FIT_USER_DEFINED_AREA
  184. help
  185. the FIT image containing the DTBs is uncompressed in an area defined
  186. at compilation time. This is the address of this area. It must be
  187. aligned on 2-byte boundary.
  188. config DTB_RESELECT
  189. bool "Support swapping dtbs at a later point in boot"
  190. depends on MULTI_DTB_FIT
  191. help
  192. It is possible during initial boot you may need to use a generic
  193. dtb until you can fully determine the board your running on. This
  194. config allows boards to implement a function at a later point
  195. during boot to switch to the "correct" dtb.
  196. config MULTI_DTB_FIT
  197. bool "Support embedding several DTBs in a FIT image for u-boot"
  198. help
  199. This option provides hooks to allow U-boot to parse an
  200. appended FIT image and enable board specific code to then select
  201. the correct DTB to be used. Use this if you need to support
  202. multiple DTBs but don't use the SPL.
  203. config SPL_MULTI_DTB_FIT
  204. depends on SPL_LOAD_FIT && SPL_OF_REAL
  205. bool "Support embedding several DTBs in a FIT image for the SPL"
  206. help
  207. This option provides the SPL with the ability to select its own
  208. DTB at runtime from an appended FIT image containing several DTBs.
  209. This allows using the same SPL binary on multiple platforms.
  210. The primary purpose is to handle different versions of
  211. the same platform without tweaking the platform code if the
  212. differences can be expressed in the DTBs (common examples are: bus
  213. capabilities, pad configurations).
  214. config SPL_OF_LIST
  215. string "List of device tree files to include for DT control in SPL"
  216. depends on SPL_MULTI_DTB_FIT
  217. default OF_LIST
  218. help
  219. This option specifies a list of device tree files to use for DT
  220. control in the SPL. These will be packaged into a FIT. At run-time,
  221. the SPL will select the correct DT to use by examining the
  222. hardware (e.g. reading a board ID value). This is a list of
  223. device tree files (without the directory or .dtb suffix)
  224. separated by <space>.
  225. choice
  226. prompt "SPL OF LIST compression"
  227. depends on SPL_MULTI_DTB_FIT
  228. default SPL_MULTI_DTB_FIT_LZO
  229. config SPL_MULTI_DTB_FIT_LZO
  230. bool "LZO"
  231. depends on SYS_MALLOC_F
  232. select SPL_LZO
  233. help
  234. Compress the FIT image containing the DTBs available for the SPL
  235. using LZO compression. (requires lzop on host).
  236. config SPL_MULTI_DTB_FIT_GZIP
  237. bool "GZIP"
  238. depends on SYS_MALLOC_F
  239. select SPL_GZIP
  240. help
  241. Compress the FIT image containing the DTBs available for the SPL
  242. using GZIP compression. (requires gzip on host)
  243. config SPL_MULTI_DTB_FIT_NO_COMPRESSION
  244. bool "No compression"
  245. help
  246. Do not compress the FIT image containing the DTBs available for the SPL.
  247. Use this options only if LZO is not available and the DTBs are very small.
  248. endchoice
  249. choice
  250. prompt "Location of uncompressed DTBs"
  251. depends on (SPL_MULTI_DTB_FIT_GZIP || SPL_MULTI_DTB_FIT_LZO)
  252. default SPL_MULTI_DTB_FIT_DYN_ALLOC if SYS_MALLOC_F
  253. config SPL_MULTI_DTB_FIT_DYN_ALLOC
  254. bool "Dynamically allocate the memory"
  255. depends on SYS_MALLOC_F
  256. config SPL_MULTI_DTB_FIT_USER_DEFINED_AREA
  257. bool "User-defined location"
  258. endchoice
  259. config SPL_MULTI_DTB_FIT_UNCOMPRESS_SZ
  260. hex "Size of memory reserved to uncompress the DTBs"
  261. depends on (SPL_MULTI_DTB_FIT_GZIP || SPL_MULTI_DTB_FIT_LZO)
  262. default 0x8000
  263. help
  264. This is the size of this area where the DTBs are uncompressed.
  265. If this area is dynamically allocated, make sure that
  266. SPL_SYS_MALLOC_F_LEN is big enough to contain it.
  267. config SPL_MULTI_DTB_FIT_USER_DEF_ADDR
  268. hex "Address of memory where dtbs are uncompressed"
  269. depends on SPL_MULTI_DTB_FIT_USER_DEFINED_AREA
  270. help
  271. the FIT image containing the DTBs is uncompressed in an area defined
  272. at compilation time. This is the address of this area. It must be
  273. aligned on 2-byte boundary.
  274. config OF_SPL_REMOVE_PROPS
  275. string "List of device tree properties to drop for SPL"
  276. depends on SPL_OF_CONTROL
  277. default "interrupt-parent interrupts" if SPL_PINCTRL && SPL_CLK
  278. default "clocks clock-names interrupt-parent interrupts" if SPL_PINCTRL
  279. default "pinctrl-0 pinctrl-names interrupt-parent interrupts" if SPL_CLK
  280. default "pinctrl-0 pinctrl-names clocks clock-names interrupt-parent interrupts"
  281. help
  282. Since SPL normally runs in a reduced memory space, the device tree
  283. is cut down to only what is needed to load and start U-Boot. Only
  284. nodes marked with the property "u-boot,dm-pre-reloc" will be
  285. included. In addition, some properties are not used by U-Boot and
  286. can be discarded. This option defines the list of properties to
  287. discard.
  288. config OF_DTB_PROPS_REMOVE
  289. bool "Enable removal of device tree properties"
  290. depends on OF_CONTROL
  291. help
  292. Some boards have restricted amount of storage for U-Boot image.
  293. If the generated binary doesn't fit into available image storage,
  294. the built-in device tree could probably be cut down by removing
  295. some not required device tree properties to reduce the image size.
  296. Enable this option and define the properties to be removed in the
  297. CONFIG_OF_REMOVE_PROPS list. Do not enable this option if you must
  298. pass the built-in DTB directly to the kernel!
  299. config OF_REMOVE_PROPS
  300. string "List of device tree properties to drop"
  301. depends on OF_DTB_PROPS_REMOVE
  302. default "interrupt-parent interrupts" if PINCTRL
  303. help
  304. Some properties are not used by U-Boot and can be discarded.
  305. This option defines the list of properties to discard.
  306. config SPL_OF_PLATDATA
  307. bool "Generate platform data for use in SPL"
  308. depends on SPL_OF_CONTROL
  309. select DTOC
  310. select SPL_OF_PLATDATA_DRIVER_RT if !SPL_OF_PLATDATA_INST
  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_DRVINFO()
  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_DRVINFO
  324. declarations for each node. See of-plat.txt for more information.
  325. config SPL_OF_REAL
  326. bool
  327. help
  328. Indicates that a real devicetree is available which can be accessed
  329. at runtime. This means that dev_read_...() functions can be used to
  330. read data from the devicetree for each device. This is true if
  331. SPL_OF_CONTROL is enabled and not SPL_OF_PLATDATA
  332. if SPL_OF_PLATDATA
  333. config SPL_OF_PLATDATA_PARENT
  334. bool "Support parent information in devices"
  335. default y
  336. help
  337. Generally it is useful to be able to access the parent of a device
  338. with of-platdata. To save space this can be disabled, but in that
  339. case dev_get_parent() will always return NULL;
  340. config SPL_OF_PLATDATA_INST
  341. bool "Declare devices at build time"
  342. help
  343. Declare devices as udevice instances so that they do not need to be
  344. bound when U-Boot starts. This can save time and code space.
  345. config SPL_OF_PLATDATA_NO_BIND
  346. bool "Don't allow run-time binding of devices"
  347. depends on SPL_OF_PLATDATA_INST
  348. default y
  349. help
  350. This removes the ability to bind devices at run time, thus saving
  351. some code space in U-Boot. This can be disabled if binding is needed,
  352. at the code of some code size increase.
  353. config SPL_OF_PLATDATA_RT
  354. bool "Use a separate struct for device runtime data"
  355. depends on SPL_OF_PLATDATA_INST
  356. default y
  357. help
  358. For systems running SPL from read-only memory it is convenient to
  359. separate out the runtime information, so that the devices don't need
  360. to be copied before being used. This moves the read-write parts of
  361. struct udevice (at present just the flags) into a separate struct,
  362. which is allocated at runtime.
  363. config SPL_OF_PLATDATA_DRIVER_RT
  364. bool
  365. help
  366. Use a separate struct for driver runtime data.
  367. This enables the driver_rt information, used with of-platdata when
  368. of-platdata-inst is not used. It allows finding devices by their
  369. driver data.
  370. endif
  371. config TPL_OF_REAL
  372. bool
  373. help
  374. Indicates that a real devicetree is available which can be accessed
  375. at runtime. This means that dev_read_...() functions can be used to
  376. read data from the devicetree for each device. This is true if
  377. TPL_OF_CONTROL is enabled and not TPL_OF_PLATDATA
  378. config TPL_OF_PLATDATA
  379. bool "Generate platform data for use in TPL"
  380. depends on TPL_OF_CONTROL
  381. select DTOC
  382. select TPL_OF_PLATDATA_DRIVER_RT if !TPL_OF_PLATDATA_INST
  383. help
  384. For very constrained SPL environments the overhead of decoding
  385. device tree nodes and converting their contents into platform data
  386. is too large. This overhead includes libfdt code as well as the
  387. device tree contents itself. The latter is fairly compact, but the
  388. former can add 3KB or more to a Thumb 2 Image.
  389. This option enables generation of platform data from the device
  390. tree as C code. This code creates devices using U_BOOT_DRVINFO()
  391. declarations. The benefit is that it allows driver code to access
  392. the platform data directly in C structures, avoidin the libfdt
  393. overhead.
  394. This option works by generating C structure declarations for each
  395. compatible string, then adding platform data and U_BOOT_DRVINFO
  396. declarations for each node. See of-plat.txt for more information.
  397. if TPL_OF_PLATDATA
  398. config TPL_OF_PLATDATA_PARENT
  399. bool "Support parent information in devices"
  400. default y
  401. help
  402. Generally it is useful to be able to access the parent of a device
  403. with of-platdata. To save space this can be disabled, but in that
  404. case dev_get_parent() will always return NULL;
  405. config TPL_OF_PLATDATA_INST
  406. bool "Declare devices at build time"
  407. help
  408. Declare devices as udevice instances so that they do not need to be
  409. bound when U-Boot starts. This can save time and code space.
  410. config TPL_OF_PLATDATA_NO_BIND
  411. bool "Don't allow run-time binding of devices"
  412. depends on TPL_OF_PLATDATA_INST
  413. default y
  414. help
  415. This removes the ability to bind devices at run time, thus saving
  416. some code space in U-Boot. This can be disabled if binding is needed,
  417. at the code of some code size increase.
  418. config TPL_OF_PLATDATA_RT
  419. bool "Use a separate struct for device runtime data"
  420. depends on TPL_OF_PLATDATA_INST
  421. default y
  422. help
  423. For systems running TPL from read-only memory it is convenient to
  424. separate out the runtime information, so that the devices don't need
  425. to be copied before being used. This moves the read-write parts of
  426. struct udevice (at present just the flags) into a separate struct,
  427. which is allocated at runtime.
  428. config TPL_OF_PLATDATA_DRIVER_RT
  429. bool
  430. help
  431. Use a separate struct for driver runtime data.
  432. This enables the driver_rt information, used with of-platdata when
  433. of-platdata-inst is not used. It allows finding devices by their
  434. driver data.
  435. endif
  436. endmenu