aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/include
diff options
context:
space:
mode:
authorWu Zhangjin <wuzhangjin@gmail.com>2009-07-02 11:26:45 -0400
committerRalf Baechle <ralf@linux-mips.org>2009-09-17 14:07:47 -0400
commit85749d24bcf90440b10394312e5b1c96d1a62cdb (patch)
treee244d0d79d24e066871ae207a851d38973d57345 /arch/mips/include
parent8e4971175acc910eb4258df82a6bd8f2c4e4e5b5 (diff)
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: Wu Zhangjin <wuzhangjin@gmail.com> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/include')
-rw-r--r--arch/mips/include/asm/mach-loongson/loongson.h11
-rw-r--r--arch/mips/include/asm/mach-loongson/machine.h22
-rw-r--r--arch/mips/include/asm/mach-loongson/mem.h30
-rw-r--r--arch/mips/include/asm/mach-loongson/pci.h12
4 files changed, 72 insertions, 3 deletions
diff --git a/arch/mips/include/asm/mach-loongson/loongson.h b/arch/mips/include/asm/mach-loongson/loongson.h
index e9f74dee24ef..da70bcf2304e 100644
--- a/arch/mips/include/asm/mach-loongson/loongson.h
+++ b/arch/mips/include/asm/mach-loongson/loongson.h
@@ -21,6 +21,10 @@
21/* loongson internal northbridge initialization */ 21/* loongson internal northbridge initialization */
22extern void bonito_irq_init(void); 22extern void bonito_irq_init(void);
23 23
24/* machine-specific reboot/halt operation */
25extern void mach_prepare_reboot(void);
26extern void mach_prepare_shutdown(void);
27
24/* environment arguments from bootloader */ 28/* environment arguments from bootloader */
25extern unsigned long bus_clock, cpu_clock_freq; 29extern unsigned long bus_clock, cpu_clock_freq;
26extern unsigned long memsize, highmemsize; 30extern unsigned long memsize, highmemsize;
@@ -30,6 +34,13 @@ extern void __init prom_init_memory(void);
30extern void __init prom_init_cmdline(void); 34extern void __init prom_init_cmdline(void);
31extern void __init prom_init_env(void); 35extern void __init prom_init_env(void);
32 36
37/* irq operation functions */
38extern void bonito_irqdispatch(void);
39extern void __init bonito_irq_init(void);
40extern void __init set_irq_trigger_mode(void);
41extern void __init mach_init_irq(void);
42extern void mach_irq_dispatch(unsigned int pending);
43
33/* PCI Configuration Registers */ 44/* PCI Configuration Registers */
34#define LOONGSON_PCI_ISR4C BONITO_PCI_REG(0x4c) 45#define LOONGSON_PCI_ISR4C BONITO_PCI_REG(0x4c)
35 46
diff --git a/arch/mips/include/asm/mach-loongson/machine.h b/arch/mips/include/asm/mach-loongson/machine.h
new file mode 100644
index 000000000000..8e60d363594e
--- /dev/null
+++ b/arch/mips/include/asm/mach-loongson/machine.h
@@ -0,0 +1,22 @@
1/*
2 * Copyright (C) 2009 Lemote, Inc. & Institute of Computing Technology
3 * Author: Wu Zhangjin <wuzj@lemote.com>
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version.
9 */
10
11#ifndef __ASM_MACH_LOONGSON_MACHINE_H
12#define __ASM_MACH_LOONGSON_MACHINE_H
13
14#ifdef CONFIG_LEMOTE_FULOONG2E
15
16#define LOONGSON_UART_BASE (BONITO_PCIIO_BASE + 0x3f8)
17
18#define LOONGSON_MACHNAME "lemote-fuloong-2e-box"
19
20#endif
21
22#endif /* __ASM_MACH_LOONGSON_MACHINE_H */
diff --git a/arch/mips/include/asm/mach-loongson/mem.h b/arch/mips/include/asm/mach-loongson/mem.h
new file mode 100644
index 000000000000..bd7b3cba7e35
--- /dev/null
+++ b/arch/mips/include/asm/mach-loongson/mem.h
@@ -0,0 +1,30 @@
1/*
2 * Copyright (C) 2009 Lemote, Inc. & Institute of Computing Technology
3 * Author: Wu Zhangjin <wuzj@lemote.com>
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version.
9 */
10
11#ifndef __ASM_MACH_LOONGSON_MEM_H
12#define __ASM_MACH_LOONGSON_MEM_H
13
14/*
15 * On Lemote Loongson 2e
16 *
17 * the high memory space starts from 512M.
18 * the peripheral registers reside between 0x1000:0000 and 0x2000:0000.
19 */
20
21#ifdef CONFIG_LEMOTE_FULOONG2E
22
23#define LOONGSON_HIGHMEM_START 0x20000000
24
25#define LOONGSON_MMIO_MEM_START 0x10000000
26#define LOONGSON_MMIO_MEM_END 0x20000000
27
28#endif
29
30#endif /* __ASM_MACH_LOONGSON_MEM_H */
diff --git a/arch/mips/include/asm/mach-loongson/pci.h b/arch/mips/include/asm/mach-loongson/pci.h
index e229b2904cc9..f1663ca81da0 100644
--- a/arch/mips/include/asm/mach-loongson/pci.h
+++ b/arch/mips/include/asm/mach-loongson/pci.h
@@ -24,8 +24,14 @@
24 24
25extern struct pci_ops bonito64_pci_ops; 25extern struct pci_ops bonito64_pci_ops;
26 26
27#define LOONGSON2E_PCI_MEM_START BONITO_PCILO1_BASE 27#ifdef CONFIG_LEMOTE_FULOONG2E
28#define LOONGSON2E_PCI_MEM_END (BONITO_PCILO1_BASE + 0x04000000 * 2) 28
29#define LOONGSON2E_PCI_IO_START 0x00004000UL 29/* this pci memory space is mapped by pcimap in pci.c */
30#define LOONGSON_PCI_MEM_START BONITO_PCILO1_BASE
31#define LOONGSON_PCI_MEM_END (BONITO_PCILO1_BASE + 0x04000000 * 2)
32/* this is an offset from mips_io_port_base */
33#define LOONGSON_PCI_IO_START 0x00004000UL
34
35#endif
30 36
31#endif /* !__ASM_MACH_LOONGSON_PCI_H_ */ 37#endif /* !__ASM_MACH_LOONGSON_PCI_H_ */