mirror of
				git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
				synced 2025-09-04 20:19:47 +08:00 
			
		
		
		
	MIPS: Loongson64: Rename CPU TYPES
CPU_LOONGSON2 -> CPU_LOONGSON2EF CPU_LOONGSON3 -> CPU_LOONGSON64 As newer loongson-2 products (2G/2H/2K1000) can share kernel implementation with loongson-3 while 2E/2F are less similar with other LOONGSON64 products. Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com> Signed-off-by: Paul Burton <paulburton@kernel.org> Cc: linux-mips@vger.kernel.org Cc: chenhc@lemote.com Cc: paul.burton@mips.com
This commit is contained in:
		
							parent
							
								
									2409839ab6
								
							
						
					
					
						commit
						268a2d6001
					
				| @ -1377,9 +1377,9 @@ choice | |||||||
| 	prompt "CPU type" | 	prompt "CPU type" | ||||||
| 	default CPU_R4X00 | 	default CPU_R4X00 | ||||||
| 
 | 
 | ||||||
| config CPU_LOONGSON3 | config CPU_LOONGSON64 | ||||||
| 	bool "Loongson 3 CPU" | 	bool "Loongson GSx64 CPU" | ||||||
| 	depends on SYS_HAS_CPU_LOONGSON3 | 	depends on SYS_HAS_CPU_LOONGSON64 | ||||||
| 	select ARCH_HAS_PHYS_TO_DMA | 	select ARCH_HAS_PHYS_TO_DMA | ||||||
| 	select CPU_SUPPORTS_64BIT_KERNEL | 	select CPU_SUPPORTS_64BIT_KERNEL | ||||||
| 	select CPU_SUPPORTS_HIGHMEM | 	select CPU_SUPPORTS_HIGHMEM | ||||||
| @ -1394,19 +1394,19 @@ config CPU_LOONGSON3 | |||||||
| 	select GPIOLIB | 	select GPIOLIB | ||||||
| 	select SWIOTLB | 	select SWIOTLB | ||||||
| 	help | 	help | ||||||
| 		The Loongson 3 processor implements the MIPS64R2 instruction | 		The Loongson GSx64 series of processor cores implements the | ||||||
| 		set with many extensions. | 		MIPS64R2 instruction set with many extensions. | ||||||
| 
 | 
 | ||||||
| config LOONGSON3_ENHANCEMENT | config LOONGSON64_ENHANCEMENT | ||||||
| 	bool "New Loongson 3 CPU Enhancements" | 	bool "New Loongson GSx64E CPU Enhancements" | ||||||
| 	default n | 	default n | ||||||
| 	select CPU_MIPSR2 | 	select CPU_MIPSR2 | ||||||
| 	select CPU_HAS_PREFETCH | 	select CPU_HAS_PREFETCH | ||||||
| 	depends on CPU_LOONGSON3 | 	depends on CPU_LOONGSON64 | ||||||
| 	help | 	help | ||||||
| 	  New Loongson 3 CPU (since Loongson-3A R2, as opposed to Loongson-3A | 	  New Loongson GSx64E cores (since Loongson-3A R2, as opposed to Loongson-3A | ||||||
| 	  R1, Loongson-3B R1 and Loongson-3B R2) has many enhancements, such as | 	  R1, Loongson-3B R1 and Loongson-3B R2) has many enhancements, such as | ||||||
| 	  FTLB, L1-VCache, EI/DI/Wait/Prefetch instruction, DSP/DSPv2 ASE, User | 	  FTLB, L1-VCache, EI/DI/Wait/Prefetch instruction, DSP/DSPr2 ASE, User | ||||||
| 	  Local register, Read-Inhibit/Execute-Inhibit, SFB (Store Fill Buffer), | 	  Local register, Read-Inhibit/Execute-Inhibit, SFB (Store Fill Buffer), | ||||||
| 	  Fast TLB refill support, etc. | 	  Fast TLB refill support, etc. | ||||||
| 
 | 
 | ||||||
| @ -1418,7 +1418,7 @@ config LOONGSON3_ENHANCEMENT | |||||||
| config CPU_LOONGSON3_WORKAROUNDS | config CPU_LOONGSON3_WORKAROUNDS | ||||||
| 	bool "Old Loongson 3 LLSC Workarounds" | 	bool "Old Loongson 3 LLSC Workarounds" | ||||||
| 	default y if SMP | 	default y if SMP | ||||||
| 	depends on CPU_LOONGSON3 | 	depends on CPU_LOONGSON64 | ||||||
| 	help | 	help | ||||||
| 	  Loongson 3 processors have the llsc issues which require workarounds. | 	  Loongson 3 processors have the llsc issues which require workarounds. | ||||||
| 	  Without workarounds the system may hang unexpectedly. | 	  Without workarounds the system may hang unexpectedly. | ||||||
| @ -1433,7 +1433,7 @@ config CPU_LOONGSON3_WORKAROUNDS | |||||||
| config CPU_LOONGSON2E | config CPU_LOONGSON2E | ||||||
| 	bool "Loongson 2E" | 	bool "Loongson 2E" | ||||||
| 	depends on SYS_HAS_CPU_LOONGSON2E | 	depends on SYS_HAS_CPU_LOONGSON2E | ||||||
| 	select CPU_LOONGSON2 | 	select CPU_LOONGSON2EF | ||||||
| 	help | 	help | ||||||
| 	  The Loongson 2E processor implements the MIPS III instruction set | 	  The Loongson 2E processor implements the MIPS III instruction set | ||||||
| 	  with many extensions. | 	  with many extensions. | ||||||
| @ -1444,7 +1444,7 @@ config CPU_LOONGSON2E | |||||||
| config CPU_LOONGSON2F | config CPU_LOONGSON2F | ||||||
| 	bool "Loongson 2F" | 	bool "Loongson 2F" | ||||||
| 	depends on SYS_HAS_CPU_LOONGSON2F | 	depends on SYS_HAS_CPU_LOONGSON2F | ||||||
| 	select CPU_LOONGSON2 | 	select CPU_LOONGSON2EF | ||||||
| 	select GPIOLIB | 	select GPIOLIB | ||||||
| 	help | 	help | ||||||
| 	  The Loongson 2F processor implements the MIPS III instruction set | 	  The Loongson 2F processor implements the MIPS III instruction set | ||||||
| @ -1857,7 +1857,7 @@ config SYS_SUPPORTS_ZBOOT_UART_PROM | |||||||
| 	bool | 	bool | ||||||
| 	select SYS_SUPPORTS_ZBOOT | 	select SYS_SUPPORTS_ZBOOT | ||||||
| 
 | 
 | ||||||
| config CPU_LOONGSON2 | config CPU_LOONGSON2EF | ||||||
| 	bool | 	bool | ||||||
| 	select CPU_SUPPORTS_32BIT_KERNEL | 	select CPU_SUPPORTS_32BIT_KERNEL | ||||||
| 	select CPU_SUPPORTS_64BIT_KERNEL | 	select CPU_SUPPORTS_64BIT_KERNEL | ||||||
| @ -1900,7 +1900,7 @@ config CPU_BMIPS5000 | |||||||
| 	select SYS_SUPPORTS_HOTPLUG_CPU | 	select SYS_SUPPORTS_HOTPLUG_CPU | ||||||
| 	select CPU_HAS_RIXI | 	select CPU_HAS_RIXI | ||||||
| 
 | 
 | ||||||
| config SYS_HAS_CPU_LOONGSON3 | config SYS_HAS_CPU_LOONGSON64 | ||||||
| 	bool | 	bool | ||||||
| 	select CPU_SUPPORTS_CPUFREQ | 	select CPU_SUPPORTS_CPUFREQ | ||||||
| 	select CPU_HAS_RIXI | 	select CPU_HAS_RIXI | ||||||
| @ -2162,7 +2162,7 @@ choice | |||||||
| 
 | 
 | ||||||
| config PAGE_SIZE_4KB | config PAGE_SIZE_4KB | ||||||
| 	bool "4kB" | 	bool "4kB" | ||||||
| 	depends on !CPU_LOONGSON2 && !CPU_LOONGSON3 | 	depends on !CPU_LOONGSON2EF && !CPU_LOONGSON64 | ||||||
| 	help | 	help | ||||||
| 	  This option select the standard 4kB Linux page size.  On some | 	  This option select the standard 4kB Linux page size.  On some | ||||||
| 	  R3000-family processors this is the only available page size.  Using | 	  R3000-family processors this is the only available page size.  Using | ||||||
| @ -2616,7 +2616,7 @@ config CPU_SUPPORTS_MSA | |||||||
| 
 | 
 | ||||||
| config ARCH_FLATMEM_ENABLE | config ARCH_FLATMEM_ENABLE | ||||||
| 	def_bool y | 	def_bool y | ||||||
| 	depends on !NUMA && !CPU_LOONGSON2 | 	depends on !NUMA && !CPU_LOONGSON2EF | ||||||
| 
 | 
 | ||||||
| config ARCH_SPARSEMEM_ENABLE | config ARCH_SPARSEMEM_ENABLE | ||||||
| 	bool | 	bool | ||||||
| @ -2697,7 +2697,7 @@ config NODES_SHIFT | |||||||
| 
 | 
 | ||||||
| config HW_PERF_EVENTS | config HW_PERF_EVENTS | ||||||
| 	bool "Enable hardware performance counter support for perf events" | 	bool "Enable hardware performance counter support for perf events" | ||||||
| 	depends on PERF_EVENTS && !OPROFILE && (CPU_MIPS32 || CPU_MIPS64 || CPU_R10000 || CPU_SB1 || CPU_CAVIUM_OCTEON || CPU_XLP || CPU_LOONGSON3) | 	depends on PERF_EVENTS && !OPROFILE && (CPU_MIPS32 || CPU_MIPS64 || CPU_R10000 || CPU_SB1 || CPU_CAVIUM_OCTEON || CPU_XLP || CPU_LOONGSON64) | ||||||
| 	default y | 	default y | ||||||
| 	help | 	help | ||||||
| 	  Enable hardware performance counter support for perf events. If | 	  Enable hardware performance counter support for perf events. If | ||||||
|  | |||||||
| @ -33,7 +33,7 @@ extern void nlm_cop2_restore(struct nlm_cop2_state *); | |||||||
| #define cop2_present		1 | #define cop2_present		1 | ||||||
| #define cop2_lazy_restore	0 | #define cop2_lazy_restore	0 | ||||||
| 
 | 
 | ||||||
| #elif defined(CONFIG_CPU_LOONGSON3) | #elif defined(CONFIG_CPU_LOONGSON64) | ||||||
| 
 | 
 | ||||||
| #define cop2_present		1 | #define cop2_present		1 | ||||||
| #define cop2_lazy_restore	1 | #define cop2_lazy_restore	1 | ||||||
|  | |||||||
| @ -15,13 +15,12 @@ | |||||||
| static inline int __pure __get_cpu_type(const int cpu_type) | static inline int __pure __get_cpu_type(const int cpu_type) | ||||||
| { | { | ||||||
| 	switch (cpu_type) { | 	switch (cpu_type) { | ||||||
| #if defined(CONFIG_SYS_HAS_CPU_LOONGSON2E) || \ | #if defined(CONFIG_SYS_HAS_CPU_LOONGSON2EF) | ||||||
|     defined(CONFIG_SYS_HAS_CPU_LOONGSON2F) | 	case CPU_LOONGSON2EF: | ||||||
| 	case CPU_LOONGSON2: |  | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef CONFIG_SYS_HAS_CPU_LOONGSON3 | #ifdef CONFIG_SYS_HAS_CPU_LOONGSON64 | ||||||
| 	case CPU_LOONGSON3: | 	case CPU_LOONGSON64: | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #if defined(CONFIG_SYS_HAS_CPU_LOONGSON1B) || \ | #if defined(CONFIG_SYS_HAS_CPU_LOONGSON1B) || \ | ||||||
|  | |||||||
| @ -319,8 +319,8 @@ enum cpu_type_enum { | |||||||
| 	/*
 | 	/*
 | ||||||
| 	 * MIPS64 class processors | 	 * MIPS64 class processors | ||||||
| 	 */ | 	 */ | ||||||
| 	CPU_5KC, CPU_5KE, CPU_20KC, CPU_25KF, CPU_SB1, CPU_SB1A, CPU_LOONGSON2, | 	CPU_5KC, CPU_5KE, CPU_20KC, CPU_25KF, CPU_SB1, CPU_SB1A, CPU_LOONGSON2EF, | ||||||
| 	CPU_LOONGSON3, CPU_CAVIUM_OCTEON, CPU_CAVIUM_OCTEON_PLUS, | 	CPU_LOONGSON64, CPU_CAVIUM_OCTEON, CPU_CAVIUM_OCTEON_PLUS, | ||||||
| 	CPU_CAVIUM_OCTEON2, CPU_CAVIUM_OCTEON3, CPU_XLR, CPU_XLP, CPU_I6500, | 	CPU_CAVIUM_OCTEON2, CPU_CAVIUM_OCTEON3, CPU_XLR, CPU_XLP, CPU_I6500, | ||||||
| 
 | 
 | ||||||
| 	CPU_QEMU_GENERIC, | 	CPU_QEMU_GENERIC, | ||||||
|  | |||||||
| @ -23,7 +23,7 @@ | |||||||
|  * TLB hazards |  * TLB hazards | ||||||
|  */ |  */ | ||||||
| #if (defined(CONFIG_CPU_MIPSR2) || defined(CONFIG_CPU_MIPSR6)) && \ | #if (defined(CONFIG_CPU_MIPSR2) || defined(CONFIG_CPU_MIPSR6)) && \ | ||||||
| 	!defined(CONFIG_CPU_CAVIUM_OCTEON) && !defined(CONFIG_LOONGSON3_ENHANCEMENT) | 	!defined(CONFIG_CPU_CAVIUM_OCTEON) && !defined(CONFIG_LOONGSON64_ENHANCEMENT) | ||||||
| 
 | 
 | ||||||
| /*
 | /*
 | ||||||
|  * MIPSR2 defines ehb for hazard avoidance |  * MIPSR2 defines ehb for hazard avoidance | ||||||
| @ -158,7 +158,7 @@ do {									\ | |||||||
| } while (0) | } while (0) | ||||||
| 
 | 
 | ||||||
| #elif defined(CONFIG_MIPS_ALCHEMY) || defined(CONFIG_CPU_CAVIUM_OCTEON) || \ | #elif defined(CONFIG_MIPS_ALCHEMY) || defined(CONFIG_CPU_CAVIUM_OCTEON) || \ | ||||||
| 	defined(CONFIG_CPU_LOONGSON2) || defined(CONFIG_LOONGSON3_ENHANCEMENT) || \ | 	defined(CONFIG_CPU_LOONGSON2EF) || defined(CONFIG_LOONGSON64_ENHANCEMENT) || \ | ||||||
| 	defined(CONFIG_CPU_R10000) || defined(CONFIG_CPU_R5500) || defined(CONFIG_CPU_XLR) | 	defined(CONFIG_CPU_R10000) || defined(CONFIG_CPU_R5500) || defined(CONFIG_CPU_XLR) | ||||||
| 
 | 
 | ||||||
| /*
 | /*
 | ||||||
|  | |||||||
| @ -306,7 +306,7 @@ static inline void iounmap(const volatile void __iomem *addr) | |||||||
| #undef __IS_KSEG1 | #undef __IS_KSEG1 | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| #if defined(CONFIG_CPU_CAVIUM_OCTEON) || defined(CONFIG_CPU_LOONGSON3) | #if defined(CONFIG_CPU_CAVIUM_OCTEON) || defined(CONFIG_CPU_LOONGSON64) | ||||||
| #define war_io_reorder_wmb()		wmb() | #define war_io_reorder_wmb()		wmb() | ||||||
| #else | #else | ||||||
| #define war_io_reorder_wmb()		barrier() | #define war_io_reorder_wmb()		barrier() | ||||||
|  | |||||||
| @ -41,7 +41,7 @@ static inline unsigned long arch_local_irq_save(void) | |||||||
| 	"	.set	push						\n" | 	"	.set	push						\n" | ||||||
| 	"	.set	reorder						\n" | 	"	.set	reorder						\n" | ||||||
| 	"	.set	noat						\n" | 	"	.set	noat						\n" | ||||||
| #if defined(CONFIG_CPU_LOONGSON3) || defined (CONFIG_CPU_LOONGSON1) | #if defined(CONFIG_CPU_LOONGSON64) || defined (CONFIG_CPU_LOONGSON1) | ||||||
| 	"	mfc0	%[flags], $12					\n" | 	"	mfc0	%[flags], $12					\n" | ||||||
| 	"	di							\n" | 	"	di							\n" | ||||||
| #else | #else | ||||||
|  | |||||||
| @ -44,7 +44,7 @@ | |||||||
| #define cpu_has_vtag_icache	0 | #define cpu_has_vtag_icache	0 | ||||||
| #define cpu_has_watch		1 | #define cpu_has_watch		1 | ||||||
| 
 | 
 | ||||||
| #ifdef CONFIG_CPU_LOONGSON3 | #ifdef CONFIG_CPU_LOONGSON64 | ||||||
| #define cpu_has_wsbh		1 | #define cpu_has_wsbh		1 | ||||||
| #define cpu_has_ic_fills_f_dc	1 | #define cpu_has_ic_fills_f_dc	1 | ||||||
| #define cpu_hwrena_impl_bits	0xc0000000 | #define cpu_hwrena_impl_bits	0xc0000000 | ||||||
|  | |||||||
| @ -4,7 +4,7 @@ | |||||||
| 
 | 
 | ||||||
| #include <boot_param.h> | #include <boot_param.h> | ||||||
| 
 | 
 | ||||||
| #ifdef CONFIG_CPU_LOONGSON3 | #ifdef CONFIG_CPU_LOONGSON64 | ||||||
| 
 | 
 | ||||||
| /* cpu core interrupt numbers */ | /* cpu core interrupt numbers */ | ||||||
| #define MIPS_CPU_IRQ_BASE 56 | #define MIPS_CPU_IRQ_BASE 56 | ||||||
|  | |||||||
| @ -17,7 +17,7 @@ | |||||||
|  * Override macros used in arch/mips/kernel/head.S. |  * Override macros used in arch/mips/kernel/head.S. | ||||||
|  */ |  */ | ||||||
| 	.macro	kernel_entry_setup | 	.macro	kernel_entry_setup | ||||||
| #ifdef CONFIG_CPU_LOONGSON3 | #ifdef CONFIG_CPU_LOONGSON64 | ||||||
| 	.set	push | 	.set	push | ||||||
| 	.set	mips64 | 	.set	mips64 | ||||||
| 	/* Set LPA on LOONGSON3 config3 */ | 	/* Set LPA on LOONGSON3 config3 */ | ||||||
| @ -54,7 +54,7 @@ | |||||||
|  * Do SMP slave processor setup. |  * Do SMP slave processor setup. | ||||||
|  */ |  */ | ||||||
| 	.macro	smp_slave_setup | 	.macro	smp_slave_setup | ||||||
| #ifdef CONFIG_CPU_LOONGSON3 | #ifdef CONFIG_CPU_LOONGSON64 | ||||||
| 	.set	push | 	.set	push | ||||||
| 	.set	mips64 | 	.set	mips64 | ||||||
| 	/* Set LPA on LOONGSON3 config3 */ | 	/* Set LPA on LOONGSON3 config3 */ | ||||||
|  | |||||||
| @ -109,7 +109,7 @@ static inline void do_perfcnt_IRQ(void) | |||||||
| #define LOONGSON_PCICFG_SIZE	0x00000800	/* 2K */ | #define LOONGSON_PCICFG_SIZE	0x00000800	/* 2K */ | ||||||
| #define LOONGSON_PCICFG_TOP	(LOONGSON_PCICFG_BASE+LOONGSON_PCICFG_SIZE-1) | #define LOONGSON_PCICFG_TOP	(LOONGSON_PCICFG_BASE+LOONGSON_PCICFG_SIZE-1) | ||||||
| 
 | 
 | ||||||
| #ifdef CONFIG_CPU_LOONGSON3 | #ifdef CONFIG_CPU_LOONGSON64 | ||||||
| #define LOONGSON_PCIIO_BASE	loongson_sysconf.pci_io_base | #define LOONGSON_PCIIO_BASE	loongson_sysconf.pci_io_base | ||||||
| #else | #else | ||||||
| #define LOONGSON_PCIIO_BASE	0x1fd00000 | #define LOONGSON_PCIIO_BASE	0x1fd00000 | ||||||
|  | |||||||
| @ -35,7 +35,7 @@ extern struct pci_ops loongson_pci_ops; | |||||||
| #else	/* loongson2f/32bit & loongson2e */ | #else	/* loongson2f/32bit & loongson2e */ | ||||||
| 
 | 
 | ||||||
| /* this pci memory space is mapped by pcimap in pci.c */ | /* this pci memory space is mapped by pcimap in pci.c */ | ||||||
| #ifdef CONFIG_CPU_LOONGSON3 | #ifdef CONFIG_CPU_LOONGSON64 | ||||||
| #define LOONGSON_PCI_MEM_START	0x40000000UL | #define LOONGSON_PCI_MEM_START	0x40000000UL | ||||||
| #define LOONGSON_PCI_MEM_END	0x7effffffUL | #define LOONGSON_PCI_MEM_END	0x7effffffUL | ||||||
| #else | #else | ||||||
|  | |||||||
| @ -121,10 +121,10 @@ search_module_dbetables(unsigned long addr) | |||||||
| #define MODULE_PROC_FAMILY "SB1 " | #define MODULE_PROC_FAMILY "SB1 " | ||||||
| #elif defined CONFIG_CPU_LOONGSON1 | #elif defined CONFIG_CPU_LOONGSON1 | ||||||
| #define MODULE_PROC_FAMILY "LOONGSON1 " | #define MODULE_PROC_FAMILY "LOONGSON1 " | ||||||
| #elif defined CONFIG_CPU_LOONGSON2 | #elif defined CONFIG_CPU_LOONGSON2EF | ||||||
| #define MODULE_PROC_FAMILY "LOONGSON2 " | #define MODULE_PROC_FAMILY "LOONGSON2EF " | ||||||
| #elif defined CONFIG_CPU_LOONGSON3 | #elif defined CONFIG_CPU_LOONGSON64 | ||||||
| #define MODULE_PROC_FAMILY "LOONGSON3 " | #define MODULE_PROC_FAMILY "LOONGSON64 " | ||||||
| #elif defined CONFIG_CPU_CAVIUM_OCTEON | #elif defined CONFIG_CPU_CAVIUM_OCTEON | ||||||
| #define MODULE_PROC_FAMILY "OCTEON " | #define MODULE_PROC_FAMILY "OCTEON " | ||||||
| #elif defined CONFIG_CPU_XLR | #elif defined CONFIG_CPU_XLR | ||||||
|  | |||||||
| @ -385,7 +385,7 @@ unsigned long get_wchan(struct task_struct *p); | |||||||
| #define KSTK_ESP(tsk) (task_pt_regs(tsk)->regs[29]) | #define KSTK_ESP(tsk) (task_pt_regs(tsk)->regs[29]) | ||||||
| #define KSTK_STATUS(tsk) (task_pt_regs(tsk)->cp0_status) | #define KSTK_STATUS(tsk) (task_pt_regs(tsk)->cp0_status) | ||||||
| 
 | 
 | ||||||
| #ifdef CONFIG_CPU_LOONGSON3 | #ifdef CONFIG_CPU_LOONGSON64 | ||||||
| /*
 | /*
 | ||||||
|  * Loongson-3's SFB (Store-Fill-Buffer) may buffer writes indefinitely when a |  * Loongson-3's SFB (Store-Fill-Buffer) may buffer writes indefinitely when a | ||||||
|  * tight read loop is executed, because reads take priority over writes & the |  * tight read loop is executed, because reads take priority over writes & the | ||||||
|  | |||||||
| @ -72,7 +72,7 @@ static inline void flush_scache_line_indexed(unsigned long addr) | |||||||
| static inline void flush_icache_line(unsigned long addr) | static inline void flush_icache_line(unsigned long addr) | ||||||
| { | { | ||||||
| 	switch (boot_cpu_type()) { | 	switch (boot_cpu_type()) { | ||||||
| 	case CPU_LOONGSON2: | 	case CPU_LOONGSON2EF: | ||||||
| 		cache_op(Hit_Invalidate_I_Loongson2, addr); | 		cache_op(Hit_Invalidate_I_Loongson2, addr); | ||||||
| 		break; | 		break; | ||||||
| 
 | 
 | ||||||
| @ -154,7 +154,7 @@ static inline void flush_scache_line(unsigned long addr) | |||||||
| static inline int protected_flush_icache_line(unsigned long addr) | static inline int protected_flush_icache_line(unsigned long addr) | ||||||
| { | { | ||||||
| 	switch (boot_cpu_type()) { | 	switch (boot_cpu_type()) { | ||||||
| 	case CPU_LOONGSON2: | 	case CPU_LOONGSON2EF: | ||||||
| 		return protected_cache_op(Hit_Invalidate_I_Loongson2, addr); | 		return protected_cache_op(Hit_Invalidate_I_Loongson2, addr); | ||||||
| 
 | 
 | ||||||
| 	default: | 	default: | ||||||
|  | |||||||
| @ -608,7 +608,7 @@ static int set_ftlb_enable(struct cpuinfo_mips *c, enum ftlb_flags flags) | |||||||
| 		if (!(flags & FTLB_EN)) | 		if (!(flags & FTLB_EN)) | ||||||
| 			return 1; | 			return 1; | ||||||
| 		return 0; | 		return 0; | ||||||
| 	case CPU_LOONGSON3: | 	case CPU_LOONGSON64: | ||||||
| 		/* Flush ITLB, DTLB, VTLB and FTLB */ | 		/* Flush ITLB, DTLB, VTLB and FTLB */ | ||||||
| 		write_c0_diag(LOONGSON_DIAG_ITLB | LOONGSON_DIAG_DTLB | | 		write_c0_diag(LOONGSON_DIAG_ITLB | LOONGSON_DIAG_DTLB | | ||||||
| 			      LOONGSON_DIAG_VTLB | LOONGSON_DIAG_FTLB); | 			      LOONGSON_DIAG_VTLB | LOONGSON_DIAG_FTLB); | ||||||
| @ -1529,21 +1529,21 @@ static inline void cpu_probe_legacy(struct cpuinfo_mips *c, unsigned int cpu) | |||||||
| 	case PRID_IMP_LOONGSON_64C:  /* Loongson-2/3 */ | 	case PRID_IMP_LOONGSON_64C:  /* Loongson-2/3 */ | ||||||
| 		switch (c->processor_id & PRID_REV_MASK) { | 		switch (c->processor_id & PRID_REV_MASK) { | ||||||
| 		case PRID_REV_LOONGSON2E: | 		case PRID_REV_LOONGSON2E: | ||||||
| 			c->cputype = CPU_LOONGSON2; | 			c->cputype = CPU_LOONGSON2EF; | ||||||
| 			__cpu_name[cpu] = "ICT Loongson-2"; | 			__cpu_name[cpu] = "ICT Loongson-2"; | ||||||
| 			set_elf_platform(cpu, "loongson2e"); | 			set_elf_platform(cpu, "loongson2e"); | ||||||
| 			set_isa(c, MIPS_CPU_ISA_III); | 			set_isa(c, MIPS_CPU_ISA_III); | ||||||
| 			c->fpu_msk31 |= FPU_CSR_CONDX; | 			c->fpu_msk31 |= FPU_CSR_CONDX; | ||||||
| 			break; | 			break; | ||||||
| 		case PRID_REV_LOONGSON2F: | 		case PRID_REV_LOONGSON2F: | ||||||
| 			c->cputype = CPU_LOONGSON2; | 			c->cputype = CPU_LOONGSON2EF; | ||||||
| 			__cpu_name[cpu] = "ICT Loongson-2"; | 			__cpu_name[cpu] = "ICT Loongson-2"; | ||||||
| 			set_elf_platform(cpu, "loongson2f"); | 			set_elf_platform(cpu, "loongson2f"); | ||||||
| 			set_isa(c, MIPS_CPU_ISA_III); | 			set_isa(c, MIPS_CPU_ISA_III); | ||||||
| 			c->fpu_msk31 |= FPU_CSR_CONDX; | 			c->fpu_msk31 |= FPU_CSR_CONDX; | ||||||
| 			break; | 			break; | ||||||
| 		case PRID_REV_LOONGSON3A_R1: | 		case PRID_REV_LOONGSON3A_R1: | ||||||
| 			c->cputype = CPU_LOONGSON3; | 			c->cputype = CPU_LOONGSON64; | ||||||
| 			__cpu_name[cpu] = "ICT Loongson-3"; | 			__cpu_name[cpu] = "ICT Loongson-3"; | ||||||
| 			set_elf_platform(cpu, "loongson3a"); | 			set_elf_platform(cpu, "loongson3a"); | ||||||
| 			set_isa(c, MIPS_CPU_ISA_M64R1); | 			set_isa(c, MIPS_CPU_ISA_M64R1); | ||||||
| @ -1552,7 +1552,7 @@ static inline void cpu_probe_legacy(struct cpuinfo_mips *c, unsigned int cpu) | |||||||
| 			break; | 			break; | ||||||
| 		case PRID_REV_LOONGSON3B_R1: | 		case PRID_REV_LOONGSON3B_R1: | ||||||
| 		case PRID_REV_LOONGSON3B_R2: | 		case PRID_REV_LOONGSON3B_R2: | ||||||
| 			c->cputype = CPU_LOONGSON3; | 			c->cputype = CPU_LOONGSON64; | ||||||
| 			__cpu_name[cpu] = "ICT Loongson-3"; | 			__cpu_name[cpu] = "ICT Loongson-3"; | ||||||
| 			set_elf_platform(cpu, "loongson3b"); | 			set_elf_platform(cpu, "loongson3b"); | ||||||
| 			set_isa(c, MIPS_CPU_ISA_M64R1); | 			set_isa(c, MIPS_CPU_ISA_M64R1); | ||||||
| @ -1908,14 +1908,14 @@ static inline void cpu_probe_loongson(struct cpuinfo_mips *c, unsigned int cpu) | |||||||
| 		switch (c->processor_id & PRID_REV_MASK) { | 		switch (c->processor_id & PRID_REV_MASK) { | ||||||
| 		case PRID_REV_LOONGSON3A_R2_0: | 		case PRID_REV_LOONGSON3A_R2_0: | ||||||
| 		case PRID_REV_LOONGSON3A_R2_1: | 		case PRID_REV_LOONGSON3A_R2_1: | ||||||
| 			c->cputype = CPU_LOONGSON3; | 			c->cputype = CPU_LOONGSON64; | ||||||
| 			__cpu_name[cpu] = "ICT Loongson-3"; | 			__cpu_name[cpu] = "ICT Loongson-3"; | ||||||
| 			set_elf_platform(cpu, "loongson3a"); | 			set_elf_platform(cpu, "loongson3a"); | ||||||
| 			set_isa(c, MIPS_CPU_ISA_M64R2); | 			set_isa(c, MIPS_CPU_ISA_M64R2); | ||||||
| 			break; | 			break; | ||||||
| 		case PRID_REV_LOONGSON3A_R3_0: | 		case PRID_REV_LOONGSON3A_R3_0: | ||||||
| 		case PRID_REV_LOONGSON3A_R3_1: | 		case PRID_REV_LOONGSON3A_R3_1: | ||||||
| 			c->cputype = CPU_LOONGSON3; | 			c->cputype = CPU_LOONGSON64; | ||||||
| 			__cpu_name[cpu] = "ICT Loongson-3"; | 			__cpu_name[cpu] = "ICT Loongson-3"; | ||||||
| 			set_elf_platform(cpu, "loongson3a"); | 			set_elf_platform(cpu, "loongson3a"); | ||||||
| 			set_isa(c, MIPS_CPU_ISA_M64R2); | 			set_isa(c, MIPS_CPU_ISA_M64R2); | ||||||
| @ -1929,7 +1929,7 @@ static inline void cpu_probe_loongson(struct cpuinfo_mips *c, unsigned int cpu) | |||||||
| 			MIPS_ASE_LOONGSON_EXT | MIPS_ASE_LOONGSON_EXT2); | 			MIPS_ASE_LOONGSON_EXT | MIPS_ASE_LOONGSON_EXT2); | ||||||
| 		break; | 		break; | ||||||
| 	case PRID_IMP_LOONGSON_64G: | 	case PRID_IMP_LOONGSON_64G: | ||||||
| 		c->cputype = CPU_LOONGSON3; | 		c->cputype = CPU_LOONGSON64; | ||||||
| 		__cpu_name[cpu] = "ICT Loongson-3"; | 		__cpu_name[cpu] = "ICT Loongson-3"; | ||||||
| 		set_elf_platform(cpu, "loongson3a"); | 		set_elf_platform(cpu, "loongson3a"); | ||||||
| 		set_isa(c, MIPS_CPU_ISA_M64R2); | 		set_isa(c, MIPS_CPU_ISA_M64R2); | ||||||
|  | |||||||
| @ -178,7 +178,7 @@ void __init check_wait(void) | |||||||
| 	case CPU_XLP: | 	case CPU_XLP: | ||||||
| 		cpu_wait = r4k_wait; | 		cpu_wait = r4k_wait; | ||||||
| 		break; | 		break; | ||||||
| 	case CPU_LOONGSON3: | 	case CPU_LOONGSON64: | ||||||
| 		if ((c->processor_id & (PRID_IMP_MASK | PRID_REV_MASK)) >= | 		if ((c->processor_id & (PRID_IMP_MASK | PRID_REV_MASK)) >= | ||||||
| 				(PRID_IMP_LOONGSON_64C | PRID_REV_LOONGSON3A_R2_0)) | 				(PRID_IMP_LOONGSON_64C | PRID_REV_LOONGSON3A_R2_0)) | ||||||
| 			cpu_wait = r4k_wait; | 			cpu_wait = r4k_wait; | ||||||
|  | |||||||
| @ -1623,7 +1623,7 @@ static const struct mips_perf_event *mipsxx_pmu_map_raw_event(u64 config) | |||||||
| 			raw_event.cntr_mask = | 			raw_event.cntr_mask = | ||||||
| 				raw_id > 127 ? CNTR_ODD : CNTR_EVEN; | 				raw_id > 127 ? CNTR_ODD : CNTR_EVEN; | ||||||
| 		break; | 		break; | ||||||
| 	case CPU_LOONGSON3: | 	case CPU_LOONGSON64: | ||||||
| 		raw_event.cntr_mask = raw_id > 127 ? CNTR_ODD : CNTR_EVEN; | 		raw_event.cntr_mask = raw_id > 127 ? CNTR_ODD : CNTR_EVEN; | ||||||
| 	break; | 	break; | ||||||
| 	} | 	} | ||||||
| @ -1769,7 +1769,7 @@ init_hw_perf_events(void) | |||||||
| 		mipspmu.general_event_map = &mipsxxcore_event_map; | 		mipspmu.general_event_map = &mipsxxcore_event_map; | ||||||
| 		mipspmu.cache_event_map = &mipsxxcore_cache_map; | 		mipspmu.cache_event_map = &mipsxxcore_cache_map; | ||||||
| 		break; | 		break; | ||||||
| 	case CPU_LOONGSON3: | 	case CPU_LOONGSON64: | ||||||
| 		mipspmu.name = "mips/loongson3"; | 		mipspmu.name = "mips/loongson3"; | ||||||
| 		mipspmu.general_event_map = &loongson3_event_map; | 		mipspmu.general_event_map = &loongson3_event_map; | ||||||
| 		mipspmu.cache_event_map = &loongson3_cache_map; | 		mipspmu.cache_event_map = &loongson3_cache_map; | ||||||
|  | |||||||
| @ -287,7 +287,7 @@ static unsigned long __init init_initrd(void) | |||||||
|  * Initialize the bootmem allocator. It also setup initrd related data |  * Initialize the bootmem allocator. It also setup initrd related data | ||||||
|  * if needed. |  * if needed. | ||||||
|  */ |  */ | ||||||
| #if defined(CONFIG_SGI_IP27) || (defined(CONFIG_CPU_LOONGSON3) && defined(CONFIG_NUMA)) | #if defined(CONFIG_SGI_IP27) || (defined(CONFIG_CPU_LOONGSON64) && defined(CONFIG_NUMA)) | ||||||
| 
 | 
 | ||||||
| static void __init bootmem_init(void) | static void __init bootmem_init(void) | ||||||
| { | { | ||||||
|  | |||||||
| @ -2394,7 +2394,7 @@ void __init trap_init(void) | |||||||
| 	else { | 	else { | ||||||
| 		if (cpu_has_vtag_icache) | 		if (cpu_has_vtag_icache) | ||||||
| 			set_except_vector(EXCCODE_RI, handle_ri_rdhwr_tlbp); | 			set_except_vector(EXCCODE_RI, handle_ri_rdhwr_tlbp); | ||||||
| 		else if (current_cpu_type() == CPU_LOONGSON3) | 		else if (current_cpu_type() == CPU_LOONGSON64) | ||||||
| 			set_except_vector(EXCCODE_RI, handle_ri_rdhwr_tlbp); | 			set_except_vector(EXCCODE_RI, handle_ri_rdhwr_tlbp); | ||||||
| 		else | 		else | ||||||
| 			set_except_vector(EXCCODE_RI, handle_ri_rdhwr); | 			set_except_vector(EXCCODE_RI, handle_ri_rdhwr); | ||||||
|  | |||||||
| @ -279,7 +279,7 @@ EXPORT_SYMBOL(csum_partial) | |||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| 	/* odd buffer alignment? */ | 	/* odd buffer alignment? */ | ||||||
| #if defined(CONFIG_CPU_MIPSR2) || defined(CONFIG_CPU_LOONGSON3) | #if defined(CONFIG_CPU_MIPSR2) || defined(CONFIG_CPU_LOONGSON64) | ||||||
| 	.set	push
 | 	.set	push
 | ||||||
| 	.set	arch=mips32r2 | 	.set	arch=mips32r2 | ||||||
| 	wsbh	v1, sum | 	wsbh	v1, sum | ||||||
| @ -732,7 +732,7 @@ EXPORT_SYMBOL(csum_partial) | |||||||
| 	addu	sum, v1 | 	addu	sum, v1 | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #if defined(CONFIG_CPU_MIPSR2) || defined(CONFIG_CPU_LOONGSON3) | #if defined(CONFIG_CPU_MIPSR2) || defined(CONFIG_CPU_LOONGSON64) | ||||||
| 	.set	push
 | 	.set	push
 | ||||||
| 	.set	arch=mips32r2 | 	.set	arch=mips32r2 | ||||||
| 	wsbh	v1, sum | 	wsbh	v1, sum | ||||||
|  | |||||||
| @ -79,7 +79,7 @@ config LOONGSON_MACH3X | |||||||
| 	select I8259 | 	select I8259 | ||||||
| 	select IRQ_MIPS_CPU | 	select IRQ_MIPS_CPU | ||||||
| 	select NR_CPUS_DEFAULT_4 | 	select NR_CPUS_DEFAULT_4 | ||||||
| 	select SYS_HAS_CPU_LOONGSON3 | 	select SYS_HAS_CPU_LOONGSON64 | ||||||
| 	select SYS_HAS_EARLY_PRINTK | 	select SYS_HAS_EARLY_PRINTK | ||||||
| 	select SYS_SUPPORTS_SMP | 	select SYS_SUPPORTS_SMP | ||||||
| 	select SYS_SUPPORTS_HOTPLUG_CPU | 	select SYS_SUPPORTS_HOTPLUG_CPU | ||||||
|  | |||||||
| @ -21,4 +21,4 @@ obj-$(CONFIG_LEMOTE_MACH2F)  += lemote-2f/ | |||||||
| # All Loongson-3 family machines
 | # All Loongson-3 family machines
 | ||||||
| #
 | #
 | ||||||
| 
 | 
 | ||||||
| obj-$(CONFIG_CPU_LOONGSON3)  += loongson-3/ | obj-$(CONFIG_CPU_LOONGSON64)  += loongson-3/ | ||||||
|  | |||||||
| @ -3,7 +3,7 @@ | |||||||
| # | # | ||||||
| 
 | 
 | ||||||
| # Only gcc >= 4.4 have Loongson specific support | # Only gcc >= 4.4 have Loongson specific support | ||||||
| cflags-$(CONFIG_CPU_LOONGSON2)	+= -Wa,--trap | cflags-$(CONFIG_CPU_LOONGSON2EF)	+= -Wa,--trap | ||||||
| cflags-$(CONFIG_CPU_LOONGSON2E) += \ | cflags-$(CONFIG_CPU_LOONGSON2E) += \ | ||||||
| 	$(call cc-option,-march=loongson2e,-march=r4600) | 	$(call cc-option,-march=loongson2e,-march=r4600) | ||||||
| cflags-$(CONFIG_CPU_LOONGSON2F) += \ | cflags-$(CONFIG_CPU_LOONGSON2F) += \ | ||||||
| @ -22,7 +22,7 @@ ifdef CONFIG_CPU_LOONGSON2F_WORKAROUNDS | |||||||
|   endif |   endif | ||||||
| endif | endif | ||||||
| 
 | 
 | ||||||
| cflags-$(CONFIG_CPU_LOONGSON3)	+= -Wa,--trap | cflags-$(CONFIG_CPU_LOONGSON64)	+= -Wa,--trap | ||||||
| 
 | 
 | ||||||
| # | # | ||||||
| # Some versions of binutils, not currently mainline as of 2019/02/04, support | # Some versions of binutils, not currently mainline as of 2019/02/04, support | ||||||
| @ -44,7 +44,7 @@ cflags-$(CONFIG_CPU_LOONGSON3)	+= -Wa,--trap | |||||||
| # binutils does not merge support for the flag then we can revisit & remove | # binutils does not merge support for the flag then we can revisit & remove | ||||||
| # this later - for now it ensures vendor toolchains don't cause problems. | # this later - for now it ensures vendor toolchains don't cause problems. | ||||||
| # | # | ||||||
| cflags-$(CONFIG_CPU_LOONGSON3)	+= $(call as-option,-Wa$(comma)-mno-fix-loongson3-llsc,) | cflags-$(CONFIG_CPU_LOONGSON64)	+= $(call as-option,-Wa$(comma)-mno-fix-loongson3-llsc,) | ||||||
| 
 | 
 | ||||||
| # | # | ||||||
| # binutils from v2.25 on and gcc starting from v4.9.0 treat -march=loongson3a | # binutils from v2.25 on and gcc starting from v4.9.0 treat -march=loongson3a | ||||||
| @ -55,14 +55,14 @@ cflags-$(CONFIG_CPU_LOONGSON3)	+= $(call as-option,-Wa$(comma)-mno-fix-loongson3 | |||||||
| # | # | ||||||
| ifeq ($(call cc-ifversion, -ge, 0409, y), y) | ifeq ($(call cc-ifversion, -ge, 0409, y), y) | ||||||
|   ifeq ($(call ld-ifversion, -ge, 225000000, y), y) |   ifeq ($(call ld-ifversion, -ge, 225000000, y), y) | ||||||
|     cflags-$(CONFIG_CPU_LOONGSON3)  += \ |     cflags-$(CONFIG_CPU_LOONGSON64)  += \ | ||||||
|       $(call cc-option,-march=loongson3a -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS64) |       $(call cc-option,-march=loongson3a -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS64) | ||||||
|   else |   else | ||||||
|     cflags-$(CONFIG_CPU_LOONGSON3)  += \ |     cflags-$(CONFIG_CPU_LOONGSON64)  += \ | ||||||
|       $(call cc-option,-march=mips64r2,-mips64r2 -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS64) |       $(call cc-option,-march=mips64r2,-mips64r2 -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS64) | ||||||
|   endif |   endif | ||||||
| else | else | ||||||
|     cflags-$(CONFIG_CPU_LOONGSON3)  += \ |     cflags-$(CONFIG_CPU_LOONGSON64)  += \ | ||||||
|       $(call cc-option,-march=mips64r2,-mips64r2 -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS64) |       $(call cc-option,-march=mips64r2,-mips64r2 -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS64) | ||||||
| endif | endif | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -87,7 +87,7 @@ static int __init pcibios_init(void) | |||||||
| #endif | #endif | ||||||
| 	register_pci_controller(&loongson_pci_controller); | 	register_pci_controller(&loongson_pci_controller); | ||||||
| 
 | 
 | ||||||
| #ifdef CONFIG_CPU_LOONGSON3 | #ifdef CONFIG_CPU_LOONGSON64 | ||||||
| 	sbx00_acpi_init(); | 	sbx00_acpi_init(); | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -324,7 +324,7 @@ static void r4k_blast_icache_page_setup(void) | |||||||
| 		r4k_blast_icache_page = (void *)cache_noop; | 		r4k_blast_icache_page = (void *)cache_noop; | ||||||
| 	else if (ic_lsize == 16) | 	else if (ic_lsize == 16) | ||||||
| 		r4k_blast_icache_page = blast_icache16_page; | 		r4k_blast_icache_page = blast_icache16_page; | ||||||
| 	else if (ic_lsize == 32 && current_cpu_type() == CPU_LOONGSON2) | 	else if (ic_lsize == 32 && current_cpu_type() == CPU_LOONGSON2EF) | ||||||
| 		r4k_blast_icache_page = loongson2_blast_icache32_page; | 		r4k_blast_icache_page = loongson2_blast_icache32_page; | ||||||
| 	else if (ic_lsize == 32) | 	else if (ic_lsize == 32) | ||||||
| 		r4k_blast_icache_page = blast_icache32_page; | 		r4k_blast_icache_page = blast_icache32_page; | ||||||
| @ -373,7 +373,7 @@ static void r4k_blast_icache_page_indexed_setup(void) | |||||||
| 		else if (TX49XX_ICACHE_INDEX_INV_WAR) | 		else if (TX49XX_ICACHE_INDEX_INV_WAR) | ||||||
| 			r4k_blast_icache_page_indexed = | 			r4k_blast_icache_page_indexed = | ||||||
| 				tx49_blast_icache32_page_indexed; | 				tx49_blast_icache32_page_indexed; | ||||||
| 		else if (current_cpu_type() == CPU_LOONGSON2) | 		else if (current_cpu_type() == CPU_LOONGSON2EF) | ||||||
| 			r4k_blast_icache_page_indexed = | 			r4k_blast_icache_page_indexed = | ||||||
| 				loongson2_blast_icache32_page_indexed; | 				loongson2_blast_icache32_page_indexed; | ||||||
| 		else | 		else | ||||||
| @ -399,7 +399,7 @@ static void r4k_blast_icache_setup(void) | |||||||
| 			r4k_blast_icache = blast_r4600_v1_icache32; | 			r4k_blast_icache = blast_r4600_v1_icache32; | ||||||
| 		else if (TX49XX_ICACHE_INDEX_INV_WAR) | 		else if (TX49XX_ICACHE_INDEX_INV_WAR) | ||||||
| 			r4k_blast_icache = tx49_blast_icache32; | 			r4k_blast_icache = tx49_blast_icache32; | ||||||
| 		else if (current_cpu_type() == CPU_LOONGSON2) | 		else if (current_cpu_type() == CPU_LOONGSON2EF) | ||||||
| 			r4k_blast_icache = loongson2_blast_icache32; | 			r4k_blast_icache = loongson2_blast_icache32; | ||||||
| 		else | 		else | ||||||
| 			r4k_blast_icache = blast_icache32; | 			r4k_blast_icache = blast_icache32; | ||||||
| @ -469,7 +469,7 @@ static void r4k_blast_scache_node_setup(void) | |||||||
| { | { | ||||||
| 	unsigned long sc_lsize = cpu_scache_line_size(); | 	unsigned long sc_lsize = cpu_scache_line_size(); | ||||||
| 
 | 
 | ||||||
| 	if (current_cpu_type() != CPU_LOONGSON3) | 	if (current_cpu_type() != CPU_LOONGSON64) | ||||||
| 		r4k_blast_scache_node = (void *)cache_noop; | 		r4k_blast_scache_node = (void *)cache_noop; | ||||||
| 	else if (sc_lsize == 16) | 	else if (sc_lsize == 16) | ||||||
| 		r4k_blast_scache_node = blast_scache16_node; | 		r4k_blast_scache_node = blast_scache16_node; | ||||||
| @ -484,7 +484,7 @@ static void r4k_blast_scache_node_setup(void) | |||||||
| static inline void local_r4k___flush_cache_all(void * args) | static inline void local_r4k___flush_cache_all(void * args) | ||||||
| { | { | ||||||
| 	switch (current_cpu_type()) { | 	switch (current_cpu_type()) { | ||||||
| 	case CPU_LOONGSON2: | 	case CPU_LOONGSON2EF: | ||||||
| 	case CPU_R4000SC: | 	case CPU_R4000SC: | ||||||
| 	case CPU_R4000MC: | 	case CPU_R4000MC: | ||||||
| 	case CPU_R4400SC: | 	case CPU_R4400SC: | ||||||
| @ -501,7 +501,7 @@ static inline void local_r4k___flush_cache_all(void * args) | |||||||
| 		r4k_blast_scache(); | 		r4k_blast_scache(); | ||||||
| 		break; | 		break; | ||||||
| 
 | 
 | ||||||
| 	case CPU_LOONGSON3: | 	case CPU_LOONGSON64: | ||||||
| 		/* Use get_ebase_cpunum() for both NUMA=y/n */ | 		/* Use get_ebase_cpunum() for both NUMA=y/n */ | ||||||
| 		r4k_blast_scache_node(get_ebase_cpunum() >> 2); | 		r4k_blast_scache_node(get_ebase_cpunum() >> 2); | ||||||
| 		break; | 		break; | ||||||
| @ -774,7 +774,7 @@ static inline void __local_r4k_flush_icache_range(unsigned long start, | |||||||
| 		r4k_blast_icache(); | 		r4k_blast_icache(); | ||||||
| 	else { | 	else { | ||||||
| 		switch (boot_cpu_type()) { | 		switch (boot_cpu_type()) { | ||||||
| 		case CPU_LOONGSON2: | 		case CPU_LOONGSON2EF: | ||||||
| 			protected_loongson2_blast_icache_range(start, end); | 			protected_loongson2_blast_icache_range(start, end); | ||||||
| 			break; | 			break; | ||||||
| 
 | 
 | ||||||
| @ -867,7 +867,7 @@ static void r4k_dma_cache_wback_inv(unsigned long addr, unsigned long size) | |||||||
| 	preempt_disable(); | 	preempt_disable(); | ||||||
| 	if (cpu_has_inclusive_pcaches) { | 	if (cpu_has_inclusive_pcaches) { | ||||||
| 		if (size >= scache_size) { | 		if (size >= scache_size) { | ||||||
| 			if (current_cpu_type() != CPU_LOONGSON3) | 			if (current_cpu_type() != CPU_LOONGSON64) | ||||||
| 				r4k_blast_scache(); | 				r4k_blast_scache(); | ||||||
| 			else | 			else | ||||||
| 				r4k_blast_scache_node(pa_to_nid(addr)); | 				r4k_blast_scache_node(pa_to_nid(addr)); | ||||||
| @ -908,7 +908,7 @@ static void r4k_dma_cache_inv(unsigned long addr, unsigned long size) | |||||||
| 	preempt_disable(); | 	preempt_disable(); | ||||||
| 	if (cpu_has_inclusive_pcaches) { | 	if (cpu_has_inclusive_pcaches) { | ||||||
| 		if (size >= scache_size) { | 		if (size >= scache_size) { | ||||||
| 			if (current_cpu_type() != CPU_LOONGSON3) | 			if (current_cpu_type() != CPU_LOONGSON64) | ||||||
| 				r4k_blast_scache(); | 				r4k_blast_scache(); | ||||||
| 			else | 			else | ||||||
| 				r4k_blast_scache_node(pa_to_nid(addr)); | 				r4k_blast_scache_node(pa_to_nid(addr)); | ||||||
| @ -1228,7 +1228,7 @@ static void probe_pcache(void) | |||||||
| 		c->options |= MIPS_CPU_PREFETCH; | 		c->options |= MIPS_CPU_PREFETCH; | ||||||
| 		break; | 		break; | ||||||
| 
 | 
 | ||||||
| 	case CPU_LOONGSON2: | 	case CPU_LOONGSON2EF: | ||||||
| 		icache_size = 1 << (12 + ((config & CONF_IC) >> 9)); | 		icache_size = 1 << (12 + ((config & CONF_IC) >> 9)); | ||||||
| 		c->icache.linesz = 16 << ((config & CONF_IB) >> 5); | 		c->icache.linesz = 16 << ((config & CONF_IB) >> 5); | ||||||
| 		if (prid & 0x3) | 		if (prid & 0x3) | ||||||
| @ -1246,7 +1246,7 @@ static void probe_pcache(void) | |||||||
| 		c->dcache.waybit = 0; | 		c->dcache.waybit = 0; | ||||||
| 		break; | 		break; | ||||||
| 
 | 
 | ||||||
| 	case CPU_LOONGSON3: | 	case CPU_LOONGSON64: | ||||||
| 		config1 = read_c0_config1(); | 		config1 = read_c0_config1(); | ||||||
| 		lsize = (config1 >> 19) & 7; | 		lsize = (config1 >> 19) & 7; | ||||||
| 		if (lsize) | 		if (lsize) | ||||||
| @ -1457,7 +1457,7 @@ static void probe_pcache(void) | |||||||
| 		c->dcache.flags &= ~MIPS_CACHE_ALIASES; | 		c->dcache.flags &= ~MIPS_CACHE_ALIASES; | ||||||
| 		break; | 		break; | ||||||
| 
 | 
 | ||||||
| 	case CPU_LOONGSON2: | 	case CPU_LOONGSON2EF: | ||||||
| 		/*
 | 		/*
 | ||||||
| 		 * LOONGSON2 has 4 way icache, but when using indexed cache op, | 		 * LOONGSON2 has 4 way icache, but when using indexed cache op, | ||||||
| 		 * one op will act on all 4 ways | 		 * one op will act on all 4 ways | ||||||
| @ -1483,7 +1483,7 @@ static void probe_vcache(void) | |||||||
| 	struct cpuinfo_mips *c = ¤t_cpu_data; | 	struct cpuinfo_mips *c = ¤t_cpu_data; | ||||||
| 	unsigned int config2, lsize; | 	unsigned int config2, lsize; | ||||||
| 
 | 
 | ||||||
| 	if (current_cpu_type() != CPU_LOONGSON3) | 	if (current_cpu_type() != CPU_LOONGSON64) | ||||||
| 		return; | 		return; | ||||||
| 
 | 
 | ||||||
| 	config2 = read_c0_config2(); | 	config2 = read_c0_config2(); | ||||||
| @ -1658,11 +1658,11 @@ static void setup_scache(void) | |||||||
| #endif | #endif | ||||||
| 		return; | 		return; | ||||||
| 
 | 
 | ||||||
| 	case CPU_LOONGSON2: | 	case CPU_LOONGSON2EF: | ||||||
| 		loongson2_sc_init(); | 		loongson2_sc_init(); | ||||||
| 		return; | 		return; | ||||||
| 
 | 
 | ||||||
| 	case CPU_LOONGSON3: | 	case CPU_LOONGSON64: | ||||||
| 		loongson3_sc_init(); | 		loongson3_sc_init(); | ||||||
| 		return; | 		return; | ||||||
| 
 | 
 | ||||||
| @ -1931,7 +1931,7 @@ void r4k_cache_init(void) | |||||||
| 		/* Optimization: an L2 flush implicitly flushes the L1 */ | 		/* Optimization: an L2 flush implicitly flushes the L1 */ | ||||||
| 		current_cpu_data.options |= MIPS_CPU_INCLUSIVE_CACHES; | 		current_cpu_data.options |= MIPS_CPU_INCLUSIVE_CACHES; | ||||||
| 		break; | 		break; | ||||||
| 	case CPU_LOONGSON3: | 	case CPU_LOONGSON64: | ||||||
| 		/* Loongson-3 maintains cache coherency by hardware */ | 		/* Loongson-3 maintains cache coherency by hardware */ | ||||||
| 		__flush_cache_all	= cache_noop; | 		__flush_cache_all	= cache_noop; | ||||||
| 		__flush_cache_vmap	= cache_noop; | 		__flush_cache_vmap	= cache_noop; | ||||||
|  | |||||||
| @ -187,7 +187,7 @@ static void set_prefetch_parameters(void) | |||||||
| 			} | 			} | ||||||
| 			break; | 			break; | ||||||
| 
 | 
 | ||||||
| 		case CPU_LOONGSON3: | 		case CPU_LOONGSON64: | ||||||
| 			/* Loongson-3 only support the Pref_Load/Pref_Store. */ | 			/* Loongson-3 only support the Pref_Load/Pref_Store. */ | ||||||
| 			pref_bias_clear_store = 128; | 			pref_bias_clear_store = 128; | ||||||
| 			pref_bias_copy_load = 128; | 			pref_bias_copy_load = 128; | ||||||
|  | |||||||
| @ -35,10 +35,10 @@ extern void build_tlb_refill_handler(void); | |||||||
| static inline void flush_micro_tlb(void) | static inline void flush_micro_tlb(void) | ||||||
| { | { | ||||||
| 	switch (current_cpu_type()) { | 	switch (current_cpu_type()) { | ||||||
| 	case CPU_LOONGSON2: | 	case CPU_LOONGSON2EF: | ||||||
| 		write_c0_diag(LOONGSON_DIAG_ITLB); | 		write_c0_diag(LOONGSON_DIAG_ITLB); | ||||||
| 		break; | 		break; | ||||||
| 	case CPU_LOONGSON3: | 	case CPU_LOONGSON64: | ||||||
| 		write_c0_diag(LOONGSON_DIAG_ITLB | LOONGSON_DIAG_DTLB); | 		write_c0_diag(LOONGSON_DIAG_ITLB | LOONGSON_DIAG_DTLB); | ||||||
| 		break; | 		break; | ||||||
| 	default: | 	default: | ||||||
|  | |||||||
| @ -571,8 +571,8 @@ void build_tlb_write_entry(u32 **p, struct uasm_label **l, | |||||||
| 	case CPU_BMIPS4350: | 	case CPU_BMIPS4350: | ||||||
| 	case CPU_BMIPS4380: | 	case CPU_BMIPS4380: | ||||||
| 	case CPU_BMIPS5000: | 	case CPU_BMIPS5000: | ||||||
| 	case CPU_LOONGSON2: | 	case CPU_LOONGSON2EF: | ||||||
| 	case CPU_LOONGSON3: | 	case CPU_LOONGSON64: | ||||||
| 	case CPU_R5500: | 	case CPU_R5500: | ||||||
| 		if (m4kc_tlbp_war()) | 		if (m4kc_tlbp_war()) | ||||||
| 			uasm_i_nop(p); | 			uasm_i_nop(p); | ||||||
| @ -1370,7 +1370,7 @@ static void build_r4000_tlb_refill_handler(void) | |||||||
| 	switch (boot_cpu_type()) { | 	switch (boot_cpu_type()) { | ||||||
| 	default: | 	default: | ||||||
| 		if (sizeof(long) == 4) { | 		if (sizeof(long) == 4) { | ||||||
| 	case CPU_LOONGSON2: | 	case CPU_LOONGSON2EF: | ||||||
| 		/* Loongson2 ebase is different than r4k, we have more space */ | 		/* Loongson2 ebase is different than r4k, we have more space */ | ||||||
| 			if ((p - tlb_handler) > 64) | 			if ((p - tlb_handler) > 64) | ||||||
| 				panic("TLB refill handler space exceeded"); | 				panic("TLB refill handler space exceeded"); | ||||||
|  | |||||||
| @ -14,5 +14,5 @@ oprofile-$(CONFIG_CPU_MIPS64)		+= op_model_mipsxx.o | |||||||
| oprofile-$(CONFIG_CPU_R10000)		+= op_model_mipsxx.o | oprofile-$(CONFIG_CPU_R10000)		+= op_model_mipsxx.o | ||||||
| oprofile-$(CONFIG_CPU_SB1)		+= op_model_mipsxx.o | oprofile-$(CONFIG_CPU_SB1)		+= op_model_mipsxx.o | ||||||
| oprofile-$(CONFIG_CPU_XLR)		+= op_model_mipsxx.o | oprofile-$(CONFIG_CPU_XLR)		+= op_model_mipsxx.o | ||||||
| oprofile-$(CONFIG_CPU_LOONGSON2)	+= op_model_loongson2.o | oprofile-$(CONFIG_CPU_LOONGSON2EF)	+= op_model_loongson2.o | ||||||
| oprofile-$(CONFIG_CPU_LOONGSON3)	+= op_model_loongson3.o | oprofile-$(CONFIG_CPU_LOONGSON64)	+= op_model_loongson3.o | ||||||
|  | |||||||
| @ -104,10 +104,10 @@ int __init oprofile_arch_init(struct oprofile_operations *ops) | |||||||
| 		lmodel = &op_model_mipsxx_ops; | 		lmodel = &op_model_mipsxx_ops; | ||||||
| 		break; | 		break; | ||||||
| 
 | 
 | ||||||
| 	case CPU_LOONGSON2: | 	case CPU_LOONGSON2EF: | ||||||
| 		lmodel = &op_model_loongson2_ops; | 		lmodel = &op_model_loongson2_ops; | ||||||
| 		break; | 		break; | ||||||
| 	case CPU_LOONGSON3: | 	case CPU_LOONGSON64: | ||||||
| 		lmodel = &op_model_loongson3_ops; | 		lmodel = &op_model_loongson3_ops; | ||||||
| 		break; | 		break; | ||||||
| 	}; | 	}; | ||||||
|  | |||||||
| @ -298,7 +298,7 @@ config GPIO_IXP4XX | |||||||
| 
 | 
 | ||||||
| config GPIO_LOONGSON | config GPIO_LOONGSON | ||||||
| 	bool "Loongson-2/3 GPIO support" | 	bool "Loongson-2/3 GPIO support" | ||||||
| 	depends on CPU_LOONGSON2 || CPU_LOONGSON3 | 	depends on CPU_LOONGSON2EF || CPU_LOONGSON64 | ||||||
| 	help | 	help | ||||||
| 	  driver for GPIO functionality on Loongson-2F/3A/3B processors. | 	  driver for GPIO functionality on Loongson-2F/3A/3B processors. | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -22,7 +22,7 @@ | |||||||
| #define STLS2F_N_GPIO		4 | #define STLS2F_N_GPIO		4 | ||||||
| #define STLS3A_N_GPIO		16 | #define STLS3A_N_GPIO		16 | ||||||
| 
 | 
 | ||||||
| #ifdef CONFIG_CPU_LOONGSON3 | #ifdef CONFIG_CPU_LOONGSON64 | ||||||
| #define LOONGSON_N_GPIO	STLS3A_N_GPIO | #define LOONGSON_N_GPIO	STLS3A_N_GPIO | ||||||
| #else | #else | ||||||
| #define LOONGSON_N_GPIO	STLS2F_N_GPIO | #define LOONGSON_N_GPIO	STLS2F_N_GPIO | ||||||
|  | |||||||
| @ -45,7 +45,7 @@ static inline bool drm_arch_can_wc_memory(void) | |||||||
| { | { | ||||||
| #if defined(CONFIG_PPC) && !defined(CONFIG_NOT_COHERENT_CACHE) | #if defined(CONFIG_PPC) && !defined(CONFIG_NOT_COHERENT_CACHE) | ||||||
| 	return false; | 	return false; | ||||||
| #elif defined(CONFIG_MIPS) && defined(CONFIG_CPU_LOONGSON3) | #elif defined(CONFIG_MIPS) && defined(CONFIG_CPU_LOONGSON64) | ||||||
| 	return false; | 	return false; | ||||||
| #elif defined(CONFIG_ARM) || defined(CONFIG_ARM64) | #elif defined(CONFIG_ARM) || defined(CONFIG_ARM64) | ||||||
| 	/*
 | 	/*
 | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Jiaxun Yang
						Jiaxun Yang