diff --git a/dts/Kconfig b/dts/Kconfig index edd5d7f830..7dfd5990d2 100644 --- a/dts/Kconfig +++ b/dts/Kconfig @@ -47,6 +47,16 @@ config SPL_OF_CONTROL which is not enough to support device tree. Enable this option to allow such boards to be supported by U-Boot SPL. +config SPL_DTB_MINIMUM + bool "Provide a minimum SPL DTB " + depends on SPL_OF_CONTROL + default n + help + Some boards need a SPL DTB as smaller as possible to save dm scan + time and space. It provides a SPL DTB only include the node with + property "u-boot,dm-spl". The property "u-boot,pre-reloc" doesn't + work any more. + config TPL_OF_CONTROL bool "Enable run-time configuration via Device Tree in TPL" depends on TPL && OF_CONTROL diff --git a/dts/Makefile b/dts/Makefile index 341e982157..170559d288 100644 --- a/dts/Makefile +++ b/dts/Makefile @@ -41,15 +41,27 @@ quiet_cmd_fdtgrep = FDTGREP $@ fdtgrep_tpl_props := -b u-boot,dm-pre-reloc -b u-boot,dm-tpl quiet_cmd_fdtgrep_tpl = FDTGREP $@ cmd_fdtgrep_tpl = $(objtree)/tools/fdtgrep $(fdtgrep_tpl_props) -RT $< \ - -n /config -O dtb | \ + -n /chosen -n config -O dtb | \ + $(objtree)/tools/fdtgrep -r -O dtb - -o $@ \ + $(addprefix -P ,$(subst $\",,$(CONFIG_OF_SPL_REMOVE_PROPS))) + +fdtgrep_spl_minimum_props := -b u-boot,dm-spl +quiet_cmd_fdtgrep_spl_minimum = FDTGREP $@ + cmd_fdtgrep_spl_minimum = $(objtree)/tools/fdtgrep $(fdtgrep_spl_minimum_props) -RT $< \ + -n /chosen -n config -O dtb | \ $(objtree)/tools/fdtgrep -r -O dtb - -o $@ \ $(addprefix -P ,$(subst $\",,$(CONFIG_OF_SPL_REMOVE_PROPS))) $(obj)/dt-tpl.dtb: $(DTB) $(objtree)/tools/fdtgrep FORCE $(call if_changed,fdtgrep_tpl) +ifeq ($(CONFIG_SPL_DTB_MINIMUM),y) +$(obj)/dt-spl.dtb: $(DTB) $(objtree)/tools/fdtgrep FORCE + $(call if_changed,fdtgrep_spl_minimum) +else $(obj)/dt-spl.dtb: $(DTB) $(objtree)/tools/fdtgrep FORCE $(call if_changed,fdtgrep) +endif ifeq ($(CONFIG_USING_KERNEL_DTB),y) $(obj)/dt.dtb: $(DTB) $(objtree)/tools/fdtgrep FORCE