diff mbox

[U-Boot,v2,14/56] armv8: remove unused low-level modules from TPL

Message ID 1501065662-52029-15-git-send-email-philipp.tomsich@theobroma-systems.com
State Superseded
Delegated to: Philipp Tomsich
Headers show

Commit Message

Philipp Tomsich July 26, 2017, 10:40 a.m. UTC
TPL builds today don't need to call into firmware or set up the MMU
(if this changes, it should be controlled through a config option
whether to include this or not), but include the needed support code
for this anyway.

Even for a feature-rich TPL (including DM support as for the RK3368),
this equates to a size difference of approx. 10% in TPL binary size:
- without this change:
   text    data    bss    dec    hex filename
  23635    3112     24  26771   6893 tpl/u-boot-tpl
- with this change:
   text	   data    bss    dec    hex filename
  21583    3112     24  24719   608f tpl/u-boot-tpl

Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
---

Changes in v2: None

 arch/arm/cpu/armv8/Makefile | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Tom Rini July 26, 2017, 7:53 p.m. UTC | #1
On Wed, Jul 26, 2017 at 12:40:18PM +0200, Philipp Tomsich wrote:

> TPL builds today don't need to call into firmware or set up the MMU
> (if this changes, it should be controlled through a config option
> whether to include this or not), but include the needed support code
> for this anyway.
> 
> Even for a feature-rich TPL (including DM support as for the RK3368),
> this equates to a size difference of approx. 10% in TPL binary size:
> - without this change:
>    text    data    bss    dec    hex filename
>   23635    3112     24  26771   6893 tpl/u-boot-tpl
> - with this change:
>    text	   data    bss    dec    hex filename
>   21583    3112     24  24719   608f tpl/u-boot-tpl
> 
> Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
> ---
> 
> Changes in v2: None
> 
>  arch/arm/cpu/armv8/Makefile | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/cpu/armv8/Makefile b/arch/arm/cpu/armv8/Makefile
> index c447085..e831471 100644
> --- a/arch/arm/cpu/armv8/Makefile
> +++ b/arch/arm/cpu/armv8/Makefile
> @@ -9,12 +9,14 @@ extra-y	:= start.o
>  
>  obj-y	+= cpu.o
>  obj-y	+= generic_timer.o
> +ifndef CONFIG_TPL_BUILD
>  obj-y	+= cache_v8.o
> -obj-y	+= exceptions.o
>  obj-y	+= cache.o
>  obj-y	+= tlb.o
>  obj-y	+= transition.o
>  obj-y	+= fwcall.o
> +endif
> +obj-y	+= exceptions.o
>  obj-y	+= cpu-dt.o
>  obj-$(CONFIG_ARM_SMCCC)		+= smccc-call.o

We're talking about various asm files above, yes?  Have you looked at
manually adding the section information to these files so they can be
gc'd in all cases?  If it's too complex (for example, some macro-heavy
asm files we borrow from Linux are just too hard to make it work in),
then the above is fine.  Otherwise I'd like to see section naming so
they can be gc'd with the normal flags here.  Thanks!
diff mbox

Patch

diff --git a/arch/arm/cpu/armv8/Makefile b/arch/arm/cpu/armv8/Makefile
index c447085..e831471 100644
--- a/arch/arm/cpu/armv8/Makefile
+++ b/arch/arm/cpu/armv8/Makefile
@@ -9,12 +9,14 @@  extra-y	:= start.o
 
 obj-y	+= cpu.o
 obj-y	+= generic_timer.o
+ifndef CONFIG_TPL_BUILD
 obj-y	+= cache_v8.o
-obj-y	+= exceptions.o
 obj-y	+= cache.o
 obj-y	+= tlb.o
 obj-y	+= transition.o
 obj-y	+= fwcall.o
+endif
+obj-y	+= exceptions.o
 obj-y	+= cpu-dt.o
 obj-$(CONFIG_ARM_SMCCC)		+= smccc-call.o