diff options
-rw-r--r-- | arch/powerpc/Makefile | 25 | ||||
-rw-r--r-- | arch/powerpc/platforms/Kconfig.cputype | 30 |
2 files changed, 42 insertions, 13 deletions
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile index 6ee3beb4d264..159e94f4b22a 100644 --- a/arch/powerpc/Makefile +++ b/arch/powerpc/Makefile | |||
@@ -69,6 +69,16 @@ LDFLAGS_vmlinux := $(LDFLAGS_vmlinux-y) | |||
69 | 69 | ||
70 | CFLAGS-$(CONFIG_PPC64) := -mminimal-toc -mtraceback=no -mcall-aixdesc | 70 | CFLAGS-$(CONFIG_PPC64) := -mminimal-toc -mtraceback=no -mcall-aixdesc |
71 | CFLAGS-$(CONFIG_PPC32) := -ffixed-r2 -mmultiple | 71 | CFLAGS-$(CONFIG_PPC32) := -ffixed-r2 -mmultiple |
72 | |||
73 | CFLAGS-$(CONFIG_GENERIC_CPU) += $(call cc-option,-mtune=power7,-mtune=power4) | ||
74 | CFLAGS-$(CONFIG_CELL_CPU) += $(call cc-option,-mcpu=cell) | ||
75 | CFLAGS-$(CONFIG_POWER4_CPU) += $(call cc-option,-mcpu=power4) | ||
76 | CFLAGS-$(CONFIG_POWER5_CPU) += $(call cc-option,-mcpu=power5) | ||
77 | CFLAGS-$(CONFIG_POWER6_CPU) += $(call cc-option,-mcpu=power6) | ||
78 | CFLAGS-$(CONFIG_POWER7_CPU) += $(call cc-option,-mcpu=power7) | ||
79 | |||
80 | CFLAGS-$(CONFIG_TUNE_CELL) += $(call cc-option,-mtune=cell) | ||
81 | |||
72 | KBUILD_CPPFLAGS += -Iarch/$(ARCH) | 82 | KBUILD_CPPFLAGS += -Iarch/$(ARCH) |
73 | KBUILD_AFLAGS += -Iarch/$(ARCH) | 83 | KBUILD_AFLAGS += -Iarch/$(ARCH) |
74 | KBUILD_CFLAGS += -msoft-float -pipe -Iarch/$(ARCH) $(CFLAGS-y) | 84 | KBUILD_CFLAGS += -msoft-float -pipe -Iarch/$(ARCH) $(CFLAGS-y) |
@@ -76,22 +86,11 @@ CPP = $(CC) -E $(KBUILD_CFLAGS) | |||
76 | 86 | ||
77 | CHECKFLAGS += -m$(CONFIG_WORD_SIZE) -D__powerpc__ -D__powerpc$(CONFIG_WORD_SIZE)__ | 87 | CHECKFLAGS += -m$(CONFIG_WORD_SIZE) -D__powerpc__ -D__powerpc$(CONFIG_WORD_SIZE)__ |
78 | 88 | ||
79 | ifeq ($(CONFIG_PPC64),y) | ||
80 | ifeq ($(CONFIG_POWER4_ONLY),y) | ||
81 | KBUILD_CFLAGS += $(call cc-option,-mcpu=power4) | ||
82 | else | ||
83 | KBUILD_CFLAGS += $(call cc-option,-mtune=power4) | ||
84 | endif | ||
85 | endif | ||
86 | |||
87 | KBUILD_LDFLAGS_MODULE += arch/powerpc/lib/crtsavres.o | 89 | KBUILD_LDFLAGS_MODULE += arch/powerpc/lib/crtsavres.o |
88 | 90 | ||
89 | ifeq ($(CONFIG_TUNE_CELL),y) | 91 | # No AltiVec or VSX instructions when building kernel |
90 | KBUILD_CFLAGS += $(call cc-option,-mtune=cell) | ||
91 | endif | ||
92 | |||
93 | # No AltiVec instruction when building kernel | ||
94 | KBUILD_CFLAGS += $(call cc-option,-mno-altivec) | 92 | KBUILD_CFLAGS += $(call cc-option,-mno-altivec) |
93 | KBUILD_CFLAGS += $(call cc-option,-mno-vsx) | ||
95 | 94 | ||
96 | # No SPE instruction when building kernel | 95 | # No SPE instruction when building kernel |
97 | # (We use all available options to help semi-broken compilers) | 96 | # (We use all available options to help semi-broken compilers) |
diff --git a/arch/powerpc/platforms/Kconfig.cputype b/arch/powerpc/platforms/Kconfig.cputype index 52e70f9b7a8f..0b7314592134 100644 --- a/arch/powerpc/platforms/Kconfig.cputype +++ b/arch/powerpc/platforms/Kconfig.cputype | |||
@@ -78,6 +78,36 @@ config PPC_BOOK3E_64 | |||
78 | 78 | ||
79 | endchoice | 79 | endchoice |
80 | 80 | ||
81 | choice | ||
82 | prompt "CPU selection" | ||
83 | depends on PPC64 | ||
84 | default GENERIC_CPU | ||
85 | help | ||
86 | This will create a kernel which is optimised for a particular CPU. | ||
87 | The resulting kernel may not run on other CPUs, so use this with care. | ||
88 | |||
89 | If unsure, select Generic. | ||
90 | |||
91 | config GENERIC_CPU | ||
92 | bool "Generic" | ||
93 | |||
94 | config CELL_CPU | ||
95 | bool "Cell Broadband Engine" | ||
96 | |||
97 | config POWER4_CPU | ||
98 | bool "POWER4" | ||
99 | |||
100 | config POWER5_CPU | ||
101 | bool "POWER5" | ||
102 | |||
103 | config POWER6_CPU | ||
104 | bool "POWER6" | ||
105 | |||
106 | config POWER7_CPU | ||
107 | bool "POWER7" | ||
108 | |||
109 | endchoice | ||
110 | |||
81 | config PPC_BOOK3S | 111 | config PPC_BOOK3S |
82 | def_bool y | 112 | def_bool y |
83 | depends on PPC_BOOK3S_32 || PPC_BOOK3S_64 | 113 | depends on PPC_BOOK3S_32 || PPC_BOOK3S_64 |