Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cc62d20c authored by Christophe Leroy's avatar Christophe Leroy Committed by Michael Ellerman
Browse files

powerpc: Make CPU selection logic generic in Makefile



At the time being, when adding a new CPU for selection, both
Kconfig.cputype and Makefile have to be modified.

This patch moves into Kconfig.cputype the name of the CPU to me
passed to the -mcpu= argument.

Signed-off-by: default avatarChristophe Leroy <christophe.leroy@c-s.fr>
Reviewed-by: default avatarNicholas Piggin <npiggin@gmail.com>
[mpe: Rename the option to TARGET_CPU to echo the gcc documentation]
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent badf436f
Loading
Loading
Loading
Loading
+1 −7
Original line number Original line Diff line number Diff line
@@ -164,13 +164,7 @@ ifdef CONFIG_MPROFILE_KERNEL
	CC_FLAGS_FTRACE := -pg -mprofile-kernel
	CC_FLAGS_FTRACE := -pg -mprofile-kernel
endif
endif


CFLAGS-$(CONFIG_CELL_CPU) += $(call cc-option,-mcpu=cell)
CFLAGS-$(CONFIG_TARGET_CPU_BOOL) += $(call cc-option,-mcpu=$(CONFIG_TARGET_CPU))
CFLAGS-$(CONFIG_POWER5_CPU) += $(call cc-option,-mcpu=power5)
CFLAGS-$(CONFIG_POWER6_CPU) += $(call cc-option,-mcpu=power6)
CFLAGS-$(CONFIG_POWER7_CPU) += $(call cc-option,-mcpu=power7)
CFLAGS-$(CONFIG_POWER8_CPU) += $(call cc-option,-mcpu=power8)
CFLAGS-$(CONFIG_POWER9_CPU) += $(call cc-option,-mcpu=power9)
CFLAGS-$(CONFIG_PPC_8xx) += $(call cc-option,-mcpu=860)


# Altivec option not allowed with e500mc64 in GCC.
# Altivec option not allowed with e500mc64 in GCC.
ifdef CONFIG_ALTIVEC
ifdef CONFIG_ALTIVEC
+15 −0
Original line number Original line Diff line number Diff line
@@ -139,6 +139,21 @@ config E6500_CPU


endchoice
endchoice


config TARGET_CPU_BOOL
	bool
	default !GENERIC_CPU

config TARGET_CPU
	string
	depends on TARGET_CPU_BOOL
	default "cell" if CELL_CPU
	default "power5" if POWER5_CPU
	default "power6" if POWER6_CPU
	default "power7" if POWER7_CPU
	default "power8" if POWER8_CPU
	default "power9" if POWER9_CPU
	default "860" if PPC_8xx

config PPC_BOOK3S
config PPC_BOOK3S
	def_bool y
	def_bool y
	depends on PPC_BOOK3S_32 || PPC_BOOK3S_64
	depends on PPC_BOOK3S_32 || PPC_BOOK3S_64