Commit 11955590a284ecb75892aad5f1174ca1b94a709b
Committed by
Tom Rini
1 parent
84570a0c11
Exists in
smarc_8mq_lf_v2020.04
and in
17 other branches
dts: renamed FIT_EMBED to MULTI_DTB_FIT and moved it to the dts Kconfig
CONFIG_FIT_EMBED might be confused with CONFIG_OF_EMBED, rename it MULTI_DTB_FIT as it is able to get a DTB from a FIT image containing multiple DTBs. Also move the option to the Kconfig dedicated to the DTS options and create a README for this feature. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Showing 14 changed files with 45 additions and 28 deletions Side-by-side Diff
- Makefile
- board/ti/ks2_evm/board_k2e.c
- board/ti/ks2_evm/board_k2g.c
- board/ti/ks2_evm/board_k2hk.c
- board/ti/ks2_evm/board_k2l.c
- common/Kconfig
- common/Makefile
- configs/k2e_evm_defconfig
- configs/k2g_evm_defconfig
- configs/k2hk_evm_defconfig
- configs/k2l_evm_defconfig
- doc/README.multi-dtb-fit
- dts/Kconfig
- lib/fdtdec.c
Makefile
board/ti/ks2_evm/board_k2e.c
board/ti/ks2_evm/board_k2g.c
board/ti/ks2_evm/board_k2hk.c
board/ti/ks2_evm/board_k2l.c
common/Kconfig
... | ... | @@ -403,22 +403,6 @@ |
403 | 403 | |
404 | 404 | endmenu |
405 | 405 | |
406 | -config DTB_RESELECT | |
407 | - bool "Support swapping dtbs at a later point in boot" | |
408 | - depends on FIT_EMBED | |
409 | - help | |
410 | - It is possible during initial boot you may need to use a generic | |
411 | - dtb until you can fully determine the board your running on. This | |
412 | - config allows boards to implement a function at a later point | |
413 | - during boot to switch to the "correct" dtb. | |
414 | - | |
415 | -config FIT_EMBED | |
416 | - bool "Support a FIT image embedded in the U-boot image" | |
417 | - help | |
418 | - This option provides hooks to allow U-boot to parse an | |
419 | - appended FIT image and enable board specific code to then select | |
420 | - the correct DTB to be used. | |
421 | - | |
422 | 406 | config DEFAULT_FDT_FILE |
423 | 407 | string "Default fdt file" |
424 | 408 | help |
common/Makefile
... | ... | @@ -103,7 +103,7 @@ |
103 | 103 | obj-$(CONFIG_ANDROID_BOOT_IMAGE) += image-android.o |
104 | 104 | obj-$(CONFIG_$(SPL_TPL_)OF_LIBFDT) += image-fdt.o |
105 | 105 | obj-$(CONFIG_$(SPL_TPL_)FIT) += image-fit.o |
106 | -obj-$(CONFIG_FIT_EMBED) += boot_fit.o common_fit.o | |
106 | +obj-$(CONFIG_$(SPL_)MULTI_DTB_FIT) += boot_fit.o common_fit.o | |
107 | 107 | obj-$(CONFIG_$(SPL_TPL_)FIT_SIGNATURE) += image-sig.o |
108 | 108 | obj-$(CONFIG_IO_TRACE) += iotrace.o |
109 | 109 | obj-y += memsize.o |
configs/k2e_evm_defconfig
configs/k2g_evm_defconfig
configs/k2hk_evm_defconfig
configs/k2l_evm_defconfig
doc/README.multi-dtb-fit
1 | +MULTI DTB FIT | |
2 | + | |
3 | +The purpose of this feature is to enable u-boot to select its DTB from a FIT | |
4 | +appended at the end of the binary. | |
5 | + | |
6 | +Usually the DTB is selected by the SPL and passed down to U-Boot. But some | |
7 | +platforms don't use the SPL. In this case MULTI_DTB_FIT can used to provide | |
8 | +U-Boot with a choice of DTBs. | |
9 | +The relevant DTBs are packed into a FIT (list provided by CONFIG__OF_LIST). The | |
10 | +FIT is automatically generated at the end of the compilation and appended to | |
11 | +u-boot.bin so that U-Boot can locate it and select the correct DTB from inside | |
12 | +the FIT. | |
13 | +The selection is done using board_fit_config_name_match() (same as what the SPL | |
14 | +uses to select the DTB for U-Boot). The selection happens during fdtdec_setup() | |
15 | +which is called during before relocation by board_init_f(). |
dts/Kconfig
... | ... | @@ -102,7 +102,7 @@ |
102 | 102 | |
103 | 103 | config OF_LIST |
104 | 104 | string "List of device tree files to include for DT control" |
105 | - depends on SPL_LOAD_FIT || FIT_EMBED | |
105 | + depends on SPL_LOAD_FIT || MULTI_DTB_FIT | |
106 | 106 | default DEFAULT_DEVICE_TREE |
107 | 107 | help |
108 | 108 | This option specifies a list of device tree files to use for DT |
... | ... | @@ -111,6 +111,24 @@ |
111 | 111 | hardware (e.g. reading a board ID value). This is a list of |
112 | 112 | device tree files (without the directory or .dtb suffix) |
113 | 113 | separated by <space>. |
114 | + | |
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. | |
114 | 132 | |
115 | 133 | config OF_SPL_REMOVE_PROPS |
116 | 134 | string "List of device tree properties to drop for SPL" |
lib/fdtdec.c
... | ... | @@ -1217,7 +1217,7 @@ |
1217 | 1217 | else |
1218 | 1218 | gd->fdt_blob = (ulong *)&__bss_end; |
1219 | 1219 | |
1220 | -# elif defined CONFIG_FIT_EMBED | |
1220 | +# elif defined CONFIG_MULTI_DTB_FIT | |
1221 | 1221 | gd->fdt_blob = locate_dtb_in_fit(&_end); |
1222 | 1222 | |
1223 | 1223 | if (gd->fdt_blob == NULL || gd->fdt_blob <= ((void *)&_end)) { |