Masahiro Yamada | 9fadbc8 | 2014-09-22 19:59:05 +0900 | [diff] [blame] | 1 | # |
| 2 | # Device Tree Control |
| 3 | # |
Masahiro Yamada | 9fadbc8 | 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 | 9fadbc8 | 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 | 7e9b9d6 | 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 | 1e35f39 | 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 | 400d040 | 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 | |
Philipp Tomsich | 2341dc6 | 2017-06-29 11:11:21 +0200 | [diff] [blame] | 35 | config TPL_OF_CONTROL |
| 36 | bool "Enable run-time configuration via Device Tree in TPL" |
| 37 | depends on TPL && OF_CONTROL |
| 38 | help |
| 39 | Some boards use device tree in U-Boot but only have 4KB of SRAM |
| 40 | which is not enough to support device tree. Enable this option to |
| 41 | allow such boards to be supported by U-Boot TPL. |
| 42 | |
Simon Glass | a6eedb8 | 2017-05-18 20:08:53 -0600 | [diff] [blame] | 43 | config OF_LIVE |
| 44 | bool "Enable use of a live tree" |
| 45 | depends on OF_CONTROL |
| 46 | help |
| 47 | Normally U-Boot uses a flat device tree which saves space and |
| 48 | avoids the need to unpack the tree before use. However a flat |
| 49 | tree does not support modifcation from within U-Boot since it |
| 50 | can invalidate driver-model device tree offsets. This option |
| 51 | enables a live tree which is available after relocation, |
| 52 | and can be adjusted as needed. |
| 53 | |
Masahiro Yamada | 9fadbc8 | 2014-09-22 19:59:05 +0900 | [diff] [blame] | 54 | choice |
| 55 | prompt "Provider of DTB for DT control" |
| 56 | depends on OF_CONTROL |
| 57 | |
| 58 | config OF_SEPARATE |
| 59 | bool "Separate DTB for DT control" |
| 60 | depends on !SANDBOX |
| 61 | help |
| 62 | If this option is enabled, the device tree will be built and |
| 63 | placed as a separate u-boot.dtb file alongside the U-Boot image. |
| 64 | |
| 65 | config OF_EMBED |
| 66 | bool "Embedded DTB for DT control" |
| 67 | help |
| 68 | If this option is enabled, the device tree will be picked up and |
Simon Glass | d9b64ea | 2015-08-31 18:47:52 -0600 | [diff] [blame] | 69 | built into the U-Boot image. This is suitable for local debugging |
| 70 | and development only and is not recommended for production devices. |
| 71 | Boards in the mainline U-Boot tree should not use it. |
Masahiro Yamada | 9fadbc8 | 2014-09-22 19:59:05 +0900 | [diff] [blame] | 72 | |
Alex Deymo | 5b661ec | 2017-04-02 01:25:20 -0700 | [diff] [blame] | 73 | config OF_BOARD |
| 74 | bool "Provided by the board at runtime" |
| 75 | depends on !SANDBOX |
| 76 | help |
| 77 | If this option is enabled, the device tree will be provided by |
| 78 | the board at runtime if the board supports it, instead of being |
| 79 | bundled with the image. |
| 80 | |
Masahiro Yamada | 9fadbc8 | 2014-09-22 19:59:05 +0900 | [diff] [blame] | 81 | config OF_HOSTFILE |
| 82 | bool "Host filed DTB for DT control" |
| 83 | depends on SANDBOX |
| 84 | help |
| 85 | If this option is enabled, DTB will be read from a file on startup. |
| 86 | This is only useful for Sandbox. Use the -d flag to U-Boot to |
| 87 | specify the file to read. |
| 88 | |
| 89 | endchoice |
| 90 | |
Masahiro Yamada | 8c65b9d | 2014-09-22 19:59:06 +0900 | [diff] [blame] | 91 | config DEFAULT_DEVICE_TREE |
| 92 | string "Default Device Tree for DT control" |
Simon Glass | 644f5bc | 2016-02-22 22:55:44 -0700 | [diff] [blame] | 93 | depends on OF_CONTROL |
Masahiro Yamada | 8c65b9d | 2014-09-22 19:59:06 +0900 | [diff] [blame] | 94 | help |
| 95 | This option specifies the default Device Tree used for DT control. |
Robert P. J. Day | eb61df5 | 2014-10-21 16:44:32 -0400 | [diff] [blame] | 96 | It can be overridden from the command line: |
Masahiro Yamada | 8c65b9d | 2014-09-22 19:59:06 +0900 | [diff] [blame] | 97 | $ make DEVICE_TREE=<device-tree-name> |
| 98 | |
Simon Glass | 963817b | 2016-02-22 22:55:57 -0700 | [diff] [blame] | 99 | config OF_LIST |
| 100 | string "List of device tree files to include for DT control" |
Cooper Jr., Franklin | 06c7b62 | 2017-06-16 17:25:09 -0500 | [diff] [blame] | 101 | depends on SPL_LOAD_FIT || FIT_EMBED |
Michal Simek | 9b2e95a | 2016-05-04 15:14:11 +0200 | [diff] [blame] | 102 | default DEFAULT_DEVICE_TREE |
Simon Glass | 963817b | 2016-02-22 22:55:57 -0700 | [diff] [blame] | 103 | help |
| 104 | This option specifies a list of device tree files to use for DT |
Cooper Jr., Franklin | 06c7b62 | 2017-06-16 17:25:09 -0500 | [diff] [blame] | 105 | control. These will be packaged into a FIT. At run-time, U-boot |
| 106 | or SPL will select the correct DT to use by examining the |
| 107 | hardware (e.g. reading a board ID value). This is a list of |
| 108 | device tree files (without the directory or .dtb suffix) |
| 109 | separated by <space>. |
Simon Glass | 963817b | 2016-02-22 22:55:57 -0700 | [diff] [blame] | 110 | |
Simon Glass | 89caf33 | 2015-06-23 15:38:29 -0600 | [diff] [blame] | 111 | config OF_SPL_REMOVE_PROPS |
| 112 | string "List of device tree properties to drop for SPL" |
Masahiro Yamada | ddb9aa97 | 2015-08-28 20:28:42 +0900 | [diff] [blame] | 113 | depends on SPL_OF_CONTROL |
Vikas Manocha | b6cca7d | 2017-03-24 14:47:44 -0700 | [diff] [blame] | 114 | default "interrupt-parent" if SPL_PINCTRL && SPL_CLK |
| 115 | default "clocks clock-names interrupt-parent" if SPL_PINCTRL |
Masahiro Yamada | f03811c | 2016-02-03 20:51:36 +0900 | [diff] [blame] | 116 | default "pinctrl-0 pinctrl-names interrupt-parent" if SPL_CLK |
Simon Glass | 89caf33 | 2015-06-23 15:38:29 -0600 | [diff] [blame] | 117 | default "pinctrl-0 pinctrl-names clocks clock-names interrupt-parent" |
| 118 | help |
| 119 | Since SPL normally runs in a reduced memory space, the device tree |
| 120 | is cut down to only what is needed to load and start U-Boot. Only |
| 121 | nodes marked with the property "u-boot,dm-pre-reloc" will be |
| 122 | included. In addition, some properties are not used by U-Boot and |
| 123 | can be discarded. This option defines the list of properties to |
| 124 | discard. |
| 125 | |
Simon Glass | 7bc65f3 | 2016-07-04 11:58:06 -0600 | [diff] [blame] | 126 | config SPL_OF_PLATDATA |
| 127 | bool "Generate platform data for use in SPL" |
| 128 | depends on SPL_OF_CONTROL |
| 129 | help |
| 130 | For very constrained SPL environments the overhead of decoding |
| 131 | device tree nodes and converting their contents into platform data |
| 132 | is too large. This overhead includes libfdt code as well as the |
| 133 | device tree contents itself. The latter is fairly compact, but the |
| 134 | former can add 3KB or more to a Thumb 2 Image. |
| 135 | |
| 136 | This option enables generation of platform data from the device |
| 137 | tree as C code. This code creates devices using U_BOOT_DEVICE() |
| 138 | declarations. The benefit is that it allows driver code to access |
| 139 | the platform data directly in C structures, avoidin the libfdt |
| 140 | overhead. |
| 141 | |
| 142 | This option works by generating C structure declarations for each |
| 143 | compatible string, then adding platform data and U_BOOT_DEVICE |
| 144 | declarations for each node. See README.platdata for more |
| 145 | information. |
| 146 | |
Philipp Tomsich | 2341dc6 | 2017-06-29 11:11:21 +0200 | [diff] [blame] | 147 | config TPL_OF_PLATDATA |
| 148 | bool "Generate platform data for use in TPL" |
| 149 | depends on TPL_OF_CONTROL |
| 150 | help |
| 151 | For very constrained SPL environments the overhead of decoding |
| 152 | device tree nodes and converting their contents into platform data |
| 153 | is too large. This overhead includes libfdt code as well as the |
| 154 | device tree contents itself. The latter is fairly compact, but the |
| 155 | former can add 3KB or more to a Thumb 2 Image. |
| 156 | |
| 157 | This option enables generation of platform data from the device |
| 158 | tree as C code. This code creates devices using U_BOOT_DEVICE() |
| 159 | declarations. The benefit is that it allows driver code to access |
| 160 | the platform data directly in C structures, avoidin the libfdt |
| 161 | overhead. |
| 162 | |
| 163 | This option works by generating C structure declarations for each |
| 164 | compatible string, then adding platform data and U_BOOT_DEVICE |
| 165 | declarations for each node. See README.platdata for more |
| 166 | information. |
| 167 | |
Masahiro Yamada | 9fadbc8 | 2014-09-22 19:59:05 +0900 | [diff] [blame] | 168 | endmenu |