Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 85749d24 authored by Wu Zhangjin's avatar Wu Zhangjin Committed by Ralf Baechle
Browse files

MIPS: Loongson: Split common loongson source code out



To share common loongson source code between all of the loongson-based
machines. there is a need to split it out of the fuloong-2e/ directory.
at the same time, other according tuning is needed. the machine-specific
parts are defined as macros in relative header file, pci.h, mem.h,
machine.h.

Signed-off-by: default avatarWu Zhangjin <wuzhangjin@gmail.com>
Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent 8e497117
Loading
Loading
Loading
Loading
+9 −23
Original line number Diff line number Diff line
@@ -174,30 +174,15 @@ config LASAT
	select SYS_SUPPORTS_64BIT_KERNEL if BROKEN
	select SYS_SUPPORTS_LITTLE_ENDIAN

config LEMOTE_FULOONG2E
	bool "Lemote Fuloong2e mini-PC"
	select ARCH_SPARSEMEM_ENABLE
	select CEVT_R4K
	select CSRC_R4K
	select SYS_HAS_CPU_LOONGSON2
	select DMA_NONCOHERENT
	select BOOT_ELF32
	select BOARD_SCACHE
	select HAVE_STD_PC_SERIAL_PORT
	select HW_HAS_PCI
	select I8259
	select ISA
	select IRQ_CPU
	select SYS_SUPPORTS_32BIT_KERNEL
	select SYS_SUPPORTS_64BIT_KERNEL
	select SYS_SUPPORTS_LITTLE_ENDIAN
	select SYS_SUPPORTS_HIGHMEM
	select SYS_HAS_EARLY_PRINTK
	select GENERIC_ISA_DMA_SUPPORT_BROKEN
	select CPU_HAS_WB
config MACH_LOONGSON
	bool "Loongson family of machines"
	help
	  Lemote Fuloong2e mini-PC board based on the Chinese Loongson-2E CPU and
	  an FPGA northbridge
	  This enables the support of Loongson 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.

config MIPS_MALTA
	bool "MIPS Malta board"
@@ -668,6 +653,7 @@ 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"

endmenu

+4 −3
Original line number Diff line number Diff line
@@ -314,11 +314,12 @@ cflags-$(CONFIG_WR_PPMC) += -I$(srctree)/arch/mips/include/asm/mach-wrppmc
load-$(CONFIG_WR_PPMC)		+= 0xffffffff80100000

#
# lemote fuloong2e mini-PC board
# Loongson family
#
core-$(CONFIG_LEMOTE_FULOONG2E) +=arch/mips/loongson/fuloong-2e/
core-$(CONFIG_MACH_LOONGSON) +=arch/mips/loongson/
cflags-$(CONFIG_MACH_LOONGSON) += -I$(srctree)/arch/mips/include/asm/mach-loongson \
                    -mno-branch-likely
load-$(CONFIG_LEMOTE_FULOONG2E) +=0xffffffff80100000
cflags-$(CONFIG_LEMOTE_FULOONG2E) += -I$(srctree)/arch/mips/include/asm/mach-loongson/

#
# MIPS Malta board
+11 −0
Original line number Diff line number Diff line
@@ -21,6 +21,10 @@
/* loongson internal northbridge initialization */
extern void bonito_irq_init(void);

/* machine-specific reboot/halt operation */
extern void mach_prepare_reboot(void);
extern void mach_prepare_shutdown(void);

/* environment arguments from bootloader */
extern unsigned long bus_clock, cpu_clock_freq;
extern unsigned long memsize, highmemsize;
@@ -30,6 +34,13 @@ extern void __init prom_init_memory(void);
extern void __init prom_init_cmdline(void);
extern void __init prom_init_env(void);

/* irq operation functions */
extern void bonito_irqdispatch(void);
extern void __init bonito_irq_init(void);
extern void __init set_irq_trigger_mode(void);
extern void __init mach_init_irq(void);
extern void mach_irq_dispatch(unsigned int pending);

/* PCI Configuration Registers */
#define LOONGSON_PCI_ISR4C  BONITO_PCI_REG(0x4c)

+22 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2009 Lemote, Inc. & Institute of Computing Technology
 * Author: Wu Zhangjin <wuzj@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.
 */

#ifndef __ASM_MACH_LOONGSON_MACHINE_H
#define __ASM_MACH_LOONGSON_MACHINE_H

#ifdef CONFIG_LEMOTE_FULOONG2E

#define LOONGSON_UART_BASE (BONITO_PCIIO_BASE + 0x3f8)

#define LOONGSON_MACHNAME "lemote-fuloong-2e-box"

#endif

#endif /* __ASM_MACH_LOONGSON_MACHINE_H */
+30 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2009 Lemote, Inc. & Institute of Computing Technology
 * Author: Wu Zhangjin <wuzj@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.
 */

#ifndef __ASM_MACH_LOONGSON_MEM_H
#define __ASM_MACH_LOONGSON_MEM_H

/*
 * On Lemote Loongson 2e
 *
 * the high memory space starts from 512M.
 * the peripheral registers reside between 0x1000:0000 and 0x2000:0000.
 */

#ifdef CONFIG_LEMOTE_FULOONG2E

#define LOONGSON_HIGHMEM_START  0x20000000

#define LOONGSON_MMIO_MEM_START 0x10000000
#define LOONGSON_MMIO_MEM_END   0x20000000

#endif

#endif /* __ASM_MACH_LOONGSON_MEM_H */
Loading