[PATCH] powerpc: e500: Fix compilation with gcc e500 compiler

Arnd Bergmann arnd at arndb.de
Sat Jul 9 06:04:08 AEST 2022


On Fri, Jul 8, 2022 at 7:12 PM Pali Rohár <pali at kernel.org> wrote:
>
> On Monday 04 July 2022 14:07:10 Arnd Bergmann wrote:
> > Another problem I see is that a kernel that is built for both E500 and E500MC
> > uses -mcpu=e500mc and may not actually work on the older ones either
> > (even with your patch).
>
> Such configuration is not supported, see arch/powerpc/platforms/Kconfig.cputype:
>
> config PPC_E500MC
>         bool "e500mc Support"
>         select PPC_FPU
>         select COMMON_CLK
>         depends on E500
>         help
>           This must be enabled for running on e500mc (and derivatives
>           such as e5500/e6500), and must be disabled for running on
>           e500v1 or e500v2.
>
> Based on this option you can enable either support for e500v1/e500v2 or
> for e500mc. But not both.

This looks like a bad decision in Kconfig though, as there is nothing
enforcing the rule: If you want support for E500MC, you have to select
PPC_85xx, which implies E500 and allows selecting any combination
of E500v1, E500v2 and E500MC based machines, but enabling
any E500MC based one breaks all the others.

If this is a hard dependency, I think it should be enforced by making
E500MC a separate top-level option in the "Processor Type" choice
statement. However, if they can actually coexist, the help text and
the Makefile need to be fixed.

       Arnd


More information about the Linuxppc-dev mailing list