diff options
Diffstat (limited to 'arch/mips/gt64120')
-rw-r--r-- | arch/mips/gt64120/wrppmc/Makefile | 2 | ||||
-rw-r--r-- | arch/mips/gt64120/wrppmc/irq.c | 23 | ||||
-rw-r--r-- | arch/mips/gt64120/wrppmc/pci.c | 3 | ||||
-rw-r--r-- | arch/mips/gt64120/wrppmc/reset.c | 10 | ||||
-rw-r--r-- | arch/mips/gt64120/wrppmc/serial.c | 80 | ||||
-rw-r--r-- | arch/mips/gt64120/wrppmc/setup.c | 39 | ||||
-rw-r--r-- | arch/mips/gt64120/wrppmc/time.c | 13 |
7 files changed, 94 insertions, 76 deletions
diff --git a/arch/mips/gt64120/wrppmc/Makefile b/arch/mips/gt64120/wrppmc/Makefile index bef15c90ae15..b49d282bee8a 100644 --- a/arch/mips/gt64120/wrppmc/Makefile +++ b/arch/mips/gt64120/wrppmc/Makefile | |||
@@ -9,6 +9,6 @@ | |||
9 | # Makefile for the Wind River MIPS 4KC PPMC Eval Board | 9 | # Makefile for the Wind River MIPS 4KC PPMC Eval Board |
10 | # | 10 | # |
11 | 11 | ||
12 | obj-y += irq.o reset.o setup.o time.o pci.o | 12 | obj-y += irq.o pci.o reset.o serial.o setup.o time.o |
13 | 13 | ||
14 | EXTRA_CFLAGS += -Werror | 14 | EXTRA_CFLAGS += -Werror |
diff --git a/arch/mips/gt64120/wrppmc/irq.c b/arch/mips/gt64120/wrppmc/irq.c index 06177bf5b1d6..c6e706274db4 100644 --- a/arch/mips/gt64120/wrppmc/irq.c +++ b/arch/mips/gt64120/wrppmc/irq.c | |||
@@ -9,26 +9,13 @@ | |||
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/errno.h> | 12 | #include <linux/hardirq.h> |
13 | #include <linux/init.h> | 13 | #include <linux/init.h> |
14 | #include <linux/kernel_stat.h> | 14 | #include <linux/irq.h> |
15 | #include <linux/module.h> | 15 | |
16 | #include <linux/signal.h> | ||
17 | #include <linux/sched.h> | ||
18 | #include <linux/types.h> | ||
19 | #include <linux/interrupt.h> | ||
20 | #include <linux/ioport.h> | ||
21 | #include <linux/timex.h> | ||
22 | #include <linux/slab.h> | ||
23 | #include <linux/random.h> | ||
24 | #include <linux/bitops.h> | ||
25 | #include <asm/bootinfo.h> | ||
26 | #include <asm/io.h> | ||
27 | #include <asm/bitops.h> | ||
28 | #include <asm/mipsregs.h> | ||
29 | #include <asm/system.h> | ||
30 | #include <asm/irq_cpu.h> | ||
31 | #include <asm/gt64120.h> | 16 | #include <asm/gt64120.h> |
17 | #include <asm/irq_cpu.h> | ||
18 | #include <asm/mipsregs.h> | ||
32 | 19 | ||
33 | asmlinkage void plat_irq_dispatch(void) | 20 | asmlinkage void plat_irq_dispatch(void) |
34 | { | 21 | { |
diff --git a/arch/mips/gt64120/wrppmc/pci.c b/arch/mips/gt64120/wrppmc/pci.c index 0d5289bc1804..d06192faeb7c 100644 --- a/arch/mips/gt64120/wrppmc/pci.c +++ b/arch/mips/gt64120/wrppmc/pci.c | |||
@@ -8,9 +8,10 @@ | |||
8 | * for more details. | 8 | * for more details. |
9 | */ | 9 | */ |
10 | #include <linux/init.h> | 10 | #include <linux/init.h> |
11 | #include <linux/ioport.h> | ||
11 | #include <linux/types.h> | 12 | #include <linux/types.h> |
12 | #include <linux/pci.h> | 13 | #include <linux/pci.h> |
13 | #include <linux/kernel.h> | 14 | |
14 | #include <asm/gt64120.h> | 15 | #include <asm/gt64120.h> |
15 | 16 | ||
16 | extern struct pci_ops gt64xxx_pci0_ops; | 17 | extern struct pci_ops gt64xxx_pci0_ops; |
diff --git a/arch/mips/gt64120/wrppmc/reset.c b/arch/mips/gt64120/wrppmc/reset.c index b97039c6d3db..c355cff38f6c 100644 --- a/arch/mips/gt64120/wrppmc/reset.c +++ b/arch/mips/gt64120/wrppmc/reset.c | |||
@@ -5,14 +5,10 @@ | |||
5 | * | 5 | * |
6 | * Copyright (C) 1997 Ralf Baechle | 6 | * Copyright (C) 1997 Ralf Baechle |
7 | */ | 7 | */ |
8 | #include <linux/sched.h> | 8 | #include <linux/kernel.h> |
9 | #include <linux/mm.h> | 9 | |
10 | #include <asm/io.h> | ||
11 | #include <asm/pgtable.h> | ||
12 | #include <asm/processor.h> | ||
13 | #include <asm/reboot.h> | ||
14 | #include <asm/system.h> | ||
15 | #include <asm/cacheflush.h> | 10 | #include <asm/cacheflush.h> |
11 | #include <asm/mipsregs.h> | ||
16 | 12 | ||
17 | void wrppmc_machine_restart(char *command) | 13 | void wrppmc_machine_restart(char *command) |
18 | { | 14 | { |
diff --git a/arch/mips/gt64120/wrppmc/serial.c b/arch/mips/gt64120/wrppmc/serial.c new file mode 100644 index 000000000000..5ec1c2ffd3a5 --- /dev/null +++ b/arch/mips/gt64120/wrppmc/serial.c | |||
@@ -0,0 +1,80 @@ | |||
1 | /* | ||
2 | * Registration of WRPPMC UART platform device. | ||
3 | * | ||
4 | * Copyright (C) 2007 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
19 | */ | ||
20 | #include <linux/errno.h> | ||
21 | #include <linux/init.h> | ||
22 | #include <linux/ioport.h> | ||
23 | #include <linux/platform_device.h> | ||
24 | #include <linux/serial_8250.h> | ||
25 | |||
26 | #include <asm/gt64120.h> | ||
27 | |||
28 | static struct resource wrppmc_uart_resource[] __initdata = { | ||
29 | { | ||
30 | .start = WRPPMC_UART16550_BASE, | ||
31 | .end = WRPPMC_UART16550_BASE + 7, | ||
32 | .flags = IORESOURCE_MEM, | ||
33 | }, | ||
34 | { | ||
35 | .start = WRPPMC_UART16550_IRQ, | ||
36 | .end = WRPPMC_UART16550_IRQ, | ||
37 | .flags = IORESOURCE_IRQ, | ||
38 | }, | ||
39 | }; | ||
40 | |||
41 | static struct plat_serial8250_port wrppmc_serial8250_port[] = { | ||
42 | { | ||
43 | .irq = WRPPMC_UART16550_IRQ, | ||
44 | .uartclk = WRPPMC_UART16550_CLOCK, | ||
45 | .iotype = UPIO_MEM, | ||
46 | .flags = UPF_IOREMAP | UPF_SKIP_TEST, | ||
47 | .mapbase = WRPPMC_UART16550_BASE, | ||
48 | }, | ||
49 | {}, | ||
50 | }; | ||
51 | |||
52 | static __init int wrppmc_uart_add(void) | ||
53 | { | ||
54 | struct platform_device *pdev; | ||
55 | int retval; | ||
56 | |||
57 | pdev = platform_device_alloc("serial8250", -1); | ||
58 | if (!pdev) | ||
59 | return -ENOMEM; | ||
60 | |||
61 | pdev->id = PLAT8250_DEV_PLATFORM; | ||
62 | pdev->dev.platform_data = wrppmc_serial8250_port; | ||
63 | |||
64 | retval = platform_device_add_resources(pdev, wrppmc_uart_resource, | ||
65 | ARRAY_SIZE(wrppmc_uart_resource)); | ||
66 | if (retval) | ||
67 | goto err_free_device; | ||
68 | |||
69 | retval = platform_device_add(pdev); | ||
70 | if (retval) | ||
71 | goto err_free_device; | ||
72 | |||
73 | return 0; | ||
74 | |||
75 | err_free_device: | ||
76 | platform_device_put(pdev); | ||
77 | |||
78 | return retval; | ||
79 | } | ||
80 | device_initcall(wrppmc_uart_add); | ||
diff --git a/arch/mips/gt64120/wrppmc/setup.c b/arch/mips/gt64120/wrppmc/setup.c index ed58c13b6032..51f6b7862460 100644 --- a/arch/mips/gt64120/wrppmc/setup.c +++ b/arch/mips/gt64120/wrppmc/setup.c | |||
@@ -11,10 +11,6 @@ | |||
11 | #include <linux/init.h> | 11 | #include <linux/init.h> |
12 | #include <linux/string.h> | 12 | #include <linux/string.h> |
13 | #include <linux/kernel.h> | 13 | #include <linux/kernel.h> |
14 | #include <linux/tty.h> | ||
15 | #include <linux/serial.h> | ||
16 | #include <linux/serial_core.h> | ||
17 | #include <linux/serial_8250.h> | ||
18 | #include <linux/pm.h> | 14 | #include <linux/pm.h> |
19 | 15 | ||
20 | #include <asm/io.h> | 16 | #include <asm/io.h> |
@@ -98,35 +94,8 @@ void __init prom_free_prom_memory(void) | |||
98 | { | 94 | { |
99 | } | 95 | } |
100 | 96 | ||
101 | #ifdef CONFIG_SERIAL_8250 | ||
102 | static void wrppmc_setup_serial(void) | ||
103 | { | ||
104 | struct uart_port up; | ||
105 | |||
106 | memset(&up, 0x00, sizeof(struct uart_port)); | ||
107 | |||
108 | /* | ||
109 | * A note about mapbase/membase | ||
110 | * -) mapbase is the physical address of the IO port. | ||
111 | * -) membase is an 'ioremapped' cookie. | ||
112 | */ | ||
113 | up.line = 0; | ||
114 | up.type = PORT_16550; | ||
115 | up.iotype = UPIO_MEM; | ||
116 | up.mapbase = WRPPMC_UART16550_BASE; | ||
117 | up.membase = ioremap(up.mapbase, 8); | ||
118 | up.irq = WRPPMC_UART16550_IRQ; | ||
119 | up.uartclk = WRPPMC_UART16550_CLOCK; | ||
120 | up.flags = UPF_SKIP_TEST/* | UPF_BOOT_AUTOCONF */; | ||
121 | up.regshift = 0; | ||
122 | |||
123 | early_serial_setup(&up); | ||
124 | } | ||
125 | #endif | ||
126 | |||
127 | void __init plat_mem_setup(void) | 97 | void __init plat_mem_setup(void) |
128 | { | 98 | { |
129 | extern void wrppmc_time_init(void); | ||
130 | extern void wrppmc_machine_restart(char *command); | 99 | extern void wrppmc_machine_restart(char *command); |
131 | extern void wrppmc_machine_halt(void); | 100 | extern void wrppmc_machine_halt(void); |
132 | extern void wrppmc_machine_power_off(void); | 101 | extern void wrppmc_machine_power_off(void); |
@@ -135,17 +104,10 @@ void __init plat_mem_setup(void) | |||
135 | _machine_halt = wrppmc_machine_halt; | 104 | _machine_halt = wrppmc_machine_halt; |
136 | pm_power_off = wrppmc_machine_power_off; | 105 | pm_power_off = wrppmc_machine_power_off; |
137 | 106 | ||
138 | /* Use MIPS Count/Compare Timer */ | ||
139 | board_time_init = wrppmc_time_init; | ||
140 | |||
141 | /* This makes the operations of 'in/out[bwl]' to the | 107 | /* This makes the operations of 'in/out[bwl]' to the |
142 | * physical address ( < KSEG0) can work via KSEG1 | 108 | * physical address ( < KSEG0) can work via KSEG1 |
143 | */ | 109 | */ |
144 | set_io_port_base(KSEG1); | 110 | set_io_port_base(KSEG1); |
145 | |||
146 | #ifdef CONFIG_SERIAL_8250 | ||
147 | wrppmc_setup_serial(); | ||
148 | #endif | ||
149 | } | 111 | } |
150 | 112 | ||
151 | const char *get_system_type(void) | 113 | const char *get_system_type(void) |
@@ -159,7 +121,6 @@ const char *get_system_type(void) | |||
159 | */ | 121 | */ |
160 | void __init prom_init(void) | 122 | void __init prom_init(void) |
161 | { | 123 | { |
162 | mips_machgroup = MACH_GROUP_WINDRIVER; | ||
163 | mips_machtype = MACH_WRPPMC; | 124 | mips_machtype = MACH_WRPPMC; |
164 | 125 | ||
165 | add_memory_region(WRPPMC_SDRAM_SCS0_BASE, WRPPMC_SDRAM_SCS0_SIZE, BOOT_MEM_RAM); | 126 | add_memory_region(WRPPMC_SDRAM_SCS0_BASE, WRPPMC_SDRAM_SCS0_SIZE, BOOT_MEM_RAM); |
diff --git a/arch/mips/gt64120/wrppmc/time.c b/arch/mips/gt64120/wrppmc/time.c index 5b440859bcee..b207e7f1417a 100644 --- a/arch/mips/gt64120/wrppmc/time.c +++ b/arch/mips/gt64120/wrppmc/time.c | |||
@@ -11,18 +11,11 @@ | |||
11 | * Copyright (C) 2006, Wind River System Inc. | 11 | * Copyright (C) 2006, Wind River System Inc. |
12 | */ | 12 | */ |
13 | #include <linux/init.h> | 13 | #include <linux/init.h> |
14 | #include <linux/string.h> | ||
15 | #include <linux/kernel.h> | ||
16 | #include <linux/param.h> /* for HZ */ | ||
17 | #include <linux/irq.h> | ||
18 | #include <linux/timex.h> | ||
19 | #include <linux/interrupt.h> | 14 | #include <linux/interrupt.h> |
15 | #include <linux/irq.h> | ||
20 | 16 | ||
21 | #include <asm/reboot.h> | ||
22 | #include <asm/time.h> | ||
23 | #include <asm/io.h> | ||
24 | #include <asm/bootinfo.h> | ||
25 | #include <asm/gt64120.h> | 17 | #include <asm/gt64120.h> |
18 | #include <asm/time.h> | ||
26 | 19 | ||
27 | #define WRPPMC_CPU_CLK_FREQ 40000000 /* 40MHZ */ | 20 | #define WRPPMC_CPU_CLK_FREQ 40000000 /* 40MHZ */ |
28 | 21 | ||
@@ -38,7 +31,7 @@ void __init plat_timer_setup(struct irqaction *irq) | |||
38 | * NOTE: We disable all GT64120 timers, and use MIPS processor internal | 31 | * NOTE: We disable all GT64120 timers, and use MIPS processor internal |
39 | * timer as the source of kernel clock tick. | 32 | * timer as the source of kernel clock tick. |
40 | */ | 33 | */ |
41 | void __init wrppmc_time_init(void) | 34 | void __init plat_time_init(void) |
42 | { | 35 | { |
43 | /* Disable GT64120 timers */ | 36 | /* Disable GT64120 timers */ |
44 | GT_WRITE(GT_TC_CONTROL_OFS, 0x00); | 37 | GT_WRITE(GT_TC_CONTROL_OFS, 0x00); |