diff options
author | Wu Zhangjin <wuzj@lemote.com> | 2009-07-02 11:23:03 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2009-09-17 14:07:46 -0400 |
commit | 5e983ff654ca3df3007b5b558b5271bb4622afa4 (patch) | |
tree | f15edfeb1df8e0b1874adec3e09a4fc1c58d59f2 | |
parent | bd92aa013e8fcd17328ec8e060477761cf3380d9 (diff) |
MIPS: Loongson: clean up the coding style
With the help of script/checkpatch.pl, i have cleaned up the coding
style.
1. remove un-needed header files and tune some comments.
2. remove some un-needed { }
add a new header file loongson.h:
3. move some common header files to loongson.h
4. move some common extern declartions to loongson.h
and this new header file is needed for future loongson2f support.
Signed-off-by: Wu Zhangjin <wuzj@lemote.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
-rw-r--r-- | arch/mips/include/asm/mach-lemote/loongson.h | 36 | ||||
-rw-r--r-- | arch/mips/include/asm/mach-lemote/pci.h | 8 | ||||
-rw-r--r-- | arch/mips/lemote/lm2e/bonito-irq.c | 27 | ||||
-rw-r--r-- | arch/mips/lemote/lm2e/cmdline.c | 5 | ||||
-rw-r--r-- | arch/mips/lemote/lm2e/early_printk.c | 4 | ||||
-rw-r--r-- | arch/mips/lemote/lm2e/env.c | 6 | ||||
-rw-r--r-- | arch/mips/lemote/lm2e/init.c | 6 | ||||
-rw-r--r-- | arch/mips/lemote/lm2e/irq.c | 48 | ||||
-rw-r--r-- | arch/mips/lemote/lm2e/mem.c | 2 | ||||
-rw-r--r-- | arch/mips/lemote/lm2e/pci.c | 26 | ||||
-rw-r--r-- | arch/mips/lemote/lm2e/reset.c | 43 | ||||
-rw-r--r-- | arch/mips/lemote/lm2e/setup.c | 22 | ||||
-rw-r--r-- | arch/mips/lemote/lm2e/time.c | 5 | ||||
-rw-r--r-- | arch/mips/pci/fixup-lm2e.c | 18 |
14 files changed, 62 insertions, 194 deletions
diff --git a/arch/mips/include/asm/mach-lemote/loongson.h b/arch/mips/include/asm/mach-lemote/loongson.h new file mode 100644 index 000000000000..76cc2bddfa43 --- /dev/null +++ b/arch/mips/include/asm/mach-lemote/loongson.h | |||
@@ -0,0 +1,36 @@ | |||
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 | |||
12 | #ifndef __ASM_MACH_LOONGSON_LOONGSON_H | ||
13 | #define __ASM_MACH_LOONGSON_LOONGSON_H | ||
14 | |||
15 | #include <linux/io.h> | ||
16 | #include <linux/init.h> | ||
17 | |||
18 | /* there is an internal bonito64-compatiable northbridge in loongson2e/2f */ | ||
19 | #include <asm/mips-boards/bonito64.h> | ||
20 | |||
21 | /* loongson internal northbridge initialization */ | ||
22 | extern void bonito_irq_init(void); | ||
23 | |||
24 | /* loongson-based machines specific reboot setup */ | ||
25 | extern void mips_reboot_setup(void); | ||
26 | |||
27 | /* environment arguments from bootloader */ | ||
28 | extern unsigned long bus_clock, cpu_clock_freq; | ||
29 | extern unsigned long memsize, highmemsize; | ||
30 | |||
31 | /* loongson-specific command line, env and memory initialization */ | ||
32 | extern void __init prom_init_memory(void); | ||
33 | extern void __init prom_init_cmdline(void); | ||
34 | extern void __init prom_init_env(void); | ||
35 | |||
36 | #endif /* __ASM_MACH_LOONGSON_LOONGSON_H */ | ||
diff --git a/arch/mips/include/asm/mach-lemote/pci.h b/arch/mips/include/asm/mach-lemote/pci.h index 0307e4935267..92b2f59d890f 100644 --- a/arch/mips/include/asm/mach-lemote/pci.h +++ b/arch/mips/include/asm/mach-lemote/pci.h | |||
@@ -19,11 +19,13 @@ | |||
19 | * 02139, USA. | 19 | * 02139, USA. |
20 | */ | 20 | */ |
21 | 21 | ||
22 | #ifndef _LEMOTE_PCI_H_ | 22 | #ifndef __ASM_MACH_LEMOTE_PCI_H_ |
23 | #define _LEMOTE_PCI_H_ | 23 | #define __ASM_MACH_LEMOTE_PCI_H_ |
24 | |||
25 | extern struct pci_ops bonito64_pci_ops; | ||
24 | 26 | ||
25 | #define LOONGSON2E_PCI_MEM_START 0x14000000UL | 27 | #define LOONGSON2E_PCI_MEM_START 0x14000000UL |
26 | #define LOONGSON2E_PCI_MEM_END 0x1fffffffUL | 28 | #define LOONGSON2E_PCI_MEM_END 0x1fffffffUL |
27 | #define LOONGSON2E_PCI_IO_START 0x00004000UL | 29 | #define LOONGSON2E_PCI_IO_START 0x00004000UL |
28 | 30 | ||
29 | #endif /* !_LEMOTE_PCI_H_ */ | 31 | #endif /* !__ASM_MACH_LEMOTE_PCI_H_ */ |
diff --git a/arch/mips/lemote/lm2e/bonito-irq.c b/arch/mips/lemote/lm2e/bonito-irq.c index 8fc3bce7075b..3e31e7ad713e 100644 --- a/arch/mips/lemote/lm2e/bonito-irq.c +++ b/arch/mips/lemote/lm2e/bonito-irq.c | |||
@@ -10,32 +10,10 @@ | |||
10 | * under the terms of the GNU General Public License as published by the | 10 | * under the terms of the GNU General Public License as published by the |
11 | * Free Software Foundation; either version 2 of the License, or (at your | 11 | * Free Software Foundation; either version 2 of the License, or (at your |
12 | * option) any later version. | 12 | * option) any later version. |
13 | * | ||
14 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED | ||
15 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | ||
16 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN | ||
17 | * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
18 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
19 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | ||
20 | * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
21 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
22 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||
23 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
24 | * | ||
25 | * You should have received a copy of the GNU General Public License along | ||
26 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
27 | * 675 Mass Ave, Cambridge, MA 02139, USA. | ||
28 | * | ||
29 | */ | 13 | */ |
30 | #include <linux/errno.h> | ||
31 | #include <linux/init.h> | ||
32 | #include <linux/io.h> | ||
33 | #include <linux/types.h> | ||
34 | #include <linux/interrupt.h> | 14 | #include <linux/interrupt.h> |
35 | #include <linux/irq.h> | ||
36 | |||
37 | #include <asm/mips-boards/bonito64.h> | ||
38 | 15 | ||
16 | #include <loongson.h> | ||
39 | 17 | ||
40 | static inline void bonito_irq_enable(unsigned int irq) | 18 | static inline void bonito_irq_enable(unsigned int irq) |
41 | { | 19 | { |
@@ -66,9 +44,8 @@ void bonito_irq_init(void) | |||
66 | { | 44 | { |
67 | u32 i; | 45 | u32 i; |
68 | 46 | ||
69 | for (i = BONITO_IRQ_BASE; i < BONITO_IRQ_BASE + 32; i++) { | 47 | for (i = BONITO_IRQ_BASE; i < BONITO_IRQ_BASE + 32; i++) |
70 | set_irq_chip_and_handler(i, &bonito_irq_type, handle_level_irq); | 48 | set_irq_chip_and_handler(i, &bonito_irq_type, handle_level_irq); |
71 | } | ||
72 | 49 | ||
73 | setup_irq(BONITO_IRQ_BASE + 10, &dma_timeout_irqaction); | 50 | setup_irq(BONITO_IRQ_BASE + 10, &dma_timeout_irqaction); |
74 | } | 51 | } |
diff --git a/arch/mips/lemote/lm2e/cmdline.c b/arch/mips/lemote/lm2e/cmdline.c index 442b93587e86..75f1b243ee4e 100644 --- a/arch/mips/lemote/lm2e/cmdline.c +++ b/arch/mips/lemote/lm2e/cmdline.c | |||
@@ -17,11 +17,10 @@ | |||
17 | * Free Software Foundation; either version 2 of the License, or (at your | 17 | * Free Software Foundation; either version 2 of the License, or (at your |
18 | * option) any later version. | 18 | * option) any later version. |
19 | */ | 19 | */ |
20 | #include <linux/io.h> | ||
21 | #include <linux/init.h> | ||
22 | |||
23 | #include <asm/bootinfo.h> | 20 | #include <asm/bootinfo.h> |
24 | 21 | ||
22 | #include <loongson.h> | ||
23 | |||
25 | int prom_argc; | 24 | int prom_argc; |
26 | /* pmon passes arguments in 32bit pointers */ | 25 | /* pmon passes arguments in 32bit pointers */ |
27 | int *_prom_argv; | 26 | int *_prom_argv; |
diff --git a/arch/mips/lemote/lm2e/early_printk.c b/arch/mips/lemote/lm2e/early_printk.c index 811c7dec1edd..3e0a6eaa4041 100644 --- a/arch/mips/lemote/lm2e/early_printk.c +++ b/arch/mips/lemote/lm2e/early_printk.c | |||
@@ -9,11 +9,9 @@ | |||
9 | * Free Software Foundation; either version 2 of the License, or (at your | 9 | * Free Software Foundation; either version 2 of the License, or (at your |
10 | * option) any later version. | 10 | * option) any later version. |
11 | */ | 11 | */ |
12 | #include <linux/io.h> | ||
13 | #include <linux/init.h> | ||
14 | #include <linux/serial_reg.h> | 12 | #include <linux/serial_reg.h> |
15 | 13 | ||
16 | #include <asm/mips-boards/bonito64.h> | 14 | #include <loongson.h> |
17 | 15 | ||
18 | #define UART_BASE (BONITO_PCIIO_BASE + 0x3f8) | 16 | #define UART_BASE (BONITO_PCIIO_BASE + 0x3f8) |
19 | 17 | ||
diff --git a/arch/mips/lemote/lm2e/env.c b/arch/mips/lemote/lm2e/env.c index 9e88409f7a3a..b9ef50385541 100644 --- a/arch/mips/lemote/lm2e/env.c +++ b/arch/mips/lemote/lm2e/env.c | |||
@@ -17,12 +17,10 @@ | |||
17 | * Free Software Foundation; either version 2 of the License, or (at your | 17 | * Free Software Foundation; either version 2 of the License, or (at your |
18 | * option) any later version. | 18 | * option) any later version. |
19 | */ | 19 | */ |
20 | |||
21 | #include <linux/io.h> | ||
22 | #include <linux/init.h> | ||
23 | |||
24 | #include <asm/bootinfo.h> | 20 | #include <asm/bootinfo.h> |
25 | 21 | ||
22 | #include <loongson.h> | ||
23 | |||
26 | unsigned long bus_clock, cpu_clock_freq; | 24 | unsigned long bus_clock, cpu_clock_freq; |
27 | unsigned long memsize, highmemsize; | 25 | unsigned long memsize, highmemsize; |
28 | 26 | ||
diff --git a/arch/mips/lemote/lm2e/init.c b/arch/mips/lemote/lm2e/init.c index 6fe624d697ed..3abe927422a3 100644 --- a/arch/mips/lemote/lm2e/init.c +++ b/arch/mips/lemote/lm2e/init.c | |||
@@ -8,15 +8,11 @@ | |||
8 | * option) any later version. | 8 | * option) any later version. |
9 | */ | 9 | */ |
10 | 10 | ||
11 | #include <linux/init.h> | ||
12 | #include <linux/bootmem.h> | 11 | #include <linux/bootmem.h> |
13 | 12 | ||
14 | #include <asm/bootinfo.h> | 13 | #include <asm/bootinfo.h> |
15 | #include <asm/mips-boards/bonito64.h> | ||
16 | 14 | ||
17 | extern void __init prom_init_cmdline(void); | 15 | #include <loongson.h> |
18 | extern void __init prom_init_env(void); | ||
19 | extern void __init prom_init_memory(void); | ||
20 | 16 | ||
21 | void __init prom_init(void) | 17 | void __init prom_init(void) |
22 | { | 18 | { |
diff --git a/arch/mips/lemote/lm2e/irq.c b/arch/mips/lemote/lm2e/irq.c index 1d0a09f3b832..fb7643a25618 100644 --- a/arch/mips/lemote/lm2e/irq.c +++ b/arch/mips/lemote/lm2e/irq.c | |||
@@ -6,35 +6,14 @@ | |||
6 | * under the terms of the GNU General Public License as published by the | 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 | 7 | * Free Software Foundation; either version 2 of the License, or (at your |
8 | * option) any later version. | 8 | * option) any later version. |
9 | * | ||
10 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED | ||
11 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | ||
12 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN | ||
13 | * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
14 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
15 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | ||
16 | * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
17 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
18 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||
19 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
20 | * | ||
21 | * You should have received a copy of the GNU General Public License along | ||
22 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
23 | * 675 Mass Ave, Cambridge, MA 02139, USA. | ||
24 | * | ||
25 | */ | 9 | */ |
26 | #include <linux/delay.h> | 10 | #include <linux/delay.h> |
27 | #include <linux/io.h> | ||
28 | #include <linux/init.h> | ||
29 | #include <linux/interrupt.h> | 11 | #include <linux/interrupt.h> |
30 | #include <linux/irq.h> | ||
31 | 12 | ||
32 | #include <asm/irq_cpu.h> | 13 | #include <asm/irq_cpu.h> |
33 | #include <asm/i8259.h> | 14 | #include <asm/i8259.h> |
34 | #include <asm/mipsregs.h> | ||
35 | #include <asm/mips-boards/bonito64.h> | ||
36 | |||
37 | 15 | ||
16 | #include <loongson.h> | ||
38 | /* | 17 | /* |
39 | * the first level int-handler will jump here if it is a bonito irq | 18 | * the first level int-handler will jump here if it is a bonito irq |
40 | */ | 19 | */ |
@@ -67,27 +46,24 @@ static void i8259_irqdispatch(void) | |||
67 | int irq; | 46 | int irq; |
68 | 47 | ||
69 | irq = i8259_irq(); | 48 | irq = i8259_irq(); |
70 | if (irq >= 0) { | 49 | if (irq >= 0) |
71 | do_IRQ(irq); | 50 | do_IRQ(irq); |
72 | } else { | 51 | else |
73 | spurious_interrupt(); | 52 | spurious_interrupt(); |
74 | } | ||
75 | |||
76 | } | 53 | } |
77 | 54 | ||
78 | asmlinkage void plat_irq_dispatch(void) | 55 | asmlinkage void plat_irq_dispatch(void) |
79 | { | 56 | { |
80 | unsigned int pending = read_c0_cause() & read_c0_status() & ST0_IM; | 57 | unsigned int pending = read_c0_cause() & read_c0_status() & ST0_IM; |
81 | 58 | ||
82 | if (pending & CAUSEF_IP7) { | 59 | if (pending & CAUSEF_IP7) |
83 | do_IRQ(MIPS_CPU_IRQ_BASE + 7); | 60 | do_IRQ(MIPS_CPU_IRQ_BASE + 7); |
84 | } else if (pending & CAUSEF_IP5) { | 61 | else if (pending & CAUSEF_IP5) |
85 | i8259_irqdispatch(); | 62 | i8259_irqdispatch(); |
86 | } else if (pending & CAUSEF_IP2) { | 63 | else if (pending & CAUSEF_IP2) |
87 | bonito_irqdispatch(); | 64 | bonito_irqdispatch(); |
88 | } else { | 65 | else |
89 | spurious_interrupt(); | 66 | spurious_interrupt(); |
90 | } | ||
91 | } | 67 | } |
92 | 68 | ||
93 | static struct irqaction cascade_irqaction = { | 69 | static struct irqaction cascade_irqaction = { |
@@ -97,8 +73,6 @@ static struct irqaction cascade_irqaction = { | |||
97 | 73 | ||
98 | void __init arch_init_irq(void) | 74 | void __init arch_init_irq(void) |
99 | { | 75 | { |
100 | extern void bonito_irq_init(void); | ||
101 | |||
102 | /* | 76 | /* |
103 | * Clear all of the interrupts while we change the able around a bit. | 77 | * Clear all of the interrupts while we change the able around a bit. |
104 | * int-handler is not on bootstrap | 78 | * int-handler is not on bootstrap |
@@ -128,16 +102,8 @@ void __init arch_init_irq(void) | |||
128 | init_i8259_irqs(); | 102 | init_i8259_irqs(); |
129 | bonito_irq_init(); | 103 | bonito_irq_init(); |
130 | 104 | ||
131 | /* | ||
132 | printk("GPIODATA=%x, GPIOIE=%x\n", BONITO_GPIODATA, BONITO_GPIOIE); | ||
133 | printk("INTEN=%x, INTSET=%x, INTCLR=%x, INTISR=%x\n", | ||
134 | BONITO_INTEN, BONITO_INTENSET, | ||
135 | BONITO_INTENCLR, BONITO_INTISR); | ||
136 | */ | ||
137 | |||
138 | /* bonito irq at IP2 */ | 105 | /* bonito irq at IP2 */ |
139 | setup_irq(MIPS_CPU_IRQ_BASE + 2, &cascade_irqaction); | 106 | setup_irq(MIPS_CPU_IRQ_BASE + 2, &cascade_irqaction); |
140 | /* 8259 irq at IP5 */ | 107 | /* 8259 irq at IP5 */ |
141 | setup_irq(MIPS_CPU_IRQ_BASE + 5, &cascade_irqaction); | 108 | setup_irq(MIPS_CPU_IRQ_BASE + 5, &cascade_irqaction); |
142 | |||
143 | } | 109 | } |
diff --git a/arch/mips/lemote/lm2e/mem.c b/arch/mips/lemote/lm2e/mem.c index f24af70b669b..6a7feb178fa5 100644 --- a/arch/mips/lemote/lm2e/mem.c +++ b/arch/mips/lemote/lm2e/mem.c | |||
@@ -10,7 +10,7 @@ | |||
10 | 10 | ||
11 | #include <asm/bootinfo.h> | 11 | #include <asm/bootinfo.h> |
12 | 12 | ||
13 | extern unsigned long memsize, highmemsize; | 13 | #include <loongson.h> |
14 | 14 | ||
15 | void __init prom_init_memory(void) | 15 | void __init prom_init_memory(void) |
16 | { | 16 | { |
diff --git a/arch/mips/lemote/lm2e/pci.c b/arch/mips/lemote/lm2e/pci.c index 152efb65bba1..bee846e6d8a8 100644 --- a/arch/mips/lemote/lm2e/pci.c +++ b/arch/mips/lemote/lm2e/pci.c | |||
@@ -1,6 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * pci.c | ||
3 | * | ||
4 | * Copyright (C) 2007 Lemote, Inc. & Institute of Computing Technology | 2 | * Copyright (C) 2007 Lemote, Inc. & Institute of Computing Technology |
5 | * Author: Fuxin Zhang, zhangfx@lemote.com | 3 | * Author: Fuxin Zhang, zhangfx@lemote.com |
6 | * | 4 | * |
@@ -8,31 +6,11 @@ | |||
8 | * under the terms of the GNU General Public License as published by the | 6 | * under the terms of the GNU General Public License as published by the |
9 | * Free Software Foundation; either version 2 of the License, or (at your | 7 | * Free Software Foundation; either version 2 of the License, or (at your |
10 | * option) any later version. | 8 | * option) any later version. |
11 | * | ||
12 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED | ||
13 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | ||
14 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN | ||
15 | * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
17 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | ||
18 | * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
19 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
20 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||
21 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
22 | * | ||
23 | * You should have received a copy of the GNU General Public License along | ||
24 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
25 | * 675 Mass Ave, Cambridge, MA 02139, USA. | ||
26 | * | ||
27 | */ | 9 | */ |
28 | #include <linux/types.h> | ||
29 | #include <linux/pci.h> | 10 | #include <linux/pci.h> |
30 | #include <linux/kernel.h> | ||
31 | #include <linux/init.h> | ||
32 | #include <asm/mips-boards/bonito64.h> | ||
33 | #include <asm/mach-lemote/pci.h> | ||
34 | 11 | ||
35 | extern struct pci_ops bonito64_pci_ops; | 12 | #include <pci.h> |
13 | #include <loongson.h> | ||
36 | 14 | ||
37 | static struct resource loongson2e_pci_mem_resource = { | 15 | static struct resource loongson2e_pci_mem_resource = { |
38 | .name = "LOONGSON2E PCI MEM", | 16 | .name = "LOONGSON2E PCI MEM", |
diff --git a/arch/mips/lemote/lm2e/reset.c b/arch/mips/lemote/lm2e/reset.c deleted file mode 100644 index 0faa140f4036..000000000000 --- a/arch/mips/lemote/lm2e/reset.c +++ /dev/null | |||
@@ -1,43 +0,0 @@ | |||
1 | /* | ||
2 | * This program is free software; you can redistribute it and/or modify it | ||
3 | * under the terms of the GNU General Public License as published by the | ||
4 | * Free Software Foundation; either version 2 of the License, or (at your | ||
5 | * option) any later version. | ||
6 | * | ||
7 | * Copyright (C) 2007 Lemote, Inc. & Institute of Computing Technology | ||
8 | * Author: Fuxin Zhang, zhangfx@lemote.com | ||
9 | * Copyright (C) 2009 Lemote, Inc. & Institute of Computing Technology | ||
10 | * Author: Zhangjin Wu, wuzj@lemote.com | ||
11 | */ | ||
12 | #include <linux/init.h> | ||
13 | #include <linux/pm.h> | ||
14 | #include <linux/io.h> | ||
15 | |||
16 | #include <asm/reboot.h> | ||
17 | #include <asm/mips-boards/bonito64.h> | ||
18 | |||
19 | static void loongson2e_restart(char *command) | ||
20 | { | ||
21 | /* do preparation for reboot */ | ||
22 | BONITO_BONGENCFG &= ~(1 << 2); | ||
23 | BONITO_BONGENCFG |= (1 << 2); | ||
24 | |||
25 | /* reboot via jumping to boot base address */ | ||
26 | ((void (*)(void))ioremap_nocache(BONITO_BOOT_BASE, 4)) (); | ||
27 | } | ||
28 | |||
29 | static void loongson2e_halt(void) | ||
30 | { | ||
31 | while (1) ; | ||
32 | } | ||
33 | |||
34 | static int __init mips_reboot_setup(void) | ||
35 | { | ||
36 | _machine_restart = loongson2e_restart; | ||
37 | _machine_halt = loongson2e_halt; | ||
38 | pm_power_off = loongson2e_halt; | ||
39 | |||
40 | return 0; | ||
41 | } | ||
42 | |||
43 | arch_initcall(mips_reboot_setup); | ||
diff --git a/arch/mips/lemote/lm2e/setup.c b/arch/mips/lemote/lm2e/setup.c index 03578cf0ee7e..663902159730 100644 --- a/arch/mips/lemote/lm2e/setup.c +++ b/arch/mips/lemote/lm2e/setup.c | |||
@@ -1,7 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * BRIEF MODULE DESCRIPTION | ||
3 | * setup.c - board dependent boot routines | ||
4 | * | ||
5 | * Copyright (C) 2007 Lemote Inc. & Insititute of Computing Technology | 2 | * Copyright (C) 2007 Lemote Inc. & Insititute of Computing Technology |
6 | * Author: Fuxin Zhang, zhangfx@lemote.com | 3 | * Author: Fuxin Zhang, zhangfx@lemote.com |
7 | * | 4 | * |
@@ -9,28 +6,13 @@ | |||
9 | * under the terms of the GNU General Public License as published by the | 6 | * under the terms of the GNU General Public License as published by the |
10 | * Free Software Foundation; either version 2 of the License, or (at your | 7 | * Free Software Foundation; either version 2 of the License, or (at your |
11 | * option) any later version. | 8 | * option) any later version. |
12 | * | ||
13 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED | ||
14 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | ||
15 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN | ||
16 | * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
17 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
18 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | ||
19 | * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
20 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
21 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||
22 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
23 | * | ||
24 | * You should have received a copy of the GNU General Public License along | ||
25 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
26 | * 675 Mass Ave, Cambridge, MA 02139, USA. | ||
27 | * | ||
28 | */ | 9 | */ |
29 | #include <linux/init.h> | ||
30 | #include <linux/module.h> | 10 | #include <linux/module.h> |
31 | 11 | ||
32 | #include <asm/wbflush.h> | 12 | #include <asm/wbflush.h> |
33 | 13 | ||
14 | #include <loongson.h> | ||
15 | |||
34 | #ifdef CONFIG_VT | 16 | #ifdef CONFIG_VT |
35 | #include <linux/console.h> | 17 | #include <linux/console.h> |
36 | #include <linux/screen_info.h> | 18 | #include <linux/screen_info.h> |
diff --git a/arch/mips/lemote/lm2e/time.c b/arch/mips/lemote/lm2e/time.c index b9d3f11b6203..b13d17174654 100644 --- a/arch/mips/lemote/lm2e/time.c +++ b/arch/mips/lemote/lm2e/time.c | |||
@@ -10,13 +10,10 @@ | |||
10 | * Free Software Foundation; either version 2 of the License, or (at your | 10 | * Free Software Foundation; either version 2 of the License, or (at your |
11 | * option) any later version. | 11 | * option) any later version. |
12 | */ | 12 | */ |
13 | |||
14 | #include <linux/init.h> | ||
15 | |||
16 | #include <asm/mc146818-time.h> | 13 | #include <asm/mc146818-time.h> |
17 | #include <asm/time.h> | 14 | #include <asm/time.h> |
18 | 15 | ||
19 | extern unsigned long cpu_clock_freq; | 16 | #include <loongson.h> |
20 | 17 | ||
21 | void __init plat_time_init(void) | 18 | void __init plat_time_init(void) |
22 | { | 19 | { |
diff --git a/arch/mips/pci/fixup-lm2e.c b/arch/mips/pci/fixup-lm2e.c index e18ae4f574c1..0c4c7a81213f 100644 --- a/arch/mips/pci/fixup-lm2e.c +++ b/arch/mips/pci/fixup-lm2e.c | |||
@@ -1,6 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * fixup-lm2e.c | ||
3 | * | ||
4 | * Copyright (C) 2004 ICT CAS | 2 | * Copyright (C) 2004 ICT CAS |
5 | * Author: Li xiaoyu, ICT CAS | 3 | * Author: Li xiaoyu, ICT CAS |
6 | * lixy@ict.ac.cn | 4 | * lixy@ict.ac.cn |
@@ -12,22 +10,6 @@ | |||
12 | * under the terms of the GNU General Public License as published by the | 10 | * under the terms of the GNU General Public License as published by the |
13 | * Free Software Foundation; either version 2 of the License, or (at your | 11 | * Free Software Foundation; either version 2 of the License, or (at your |
14 | * option) any later version. | 12 | * option) any later version. |
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED | ||
17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | ||
18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN | ||
19 | * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
21 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | ||
22 | * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
23 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||
25 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | * | ||
27 | * You should have received a copy of the GNU General Public License along | ||
28 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
29 | * 675 Mass Ave, Cambridge, MA 02139, USA. | ||
30 | * | ||
31 | */ | 13 | */ |
32 | #include <linux/init.h> | 14 | #include <linux/init.h> |
33 | #include <linux/pci.h> | 15 | #include <linux/pci.h> |