From c48a3a80d2169914a6b90ad1a3895e69b7797cae Mon Sep 17 00:00:00 2001 From: Joseph Chen Date: Thu, 28 May 2020 11:40:57 +0800 Subject: [PATCH] dts: Kconfig: introduce U-Boot list of device tree properties to drop Since kernel dtb feature is enabled, U-Boot prop use the same device tree as SPL. At sometimes there is different require for list of device tree properties to drop for U-Boot prop, so providing this configure which has higher priority, that if it is defined empty string, fallback to use OF_SPL_REMOVE_PROPS. Signed-off-by: Joseph Chen Change-Id: I83b97226c01c320d3a51a6cb0b181016dc5c0067 --- dts/Kconfig | 10 ++++++++++ dts/Makefile | 14 +++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/dts/Kconfig b/dts/Kconfig index 7dfd5990d2..16f281ae45 100644 --- a/dts/Kconfig +++ b/dts/Kconfig @@ -248,6 +248,16 @@ config OF_SPL_REMOVE_PROPS can be discarded. This option defines the list of properties to discard. +config OF_U_BOOT_REMOVE_PROPS + string "List of device tree properties to drop for U-Boot" + depends on USING_KERNEL_DTB + default "" + help + Since kernel dtb feature is enabled, U-Boot prop use the same device tree as SPL. + At sometimes there is different require for list of device tree properties to drop + for U-Boot prop, so providing this configure which has higher priority, that if it + is defined empty string, fallback to use OF_SPL_REMOVE_PROPS. + config SPL_OF_PLATDATA bool "Generate platform data for use in SPL" depends on SPL_OF_CONTROL diff --git a/dts/Makefile b/dts/Makefile index ec341cad35..5383dd6f9a 100644 --- a/dts/Makefile +++ b/dts/Makefile @@ -32,11 +32,18 @@ fdtgrep_props := -b u-boot,dm-pre-reloc -b u-boot,dm-tpl else fdtgrep_props := -b u-boot,dm-pre-reloc -b u-boot,dm-spl endif + quiet_cmd_fdtgrep = FDTGREP $@ cmd_fdtgrep = $(objtree)/tools/fdtgrep $(fdtgrep_props) -RT $< \ + -n /chosen -n /config -O dtb | \ + $(objtree)/tools/fdtgrep -r -O dtb - -o $@ \ + $(addprefix -P ,$(subst $\",,$(CONFIG_OF_SPL_REMOVE_PROPS))) + +quiet_cmd_fdtgrep_uboot = FDTGREP $@ + cmd_fdtgrep_uboot = $(objtree)/tools/fdtgrep $(fdtgrep_props) -RT $< \ -n /chosen -n /config -O dtb | \ $(objtree)/tools/fdtgrep -r -O dtb - -o $@ \ - $(addprefix -P ,$(subst $\",,$(CONFIG_OF_SPL_REMOVE_PROPS))) + $(addprefix -P ,$(subst $\",,$(CONFIG_OF_U_BOOT_REMOVE_PROPS))) fdtgrep_tpl_props := -b u-boot,dm-pre-reloc -b u-boot,dm-tpl quiet_cmd_fdtgrep_tpl = FDTGREP $@ @@ -63,9 +70,14 @@ $(obj)/dt-spl.dtb: $(DTB) $(objtree)/tools/fdtgrep FORCE $(call if_changed,fdtgrep) endif +# Normally, usbplug is enabled with kernel dtb disabled ifneq ($(CONFIG_USING_KERNEL_DTB)$(CONFIG_SUPPORT_USBPLUG),) $(obj)/dt.dtb: $(DTB) $(objtree)/tools/fdtgrep FORCE +ifneq ($(CONFIG_OF_U_BOOT_REMOVE_PROPS), "") + $(call if_changed,fdtgrep_uboot) +else $(call if_changed,fdtgrep) +endif else $(obj)/dt.dtb: $(DTB) FORCE $(call if_changed,shipped)