From f45e4ffbecd1c059aa49d8a119b50ee84d7f9d0f Mon Sep 17 00:00:00 2001 From: Danny Lin Date: Wed, 31 Jul 2019 22:14:24 -0700 Subject: [PATCH] Makefile: Optimize for sm8150's Kryo 485 CPU setup The big (Gold and Prime) cores are derived from ARM's Cortex-A75 reference design, while the little (Silver) cores are derived from Cortex-A55. Clang doen't support optimizing for two clusters at once, so help the weaker little cluster out a bit by optimizing exclusive for it instead since it needs all the speed it can get. Test: GCC 9.1.0 and Clang 10.0.0svn both compile working kernels Signed-off-by: Danny Lin --- Makefile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Makefile b/Makefile index a9f4cd930054..6c62ec99a704 100644 --- a/Makefile +++ b/Makefile @@ -682,6 +682,12 @@ ifdef CONFIG_PROFILE_ALL_BRANCHES KBUILD_CFLAGS += -O2 $(call cc-disable-warning,maybe-uninitialized,) else KBUILD_CFLAGS += -O2 +ifeq ($(cc-name),gcc) +KBUILD_CFLAGS += -mcpu=cortex-a76.cortex-a55 -mtune=cortex-a76.cortex-a55 +endif +ifeq ($(cc-name),clang) +KBUILD_CFLAGS += -mcpu=cortex-a55 -mtune=cortex-a55 +endif endif endif