Skip to content

Commit

Permalink
MIPS: Loongson: Change naming methods
Browse files Browse the repository at this point in the history
To make source code of loongson sharable to the machines(such as gdium)
made by the other companies, we rename arch/mips/lemote to
arch/mips/loongson, asm/mach-lemote to asm/mach-loongson, and rename lm2e
to the name of the machine: fuloong-2e. accordingly, FULONG are renamed to
FULOONG2E to make it distinguishable to the future FULOONG2F.  and also,
some other relative tuning is needed.

Signed-off-by: Wu Zhangjin <wuzhangjin@gmail.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
  • Loading branch information
Wu Zhangjin authored and Ralf Baechle committed Sep 17, 2009
1 parent 67b35e5 commit 8e49711
Show file tree
Hide file tree
Showing 25 changed files with 73 additions and 90 deletions.
8 changes: 4 additions & 4 deletions arch/mips/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
8 changes: 4 additions & 4 deletions arch/mips/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 */
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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 */
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
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_LEMOTE_MC146818RTC_H
#define __ASM_MACH_LEMOTE_MC146818RTC_H
#ifndef __ASM_MACH_LOONGSON_MC146818RTC_H
#define __ASM_MACH_LOONGSON_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_LEMOTE_MC146818RTC_H */
#endif /* __ASM_MACH_LOONGSON_MC146818RTC_H */
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
* 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;

#define LOONGSON2E_PCI_MEM_START BONITO_PCILO1_BASE
#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_ */
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
*
* Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org>
*/
#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
Expand All @@ -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 */
2 changes: 1 addition & 1 deletion arch/mips/include/asm/mips-boards/bonito64.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
58 changes: 0 additions & 58 deletions arch/mips/lemote/lm2e/setup.c

This file was deleted.

Original file line number Diff line number Diff line change
@@ -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 \
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@

const char *get_system_type(void)
{
return "lemote-fulong";
return "lemote-fuloong-2e-box";
}

File renamed without changes.
File renamed without changes.
44 changes: 44 additions & 0 deletions arch/mips/loongson/fuloong-2e/reset.c
Original file line number Diff line number Diff line change
@@ -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 <linux/init.h>
#include <linux/pm.h>

#include <asm/reboot.h>

#include <loongson.h>

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);
File renamed without changes.
2 changes: 1 addition & 1 deletion arch/mips/pci/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions arch/mips/pci/ops-bonito64.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 8e49711

Please sign in to comment.