linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiaxun Yang <jiaxun.yang@flygoat.com>
To: linux-mips@vger.kernel.org
Cc: chenhc@lemote.com, paul.burton@mips.com,
	Jiaxun Yang <jiaxun.yang@flygoat.com>
Subject: [PATCH 5/6] MIPS: Loongson64: Move files to the top-level directory
Date: Sun, 20 Oct 2019 23:01:36 +0800	[thread overview]
Message-ID: <20191020150137.19256-2-jiaxun.yang@flygoat.com> (raw)
In-Reply-To: <20191020150137.19256-1-jiaxun.yang@flygoat.com>

Current Loongson-3 code can share among all Loongson64 processors.

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
---
 arch/mips/Kconfig                             | 26 +++++++++++++
 arch/mips/configs/loongson3_defconfig         |  1 -
 .../mach-loongson64/cpu-feature-overrides.h   |  1 -
 arch/mips/loongson64/Kconfig                  | 38 +------------------
 arch/mips/loongson64/Makefile                 | 17 +++++----
 .../loongson64/{loongson-3 => }/acpi_init.c   |  0
 arch/mips/loongson64/{common => }/cmdline.c   |  0
 arch/mips/loongson64/common/Makefile          | 16 --------
 .../loongson64/{loongson-3 => }/cop2-ex.c     |  0
 arch/mips/loongson64/{loongson-3 => }/dma.c   |  0
 arch/mips/loongson64/{common => }/env.c       |  0
 arch/mips/loongson64/{loongson-3 => }/hpet.c  |  0
 arch/mips/loongson64/{common => }/init.c      |  0
 arch/mips/loongson64/{loongson-3 => }/irq.c   |  0
 arch/mips/loongson64/loongson-3/Makefile      | 11 ------
 arch/mips/loongson64/{loongson-3 => }/numa.c  |  0
 arch/mips/loongson64/{common => }/pci.c       |  0
 .../loongson64/{loongson-3 => }/platform.c    |  0
 arch/mips/loongson64/{common => }/pm.c        |  0
 arch/mips/loongson64/{common => }/reset.c     |  0
 arch/mips/loongson64/{common => }/rtc.c       |  0
 arch/mips/loongson64/{common => }/setup.c     |  0
 arch/mips/loongson64/{loongson-3 => }/smp.c   |  0
 arch/mips/loongson64/{loongson-3 => }/smp.h   |  0
 arch/mips/loongson64/{common => }/time.c      |  0
 arch/mips/pci/Makefile                        |  2 +-
 drivers/platform/mips/Kconfig                 |  4 +-
 27 files changed, 39 insertions(+), 77 deletions(-)
 rename arch/mips/loongson64/{loongson-3 => }/acpi_init.c (100%)
 rename arch/mips/loongson64/{common => }/cmdline.c (100%)
 delete mode 100644 arch/mips/loongson64/common/Makefile
 rename arch/mips/loongson64/{loongson-3 => }/cop2-ex.c (100%)
 rename arch/mips/loongson64/{loongson-3 => }/dma.c (100%)
 rename arch/mips/loongson64/{common => }/env.c (100%)
 rename arch/mips/loongson64/{loongson-3 => }/hpet.c (100%)
 rename arch/mips/loongson64/{common => }/init.c (100%)
 rename arch/mips/loongson64/{loongson-3 => }/irq.c (100%)
 delete mode 100644 arch/mips/loongson64/loongson-3/Makefile
 rename arch/mips/loongson64/{loongson-3 => }/numa.c (100%)
 rename arch/mips/loongson64/{common => }/pci.c (100%)
 rename arch/mips/loongson64/{loongson-3 => }/platform.c (100%)
 rename arch/mips/loongson64/{common => }/pm.c (100%)
 rename arch/mips/loongson64/{common => }/reset.c (100%)
 rename arch/mips/loongson64/{common => }/rtc.c (100%)
 rename arch/mips/loongson64/{common => }/setup.c (100%)
 rename arch/mips/loongson64/{loongson-3 => }/smp.c (100%)
 rename arch/mips/loongson64/{loongson-3 => }/smp.h (100%)
 rename arch/mips/loongson64/{common => }/time.c (100%)

diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 7d6b1c993e28..94249c69bd14 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -461,7 +461,33 @@ config MACH_LOONGSON2EF
 
 config MACH_LOONGSON64
 	bool "Loongson-2/3 GSx64 family of machines"
+	select ARCH_SPARSEMEM_ENABLE
+	select ARCH_MIGHT_HAVE_PC_PARPORT
+	select ARCH_MIGHT_HAVE_PC_SERIO
+	select GENERIC_ISA_DMA_SUPPORT_BROKEN
+	select BOOT_ELF32
+	select BOARD_SCACHE
+	select CSRC_R4K
+	select CEVT_R4K
+	select CPU_HAS_WB
+	select FORCE_PCI
+	select ISA
+	select I8259
+	select IRQ_MIPS_CPU
+	select NR_CPUS_DEFAULT_4
+	select USE_GENERIC_EARLY_PRINTK_8250
+	select SYS_HAS_CPU_LOONGSON64
+	select SYS_HAS_EARLY_PRINTK
+	select SYS_SUPPORTS_SMP
+	select SYS_SUPPORTS_HOTPLUG_CPU
+	select SYS_SUPPORTS_NUMA
+	select SYS_SUPPORTS_64BIT_KERNEL
+	select SYS_SUPPORTS_HIGHMEM
+	select SYS_SUPPORTS_LITTLE_ENDIAN
 	select SYS_SUPPORTS_ZBOOT
+	select LOONGSON_MC146818
+	select ZONE_DMA32
+	select NUMA
 	help
 	  This enables the support of Loongson-2/3 family of processors with
 	  GSx64 microarchitecture.
diff --git a/arch/mips/configs/loongson3_defconfig b/arch/mips/configs/loongson3_defconfig
index 90ee0084d786..caad7bf7902c 100644
--- a/arch/mips/configs/loongson3_defconfig
+++ b/arch/mips/configs/loongson3_defconfig
@@ -24,7 +24,6 @@ CONFIG_BLK_DEV_INITRD=y
 CONFIG_SYSCTL_SYSCALL=y
 CONFIG_EMBEDDED=y
 CONFIG_MACH_LOONGSON64=y
-CONFIG_LOONGSON_MACH3X=y
 CONFIG_SMP=y
 CONFIG_HZ_256=y
 CONFIG_KEXEC=y
diff --git a/arch/mips/include/asm/mach-loongson64/cpu-feature-overrides.h b/arch/mips/include/asm/mach-loongson64/cpu-feature-overrides.h
index 895607eb81ca..7dc8d75445a9 100644
--- a/arch/mips/include/asm/mach-loongson64/cpu-feature-overrides.h
+++ b/arch/mips/include/asm/mach-loongson64/cpu-feature-overrides.h
@@ -43,7 +43,6 @@
 #define cpu_has_vint		0
 #define cpu_has_vtag_icache	0
 #define cpu_has_watch		1
-
 #define cpu_has_wsbh		1
 #define cpu_has_ic_fills_f_dc	1
 #define cpu_hwrena_impl_bits	0xc0000000
diff --git a/arch/mips/loongson64/Kconfig b/arch/mips/loongson64/Kconfig
index 3215b768bb88..b1aefd06e3f5 100644
--- a/arch/mips/loongson64/Kconfig
+++ b/arch/mips/loongson64/Kconfig
@@ -1,45 +1,9 @@
 # SPDX-License-Identifier: GPL-2.0
 if MACH_LOONGSON64
 
-choice
-	prompt "Machine Type"
-
-config LOONGSON_MACH3X
-	bool "Generic Loongson 3 family machines"
-	select ARCH_SPARSEMEM_ENABLE
-	select ARCH_MIGHT_HAVE_PC_PARPORT
-	select ARCH_MIGHT_HAVE_PC_SERIO
-	select GENERIC_ISA_DMA_SUPPORT_BROKEN
-	select BOOT_ELF32
-	select BOARD_SCACHE
-	select CSRC_R4K
-	select CEVT_R4K
-	select CPU_HAS_WB
-	select FORCE_PCI
-	select ISA
-	select I8259
-	select IRQ_MIPS_CPU
-	select NR_CPUS_DEFAULT_4
-	select USE_GENERIC_EARLY_PRINTK_8250
-	select SYS_HAS_CPU_LOONGSON64
-	select SYS_HAS_EARLY_PRINTK
-	select SYS_SUPPORTS_SMP
-	select SYS_SUPPORTS_HOTPLUG_CPU
-	select SYS_SUPPORTS_NUMA
-	select SYS_SUPPORTS_64BIT_KERNEL
-	select SYS_SUPPORTS_HIGHMEM
-	select SYS_SUPPORTS_LITTLE_ENDIAN
-	select LOONGSON_MC146818
-	select ZONE_DMA32
-	select NUMA
-	help
-		Generic Loongson 3 family machines utilize the 3A/3B revision
-		of Loongson processor and RS780/SBX00 chipset.
-endchoice
-
 config RS780_HPET
 	bool "RS780/SBX00 HPET Timer"
-	depends on LOONGSON_MACH3X
+	depends on CONFIG_MACH_LOONGSON64
 	select MIPS_EXTERNAL_TIMER
 	help
 	  This option enables the hpet timer of AMD RS780/SBX00.
diff --git a/arch/mips/loongson64/Makefile b/arch/mips/loongson64/Makefile
index dc16a23c171f..0b3c65b52965 100644
--- a/arch/mips/loongson64/Makefile
+++ b/arch/mips/loongson64/Makefile
@@ -1,12 +1,13 @@
 # SPDX-License-Identifier: GPL-2.0-only
 #
-# Common code for all Loongson based systems
+# Makefile for Loongson-3 family machines
 #
+obj-$(CONFIG_MACH_LOONGSON64) += irq.o cop2-ex.o platform.o acpi_init.o dma.o \
+				setup.o init.o cmdline.o env.o time.o reset.o \
 
-obj-$(CONFIG_MACH_LOONGSON64) += common/
-
-#
-# All Loongson-3 family machines
-#
-
-obj-$(CONFIG_CPU_LOONGSON64)  += loongson-3/
+obj-$(CONFIG_SMP)	+= smp.o
+obj-$(CONFIG_NUMA)	+= numa.o
+obj-$(CONFIG_RS780_HPET) += hpet.o
+obj-$(CONFIG_PCI) += pci.o
+obj-$(CONFIG_LOONGSON_MC146818) += rtc.o
+obj-$(CONFIG_SUSPEND) += pm.o
diff --git a/arch/mips/loongson64/loongson-3/acpi_init.c b/arch/mips/loongson64/acpi_init.c
similarity index 100%
rename from arch/mips/loongson64/loongson-3/acpi_init.c
rename to arch/mips/loongson64/acpi_init.c
diff --git a/arch/mips/loongson64/common/cmdline.c b/arch/mips/loongson64/cmdline.c
similarity index 100%
rename from arch/mips/loongson64/common/cmdline.c
rename to arch/mips/loongson64/cmdline.c
diff --git a/arch/mips/loongson64/common/Makefile b/arch/mips/loongson64/common/Makefile
deleted file mode 100644
index c476401c9b13..000000000000
--- a/arch/mips/loongson64/common/Makefile
+++ /dev/null
@@ -1,16 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-#
-# Makefile for loongson based machines.
-#
-
-obj-y += setup.o init.o cmdline.o env.o time.o reset.o
-
-obj-$(CONFIG_PCI) += pci.o
-
-obj-$(CONFIG_LOONGSON_MC146818) += rtc.o
-
-#
-# Suspend Support
-#
-
-obj-$(CONFIG_SUSPEND) += pm.o
diff --git a/arch/mips/loongson64/loongson-3/cop2-ex.c b/arch/mips/loongson64/cop2-ex.c
similarity index 100%
rename from arch/mips/loongson64/loongson-3/cop2-ex.c
rename to arch/mips/loongson64/cop2-ex.c
diff --git a/arch/mips/loongson64/loongson-3/dma.c b/arch/mips/loongson64/dma.c
similarity index 100%
rename from arch/mips/loongson64/loongson-3/dma.c
rename to arch/mips/loongson64/dma.c
diff --git a/arch/mips/loongson64/common/env.c b/arch/mips/loongson64/env.c
similarity index 100%
rename from arch/mips/loongson64/common/env.c
rename to arch/mips/loongson64/env.c
diff --git a/arch/mips/loongson64/loongson-3/hpet.c b/arch/mips/loongson64/hpet.c
similarity index 100%
rename from arch/mips/loongson64/loongson-3/hpet.c
rename to arch/mips/loongson64/hpet.c
diff --git a/arch/mips/loongson64/common/init.c b/arch/mips/loongson64/init.c
similarity index 100%
rename from arch/mips/loongson64/common/init.c
rename to arch/mips/loongson64/init.c
diff --git a/arch/mips/loongson64/loongson-3/irq.c b/arch/mips/loongson64/irq.c
similarity index 100%
rename from arch/mips/loongson64/loongson-3/irq.c
rename to arch/mips/loongson64/irq.c
diff --git a/arch/mips/loongson64/loongson-3/Makefile b/arch/mips/loongson64/loongson-3/Makefile
deleted file mode 100644
index df39598742b2..000000000000
--- a/arch/mips/loongson64/loongson-3/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0-only
-#
-# Makefile for Loongson-3 family machines
-#
-obj-y			+= irq.o cop2-ex.o platform.o acpi_init.o dma.o
-
-obj-$(CONFIG_SMP)	+= smp.o
-
-obj-$(CONFIG_NUMA)	+= numa.o
-
-obj-$(CONFIG_RS780_HPET) += hpet.o
diff --git a/arch/mips/loongson64/loongson-3/numa.c b/arch/mips/loongson64/numa.c
similarity index 100%
rename from arch/mips/loongson64/loongson-3/numa.c
rename to arch/mips/loongson64/numa.c
diff --git a/arch/mips/loongson64/common/pci.c b/arch/mips/loongson64/pci.c
similarity index 100%
rename from arch/mips/loongson64/common/pci.c
rename to arch/mips/loongson64/pci.c
diff --git a/arch/mips/loongson64/loongson-3/platform.c b/arch/mips/loongson64/platform.c
similarity index 100%
rename from arch/mips/loongson64/loongson-3/platform.c
rename to arch/mips/loongson64/platform.c
diff --git a/arch/mips/loongson64/common/pm.c b/arch/mips/loongson64/pm.c
similarity index 100%
rename from arch/mips/loongson64/common/pm.c
rename to arch/mips/loongson64/pm.c
diff --git a/arch/mips/loongson64/common/reset.c b/arch/mips/loongson64/reset.c
similarity index 100%
rename from arch/mips/loongson64/common/reset.c
rename to arch/mips/loongson64/reset.c
diff --git a/arch/mips/loongson64/common/rtc.c b/arch/mips/loongson64/rtc.c
similarity index 100%
rename from arch/mips/loongson64/common/rtc.c
rename to arch/mips/loongson64/rtc.c
diff --git a/arch/mips/loongson64/common/setup.c b/arch/mips/loongson64/setup.c
similarity index 100%
rename from arch/mips/loongson64/common/setup.c
rename to arch/mips/loongson64/setup.c
diff --git a/arch/mips/loongson64/loongson-3/smp.c b/arch/mips/loongson64/smp.c
similarity index 100%
rename from arch/mips/loongson64/loongson-3/smp.c
rename to arch/mips/loongson64/smp.c
diff --git a/arch/mips/loongson64/loongson-3/smp.h b/arch/mips/loongson64/smp.h
similarity index 100%
rename from arch/mips/loongson64/loongson-3/smp.h
rename to arch/mips/loongson64/smp.h
diff --git a/arch/mips/loongson64/common/time.c b/arch/mips/loongson64/time.c
similarity index 100%
rename from arch/mips/loongson64/common/time.c
rename to arch/mips/loongson64/time.c
diff --git a/arch/mips/pci/Makefile b/arch/mips/pci/Makefile
index d6de4cb2e31c..342ce10ef593 100644
--- a/arch/mips/pci/Makefile
+++ b/arch/mips/pci/Makefile
@@ -35,7 +35,7 @@ obj-$(CONFIG_LASAT)		+= pci-lasat.o
 obj-$(CONFIG_MIPS_COBALT)	+= fixup-cobalt.o
 obj-$(CONFIG_LEMOTE_FULOONG2E)	+= fixup-fuloong2e.o ops-loongson2.o
 obj-$(CONFIG_LEMOTE_MACH2F)	+= fixup-lemote2f.o ops-loongson2.o
-obj-$(CONFIG_LOONGSON_MACH3X)	+= fixup-loongson3.o ops-loongson3.o
+obj-$(CONFIG_MACH_LOONGSON64)	+= fixup-loongson3.o ops-loongson3.o
 obj-$(CONFIG_MIPS_MALTA)	+= fixup-malta.o pci-malta.o
 obj-$(CONFIG_PMC_MSP7120_GW)	+= fixup-pmcmsp.o ops-pmcmsp.o
 obj-$(CONFIG_PMC_MSP7120_EVAL)	+= fixup-pmcmsp.o ops-pmcmsp.o
diff --git a/drivers/platform/mips/Kconfig b/drivers/platform/mips/Kconfig
index 62ea1934fb6a..f4d0a86c00d0 100644
--- a/drivers/platform/mips/Kconfig
+++ b/drivers/platform/mips/Kconfig
@@ -17,8 +17,8 @@ menuconfig MIPS_PLATFORM_DEVICES
 if MIPS_PLATFORM_DEVICES
 
 config CPU_HWMON
-	tristate "Loongson CPU HWMon Driver"
-	depends on LOONGSON_MACH3X
+	tristate "Loongson-3 CPU HWMon Driver"
+	depends on CONFIG_MACH_LOONGSON64
 	select HWMON
 	default y
 	help
-- 
2.23.0


  reply	other threads:[~2019-10-20 15:02 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-20 14:43 [PATCH 0/5] MIPS: Loongson64: separate loongson2ef/loongson64 code Jiaxun Yang
2019-10-20 14:43 ` [PATCH 1/6] MIPS: Loongson64: Rename CPU TYPES Jiaxun Yang
2019-11-01 23:27   ` Paul Burton
2019-10-20 14:43 ` [PATCH 2/6] MIPS: Fork loongson2ef from loongson64 Jiaxun Yang
2019-11-01 23:27   ` Paul Burton
2019-10-20 14:43 ` [PATCH 3/6] MIPS: Loongson2ef: clean up loongson64 related code Jiaxun Yang
2019-11-01 23:27   ` Paul Burton
2019-10-20 15:01 ` [PATCH 4/6] MIPS: Loongson64: Cleanup unused code Jiaxun Yang
2019-10-20 15:01   ` Jiaxun Yang [this message]
2019-11-01 23:28     ` [PATCH 5/6] MIPS: Loongson64: Move files to the top-level directory Paul Burton
2019-10-20 15:01   ` [PATCH 6/6] MAINTAINERS: Fix entries for Loongson2EF and add myself to Loongson64 Jiaxun Yang
2019-11-01 23:28   ` [PATCH 4/6] MIPS: Loongson64: Cleanup unused code Paul Burton
2019-10-21  1:07 ` [PATCH 0/5] MIPS: Loongson64: separate loongson2ef/loongson64 code Huacai Chen
2019-10-21  3:55   ` Jiaxun Yang
2019-10-22  1:35     ` Huacai Chen
2019-10-22  2:47       ` Jiaxun Yang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191020150137.19256-2-jiaxun.yang@flygoat.com \
    --to=jiaxun.yang@flygoat.com \
    --cc=chenhc@lemote.com \
    --cc=linux-mips@vger.kernel.org \
    --cc=paul.burton@mips.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).