Re: [PATCH v2 02/19] MIPS: Loongson64: separate loongson2ef/loongson64 code

From: Jiaxun Yang
Date: Tue Sep 17 2019 - 20:38:37 EST



08:12, 2019å9æ10æ, Paul Burton <paul.burton@xxxxxxxx>:

Hi Jiaxun & Huacai,

On Thu, Sep 05, 2019 at 10:42:59PM +0800, Jiaxun Yang wrote:

ÂAs later model of GSx64 family processors including
2-series-soc have
Âsimilar design with initial loongson3a while loongson2e/f
seems less
Âidentical, we separate loongson2e/f support code out of
mach-loongson64
Âto make our life easier.

ÂSigned-off-by: Jiaxun Yang <jiaxun.yang@xxxxxxxxxxx
<mailto:jiaxun.yang@xxxxxxxxxxx>>


I looked at applying the first 3 patches of this series to mips-next &
squashed in the relevant defconfig updates, then was looking at applying
Huacai's recent 3 patch series.

Hi Paul,
Thanks for your effort.
Please let Huacai's patches go first.

I'm going to make a delicated set for separate the code. Based on mips-next.

One issue is that they conflict, but beyond that it showed me that this
patch deletes kernel-entry-init.h entirely. Was that intentional? If so
it should be a separate patch & it needs an explanation.

Yes, that's intentional, I'm going to explain them in sets later.

Please could the two of you make it clear what branch & commit your
patches are based upon? Ideally it should be the current head of the
mips-next branch.

Also Jiaxun, it's really hard to see whether this patch is making any
functional changes in addition to the duplication & renaming. I think it
would be much better to split this into a few steps across multiple
commits, something like this:

1) Copy the loongson64 directory to loongson2ef, and keep the copy as-is
ÂÂÂ*except* for the removal of the loongson2ef/loongon-3 subdirectory.
ÂÂÂDelete loongson64/fuloong-2e & loongson64/lemote-2f.

2) Now clean up the loongson64 directory by moving files up from the
ÂÂÂloongson-3 subdirectory.

3) Now clean up code, removing #ifdef's etc that no longer make sense.

Provide the -M & -C flags to git format-patch when generating your
patches. --find-copies-harder might help with the first step, if it's
practical to run.

That way each commit will be easier to review, and issues like the
deletion of kernel-entry-init.h will be easier to spot.

Got it!
--
Jiaxun

For now I undid the whole thing. It's getting late in the cycle anyway,
so this will probably be v5.5 material.

Thanks,
ÂÂÂÂPaul

Â---
ÂÂarch/mips/Kbuild.platforms | 1 +
ÂÂarch/mips/Kconfig | 51 +++++--
ÂÂarch/mips/include/asm/bootinfo.h | 1 -
ÂÂ.../mach-loongson2ef/cpu-feature-overrides.h | 45 +++++++
ÂÂ.../cs5536/cs5536.h | 0
ÂÂ.../cs5536/cs5536_mfgpt.h | 0
ÂÂ.../cs5536/cs5536_pci.h | 0
ÂÂ.../cs5536/cs5536_vsm.h | 0
ÂÂ.../loongson2ef.h} | 29 +---
ÂÂ.../machine.h | 6 -
ÂÂ.../mc146818rtc.h | 5 +-
ÂÂ.../mem.h | 6 +-
ÂÂarch/mips/include/asm/mach-loongson2ef/pci.h | 43 ++++++
ÂÂ.../include/asm/mach-loongson2ef/spaces.h | 10 ++
ÂÂ.../mach-loongson64/cpu-feature-overrides.h | 8 +-
ÂÂarch/mips/include/asm/mach-loongson64/irq.h | 7 +-
ÂÂ.../asm/mach-loongson64/kernel-entry-init.h | 74 ----------
ÂÂ.../include/asm/mach-loongson64/loongson64.h | 48 +++++++
ÂÂ.../mips/include/asm/mach-loongson64/mmzone.h | 16 ---
ÂÂarch/mips/include/asm/mach-loongson64/pci.h | 41 +-----
ÂÂ.../include/asm/mach-loongson64/workarounds.h | 4 +-
ÂÂarch/mips/loongson2ef/Kconfig | 93 +++++++++++++
ÂÂarch/mips/loongson2ef/Makefile | 18 +++
ÂÂarch/mips/loongson2ef/Platform | 32 +++++
ÂÂ.../common/Makefile | 0
ÂÂ.../common/bonito-irq.c | 2 +-
ÂÂ.../common/cmdline.c | 2 +-
ÂÂ.../common/cs5536/Makefile | 0
ÂÂ.../common/cs5536/cs5536_acc.c | 0
ÂÂ.../common/cs5536/cs5536_ehci.c | 0
ÂÂ.../common/cs5536/cs5536_ide.c | 0
ÂÂ.../common/cs5536/cs5536_isa.c | 0
ÂÂ.../common/cs5536/cs5536_mfgpt.c | 0
ÂÂ.../common/cs5536/cs5536_ohci.c | 0
ÂÂ.../common/cs5536/cs5536_pci.c | 0
ÂÂ.../common/early_printk.c | 2 +-
ÂÂarch/mips/loongson2ef/common/env.c | 71 ++++++++++
ÂÂ.../{loongson64 => loongson2ef}/common/init.c | 7 +-
ÂÂ.../{loongson64 => loongson2ef}/common/irq.c | 2 +-
ÂÂ.../common/machtype.c | 3 +-
ÂÂ.../{loongson64 => loongson2ef}/common/mem.c | 40 +-----
ÂÂ.../{loongson64 => loongson2ef}/common/pci.c | 11 +-
ÂÂ.../common/platform.c | 0
ÂÂ.../{loongson64 => loongson2ef}/common/pm.c | 2 +-
ÂÂ.../common/reset.c | 23 +---
ÂÂ.../{loongson64 => loongson2ef}/common/rtc.c | 0
ÂÂ.../common/serial.c | 37 +----
ÂÂ.../common/setup.c | 2 +-
ÂÂ.../{loongson64 => loongson2ef}/common/time.c | 2 +-
ÂÂ.../common/uart_base.c | 10 +-
ÂÂ.../fuloong-2e/Makefile | 0
ÂÂ.../fuloong-2e/dma.c | 0
ÂÂ.../fuloong-2e/irq.c | 2 +-
ÂÂ.../fuloong-2e/reset.c | 2 +-
ÂÂ.../lemote-2f/Makefile | 0
ÂÂ.../lemote-2f/clock.c | 2 +-
ÂÂ.../lemote-2f/dma.c | 0
ÂÂ.../lemote-2f/ec_kb3310b.c | 0
ÂÂ.../lemote-2f/ec_kb3310b.h | 0
ÂÂ.../lemote-2f/irq.c | 2 +-
ÂÂ.../lemote-2f/machtype.c | 2 +-
ÂÂ.../lemote-2f/pm.c | 2 +-
ÂÂ.../lemote-2f/reset.c | 2 +-
ÂÂarch/mips/loongson64/Kconfig | 126 +-----------------
ÂÂarch/mips/loongson64/Makefile | 23 +---
ÂÂarch/mips/loongson64/Platform | 26 +---
ÂÂ.../loongson64/{loongson-3 => }/acpi_init.c | 3 +-
ÂÂ.../loongson64/{loongson-3 => }/cop2-ex.c | 5 +-
ÂÂarch/mips/loongson64/{loongson-3 => }/dma.c | 6 +-
ÂÂarch/mips/loongson64/{common => }/env.c | 72 +++-------
ÂÂarch/mips/loongson64/{loongson-3 => }/hpet.c | 0
ÂÂarch/mips/loongson64/{loongson-3 => }/irq.c | 40 +++++-
ÂÂarch/mips/loongson64/loongson-3/Makefile | 11 --
ÂÂarch/mips/loongson64/{loongson-3 => }/numa.c | 4 +-
ÂÂarch/mips/loongson64/pci.c | 45 +++++++
ÂÂ.../loongson64/{loongson-3 => }/platform.c | 0
ÂÂarch/mips/loongson64/reset.c | 58 ++++++++
ÂÂarch/mips/loongson64/setup.c | 91 +++++++++++++
ÂÂarch/mips/loongson64/{loongson-3 => }/smp.c | 4 +-
ÂÂarch/mips/loongson64/{loongson-3 => }/smp.h | 0
ÂÂarch/mips/oprofile/op_model_loongson2.c | 2 +-
ÂÂarch/mips/oprofile/op_model_loongson3.c | 2 +-
ÂÂarch/mips/pci/Makefile | 2 +-
ÂÂarch/mips/pci/fixup-fuloong2e.c | 2 +-
ÂÂarch/mips/pci/fixup-lemote2f.c | 2 +-
ÂÂarch/mips/pci/ops-loongson2.c | 2 +-
ÂÂarch/mips/pci/ops-loongson3.c | 2 +-
ÂÂdrivers/cpufreq/loongson2_cpufreq.c | 2 +-
ÂÂdrivers/gpio/gpio-loongson.c | 2 +-
ÂÂdrivers/platform/mips/cpu_hwmon.c | 2 +-
ÂÂ90 files changed, 720 insertions(+), 582 deletions(-)
ÂÂcreate mode 100644
arch/mips/include/asm/mach-loongson2ef/cpu-feature-overrides.h
ÂÂrename arch/mips/include/asm/{mach-loongson64 =>
mach-loongson2ef}/cs5536/cs5536.h (100%)
ÂÂrename arch/mips/include/asm/{mach-loongson64 =>
mach-loongson2ef}/cs5536/cs5536_mfgpt.h (100%)
ÂÂrename arch/mips/include/asm/{mach-loongson64 =>
mach-loongson2ef}/cs5536/cs5536_pci.h (100%)
ÂÂrename arch/mips/include/asm/{mach-loongson64 =>
mach-loongson2ef}/cs5536/cs5536_vsm.h (100%)
ÂÂrename arch/mips/include/asm/{mach-loongson64/loongson.h =>
mach-loongson2ef/loongson2ef.h} (91%)
ÂÂrename arch/mips/include/asm/{mach-loongson64 =>
mach-loongson2ef}/machine.h (80%)
ÂÂrename arch/mips/include/asm/{mach-loongson64 =>
mach-loongson2ef}/mc146818rtc.h (80%)
ÂÂrename arch/mips/include/asm/{mach-loongson64 =>
mach-loongson2ef}/mem.h (86%)
ÂÂcreate mode 100644 arch/mips/include/asm/mach-loongson2ef/pci.h
ÂÂcreate mode 100644
arch/mips/include/asm/mach-loongson2ef/spaces.h
ÂÂdelete mode 100644
arch/mips/include/asm/mach-loongson64/kernel-entry-init.h
ÂÂcreate mode 100644
arch/mips/include/asm/mach-loongson64/loongson64.h
ÂÂcreate mode 100644 arch/mips/loongson2ef/Kconfig
ÂÂcreate mode 100644 arch/mips/loongson2ef/Makefile
ÂÂcreate mode 100644 arch/mips/loongson2ef/Platform
ÂÂrename arch/mips/{loongson64 => loongson2ef}/common/Makefile
(100%)
ÂÂrename arch/mips/{loongson64 =>
loongson2ef}/common/bonito-irq.c (97%)
ÂÂrename arch/mips/{loongson64 => loongson2ef}/common/cmdline.c
(97%)
ÂÂrename arch/mips/{loongson64 =>
loongson2ef}/common/cs5536/Makefile (100%)
ÂÂrename arch/mips/{loongson64 =>
loongson2ef}/common/cs5536/cs5536_acc.c (100%)
ÂÂrename arch/mips/{loongson64 =>
loongson2ef}/common/cs5536/cs5536_ehci.c (100%)
ÂÂrename arch/mips/{loongson64 =>
loongson2ef}/common/cs5536/cs5536_ide.c (100%)
ÂÂrename arch/mips/{loongson64 =>
loongson2ef}/common/cs5536/cs5536_isa.c (100%)
ÂÂrename arch/mips/{loongson64 =>
loongson2ef}/common/cs5536/cs5536_mfgpt.c (100%)
ÂÂrename arch/mips/{loongson64 =>
loongson2ef}/common/cs5536/cs5536_ohci.c (100%)
ÂÂrename arch/mips/{loongson64 =>
loongson2ef}/common/cs5536/cs5536_pci.c (100%)
ÂÂrename arch/mips/{loongson64 =>
loongson2ef}/common/early_printk.c (97%)
ÂÂcreate mode 100644 arch/mips/loongson2ef/common/env.c
ÂÂrename arch/mips/{loongson64 => loongson2ef}/common/init.c (90%)
ÂÂrename arch/mips/{loongson64 => loongson2ef}/common/irq.c (98%)
ÂÂrename arch/mips/{loongson64 =>
loongson2ef}/common/machtype.c (94%)
ÂÂrename arch/mips/{loongson64 => loongson2ef}/common/mem.c (72%)
ÂÂrename arch/mips/{loongson64 => loongson2ef}/common/pci.c (89%)
ÂÂrename arch/mips/{loongson64 =>
loongson2ef}/common/platform.c (100%)
ÂÂrename arch/mips/{loongson64 => loongson2ef}/common/pm.c (99%)
ÂÂrename arch/mips/{loongson64 => loongson2ef}/common/reset.c (77%)
ÂÂrename arch/mips/{loongson64 => loongson2ef}/common/rtc.c (100%)
ÂÂrename arch/mips/{loongson64 => loongson2ef}/common/serial.c
(63%)
ÂÂrename arch/mips/{loongson64 => loongson2ef}/common/setup.c (97%)
ÂÂrename arch/mips/{loongson64 => loongson2ef}/common/time.c (96%)
ÂÂrename arch/mips/{loongson64 =>
loongson2ef}/common/uart_base.c (77%)
ÂÂrename arch/mips/{loongson64 =>
loongson2ef}/fuloong-2e/Makefile (100%)
ÂÂrename arch/mips/{loongson64 => loongson2ef}/fuloong-2e/dma.c
(100%)
ÂÂrename arch/mips/{loongson64 => loongson2ef}/fuloong-2e/irq.c
(98%)
ÂÂrename arch/mips/{loongson64 =>
loongson2ef}/fuloong-2e/reset.c (93%)
ÂÂrename arch/mips/{loongson64 =>
loongson2ef}/lemote-2f/Makefile (100%)
ÂÂrename arch/mips/{loongson64 =>
loongson2ef}/lemote-2f/clock.c (98%)
ÂÂrename arch/mips/{loongson64 => loongson2ef}/lemote-2f/dma.c
(100%)
ÂÂrename arch/mips/{loongson64 =>
loongson2ef}/lemote-2f/ec_kb3310b.c (100%)
ÂÂrename arch/mips/{loongson64 =>
loongson2ef}/lemote-2f/ec_kb3310b.h (100%)
ÂÂrename arch/mips/{loongson64 => loongson2ef}/lemote-2f/irq.c
(99%)
ÂÂrename arch/mips/{loongson64 =>
loongson2ef}/lemote-2f/machtype.c (98%)
ÂÂrename arch/mips/{loongson64 => loongson2ef}/lemote-2f/pm.c (99%)
ÂÂrename arch/mips/{loongson64 =>
loongson2ef}/lemote-2f/reset.c (99%)
ÂÂrename arch/mips/loongson64/{loongson-3 => }/acpi_init.c (99%)
ÂÂrename arch/mips/loongson64/{loongson-3 => }/cop2-ex.c (88%)
ÂÂrename arch/mips/loongson64/{loongson-3 => }/dma.c (82%)
ÂÂrename arch/mips/loongson64/{common => }/env.c (79%)
ÂÂrename arch/mips/loongson64/{loongson-3 => }/hpet.c (100%)
ÂÂrename arch/mips/loongson64/{loongson-3 => }/irq.c (77%)
ÂÂdelete mode 100644 arch/mips/loongson64/loongson-3/Makefile
ÂÂrename arch/mips/loongson64/{loongson-3 => }/numa.c (98%)
ÂÂcreate mode 100644 arch/mips/loongson64/pci.c
ÂÂrename arch/mips/loongson64/{loongson-3 => }/platform.c (100%)
ÂÂcreate mode 100644 arch/mips/loongson64/reset.c
ÂÂcreate mode 100644 arch/mips/loongson64/setup.c
ÂÂrename arch/mips/loongson64/{loongson-3 => }/smp.c (99%)
ÂÂrename arch/mips/loongson64/{loongson-3 => }/smp.h (100%)



--
Jiaxun Yang