Commit e91df49fbb56858003ebe61191ae07b223a7b866

Authored by Masahiro Yamada
Committed by Tom Rini
1 parent 3775dcd9c4

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>

Showing 49 changed files with 26 additions and 212 deletions Side-by-side Diff

board/bct-brettl2/config.mk
1   -#
2   -# Copyright (c) 2005-2008 Analog Device Inc.
3   -#
4   -# (C) Copyright 2001
5   -# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
6   -#
7   -# SPDX-License-Identifier: GPL-2.0+
8   -#
9   -
10   -# FIX ME
11   -ifneq ($(filter lib lib/lzma lib/zlib, $(obj)),)
12   -ccflags-y := -O2
13   -endif
board/bf518f-ezbrd/config.mk
1   -#
2   -# Copyright (c) 2005-2008 Analog Device Inc.
3   -#
4   -# (C) Copyright 2001
5   -# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
6   -#
7   -# SPDX-License-Identifier: GPL-2.0+
8   -#
9   -
10   -# FIX ME
11   -ifneq ($(filter lib lib/lzma lib/zlib, $(obj)),)
12   -ccflags-y := -O2
13   -endif
board/bf526-ezbrd/config.mk
1   -#
2   -# Copyright (c) 2005-2008 Analog Device Inc.
3   -#
4   -# (C) Copyright 2001
5   -# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
6   -#
7   -# SPDX-License-Identifier: GPL-2.0+
8   -#
9   -
10   -# FIX ME
11   -ifneq ($(filter lib lib/lzma lib/zlib, $(obj)),)
12   -ccflags-y := -O2
13   -endif
board/bf527-ad7160-eval/config.mk
1   -#
2   -# Copyright (c) 2005-2008 Analog Device Inc.
3   -#
4   -# (C) Copyright 2001
5   -# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
6   -#
7   -# SPDX-License-Identifier: GPL-2.0+
8   -#
9   -
10   -# FIX ME
11   -ifneq ($(filter lib lib/lzma lib/zlib, $(obj)),)
12   -ccflags-y := -O2
13   -endif
board/bf527-ezkit/config.mk
1   -#
2   -# Copyright (c) 2005-2008 Analog Device Inc.
3   -#
4   -# (C) Copyright 2001
5   -# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
6   -#
7   -# SPDX-License-Identifier: GPL-2.0+
8   -#
9   -
10   -# FIX ME
11   -ifneq ($(filter lib lib/lzma lib/zlib, $(obj)),)
12   -ccflags-y := -O2
13   -endif
board/bf527-sdp/config.mk
... ... @@ -7,11 +7,6 @@
7 7 # SPDX-License-Identifier: GPL-2.0+
8 8 #
9 9  
10   -# FIX ME
11   -ifneq ($(filter lib lib/lzma lib/zlib, $(obj)),)
12   -ccflags-y := -O2
13   -endif
14   -
15 10 # Set some default LDR flags based on boot mode.
16 11 LDR_FLAGS-BFIN_BOOT_PARA := --bits 16 --dma 6
board/bf533-ezkit/config.mk
... ... @@ -7,11 +7,6 @@
7 7 # SPDX-License-Identifier: GPL-2.0+
8 8 #
9 9  
10   -# FIX ME
11   -ifneq ($(filter lib lib/lzma lib/zlib, $(obj)),)
12   -ccflags-y := -O2
13   -endif
14   -
15 10 # Set some default LDR flags based on boot mode.
16 11 LDR_FLAGS-BFIN_BOOT_PARA := --bits 16 --dma 8
board/bf533-stamp/config.mk
... ... @@ -7,11 +7,6 @@
7 7 # SPDX-License-Identifier: GPL-2.0+
8 8 #
9 9  
10   -# FIX ME
11   -ifneq ($(filter lib lib/lzma lib/zlib, $(obj)),)
12   -ccflags-y := -O2
13   -endif
14   -
15 10 # Set some default LDR flags based on boot mode.
16 11 LDR_FLAGS-BFIN_BOOT_PARA := --bits 16 --dma 8
board/bf537-stamp/config.mk
... ... @@ -7,11 +7,6 @@
7 7 # SPDX-License-Identifier: GPL-2.0+
8 8 #
9 9  
10   -# FIX ME
11   -ifneq ($(filter lib lib/lzma lib/zlib, $(obj)),)
12   -ccflags-y := -O2
13   -endif
14   -
15 10 # Set some default LDR flags based on boot mode.
16 11 LDR_FLAGS-BFIN_BOOT_PARA := --bits 16 --dma 8
17 12 LDR_FLAGS-BFIN_BOOT_UART := --port g --gpio 6
board/bf538f-ezkit/config.mk
... ... @@ -7,11 +7,6 @@
7 7 # SPDX-License-Identifier: GPL-2.0+
8 8 #
9 9  
10   -# FIX ME
11   -ifneq ($(filter lib lib/lzma lib/zlib, $(obj)),)
12   -ccflags-y := -O2
13   -endif
14   -
15 10 # Set some default LDR flags based on boot mode.
16 11 LDR_FLAGS-BFIN_BOOT_PARA := --bits 16 --dma 8
board/bf548-ezkit/config.mk
... ... @@ -7,11 +7,6 @@
7 7 # SPDX-License-Identifier: GPL-2.0+
8 8 #
9 9  
10   -# FIX ME
11   -ifneq ($(filter lib lib/lzma lib/zlib, $(obj)),)
12   -ccflags-y := -O2
13   -endif
14   -
15 10 # Set some default LDR flags based on boot mode.
16 11 LDR_FLAGS-BFIN_BOOT_PARA := --dma 6
17 12 LDR_FLAGS-BFIN_BOOT_FIFO := --dma 1
board/bf561-acvilon/config.mk
... ... @@ -7,11 +7,6 @@
7 7 # SPDX-License-Identifier: GPL-2.0+
8 8 #
9 9  
10   -# FIX ME
11   -ifneq ($(filter lib lib/lzma lib/zlib, $(obj)),)
12   -ccflags-y := -O2
13   -endif
14   -
15 10 # Set some default LDR flags based on boot mode.
16 11 LDR_FLAGS-BFIN_BOOT_PARA := --bits 16
board/bf561-ezkit/config.mk
... ... @@ -7,11 +7,6 @@
7 7 # SPDX-License-Identifier: GPL-2.0+
8 8 #
9 9  
10   -# FIX ME
11   -ifneq ($(filter lib lib/lzma lib/zlib, $(obj)),)
12   -ccflags-y := -O2
13   -endif
14   -
15 10 # Set some default LDR flags based on boot mode.
16 11 LDR_FLAGS-BFIN_BOOT_PARA := --bits 16
board/br4/config.mk
1   -#
2   -# Copyright (c) Switchfin Org. <dpn@switchfin.org>
3   -#
4   -# Copyright (c) 2005-2008 Analog Device Inc.
5   -#
6   -# (C) Copyright 2001
7   -# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
8   -#
9   -# SPDX-License-Identifier: GPL-2.0+
10   -#
11   -
12   -# FIX ME
13   -ifneq ($(filter lib lib/lzma lib/zlib, $(obj)),)
14   -ccflags-y := -O2
15   -endif
board/cm-bf527/config.mk
1   -#
2   -# Copyright (c) 2005-2008 Analog Device Inc.
3   -#
4   -# (C) Copyright 2001
5   -# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
6   -#
7   -# SPDX-License-Identifier: GPL-2.0+
8   -#
9   -
10   -# FIX ME
11   -ifneq ($(filter lib lib/lzma lib/zlib, $(obj)),)
12   -ccflags-y := -O2
13   -endif
board/cm-bf533/config.mk
... ... @@ -7,11 +7,6 @@
7 7 # SPDX-License-Identifier: GPL-2.0+
8 8 #
9 9  
10   -# FIX ME
11   -ifneq ($(filter lib lib/lzma lib/zlib, $(obj)),)
12   -ccflags-y := -O2
13   -endif
14   -
15 10 # Set some default LDR flags based on boot mode.
16 11 LDR_FLAGS-BFIN_BOOT_PARA := --bits 16 --dma 8
board/cm-bf537e/config.mk
... ... @@ -7,11 +7,6 @@
7 7 # SPDX-License-Identifier: GPL-2.0+
8 8 #
9 9  
10   -# FIX ME
11   -ifneq ($(filter lib lib/lzma lib/zlib, $(obj)),)
12   -ccflags-y := -O2
13   -endif
14   -
15 10 # Set some default LDR flags based on boot mode.
16 11 LDR_FLAGS-BFIN_BOOT_PARA := --bits 16 --dma 8
board/cm-bf537u/config.mk
... ... @@ -7,11 +7,6 @@
7 7 # SPDX-License-Identifier: GPL-2.0+
8 8 #
9 9  
10   -# FIX ME
11   -ifneq ($(filter lib lib/lzma lib/zlib, $(obj)),)
12   -ccflags-y := -O2
13   -endif
14   -
15 10 # Set some default LDR flags based on boot mode.
16 11 LDR_FLAGS-BFIN_BOOT_PARA := --bits 16 --dma 8
board/cm-bf548/config.mk
... ... @@ -7,11 +7,6 @@
7 7 # SPDX-License-Identifier: GPL-2.0+
8 8 #
9 9  
10   -# FIX ME
11   -ifneq ($(filter lib lib/lzma lib/zlib, $(obj)),)
12   -ccflags-y := -O2
13   -endif
14   -
15 10 # Set some default LDR flags based on boot mode.
16 11 LDR_FLAGS-BFIN_BOOT_PARA := --dma 6
17 12 LDR_FLAGS-BFIN_BOOT_FIFO := --dma 1
board/cm-bf561/config.mk
... ... @@ -7,11 +7,6 @@
7 7 # SPDX-License-Identifier: GPL-2.0+
8 8 #
9 9  
10   -# FIX ME
11   -ifneq ($(filter lib lib/lzma lib/zlib, $(obj)),)
12   -ccflags-y := -O2
13   -endif
14   -
15 10 # Set some default LDR flags based on boot mode.
16 11 LDR_FLAGS-BFIN_BOOT_PARA := --bits 16
board/ip04/config.mk
... ... @@ -7,11 +7,6 @@
7 7 # SPDX-License-Identifier: GPL-2.0+
8 8 #
9 9  
10   -# FIX ME
11   -ifneq ($(filter lib lib/lzma lib/zlib, $(obj)),)
12   -ccflags-y := -O2
13   -endif
14   -
15 10 # Set some default LDR flags based on boot mode.
16 11 LDR_FLAGS-BFIN_BOOT_PARA := --bits 16 --dma 8
17 12 LDR_FLAGS-BFIN_BOOT_UART := --port g --gpio 6
board/pr1/config.mk
1   -#
2   -# Copyright (c) Switchfin Org. <dpn@switchfin.org>
3   -#
4   -# Copyright (c) 2005-2008 Analog Device Inc.
5   -#
6   -# (C) Copyright 2001
7   -# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
8   -#
9   -# SPDX-License-Identifier: GPL-2.0+
10   -#
11   -
12   -# FIX ME
13   -ifneq ($(filter lib lib/lzma lib/zlib, $(obj)),)
14   -ccflags-y := -O2
15   -endif
board/tcm-bf518/config.mk
1   -#
2   -# Copyright (c) 2005-2008 Analog Device Inc.
3   -#
4   -# (C) Copyright 2001
5   -# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
6   -#
7   -# SPDX-License-Identifier: GPL-2.0+
8   -#
9   -
10   -# FIX ME
11   -ifneq ($(filter lib lib/lzma lib/zlib, $(obj)),)
12   -ccflags-y := -O2
13   -endif
board/tcm-bf537/config.mk
... ... @@ -7,11 +7,6 @@
7 7 # SPDX-License-Identifier: GPL-2.0+
8 8 #
9 9  
10   -# FIX ME
11   -ifneq ($(filter lib lib/lzma lib/zlib, $(obj)),)
12   -ccflags-y := -O2
13   -endif
14   -
15 10 # Set some default LDR flags based on boot mode.
16 11 LDR_FLAGS-BFIN_BOOT_PARA := --bits 16 --dma 8
include/configs/bct-brettl2.h
... ... @@ -136,7 +136,7 @@
136 136 #define CONFIG_MTD_DEVICE
137 137 #define CONFIG_MTD_PARTITIONS
138 138 #define CONFIG_SYS_HUSH_PARSER
139   -
  139 +#define CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED
140 140  
141 141 /*
142 142 * Pull in common ADI header for remaining command/environment setup
include/configs/bf518f-ezbrd.h
... ... @@ -155,7 +155,7 @@
155 155 #define CONFIG_MISC_INIT_R
156 156 #define CONFIG_RTC_BFIN
157 157 #define CONFIG_UART_CONSOLE 0
158   -
  158 +#define CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED
159 159  
160 160 /*
161 161 * Pull in common ADI header for remaining command/environment setup
include/configs/bf526-ezbrd.h
... ... @@ -153,6 +153,7 @@
153 153 #define CONFIG_MISC_INIT_R
154 154 #define CONFIG_RTC_BFIN
155 155 #define CONFIG_UART_CONSOLE 1
  156 +#define CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED
156 157  
157 158 /* define to enable run status via led */
158 159 /* #define CONFIG_STATUS_LED */
include/configs/bf527-ad7160-eval.h
... ... @@ -136,7 +136,7 @@
136 136 */
137 137 #define CONFIG_MISC_INIT_R
138 138 #define CONFIG_UART_CONSOLE 0
139   -
  139 +#define CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED
140 140  
141 141 /*
142 142 * Pull in common ADI header for remaining command/environment setup
include/configs/bf527-ezkit.h
... ... @@ -179,7 +179,7 @@
179 179 #define CONFIG_MISC_INIT_R
180 180 #define CONFIG_RTC_BFIN
181 181 #define CONFIG_UART_CONSOLE 1
182   -
  182 +#define CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED
183 183  
184 184 /*
185 185 * Pull in common ADI header for remaining command/environment setup
include/configs/bf527-sdp.h
... ... @@ -112,7 +112,7 @@
112 112 */
113 113 #define CONFIG_MISC_INIT_R
114 114 #define CONFIG_UART_CONSOLE 0
115   -
  115 +#define CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED
116 116  
117 117 /*
118 118 * Pull in common ADI header for remaining command/environment setup
include/configs/bf533-ezkit.h
... ... @@ -110,7 +110,7 @@
110 110 #define CONFIG_MISC_INIT_R
111 111 #define CONFIG_RTC_BFIN
112 112 #define CONFIG_UART_CONSOLE 0
113   -
  113 +#define CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED
114 114  
115 115 /*
116 116 * Pull in common ADI header for remaining command/environment setup
include/configs/bf533-stamp.h
... ... @@ -185,6 +185,7 @@
185 185 */
186 186 #define CONFIG_RTC_BFIN
187 187 #define CONFIG_UART_CONSOLE 0
  188 +#define CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED
188 189  
189 190 /* FLASH/ETHERNET uses the same async bank */
190 191 #define SHARED_RESOURCES 1
include/configs/bf537-stamp.h
... ... @@ -254,6 +254,7 @@
254 254 #define CONFIG_MISC_INIT_R
255 255 #define CONFIG_RTC_BFIN
256 256 #define CONFIG_UART_CONSOLE 0
  257 +#define CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED
257 258  
258 259 /* Define if want to do post memory test */
259 260 #undef CONFIG_POST
include/configs/bf538f-ezkit.h
... ... @@ -134,7 +134,7 @@
134 134 */
135 135 #define CONFIG_RTC_BFIN
136 136 #define CONFIG_UART_CONSOLE 0
137   -
  137 +#define CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED
138 138  
139 139 /*
140 140 * Pull in common ADI header for remaining command/environment setup
include/configs/bf548-ezkit.h
... ... @@ -181,6 +181,7 @@
181 181 #define CONFIG_RTC_BFIN
182 182 #define CONFIG_UART_CONSOLE 1
183 183 #define CONFIG_BFIN_SPI_IMG_SIZE 0x50000
  184 +#define CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED
184 185  
185 186 #define CONFIG_ADI_GPIO2
186 187  
include/configs/bf561-acvilon.h
... ... @@ -160,7 +160,7 @@
160 160 #define CONFIG_UART_CONSOLE 0
161 161 #define CONFIG_BAUDRATE 57600
162 162 #define CONFIG_SYS_PROMPT "Acvilon> "
163   -
  163 +#define CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED
164 164  
165 165 /*
166 166 * Pull in common ADI header for remaining command/environment setup
include/configs/bf561-ezkit.h
... ... @@ -102,6 +102,7 @@
102 102 * Misc Settings
103 103 */
104 104 #define CONFIG_UART_CONSOLE 0
  105 +#define CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED
105 106  
106 107 /*
107 108 * Run core 1 from L1 SRAM start address when init uboot on core 0
include/configs/br4.h
... ... @@ -135,7 +135,7 @@
135 135 #define CONFIG_BOOTCOMMAND "run nandboot"
136 136 #define CONFIG_BOOTDELAY 2
137 137 #define CONFIG_LOADADDR 0x2000000
138   -
  138 +#define CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED
139 139  
140 140 /*
141 141 * Pull in common ADI header for remaining command/environment setup
include/configs/cm-bf527.h
... ... @@ -128,7 +128,7 @@
128 128 #define FLASHBOOT_ENV_SETTINGS \
129 129 "flashboot=flread 20040000 1000000 300000;" \
130 130 "bootm 0x1000000\0"
131   -
  131 +#define CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED
132 132  
133 133 /*
134 134 * Pull in common ADI header for remaining command/environment setup
include/configs/cm-bf533.h
... ... @@ -97,7 +97,7 @@
97 97 #define CONFIG_UART_CONSOLE 0
98 98 #define CONFIG_BOOTCOMMAND "run flashboot"
99 99 #define FLASHBOOT_ENV_SETTINGS "flashboot=bootm 0x20040000\0"
100   -
  100 +#define CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED
101 101  
102 102 /*
103 103 * Pull in common ADI header for remaining command/environment setup
include/configs/cm-bf537e.h
... ... @@ -146,6 +146,7 @@
146 146 "flashboot=flread 20040000 1000000 3c0000;" \
147 147 "bootm 0x1000000\0"
148 148 #define CONFIG_BOARD_SIZE_LIMIT $$((384 * 1024))
  149 +#define CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED
149 150  
150 151 /*
151 152 * Pull in common ADI header for remaining command/environment setup
include/configs/cm-bf537u.h
... ... @@ -143,7 +143,7 @@
143 143 "flashboot=flread 20040000 1000000 300000;" \
144 144 "bootm 0x1000000\0"
145 145 #define CONFIG_BOARD_SIZE_LIMIT $$((384 * 1024))
146   -
  146 +#define CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED
147 147  
148 148 /*
149 149 * Pull in common ADI header for remaining command/environment setup
include/configs/cm-bf548.h
... ... @@ -117,6 +117,7 @@
117 117 #define CONFIG_UART_CONSOLE 1
118 118 #define CONFIG_BOOTCOMMAND "run flashboot"
119 119 #define FLASHBOOT_ENV_SETTINGS "flashboot=bootm 0x20040000\0"
  120 +#define CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED
120 121  
121 122 #define CONFIG_ADI_GPIO2
122 123  
include/configs/cm-bf561.h
... ... @@ -99,7 +99,7 @@
99 99 #define CONFIG_UART_CONSOLE 0
100 100 #define CONFIG_BOOTCOMMAND "run flashboot"
101 101 #define FLASHBOOT_ENV_SETTINGS "flashboot=bootm 0x20040000\0"
102   -
  102 +#define CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED
103 103  
104 104 /*
105 105 * Pull in common ADI header for remaining command/environment setup
include/configs/ip04.h
... ... @@ -132,6 +132,7 @@
132 132 #define CONFIG_BAUDRATE 115200
133 133 #define CONFIG_MISC_INIT_R /* needed for MAC address */
134 134 #define CONFIG_UART_CONSOLE 0
  135 +#define CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED
135 136  
136 137 #undef CONFIG_SHOW_BOOT_PROGRESS
137 138 /* Enable this if bootretry required; currently it's disabled */
include/configs/pr1.h
... ... @@ -135,7 +135,7 @@
135 135 #define CONFIG_BOOTCOMMAND "run nandboot"
136 136 #define CONFIG_BOOTDELAY 2
137 137 #define CONFIG_LOADADDR 0x2000000
138   -
  138 +#define CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED
139 139  
140 140 /*
141 141 * Pull in common ADI header for remaining command/environment setup
include/configs/tcm-bf518.h
... ... @@ -116,7 +116,7 @@
116 116 #define CONFIG_UART_CONSOLE 0
117 117 #define CONFIG_BOOTCOMMAND "run flashboot"
118 118 #define FLASHBOOT_ENV_SETTINGS "flashboot=bootm 0x20040000\0"
119   -
  119 +#define CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED
120 120  
121 121 /*
122 122 * Pull in common ADI header for remaining command/environment setup
include/configs/tcm-bf537.h
... ... @@ -145,7 +145,7 @@
145 145 "flashboot=flread 20040000 1000000 300000;" \
146 146 "bootm 0x1000000\0"
147 147 #define CONFIG_BOARD_SIZE_LIMIT $$((384 * 1024))
148   -
  148 +#define CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED
149 149  
150 150 /*
151 151 * Pull in common ADI header for remaining command/environment setup
... ... @@ -65,4 +65,6 @@
65 65 obj-$(CONFIG_RANDOM_MACADDR) += rand.o
66 66 obj-$(CONFIG_BOOTP_RANDOM_DELAY) += rand.o
67 67 obj-$(CONFIG_CMD_LINK_LOCAL) += rand.o
  68 +
  69 +subdir-ccflags-$(CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED) += -O2