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