2 * linux/arch/arm/mach-cpe/arch.c
3 * modified by ivan wang 2004/8/18 01:35pm
6 #include <linux/delay.h>
8 #include <linux/init.h>
12 #include <asm/setup.h>
13 #include <asm/mach-types.h>
14 #include <asm/mach/arch.h>
15 #include <asm/arch/hardware.h>
16 #include <asm/sizes.h>
17 #include <asm/mach/map.h>
18 #include <asm/arch/time.h> /*Calling moxa_timer_init*/
19 #include <asm/arch/irq.h> /*Calling moxa_irq_init*/
20 #include <asm/arch/moxa.h>
21 #include <linux/serial.h>
22 #include <linux/serial_core.h>
23 #include <asm/arch/moxa.h>
25 #if 0 // mask by Victor Yu. 02-12-2007
26 static struct uart_port moxa_serial_ports
[] = {
28 .iobase
= CPE_UART1_BASE
,
29 .mapbase
= CPE_UART1_BASE
,
31 .flags
= UPF_SKIP_TEST
|UPF_SHARE_IRQ
,
34 .uartclk
= CONFIG_UART_CLK
,
40 .mapbase
= CPE_UART2_BASE
,
41 .iobase
= CPE_UART2_BASE
,
43 .flags
= UPF_SKIP_TEST
|UPF_SHARE_IRQ
,
46 .uartclk
= CONFIG_UART_CLK
,
53 static struct uart_port moxa_serial_ports
[2];
56 #if 0 // mask by Victor Yu. 02-08-2007
57 static int __init
moxa_serial_init(void)
59 early_serial_setup(&moxa_serial_ports
[0]);
60 early_serial_setup(&moxa_serial_ports
[1]);
63 __initcall(moxa_serial_init
);
66 #if 1 // add by Victor Yu, 03-15-2007
67 #include <linux/interrupt.h>
68 extern void cpe_mask_irq(unsigned int irq
);
69 extern void cpe_unmask_irq(unsigned int irq
);
70 extern void cpe_mask_ack_irq(unsigned int irq
);
71 extern void cpe_clear_irq(unsigned int intNum
);
72 extern void cpe_int_init(void);
73 static struct irqchip cpe_irq_chip
;
74 static void irq_init_irq(void)
82 cpe_irq_chip
.ack
= cpe_mask_ack_irq
;
83 cpe_irq_chip
.mask
= cpe_mask_irq
;
84 cpe_irq_chip
.unmask
= cpe_unmask_irq
;
85 for (irq
= 0; irq
< NR_IRQS
; irq
++) {
86 set_irq_chip(irq
, &cpe_irq_chip
);
87 set_irq_handler(irq
, do_level_IRQ
);
88 set_irq_flags(irq
, IRQF_VALID
);
94 fixup_uc711x(struct machine_desc
*desc
, struct tag
*tags
, char **cmdline
, struct meminfo
*mi
)
97 mi
->bank
[0].start
= CONFIG_DRAM_BASE
;
98 mi
->bank
[0].size
= CONFIG_DRAM_SIZE
;
101 #if 1 // add by Victor Yu. 02-12-2007
102 moxa_serial_ports
[0].iobase
= CPE_UART1_BASE
;
103 moxa_serial_ports
[0].mapbase
= CPE_UART1_BASE
;
104 moxa_serial_ports
[0].irq
= IRQ_UART
;
105 moxa_serial_ports
[0].flags
= UPF_SKIP_TEST
|UPF_SHARE_IRQ
;
106 moxa_serial_ports
[0].iotype
= UPIO_PORT
;
107 moxa_serial_ports
[0].regshift
= 2;
108 moxa_serial_ports
[0].uartclk
= CONFIG_UART_CLK
;
109 moxa_serial_ports
[0].line
= 0;
110 moxa_serial_ports
[0].type
= PORT_16550A
;
111 moxa_serial_ports
[0].fifosize
= 16;
113 moxa_serial_ports
[1].iobase
= CPE_UART2_BASE
;
114 moxa_serial_ports
[1].mapbase
= CPE_UART2_BASE
;
115 moxa_serial_ports
[1].irq
= IRQ_UART
;
116 moxa_serial_ports
[1].flags
= UPF_SKIP_TEST
|UPF_SHARE_IRQ
;
117 moxa_serial_ports
[1].iotype
= UPIO_PORT
;
118 moxa_serial_ports
[1].regshift
= 2;
119 moxa_serial_ports
[1].uartclk
= CONFIG_UART_CLK
;
120 moxa_serial_ports
[1].line
= 1;
121 moxa_serial_ports
[1].type
= PORT_16550A
;
122 moxa_serial_ports
[1].fifosize
= 16;
124 early_serial_setup(&moxa_serial_ports
[0]);
125 early_serial_setup(&moxa_serial_ports
[1]);
129 extern struct sys_timer moxa_timer
;
131 #ifdef CONFIG_ARCH_UC7110
132 MACHINE_START(MOXART
, "UC7110")
133 .fixup
= fixup_uc711x
,
134 .init_irq
= irq_init_irq
,
135 .timer
= &moxa_timer
,
139 #ifdef CONFIG_ARCH_UC7112
140 MACHINE_START(MOXART
, "UC7112")
141 .fixup
= fixup_uc711x
,
142 .init_irq
= irq_init_irq
,
143 .timer
= &moxa_timer
,
147 #ifdef CONFIG_ARCH_EM1220
148 MACHINE_START(MOXART
, "EM1220")
149 .fixup
= fixup_uc711x
,
150 .init_irq
= irq_init_irq
,
151 .timer
= &moxa_timer
,
155 #ifdef CONFIG_ARCH_EM1220_DLIN
156 MACHINE_START(MOXART
, "EM1220 DLIN")
157 .fixup
= fixup_uc711x
,
158 .init_irq
= irq_init_irq
,
159 .timer
= &moxa_timer
,
163 #ifdef CONFIG_ARCH_EM1220_APIT
164 MACHINE_START(MOXART
, "EM1220 APIT")
165 .fixup
= fixup_uc711x
,
166 .init_irq
= irq_init_irq
,
167 .timer
= &moxa_timer
,
171 #ifdef CONFIG_ARCH_EM1240
172 MACHINE_START(MOXART
, "EM1240")
173 .fixup
= fixup_uc711x
,
174 .init_irq
= irq_init_irq
,
175 .timer
= &moxa_timer
,
179 #ifdef CONFIG_ARCH_EM1240_IVTC
180 MACHINE_START(MOXART
, "EM1240 IVTC")
181 .fixup
= fixup_uc711x
,
182 .init_irq
= irq_init_irq
,
183 .timer
= &moxa_timer
,
187 #ifdef CONFIG_ARCH_EM1240_MT
188 MACHINE_START(MOXART
, "EM1240 MT")
189 .fixup
= fixup_uc711x
,
190 .init_irq
= irq_init_irq
,
191 .timer
= &moxa_timer
,
195 #ifdef CONFIG_ARCH_W321_GL2
196 MACHINE_START(MOXART
, "W321 GL2")
197 .fixup
= fixup_uc711x
,
198 .init_irq
= irq_init_irq
,
199 .timer
= &moxa_timer
,
203 #ifdef CONFIG_ARCH_W315_EC
204 MACHINE_START(MOXART
, "W315_EC")
205 .fixup
= fixup_uc711x
,
206 .init_irq
= irq_init_irq
,
207 .timer
= &moxa_timer
,
211 #ifdef CONFIG_ARCH_UC7101
212 MACHINE_START(MOXART
, "UC7101")
213 .fixup
= fixup_uc711x
,
214 .init_irq
= irq_init_irq
,
215 .timer
= &moxa_timer
,
219 #ifdef CONFIG_ARCH_W311_TEST
220 MACHINE_START(MOXART
, "W311_TEST")
221 .fixup
= fixup_uc711x
,
222 .init_irq
= irq_init_irq
,
223 .timer
= &moxa_timer
,
227 #ifdef CONFIG_ARCH_EM1110
228 MACHINE_START(MOXART
, "EM1110")
229 .fixup
= fixup_uc711x
,
230 .init_irq
= irq_init_irq
,
231 .timer
= &moxa_timer
,