diff options
author | Yoshinori Sato <ysato@users.sourceforge.jp> | 2007-05-06 17:50:35 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-07 15:12:58 -0400 |
commit | c728d60455e8e8722ee08312a75f38dd7a866b5e (patch) | |
tree | c848cbddc7557fa1cf00993245e562007465dadb /arch/h8300/platform | |
parent | aeecf3142d82414d511135cc85f86caddfb58338 (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')
-rw-r--r-- | arch/h8300/platform/h8300h/Makefile | 2 | ||||
-rw-r--r-- | arch/h8300/platform/h8300h/entry.S | 4 | ||||
-rw-r--r-- | arch/h8300/platform/h8300h/generic/Makefile | 2 | ||||
-rw-r--r-- | arch/h8300/platform/h8300h/ints_h8300h.c | 85 | ||||
-rw-r--r-- | arch/h8300/platform/h8s/entry.S | 17 |
5 files changed, 13 insertions, 97 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 | ||
7 | obj-y := entry.o ints_h8300h.o ptrace_h8300h.o | 7 | obj-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 | ||
5 | extra-y := crt0_$(MODEL).o | ||
5 | obj-y := timer.o | 6 | obj-y := timer.o |
6 | extra-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 */ | ||
20 | const int __initdata h8300_saved_vectors[]={ | ||
21 | #if defined(CONFIG_GDB_DEBUG) | ||
22 | TRAP3_VEC, | ||
23 | #endif | ||
24 | -1 | ||
25 | }; | ||
26 | |||
27 | /* trap entry table */ | ||
28 | const 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 | |||
35 | int 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 | |||
63 | void 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 | } | ||
diff --git a/arch/h8300/platform/h8s/entry.S b/arch/h8300/platform/h8s/entry.S index aeb2e9faa9b2..f3d6b8e8f959 100644 --- a/arch/h8300/platform/h8s/entry.S +++ b/arch/h8300/platform/h8s/entry.S | |||
@@ -31,12 +31,13 @@ | |||
31 | mov.l er0,@-sp | 31 | mov.l er0,@-sp |
32 | 32 | ||
33 | stc ccr,r0l /* check kernel mode */ | 33 | stc ccr,r0l /* check kernel mode */ |
34 | orc #0x10,ccr | ||
35 | btst #4,r0l | 34 | btst #4,r0l |
36 | bne 5f | 35 | bne 5f |
37 | 36 | ||
38 | mov.l sp,@SYMBOL_NAME(sw_usp) /* user mode */ | 37 | /* user mode */ |
39 | mov.l @sp,er0 | 38 | mov.l sp,@SYMBOL_NAME(sw_usp) |
39 | mov.l @sp,er0 /* restore saved er0 */ | ||
40 | orc #0x10,ccr /* switch kernel stack */ | ||
40 | mov.l @SYMBOL_NAME(sw_ksp),sp | 41 | mov.l @SYMBOL_NAME(sw_ksp),sp |
41 | sub.l #(LRET-LORIG),sp /* allocate LORIG - LRET */ | 42 | sub.l #(LRET-LORIG),sp /* allocate LORIG - LRET */ |
42 | stm.l er0-er3,@-sp | 43 | stm.l er0-er3,@-sp |
@@ -55,8 +56,9 @@ | |||
55 | mov.l er0,@(LER0-LER3:16,sp) /* copy ER0 */ | 56 | mov.l er0,@(LER0-LER3:16,sp) /* copy ER0 */ |
56 | bra 6f | 57 | bra 6f |
57 | 5: | 58 | 5: |
58 | mov.l @sp,er0 /* kernel mode */ | 59 | /* kernel mode */ |
59 | subs #2,sp /* dummy ccr */ | 60 | mov.l @sp,er0 /* restore saved er0 */ |
61 | subs #2,sp /* set dummy ccr */ | ||
60 | stm.l er0-er3,@-sp | 62 | stm.l er0-er3,@-sp |
61 | mov.w @(LRET-LER3:16,sp),r1 /* copy old ccr */ | 63 | mov.w @(LRET-LER3:16,sp),r1 /* copy old ccr */ |
62 | mov.b r1h,r1l | 64 | mov.b r1h,r1l |
@@ -94,6 +96,7 @@ | |||
94 | mov.l @sp+,er1 | 96 | mov.l @sp+,er1 |
95 | add.l #(LRET-LER1),sp /* remove LORIG - LRET */ | 97 | add.l #(LRET-LER1),sp /* remove LORIG - LRET */ |
96 | mov.l sp,@SYMBOL_NAME(sw_ksp) | 98 | mov.l sp,@SYMBOL_NAME(sw_ksp) |
99 | andc #0xef,ccr /* switch to user mode */ | ||
97 | mov.l er0,sp | 100 | mov.l er0,sp |
98 | bra 8f | 101 | bra 8f |
99 | 7: | 102 | 7: |
@@ -173,9 +176,6 @@ SYMBOL_NAME_LABEL(interrupt_entry) | |||
173 | SYMBOL_NAME_LABEL(system_call) | 176 | SYMBOL_NAME_LABEL(system_call) |
174 | subs #4,sp /* dummy LVEC */ | 177 | subs #4,sp /* dummy LVEC */ |
175 | SAVE_ALL | 178 | SAVE_ALL |
176 | mov.w @(LCCR:16,sp),r1 | ||
177 | bset #4,r1l | ||
178 | ldc r1l,ccr /* restore ccr */ | ||
179 | mov.l er0,er4 | 179 | mov.l er0,er4 |
180 | mov.l #-ENOSYS,er0 | 180 | mov.l #-ENOSYS,er0 |
181 | mov.l er0,@(LER0:16,sp) | 181 | mov.l er0,@(LER0:16,sp) |
@@ -198,6 +198,7 @@ SYMBOL_NAME_LABEL(system_call) | |||
198 | mov.l @(LER1:16,sp),er0 | 198 | mov.l @(LER1:16,sp),er0 |
199 | mov.l @(LER2:16,sp),er1 | 199 | mov.l @(LER2:16,sp),er1 |
200 | mov.l @(LER3:16,sp),er2 | 200 | mov.l @(LER3:16,sp),er2 |
201 | andc #0x7f,ccr | ||
201 | jsr @er4 | 202 | jsr @er4 |
202 | mov.l er0,@(LER0:16,sp) /* save the return value */ | 203 | mov.l er0,@(LER0:16,sp) /* save the return value */ |
203 | #if defined(CONFIG_SYSCALL_PRINT) | 204 | #if defined(CONFIG_SYSCALL_PRINT) |