From patchwork Wed Jan 8 21:38:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anatolij Gustschin X-Patchwork-Id: 239268 List-Id: U-Boot discussion From: agust at denx.de (Anatolij Gustschin) Date: Wed, 8 Jan 2020 22:38:32 +0100 Subject: [PATCH 1/2] dts: add property removal option CONFIG_OF_REMOVE_PROPS Message-ID: <20200108213833.10869-1-agust@denx.de> This can be used for device tree size reduction similar as CONFIG_OF_SPL_REMOVE_PROPS option. For tbs2910 board this shrinks the image size: all -2304.0 bss -16.0 text -2288.0 Signed-off-by: Anatolij Gustschin Reviewed-by: Tom Rini --- dts/Kconfig | 8 ++++++++ scripts/Makefile.lib | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/dts/Kconfig b/dts/Kconfig index 64c98dd723..49224bee93 100644 --- a/dts/Kconfig +++ b/dts/Kconfig @@ -311,6 +311,14 @@ config OF_SPL_REMOVE_PROPS can be discarded. This option defines the list of properties to discard. +config OF_REMOVE_PROPS + string "List of device tree properties to drop" + depends on OF_CONTROL + default "interrupt-parent interrupts" if PINCTRL + help + Some properties are not used by U-Boot and can be discarded. + This option defines the list of properties to discard. + config SPL_OF_PLATDATA bool "Generate platform data for use in SPL" depends on SPL_OF_CONTROL diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 4ea898a421..3b124369ad 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -235,7 +235,8 @@ $(obj)/%.tab.h: $(src)/%.y FORCE # =========================================================================== quiet_cmd_shipped = SHIPPED $@ -cmd_shipped = cat $< > $@ +cmd_shipped = cat $< | $(objtree)/tools/fdtgrep -r -O dtb - -o $@ \ + $(addprefix -P ,$(subst $\",,$(CONFIG_OF_REMOVE_PROPS))) $(obj)/%: $(src)/%_shipped $(call cmd,shipped) From patchwork Wed Jan 8 21:38:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anatolij Gustschin X-Patchwork-Id: 239269 List-Id: U-Boot discussion From: agust at denx.de (Anatolij Gustschin) Date: Wed, 8 Jan 2020 22:38:33 +0100 Subject: [PATCH 2/2] tbs2910: add custom CONFIG_OF_REMOVE_PROPS list to defconfig In-Reply-To: <20200108213833.10869-1-agust@denx.de> References: <20200108213833.10869-1-agust@denx.de> Message-ID: <20200108213833.10869-2-agust@denx.de> This shrinks the image size: all -1536.0 bss +16.0 text -1552.0 Signed-off-by: Anatolij Gustschin Acked-by: Soeren Moch --- NOTE: building with this patch only works when patch [1] is applied. [1] http://patchwork.ozlabs.org/patch/1219944 configs/tbs2910_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/configs/tbs2910_defconfig b/configs/tbs2910_defconfig index a42f53e849..12f3a5dc24 100644 --- a/configs/tbs2910_defconfig +++ b/configs/tbs2910_defconfig @@ -46,6 +46,7 @@ CONFIG_EFI_PARTITION=y CONFIG_OF_CONTROL=y CONFIG_OF_EMBED=y CONFIG_DEFAULT_DEVICE_TREE="imx6q-tbs2910" +CONFIG_OF_REMOVE_PROPS="dmas dma-names interrupt-parent interrupts interrupts-extended interrupt-names interrupt-map interrupt-map-mask" CONFIG_ENV_IS_IN_MMC=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y CONFIG_DM=y