diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index a383dac81018af54a1f52908d0bab81d1f95ec7d..3414e2301824732de7955b2705dfadbf794a2600 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig @@ -6,7 +6,7 @@ config MIPS select HAVE_ARCH_KGDB # Horrible source of confusion. Die, die, die ... select EMBEDDED - select RTC_LIB if !LEMOTE_FULONG + select RTC_LIB if !LEMOTE_FULOONG2E mainmenu "Linux/MIPS Kernel Configuration" @@ -174,8 +174,8 @@ config LASAT select SYS_SUPPORTS_64BIT_KERNEL if BROKEN select SYS_SUPPORTS_LITTLE_ENDIAN -config LEMOTE_FULONG - bool "Lemote Fulong mini-PC" +config LEMOTE_FULOONG2E + bool "Lemote Fuloong2e mini-PC" select ARCH_SPARSEMEM_ENABLE select CEVT_R4K select CSRC_R4K @@ -196,7 +196,7 @@ config LEMOTE_FULONG select GENERIC_ISA_DMA_SUPPORT_BROKEN select CPU_HAS_WB help - Lemote Fulong mini-PC board based on the Chinese Loongson-2E CPU and + Lemote Fuloong2e mini-PC board based on the Chinese Loongson-2E CPU and an FPGA northbridge config MIPS_MALTA diff --git a/arch/mips/Makefile b/arch/mips/Makefile index 861da514a468a7cf84bdb0d32cd703921f7853e0..7754cbbbf4ed7e7f6a39c72272cf0c546e1cc883 100644 --- a/arch/mips/Makefile +++ b/arch/mips/Makefile @@ -314,11 +314,11 @@ cflags-$(CONFIG_WR_PPMC) += -I$(srctree)/arch/mips/include/asm/mach-wrppmc load-$(CONFIG_WR_PPMC) += 0xffffffff80100000 # -# lemote fulong mini-PC board +# lemote fuloong2e mini-PC board # -core-$(CONFIG_LEMOTE_FULONG) +=arch/mips/lemote/lm2e/ -load-$(CONFIG_LEMOTE_FULONG) +=0xffffffff80100000 -cflags-$(CONFIG_LEMOTE_FULONG) += -I$(srctree)/arch/mips/include/asm/mach-lemote +core-$(CONFIG_LEMOTE_FULOONG2E) +=arch/mips/loongson/fuloong-2e/ +load-$(CONFIG_LEMOTE_FULOONG2E) +=0xffffffff80100000 +cflags-$(CONFIG_LEMOTE_FULOONG2E) += -I$(srctree)/arch/mips/include/asm/mach-loongson/ # # MIPS Malta board diff --git a/arch/mips/include/asm/mach-lemote/cpu-feature-overrides.h b/arch/mips/include/asm/mach-loongson/cpu-feature-overrides.h similarity index 90% rename from arch/mips/include/asm/mach-lemote/cpu-feature-overrides.h rename to arch/mips/include/asm/mach-loongson/cpu-feature-overrides.h index 550a10dc9dbaae55824708d85187d672bd1ad18c..ce5b6e270e3f06eb4257d89277e779631d617b2b 100644 --- a/arch/mips/include/asm/mach-lemote/cpu-feature-overrides.h +++ b/arch/mips/include/asm/mach-loongson/cpu-feature-overrides.h @@ -13,8 +13,8 @@ * loongson2f user manual. */ -#ifndef __ASM_MACH_LEMOTE_CPU_FEATURE_OVERRIDES_H -#define __ASM_MACH_LEMOTE_CPU_FEATURE_OVERRIDES_H +#ifndef __ASM_MACH_LOONGSON_CPU_FEATURE_OVERRIDES_H +#define __ASM_MACH_LOONGSON_CPU_FEATURE_OVERRIDES_H #define cpu_dcache_line_size() 32 #define cpu_icache_line_size() 32 @@ -56,4 +56,4 @@ #define cpu_has_watch 1 #define cpu_icache_snoops_remote_store 1 -#endif /* __ASM_MACH_LEMOTE_CPU_FEATURE_OVERRIDES_H */ +#endif /* __ASM_MACH_LOONGSON_CPU_FEATURE_OVERRIDES_H */ diff --git a/arch/mips/include/asm/mach-lemote/dma-coherence.h b/arch/mips/include/asm/mach-loongson/dma-coherence.h similarity index 91% rename from arch/mips/include/asm/mach-lemote/dma-coherence.h rename to arch/mips/include/asm/mach-loongson/dma-coherence.h index c8de5e750777e9d0a4b309a73247e9f103688199..71a6851ba833250b572e75372b41811ec4bcd6ba 100644 --- a/arch/mips/include/asm/mach-lemote/dma-coherence.h +++ b/arch/mips/include/asm/mach-loongson/dma-coherence.h @@ -8,8 +8,8 @@ * Author: Fuxin Zhang, zhangfx@lemote.com * */ -#ifndef __ASM_MACH_LEMOTE_DMA_COHERENCE_H -#define __ASM_MACH_LEMOTE_DMA_COHERENCE_H +#ifndef __ASM_MACH_LOONGSON_DMA_COHERENCE_H +#define __ASM_MACH_LOONGSON_DMA_COHERENCE_H struct device; @@ -65,4 +65,4 @@ static inline int plat_device_is_coherent(struct device *dev) return 0; } -#endif /* __ASM_MACH_LEMOTE_DMA_COHERENCE_H */ +#endif /* __ASM_MACH_LOONGSON_DMA_COHERENCE_H */ diff --git a/arch/mips/include/asm/mach-lemote/loongson.h b/arch/mips/include/asm/mach-loongson/loongson.h similarity index 95% rename from arch/mips/include/asm/mach-lemote/loongson.h rename to arch/mips/include/asm/mach-loongson/loongson.h index 95ee4c8f2d56eb4b413c51a6feb617b52bd42b21..e9f74dee24ef9099f6bc00753d17eddc550aa259 100644 --- a/arch/mips/include/asm/mach-lemote/loongson.h +++ b/arch/mips/include/asm/mach-loongson/loongson.h @@ -21,9 +21,6 @@ /* loongson internal northbridge initialization */ extern void bonito_irq_init(void); -/* loongson-based machines specific reboot setup */ -extern void mips_reboot_setup(void); - /* environment arguments from bootloader */ extern unsigned long bus_clock, cpu_clock_freq; extern unsigned long memsize, highmemsize; diff --git a/arch/mips/include/asm/mach-lemote/mc146818rtc.h b/arch/mips/include/asm/mach-loongson/mc146818rtc.h similarity index 85% rename from arch/mips/include/asm/mach-lemote/mc146818rtc.h rename to arch/mips/include/asm/mach-loongson/mc146818rtc.h index ed5147e11085c3860c630f0ffea8d6a75681af5a..ed7fe978335ad667a6b6b185ec3cf054f5cb2bc2 100644 --- a/arch/mips/include/asm/mach-lemote/mc146818rtc.h +++ b/arch/mips/include/asm/mach-loongson/mc146818rtc.h @@ -7,8 +7,8 @@ * * RTC routines for PC style attached Dallas chip. */ -#ifndef __ASM_MACH_LEMOTE_MC146818RTC_H -#define __ASM_MACH_LEMOTE_MC146818RTC_H +#ifndef __ASM_MACH_LOONGSON_MC146818RTC_H +#define __ASM_MACH_LOONGSON_MC146818RTC_H #include @@ -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_LEMOTE_MC146818RTC_H */ +#endif /* __ASM_MACH_LOONGSON_MC146818RTC_H */ diff --git a/arch/mips/include/asm/mach-lemote/pci.h b/arch/mips/include/asm/mach-loongson/pci.h similarity index 89% rename from arch/mips/include/asm/mach-lemote/pci.h rename to arch/mips/include/asm/mach-loongson/pci.h index 3e6b1300afb612e30c31c3211e5f3c49f207a1e1..e229b2904cc9796a0b5c2f3a03895eab48eb2f62 100644 --- a/arch/mips/include/asm/mach-lemote/pci.h +++ b/arch/mips/include/asm/mach-loongson/pci.h @@ -19,8 +19,8 @@ * 02139, USA. */ -#ifndef __ASM_MACH_LEMOTE_PCI_H_ -#define __ASM_MACH_LEMOTE_PCI_H_ +#ifndef __ASM_MACH_LOONGSON_PCI_H_ +#define __ASM_MACH_LOONGSON_PCI_H_ extern struct pci_ops bonito64_pci_ops; @@ -28,4 +28,4 @@ extern struct pci_ops bonito64_pci_ops; #define LOONGSON2E_PCI_MEM_END (BONITO_PCILO1_BASE + 0x04000000 * 2) #define LOONGSON2E_PCI_IO_START 0x00004000UL -#endif /* !__ASM_MACH_LEMOTE_PCI_H_ */ +#endif /* !__ASM_MACH_LOONGSON_PCI_H_ */ diff --git a/arch/mips/include/asm/mach-lemote/war.h b/arch/mips/include/asm/mach-loongson/war.h similarity index 85% rename from arch/mips/include/asm/mach-lemote/war.h rename to arch/mips/include/asm/mach-loongson/war.h index 05f89e0f2a118d05e863f320c6b7051b41e1ba08..4b971c3ffd8d79dc9c463ed7d903afab0abee5c6 100644 --- a/arch/mips/include/asm/mach-lemote/war.h +++ b/arch/mips/include/asm/mach-loongson/war.h @@ -5,8 +5,8 @@ * * Copyright (C) 2002, 2004, 2007 by Ralf Baechle */ -#ifndef __ASM_MIPS_MACH_LEMOTE_WAR_H -#define __ASM_MIPS_MACH_LEMOTE_WAR_H +#ifndef __ASM_MACH_LOONGSON_WAR_H +#define __ASM_MACH_LOONGSON_WAR_H #define R4600_V1_INDEX_ICACHEOP_WAR 0 #define R4600_V1_HIT_CACHEOP_WAR 0 @@ -22,4 +22,4 @@ #define R10000_LLSC_WAR 0 #define MIPS34K_MISSED_ITLB_WAR 0 -#endif /* __ASM_MIPS_MACH_LEMOTE_WAR_H */ +#endif /* __ASM_MACH_LEMOTE_WAR_H */ diff --git a/arch/mips/include/asm/mips-boards/bonito64.h b/arch/mips/include/asm/mips-boards/bonito64.h index a0f04bb99c99bc57602cdde0b62af5252c1207e2..a576ce044c3c7ca845dedd4975a8dfef40a3b259 100644 --- a/arch/mips/include/asm/mips-boards/bonito64.h +++ b/arch/mips/include/asm/mips-boards/bonito64.h @@ -26,7 +26,7 @@ /* offsets from base register */ #define BONITO(x) (x) -#elif defined(CONFIG_LEMOTE_FULONG) +#elif defined(CONFIG_LEMOTE_FULOONG2E) #define BONITO(x) (*(volatile u32 *)((char *)CKSEG1ADDR(BONITO_REG_BASE) + (x))) #define BONITO_IRQ_BASE 32 diff --git a/arch/mips/lemote/lm2e/setup.c b/arch/mips/lemote/lm2e/setup.c deleted file mode 100644 index 66390215973048286d3d84fdbbbae6955723446a..0000000000000000000000000000000000000000 --- a/arch/mips/lemote/lm2e/setup.c +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (C) 2007 Lemote Inc. & Insititute of Computing Technology - * Author: Fuxin Zhang, zhangfx@lemote.com - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - */ -#include - -#include - -#include - -#ifdef CONFIG_VT -#include -#include -#endif - -void (*__wbflush)(void); -EXPORT_SYMBOL(__wbflush); - -static void wbflush_loongson2e(void) -{ - asm(".set\tpush\n\t" - ".set\tnoreorder\n\t" - ".set mips3\n\t" - "sync\n\t" - "nop\n\t" - ".set\tpop\n\t" - ".set mips0\n\t"); -} - -void __init plat_mem_setup(void) -{ - __wbflush = wbflush_loongson2e; - -#ifdef CONFIG_VT -#if defined(CONFIG_VGA_CONSOLE) - conswitchp = &vga_con; - - screen_info = (struct screen_info) { - 0, 25, /* orig-x, orig-y */ - 0, /* unused */ - 0, /* orig-video-page */ - 0, /* orig-video-mode */ - 80, /* orig-video-cols */ - 0, 0, 0, /* ega_ax, ega_bx, ega_cx */ - 25, /* orig-video-lines */ - VIDEO_TYPE_VGAC, /* orig-video-isVGA */ - 16 /* orig-video-points */ - }; -#elif defined(CONFIG_DUMMY_CONSOLE) - conswitchp = &dummy_con; -#endif -#endif -} diff --git a/arch/mips/lemote/lm2e/Makefile b/arch/mips/loongson/fuloong-2e/Makefile similarity index 81% rename from arch/mips/lemote/lm2e/Makefile rename to arch/mips/loongson/fuloong-2e/Makefile index a5bc1efc362a500a692b257476a2db3dd3207561..feb1d6bba499bff3949674ce78c835407497d292 100644 --- a/arch/mips/lemote/lm2e/Makefile +++ b/arch/mips/loongson/fuloong-2e/Makefile @@ -1,5 +1,5 @@ # -# Makefile for Lemote Fulong mini-PC board. +# Makefile for Lemote Fuloong2e mini-PC board. # obj-y += setup.o init.o reset.o irq.o pci.o bonito-irq.o mem.o \ diff --git a/arch/mips/lemote/lm2e/bonito-irq.c b/arch/mips/loongson/fuloong-2e/bonito-irq.c similarity index 100% rename from arch/mips/lemote/lm2e/bonito-irq.c rename to arch/mips/loongson/fuloong-2e/bonito-irq.c diff --git a/arch/mips/lemote/lm2e/cmdline.c b/arch/mips/loongson/fuloong-2e/cmdline.c similarity index 100% rename from arch/mips/lemote/lm2e/cmdline.c rename to arch/mips/loongson/fuloong-2e/cmdline.c diff --git a/arch/mips/lemote/lm2e/early_printk.c b/arch/mips/loongson/fuloong-2e/early_printk.c similarity index 100% rename from arch/mips/lemote/lm2e/early_printk.c rename to arch/mips/loongson/fuloong-2e/early_printk.c diff --git a/arch/mips/lemote/lm2e/env.c b/arch/mips/loongson/fuloong-2e/env.c similarity index 100% rename from arch/mips/lemote/lm2e/env.c rename to arch/mips/loongson/fuloong-2e/env.c diff --git a/arch/mips/lemote/lm2e/init.c b/arch/mips/loongson/fuloong-2e/init.c similarity index 100% rename from arch/mips/lemote/lm2e/init.c rename to arch/mips/loongson/fuloong-2e/init.c diff --git a/arch/mips/lemote/lm2e/irq.c b/arch/mips/loongson/fuloong-2e/irq.c similarity index 100% rename from arch/mips/lemote/lm2e/irq.c rename to arch/mips/loongson/fuloong-2e/irq.c diff --git a/arch/mips/lemote/lm2e/machtype.c b/arch/mips/loongson/fuloong-2e/machtype.c similarity index 92% rename from arch/mips/lemote/lm2e/machtype.c rename to arch/mips/loongson/fuloong-2e/machtype.c index 8d803eea78726cf464a2d9f7d1ba708f21c42610..e03aa0de617690370f7cab99f1026882da7355c4 100644 --- a/arch/mips/lemote/lm2e/machtype.c +++ b/arch/mips/loongson/fuloong-2e/machtype.c @@ -10,6 +10,6 @@ const char *get_system_type(void) { - return "lemote-fulong"; + return "lemote-fuloong-2e-box"; } diff --git a/arch/mips/lemote/lm2e/mem.c b/arch/mips/loongson/fuloong-2e/mem.c similarity index 100% rename from arch/mips/lemote/lm2e/mem.c rename to arch/mips/loongson/fuloong-2e/mem.c diff --git a/arch/mips/lemote/lm2e/pci.c b/arch/mips/loongson/fuloong-2e/pci.c similarity index 100% rename from arch/mips/lemote/lm2e/pci.c rename to arch/mips/loongson/fuloong-2e/pci.c diff --git a/arch/mips/loongson/fuloong-2e/reset.c b/arch/mips/loongson/fuloong-2e/reset.c new file mode 100644 index 0000000000000000000000000000000000000000..c21299af7f642d3c416db013fdbcdd16ee601c26 --- /dev/null +++ b/arch/mips/loongson/fuloong-2e/reset.c @@ -0,0 +1,44 @@ +/* + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * Copyright (C) 2007 Lemote, Inc. & Institute of Computing Technology + * Author: Fuxin Zhang, zhangfx@lemote.com + * Copyright (C) 2009 Lemote, Inc. & Institute of Computing Technology + * Author: Zhangjin Wu, wuzj@lemote.com + */ +#include +#include + +#include + +#include + +static void loongson2e_restart(char *command) +{ + /* do preparation for reboot */ + BONITO_BONGENCFG &= ~(1 << 2); + BONITO_BONGENCFG |= (1 << 2); + + /* reboot via jumping to boot base address */ + ((void (*)(void))ioremap_nocache(BONITO_BOOT_BASE, 4)) (); +} + +static void loongson2e_halt(void) +{ + while (1) + ; +} + +static int __init mips_reboot_setup(void) +{ + _machine_restart = loongson2e_restart; + _machine_halt = loongson2e_halt; + pm_power_off = loongson2e_halt; + + return 0; +} + +arch_initcall(mips_reboot_setup); diff --git a/arch/mips/lemote/lm2e/time.c b/arch/mips/loongson/fuloong-2e/time.c similarity index 100% rename from arch/mips/lemote/lm2e/time.c rename to arch/mips/loongson/fuloong-2e/time.c diff --git a/arch/mips/pci/Makefile b/arch/mips/pci/Makefile index 63d8a297c58da4f85abf378fa4da6e7e2c9ed5e6..0d4d5ea6fac34d1471d8d75513b7971749b5bc19 100644 --- a/arch/mips/pci/Makefile +++ b/arch/mips/pci/Makefile @@ -26,7 +26,7 @@ obj-$(CONFIG_MIPS_COBALT) += fixup-cobalt.o obj-$(CONFIG_SOC_AU1500) += fixup-au1000.o ops-au1000.o obj-$(CONFIG_SOC_AU1550) += fixup-au1000.o ops-au1000.o obj-$(CONFIG_SOC_PNX8550) += fixup-pnx8550.o ops-pnx8550.o -obj-$(CONFIG_LEMOTE_FULONG) += fixup-lm2e.o ops-bonito64.o +obj-$(CONFIG_LEMOTE_FULOONG2E) += fixup-fuloong2e.o ops-bonito64.o obj-$(CONFIG_MIPS_MALTA) += fixup-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/arch/mips/pci/fixup-lm2e.c b/arch/mips/pci/fixup-fuloong2e.c similarity index 100% rename from arch/mips/pci/fixup-lm2e.c rename to arch/mips/pci/fixup-fuloong2e.c diff --git a/arch/mips/pci/ops-bonito64.c b/arch/mips/pci/ops-bonito64.c index f742c51acf0d0506a18d3784ecbf87fec371a175..54e55e7a243128a783070aed91faa661e96940b3 100644 --- a/arch/mips/pci/ops-bonito64.c +++ b/arch/mips/pci/ops-bonito64.c @@ -29,7 +29,7 @@ #define PCI_ACCESS_READ 0 #define PCI_ACCESS_WRITE 1 -#ifdef CONFIG_LEMOTE_FULONG +#ifdef CONFIG_LEMOTE_FULOONG2E #define CFG_SPACE_REG(offset) (void *)CKSEG1ADDR(BONITO_PCICFG_BASE | (offset)) #define ID_SEL_BEGIN 11 #else @@ -77,7 +77,7 @@ static int bonito64_pcibios_config_access(unsigned char access_type, addrp = CFG_SPACE_REG(addr & 0xffff); if (access_type == PCI_ACCESS_WRITE) { writel(cpu_to_le32(*data), addrp); -#ifndef CONFIG_LEMOTE_FULONG +#ifndef CONFIG_LEMOTE_FULOONG2E /* Wait till done */ while (BONITO_PCIMSTAT & 0xF); #endif