aboutsummaryrefslogtreecommitdiffstats
path: root/arch/h8300/platform/h8300h
diff options
context:
space:
mode:
authorYoshinori Sato <ysato@users.sourceforge.jp>2007-05-06 17:50:35 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-07 15:12:58 -0400
commitc728d60455e8e8722ee08312a75f38dd7a866b5e (patch)
treec848cbddc7557fa1cf00993245e562007465dadb /arch/h8300/platform/h8300h
parentaeecf3142d82414d511135cc85f86caddfb58338 (diff)
h8300 generic irq
h8300 using generic irq handler patch. Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/h8300/platform/h8300h')
-rw-r--r--arch/h8300/platform/h8300h/Makefile2
-rw-r--r--arch/h8300/platform/h8300h/entry.S4
-rw-r--r--arch/h8300/platform/h8300h/generic/Makefile2
-rw-r--r--arch/h8300/platform/h8300h/ints_h8300h.c85
4 files changed, 4 insertions, 89 deletions
diff --git a/arch/h8300/platform/h8300h/Makefile b/arch/h8300/platform/h8300h/Makefile
index 5d42c772f75a..b24ea08aa0a7 100644
--- a/arch/h8300/platform/h8300h/Makefile
+++ b/arch/h8300/platform/h8300h/Makefile
@@ -4,4 +4,4 @@
4# Reuse any files we can from the H8/300H 4# Reuse any files we can from the H8/300H
5# 5#
6 6
7obj-y := entry.o ints_h8300h.o ptrace_h8300h.o 7obj-y := entry.o irq_pin.o ptrace_h8300h.o
diff --git a/arch/h8300/platform/h8300h/entry.S b/arch/h8300/platform/h8300h/entry.S
index d2dea2432fb2..f86ac3b5d4de 100644
--- a/arch/h8300/platform/h8300h/entry.S
+++ b/arch/h8300/platform/h8300h/entry.S
@@ -30,12 +30,12 @@
30 mov.l er0,@-sp 30 mov.l er0,@-sp
31 31
32 stc ccr,r0l /* check kernel mode */ 32 stc ccr,r0l /* check kernel mode */
33 orc #0x10,ccr
34 btst #4,r0l 33 btst #4,r0l
35 bne 5f 34 bne 5f
36 35
37 mov.l sp,@SYMBOL_NAME(sw_usp) /* user mode */ 36 mov.l sp,@SYMBOL_NAME(sw_usp) /* user mode */
38 mov.l @sp,er0 37 mov.l @sp,er0
38 orc #0x10,ccr
39 mov.l @SYMBOL_NAME(sw_ksp),sp 39 mov.l @SYMBOL_NAME(sw_ksp),sp
40 sub.l #(LRET-LORIG),sp /* allocate LORIG - LRET */ 40 sub.l #(LRET-LORIG),sp /* allocate LORIG - LRET */
41 mov.l er0,@-sp 41 mov.l er0,@-sp
@@ -165,7 +165,7 @@ SYMBOL_NAME_LABEL(interrupt_entry)
165 dec.l #1,er0 165 dec.l #1,er0
166 mov.l sp,er1 166 mov.l sp,er1
167 subs #4,er1 /* adjust ret_pc */ 167 subs #4,er1 /* adjust ret_pc */
168 jsr @SYMBOL_NAME(process_int) 168 jsr @SYMBOL_NAME(do_IRQ)
169 mov.l @SYMBOL_NAME(irq_stat)+CPUSTAT_SOFTIRQ_PENDING,er0 169 mov.l @SYMBOL_NAME(irq_stat)+CPUSTAT_SOFTIRQ_PENDING,er0
170 beq 1f 170 beq 1f
171 jsr @SYMBOL_NAME(do_softirq) 171 jsr @SYMBOL_NAME(do_softirq)
diff --git a/arch/h8300/platform/h8300h/generic/Makefile b/arch/h8300/platform/h8300h/generic/Makefile
index b6ea7688a616..32b964a9010e 100644
--- a/arch/h8300/platform/h8300h/generic/Makefile
+++ b/arch/h8300/platform/h8300h/generic/Makefile
@@ -2,5 +2,5 @@
2# Makefile for the linux kernel. 2# Makefile for the linux kernel.
3# 3#
4 4
5extra-y := crt0_$(MODEL).o
5obj-y := timer.o 6obj-y := timer.o
6extra-y = crt0_$(MODEL).o
diff --git a/arch/h8300/platform/h8300h/ints_h8300h.c b/arch/h8300/platform/h8300h/ints_h8300h.c
deleted file mode 100644
index f1777119b871..000000000000
--- a/arch/h8300/platform/h8300h/ints_h8300h.c
+++ /dev/null
@@ -1,85 +0,0 @@
1/*
2 * linux/arch/h8300/platform/h8300h/ints_h8300h.c
3 * Interrupt handling CPU variants
4 *
5 * Yoshinori Sato <ysato@users.sourceforge.jp>
6 *
7 */
8
9#include <linux/init.h>
10#include <linux/errno.h>
11
12#include <asm/ptrace.h>
13#include <asm/traps.h>
14#include <asm/irq.h>
15#include <asm/io.h>
16#include <asm/gpio.h>
17#include <asm/regs306x.h>
18
19/* saved vector list */
20const int __initdata h8300_saved_vectors[]={
21#if defined(CONFIG_GDB_DEBUG)
22 TRAP3_VEC,
23#endif
24 -1
25};
26
27/* trap entry table */
28const unsigned long __initdata h8300_trap_table[NR_TRAPS]={
29 0,0,0,0,0,0,0,0,
30 (unsigned long)system_call, /* TRAPA #0 */
31 0,0,
32 (unsigned long)trace_break, /* TRAPA #3 */
33};
34
35int h8300_enable_irq_pin(unsigned int irq)
36{
37 int bitmask;
38 if (irq < EXT_IRQ0 || irq > EXT_IRQ5)
39 return 0;
40
41 /* initialize IRQ pin */
42 bitmask = 1 << (irq - EXT_IRQ0);
43 switch(irq) {
44 case EXT_IRQ0:
45 case EXT_IRQ1:
46 case EXT_IRQ2:
47 case EXT_IRQ3:
48 if (H8300_GPIO_RESERVE(H8300_GPIO_P8, bitmask) == 0)
49 return -EBUSY;
50 H8300_GPIO_DDR(H8300_GPIO_P8, bitmask, H8300_GPIO_INPUT);
51 break;
52 case EXT_IRQ4:
53 case EXT_IRQ5:
54 if (H8300_GPIO_RESERVE(H8300_GPIO_P9, bitmask) == 0)
55 return -EBUSY;
56 H8300_GPIO_DDR(H8300_GPIO_P9, bitmask, H8300_GPIO_INPUT);
57 break;
58 }
59
60 return 0;
61}
62
63void h8300_disable_irq_pin(unsigned int irq)
64{
65 int bitmask;
66 if (irq < EXT_IRQ0 || irq > EXT_IRQ5)
67 return;
68
69 /* disable interrupt & release IRQ pin */
70 bitmask = 1 << (irq - EXT_IRQ0);
71 switch(irq) {
72 case EXT_IRQ0:
73 case EXT_IRQ1:
74 case EXT_IRQ2:
75 case EXT_IRQ3:
76 *(volatile unsigned char *)IER &= ~bitmask;
77 H8300_GPIO_FREE(H8300_GPIO_P8, bitmask);
78 break ;
79 case EXT_IRQ4:
80 case EXT_IRQ5:
81 *(volatile unsigned char *)IER &= ~bitmask;
82 H8300_GPIO_FREE(H8300_GPIO_P9, bitmask);
83 break;
84 }
85}