Skip to content

Commit 85c4354

Browse files
kelvincheungtsbogend
authored andcommitted
MIPS: loongson32: Switch to generic core
The generic MIPS core is fully compatible with Loongson-1 SoCs, so migrate Loongson-1 to it. Main changes are: - Merge CPU_LOONGSON1B and CPU_LOONGSON1C into a unified CPU_LOONGSON32, as both are based on the GS232 core. - Consolidate LOONGSON1_LS1B and LOONGSON1_LS1C Kconfig options into MACH_LOONGSON32. - Enable MACH_GENERIC_CORE and remove the legacy custom implementation. - Remove all Loongson-1 platform devices and associated code, which are now obsolete due to Device Tree support. - Misc cleanup. Partially based on earlier work by Jiaxun Yang. Link: https://lore.kernel.org/all/[email protected]/ Signed-off-by: Keguang Zhang <[email protected]> Signed-off-by: Thomas Bogendoerfer <[email protected]>
1 parent ec7c2a1 commit 85c4354

File tree

20 files changed

+33
-1057
lines changed

20 files changed

+33
-1057
lines changed

MAINTAINERS

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17017,7 +17017,6 @@ L: [email protected]
1701717017
S: Maintained
1701817018
F: Documentation/devicetree/bindings/*/loongson,ls1*.yaml
1701917019
F: arch/mips/boot/dts/loongson/loongson1*
17020-
F: arch/mips/include/asm/mach-loongson32/
1702117020
F: arch/mips/loongson32/
1702217021
F: drivers/*/*loongson1*
1702317022
F: drivers/mtd/nand/raw/loongson1-nand-controller.c

arch/mips/Kconfig

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,23 @@ config LANTIQ
480480

481481
config MACH_LOONGSON32
482482
bool "Loongson 32-bit family of machines"
483+
select MACH_GENERIC_CORE
484+
select USE_OF
485+
select BUILTIN_DTB
486+
select BOOT_ELF32
487+
select CEVT_R4K
488+
select CSRC_R4K
489+
select COMMON_CLK
490+
select DMA_NONCOHERENT
491+
select GENERIC_IRQ_SHOW_LEVEL
492+
select IRQ_MIPS_CPU
493+
select LS1X_IRQ
494+
select SYS_HAS_CPU_LOONGSON32
495+
select SYS_HAS_EARLY_PRINTK
496+
select USE_GENERIC_EARLY_PRINTK_8250
497+
select SYS_SUPPORTS_32BIT_KERNEL
498+
select SYS_SUPPORTS_LITTLE_ENDIAN
499+
select SYS_SUPPORTS_HIGHMEM
483500
select SYS_SUPPORTS_ZBOOT
484501
help
485502
This enables support for the Loongson-1 family of machines.
@@ -1386,25 +1403,20 @@ config CPU_LOONGSON2F
13861403
have a similar programming interface with FPGA northbridge used in
13871404
Loongson2E.
13881405

1389-
config CPU_LOONGSON1B
1390-
bool "Loongson 1B"
1391-
depends on SYS_HAS_CPU_LOONGSON1B
1392-
select CPU_LOONGSON32
1393-
select LEDS_GPIO_REGISTER
1394-
help
1395-
The Loongson 1B is a 32-bit SoC, which implements the MIPS32
1396-
Release 1 instruction set and part of the MIPS32 Release 2
1397-
instruction set.
1398-
1399-
config CPU_LOONGSON1C
1400-
bool "Loongson 1C"
1401-
depends on SYS_HAS_CPU_LOONGSON1C
1402-
select CPU_LOONGSON32
1406+
config CPU_LOONGSON32
1407+
bool "Loongson 32-bit CPU"
1408+
depends on SYS_HAS_CPU_LOONGSON32
1409+
select CPU_MIPS32
1410+
select CPU_MIPSR2
1411+
select CPU_HAS_PREFETCH
1412+
select CPU_HAS_LOAD_STORE_LR
1413+
select CPU_SUPPORTS_32BIT_KERNEL
1414+
select CPU_SUPPORTS_HIGHMEM
1415+
select CPU_SUPPORTS_CPUFREQ
14031416
select LEDS_GPIO_REGISTER
14041417
help
1405-
The Loongson 1C is a 32-bit SoC, which implements the MIPS32
1406-
Release 1 instruction set and part of the MIPS32 Release 2
1407-
instruction set.
1418+
The Loongson GS232 microarchitecture implements the MIPS32 Release 1
1419+
instruction set and part of the MIPS32 Release 2 instruction set.
14081420

14091421
config CPU_MIPS32_R1
14101422
bool "MIPS32 Release 1"
@@ -1839,15 +1851,6 @@ config CPU_LOONGSON2EF
18391851
select CPU_SUPPORTS_HUGEPAGES
18401852
select RTC_MC146818_LIB
18411853

1842-
config CPU_LOONGSON32
1843-
bool
1844-
select CPU_MIPS32
1845-
select CPU_MIPSR2
1846-
select CPU_HAS_PREFETCH
1847-
select CPU_SUPPORTS_32BIT_KERNEL
1848-
select CPU_SUPPORTS_HIGHMEM
1849-
select CPU_SUPPORTS_CPUFREQ
1850-
18511854
config CPU_BMIPS32_3300
18521855
select SMP_UP if SMP
18531856
bool
@@ -1885,10 +1888,7 @@ config SYS_HAS_CPU_LOONGSON2F
18851888
select CPU_SUPPORTS_CPUFREQ
18861889
select CPU_SUPPORTS_ADDRWINCFG if 64BIT
18871890

1888-
config SYS_HAS_CPU_LOONGSON1B
1889-
bool
1890-
1891-
config SYS_HAS_CPU_LOONGSON1C
1891+
config SYS_HAS_CPU_LOONGSON32
18921892
bool
18931893

18941894
config SYS_HAS_CPU_MIPS32_R1
@@ -2999,8 +2999,8 @@ choice
29992999
prompt "Kernel command line type"
30003000
depends on !CMDLINE_OVERRIDE
30013001
default MIPS_CMDLINE_FROM_DTB if USE_OF && !ATH79 && !MACH_INGENIC && \
3002-
!MACH_LOONGSON64 && !MIPS_MALTA && \
3003-
!CAVIUM_OCTEON_SOC
3002+
!MACH_LOONGSON64 && !MACH_LOONGSON32 && \
3003+
!MIPS_MALTA && !CAVIUM_OCTEON_SOC
30043004
default MIPS_CMDLINE_FROM_BOOTLOADER
30053005

30063006
config MIPS_CMDLINE_FROM_DTB

arch/mips/include/asm/cpu-type.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ static inline int __pure __get_cpu_type(const int cpu_type)
2424
case CPU_LOONGSON64:
2525
#endif
2626

27-
#if defined(CONFIG_SYS_HAS_CPU_LOONGSON1B) || \
28-
defined(CONFIG_SYS_HAS_CPU_LOONGSON1C)
27+
#ifdef CONFIG_SYS_HAS_CPU_LOONGSON32
2928
case CPU_LOONGSON32:
3029
#endif
3130

arch/mips/include/asm/mach-loongson32/irq.h

Lines changed: 0 additions & 107 deletions
This file was deleted.

arch/mips/include/asm/mach-loongson32/loongson1.h

Lines changed: 0 additions & 50 deletions
This file was deleted.

arch/mips/include/asm/mach-loongson32/platform.h

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)