Masahiro Yamada | 783e6a7 | 2014-09-22 19:59:05 +0900 | [diff] [blame] | 1 | # |
| 2 | # Device Tree Control |
| 3 | # |
Masahiro Yamada | 783e6a7 | 2014-09-22 19:59:05 +0900 | [diff] [blame] | 4 | |
| 5 | config SUPPORT_OF_CONTROL |
| 6 | bool |
| 7 | |
| 8 | menu "Device Tree Control" |
Masahiro Yamada | 783e6a7 | 2014-09-22 19:59:05 +0900 | [diff] [blame] | 9 | depends on SUPPORT_OF_CONTROL |
| 10 | |
| 11 | config OF_CONTROL |
| 12 | bool "Run-time configuration via Device Tree" |
| 13 | help |
| 14 | This feature provides for run-time configuration of U-Boot |
| 15 | via a flattened device tree. |
| 16 | |
mario.six@gdsys.cc | 2a79275 | 2017-02-22 16:07:22 +0100 | [diff] [blame] | 17 | config OF_BOARD_FIXUP |
| 18 | bool "Board-specific manipulation of Device Tree" |
| 19 | help |
| 20 | In certain circumstances it is necessary to be able to modify |
| 21 | U-Boot's device tree (e.g. to delete device from it). This option |
| 22 | make the Device Tree writeable and provides a board-specific |
| 23 | "board_fix_fdt" callback (called during pre-relocation time), which |
| 24 | enables the board initialization to modifiy the Device Tree. The |
| 25 | modified copy is subsequently used by U-Boot after relocation. |
| 26 | |
Masahiro Yamada | dffb86e | 2015-08-12 07:31:54 +0900 | [diff] [blame] | 27 | config SPL_OF_CONTROL |
| 28 | bool "Enable run-time configuration via Device Tree in SPL" |
| 29 | depends on SPL && OF_CONTROL |
Simon Glass | 2860f03 | 2015-02-27 22:06:38 -0700 | [diff] [blame] | 30 | help |
| 31 | Some boards use device tree in U-Boot but only have 4KB of SRAM |
| 32 | which is not enough to support device tree. Enable this option to |
| 33 | allow such boards to be supported by U-Boot SPL. |
| 34 | |
Simon Glass | 5e060d8 | 2017-05-18 20:08:53 -0600 | [diff] [blame] | 35 | config OF_LIVE |
| 36 | bool "Enable use of a live tree" |
| 37 | depends on OF_CONTROL |
| 38 | help |
| 39 | Normally U-Boot uses a flat device tree which saves space and |
| 40 | avoids the need to unpack the tree before use. However a flat |
| 41 | tree does not support modifcation from within U-Boot since it |
| 42 | can invalidate driver-model device tree offsets. This option |
| 43 | enables a live tree which is available after relocation, |
| 44 | and can be adjusted as needed. |
| 45 | |
Masahiro Yamada | 783e6a7 | 2014-09-22 19:59:05 +0900 | [diff] [blame] | 46 | choice |
| 47 | prompt "Provider of DTB for DT control" |
| 48 | depends on OF_CONTROL |
| 49 | |
| 50 | config OF_SEPARATE |
| 51 | bool "Separate DTB for DT control" |
| 52 | depends on !SANDBOX |
| 53 | help |
| 54 | If this option is enabled, the device tree will be built and |
| 55 | placed as a separate u-boot.dtb file alongside the U-Boot image. |
| 56 | |
| 57 | config OF_EMBED |
| 58 | bool "Embedded DTB for DT control" |
| 59 | help |
| 60 | If this option is enabled, the device tree will be picked up and |
Simon Glass | 3d3f60c | 2015-08-31 18:47:52 -0600 | [diff] [blame] | 61 | built into the U-Boot image. This is suitable for local debugging |
| 62 | and development only and is not recommended for production devices. |
| 63 | Boards in the mainline U-Boot tree should not use it. |
Masahiro Yamada | 783e6a7 | 2014-09-22 19:59:05 +0900 | [diff] [blame] | 64 | |
Alex Deymo | 82f766d | 2017-04-02 01:25:20 -0700 | [diff] [blame] | 65 | config OF_BOARD |
| 66 | bool "Provided by the board at runtime" |
| 67 | depends on !SANDBOX |
| 68 | help |
| 69 | If this option is enabled, the device tree will be provided by |
| 70 | the board at runtime if the board supports it, instead of being |
| 71 | bundled with the image. |
| 72 | |
Masahiro Yamada | 783e6a7 | 2014-09-22 19:59:05 +0900 | [diff] [blame] | 73 | config OF_HOSTFILE |
| 74 | bool "Host filed DTB for DT control" |
| 75 | depends on SANDBOX |
| 76 | help |
| 77 | If this option is enabled, DTB will be read from a file on startup. |
| 78 | This is only useful for Sandbox. Use the -d flag to U-Boot to |
| 79 | specify the file to read. |
| 80 | |
| 81 | endchoice |
| 82 | |
Masahiro Yamada | f1ef2b6 | 2014-09-22 19:59:06 +0900 | [diff] [blame] | 83 | config DEFAULT_DEVICE_TREE |
| 84 | string "Default Device Tree for DT control" |
Simon Glass | 70d4109 | 2016-02-22 22:55:44 -0700 | [diff] [blame] | 85 | depends on OF_CONTROL |
Masahiro Yamada | f1ef2b6 | 2014-09-22 19:59:06 +0900 | [diff] [blame] | 86 | help |
| 87 | This option specifies the default Device Tree used for DT control. |
Robert P. J. Day | 5699ea6 | 2014-10-21 16:44:32 -0400 | [diff] [blame] | 88 | It can be overridden from the command line: |
Masahiro Yamada | f1ef2b6 | 2014-09-22 19:59:06 +0900 | [diff] [blame] | 89 | $ make DEVICE_TREE=<device-tree-name> |
| 90 | |
Simon Glass | cdf1724 | 2016-02-22 22:55:57 -0700 | [diff] [blame] | 91 | config OF_LIST |
| 92 | string "List of device tree files to include for DT control" |
Cooper Jr., Franklin | d979740 | 2017-06-16 17:25:09 -0500 | [diff] [blame] | 93 | depends on SPL_LOAD_FIT || FIT_EMBED |
Michal Simek | c409bd0 | 2016-05-04 15:14:11 +0200 | [diff] [blame] | 94 | default DEFAULT_DEVICE_TREE |
Simon Glass | cdf1724 | 2016-02-22 22:55:57 -0700 | [diff] [blame] | 95 | help |
| 96 | This option specifies a list of device tree files to use for DT |
Cooper Jr., Franklin | d979740 | 2017-06-16 17:25:09 -0500 | [diff] [blame] | 97 | control. These will be packaged into a FIT. At run-time, U-boot |
| 98 | or SPL will select the correct DT to use by examining the |
| 99 | hardware (e.g. reading a board ID value). This is a list of |
| 100 | device tree files (without the directory or .dtb suffix) |
| 101 | separated by <space>. |
Simon Glass | cdf1724 | 2016-02-22 22:55:57 -0700 | [diff] [blame] | 102 | |
Simon Glass | fa78e0a | 2015-06-23 15:38:29 -0600 | [diff] [blame] | 103 | config OF_SPL_REMOVE_PROPS |
| 104 | string "List of device tree properties to drop for SPL" |
Masahiro Yamada | 897705e | 2015-08-28 20:28:42 +0900 | [diff] [blame] | 105 | depends on SPL_OF_CONTROL |
Vikas Manocha | 239ae4a | 2017-03-24 14:47:44 -0700 | [diff] [blame] | 106 | default "interrupt-parent" if SPL_PINCTRL && SPL_CLK |
| 107 | default "clocks clock-names interrupt-parent" if SPL_PINCTRL |
Masahiro Yamada | 5f3f7b7 | 2016-02-03 20:51:36 +0900 | [diff] [blame] | 108 | default "pinctrl-0 pinctrl-names interrupt-parent" if SPL_CLK |
Simon Glass | fa78e0a | 2015-06-23 15:38:29 -0600 | [diff] [blame] | 109 | default "pinctrl-0 pinctrl-names clocks clock-names interrupt-parent" |
| 110 | help |
| 111 | Since SPL normally runs in a reduced memory space, the device tree |
| 112 | is cut down to only what is needed to load and start U-Boot. Only |
| 113 | nodes marked with the property "u-boot,dm-pre-reloc" will be |
| 114 | included. In addition, some properties are not used by U-Boot and |
| 115 | can be discarded. This option defines the list of properties to |
| 116 | discard. |
| 117 | |
Simon Glass | 2789ddb | 2016-07-04 11:58:06 -0600 | [diff] [blame] | 118 | config SPL_OF_PLATDATA |
| 119 | bool "Generate platform data for use in SPL" |
| 120 | depends on SPL_OF_CONTROL |
| 121 | help |
| 122 | For very constrained SPL environments the overhead of decoding |
| 123 | device tree nodes and converting their contents into platform data |
| 124 | is too large. This overhead includes libfdt code as well as the |
| 125 | device tree contents itself. The latter is fairly compact, but the |
| 126 | former can add 3KB or more to a Thumb 2 Image. |
| 127 | |
| 128 | This option enables generation of platform data from the device |
| 129 | tree as C code. This code creates devices using U_BOOT_DEVICE() |
| 130 | declarations. The benefit is that it allows driver code to access |
| 131 | the platform data directly in C structures, avoidin the libfdt |
| 132 | overhead. |
| 133 | |
| 134 | This option works by generating C structure declarations for each |
| 135 | compatible string, then adding platform data and U_BOOT_DEVICE |
| 136 | declarations for each node. See README.platdata for more |
| 137 | information. |
| 138 | |
Masahiro Yamada | 783e6a7 | 2014-09-22 19:59:05 +0900 | [diff] [blame] | 139 | endmenu |