Commit 11955590a284ecb75892aad5f1174ca1b94a709b

Authored by Jean-Jacques Hiblot
Committed by Tom Rini
1 parent 84570a0c11

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

... ... @@ -878,7 +878,7 @@
878 878 quiet_cmd_copy = COPY $@
879 879 cmd_copy = cp $< $@
880 880  
881   -ifeq ($(CONFIG_FIT_EMBED),y)
  881 +ifeq ($(CONFIG_MULTI_DTB_FIT),y)
882 882  
883 883 fit-dtb.blob: dts/dt.dtb FORCE
884 884 $(call if_changed,mkimage)
board/ti/ks2_evm/board_k2e.c
... ... @@ -166,7 +166,7 @@
166 166 }
167 167 #endif
168 168  
169   -#if defined(CONFIG_FIT_EMBED)
  169 +#if defined(CONFIG_MULTI_DTB_FIT)
170 170 int board_fit_config_name_match(const char *name)
171 171 {
172 172 if (!strcmp(name, "keystone-k2e-evm"))
board/ti/ks2_evm/board_k2g.c
... ... @@ -217,7 +217,7 @@
217 217 }
218 218 #endif
219 219  
220   -#if defined(CONFIG_FIT_EMBED)
  220 +#if defined(CONFIG_MULTI_DTB_FIT)
221 221 int board_fit_config_name_match(const char *name)
222 222 {
223 223 bool eeprom_read = board_ti_was_eeprom_read();
board/ti/ks2_evm/board_k2hk.c
... ... @@ -150,7 +150,7 @@
150 150 }
151 151 #endif
152 152  
153   -#if defined(CONFIG_FIT_EMBED)
  153 +#if defined(CONFIG_MULTI_DTB_FIT)
154 154 int board_fit_config_name_match(const char *name)
155 155 {
156 156 if (!strcmp(name, "keystone-k2hk-evm"))
board/ti/ks2_evm/board_k2l.c
... ... @@ -138,7 +138,7 @@
138 138 }
139 139 #endif
140 140  
141   -#if defined(CONFIG_FIT_EMBED)
  141 +#if defined(CONFIG_MULTI_DTB_FIT)
142 142 int board_fit_config_name_match(const char *name)
143 143 {
144 144 if (!strcmp(name, "keystone-k2l-evm"))
... ... @@ -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
... ... @@ -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
... ... @@ -12,7 +12,7 @@
12 12 CONFIG_OF_BOARD_SETUP=y
13 13 CONFIG_SYS_CONSOLE_INFO_QUIET=y
14 14 CONFIG_DTB_RESELECT=y
15   -CONFIG_FIT_EMBED=y
  15 +CONFIG_MULTI_DTB_FIT=y
16 16 CONFIG_VERSION_VARIABLE=y
17 17 CONFIG_BOARD_EARLY_INIT_F=y
18 18 CONFIG_SPL=y
configs/k2g_evm_defconfig
... ... @@ -12,7 +12,7 @@
12 12 CONFIG_OF_BOARD_SETUP=y
13 13 CONFIG_SYS_CONSOLE_INFO_QUIET=y
14 14 CONFIG_DTB_RESELECT=y
15   -CONFIG_FIT_EMBED=y
  15 +CONFIG_MULTI_DTB_FIT=y
16 16 CONFIG_VERSION_VARIABLE=y
17 17 CONFIG_BOARD_EARLY_INIT_F=y
18 18 CONFIG_SPL=y
configs/k2hk_evm_defconfig
... ... @@ -12,7 +12,7 @@
12 12 CONFIG_OF_BOARD_SETUP=y
13 13 CONFIG_SYS_CONSOLE_INFO_QUIET=y
14 14 CONFIG_DTB_RESELECT=y
15   -CONFIG_FIT_EMBED=y
  15 +CONFIG_MULTI_DTB_FIT=y
16 16 CONFIG_VERSION_VARIABLE=y
17 17 CONFIG_BOARD_EARLY_INIT_F=y
18 18 CONFIG_SPL=y
configs/k2l_evm_defconfig
... ... @@ -12,7 +12,7 @@
12 12 CONFIG_OF_BOARD_SETUP=y
13 13 CONFIG_SYS_CONSOLE_INFO_QUIET=y
14 14 CONFIG_DTB_RESELECT=y
15   -CONFIG_FIT_EMBED=y
  15 +CONFIG_MULTI_DTB_FIT=y
16 16 CONFIG_VERSION_VARIABLE=y
17 17 CONFIG_BOARD_EARLY_INIT_F=y
18 18 CONFIG_SPL=y
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().
... ... @@ -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"
... ... @@ -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)) {