All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] dts: add property removal option CONFIG_OF_REMOVE_PROPS
@ 2020-01-08 21:38 Anatolij Gustschin
  2020-01-08 21:38 ` [PATCH 2/2] tbs2910: add custom CONFIG_OF_REMOVE_PROPS list to defconfig Anatolij Gustschin
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Anatolij Gustschin @ 2020-01-08 21:38 UTC (permalink / raw)
  To: u-boot

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 <agust@denx.de>
---
 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)
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 2/2] tbs2910: add custom CONFIG_OF_REMOVE_PROPS list to defconfig
  2020-01-08 21:38 [PATCH 1/2] dts: add property removal option CONFIG_OF_REMOVE_PROPS Anatolij Gustschin
@ 2020-01-08 21:38 ` Anatolij Gustschin
  2020-01-09 12:06   ` Soeren Moch
  2020-01-08 21:57 ` [PATCH 1/2] dts: add property removal option CONFIG_OF_REMOVE_PROPS Tom Rini
  2020-01-10 16:39 ` Tom Rini
  2 siblings, 1 reply; 10+ messages in thread
From: Anatolij Gustschin @ 2020-01-08 21:38 UTC (permalink / raw)
  To: u-boot

This shrinks the image size: all -1536.0 bss +16.0 text -1552.0

Signed-off-by: Anatolij Gustschin <agust@denx.de>
---
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
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 1/2] dts: add property removal option CONFIG_OF_REMOVE_PROPS
  2020-01-08 21:38 [PATCH 1/2] dts: add property removal option CONFIG_OF_REMOVE_PROPS Anatolij Gustschin
  2020-01-08 21:38 ` [PATCH 2/2] tbs2910: add custom CONFIG_OF_REMOVE_PROPS list to defconfig Anatolij Gustschin
@ 2020-01-08 21:57 ` Tom Rini
  2020-01-10 16:39 ` Tom Rini
  2 siblings, 0 replies; 10+ messages in thread
From: Tom Rini @ 2020-01-08 21:57 UTC (permalink / raw)
  To: u-boot

On Wed, Jan 08, 2020 at 10:38:32PM +0100, Anatolij Gustschin wrote:

> 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 <agust@denx.de>

Reviewed-by: Tom Rini <trini@konsulko.com>

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200108/32860473/attachment.sig>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 2/2] tbs2910: add custom CONFIG_OF_REMOVE_PROPS list to defconfig
  2020-01-08 21:38 ` [PATCH 2/2] tbs2910: add custom CONFIG_OF_REMOVE_PROPS list to defconfig Anatolij Gustschin
@ 2020-01-09 12:06   ` Soeren Moch
  0 siblings, 0 replies; 10+ messages in thread
From: Soeren Moch @ 2020-01-09 12:06 UTC (permalink / raw)
  To: u-boot


On 08.01.20 22:38, Anatolij Gustschin wrote:
> This shrinks the image size: all -1536.0 bss +16.0 text -1552.0
>
> Signed-off-by: Anatolij Gustschin <agust@denx.de>

Acked-by: Soeren Moch <smoch@web.de>

Thanks,
Soeren

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 1/2] dts: add property removal option CONFIG_OF_REMOVE_PROPS
  2020-01-08 21:38 [PATCH 1/2] dts: add property removal option CONFIG_OF_REMOVE_PROPS Anatolij Gustschin
  2020-01-08 21:38 ` [PATCH 2/2] tbs2910: add custom CONFIG_OF_REMOVE_PROPS list to defconfig Anatolij Gustschin
  2020-01-08 21:57 ` [PATCH 1/2] dts: add property removal option CONFIG_OF_REMOVE_PROPS Tom Rini
@ 2020-01-10 16:39 ` Tom Rini
  2020-01-10 17:01   ` Masahiro Yamada
                     ` (2 more replies)
  2 siblings, 3 replies; 10+ messages in thread
From: Tom Rini @ 2020-01-10 16:39 UTC (permalink / raw)
  To: u-boot

On Wed, Jan 08, 2020 at 10:38:32PM +0100, Anatolij Gustschin wrote:

> 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 <agust@denx.de>
> ---
>  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)

On further thinking, this will make it harder in the case of passing the
DTB directly to the kernel.  We should guard this option by something
else first.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200110/2043dfdd/attachment.sig>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 1/2] dts: add property removal option CONFIG_OF_REMOVE_PROPS
  2020-01-10 16:39 ` Tom Rini
@ 2020-01-10 17:01   ` Masahiro Yamada
  2020-01-12 14:08     ` Anatolij Gustschin
  2020-01-10 19:13   ` Masahiro Yamada
  2020-01-12 14:06   ` Anatolij Gustschin
  2 siblings, 1 reply; 10+ messages in thread
From: Masahiro Yamada @ 2020-01-10 17:01 UTC (permalink / raw)
  To: u-boot

On Sat, Jan 11, 2020 at 1:39 AM Tom Rini <trini@konsulko.com> wrote:
>
> On Wed, Jan 08, 2020 at 10:38:32PM +0100, Anatolij Gustschin wrote:
>
> > 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 <agust@denx.de>
> > ---
> >  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)
>
> On further thinking, this will make it harder in the case of passing the
> DTB directly to the kernel.  We should guard this option by something
> else first.
>
> --
> Tom


More importantly, this patch breaks targets
that compile pylibfdt, for example, qemu-x86_defconfig.


$ make qemu-x86_defconfig
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/kconfig/conf.o
  YACC    scripts/kconfig/zconf.tab.c
  LEX     scripts/kconfig/zconf.lex.c
  HOSTCC  scripts/kconfig/zconf.tab.o
  HOSTLD  scripts/kconfig/conf
#
# configuration written to .config
#
masahiro at grover:~/ref/u-boot$ make
scripts/kconfig/conf  --syncconfig Kconfig
  CHK     include/config.h
  UPD     include/config.h
  CFG     u-boot.cfg
  GEN     include/autoconf.mk
  GEN     include/autoconf.mk.dep
  CHK     include/config/uboot.release
  UPD     include/config/uboot.release
  CHK     include/generated/version_autogenerated.h
  UPD     include/generated/version_autogenerated.h
  CHK     include/generated/timestamp_autogenerated.h
  UPD     include/generated/timestamp_autogenerated.h
  CC      lib/asm-offsets.s
  CHK     include/generated/generic-asm-offsets.h
  UPD     include/generated/generic-asm-offsets.h
  CC      arch/x86/lib/asm-offsets.s
  CHK     include/generated/asm-offsets.h
  UPD     include/generated/asm-offsets.h
  SHIPPED scripts/dtc/pylibfdt/libfdt.i
/bin/sh: 1: ./tools/fdtgrep: not found
make[3]: *** [scripts/Makefile.lib:242: scripts/dtc/pylibfdt/libfdt.i] Error 127
make[2]: *** [scripts/Makefile.build:432: scripts/dtc/pylibfdt] Error 2
make[1]: *** [scripts/Makefile.build:432: scripts/dtc] Error 2
make: *** [Makefile:551: scripts] Error 2


Please do not touch cmd_shipped.

If this feature is desired,
please implement it in dts/Makefile.


-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 1/2] dts: add property removal option CONFIG_OF_REMOVE_PROPS
  2020-01-10 16:39 ` Tom Rini
  2020-01-10 17:01   ` Masahiro Yamada
@ 2020-01-10 19:13   ` Masahiro Yamada
  2020-01-10 19:49     ` Tom Rini
  2020-01-12 14:06   ` Anatolij Gustschin
  2 siblings, 1 reply; 10+ messages in thread
From: Masahiro Yamada @ 2020-01-10 19:13 UTC (permalink / raw)
  To: u-boot

Hi Tom,

On Sat, Jan 11, 2020 at 1:39 AM Tom Rini <trini@konsulko.com> wrote:

> >  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)
>
> On further thinking, this will make it harder in the case of passing the
> DTB directly to the kernel.  We should guard this option by something
> else first.

Please let me ask a question about this.
In my understanding, U-Boot DTB is a different instance
from the DTB passed to the kernel.
Was it changed, or is the change planned?



--
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 1/2] dts: add property removal option CONFIG_OF_REMOVE_PROPS
  2020-01-10 19:13   ` Masahiro Yamada
@ 2020-01-10 19:49     ` Tom Rini
  0 siblings, 0 replies; 10+ messages in thread
From: Tom Rini @ 2020-01-10 19:49 UTC (permalink / raw)
  To: u-boot

On Sat, Jan 11, 2020 at 04:13:02AM +0900, Masahiro Yamada wrote:
> Hi Tom,
> 
> On Sat, Jan 11, 2020 at 1:39 AM Tom Rini <trini@konsulko.com> wrote:
> 
> > >  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)
> >
> > On further thinking, this will make it harder in the case of passing the
> > DTB directly to the kernel.  We should guard this option by something
> > else first.
> 
> Please let me ask a question about this.
> In my understanding, U-Boot DTB is a different instance
> from the DTB passed to the kernel.
> Was it changed, or is the change planned?

For a long time now I believe we've had some platforms that wanted to be
passed, and pass on again, a single DTB.  There's also been boards that
have wanted to (or have been) passing what we have on.  We also have the
case of platforms that more constrained and so stripping information out
of the DTB for U-Boot, and continuing to load the kernel DTB from
somewhere else, is what they need and want.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200110/e632b257/attachment.sig>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 1/2] dts: add property removal option CONFIG_OF_REMOVE_PROPS
  2020-01-10 16:39 ` Tom Rini
  2020-01-10 17:01   ` Masahiro Yamada
  2020-01-10 19:13   ` Masahiro Yamada
@ 2020-01-12 14:06   ` Anatolij Gustschin
  2 siblings, 0 replies; 10+ messages in thread
From: Anatolij Gustschin @ 2020-01-12 14:06 UTC (permalink / raw)
  To: u-boot

On Fri, 10 Jan 2020 11:39:45 -0500
Tom Rini trini at konsulko.com wrote:
...
> >  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)  
> 
> On further thinking, this will make it harder in the case of passing the
> DTB directly to the kernel.  We should guard this option by something
> else first.

Agreed, I'll make it optional in patch v2.

--
Anatolij

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 1/2] dts: add property removal option CONFIG_OF_REMOVE_PROPS
  2020-01-10 17:01   ` Masahiro Yamada
@ 2020-01-12 14:08     ` Anatolij Gustschin
  0 siblings, 0 replies; 10+ messages in thread
From: Anatolij Gustschin @ 2020-01-12 14:08 UTC (permalink / raw)
  To: u-boot

On Sat, 11 Jan 2020 02:01:27 +0900
Masahiro Yamada masahiroy at kernel.org wrote:
...
>   UPD     include/generated/asm-offsets.h
>   SHIPPED scripts/dtc/pylibfdt/libfdt.i
> /bin/sh: 1: ./tools/fdtgrep: not found
> make[3]: *** [scripts/Makefile.lib:242: scripts/dtc/pylibfdt/libfdt.i] Error 127
> make[2]: *** [scripts/Makefile.build:432: scripts/dtc/pylibfdt] Error 2
> make[1]: *** [scripts/Makefile.build:432: scripts/dtc] Error 2
> make: *** [Makefile:551: scripts] Error 2

Thanks for testing and reporting it, I'll fix it in v2.
 
> Please do not touch cmd_shipped.
> 
> If this feature is desired,
> please implement it in dts/Makefile.

OK, thanks!

--
Anatolij

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2020-01-12 14:08 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-08 21:38 [PATCH 1/2] dts: add property removal option CONFIG_OF_REMOVE_PROPS Anatolij Gustschin
2020-01-08 21:38 ` [PATCH 2/2] tbs2910: add custom CONFIG_OF_REMOVE_PROPS list to defconfig Anatolij Gustschin
2020-01-09 12:06   ` Soeren Moch
2020-01-08 21:57 ` [PATCH 1/2] dts: add property removal option CONFIG_OF_REMOVE_PROPS Tom Rini
2020-01-10 16:39 ` Tom Rini
2020-01-10 17:01   ` Masahiro Yamada
2020-01-12 14:08     ` Anatolij Gustschin
2020-01-10 19:13   ` Masahiro Yamada
2020-01-10 19:49     ` Tom Rini
2020-01-12 14:06   ` Anatolij Gustschin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.