Skip to content

Commit

Permalink
MIPS: Loongson: Naming style cleanup and rework
Browse files Browse the repository at this point in the history
Currently, code of Loongson-2/3 is under loongson directory and code of
Loongson-1 is under loongson1 directory. Besides, there are Kconfig
options such as MACH_LOONGSON and MACH_LOONGSON1. This naming style is
very ugly and confusing. Since Loongson-2/3 are both 64-bit general-
purpose CPU while Loongson-1 is 32-bit SoC, we rename both file names
and Kconfig symbols from loongson/loongson1 to loongson64/loongson32.

[[email protected]: Resolve a number of simple conflicts.]

Signed-off-by: Huacai Chen <[email protected]>
Cc: Steven J. Hill <[email protected]>
Cc: [email protected]
Cc: Fuxin Zhang <[email protected]>
Cc: Zhangjin Wu <[email protected]>
Cc: Kelvin Cheung <[email protected]>
Patchwork: https://patchwork.linux-mips.org/patch/9790/
Signed-off-by: Ralf Baechle <[email protected]>
  • Loading branch information
chenhuacai authored and ralfbaechle committed Jun 21, 2015
1 parent abcc82b commit 30ad29b
Show file tree
Hide file tree
Showing 102 changed files with 105 additions and 103 deletions.
4 changes: 2 additions & 2 deletions arch/mips/Kbuild.platforms
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ platforms += jazz
platforms += jz4740
platforms += lantiq
platforms += lasat
platforms += loongson
platforms += loongson1
platforms += loongson32
platforms += loongson64
platforms += mti-malta
platforms += mti-sead3
platforms += netlogic
Expand Down
34 changes: 18 additions & 16 deletions arch/mips/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ config MIPS
select HAVE_SYSCALL_TRACEPOINTS
select ARCH_HAS_ELF_RANDOMIZE
select HAVE_ARCH_TRANSPARENT_HUGEPAGE if CPU_SUPPORTS_HUGEPAGES && 64BIT
select RTC_LIB if !MACH_LOONGSON
select RTC_LIB if !MACH_LOONGSON64
select GENERIC_ATOMIC64 if !64BIT
select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
select HAVE_DMA_ATTRS
Expand Down Expand Up @@ -346,26 +346,28 @@ config LASAT
select SYS_SUPPORTS_64BIT_KERNEL if BROKEN
select SYS_SUPPORTS_LITTLE_ENDIAN

config MACH_LOONGSON
bool "Loongson family of machines"
config MACH_LOONGSON32
bool "Loongson-1 family of machines"
select SYS_SUPPORTS_ZBOOT
help
This enables the support of Loongson family of machines.
This enables support for the Loongson-1 family of machines.

Loongson is a family of general-purpose MIPS-compatible CPUs.
developed at Institute of Computing Technology (ICT),
Chinese Academy of Sciences (CAS) in the People's Republic
of China. The chief architect is Professor Weiwu Hu.
Loongson-1 is a family of 32-bit MIPS-compatible SoCs developed by
the Institute of Computing Technology (ICT), Chinese Academy of
Sciences (CAS).

config MACH_LOONGSON1
bool "Loongson 1 family of machines"
config MACH_LOONGSON64
bool "Loongson-2/3 family of machines"
select SYS_SUPPORTS_ZBOOT
help
This enables support for the Loongson 1 based machines.
This enables the support of Loongson-2/3 family of machines.

Loongson 1 is a family of 32-bit MIPS-compatible SoCs developed by
the ICT (Institute of Computing Technology) and the Chinese Academy
of Sciences.
Loongson-2 is a family of single-core CPUs and Loongson-3 is a
family of multi-core CPUs. They are both 64-bit general-purpose
MIPS-compatible CPUs. Loongson-2/3 are developed by the Institute
of Computing Technology (ICT), Chinese Academy of Sciences (CAS)
in the People's Republic of China. The chief architect is Professor
Weiwu Hu.

config MACH_PISTACHIO
bool "IMG Pistachio SoC based boards"
Expand Down Expand Up @@ -948,8 +950,8 @@ source "arch/mips/sibyte/Kconfig"
source "arch/mips/txx9/Kconfig"
source "arch/mips/vr41xx/Kconfig"
source "arch/mips/cavium-octeon/Kconfig"
source "arch/mips/loongson/Kconfig"
source "arch/mips/loongson1/Kconfig"
source "arch/mips/loongson32/Kconfig"
source "arch/mips/loongson64/Kconfig"
source "arch/mips/netlogic/Kconfig"
source "arch/mips/paravirt/Kconfig"

Expand Down
2 changes: 1 addition & 1 deletion arch/mips/boot/compressed/uart-16550.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#include <asm/addrspace.h>

#if defined(CONFIG_MACH_LOONGSON) || defined(CONFIG_MIPS_MALTA)
#if defined(CONFIG_MACH_LOONGSON64) || defined(CONFIG_MIPS_MALTA)
#define UART_BASE 0x1fd003f8
#define PORT(offset) (CKSEG1ADDR(UART_BASE) + (offset))
#endif
Expand Down
2 changes: 1 addition & 1 deletion arch/mips/configs/fuloong2e_defconfig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CONFIG_MACH_LOONGSON=y
CONFIG_MACH_LOONGSON64=y
CONFIG_64BIT=y
CONFIG_NO_HZ=y
CONFIG_HIGH_RES_TIMERS=y
Expand Down
2 changes: 1 addition & 1 deletion arch/mips/configs/lemote2f_defconfig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CONFIG_MACH_LOONGSON=y
CONFIG_MACH_LOONGSON64=y
CONFIG_LEMOTE_MACH2F=y
CONFIG_CS5536_MFGPT=y
CONFIG_64BIT=y
Expand Down
2 changes: 1 addition & 1 deletion arch/mips/configs/loongson3_defconfig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CONFIG_MACH_LOONGSON=y
CONFIG_MACH_LOONGSON64=y
CONFIG_SWIOTLB=y
CONFIG_LOONGSON_MACH3X=y
CONFIG_CPU_LOONGSON3=y
Expand Down
2 changes: 1 addition & 1 deletion arch/mips/configs/ls1b_defconfig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CONFIG_MACH_LOONGSON1=y
CONFIG_MACH_LOONGSON32=y
CONFIG_PREEMPT=y
# CONFIG_SECCOMP is not set
CONFIG_EXPERIMENTAL=y
Expand Down
7 changes: 0 additions & 7 deletions arch/mips/include/asm/mach-loongson/workarounds.h

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
*/


#ifndef __ASM_MACH_LOONGSON1_CPUFREQ_H
#define __ASM_MACH_LOONGSON1_CPUFREQ_H
#ifndef __ASM_MACH_LOONGSON32_CPUFREQ_H
#define __ASM_MACH_LOONGSON32_CPUFREQ_H

struct plat_ls1x_cpufreq {
const char *clk_name; /* CPU clk */
Expand All @@ -20,4 +20,4 @@ struct plat_ls1x_cpufreq {
unsigned int min_freq; /* in kHz */
};

#endif /* __ASM_MACH_LOONGSON1_CPUFREQ_H */
#endif /* __ASM_MACH_LOONGSON32_CPUFREQ_H */
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
*/


#ifndef __ASM_MACH_LOONGSON1_IRQ_H
#define __ASM_MACH_LOONGSON1_IRQ_H
#ifndef __ASM_MACH_LOONGSON32_IRQ_H
#define __ASM_MACH_LOONGSON32_IRQ_H

/*
* CPU core Interrupt Numbers
Expand Down Expand Up @@ -70,4 +70,4 @@

#define NR_IRQS (MIPS_CPU_IRQS + LS1X_IRQS)

#endif /* __ASM_MACH_LOONGSON1_IRQ_H */
#endif /* __ASM_MACH_LOONGSON32_IRQ_H */
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
*/


#ifndef __ASM_MACH_LOONGSON1_LOONGSON1_H
#define __ASM_MACH_LOONGSON1_LOONGSON1_H
#ifndef __ASM_MACH_LOONGSON32_LOONGSON1_H
#define __ASM_MACH_LOONGSON32_LOONGSON1_H

#define DEFAULT_MEMSIZE 256 /* If no memsize provided */

Expand Down Expand Up @@ -47,4 +47,4 @@
#include <regs-pwm.h>
#include <regs-wdt.h>

#endif /* __ASM_MACH_LOONGSON1_LOONGSON1_H */
#endif /* __ASM_MACH_LOONGSON32_LOONGSON1_H */
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
*/


#ifndef __ASM_MACH_LOONGSON1_PLATFORM_H
#define __ASM_MACH_LOONGSON1_PLATFORM_H
#ifndef __ASM_MACH_LOONGSON32_PLATFORM_H
#define __ASM_MACH_LOONGSON32_PLATFORM_H

#include <linux/platform_device.h>

Expand All @@ -23,4 +23,4 @@ extern struct platform_device ls1x_rtc_pdev;
extern void __init ls1x_clk_init(void);
extern void __init ls1x_serial_setup(struct platform_device *pdev);

#endif /* __ASM_MACH_LOONGSON1_PLATFORM_H */
#endif /* __ASM_MACH_LOONGSON32_PLATFORM_H */
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
* option) any later version.
*/

#ifndef __ASM_MACH_LOONGSON1_PROM_H
#define __ASM_MACH_LOONGSON1_PROM_H
#ifndef __ASM_MACH_LOONGSON32_PROM_H
#define __ASM_MACH_LOONGSON32_PROM_H

#include <linux/io.h>
#include <linux/init.h>
Expand All @@ -21,4 +21,4 @@ extern unsigned long memsize, highmemsize;
extern char *prom_getenv(char *name);
extern void __init prom_init_cmdline(void);

#endif /* __ASM_MACH_LOONGSON1_PROM_H */
#endif /* __ASM_MACH_LOONGSON32_PROM_H */
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
* option) any later version.
*/

#ifndef __ASM_MACH_LOONGSON1_REGS_CLK_H
#define __ASM_MACH_LOONGSON1_REGS_CLK_H
#ifndef __ASM_MACH_LOONGSON32_REGS_CLK_H
#define __ASM_MACH_LOONGSON32_REGS_CLK_H

#define LS1X_CLK_REG(x) \
((void __iomem *)KSEG1ADDR(LS1X_CLK_BASE + (x)))
Expand Down Expand Up @@ -48,4 +48,4 @@
#define BYPASS_DDR_WIDTH 1
#define BYPASS_CPU_WIDTH 1

#endif /* __ASM_MACH_LOONGSON1_REGS_CLK_H */
#endif /* __ASM_MACH_LOONGSON32_REGS_CLK_H */
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
* option) any later version.
*/

#ifndef __ASM_MACH_LOONGSON1_REGS_MUX_H
#define __ASM_MACH_LOONGSON1_REGS_MUX_H
#ifndef __ASM_MACH_LOONGSON32_REGS_MUX_H
#define __ASM_MACH_LOONGSON32_REGS_MUX_H

#define LS1X_MUX_REG(x) \
((void __iomem *)KSEG1ADDR(LS1X_MUX_BASE + (x)))
Expand Down Expand Up @@ -64,4 +64,4 @@
#define GMAC1_USE_PWM23 (0x1 << 1)
#define GMAC0_USE_PWM01 0x1

#endif /* __ASM_MACH_LOONGSON1_REGS_MUX_H */
#endif /* __ASM_MACH_LOONGSON32_REGS_MUX_H */
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
* option) any later version.
*/

#ifndef __ASM_MACH_LOONGSON1_REGS_PWM_H
#define __ASM_MACH_LOONGSON1_REGS_PWM_H
#ifndef __ASM_MACH_LOONGSON32_REGS_PWM_H
#define __ASM_MACH_LOONGSON32_REGS_PWM_H

/* Loongson 1 PWM Timer Register Definitions */
#define PWM_CNT 0x0
Expand All @@ -26,4 +26,4 @@
#define PWM_OE (0x1 << 3)
#define CNT_EN 0x1

#endif /* __ASM_MACH_LOONGSON1_REGS_PWM_H */
#endif /* __ASM_MACH_LOONGSON32_REGS_PWM_H */
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
* option) any later version.
*/

#ifndef __ASM_MACH_LOONGSON1_REGS_WDT_H
#define __ASM_MACH_LOONGSON1_REGS_WDT_H
#ifndef __ASM_MACH_LOONGSON32_REGS_WDT_H
#define __ASM_MACH_LOONGSON32_REGS_WDT_H

#define WDT_EN 0x0
#define WDT_TIMER 0x4
#define WDT_SET 0x8

#endif /* __ASM_MACH_LOONGSON1_REGS_WDT_H */
#endif /* __ASM_MACH_LOONGSON32_REGS_WDT_H */
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef __ASM_MACH_LOONGSON_BOOT_PARAM_H_
#define __ASM_MACH_LOONGSON_BOOT_PARAM_H_
#ifndef __ASM_MACH_LOONGSON64_BOOT_PARAM_H_
#define __ASM_MACH_LOONGSON64_BOOT_PARAM_H_

#define SYSTEM_RAM_LOW 1
#define SYSTEM_RAM_HIGH 2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
* loongson2f user manual.
*/

#ifndef __ASM_MACH_LOONGSON_CPU_FEATURE_OVERRIDES_H
#define __ASM_MACH_LOONGSON_CPU_FEATURE_OVERRIDES_H
#ifndef __ASM_MACH_LOONGSON64_CPU_FEATURE_OVERRIDES_H
#define __ASM_MACH_LOONGSON64_CPU_FEATURE_OVERRIDES_H

#define cpu_dcache_line_size() 32
#define cpu_icache_line_size() 32
Expand Down Expand Up @@ -58,4 +58,4 @@

#define cpu_has_wsbh IS_ENABLED(CONFIG_CPU_LOONGSON3)

#endif /* __ASM_MACH_LOONGSON_CPU_FEATURE_OVERRIDES_H */
#endif /* __ASM_MACH_LOONGSON64_CPU_FEATURE_OVERRIDES_H */
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
* Author: Fuxin Zhang, [email protected]
*
*/
#ifndef __ASM_MACH_LOONGSON_DMA_COHERENCE_H
#define __ASM_MACH_LOONGSON_DMA_COHERENCE_H
#ifndef __ASM_MACH_LOONGSON64_DMA_COHERENCE_H
#define __ASM_MACH_LOONGSON64_DMA_COHERENCE_H

#ifdef CONFIG_SWIOTLB
#include <linux/swiotlb.h>
Expand Down Expand Up @@ -82,4 +82,4 @@ static inline void plat_post_dma_flush(struct device *dev)
{
}

#endif /* __ASM_MACH_LOONGSON_DMA_COHERENCE_H */
#endif /* __ASM_MACH_LOONGSON64_DMA_COHERENCE_H */
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef __ASM_MACH_LOONGSON_IRQ_H_
#define __ASM_MACH_LOONGSON_IRQ_H_
#ifndef __ASM_MACH_LOONGSON64_IRQ_H_
#define __ASM_MACH_LOONGSON64_IRQ_H_

#include <boot_param.h>

Expand Down Expand Up @@ -40,4 +40,4 @@ extern void fixup_irqs(void);
extern void loongson3_ipi_interrupt(struct pt_regs *regs);

#include_next <irq.h>
#endif /* __ASM_MACH_LOONGSON_IRQ_H_ */
#endif /* __ASM_MACH_LOONGSON64_IRQ_H_ */
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
* Copyright (C) 2009 Jiajie Chen ([email protected])
* Copyright (C) 2012 Huacai Chen ([email protected])
*/
#ifndef __ASM_MACH_LOONGSON_KERNEL_ENTRY_H
#define __ASM_MACH_LOONGSON_KERNEL_ENTRY_H
#ifndef __ASM_MACH_LOONGSON64_KERNEL_ENTRY_H
#define __ASM_MACH_LOONGSON64_KERNEL_ENTRY_H

/*
* Override macros used in arch/mips/kernel/head.S.
Expand Down Expand Up @@ -49,4 +49,4 @@
#endif
.endm

#endif /* __ASM_MACH_LOONGSON_KERNEL_ENTRY_H */
#endif /* __ASM_MACH_LOONGSON64_KERNEL_ENTRY_H */
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
* option) any later version.
*/

#ifndef __ASM_MACH_LOONGSON_LOONGSON_H
#define __ASM_MACH_LOONGSON_LOONGSON_H
#ifndef __ASM_MACH_LOONGSON64_LOONGSON_H
#define __ASM_MACH_LOONGSON64_LOONGSON_H

#include <linux/io.h>
#include <linux/init.h>
Expand Down Expand Up @@ -357,4 +357,4 @@ extern unsigned long _loongson_addrwincfg_base;

#endif /* ! CONFIG_CPU_SUPPORTS_ADDRWINCFG */

#endif /* __ASM_MACH_LOONGSON_LOONGSON_H */
#endif /* __ASM_MACH_LOONGSON64_LOONGSON_H */
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
* option) any later version.
*/

#ifndef __ASM_MACH_LOONGSON_MACHINE_H
#define __ASM_MACH_LOONGSON_MACHINE_H
#ifndef __ASM_MACH_LOONGSON64_MACHINE_H
#define __ASM_MACH_LOONGSON64_MACHINE_H

#ifdef CONFIG_LEMOTE_FULOONG2E

Expand All @@ -30,4 +30,4 @@

#endif /* CONFIG_LOONGSON_MACH3X */

#endif /* __ASM_MACH_LOONGSON_MACHINE_H */
#endif /* __ASM_MACH_LOONGSON64_MACHINE_H */
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
*
* RTC routines for PC style attached Dallas chip.
*/
#ifndef __ASM_MACH_LOONGSON_MC146818RTC_H
#define __ASM_MACH_LOONGSON_MC146818RTC_H
#ifndef __ASM_MACH_LOONGSON64_MC146818RTC_H
#define __ASM_MACH_LOONGSON64_MC146818RTC_H

#include <linux/io.h>

Expand All @@ -33,4 +33,4 @@ static inline void CMOS_WRITE(unsigned char data, unsigned long addr)
#define mc146818_decode_year(year) ((year) < 70 ? (year) + 2000 : (year) + 1970)
#endif

#endif /* __ASM_MACH_LOONGSON_MC146818RTC_H */
#endif /* __ASM_MACH_LOONGSON64_MC146818RTC_H */
Loading

0 comments on commit 30ad29b

Please sign in to comment.