Skip to content

Commit 5083272

Browse files
committed
powerpc/64s: Move CPU -mtune options into Kconfig
Currently the -mtune options are set in the Makefile, depending on what the compiler supports. One downside of doing it that way is that the chosen -mtune option is not recorded in the .config. Another downside is that if there's ever a need to do more complicated logic to calculate the correct option, that gets messy in the Makefile. So move the determination of which -mtune option to use into Kconfig logic. Signed-off-by: Michael Ellerman <[email protected]> Link: https://msgid.link/[email protected]
1 parent 1eafbd8 commit 5083272

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

arch/powerpc/Makefile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,7 @@ endif
157157
CFLAGS-$(CONFIG_TARGET_CPU_BOOL) += -mcpu=$(CONFIG_TARGET_CPU)
158158
AFLAGS-$(CONFIG_TARGET_CPU_BOOL) += -mcpu=$(CONFIG_TARGET_CPU)
159159

160-
CFLAGS-$(CONFIG_POWERPC64_CPU) += $(call cc-option,-mtune=power10, \
161-
$(call cc-option,-mtune=power9, \
162-
$(call cc-option,-mtune=power8)))
160+
CFLAGS-y += $(CONFIG_TUNE_CPU)
163161

164162
asinstr := $(call as-instr,lis 9$(comma)foo@high,-DHAVE_AS_ATHIGH=1)
165163

arch/powerpc/platforms/Kconfig.cputype

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,13 @@ config TARGET_CPU
275275
default "e500mc" if E500MC_CPU
276276
default "powerpc" if POWERPC_CPU
277277

278+
config TUNE_CPU
279+
string
280+
depends on POWERPC64_CPU
281+
default "-mtune=power10" if $(cc-option,-mtune=power10)
282+
default "-mtune=power9" if $(cc-option,-mtune=power9)
283+
default "-mtune=power8" if $(cc-option,-mtune=power8)
284+
278285
config PPC_BOOK3S
279286
def_bool y
280287
depends on PPC_BOOK3S_32 || PPC_BOOK3S_64

0 commit comments

Comments
 (0)