android_kernel_xiaomi_sm8450/arch/powerpc/platforms
Christophe Leroy 6ed3e280c7 powerpc/32: Don't always pass -mcpu=powerpc to the compiler
[ Upstream commit 446cda1b21d9a6b3697fe399c6a3a00ff4a285f5 ]

Since commit 4bf4f42a2f ("powerpc/kbuild: Set default generic
machine type for 32-bit compile"), when building a 32 bits kernel
with a bi-arch version of GCC, or when building a book3s/32 kernel,
the option -mcpu=powerpc is passed to GCC at all time, relying on it
being eventually overriden by a subsequent -mcpu=xxxx.

But when building the same kernel with a 32 bits only version of GCC,
that is not done, relying on gcc being built with the expected default
CPU.

This logic has two problems. First, it is a bit fragile to rely on
whether the GCC version is bi-arch or not, because today we can have
bi-arch versions of GCC configured with a 32 bits default. Second,
there are some versions of GCC which don't support -mcpu=powerpc,
for instance for e500 SPE-only versions.

So, stop relying on this approximative logic and allow the user to
decide whether he/she wants to use the toolchain's default CPU or if
he/she wants to set one, and allow only possible CPUs based on the
selected target.

Reported-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Tested-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Segher Boessenkool <segher@kernel.crashing.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/d4df724691351531bf46d685d654689e5dfa0d74.1657549153.git.christophe.leroy@csgroup.eu
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-08-25 11:38:20 +02:00
..
4xx powerpc/4xx/cpm: Fix return value of __setup() handler 2022-06-09 10:21:16 +02:00
8xx powerpc/8xx: export 'cpm_setbrg' for modules 2022-06-09 10:21:16 +02:00
40x powerpc: Remove IBM405 Erratum #77 2020-05-28 23:24:36 +10:00
44x powerpc/44x/fsp2: add missing of_node_put 2021-11-18 14:04:21 +01:00
52xx powerpc/52xx: Fix an invalid ASM expression ('addi' used instead of 'add') 2021-05-14 09:50:42 +02:00
82xx powerpc/82xx: Blacklist pq2_restart() for kprobe 2020-06-02 20:59:09 +10:00
83xx powerpc: Use simple i2c probe function 2020-09-02 11:00:20 +10:00
85xx powerpc/85xx: Fix oops when CONFIG_FSL_PMC=n 2021-12-22 09:30:56 +01:00
86xx mm: reorder includes after introduction of linux/pgtable.h 2020-06-09 09:39:13 -07:00
512x powerpc/512x: Use dma_request_chan() instead dma_request_slave_channel() 2020-01-06 16:25:29 +11:00
amigaone powerpc/32: drop unused ISA_DMA_THRESHOLD 2020-04-01 14:30:50 +11:00
cell powerpc/cell/axon_msi: Fix refcount leak in setup_msi_msg_address 2022-08-21 15:16:11 +02:00
chrp mm: reorder includes after introduction of linux/pgtable.h 2020-06-09 09:39:13 -07:00
embedded6xx powerpc/6xx: add missing of_node_put 2022-01-27 10:54:21 +01:00
maple mm: don't include asm/pgtable.h if linux/mm.h is already included 2020-06-09 09:39:13 -07:00
pasemi powerpc: use for_each_child_of_node() macro 2020-07-29 22:30:33 +10:00
powermac powerpc/mm: Switch obsolete dssall to .long 2022-06-14 18:32:46 +02:00
powernv powerpc/powernv: Avoid crashing if rng is NULL 2022-08-21 15:15:26 +02:00
ps3 powerpc/ps3: Add dma_mask to ps3_dma_region 2021-07-20 16:05:42 +02:00
pseries powerpc/pseries: wire up rng during setup_arch() 2022-06-29 08:59:54 +02:00
fsl_uli1575.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
Kconfig powerpc: Remove CONFIG_PPC601_SYNC_FIX 2020-10-08 21:17:13 +11:00
Kconfig.cputype powerpc/32: Don't always pass -mcpu=powerpc to the compiler 2022-08-25 11:38:20 +02:00
Makefile powerpc: Add -Werror at arch/powerpc level 2018-10-19 00:56:17 +11:00