diff options
author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:20:36 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:20:36 -0400 |
commit | 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch) | |
tree | 0bba044c4ce775e45a88a51686b5d9f90697ea9d /arch/arm/mach-h720x |
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history,
even though we have it. We can create a separate "historical" git
archive of that later if we want to, and in the meantime it's about
3.2GB when imported into git - space that would just make the early
git days unnecessarily complicated, when we don't have a lot of good
infrastructure for it.
Let it rip!
Diffstat (limited to 'arch/arm/mach-h720x')
-rw-r--r-- | arch/arm/mach-h720x/Kconfig | 38 | ||||
-rw-r--r-- | arch/arm/mach-h720x/Makefile | 16 | ||||
-rw-r--r-- | arch/arm/mach-h720x/Makefile.boot | 2 | ||||
-rw-r--r-- | arch/arm/mach-h720x/common.c | 247 | ||||
-rw-r--r-- | arch/arm/mach-h720x/common.h | 29 | ||||
-rw-r--r-- | arch/arm/mach-h720x/cpu-h7201.c | 64 | ||||
-rw-r--r-- | arch/arm/mach-h720x/cpu-h7202.c | 228 | ||||
-rw-r--r-- | arch/arm/mach-h720x/h7201-eval.c | 39 | ||||
-rw-r--r-- | arch/arm/mach-h720x/h7202-eval.c | 81 |
9 files changed, 744 insertions, 0 deletions
diff --git a/arch/arm/mach-h720x/Kconfig b/arch/arm/mach-h720x/Kconfig new file mode 100644 index 000000000000..9b6982efbd22 --- /dev/null +++ b/arch/arm/mach-h720x/Kconfig | |||
@@ -0,0 +1,38 @@ | |||
1 | if ARCH_H720X | ||
2 | |||
3 | menu "h720x Implementations" | ||
4 | |||
5 | config ARCH_H7201 | ||
6 | bool "gms30c7201" | ||
7 | depends on ARCH_H720X | ||
8 | select CPU_H7201 | ||
9 | help | ||
10 | Say Y here if you are using the Hynix GMS30C7201 Reference Board | ||
11 | |||
12 | config ARCH_H7202 | ||
13 | bool "hms30c7202" | ||
14 | select CPU_H7202 | ||
15 | depends on ARCH_H720X | ||
16 | help | ||
17 | Say Y here if you are using the Hynix HMS30C7202 Reference Board | ||
18 | |||
19 | endmenu | ||
20 | |||
21 | config CPU_H7201 | ||
22 | bool | ||
23 | help | ||
24 | Select code specific to h7201 variants | ||
25 | |||
26 | config CPU_H7202 | ||
27 | bool | ||
28 | help | ||
29 | Select code specific to h7202 variants | ||
30 | config H7202_SERIAL23 | ||
31 | depends on CPU_H7202 | ||
32 | bool "Use serial ports 2+3" | ||
33 | help | ||
34 | Say Y here if you wish to use serial ports 2+3. They share their | ||
35 | pins with the keyboard matrix controller, so you have to decide. | ||
36 | |||
37 | |||
38 | endif | ||
diff --git a/arch/arm/mach-h720x/Makefile b/arch/arm/mach-h720x/Makefile new file mode 100644 index 000000000000..e4cf728948eb --- /dev/null +++ b/arch/arm/mach-h720x/Makefile | |||
@@ -0,0 +1,16 @@ | |||
1 | # | ||
2 | # Makefile for the linux kernel. | ||
3 | # | ||
4 | |||
5 | # Common support | ||
6 | obj-y := common.o | ||
7 | obj-m := | ||
8 | obj-n := | ||
9 | obj- := | ||
10 | |||
11 | # Specific board support | ||
12 | |||
13 | obj-$(CONFIG_ARCH_H7201) += h7201-eval.o | ||
14 | obj-$(CONFIG_ARCH_H7202) += h7202-eval.o | ||
15 | obj-$(CONFIG_CPU_H7201) += cpu-h7201.o | ||
16 | obj-$(CONFIG_CPU_H7202) += cpu-h7202.o | ||
diff --git a/arch/arm/mach-h720x/Makefile.boot b/arch/arm/mach-h720x/Makefile.boot new file mode 100644 index 000000000000..52984017bd91 --- /dev/null +++ b/arch/arm/mach-h720x/Makefile.boot | |||
@@ -0,0 +1,2 @@ | |||
1 | zreladdr-$(CONFIG_ARCH_H720X) := 0x40008000 | ||
2 | |||
diff --git a/arch/arm/mach-h720x/common.c b/arch/arm/mach-h720x/common.c new file mode 100644 index 000000000000..96aa3af70d86 --- /dev/null +++ b/arch/arm/mach-h720x/common.c | |||
@@ -0,0 +1,247 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-h720x/common.c | ||
3 | * | ||
4 | * Copyright (C) 2003 Thomas Gleixner <tglx@linutronix.de> | ||
5 | * 2003 Robert Schwebel <r.schwebel@pengutronix.de> | ||
6 | * 2004 Sascha Hauer <s.hauer@pengutronix.de> | ||
7 | * | ||
8 | * common stuff for Hynix h720x processors | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify | ||
11 | * it under the terms of the GNU General Public License version 2 as | ||
12 | * published by the Free Software Foundation. | ||
13 | * | ||
14 | */ | ||
15 | |||
16 | #include <linux/sched.h> | ||
17 | #include <linux/slab.h> | ||
18 | #include <linux/mman.h> | ||
19 | #include <linux/init.h> | ||
20 | #include <linux/interrupt.h> | ||
21 | |||
22 | #include <asm/page.h> | ||
23 | #include <asm/pgtable.h> | ||
24 | #include <asm/dma.h> | ||
25 | #include <asm/io.h> | ||
26 | #include <asm/hardware.h> | ||
27 | #include <asm/irq.h> | ||
28 | #include <asm/mach/irq.h> | ||
29 | #include <asm/mach/map.h> | ||
30 | #include <asm/arch/irqs.h> | ||
31 | |||
32 | #include <asm/mach/dma.h> | ||
33 | |||
34 | #if 0 | ||
35 | #define IRQDBG(args...) printk(args) | ||
36 | #else | ||
37 | #define IRQDBG(args...) do {} while(0) | ||
38 | #endif | ||
39 | |||
40 | void __init arch_dma_init(dma_t *dma) | ||
41 | { | ||
42 | } | ||
43 | |||
44 | /* | ||
45 | * Return usecs since last timer reload | ||
46 | * (timercount * (usecs perjiffie)) / (ticks per jiffie) | ||
47 | */ | ||
48 | unsigned long h720x_gettimeoffset(void) | ||
49 | { | ||
50 | return (CPU_REG (TIMER_VIRT, TM0_COUNT) * tick_usec) / LATCH; | ||
51 | } | ||
52 | |||
53 | /* | ||
54 | * mask Global irq's | ||
55 | */ | ||
56 | static void mask_global_irq (unsigned int irq ) | ||
57 | { | ||
58 | CPU_REG (IRQC_VIRT, IRQC_IER) &= ~(1 << irq); | ||
59 | } | ||
60 | |||
61 | /* | ||
62 | * unmask Global irq's | ||
63 | */ | ||
64 | static void unmask_global_irq (unsigned int irq ) | ||
65 | { | ||
66 | CPU_REG (IRQC_VIRT, IRQC_IER) |= (1 << irq); | ||
67 | } | ||
68 | |||
69 | |||
70 | /* | ||
71 | * ack GPIO irq's | ||
72 | * Ack only for edge triggered int's valid | ||
73 | */ | ||
74 | static void inline ack_gpio_irq(u32 irq) | ||
75 | { | ||
76 | u32 reg_base = GPIO_VIRT(IRQ_TO_REGNO(irq)); | ||
77 | u32 bit = IRQ_TO_BIT(irq); | ||
78 | if ( (CPU_REG (reg_base, GPIO_EDGE) & bit)) | ||
79 | CPU_REG (reg_base, GPIO_CLR) = bit; | ||
80 | } | ||
81 | |||
82 | /* | ||
83 | * mask GPIO irq's | ||
84 | */ | ||
85 | static void inline mask_gpio_irq(u32 irq) | ||
86 | { | ||
87 | u32 reg_base = GPIO_VIRT(IRQ_TO_REGNO(irq)); | ||
88 | u32 bit = IRQ_TO_BIT(irq); | ||
89 | CPU_REG (reg_base, GPIO_MASK) &= ~bit; | ||
90 | } | ||
91 | |||
92 | /* | ||
93 | * unmask GPIO irq's | ||
94 | */ | ||
95 | static void inline unmask_gpio_irq(u32 irq) | ||
96 | { | ||
97 | u32 reg_base = GPIO_VIRT(IRQ_TO_REGNO(irq)); | ||
98 | u32 bit = IRQ_TO_BIT(irq); | ||
99 | CPU_REG (reg_base, GPIO_MASK) |= bit; | ||
100 | } | ||
101 | |||
102 | static void | ||
103 | h720x_gpio_handler(unsigned int mask, unsigned int irq, | ||
104 | struct irqdesc *desc, struct pt_regs *regs) | ||
105 | { | ||
106 | IRQDBG("%s irq: %d\n",__FUNCTION__,irq); | ||
107 | desc = irq_desc + irq; | ||
108 | while (mask) { | ||
109 | if (mask & 1) { | ||
110 | IRQDBG("handling irq %d\n", irq); | ||
111 | desc->handle(irq, desc, regs); | ||
112 | } | ||
113 | irq++; | ||
114 | desc++; | ||
115 | mask >>= 1; | ||
116 | } | ||
117 | } | ||
118 | |||
119 | static void | ||
120 | h720x_gpioa_demux_handler(unsigned int irq_unused, struct irqdesc *desc, | ||
121 | struct pt_regs *regs) | ||
122 | { | ||
123 | unsigned int mask, irq; | ||
124 | |||
125 | mask = CPU_REG(GPIO_A_VIRT,GPIO_STAT); | ||
126 | irq = IRQ_CHAINED_GPIOA(0); | ||
127 | IRQDBG("%s mask: 0x%08x irq: %d\n",__FUNCTION__,mask,irq); | ||
128 | h720x_gpio_handler(mask, irq, desc, regs); | ||
129 | } | ||
130 | |||
131 | static void | ||
132 | h720x_gpiob_demux_handler(unsigned int irq_unused, struct irqdesc *desc, | ||
133 | struct pt_regs *regs) | ||
134 | { | ||
135 | unsigned int mask, irq; | ||
136 | mask = CPU_REG(GPIO_B_VIRT,GPIO_STAT); | ||
137 | irq = IRQ_CHAINED_GPIOB(0); | ||
138 | IRQDBG("%s mask: 0x%08x irq: %d\n",__FUNCTION__,mask,irq); | ||
139 | h720x_gpio_handler(mask, irq, desc, regs); | ||
140 | } | ||
141 | |||
142 | static void | ||
143 | h720x_gpioc_demux_handler(unsigned int irq_unused, struct irqdesc *desc, | ||
144 | struct pt_regs *regs) | ||
145 | { | ||
146 | unsigned int mask, irq; | ||
147 | |||
148 | mask = CPU_REG(GPIO_C_VIRT,GPIO_STAT); | ||
149 | irq = IRQ_CHAINED_GPIOC(0); | ||
150 | IRQDBG("%s mask: 0x%08x irq: %d\n",__FUNCTION__,mask,irq); | ||
151 | h720x_gpio_handler(mask, irq, desc, regs); | ||
152 | } | ||
153 | |||
154 | static void | ||
155 | h720x_gpiod_demux_handler(unsigned int irq_unused, struct irqdesc *desc, | ||
156 | struct pt_regs *regs) | ||
157 | { | ||
158 | unsigned int mask, irq; | ||
159 | |||
160 | mask = CPU_REG(GPIO_D_VIRT,GPIO_STAT); | ||
161 | irq = IRQ_CHAINED_GPIOD(0); | ||
162 | IRQDBG("%s mask: 0x%08x irq: %d\n",__FUNCTION__,mask,irq); | ||
163 | h720x_gpio_handler(mask, irq, desc, regs); | ||
164 | } | ||
165 | |||
166 | #ifdef CONFIG_CPU_H7202 | ||
167 | static void | ||
168 | h720x_gpioe_demux_handler(unsigned int irq_unused, struct irqdesc *desc, | ||
169 | struct pt_regs *regs) | ||
170 | { | ||
171 | unsigned int mask, irq; | ||
172 | |||
173 | mask = CPU_REG(GPIO_E_VIRT,GPIO_STAT); | ||
174 | irq = IRQ_CHAINED_GPIOE(0); | ||
175 | IRQDBG("%s mask: 0x%08x irq: %d\n",__FUNCTION__,mask,irq); | ||
176 | h720x_gpio_handler(mask, irq, desc, regs); | ||
177 | } | ||
178 | #endif | ||
179 | |||
180 | static struct irqchip h720x_global_chip = { | ||
181 | .ack = mask_global_irq, | ||
182 | .mask = mask_global_irq, | ||
183 | .unmask = unmask_global_irq, | ||
184 | }; | ||
185 | |||
186 | static struct irqchip h720x_gpio_chip = { | ||
187 | .ack = ack_gpio_irq, | ||
188 | .mask = mask_gpio_irq, | ||
189 | .unmask = unmask_gpio_irq, | ||
190 | }; | ||
191 | |||
192 | /* | ||
193 | * Initialize IRQ's, mask all, enable multiplexed irq's | ||
194 | */ | ||
195 | void __init h720x_init_irq (void) | ||
196 | { | ||
197 | int irq; | ||
198 | |||
199 | /* Mask global irq's */ | ||
200 | CPU_REG (IRQC_VIRT, IRQC_IER) = 0x0; | ||
201 | |||
202 | /* Mask all multiplexed irq's */ | ||
203 | CPU_REG (GPIO_A_VIRT, GPIO_MASK) = 0x0; | ||
204 | CPU_REG (GPIO_B_VIRT, GPIO_MASK) = 0x0; | ||
205 | CPU_REG (GPIO_C_VIRT, GPIO_MASK) = 0x0; | ||
206 | CPU_REG (GPIO_D_VIRT, GPIO_MASK) = 0x0; | ||
207 | |||
208 | /* Initialize global IRQ's, fast path */ | ||
209 | for (irq = 0; irq < NR_GLBL_IRQS; irq++) { | ||
210 | set_irq_chip(irq, &h720x_global_chip); | ||
211 | set_irq_handler(irq, do_level_IRQ); | ||
212 | set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); | ||
213 | } | ||
214 | |||
215 | /* Initialize multiplexed IRQ's, slow path */ | ||
216 | for (irq = IRQ_CHAINED_GPIOA(0) ; irq <= IRQ_CHAINED_GPIOD(31); irq++) { | ||
217 | set_irq_chip(irq, &h720x_gpio_chip); | ||
218 | set_irq_handler(irq, do_edge_IRQ); | ||
219 | set_irq_flags(irq, IRQF_VALID ); | ||
220 | } | ||
221 | set_irq_chained_handler(IRQ_GPIOA, h720x_gpioa_demux_handler); | ||
222 | set_irq_chained_handler(IRQ_GPIOB, h720x_gpiob_demux_handler); | ||
223 | set_irq_chained_handler(IRQ_GPIOC, h720x_gpioc_demux_handler); | ||
224 | set_irq_chained_handler(IRQ_GPIOD, h720x_gpiod_demux_handler); | ||
225 | |||
226 | #ifdef CONFIG_CPU_H7202 | ||
227 | for (irq = IRQ_CHAINED_GPIOE(0) ; irq <= IRQ_CHAINED_GPIOE(31); irq++) { | ||
228 | set_irq_chip(irq, &h720x_gpio_chip); | ||
229 | set_irq_handler(irq, do_edge_IRQ); | ||
230 | set_irq_flags(irq, IRQF_VALID ); | ||
231 | } | ||
232 | set_irq_chained_handler(IRQ_GPIOE, h720x_gpioe_demux_handler); | ||
233 | #endif | ||
234 | |||
235 | /* Enable multiplexed irq's */ | ||
236 | CPU_REG (IRQC_VIRT, IRQC_IER) = IRQ_ENA_MUX; | ||
237 | } | ||
238 | |||
239 | static struct map_desc h720x_io_desc[] __initdata = { | ||
240 | { IO_VIRT, IO_PHYS, IO_SIZE, MT_DEVICE }, | ||
241 | }; | ||
242 | |||
243 | /* Initialize io tables */ | ||
244 | void __init h720x_map_io(void) | ||
245 | { | ||
246 | iotable_init(h720x_io_desc,ARRAY_SIZE(h720x_io_desc)); | ||
247 | } | ||
diff --git a/arch/arm/mach-h720x/common.h b/arch/arm/mach-h720x/common.h new file mode 100644 index 000000000000..d8798dbc44f8 --- /dev/null +++ b/arch/arm/mach-h720x/common.h | |||
@@ -0,0 +1,29 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-h720x/common.h | ||
3 | * | ||
4 | * Copyright (C) 2003 Thomas Gleixner <tglx@linutronix.de> | ||
5 | * 2003 Robert Schwebel <r.schwebel@pengutronix.de> | ||
6 | * 2004 Sascha Hauer <s.hauer@pengutronix.de> | ||
7 | * | ||
8 | * Architecture specific stuff for Hynix GMS30C7201 development board | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify | ||
11 | * it under the terms of the GNU General Public License version 2 as | ||
12 | * published by the Free Software Foundation. | ||
13 | * | ||
14 | */ | ||
15 | |||
16 | extern unsigned long h720x_gettimeoffset(void); | ||
17 | extern void __init h720x_init_irq (void); | ||
18 | extern void __init h720x_map_io(void); | ||
19 | |||
20 | #ifdef CONFIG_ARCH_H7202 | ||
21 | extern struct sys_timer h7202_timer; | ||
22 | extern void __init init_hw_h7202(void); | ||
23 | extern void __init h7202_init_irq (void); | ||
24 | extern void __init h7202_init_time(void); | ||
25 | #endif | ||
26 | |||
27 | #ifdef CONFIG_ARCH_H7201 | ||
28 | extern struct sys_timer h7201_timer; | ||
29 | #endif | ||
diff --git a/arch/arm/mach-h720x/cpu-h7201.c b/arch/arm/mach-h720x/cpu-h7201.c new file mode 100644 index 000000000000..743656881ed6 --- /dev/null +++ b/arch/arm/mach-h720x/cpu-h7201.c | |||
@@ -0,0 +1,64 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-h720x/cpu-h7201.c | ||
3 | * | ||
4 | * Copyright (C) 2003 Thomas Gleixner <tglx@linutronix.de> | ||
5 | * 2003 Robert Schwebel <r.schwebel@pengutronix.de> | ||
6 | * 2004 Sascha Hauer <s.hauer@pengutronix.de> | ||
7 | * | ||
8 | * processor specific stuff for the Hynix h7201 | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify | ||
11 | * it under the terms of the GNU General Public License version 2 as | ||
12 | * published by the Free Software Foundation. | ||
13 | * | ||
14 | */ | ||
15 | |||
16 | #include <linux/init.h> | ||
17 | #include <linux/interrupt.h> | ||
18 | #include <linux/module.h> | ||
19 | #include <asm/types.h> | ||
20 | #include <asm/hardware.h> | ||
21 | #include <asm/irq.h> | ||
22 | #include <asm/arch/irqs.h> | ||
23 | #include <asm/mach/irq.h> | ||
24 | #include <asm/mach/time.h> | ||
25 | #include "common.h" | ||
26 | /* | ||
27 | * Timer interrupt handler | ||
28 | */ | ||
29 | static irqreturn_t | ||
30 | h7201_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) | ||
31 | { | ||
32 | write_seqlock(&xtime_lock); | ||
33 | |||
34 | CPU_REG (TIMER_VIRT, TIMER_TOPSTAT); | ||
35 | timer_tick(regs); | ||
36 | |||
37 | write_sequnlock(&xtime_lock); | ||
38 | |||
39 | return IRQ_HANDLED; | ||
40 | } | ||
41 | |||
42 | static struct irqaction h7201_timer_irq = { | ||
43 | .name = "h7201 Timer Tick", | ||
44 | .flags = SA_INTERRUPT, | ||
45 | .handler = h7201_timer_interrupt | ||
46 | }; | ||
47 | |||
48 | /* | ||
49 | * Setup TIMER0 as system timer | ||
50 | */ | ||
51 | void __init h7201_init_time(void) | ||
52 | { | ||
53 | CPU_REG (TIMER_VIRT, TM0_PERIOD) = LATCH; | ||
54 | CPU_REG (TIMER_VIRT, TM0_CTRL) = TM_RESET; | ||
55 | CPU_REG (TIMER_VIRT, TM0_CTRL) = TM_REPEAT | TM_START; | ||
56 | CPU_REG (TIMER_VIRT, TIMER_TOPCTRL) = ENABLE_TM0_INTR | TIMER_ENABLE_BIT; | ||
57 | |||
58 | setup_irq(IRQ_TIMER0, &h7201_timer_irq); | ||
59 | } | ||
60 | |||
61 | struct sys_timer h7201_timer = { | ||
62 | .init = h7201_init_time, | ||
63 | .offset = h720x_gettimeoffset, | ||
64 | }; | ||
diff --git a/arch/arm/mach-h720x/cpu-h7202.c b/arch/arm/mach-h720x/cpu-h7202.c new file mode 100644 index 000000000000..21b8fb6122cd --- /dev/null +++ b/arch/arm/mach-h720x/cpu-h7202.c | |||
@@ -0,0 +1,228 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-h720x/cpu-h7202.c | ||
3 | * | ||
4 | * Copyright (C) 2003 Thomas Gleixner <tglx@linutronix.de> | ||
5 | * 2003 Robert Schwebel <r.schwebel@pengutronix.de> | ||
6 | * 2004 Sascha Hauer <s.hauer@pengutronix.de> | ||
7 | * | ||
8 | * processor specific stuff for the Hynix h7202 | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify | ||
11 | * it under the terms of the GNU General Public License version 2 as | ||
12 | * published by the Free Software Foundation. | ||
13 | * | ||
14 | */ | ||
15 | |||
16 | #include <linux/init.h> | ||
17 | #include <linux/interrupt.h> | ||
18 | #include <linux/module.h> | ||
19 | #include <asm/types.h> | ||
20 | #include <asm/hardware.h> | ||
21 | #include <asm/irq.h> | ||
22 | #include <asm/arch/irqs.h> | ||
23 | #include <asm/mach/irq.h> | ||
24 | #include <asm/mach/time.h> | ||
25 | #include <linux/device.h> | ||
26 | #include <linux/serial_8250.h> | ||
27 | #include "common.h" | ||
28 | |||
29 | static struct resource h7202ps2_resources[] = { | ||
30 | [0] = { | ||
31 | .start = 0x8002c000, | ||
32 | .end = 0x8002c040, | ||
33 | .flags = IORESOURCE_MEM, | ||
34 | }, | ||
35 | [1] = { | ||
36 | .start = IRQ_PS2, | ||
37 | .end = IRQ_PS2, | ||
38 | .flags = IORESOURCE_IRQ, | ||
39 | }, | ||
40 | }; | ||
41 | |||
42 | static struct platform_device h7202ps2_device = { | ||
43 | .name = "h7202ps2", | ||
44 | .id = -1, | ||
45 | .num_resources = ARRAY_SIZE(h7202ps2_resources), | ||
46 | .resource = h7202ps2_resources, | ||
47 | }; | ||
48 | |||
49 | static struct plat_serial8250_port serial_platform_data[] = { | ||
50 | { | ||
51 | .membase = (void*)SERIAL0_VIRT, | ||
52 | .mapbase = SERIAL0_BASE, | ||
53 | .irq = IRQ_UART0, | ||
54 | .uartclk = 2*1843200, | ||
55 | .regshift = 2, | ||
56 | .iotype = UPIO_MEM, | ||
57 | .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, | ||
58 | }, | ||
59 | { | ||
60 | .membase = (void*)SERIAL1_VIRT, | ||
61 | .mapbase = SERIAL1_BASE, | ||
62 | .irq = IRQ_UART1, | ||
63 | .uartclk = 2*1843200, | ||
64 | .regshift = 2, | ||
65 | .iotype = UPIO_MEM, | ||
66 | .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, | ||
67 | }, | ||
68 | #ifdef CONFIG_H7202_SERIAL23 | ||
69 | { | ||
70 | .membase = (void*)SERIAL2_VIRT, | ||
71 | .mapbase = SERIAL2_BASE, | ||
72 | .irq = IRQ_UART2, | ||
73 | .uartclk = 2*1843200, | ||
74 | .regshift = 2, | ||
75 | .iotype = UPIO_MEM, | ||
76 | .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, | ||
77 | }, | ||
78 | { | ||
79 | .membase = (void*)SERIAL3_VIRT, | ||
80 | .mapbase = SERIAL3_BASE, | ||
81 | .irq = IRQ_UART3, | ||
82 | .uartclk = 2*1843200, | ||
83 | .regshift = 2, | ||
84 | .iotype = UPIO_MEM, | ||
85 | .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, | ||
86 | }, | ||
87 | #endif | ||
88 | { }, | ||
89 | }; | ||
90 | |||
91 | static struct platform_device serial_device = { | ||
92 | .name = "serial8250", | ||
93 | .id = 0, | ||
94 | .dev = { | ||
95 | .platform_data = serial_platform_data, | ||
96 | }, | ||
97 | }; | ||
98 | |||
99 | static struct platform_device *devices[] __initdata = { | ||
100 | &h7202ps2_device, | ||
101 | &serial_device, | ||
102 | }; | ||
103 | |||
104 | /* Although we have two interrupt lines for the timers, we only have one | ||
105 | * status register which clears all pending timer interrupts on reading. So | ||
106 | * we have to handle all timer interrupts in one place. | ||
107 | */ | ||
108 | static void | ||
109 | h7202_timerx_demux_handler(unsigned int irq_unused, struct irqdesc *desc, | ||
110 | struct pt_regs *regs) | ||
111 | { | ||
112 | unsigned int mask, irq; | ||
113 | |||
114 | mask = CPU_REG (TIMER_VIRT, TIMER_TOPSTAT); | ||
115 | |||
116 | if ( mask & TSTAT_T0INT ) { | ||
117 | write_seqlock(&xtime_lock); | ||
118 | timer_tick(regs); | ||
119 | write_sequnlock(&xtime_lock); | ||
120 | if( mask == TSTAT_T0INT ) | ||
121 | return; | ||
122 | } | ||
123 | |||
124 | mask >>= 1; | ||
125 | irq = IRQ_TIMER1; | ||
126 | desc = irq_desc + irq; | ||
127 | while (mask) { | ||
128 | if (mask & 1) | ||
129 | desc->handle(irq, desc, regs); | ||
130 | irq++; | ||
131 | desc++; | ||
132 | mask >>= 1; | ||
133 | } | ||
134 | } | ||
135 | |||
136 | /* | ||
137 | * Timer interrupt handler | ||
138 | */ | ||
139 | static irqreturn_t | ||
140 | h7202_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) | ||
141 | { | ||
142 | h7202_timerx_demux_handler(0, NULL, regs); | ||
143 | return IRQ_HANDLED; | ||
144 | } | ||
145 | |||
146 | /* | ||
147 | * mask multiplexed timer irq's | ||
148 | */ | ||
149 | static void inline mask_timerx_irq (u32 irq) | ||
150 | { | ||
151 | unsigned int bit; | ||
152 | bit = 2 << ((irq == IRQ_TIMER64B) ? 4 : (irq - IRQ_TIMER1)); | ||
153 | CPU_REG (TIMER_VIRT, TIMER_TOPCTRL) &= ~bit; | ||
154 | } | ||
155 | |||
156 | /* | ||
157 | * unmask multiplexed timer irq's | ||
158 | */ | ||
159 | static void inline unmask_timerx_irq (u32 irq) | ||
160 | { | ||
161 | unsigned int bit; | ||
162 | bit = 2 << ((irq == IRQ_TIMER64B) ? 4 : (irq - IRQ_TIMER1)); | ||
163 | CPU_REG (TIMER_VIRT, TIMER_TOPCTRL) |= bit; | ||
164 | } | ||
165 | |||
166 | static struct irqchip h7202_timerx_chip = { | ||
167 | .ack = mask_timerx_irq, | ||
168 | .mask = mask_timerx_irq, | ||
169 | .unmask = unmask_timerx_irq, | ||
170 | }; | ||
171 | |||
172 | static struct irqaction h7202_timer_irq = { | ||
173 | .name = "h7202 Timer Tick", | ||
174 | .flags = SA_INTERRUPT, | ||
175 | .handler = h7202_timer_interrupt | ||
176 | }; | ||
177 | |||
178 | /* | ||
179 | * Setup TIMER0 as system timer | ||
180 | */ | ||
181 | void __init h7202_init_time(void) | ||
182 | { | ||
183 | CPU_REG (TIMER_VIRT, TM0_PERIOD) = LATCH; | ||
184 | CPU_REG (TIMER_VIRT, TM0_CTRL) = TM_RESET; | ||
185 | CPU_REG (TIMER_VIRT, TM0_CTRL) = TM_REPEAT | TM_START; | ||
186 | CPU_REG (TIMER_VIRT, TIMER_TOPCTRL) = ENABLE_TM0_INTR | TIMER_ENABLE_BIT; | ||
187 | |||
188 | setup_irq(IRQ_TIMER0, &h7202_timer_irq); | ||
189 | } | ||
190 | |||
191 | struct sys_timer h7202_timer = { | ||
192 | .init = h7202_init_time, | ||
193 | .offset = h720x_gettimeoffset, | ||
194 | }; | ||
195 | |||
196 | void __init h7202_init_irq (void) | ||
197 | { | ||
198 | int irq; | ||
199 | |||
200 | CPU_REG (GPIO_E_VIRT, GPIO_MASK) = 0x0; | ||
201 | |||
202 | for (irq = IRQ_TIMER1; | ||
203 | irq < IRQ_CHAINED_TIMERX(NR_TIMERX_IRQS); irq++) { | ||
204 | mask_timerx_irq(irq); | ||
205 | set_irq_chip(irq, &h7202_timerx_chip); | ||
206 | set_irq_handler(irq, do_edge_IRQ); | ||
207 | set_irq_flags(irq, IRQF_VALID ); | ||
208 | } | ||
209 | set_irq_chained_handler(IRQ_TIMERX, h7202_timerx_demux_handler); | ||
210 | |||
211 | h720x_init_irq(); | ||
212 | } | ||
213 | |||
214 | void __init init_hw_h7202(void) | ||
215 | { | ||
216 | /* Enable clocks */ | ||
217 | CPU_REG (PMU_BASE, PMU_PLL_CTRL) |= PLL_2_EN | PLL_1_EN | PLL_3_MUTE; | ||
218 | |||
219 | CPU_REG (SERIAL0_VIRT, SERIAL_ENABLE) = SERIAL_ENABLE_EN; | ||
220 | CPU_REG (SERIAL1_VIRT, SERIAL_ENABLE) = SERIAL_ENABLE_EN; | ||
221 | #ifdef CONFIG_H7202_SERIAL23 | ||
222 | CPU_REG (SERIAL2_VIRT, SERIAL_ENABLE) = SERIAL_ENABLE_EN; | ||
223 | CPU_REG (SERIAL3_VIRT, SERIAL_ENABLE) = SERIAL_ENABLE_EN; | ||
224 | CPU_IO (GPIO_AMULSEL) = AMULSEL_USIN2 | AMULSEL_USOUT2 | | ||
225 | AMULSEL_USIN3 | AMULSEL_USOUT3; | ||
226 | #endif | ||
227 | (void) platform_add_devices(devices, ARRAY_SIZE(devices)); | ||
228 | } | ||
diff --git a/arch/arm/mach-h720x/h7201-eval.c b/arch/arm/mach-h720x/h7201-eval.c new file mode 100644 index 000000000000..9b24b9b0db15 --- /dev/null +++ b/arch/arm/mach-h720x/h7201-eval.c | |||
@@ -0,0 +1,39 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-h720x/h7201-eval.c | ||
3 | * | ||
4 | * Copyright (C) 2003 Thomas Gleixner <tglx@linutronix.de> | ||
5 | * 2003 Robert Schwebel <r.schwebel@pengutronix.de> | ||
6 | * 2004 Sascha Hauer <s.hauer@pengutronix.de> | ||
7 | * | ||
8 | * Architecture specific stuff for Hynix GMS30C7201 development board | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify | ||
11 | * it under the terms of the GNU General Public License version 2 as | ||
12 | * published by the Free Software Foundation. | ||
13 | * | ||
14 | */ | ||
15 | |||
16 | #include <linux/config.h> | ||
17 | #include <linux/init.h> | ||
18 | #include <linux/kernel.h> | ||
19 | #include <linux/types.h> | ||
20 | #include <linux/string.h> | ||
21 | #include <linux/device.h> | ||
22 | |||
23 | #include <asm/setup.h> | ||
24 | #include <asm/types.h> | ||
25 | #include <asm/mach-types.h> | ||
26 | #include <asm/page.h> | ||
27 | #include <asm/pgtable.h> | ||
28 | #include <asm/mach/arch.h> | ||
29 | #include <asm/hardware.h> | ||
30 | #include "common.h" | ||
31 | |||
32 | MACHINE_START(H7201, "Hynix GMS30C7201") | ||
33 | MAINTAINER("Robert Schwebel, Pengutronix") | ||
34 | BOOT_MEM(0x40000000, 0x80000000, 0xf0000000) | ||
35 | BOOT_PARAMS(0xc0001000) | ||
36 | MAPIO(h720x_map_io) | ||
37 | INITIRQ(h720x_init_irq) | ||
38 | .timer = &h7201_timer, | ||
39 | MACHINE_END | ||
diff --git a/arch/arm/mach-h720x/h7202-eval.c b/arch/arm/mach-h720x/h7202-eval.c new file mode 100644 index 000000000000..3456a00d5f5c --- /dev/null +++ b/arch/arm/mach-h720x/h7202-eval.c | |||
@@ -0,0 +1,81 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-h720x/h7202-eval.c | ||
3 | * | ||
4 | * Copyright (C) 2003 Thomas Gleixner <tglx@linutronix.de> | ||
5 | * 2003 Robert Schwebel <r.schwebel@pengutronix.de> | ||
6 | * 2004 Sascha Hauer <s.hauer@pengutronix.de> | ||
7 | * | ||
8 | * Architecture specific stuff for Hynix HMS30C7202 development board | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify | ||
11 | * it under the terms of the GNU General Public License version 2 as | ||
12 | * published by the Free Software Foundation. | ||
13 | * | ||
14 | */ | ||
15 | |||
16 | #include <linux/config.h> | ||
17 | #include <linux/init.h> | ||
18 | #include <linux/kernel.h> | ||
19 | #include <linux/types.h> | ||
20 | #include <linux/string.h> | ||
21 | #include <linux/device.h> | ||
22 | |||
23 | #include <asm/setup.h> | ||
24 | #include <asm/types.h> | ||
25 | #include <asm/mach-types.h> | ||
26 | #include <asm/page.h> | ||
27 | #include <asm/pgtable.h> | ||
28 | #include <asm/mach/arch.h> | ||
29 | #include <asm/hardware.h> | ||
30 | #include "common.h" | ||
31 | |||
32 | static struct resource cirrus_resources[] = { | ||
33 | [0] = { | ||
34 | .start = ETH0_PHYS + 0x300, | ||
35 | .end = ETH0_PHYS + 0x300 + 0x10, | ||
36 | .flags = IORESOURCE_MEM, | ||
37 | }, | ||
38 | [1] = { | ||
39 | .start = IRQ_CHAINED_GPIOB(8), | ||
40 | .end = IRQ_CHAINED_GPIOB(8), | ||
41 | .flags = IORESOURCE_IRQ, | ||
42 | }, | ||
43 | }; | ||
44 | |||
45 | static struct platform_device cirrus_device = { | ||
46 | .name = "cirrus-cs89x0", | ||
47 | .id = -1, | ||
48 | .num_resources = ARRAY_SIZE(cirrus_resources), | ||
49 | .resource = cirrus_resources, | ||
50 | }; | ||
51 | |||
52 | static struct platform_device *devices[] __initdata = { | ||
53 | &cirrus_device, | ||
54 | }; | ||
55 | |||
56 | /* | ||
57 | * Hardware init. This is called early in initcalls | ||
58 | * Place pin inits here. So you avoid adding ugly | ||
59 | * #ifdef stuff to common drivers. | ||
60 | * Use this only, if your bootloader is not able | ||
61 | * to initialize the pins proper. | ||
62 | */ | ||
63 | static void __init init_eval_h7202(void) | ||
64 | { | ||
65 | init_hw_h7202(); | ||
66 | (void) platform_add_devices(devices, ARRAY_SIZE(devices)); | ||
67 | |||
68 | /* Enable interrupt on portb bit 8 (ethernet) */ | ||
69 | CPU_REG (GPIO_B_VIRT, GPIO_POL) &= ~(1 << 8); | ||
70 | CPU_REG (GPIO_B_VIRT, GPIO_EN) |= (1 << 8); | ||
71 | } | ||
72 | |||
73 | MACHINE_START(H7202, "Hynix HMS30C7202") | ||
74 | MAINTAINER("Robert Schwebel, Pengutronix") | ||
75 | BOOT_MEM(0x40000000, 0x80000000, 0xf0000000) | ||
76 | BOOT_PARAMS(0x40000100) | ||
77 | MAPIO(h720x_map_io) | ||
78 | INITIRQ(h7202_init_irq) | ||
79 | .timer = &h7202_timer, | ||
80 | INIT_MACHINE(init_eval_h7202) | ||
81 | MACHINE_END | ||