Browse Source

kbuild, blackfin: Add CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED

Many (but not all) of Blackfin boards give -O2 option
to compile under lib/ directory.
That means lib/ should be speed-optimized,
whereas other parts should be size-optimized.

We want to keep the same behavior,
but do not want to parse board/*/config.mk again and again.
We've got no choice but to invent a new method.

CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED, if it is enabled,
gives -O2 flag only for building under lib/ directory.

Dirty codes which I had marked as "FIX ME"
in board/${BOARD}/config.mk have been deleted.
Instead, CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED has been
defined in include/configs/${BOARD}.h.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Sonic Zhang <sonic.zhang@analog.com>
Masahiro Yamada 10 years ago
parent
commit
e91df49fbb
49 changed files with 26 additions and 212 deletions
  1. 0 13
      board/bct-brettl2/config.mk
  2. 0 13
      board/bf518f-ezbrd/config.mk
  3. 0 13
      board/bf526-ezbrd/config.mk
  4. 0 13
      board/bf527-ad7160-eval/config.mk
  5. 0 13
      board/bf527-ezkit/config.mk
  6. 0 5
      board/bf527-sdp/config.mk
  7. 0 5
      board/bf533-ezkit/config.mk
  8. 0 5
      board/bf533-stamp/config.mk
  9. 0 5
      board/bf537-stamp/config.mk
  10. 0 5
      board/bf538f-ezkit/config.mk
  11. 0 5
      board/bf548-ezkit/config.mk
  12. 0 5
      board/bf561-acvilon/config.mk
  13. 0 5
      board/bf561-ezkit/config.mk
  14. 0 15
      board/br4/config.mk
  15. 0 13
      board/cm-bf527/config.mk
  16. 0 5
      board/cm-bf533/config.mk
  17. 0 5
      board/cm-bf537e/config.mk
  18. 0 5
      board/cm-bf537u/config.mk
  19. 0 5
      board/cm-bf548/config.mk
  20. 0 5
      board/cm-bf561/config.mk
  21. 0 5
      board/ip04/config.mk
  22. 0 15
      board/pr1/config.mk
  23. 0 13
      board/tcm-bf518/config.mk
  24. 0 5
      board/tcm-bf537/config.mk
  25. 1 1
      include/configs/bct-brettl2.h
  26. 1 1
      include/configs/bf518f-ezbrd.h
  27. 1 0
      include/configs/bf526-ezbrd.h
  28. 1 1
      include/configs/bf527-ad7160-eval.h
  29. 1 1
      include/configs/bf527-ezkit.h
  30. 1 1
      include/configs/bf527-sdp.h
  31. 1 1
      include/configs/bf533-ezkit.h
  32. 1 0
      include/configs/bf533-stamp.h
  33. 1 0
      include/configs/bf537-stamp.h
  34. 1 1
      include/configs/bf538f-ezkit.h
  35. 1 0
      include/configs/bf548-ezkit.h
  36. 1 1
      include/configs/bf561-acvilon.h
  37. 1 0
      include/configs/bf561-ezkit.h
  38. 1 1
      include/configs/br4.h
  39. 1 1
      include/configs/cm-bf527.h
  40. 1 1
      include/configs/cm-bf533.h
  41. 1 0
      include/configs/cm-bf537e.h
  42. 1 1
      include/configs/cm-bf537u.h
  43. 1 0
      include/configs/cm-bf548.h
  44. 1 1
      include/configs/cm-bf561.h
  45. 1 0
      include/configs/ip04.h
  46. 1 1
      include/configs/pr1.h
  47. 1 1
      include/configs/tcm-bf518.h
  48. 1 1
      include/configs/tcm-bf537.h
  49. 2 0
      lib/Makefile

+ 0 - 13
board/bct-brettl2/config.mk

@@ -1,13 +0,0 @@
-#
-# Copyright (c) 2005-2008 Analog Device Inc.
-#
-# (C) Copyright 2001
-# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
-#
-# SPDX-License-Identifier:	GPL-2.0+
-#
-
-# FIX ME
-ifneq ($(filter lib lib/lzma lib/zlib, $(obj)),)
-ccflags-y := -O2
-endif

+ 0 - 13
board/bf518f-ezbrd/config.mk

@@ -1,13 +0,0 @@
-#
-# Copyright (c) 2005-2008 Analog Device Inc.
-#
-# (C) Copyright 2001
-# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
-#
-# SPDX-License-Identifier:	GPL-2.0+
-#
-
-# FIX ME
-ifneq ($(filter lib lib/lzma lib/zlib, $(obj)),)
-ccflags-y := -O2
-endif

+ 0 - 13
board/bf526-ezbrd/config.mk

@@ -1,13 +0,0 @@
-#
-# Copyright (c) 2005-2008 Analog Device Inc.
-#
-# (C) Copyright 2001
-# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
-#
-# SPDX-License-Identifier:	GPL-2.0+
-#
-
-# FIX ME
-ifneq ($(filter lib lib/lzma lib/zlib, $(obj)),)
-ccflags-y := -O2
-endif

+ 0 - 13
board/bf527-ad7160-eval/config.mk

@@ -1,13 +0,0 @@
-#
-# Copyright (c) 2005-2008 Analog Device Inc.
-#
-# (C) Copyright 2001
-# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
-#
-# SPDX-License-Identifier:	GPL-2.0+
-#
-
-# FIX ME
-ifneq ($(filter lib lib/lzma lib/zlib, $(obj)),)
-ccflags-y := -O2
-endif

+ 0 - 13
board/bf527-ezkit/config.mk

@@ -1,13 +0,0 @@
-#
-# Copyright (c) 2005-2008 Analog Device Inc.
-#
-# (C) Copyright 2001
-# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
-#
-# SPDX-License-Identifier:	GPL-2.0+
-#
-
-# FIX ME
-ifneq ($(filter lib lib/lzma lib/zlib, $(obj)),)
-ccflags-y := -O2
-endif

+ 0 - 5
board/bf527-sdp/config.mk

@@ -7,10 +7,5 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-# FIX ME
-ifneq ($(filter lib lib/lzma lib/zlib, $(obj)),)
-ccflags-y := -O2
-endif
-
 # Set some default LDR flags based on boot mode.
 LDR_FLAGS-BFIN_BOOT_PARA := --bits 16 --dma 6

+ 0 - 5
board/bf533-ezkit/config.mk

@@ -7,10 +7,5 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-# FIX ME
-ifneq ($(filter lib lib/lzma lib/zlib, $(obj)),)
-ccflags-y := -O2
-endif
-
 # Set some default LDR flags based on boot mode.
 LDR_FLAGS-BFIN_BOOT_PARA := --bits 16 --dma 8

+ 0 - 5
board/bf533-stamp/config.mk

@@ -7,10 +7,5 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-# FIX ME
-ifneq ($(filter lib lib/lzma lib/zlib, $(obj)),)
-ccflags-y := -O2
-endif
-
 # Set some default LDR flags based on boot mode.
 LDR_FLAGS-BFIN_BOOT_PARA := --bits 16 --dma 8

+ 0 - 5
board/bf537-stamp/config.mk

@@ -7,11 +7,6 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-# FIX ME
-ifneq ($(filter lib lib/lzma lib/zlib, $(obj)),)
-ccflags-y := -O2
-endif
-
 # Set some default LDR flags based on boot mode.
 LDR_FLAGS-BFIN_BOOT_PARA := --bits 16 --dma 8
 LDR_FLAGS-BFIN_BOOT_UART := --port g --gpio 6

+ 0 - 5
board/bf538f-ezkit/config.mk

@@ -7,10 +7,5 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-# FIX ME
-ifneq ($(filter lib lib/lzma lib/zlib, $(obj)),)
-ccflags-y := -O2
-endif
-
 # Set some default LDR flags based on boot mode.
 LDR_FLAGS-BFIN_BOOT_PARA := --bits 16 --dma 8

+ 0 - 5
board/bf548-ezkit/config.mk

@@ -7,11 +7,6 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-# FIX ME
-ifneq ($(filter lib lib/lzma lib/zlib, $(obj)),)
-ccflags-y := -O2
-endif
-
 # Set some default LDR flags based on boot mode.
 LDR_FLAGS-BFIN_BOOT_PARA       := --dma 6
 LDR_FLAGS-BFIN_BOOT_FIFO       := --dma 1

+ 0 - 5
board/bf561-acvilon/config.mk

@@ -7,10 +7,5 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-# FIX ME
-ifneq ($(filter lib lib/lzma lib/zlib, $(obj)),)
-ccflags-y := -O2
-endif
-
 # Set some default LDR flags based on boot mode.
 LDR_FLAGS-BFIN_BOOT_PARA := --bits 16

+ 0 - 5
board/bf561-ezkit/config.mk

@@ -7,10 +7,5 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-# FIX ME
-ifneq ($(filter lib lib/lzma lib/zlib, $(obj)),)
-ccflags-y := -O2
-endif
-
 # Set some default LDR flags based on boot mode.
 LDR_FLAGS-BFIN_BOOT_PARA := --bits 16

+ 0 - 15
board/br4/config.mk

@@ -1,15 +0,0 @@
-#
-# Copyright (c) Switchfin Org. <dpn@switchfin.org>
-#
-# Copyright (c) 2005-2008 Analog Device Inc.
-#
-# (C) Copyright 2001
-# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
-#
-# SPDX-License-Identifier:	GPL-2.0+
-#
-
-# FIX ME
-ifneq ($(filter lib lib/lzma lib/zlib, $(obj)),)
-ccflags-y := -O2
-endif

+ 0 - 13
board/cm-bf527/config.mk

@@ -1,13 +0,0 @@
-#
-# Copyright (c) 2005-2008 Analog Device Inc.
-#
-# (C) Copyright 2001
-# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
-#
-# SPDX-License-Identifier:	GPL-2.0+
-#
-
-# FIX ME
-ifneq ($(filter lib lib/lzma lib/zlib, $(obj)),)
-ccflags-y := -O2
-endif

+ 0 - 5
board/cm-bf533/config.mk

@@ -7,10 +7,5 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-# FIX ME
-ifneq ($(filter lib lib/lzma lib/zlib, $(obj)),)
-ccflags-y := -O2
-endif
-
 # Set some default LDR flags based on boot mode.
 LDR_FLAGS-BFIN_BOOT_PARA := --bits 16 --dma 8

+ 0 - 5
board/cm-bf537e/config.mk

@@ -7,10 +7,5 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-# FIX ME
-ifneq ($(filter lib lib/lzma lib/zlib, $(obj)),)
-ccflags-y := -O2
-endif
-
 # Set some default LDR flags based on boot mode.
 LDR_FLAGS-BFIN_BOOT_PARA := --bits 16 --dma 8

+ 0 - 5
board/cm-bf537u/config.mk

@@ -7,10 +7,5 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-# FIX ME
-ifneq ($(filter lib lib/lzma lib/zlib, $(obj)),)
-ccflags-y := -O2
-endif
-
 # Set some default LDR flags based on boot mode.
 LDR_FLAGS-BFIN_BOOT_PARA := --bits 16 --dma 8

+ 0 - 5
board/cm-bf548/config.mk

@@ -7,11 +7,6 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-# FIX ME
-ifneq ($(filter lib lib/lzma lib/zlib, $(obj)),)
-ccflags-y := -O2
-endif
-
 # Set some default LDR flags based on boot mode.
 LDR_FLAGS-BFIN_BOOT_PARA       := --dma 6
 LDR_FLAGS-BFIN_BOOT_FIFO       := --dma 1

+ 0 - 5
board/cm-bf561/config.mk

@@ -7,10 +7,5 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-# FIX ME
-ifneq ($(filter lib lib/lzma lib/zlib, $(obj)),)
-ccflags-y := -O2
-endif
-
 # Set some default LDR flags based on boot mode.
 LDR_FLAGS-BFIN_BOOT_PARA := --bits 16

+ 0 - 5
board/ip04/config.mk

@@ -7,11 +7,6 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-# FIX ME
-ifneq ($(filter lib lib/lzma lib/zlib, $(obj)),)
-ccflags-y := -O2
-endif
-
 # Set some default LDR flags based on boot mode.
 LDR_FLAGS-BFIN_BOOT_PARA := --bits 16 --dma 8
 LDR_FLAGS-BFIN_BOOT_UART := --port g --gpio 6

+ 0 - 15
board/pr1/config.mk

@@ -1,15 +0,0 @@
-#
-# Copyright (c) Switchfin Org. <dpn@switchfin.org>
-#
-# Copyright (c) 2005-2008 Analog Device Inc.
-#
-# (C) Copyright 2001
-# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
-#
-# SPDX-License-Identifier:	GPL-2.0+
-#
-
-# FIX ME
-ifneq ($(filter lib lib/lzma lib/zlib, $(obj)),)
-ccflags-y := -O2
-endif

+ 0 - 13
board/tcm-bf518/config.mk

@@ -1,13 +0,0 @@
-#
-# Copyright (c) 2005-2008 Analog Device Inc.
-#
-# (C) Copyright 2001
-# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
-#
-# SPDX-License-Identifier:	GPL-2.0+
-#
-
-# FIX ME
-ifneq ($(filter lib lib/lzma lib/zlib, $(obj)),)
-ccflags-y := -O2
-endif

+ 0 - 5
board/tcm-bf537/config.mk

@@ -7,10 +7,5 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-# FIX ME
-ifneq ($(filter lib lib/lzma lib/zlib, $(obj)),)
-ccflags-y := -O2
-endif
-
 # Set some default LDR flags based on boot mode.
 LDR_FLAGS-BFIN_BOOT_PARA := --bits 16 --dma 8

+ 1 - 1
include/configs/bct-brettl2.h

@@ -136,7 +136,7 @@
 #define CONFIG_MTD_DEVICE
 #define CONFIG_MTD_PARTITIONS
 #define CONFIG_SYS_HUSH_PARSER
-
+#define CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED
 
 /*
  * Pull in common ADI header for remaining command/environment setup

+ 1 - 1
include/configs/bf518f-ezbrd.h

@@ -155,7 +155,7 @@
 #define CONFIG_MISC_INIT_R
 #define CONFIG_RTC_BFIN
 #define CONFIG_UART_CONSOLE	0
-
+#define CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED
 
 /*
  * Pull in common ADI header for remaining command/environment setup

+ 1 - 0
include/configs/bf526-ezbrd.h

@@ -153,6 +153,7 @@
 #define CONFIG_MISC_INIT_R
 #define CONFIG_RTC_BFIN
 #define CONFIG_UART_CONSOLE	1
+#define CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED
 
 /* define to enable run status via led */
 /* #define CONFIG_STATUS_LED */

+ 1 - 1
include/configs/bf527-ad7160-eval.h

@@ -136,7 +136,7 @@
  */
 #define CONFIG_MISC_INIT_R
 #define CONFIG_UART_CONSOLE	0
-
+#define CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED
 
 /*
  * Pull in common ADI header for remaining command/environment setup

+ 1 - 1
include/configs/bf527-ezkit.h

@@ -179,7 +179,7 @@
 #define CONFIG_MISC_INIT_R
 #define CONFIG_RTC_BFIN
 #define CONFIG_UART_CONSOLE	1
-
+#define CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED
 
 /*
  * Pull in common ADI header for remaining command/environment setup

+ 1 - 1
include/configs/bf527-sdp.h

@@ -112,7 +112,7 @@
  */
 #define CONFIG_MISC_INIT_R
 #define CONFIG_UART_CONSOLE	0
-
+#define CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED
 
 /*
  * Pull in common ADI header for remaining command/environment setup

+ 1 - 1
include/configs/bf533-ezkit.h

@@ -110,7 +110,7 @@
 #define CONFIG_MISC_INIT_R
 #define CONFIG_RTC_BFIN
 #define CONFIG_UART_CONSOLE	0
-
+#define CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED
 
 /*
  * Pull in common ADI header for remaining command/environment setup

+ 1 - 0
include/configs/bf533-stamp.h

@@ -185,6 +185,7 @@
  */
 #define CONFIG_RTC_BFIN
 #define CONFIG_UART_CONSOLE	0
+#define CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED
 
 /* FLASH/ETHERNET uses the same async bank */
 #define SHARED_RESOURCES 	1

+ 1 - 0
include/configs/bf537-stamp.h

@@ -254,6 +254,7 @@
 #define CONFIG_MISC_INIT_R
 #define CONFIG_RTC_BFIN
 #define CONFIG_UART_CONSOLE	0
+#define CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED
 
 /* Define if want to do post memory test */
 #undef CONFIG_POST

+ 1 - 1
include/configs/bf538f-ezkit.h

@@ -134,7 +134,7 @@
  */
 #define CONFIG_RTC_BFIN
 #define CONFIG_UART_CONSOLE	0
-
+#define CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED
 
 /*
  * Pull in common ADI header for remaining command/environment setup

+ 1 - 0
include/configs/bf548-ezkit.h

@@ -181,6 +181,7 @@
 #define CONFIG_RTC_BFIN
 #define CONFIG_UART_CONSOLE	1
 #define CONFIG_BFIN_SPI_IMG_SIZE 0x50000
+#define CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED
 
 #define CONFIG_ADI_GPIO2
 

+ 1 - 1
include/configs/bf561-acvilon.h

@@ -160,7 +160,7 @@
 #define CONFIG_UART_CONSOLE			0
 #define CONFIG_BAUDRATE				57600
 #define CONFIG_SYS_PROMPT "Acvilon> "
-
+#define CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED
 
 /*
  * Pull in common ADI header for remaining command/environment setup

+ 1 - 0
include/configs/bf561-ezkit.h

@@ -102,6 +102,7 @@
  * Misc Settings
  */
 #define CONFIG_UART_CONSOLE	0
+#define CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED
 
 /*
  * Run core 1 from L1 SRAM start address when init uboot on core 0

+ 1 - 1
include/configs/br4.h

@@ -135,7 +135,7 @@
 #define CONFIG_BOOTCOMMAND	"run nandboot"
 #define CONFIG_BOOTDELAY	2
 #define CONFIG_LOADADDR		0x2000000
-
+#define CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED
 
 /*
  * Pull in common ADI header for remaining command/environment setup

+ 1 - 1
include/configs/cm-bf527.h

@@ -128,7 +128,7 @@
 #define FLASHBOOT_ENV_SETTINGS \
 	"flashboot=flread 20040000 1000000 300000;" \
 	"bootm 0x1000000\0"
-
+#define CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED
 
 /*
  * Pull in common ADI header for remaining command/environment setup

+ 1 - 1
include/configs/cm-bf533.h

@@ -97,7 +97,7 @@
 #define CONFIG_UART_CONSOLE	0
 #define CONFIG_BOOTCOMMAND	"run flashboot"
 #define FLASHBOOT_ENV_SETTINGS	"flashboot=bootm 0x20040000\0"
-
+#define CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED
 
 /*
  * Pull in common ADI header for remaining command/environment setup

+ 1 - 0
include/configs/cm-bf537e.h

@@ -146,6 +146,7 @@
 	"flashboot=flread 20040000 1000000 3c0000;" \
 	"bootm 0x1000000\0"
 #define CONFIG_BOARD_SIZE_LIMIT $$((384 * 1024))
+#define CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED
 
 /*
  * Pull in common ADI header for remaining command/environment setup

+ 1 - 1
include/configs/cm-bf537u.h

@@ -143,7 +143,7 @@
 	"flashboot=flread 20040000 1000000 300000;" \
 	"bootm 0x1000000\0"
 #define CONFIG_BOARD_SIZE_LIMIT $$((384 * 1024))
-
+#define CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED
 
 /*
  * Pull in common ADI header for remaining command/environment setup

+ 1 - 0
include/configs/cm-bf548.h

@@ -117,6 +117,7 @@
 #define CONFIG_UART_CONSOLE	1
 #define CONFIG_BOOTCOMMAND	"run flashboot"
 #define FLASHBOOT_ENV_SETTINGS	"flashboot=bootm 0x20040000\0"
+#define CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED
 
 #define CONFIG_ADI_GPIO2
 

+ 1 - 1
include/configs/cm-bf561.h

@@ -99,7 +99,7 @@
 #define CONFIG_UART_CONSOLE	0
 #define CONFIG_BOOTCOMMAND	"run flashboot"
 #define FLASHBOOT_ENV_SETTINGS	"flashboot=bootm 0x20040000\0"
-
+#define CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED
 
 /*
  * Pull in common ADI header for remaining command/environment setup

+ 1 - 0
include/configs/ip04.h

@@ -132,6 +132,7 @@
 #define CONFIG_BAUDRATE		115200
 #define CONFIG_MISC_INIT_R	/* needed for MAC address */
 #define CONFIG_UART_CONSOLE	0
+#define CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED
 
 #undef CONFIG_SHOW_BOOT_PROGRESS
 /* Enable this if bootretry required; currently it's disabled */

+ 1 - 1
include/configs/pr1.h

@@ -135,7 +135,7 @@
 #define CONFIG_BOOTCOMMAND	"run nandboot"
 #define CONFIG_BOOTDELAY	2
 #define CONFIG_LOADADDR		0x2000000
-
+#define CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED
 
 /*
  * Pull in common ADI header for remaining command/environment setup

+ 1 - 1
include/configs/tcm-bf518.h

@@ -116,7 +116,7 @@
 #define CONFIG_UART_CONSOLE	0
 #define CONFIG_BOOTCOMMAND	"run flashboot"
 #define FLASHBOOT_ENV_SETTINGS	"flashboot=bootm 0x20040000\0"
-
+#define CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED
 
 /*
  * Pull in common ADI header for remaining command/environment setup

+ 1 - 1
include/configs/tcm-bf537.h

@@ -145,7 +145,7 @@
 	"flashboot=flread 20040000 1000000 300000;" \
 	"bootm 0x1000000\0"
 #define CONFIG_BOARD_SIZE_LIMIT $$((384 * 1024))
-
+#define CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED
 
 /*
  * Pull in common ADI header for remaining command/environment setup

+ 2 - 0
lib/Makefile

@@ -65,3 +65,5 @@ obj-y += vsprintf.o
 obj-$(CONFIG_RANDOM_MACADDR) += rand.o
 obj-$(CONFIG_BOOTP_RANDOM_DELAY) += rand.o
 obj-$(CONFIG_CMD_LINK_LOCAL) += rand.o
+
+subdir-ccflags-$(CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED) += -O2