On Wed, Jul 01, 2026 at 11:55:03AM -0600, Tom Rini wrote:
> On Wed, Jul 01, 2026 at 11:18:03AM +0000, Yao Zi wrote:
> > From: Jiaxun Yang <[email protected]>
> > 
> > Provide a generic CPU type with some common routines
> > that expected to be implemented at CPU level.
> > 
> > Signed-off-by: Jiaxun Yang <[email protected]>
> > Signed-off-by: Yao Zi <[email protected]>
> > ---
> > 
> > (No changes from v1)
> > 
> >  arch/loongarch/Kconfig              |  1 +
> >  arch/loongarch/cpu/generic/Kconfig  | 13 +++++++++++++
> >  arch/loongarch/cpu/generic/Makefile |  7 +++++++
> >  arch/loongarch/cpu/generic/cpu.c    | 22 ++++++++++++++++++++++
> >  arch/loongarch/cpu/generic/dram.c   | 21 +++++++++++++++++++++
> >  5 files changed, 64 insertions(+)
> >  create mode 100644 arch/loongarch/cpu/generic/Kconfig
> >  create mode 100644 arch/loongarch/cpu/generic/Makefile
> >  create mode 100644 arch/loongarch/cpu/generic/cpu.c
> >  create mode 100644 arch/loongarch/cpu/generic/dram.c
> > 
> > diff --git a/arch/loongarch/Kconfig b/arch/loongarch/Kconfig
> > index 109d37d8e2c7..5254afb2cd05 100644
> > --- a/arch/loongarch/Kconfig
> > +++ b/arch/loongarch/Kconfig
> > @@ -12,6 +12,7 @@ endchoice
> >  # board-specific options below
> >  
> >  # platform-specific options below
> > +source "arch/loongarch/cpu/generic/Kconfig"
> >  
> >  # architecture-specific options below
> >  choice
> > diff --git a/arch/loongarch/cpu/generic/Kconfig 
> > b/arch/loongarch/cpu/generic/Kconfig
> > new file mode 100644
> > index 000000000000..ac7556d6d4d0
> > --- /dev/null
> > +++ b/arch/loongarch/cpu/generic/Kconfig
> > @@ -0,0 +1,13 @@
> > +# SPDX-License-Identifier: GPL-2.0+
> > +#
> > +# Copyright (C) 2024 Jiaxun yang <[email protected]>
> > +#
> > +
> > +config GENERIC_LOONGARCH
> > +   bool
> > +   select SYS_CACHE_SHIFT_6
> > +   imply CPU
> > +   imply CPU_LOONGARCH
> > +   imply LOONGARCH_TIMER
> > +   imply CMD_CPU
> 
> Which of these "imply" values can ever really be turned off? CMD_CPU?
> Yes, others, I don't know.

CPU* are all optional, but to turn them off, we must also turn off
DISPLAY_CPUINFO, which is broken without CONFIG_CPU since the
implementation of print_cpuinfo() is guarded by CONFIG_IS_ENABLED(CPU).
I think we should reflect the dependency in Kconfig?

For LOONGARCH_TIMER, it's necessary for delay functions to operate, but
if a platform makes use of a non-standard in-core timer implementation
in the future, being able to turn LOONGARCH_TIMER off in the board
configuration might help in code size. But I don't have a strong opinion
for this.

> -- 
> Tom

Regards,
Yao Zi

Reply via email to