u-boot/arch/powerpc/cpu/mpc85xx
Pali Rohár c0d0569cf6 powerpc/mpc85xx: Pass correct cpu compiler flags
When gcc's default cpu (selected by --with-cpu= during gcc's configure
phase) does not match target U-Boot board cpu then U-Boot binary does not
have to be compiled correctly. Lot of distributions sets gcc's default cpu
to generic powerpc variant which works fine.

U-Boot already pass -Wa,-me500 flag to gcc which instructs GNU AS to accept
e500 specific instructions when processing assembler source files (.S).

This affects also assembly files generated by gcc from C source files. And
because gcc for generic powerpc cpu puts '.machine ppc' at the beginning of
the generated assembly file, it basically overwrites -me500 flag by which
was GNU AS invoked (from U-boot build system).

It started to be an issue since binutils 2.38 which does not keep enabled
extra functional units selected by previous cpu. Hence issuing directive
'.machine ppc' (generated by gcc for generic powerpc) after '.machine e500'
(specifying at command line) disables usage of e500 specific instructions.

And compiling arch/powerpc/cpu/mpc85xx/tlb.c code throws following
assembler errors:

    {standard input}: Assembler messages:
    {standard input}:127: Error: unrecognized opcode: `tlbre'
    {standard input}:418: Error: unrecognized opcode: `tlbre'
    {standard input}:821: Error: unrecognized opcode: `msync'
    {standard input}:821: Error: unrecognized opcode: `tlbwe'
    {standard input}:884: Error: unrecognized opcode: `tlbsx'

This issue was already hit by Debian people and is reported in bug tracker:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1003490

Calling gcc with -mcpu=8540 flag fixes this issue because -mcpu=8540 tells
gcc to compile code for e500 core/cpu (overwriting gcc's default cpu) and
does not put '.machine ppc' directive into assembly anymore.

Also if gcc is invoked with -mcpu=8540 then it pass -me500 flag to GNU AS.
So it is unnecessary to manually specify -Wa,-me500 flag because it is
implicitly added.

Fix this issue properly by specifying correct -mcpu compiler flag for all
supported powerpc cores in U-Boot mpc85xx platform, which are: e500v1,
e500v2, e500mc, e5500 and e6500. For specifying e500v1 and e500v2 cores,
gcc has unintuitive -mcpu=8540 and -mcpu=8548 flag names, for other cores
-mcpu matches core name.

The only difference between gcc's -mcpu=8540 and -mcpu=8548 flags is
support for double precision floating point SPE instructions. As U-Boot
does not use floating point, it is fine to use -mcpu=8540 for both e500v1
and e500v2 cores. Moreover gcc 9 completely removed e500 floating point
support, so since gcc 9 -mcpu=8548 is just alias to -mcpu=8540.

Note that U-Boot's CONFIG_E500 option is set also for other cpus, not only
for e500v1 and e500v2. So do not check for CONFIG_E500 and rather set e500
as last fallback value when no other mpc85xx cpu matches.

Signed-off-by: Pali Rohár <pali@kernel.org>
2022-12-22 15:39:13 -05:00
..
b4860_ids.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
b4860_serdes.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
bsc9132_serdes.c global: Migrate CONFIG_SYS_MPC8* symbols to the CFG_SYS namespace 2022-11-10 10:08:55 -05:00
c29x_serdes.c global: Migrate CONFIG_SYS_MPC8* symbols to the CFG_SYS namespace 2022-11-10 10:08:55 -05:00
cmd_errata.c global: Migrate CONFIG_SYS_FSL* symbols to the CFG_SYS namespace 2022-11-10 10:08:55 -05:00
config.mk powerpc/mpc85xx: Pass correct cpu compiler flags 2022-12-22 15:39:13 -05:00
cpu.c global: Migrate CONFIG_SYS_FSL* symbols to the CFG_SYS namespace 2022-11-10 10:08:55 -05:00
cpu_init.c global: Migrate CONFIG_SYS_FSL* symbols to the CFG_SYS namespace 2022-11-10 10:08:55 -05:00
cpu_init_early.c global: Migrate CONFIG_SYS_MPC8* symbols to the CFG_SYS namespace 2022-11-10 10:08:55 -05:00
fdt.c global: Migrate CONFIG_SYS_FSL* symbols to the CFG_SYS namespace 2022-11-10 10:08:55 -05:00
fsl_corenet2_serdes.c global: Migrate CONFIG_SYS_FSL* symbols to the CFG_SYS namespace 2022-11-10 10:08:55 -05:00
fsl_corenet2_serdes.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
fsl_corenet_serdes.c global: Migrate CONFIG_SYS_FSL* symbols to the CFG_SYS namespace 2022-11-10 10:08:55 -05:00
fsl_corenet_serdes.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
interrupts.c global: Migrate CONFIG_SYS_MPC8* symbols to the CFG_SYS namespace 2022-11-10 10:08:55 -05:00
Kconfig powerpc: Migrate SYS_L3_SIZE to Kconfig 2022-11-10 09:45:54 -05:00
liodn.c global: Migrate CONFIG_SYS_FSL* symbols to the CFG_SYS namespace 2022-11-10 10:08:55 -05:00
Makefile Convert CONFIG_SPL_INIT_MINIMAL et al to Kconfig 2022-06-06 12:09:00 -04:00
mp.c global: Migrate CONFIG_SYS_FSL* symbols to the CFG_SYS namespace 2022-11-10 10:08:55 -05:00
mp.h powerpc/mpc85xx: Rewrite spin table to comply with ePAPR v1.1 2012-10-22 14:31:32 -05:00
mpc8536_serdes.c global: Migrate CONFIG_SYS_MPC8* symbols to the CFG_SYS namespace 2022-11-10 10:08:55 -05:00
mpc8544_serdes.c global: Migrate CONFIG_SYS_MPC8* symbols to the CFG_SYS namespace 2022-11-10 10:08:55 -05:00
mpc8548_serdes.c global: Migrate CONFIG_SYS_MPC8* symbols to the CFG_SYS namespace 2022-11-10 10:08:55 -05:00
p1010_serdes.c global: Migrate CONFIG_SYS_MPC8* symbols to the CFG_SYS namespace 2022-11-10 10:08:55 -05:00
p1021_serdes.c global: Migrate CONFIG_SYS_MPC8* symbols to the CFG_SYS namespace 2022-11-10 10:08:55 -05:00
p1023_serdes.c global: Migrate CONFIG_SYS_MPC8* symbols to the CFG_SYS namespace 2022-11-10 10:08:55 -05:00
p2020_serdes.c global: Migrate CONFIG_SYS_MPC8* symbols to the CFG_SYS namespace 2022-11-10 10:08:55 -05:00
p2041_ids.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
p2041_serdes.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
p3041_ids.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
p3041_serdes.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
p4080_ids.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
p4080_serdes.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
p5040_ids.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
p5040_serdes.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
portals.c treewide: Remove the unnecessary space before semicolon 2022-11-02 13:58:17 -04:00
qe_io.c global: Migrate CONFIG_SYS_MPC8* symbols to the CFG_SYS namespace 2022-11-10 10:08:55 -05:00
release.S powerpc: mpc85xx: Improve Work-around for Erratum A005125 2018-05-09 09:17:51 -05:00
resetvec.S powerpc: mpc85xx: Rename _start_e500 symbol to _start 2022-04-26 17:18:39 +05:30
speed.c global: Migrate CONFIG_SYS_FSL* symbols to the CFG_SYS namespace 2022-11-10 10:08:55 -05:00
spl_minimal.c global: Migrate CONFIG_SYS_MPC8* symbols to the CFG_SYS namespace 2022-11-10 10:08:55 -05:00
start.S global: Migrate CONFIG_SYS_FSL* symbols to the CFG_SYS namespace 2022-11-10 10:08:55 -05:00
t1024_ids.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
t1024_serdes.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
t1040_ids.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
t1040_serdes.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
t2080_ids.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
t2080_serdes.c ppc: Remove T2081QDS board and ARCH_T2081 support 2021-04-10 08:04:42 -04:00
t4240_ids.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
t4240_serdes.c ppc: Remove T4160RDB board 2021-07-07 19:52:24 -04:00
tlb.c treewide: Remove the unnecessary space before semicolon 2022-11-02 13:58:17 -04:00
traps.c global: Migrate CONFIG_SYS_MPC8* symbols to the CFG_SYS namespace 2022-11-10 10:08:55 -05:00
u-boot-spl.lds powerpc: mpc85xx: Fix incorrect application of patch 2022-09-19 08:30:58 -04:00
u-boot.lds Rename CONFIG_SYS_TEXT_BASE to CONFIG_TEXT_BASE 2022-10-31 11:01:31 -04:00