Re: [U-Boot] [PATCH] mpc85xx: Add support for -msingle-pic-base

2019-01-24 Thread York Sun
On 12/6/18 8:20 AM, Joakim Tjernlund wrote:
> -msingle-pic-base is a new gcc(from 4.6) option for ppc and
> it reduces the size of my u-boot with about 4-5 KB.
> While at it, add -fno-jump-tables too to save a
> few more bytes.
> 
> e5500 core:
> size u-boot.bef
>text  data bss dec hex filename
>  473043 23772  307104  803919   c444f u-boot.bef
> size u-boot.aft
>text  data bss dec hex filename
>  453195 23772  307104  784071   bf6c7 u-boot.aft
> 
> e500 core:
> size u-boot.bef
>text  data bss dec hex filename
>  292998 17868   24968  335834   51fda u-boot.bef
> size u-boot.aft
>text  data bss dec hex filename
>  288002 17868   24968  330838   50c56 u-boot.aft
> 
> Signed-off-by: Joakim Tjernlund 
> ---

Applied to u-boot-mpc85xx, awaiting upstream. Thanks.

York
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH] mpc85xx: Add support for -msingle-pic-base

2018-12-07 Thread York Sun
On 12/6/18 8:20 AM, Joakim Tjernlund wrote:
> -msingle-pic-base is a new gcc(from 4.6) option for ppc and
> it reduces the size of my u-boot with about 4-5 KB.
> While at it, add -fno-jump-tables too to save a
> few more bytes.
>
> e5500 core:
> size u-boot.bef
>text  data bss dec hex filename
>  473043 23772  307104  803919   c444f u-boot.bef
> size u-boot.aft
>text  data bss dec hex filename
>  453195 23772  307104  784071   bf6c7 u-boot.aft
>
> e500 core:
> size u-boot.bef
>text  data bss dec hex filename
>  292998 17868   24968  335834   51fda u-boot.bef
> size u-boot.aft
>text  data bss dec hex filename
>  288002 17868   24968  330838   50c56 u-boot.aft
>
> Signed-off-by: Joakim Tjernlund 
> ---

Tested on e500mc, e5500, e6500 platforms.

Acked-by: York Sun 

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH] mpc85xx: Add support for -msingle-pic-base

2018-12-06 Thread Joakim Tjernlund
-msingle-pic-base is a new gcc(from 4.6) option for ppc and
it reduces the size of my u-boot with about 4-5 KB.
While at it, add -fno-jump-tables too to save a
few more bytes.

e5500 core:
size u-boot.bef
   textdata bss dec hex filename
 473043   23772  307104  803919   c444f u-boot.bef
size u-boot.aft
   textdata bss dec hex filename
 453195   23772  307104  784071   bf6c7 u-boot.aft

e500 core:
size u-boot.bef
   textdata bss dec hex filename
 292998   17868   24968  335834   51fda u-boot.bef
size u-boot.aft
   textdata bss dec hex filename
 288002   17868   24968  330838   50c56 u-boot.aft

Signed-off-by: Joakim Tjernlund 
---
 arch/powerpc/cpu/mpc85xx/config.mk | 1 +
 arch/powerpc/cpu/mpc85xx/start.S   | 3 +++
 2 files changed, 4 insertions(+)

diff --git a/arch/powerpc/cpu/mpc85xx/config.mk 
b/arch/powerpc/cpu/mpc85xx/config.mk
index 44d69add68..7a1d81cf2d 100644
--- a/arch/powerpc/cpu/mpc85xx/config.mk
+++ b/arch/powerpc/cpu/mpc85xx/config.mk
@@ -4,6 +4,7 @@
 # Xianghua Xiao, x.x...@motorola.com
 
 PLATFORM_CPPFLAGS += -Wa,-me500 -msoft-float -mno-string
+PLATFORM_RELFLAGS += -msingle-pic-base -fno-jump-tables
 
 # -mspe=yes is needed to have -mno-spe accepted by a buggy GCC;
 # see "[PATCH,rs6000] make -mno-spe work as expected" on
diff --git a/arch/powerpc/cpu/mpc85xx/start.S b/arch/powerpc/cpu/mpc85xx/start.S
index 932aa08b27..dbc705388c 100644
--- a/arch/powerpc/cpu/mpc85xx/start.S
+++ b/arch/powerpc/cpu/mpc85xx/start.S
@@ -1216,6 +1216,9 @@ _start_cont:
mr  r1,r3   /* Transfer to SP(r1) */
 
GET_GOT
+   /* Needed for -msingle-pic-base */
+   bl  _GLOBAL_OFFSET_TABLE_@local-4
+   mflrr30
 
/* Pass our potential ePAPR device tree pointer to cpu_init_early_f */
mr  r3, r24
-- 
2.18.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot