aboutsummaryrefslogtreecommitdiffstats
path: root/arch/h8300/platform
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2013-08-30 09:01:49 -0400
committerGuenter Roeck <linux@roeck-us.net>2013-09-16 21:19:04 -0400
commit4b08478422040ae8cb11acc15d51f1cdb0ac39c8 (patch)
tree79718cea7b73f175d64e4c2073ea2585a7bd2337 /arch/h8300/platform
parent272b98c6455f00884f0350f775c5342358ebb73f (diff)
Drop support for Renesas H8/300 (h8300) architecture
H8/300 has been dead for several years, and the kernel for it has not compiled for ages. Drop support for it. Cc: Yoshinori Sato <ysato@users.sourceforge.jp> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'arch/h8300/platform')
-rw-r--r--arch/h8300/platform/h8300h/Makefile7
-rw-r--r--arch/h8300/platform/h8300h/aki3068net/Makefile5
-rw-r--r--arch/h8300/platform/h8300h/aki3068net/crt0_ram.S110
-rw-r--r--arch/h8300/platform/h8300h/generic/Makefile5
-rw-r--r--arch/h8300/platform/h8300h/generic/crt0_ram.S107
-rw-r--r--arch/h8300/platform/h8300h/generic/crt0_rom.S122
-rw-r--r--arch/h8300/platform/h8300h/h8max/Makefile5
-rw-r--r--arch/h8300/platform/h8300h/h8max/crt0_ram.S110
-rw-r--r--arch/h8300/platform/h8300h/irq.c82
-rw-r--r--arch/h8300/platform/h8300h/ptrace_h8300h.c284
-rw-r--r--arch/h8300/platform/h8s/Makefile7
-rw-r--r--arch/h8300/platform/h8s/edosk2674/Makefile5
-rw-r--r--arch/h8300/platform/h8s/edosk2674/crt0_ram.S130
-rw-r--r--arch/h8300/platform/h8s/edosk2674/crt0_rom.S186
-rw-r--r--arch/h8300/platform/h8s/generic/Makefile5
-rw-r--r--arch/h8300/platform/h8s/generic/crt0_ram.S127
-rw-r--r--arch/h8300/platform/h8s/generic/crt0_rom.S128
-rw-r--r--arch/h8300/platform/h8s/irq.c104
-rw-r--r--arch/h8300/platform/h8s/ptrace_h8s.c84
19 files changed, 0 insertions, 1613 deletions
diff --git a/arch/h8300/platform/h8300h/Makefile b/arch/h8300/platform/h8300h/Makefile
deleted file mode 100644
index 420f73b0d962..000000000000
--- a/arch/h8300/platform/h8300h/Makefile
+++ /dev/null
@@ -1,7 +0,0 @@
1#
2# Makefile for the linux kernel.
3#
4# Reuse any files we can from the H8/300H
5#
6
7obj-y := irq.o ptrace_h8300h.o
diff --git a/arch/h8300/platform/h8300h/aki3068net/Makefile b/arch/h8300/platform/h8300h/aki3068net/Makefile
deleted file mode 100644
index b7ff78050b7f..000000000000
--- a/arch/h8300/platform/h8300h/aki3068net/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
1#
2# Makefile for the linux kernel.
3#
4
5extra-y := crt0_ram.o
diff --git a/arch/h8300/platform/h8300h/aki3068net/crt0_ram.S b/arch/h8300/platform/h8300h/aki3068net/crt0_ram.S
deleted file mode 100644
index b2ad0f2d0417..000000000000
--- a/arch/h8300/platform/h8300h/aki3068net/crt0_ram.S
+++ /dev/null
@@ -1,110 +0,0 @@
1/*
2 * linux/arch/h8300/platform/h8300h/aki3068net/crt0_ram.S
3 *
4 * Yoshinori Sato <ysato@users.sourceforge.jp>
5 *
6 * Platform depend startup
7 * Target Archtecture: AE-3068 (aka. aki3068net)
8 * Memory Layout : RAM
9 */
10
11#define ASSEMBLY
12
13#include <asm/linkage.h>
14
15#if !defined(CONFIG_BLKDEV_RESERVE)
16#if defined(CONFIG_GDB_DEBUG)
17#define RAMEND (__ramend - 0xc000)
18#else
19#define RAMEND __ramend
20#endif
21#else
22#define RAMEND CONFIG_BLKDEV_RESERVE_ADDRESS
23#endif
24
25 .global __start
26 .global _command_line
27 .global __platform_gpio_table
28 .global __target_name
29
30 .h8300h
31
32 .section .text
33 .file "crt0_ram.S"
34
35 /* CPU Reset entry */
36__start:
37 mov.l #RAMEND,sp
38 ldc #0x80,ccr
39
40 /* Peripheral Setup */
41
42#if defined(CONFIG_MTD_UCLINUX)
43 /* move romfs image */
44 jsr @__move_romfs
45#endif
46
47 /* .bss clear */
48 mov.l #__sbss,er5
49 mov.l #__ebss,er4
50 sub.l er5,er4
51 shlr er4
52 shlr er4
53 sub.l er0,er0
541:
55 mov.l er0,@er5
56 adds #4,er5
57 dec.l #1,er4
58 bne 1b
59
60 /* copy kernel commandline */
61 mov.l #COMMAND_START,er5
62 mov.l #_command_line,er6
63 mov.w #512,r4
64 eepmov.w
65
66 /* uClinux kernel start */
67 ldc #0x90,ccr /* running kernel */
68 mov.l #_init_thread_union,sp
69 add.l #0x2000,sp
70 jsr @_start_kernel
71_exit:
72
73 jmp _exit
74
75 rts
76
77 /* I/O port assign information */
78__platform_gpio_table:
79 mov.l #gpio_table,er0
80 rts
81
82gpio_table:
83 ;; P1DDR
84 .byte 0xff,0xff
85 ;; P2DDR
86 .byte 0xff,0xff
87 ;; P3DDR
88 .byte 0xff,0x00
89 ;; P4DDR
90 .byte 0x00,0x00
91 ;; P5DDR
92 .byte 0x01,0x01
93 ;; P6DDR
94 .byte 0x00,0x00
95 ;; dummy
96 .byte 0x00,0x00
97 ;; P8DDR
98 .byte 0x0c,0x0c
99 ;; P9DDR
100 .byte 0x00,0x00
101 ;; PADDR
102 .byte 0x00,0x00
103 ;; PBDDR
104 .byte 0x30,0x30
105
106__target_name:
107 .asciz "AE-3068"
108
109 .section .bootvec,"ax"
110 jmp @__start
diff --git a/arch/h8300/platform/h8300h/generic/Makefile b/arch/h8300/platform/h8300h/generic/Makefile
deleted file mode 100644
index 2b12a170209e..000000000000
--- a/arch/h8300/platform/h8300h/generic/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
1#
2# Makefile for the linux kernel.
3#
4
5extra-y := crt0_$(MODEL).o
diff --git a/arch/h8300/platform/h8300h/generic/crt0_ram.S b/arch/h8300/platform/h8300h/generic/crt0_ram.S
deleted file mode 100644
index 5ab7d9c12910..000000000000
--- a/arch/h8300/platform/h8300h/generic/crt0_ram.S
+++ /dev/null
@@ -1,107 +0,0 @@
1/*
2 * linux/arch/h8300/platform/h8300h/generic/crt0_ram.S
3 *
4 * Yoshinori Sato <ysato@users.sourceforge.jp>
5 *
6 * Platform depend startup
7 * Target Archtecture: AE-3068 (aka. aki3068net)
8 * Memory Layout : RAM
9 */
10
11#define ASSEMBLY
12
13#include <asm/linkage.h>
14
15#if !defined(CONFIG_BLKDEV_RESERVE)
16#if defined(CONFIG_GDB_DEBUG)
17#define RAMEND (__ramend - 0xc000)
18#else
19#define RAMEND __ramend
20#endif
21#else
22#define RAMEND CONFIG_BLKDEV_RESERVE_ADDRESS
23#endif
24
25 .global __start
26 .global _command_line
27 .global __platform_gpio_table
28 .global __target_name
29
30 .h8300h
31
32 .section .text
33 .file "crt0_ram.S"
34
35 /* CPU Reset entry */
36__start:
37 mov.l #RAMEND,sp
38 ldc #0x80,ccr
39
40 /* Peripheral Setup */
41
42#if defined(CONFIG_BLK_DEV_BLKMEM)
43 /* move romfs image */
44 jsr @__move_romfs
45#endif
46
47 /* .bss clear */
48 mov.l #__sbss,er5
49 mov.l #__ebss,er4
50 sub.l er5,er4
51 shlr er4
52 shlr er4
53 sub.l er0,er0
541:
55 mov.l er0,@er5
56 adds #4,er5
57 dec.l #1,er4
58 bne 1b
59
60 /* copy kernel commandline */
61 mov.l #COMMAND_START,er5
62 mov.l #_command_line,er6
63 mov.w #512,r4
64 eepmov.w
65
66 /* uClinux kernel start */
67 ldc #0x90,ccr /* running kernel */
68 mov.l #_init_thread_union,sp
69 add.l #0x2000,sp
70 jsr @_start_kernel
71_exit:
72
73 jmp _exit
74
75 rts
76
77 /* I/O port assign information */
78__platform_gpio_table:
79 mov.l #gpio_table,er0
80 rts
81
82gpio_table:
83 ;; P1DDR
84 .byte 0x00,0x00
85 ;; P2DDR
86 .byte 0x00,0x00
87 ;; P3DDR
88 .byte 0x00,0x00
89 ;; P4DDR
90 .byte 0x00,0x00
91 ;; P5DDR
92 .byte 0x00,0x00
93 ;; P6DDR
94 .byte 0x00,0x00
95 ;; dummy
96 .byte 0x00,0x00
97 ;; P8DDR
98 .byte 0x00,0x00
99 ;; P9DDR
100 .byte 0x00,0x00
101 ;; PADDR
102 .byte 0x00,0x00
103 ;; PBDDR
104 .byte 0x00,0x00
105
106__target_name:
107 .asciz "generic"
diff --git a/arch/h8300/platform/h8300h/generic/crt0_rom.S b/arch/h8300/platform/h8300h/generic/crt0_rom.S
deleted file mode 100644
index dda1dfa15a5e..000000000000
--- a/arch/h8300/platform/h8300h/generic/crt0_rom.S
+++ /dev/null
@@ -1,122 +0,0 @@
1/*
2 * linux/arch/h8300/platform/h8300h/generic/crt0_rom.S
3 *
4 * Yoshinori Sato <ysato@users.sourceforge.jp>
5 *
6 * Platform depend startup
7 * Target Archtecture: generic
8 * Memory Layout : ROM
9 */
10
11#define ASSEMBLY
12
13#include <asm/linkage.h>
14
15 .global __start
16 .global __command_line
17 .global __platform_gpio_table
18 .global __target_name
19
20 .h8300h
21 .section .text
22 .file "crt0_rom.S"
23
24 /* CPU Reset entry */
25__start:
26 mov.l #__ramend,sp
27 ldc #0x80,ccr
28
29 /* Peripheral Setup */
30
31 /* .bss clear */
32 mov.l #__sbss,er5
33 mov.l #__ebss,er4
34 sub.l er5,er4
35 shlr er4
36 shlr er4
37 sub.l er0,er0
381:
39 mov.l er0,@er5
40 adds #4,er5
41 dec.l #1,er4
42 bne 1b
43
44 /* copy .data */
45#if !defined(CONFIG_H8300H_SIM)
46 /* copy .data */
47 mov.l #__begin_data,er5
48 mov.l #__sdata,er6
49 mov.l #__edata,er4
50 sub.l er6,er4
51 shlr.l er4
52 shlr.l er4
531:
54 mov.l @er5+,er0
55 mov.l er0,@er6
56 adds #4,er6
57 dec.l #1,er4
58 bne 1b
59#endif
60
61 /* copy kernel commandline */
62 mov.l #COMMAND_START,er5
63 mov.l #__command_line,er6
64 mov.w #512,r4
65 eepmov.w
66
67 /* linux kernel start */
68 ldc #0x90,ccr /* running kernel */
69 mov.l #_init_thread_union,sp
70 add.l #0x2000,sp
71 jsr @_start_kernel
72_exit:
73
74 jmp _exit
75
76 rts
77
78 /* I/O port assign information */
79__platform_gpio_table:
80 mov.l #gpio_table,er0
81 rts
82
83gpio_table:
84 ;; P1DDR
85 .byte 0x00,0x00
86 ;; P2DDR
87 .byte 0x00,0x00
88 ;; P3DDR
89 .byte 0x00,0x00
90 ;; P4DDR
91 .byte 0x00,0x00
92 ;; P5DDR
93 .byte 0x00,0x00
94 ;; P6DDR
95 .byte 0x00,0x00
96 ;; dummy
97 .byte 0x00,0x00
98 ;; P8DDR
99 .byte 0x00,0x00
100 ;; P9DDR
101 .byte 0x00,0x00
102 ;; PADDR
103 .byte 0x00,0x00
104 ;; PBDDR
105 .byte 0x00,0x00
106
107 .section .rodata
108__target_name:
109 .asciz "generic"
110
111 .section .bss
112__command_line:
113 .space 512
114
115 /* interrupt vector */
116 .section .vectors,"ax"
117 .long __start
118vector = 1
119 .rept 64-1
120 .long _interrupt_redirect_table+vector*4
121vector = vector + 1
122 .endr
diff --git a/arch/h8300/platform/h8300h/h8max/Makefile b/arch/h8300/platform/h8300h/h8max/Makefile
deleted file mode 100644
index b7ff78050b7f..000000000000
--- a/arch/h8300/platform/h8300h/h8max/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
1#
2# Makefile for the linux kernel.
3#
4
5extra-y := crt0_ram.o
diff --git a/arch/h8300/platform/h8300h/h8max/crt0_ram.S b/arch/h8300/platform/h8300h/h8max/crt0_ram.S
deleted file mode 100644
index 6a0d4e2d9ec6..000000000000
--- a/arch/h8300/platform/h8300h/h8max/crt0_ram.S
+++ /dev/null
@@ -1,110 +0,0 @@
1/*
2 * linux/arch/h8300/platform/h8300h/h8max/crt0_ram.S
3 *
4 * Yoshinori Sato <ysato@users.sourceforge.jp>
5 *
6 * Platform depend startup
7 * Target Archtecture: H8MAX
8 * Memory Layout : RAM
9 */
10
11#define ASSEMBLY
12
13#include <asm/linkage.h>
14
15#if !defined(CONFIG_BLKDEV_RESERVE)
16#if defined(CONFIG_GDB_DEBUG)
17#define RAMEND (__ramend - 0xc000)
18#else
19#define RAMEND __ramend
20#endif
21#else
22#define RAMEND CONFIG_BLKDEV_RESERVE_ADDRESS
23#endif
24
25 .global __start
26 .global _command_line
27 .global __platform_gpio_table
28 .global __target_name
29
30 .h8300h
31
32 .section .text
33 .file "crt0_ram.S"
34
35 /* CPU Reset entry */
36__start:
37 mov.l #RAMEND,sp
38 ldc #0x80,ccr
39
40 /* Peripheral Setup */
41
42#if defined(CONFIG_MTD_UCLINUX)
43 /* move romfs image */
44 jsr @__move_romfs
45#endif
46
47 /* .bss clear */
48 mov.l #__sbss,er5
49 mov.l #__ebss,er4
50 sub.l er5,er4
51 shlr er4
52 shlr er4
53 sub.l er0,er0
541:
55 mov.l er0,@er5
56 adds #4,er5
57 dec.l #1,er4
58 bne 1b
59
60 /* copy kernel commandline */
61 mov.l #COMMAND_START,er5
62 mov.l #_command_line,er6
63 mov.w #512,r4
64 eepmov.w
65
66 /* uClinux kernel start */
67 ldc #0x90,ccr /* running kernel */
68 mov.l #_init_thread_union,sp
69 add.l #0x2000,sp
70 jsr @_start_kernel
71_exit:
72
73 jmp _exit
74
75 rts
76
77 /* I/O port assign information */
78__platform_gpio_table:
79 mov.l #gpio_table,er0
80 rts
81
82gpio_table:
83 ;; P1DDR
84 .byte 0xff,0xff
85 ;; P2DDR
86 .byte 0xff,0xff
87 ;; P3DDR
88 .byte 0x00,0x00
89 ;; P4DDR
90 .byte 0x00,0x00
91 ;; P5DDR
92 .byte 0x01,0x01
93 ;; P6DDR
94 .byte 0xf6,0xf6
95 ;; dummy
96 .byte 0x00,0x00
97 ;; P8DDR
98 .byte 0xee,0xee
99 ;; P9DDR
100 .byte 0x00,0x00
101 ;; PADDR
102 .byte 0x00,0x00
103 ;; PBDDR
104 .byte 0x30,0x30
105
106__target_name:
107 .asciz "H8MAX"
108
109 .section .bootvec,"ax"
110 jmp @__start
diff --git a/arch/h8300/platform/h8300h/irq.c b/arch/h8300/platform/h8300h/irq.c
deleted file mode 100644
index 0a50353e09d5..000000000000
--- a/arch/h8300/platform/h8300h/irq.c
+++ /dev/null
@@ -1,82 +0,0 @@
1/*
2 * Interrupt handling H8/300H depend.
3 * Yoshinori Sato <ysato@users.sourceforge.jp>
4 *
5 */
6
7#include <linux/init.h>
8#include <linux/errno.h>
9
10#include <asm/ptrace.h>
11#include <asm/traps.h>
12#include <asm/irq.h>
13#include <asm/io.h>
14#include <asm/gpio-internal.h>
15#include <asm/regs306x.h>
16
17const int __initconst h8300_saved_vectors[] = {
18#if defined(CONFIG_GDB_DEBUG)
19 TRAP3_VEC, /* TRAPA #3 is GDB breakpoint */
20#endif
21 -1,
22};
23
24const h8300_vector __initconst h8300_trap_table[] = {
25 0, 0, 0, 0, 0, 0, 0, 0,
26 system_call,
27 0,
28 0,
29 trace_break,
30};
31
32int h8300_enable_irq_pin(unsigned int irq)
33{
34 int bitmask;
35 if (irq < EXT_IRQ0 || irq > EXT_IRQ5)
36 return 0;
37
38 /* initialize IRQ pin */
39 bitmask = 1 << (irq - EXT_IRQ0);
40 switch(irq) {
41 case EXT_IRQ0:
42 case EXT_IRQ1:
43 case EXT_IRQ2:
44 case EXT_IRQ3:
45 if (H8300_GPIO_RESERVE(H8300_GPIO_P8, bitmask) == 0)
46 return -EBUSY;
47 H8300_GPIO_DDR(H8300_GPIO_P8, bitmask, H8300_GPIO_INPUT);
48 break;
49 case EXT_IRQ4:
50 case EXT_IRQ5:
51 if (H8300_GPIO_RESERVE(H8300_GPIO_P9, bitmask) == 0)
52 return -EBUSY;
53 H8300_GPIO_DDR(H8300_GPIO_P9, bitmask, H8300_GPIO_INPUT);
54 break;
55 }
56
57 return 0;
58}
59
60void h8300_disable_irq_pin(unsigned int irq)
61{
62 int bitmask;
63 if (irq < EXT_IRQ0 || irq > EXT_IRQ5)
64 return;
65
66 /* disable interrupt & release IRQ pin */
67 bitmask = 1 << (irq - EXT_IRQ0);
68 switch(irq) {
69 case EXT_IRQ0:
70 case EXT_IRQ1:
71 case EXT_IRQ2:
72 case EXT_IRQ3:
73 *(volatile unsigned char *)IER &= ~bitmask;
74 H8300_GPIO_FREE(H8300_GPIO_P8, bitmask);
75 break ;
76 case EXT_IRQ4:
77 case EXT_IRQ5:
78 *(volatile unsigned char *)IER &= ~bitmask;
79 H8300_GPIO_FREE(H8300_GPIO_P9, bitmask);
80 break;
81 }
82}
diff --git a/arch/h8300/platform/h8300h/ptrace_h8300h.c b/arch/h8300/platform/h8300h/ptrace_h8300h.c
deleted file mode 100644
index 4f1ed0279633..000000000000
--- a/arch/h8300/platform/h8300h/ptrace_h8300h.c
+++ /dev/null
@@ -1,284 +0,0 @@
1/*
2 * linux/arch/h8300/platform/h8300h/ptrace_h8300h.c
3 * ptrace cpu depend helper functions
4 *
5 * Yoshinori Sato <ysato@users.sourceforge.jp>
6 *
7 * This file is subject to the terms and conditions of the GNU General
8 * Public License. See the file COPYING in the main directory of
9 * this archive for more details.
10 */
11
12#include <linux/linkage.h>
13#include <linux/sched.h>
14#include <asm/ptrace.h>
15
16#define CCR_MASK 0x6f /* mode/imask not set */
17#define BREAKINST 0x5730 /* trapa #3 */
18
19/* Mapping from PT_xxx to the stack offset at which the register is
20 saved. Notice that usp has no stack-slot and needs to be treated
21 specially (see get_reg/put_reg below). */
22static const int h8300_register_offset[] = {
23 PT_REG(er1), PT_REG(er2), PT_REG(er3), PT_REG(er4),
24 PT_REG(er5), PT_REG(er6), PT_REG(er0), PT_REG(orig_er0),
25 PT_REG(ccr), PT_REG(pc)
26};
27
28/* read register */
29long h8300_get_reg(struct task_struct *task, int regno)
30{
31 switch (regno) {
32 case PT_USP:
33 return task->thread.usp + sizeof(long)*2;
34 case PT_CCR:
35 return *(unsigned short *)(task->thread.esp0 + h8300_register_offset[regno]);
36 default:
37 return *(unsigned long *)(task->thread.esp0 + h8300_register_offset[regno]);
38 }
39}
40
41/* write register */
42int h8300_put_reg(struct task_struct *task, int regno, unsigned long data)
43{
44 unsigned short oldccr;
45 switch (regno) {
46 case PT_USP:
47 task->thread.usp = data - sizeof(long)*2;
48 case PT_CCR:
49 oldccr = *(unsigned short *)(task->thread.esp0 + h8300_register_offset[regno]);
50 oldccr &= ~CCR_MASK;
51 data &= CCR_MASK;
52 data |= oldccr;
53 *(unsigned short *)(task->thread.esp0 + h8300_register_offset[regno]) = data;
54 break;
55 default:
56 *(unsigned long *)(task->thread.esp0 + h8300_register_offset[regno]) = data;
57 break;
58 }
59 return 0;
60}
61
62/* disable singlestep */
63void user_disable_single_step(struct task_struct *child)
64{
65 if((long)child->thread.breakinfo.addr != -1L) {
66 *child->thread.breakinfo.addr = child->thread.breakinfo.inst;
67 child->thread.breakinfo.addr = (unsigned short *)-1L;
68 }
69}
70
71/* calculate next pc */
72enum jump_type {none, /* normal instruction */
73 jabs, /* absolute address jump */
74 ind, /* indirect address jump */
75 ret, /* return to subrutine */
76 reg, /* register indexed jump */
77 relb, /* pc relative jump (byte offset) */
78 relw, /* pc relative jump (word offset) */
79 };
80
81/* opcode decode table define
82 ptn: opcode pattern
83 msk: opcode bitmask
84 len: instruction length (<0 next table index)
85 jmp: jump operation mode */
86struct optable {
87 unsigned char bitpattern;
88 unsigned char bitmask;
89 signed char length;
90 signed char type;
91} __attribute__((aligned(1),packed));
92
93#define OPTABLE(ptn,msk,len,jmp) \
94 { \
95 .bitpattern = ptn, \
96 .bitmask = msk, \
97 .length = len, \
98 .type = jmp, \
99 }
100
101static const struct optable optable_0[] = {
102 OPTABLE(0x00,0xff, 1,none), /* 0x00 */
103 OPTABLE(0x01,0xff,-1,none), /* 0x01 */
104 OPTABLE(0x02,0xfe, 1,none), /* 0x02-0x03 */
105 OPTABLE(0x04,0xee, 1,none), /* 0x04-0x05/0x14-0x15 */
106 OPTABLE(0x06,0xfe, 1,none), /* 0x06-0x07 */
107 OPTABLE(0x08,0xea, 1,none), /* 0x08-0x09/0x0c-0x0d/0x18-0x19/0x1c-0x1d */
108 OPTABLE(0x0a,0xee, 1,none), /* 0x0a-0x0b/0x1a-0x1b */
109 OPTABLE(0x0e,0xee, 1,none), /* 0x0e-0x0f/0x1e-0x1f */
110 OPTABLE(0x10,0xfc, 1,none), /* 0x10-0x13 */
111 OPTABLE(0x16,0xfe, 1,none), /* 0x16-0x17 */
112 OPTABLE(0x20,0xe0, 1,none), /* 0x20-0x3f */
113 OPTABLE(0x40,0xf0, 1,relb), /* 0x40-0x4f */
114 OPTABLE(0x50,0xfc, 1,none), /* 0x50-0x53 */
115 OPTABLE(0x54,0xfd, 1,ret ), /* 0x54/0x56 */
116 OPTABLE(0x55,0xff, 1,relb), /* 0x55 */
117 OPTABLE(0x57,0xff, 1,none), /* 0x57 */
118 OPTABLE(0x58,0xfb, 2,relw), /* 0x58/0x5c */
119 OPTABLE(0x59,0xfb, 1,reg ), /* 0x59/0x5b */
120 OPTABLE(0x5a,0xfb, 2,jabs), /* 0x5a/0x5e */
121 OPTABLE(0x5b,0xfb, 2,ind ), /* 0x5b/0x5f */
122 OPTABLE(0x60,0xe8, 1,none), /* 0x60-0x67/0x70-0x77 */
123 OPTABLE(0x68,0xfa, 1,none), /* 0x68-0x69/0x6c-0x6d */
124 OPTABLE(0x6a,0xfe,-2,none), /* 0x6a-0x6b */
125 OPTABLE(0x6e,0xfe, 2,none), /* 0x6e-0x6f */
126 OPTABLE(0x78,0xff, 4,none), /* 0x78 */
127 OPTABLE(0x79,0xff, 2,none), /* 0x79 */
128 OPTABLE(0x7a,0xff, 3,none), /* 0x7a */
129 OPTABLE(0x7b,0xff, 2,none), /* 0x7b */
130 OPTABLE(0x7c,0xfc, 2,none), /* 0x7c-0x7f */
131 OPTABLE(0x80,0x80, 1,none), /* 0x80-0xff */
132};
133
134static const struct optable optable_1[] = {
135 OPTABLE(0x00,0xff,-3,none), /* 0x0100 */
136 OPTABLE(0x40,0xf0,-3,none), /* 0x0140-0x14f */
137 OPTABLE(0x80,0xf0, 1,none), /* 0x0180-0x018f */
138 OPTABLE(0xc0,0xc0, 2,none), /* 0x01c0-0x01ff */
139};
140
141static const struct optable optable_2[] = {
142 OPTABLE(0x00,0x20, 2,none), /* 0x6a0?/0x6a8?/0x6b0?/0x6b8? */
143 OPTABLE(0x20,0x20, 3,none), /* 0x6a2?/0x6aa?/0x6b2?/0x6ba? */
144};
145
146static const struct optable optable_3[] = {
147 OPTABLE(0x69,0xfb, 2,none), /* 0x010069/0x01006d/014069/0x01406d */
148 OPTABLE(0x6b,0xff,-4,none), /* 0x01006b/0x01406b */
149 OPTABLE(0x6f,0xff, 3,none), /* 0x01006f/0x01406f */
150 OPTABLE(0x78,0xff, 5,none), /* 0x010078/0x014078 */
151};
152
153static const struct optable optable_4[] = {
154 OPTABLE(0x00,0x78, 3,none), /* 0x0100690?/0x01006d0?/0140690/0x01406d0?/0x0100698?/0x01006d8?/0140698?/0x01406d8? */
155 OPTABLE(0x20,0x78, 4,none), /* 0x0100692?/0x01006d2?/0140692/0x01406d2?/0x010069a?/0x01006da?/014069a?/0x01406da? */
156};
157
158static const struct optables_list {
159 const struct optable *ptr;
160 int size;
161} optables[] = {
162#define OPTABLES(no) \
163 { \
164 .ptr = optable_##no, \
165 .size = sizeof(optable_##no) / sizeof(struct optable), \
166 }
167 OPTABLES(0),
168 OPTABLES(1),
169 OPTABLES(2),
170 OPTABLES(3),
171 OPTABLES(4),
172
173};
174
175const unsigned char condmask[] = {
176 0x00,0x40,0x01,0x04,0x02,0x08,0x10,0x20
177};
178
179static int isbranch(struct task_struct *task,int reson)
180{
181 unsigned char cond = h8300_get_reg(task, PT_CCR);
182 /* encode complex conditions */
183 /* B4: N^V
184 B5: Z|(N^V)
185 B6: C|Z */
186 __asm__("bld #3,%w0\n\t"
187 "bxor #1,%w0\n\t"
188 "bst #4,%w0\n\t"
189 "bor #2,%w0\n\t"
190 "bst #5,%w0\n\t"
191 "bld #2,%w0\n\t"
192 "bor #0,%w0\n\t"
193 "bst #6,%w0\n\t"
194 :"=&r"(cond)::"cc");
195 cond &= condmask[reson >> 1];
196 if (!(reson & 1))
197 return cond == 0;
198 else
199 return cond != 0;
200}
201
202static unsigned short *getnextpc(struct task_struct *child, unsigned short *pc)
203{
204 const struct optable *op;
205 unsigned char *fetch_p;
206 unsigned char inst;
207 unsigned long addr;
208 unsigned long *sp;
209 int op_len,regno;
210 op = optables[0].ptr;
211 op_len = optables[0].size;
212 fetch_p = (unsigned char *)pc;
213 inst = *fetch_p++;
214 do {
215 if ((inst & op->bitmask) == op->bitpattern) {
216 if (op->length < 0) {
217 op = optables[-op->length].ptr;
218 op_len = optables[-op->length].size + 1;
219 inst = *fetch_p++;
220 } else {
221 switch (op->type) {
222 case none:
223 return pc + op->length;
224 case jabs:
225 addr = *(unsigned long *)pc;
226 return (unsigned short *)(addr & 0x00ffffff);
227 case ind:
228 addr = *pc & 0xff;
229 return (unsigned short *)(*(unsigned long *)addr);
230 case ret:
231 sp = (unsigned long *)h8300_get_reg(child, PT_USP);
232 /* user stack frames
233 | er0 | temporary saved
234 +--------+
235 | exp | exception stack frames
236 +--------+
237 | ret pc | userspace return address
238 */
239 return (unsigned short *)(*(sp+2) & 0x00ffffff);
240 case reg:
241 regno = (*pc >> 4) & 0x07;
242 if (regno == 0)
243 addr = h8300_get_reg(child, PT_ER0);
244 else
245 addr = h8300_get_reg(child, regno-1+PT_ER1);
246 return (unsigned short *)addr;
247 case relb:
248 if (inst == 0x55 || isbranch(child,inst & 0x0f))
249 pc = (unsigned short *)((unsigned long)pc +
250 ((signed char)(*fetch_p)));
251 return pc+1; /* skip myself */
252 case relw:
253 if (inst == 0x5c || isbranch(child,(*fetch_p & 0xf0) >> 4))
254 pc = (unsigned short *)((unsigned long)pc +
255 ((signed short)(*(pc+1))));
256 return pc+2; /* skip myself */
257 }
258 }
259 } else
260 op++;
261 } while(--op_len > 0);
262 return NULL;
263}
264
265/* Set breakpoint(s) to simulate a single step from the current PC. */
266
267void user_enable_single_step(struct task_struct *child)
268{
269 unsigned short *nextpc;
270 nextpc = getnextpc(child,(unsigned short *)h8300_get_reg(child, PT_PC));
271 child->thread.breakinfo.addr = nextpc;
272 child->thread.breakinfo.inst = *nextpc;
273 *nextpc = BREAKINST;
274}
275
276asmlinkage void trace_trap(unsigned long bp)
277{
278 if ((unsigned long)current->thread.breakinfo.addr == bp) {
279 user_disable_single_step(current);
280 force_sig(SIGTRAP,current);
281 } else
282 force_sig(SIGILL,current);
283}
284
diff --git a/arch/h8300/platform/h8s/Makefile b/arch/h8300/platform/h8s/Makefile
deleted file mode 100644
index bf1241883766..000000000000
--- a/arch/h8300/platform/h8s/Makefile
+++ /dev/null
@@ -1,7 +0,0 @@
1#
2# Makefile for the linux kernel.
3#
4# Reuse any files we can from the H8S
5#
6
7obj-y := ints_h8s.o ptrace_h8s.o
diff --git a/arch/h8300/platform/h8s/edosk2674/Makefile b/arch/h8300/platform/h8s/edosk2674/Makefile
deleted file mode 100644
index 8e349723bb4f..000000000000
--- a/arch/h8300/platform/h8s/edosk2674/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
1#
2# Makefile for the linux kernel.
3#
4
5extra-y := crt0_$(MODEL).o
diff --git a/arch/h8300/platform/h8s/edosk2674/crt0_ram.S b/arch/h8300/platform/h8s/edosk2674/crt0_ram.S
deleted file mode 100644
index 5ed191b37cde..000000000000
--- a/arch/h8300/platform/h8s/edosk2674/crt0_ram.S
+++ /dev/null
@@ -1,130 +0,0 @@
1/*
2 * linux/arch/h8300/platform/h8s/edosk2674/crt0_ram.S
3 *
4 * Yoshinori Sato <ysato@users.sourceforge.jp>
5 *
6 * Platform depend startup
7 * Target Archtecture: EDOSK-2674
8 * Memory Layout : RAM
9 */
10
11#define ASSEMBLY
12
13#include <asm/linkage.h>
14#include <asm/regs267x.h>
15
16#if !defined(CONFIG_BLKDEV_RESERVE)
17#if defined(CONFIG_GDB_DEBUG)
18#define RAMEND (__ramend - 0xc000)
19#else
20#define RAMEND __ramend
21#endif
22#else
23#define RAMEND CONFIG_BLKDEV_RESERVE_ADDRESS
24#endif
25
26 .global __start
27 .global __command_line
28 .global __platform_gpio_table
29 .global __target_name
30
31 .h8300s
32
33 .section .text
34 .file "crt0_ram.S"
35
36 /* CPU Reset entry */
37__start:
38 mov.l #RAMEND,sp
39 ldc #0x80,ccr
40 ldc #0x00,exr
41
42 /* Peripheral Setup */
43 bclr #4,@INTCR:8 /* interrupt mode 2 */
44 bset #5,@INTCR:8
45 bclr #0,@IER+1:16
46 bset #1,@ISCRL+1:16 /* IRQ0 Positive Edge */
47 bclr #0,@ISCRL+1:16
48
49#if defined(CONFIG_MTD_UCLINUX)
50 /* move romfs image */
51 jsr @__move_romfs
52#endif
53
54 /* .bss clear */
55 mov.l #__sbss,er5
56 mov.l er5,er6
57 mov.l #__ebss,er4
58 sub.l er5,er4
59 shlr #2,er4
60 sub.l er0,er0
611:
62 mov.l er0,@er5
63 adds #4,er5
64 dec.l #1,er4
65 bne 1b
66
67 /* copy kernel commandline */
68 mov.l #COMMAND_START,er5
69 mov.l #_command_line,er6
70 mov.w #512,r4
71 eepmov.w
72
73 /* uClinux kernel start */
74 ldc #0x90,ccr /* running kernel */
75 mov.l #_init_thread_union,sp
76 add.l #0x2000,sp
77 jsr @_start_kernel
78_exit:
79
80 jmp _exit
81
82 rts
83
84 /* I/O port assign information */
85__platform_gpio_table:
86 mov.l #gpio_table,er0
87 rts
88
89gpio_table:
90 ;; P1DDR
91 ;; used,ddr
92 .byte 0x00,0x00
93 ;; P2DDR
94 .byte 0x00,0x00
95 ;; P3DDR
96 .byte 0x3f,0x3a
97 ;; dummy
98 .byte 0x00,0x00
99 ;; P5DDR
100 .byte 0x00,0x00
101 ;; P6DDR
102 .byte 0x00,0x00
103 ;; P7DDR
104 .byte 0x00,0x00
105 ;; P8DDR
106 .byte 0x00,0x00
107 ;; dummy
108 .byte 0x00,0x00
109 ;; PADDR
110 .byte 0xff,0xff
111 ;; PBDDR
112 .byte 0xff,0x00
113 ;; PCDDR
114 .byte 0xff,0x00
115 ;; PDDDR
116 .byte 0xff,0x00
117 ;; PEDDR
118 .byte 0xff,0x00
119 ;; PFDDR
120 .byte 0xff,0xff
121 ;; PGDDR
122 .byte 0x0f,0x0f
123 ;; PHDDR
124 .byte 0x0f,0x0f
125
126__target_name:
127 .asciz "EDOSK-2674"
128
129 .section .bootvec,"ax"
130 jmp @__start
diff --git a/arch/h8300/platform/h8s/edosk2674/crt0_rom.S b/arch/h8300/platform/h8s/edosk2674/crt0_rom.S
deleted file mode 100644
index 06d1d7f324ca..000000000000
--- a/arch/h8300/platform/h8s/edosk2674/crt0_rom.S
+++ /dev/null
@@ -1,186 +0,0 @@
1/*
2 * linux/arch/h8300/platform/h8s/edosk2674/crt0_rom.S
3 *
4 * Yoshinori Sato <ysato@users.sourceforge.jp>
5 *
6 * Platform depend startup
7 * Target Archtecture: EDOSK-2674
8 * Memory Layout : ROM
9 */
10
11#define ASSEMBLY
12
13#include <asm/linkage.h>
14#include <asm/regs267x.h>
15
16 .global __start
17 .global __command_line
18 .global __platform_gpio_table
19 .global __target_name
20
21 .h8300s
22 .section .text
23 .file "crt0_rom.S"
24
25 /* CPU Reset entry */
26__start:
27 mov.l #__ramend,sp
28 ldc #0x80,ccr
29 ldc #0,exr
30
31 /* Peripheral Setup */
32;BSC/GPIO setup
33 mov.l #init_regs,er0
34 mov.w #0xffff,e2
351:
36 mov.w @er0+,r2
37 beq 2f
38 mov.w @er0+,r1
39 mov.b r1l,@er2
40 bra 1b
41
422:
43;SDRAM setup
44#define SDRAM_SMR 0x400040
45
46 mov.b #0,r0l
47 mov.b r0l,@DRACCR:16
48 mov.w #0x188,r0
49 mov.w r0,@REFCR:16
50 mov.w #0x85b4,r0
51 mov.w r0,@DRAMCR:16
52 mov.b #0,r1l
53 mov.b r1l,@SDRAM_SMR
54 mov.w #0x84b4,r0
55 mov.w r0,@DRAMCR:16
56;special thanks to Arizona Cooperative Power
57
58 /* copy .data */
59 mov.l #__begin_data,er5
60 mov.l #__sdata,er6
61 mov.l #__edata,er4
62 sub.l er6,er4
63 shlr.l #2,er4
641:
65 mov.l @er5+,er0
66 mov.l er0,@er6
67 adds #4,er6
68 dec.l #1,er4
69 bne 1b
70
71 /* .bss clear */
72 mov.l #__sbss,er5
73 mov.l #__ebss,er4
74 sub.l er5,er4
75 shlr.l #2,er4
76 sub.l er0,er0
771:
78 mov.l er0,@er5
79 adds #4,er5
80 dec.l #1,er4
81 bne 1b
82
83 /* copy kernel commandline */
84 mov.l #COMMAND_START,er5
85 mov.l #__command_line,er6
86 mov.w #512,r4
87 eepmov.w
88
89 /* linux kernel start */
90 ldc #0x90,ccr /* running kernel */
91 mov.l #_init_thread_union,sp
92 add.l #0x2000,sp
93 jsr @_start_kernel
94_exit:
95
96 jmp _exit
97
98 rts
99
100 /* I/O port assign information */
101__platform_gpio_table:
102 mov.l #gpio_table,er0
103 rts
104
105#define INIT_REGS_DATA(REGS,DATA) \
106 .word ((REGS) & 0xffff),DATA
107
108init_regs:
109INIT_REGS_DATA(ASTCR,0xff)
110INIT_REGS_DATA(RDNCR,0x00)
111INIT_REGS_DATA(ABWCR,0x80)
112INIT_REGS_DATA(WTCRAH,0x27)
113INIT_REGS_DATA(WTCRAL,0x77)
114INIT_REGS_DATA(WTCRBH,0x71)
115INIT_REGS_DATA(WTCRBL,0x22)
116INIT_REGS_DATA(CSACRH,0x80)
117INIT_REGS_DATA(CSACRL,0x80)
118INIT_REGS_DATA(BROMCRH,0xa0)
119INIT_REGS_DATA(BROMCRL,0xa0)
120INIT_REGS_DATA(P3DDR,0x3a)
121INIT_REGS_DATA(P3ODR,0x06)
122INIT_REGS_DATA(PADDR,0xff)
123INIT_REGS_DATA(PFDDR,0xfe)
124INIT_REGS_DATA(PGDDR,0x0f)
125INIT_REGS_DATA(PHDDR,0x0f)
126INIT_REGS_DATA(PFCR0,0xff)
127INIT_REGS_DATA(PFCR2,0x0d)
128INIT_REGS_DATA(ITSR, 0x00)
129INIT_REGS_DATA(ITSR+1,0x3f)
130INIT_REGS_DATA(INTCR,0x20)
131
132 .word 0
133
134gpio_table:
135 ;; P1DDR
136 .byte 0x00,0x00
137 ;; P2DDR
138 .byte 0x00,0x00
139 ;; P3DDR
140 .byte 0x00,0x00
141 ;; dummy
142 .byte 0x00,0x00
143 ;; P5DDR
144 .byte 0x00,0x00
145 ;; P6DDR
146 .byte 0x00,0x00
147 ;; P7DDR
148 .byte 0x00,0x00
149 ;; P8DDR
150 .byte 0x00,0x00
151 ;; dummy
152 .byte 0x00,0x00
153 ;; PADDR
154 .byte 0x00,0x00
155 ;; PBDDR
156 .byte 0x00,0x00
157 ;; PCDDR
158 .byte 0x00,0x00
159 ;; PDDDR
160 .byte 0x00,0x00
161 ;; PEDDR
162 .byte 0x00,0x00
163 ;; PFDDR
164 .byte 0x00,0x00
165 ;; PGDDR
166 .byte 0x00,0x00
167 ;; PHDDR
168 .byte 0x00,0x00
169
170 .section .rodata
171__target_name:
172 .asciz "EDOSK-2674"
173
174 .section .bss
175__command_line:
176 .space 512
177
178 /* interrupt vector */
179 .section .vectors,"ax"
180 .long __start
181 .long __start
182vector = 2
183 .rept 126
184 .long _interrupt_redirect_table+vector*4
185vector = vector + 1
186 .endr
diff --git a/arch/h8300/platform/h8s/generic/Makefile b/arch/h8300/platform/h8s/generic/Makefile
deleted file mode 100644
index 44b4685c664c..000000000000
--- a/arch/h8300/platform/h8s/generic/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
1#
2# Makefile for the linux kernel.
3#
4
5extra-y = crt0_$(MODEL).o
diff --git a/arch/h8300/platform/h8s/generic/crt0_ram.S b/arch/h8300/platform/h8s/generic/crt0_ram.S
deleted file mode 100644
index 7018915de74f..000000000000
--- a/arch/h8300/platform/h8s/generic/crt0_ram.S
+++ /dev/null
@@ -1,127 +0,0 @@
1/*
2 * linux/arch/h8300/platform/h8s/edosk2674/crt0_ram.S
3 *
4 * Yoshinori Sato <ysato@users.sourceforge.jp>
5 *
6 * Platform depend startup
7 * Target Archtecture: generic
8 * Memory Layout : RAM
9 */
10
11#define ASSEMBLY
12
13#include <asm/linkage.h>
14#include <asm/regs267x.h>
15
16#if !defined(CONFIG_BLKDEV_RESERVE)
17#if defined(CONFIG_GDB_DEBUG)
18#define RAMEND (__ramend - 0xc000)
19#else
20#define RAMEND __ramend
21#endif
22#else
23#define RAMEND CONFIG_BLKDEV_RESERVE_ADDRESS
24#endif
25
26 .global __start
27 .global __command_line
28 .global __platform_gpio_table
29 .global __target_name
30
31 .h8300s
32
33 .section .text
34 .file "crt0_ram.S"
35
36 /* CPU Reset entry */
37__start:
38 mov.l #RAMEND,sp
39 ldc #0x80,ccr
40 ldc #0x00,exr
41
42 /* Peripheral Setup */
43 bclr #4,@INTCR:8 /* interrupt mode 2 */
44 bset #5,@INTCR:8
45
46#if defined(CONFIG_MTD_UCLINUX)
47 /* move romfs image */
48 jsr @__move_romfs
49#endif
50
51 /* .bss clear */
52 mov.l #__sbss,er5
53 mov.l er5,er6
54 mov.l #__ebss,er4
55 sub.l er5,er4
56 shlr #2,er4
57 sub.l er0,er0
581:
59 mov.l er0,@er5
60 adds #4,er5
61 dec.l #1,er4
62 bne 1b
63
64 /* copy kernel commandline */
65 mov.l #COMMAND_START,er5
66 mov.l #_command_line,er6
67 mov.w #512,r4
68 eepmov.w
69
70 /* uClinux kernel start */
71 ldc #0x90,ccr /* running kernel */
72 mov.l #_init_thread_union,sp
73 add.l #0x2000,sp
74 jsr @_start_kernel
75_exit:
76
77 jmp _exit
78
79 rts
80
81 /* I/O port assign information */
82__platform_gpio_table:
83 mov.l #gpio_table,er0
84 rts
85
86gpio_table:
87 ;; P1DDR
88 ;; used,ddr
89 .byte 0x00,0x00
90 ;; P2DDR
91 .byte 0x00,0x00
92 ;; P3DDR
93 .byte 0x00,0x00
94 ;; dummy
95 .byte 0x00,0x00
96 ;; P5DDR
97 .byte 0x00,0x00
98 ;; P6DDR
99 .byte 0x00,0x00
100 ;; P7DDR
101 .byte 0x00,0x00
102 ;; P8DDR
103 .byte 0x00,0x00
104 ;; dummy
105 .byte 0x00,0x00
106 ;; PADDR
107 .byte 0x00,0x00
108 ;; PBDDR
109 .byte 0x00,0x00
110 ;; PCDDR
111 .byte 0x00,0x00
112 ;; PDDDR
113 .byte 0x00,0x00
114 ;; PEDDR
115 .byte 0x00,0x00
116 ;; PFDDR
117 .byte 0x00,0x00
118 ;; PGDDR
119 .byte 0x00,0x00
120 ;; PHDDR
121 .byte 0x00,0x00
122
123__target_name:
124 .asciz "generic"
125
126 .section .bootvec,"ax"
127 jmp @__start
diff --git a/arch/h8300/platform/h8s/generic/crt0_rom.S b/arch/h8300/platform/h8s/generic/crt0_rom.S
deleted file mode 100644
index 623ba7828193..000000000000
--- a/arch/h8300/platform/h8s/generic/crt0_rom.S
+++ /dev/null
@@ -1,128 +0,0 @@
1/*
2 * linux/arch/h8300/platform/h8s/generic/crt0_rom.S
3 *
4 * Yoshinori Sato <ysato@users.sourceforge.jp>
5 *
6 * Platform depend startup
7 * Target Archtecture: generic
8 * Memory Layout : ROM
9 */
10
11#define ASSEMBLY
12
13#include <asm/linkage.h>
14#include <asm/regs267x.h>
15
16 .global __start
17 .global __command_line
18 .global __platform_gpio_table
19 .global __target_name
20
21 .h8300s
22 .section .text
23 .file "crt0_rom.S"
24
25 /* CPU Reset entry */
26__start:
27 mov.l #__ramend,sp
28 ldc #0x80,ccr
29 ldc #0,exr
30 bclr #4,@INTCR:8
31 bset #5,@INTCR:8 /* Interrupt mode 2 */
32
33 /* Peripheral Setup */
34
35 /* copy .data */
36#if !defined(CONFIG_H8S_SIM)
37 mov.l #__begin_data,er5
38 mov.l #__sdata,er6
39 mov.l #__edata,er4
40 sub.l er6,er4
41 shlr.l #2,er4
421:
43 mov.l @er5+,er0
44 mov.l er0,@er6
45 adds #4,er6
46 dec.l #1,er4
47 bne 1b
48#endif
49
50 /* .bss clear */
51 mov.l #__sbss,er5
52 mov.l #__ebss,er4
53 sub.l er5,er4
54 shlr.l #2,er4
55 sub.l er0,er0
561:
57 mov.l er0,@er5
58 adds #4,er5
59 dec.l #1,er4
60 bne 1b
61
62 /* linux kernel start */
63 ldc #0x90,ccr /* running kernel */
64 mov.l #_init_thread_union,sp
65 add.l #0x2000,sp
66 jsr @_start_kernel
67_exit:
68
69 jmp _exit
70
71 rts
72
73 /* I/O port assign information */
74__platform_gpio_table:
75 mov.l #gpio_table,er0
76 rts
77
78gpio_table:
79 ;; P1DDR
80 .byte 0x00,0x00
81 ;; P2DDR
82 .byte 0x00,0x00
83 ;; P3DDR
84 .byte 0x00,0x00
85 ;; P4DDR
86 .byte 0x00,0x00
87 ;; P5DDR
88 .byte 0x00,0x00
89 ;; P6DDR
90 .byte 0x00,0x00
91 ;; dummy
92 .byte 0x00,0x00
93 ;; P8DDR
94 .byte 0x00,0x00
95 ;; PADDR
96 .byte 0x00,0x00
97 ;; PBDDR
98 .byte 0x00,0x00
99 ;; PCDDR
100 .byte 0x00,0x00
101 ;; PDDDR
102 .byte 0x00,0x00
103 ;; PEDDR
104 .byte 0x00,0x00
105 ;; PFDDR
106 .byte 0x00,0x00
107 ;; PGDDR
108 .byte 0x00,0x00
109 ;; PHDDR
110 .byte 0x00,0x00
111
112 .section .rodata
113__target_name:
114 .asciz "generic"
115
116 .section .bss
117__command_line:
118 .space 512
119
120 /* interrupt vector */
121 .section .vectors,"ax"
122 .long __start
123 .long __start
124vector = 2
125 .rept 126-1
126 .long _interrupt_redirect_table+vector*4
127vector = vector + 1
128 .endr
diff --git a/arch/h8300/platform/h8s/irq.c b/arch/h8300/platform/h8s/irq.c
deleted file mode 100644
index f3a5511c16b1..000000000000
--- a/arch/h8300/platform/h8s/irq.c
+++ /dev/null
@@ -1,104 +0,0 @@
1/*
2 * linux/arch/h8300/platform/h8s/ints_h8s.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#include <linux/kernel.h>
12
13#include <asm/ptrace.h>
14#include <asm/traps.h>
15#include <asm/irq.h>
16#include <asm/io.h>
17#include <asm/gpio-internal.h>
18#include <asm/regs267x.h>
19
20/* saved vector list */
21const int __initconst h8300_saved_vectors[] = {
22#if defined(CONFIG_GDB_DEBUG)
23 TRACE_VEC,
24 TRAP3_VEC,
25#endif
26 -1
27};
28
29/* trap entry table */
30const H8300_VECTOR __initconst h8300_trap_table[] = {
31 0,0,0,0,0,
32 trace_break, /* TRACE */
33 0,0,
34 system_call, /* TRAPA #0 */
35 0,0,0,0,0,0,0
36};
37
38/* IRQ pin assignment */
39struct irq_pins {
40 unsigned char port_no;
41 unsigned char bit_no;
42} __attribute__((aligned(1),packed));
43/* ISTR = 0 */
44static const struct irq_pins irq_assign_table0[16]={
45 {H8300_GPIO_P5,H8300_GPIO_B0},{H8300_GPIO_P5,H8300_GPIO_B1},
46 {H8300_GPIO_P5,H8300_GPIO_B2},{H8300_GPIO_P5,H8300_GPIO_B3},
47 {H8300_GPIO_P5,H8300_GPIO_B4},{H8300_GPIO_P5,H8300_GPIO_B5},
48 {H8300_GPIO_P5,H8300_GPIO_B6},{H8300_GPIO_P5,H8300_GPIO_B7},
49 {H8300_GPIO_P6,H8300_GPIO_B0},{H8300_GPIO_P6,H8300_GPIO_B1},
50 {H8300_GPIO_P6,H8300_GPIO_B2},{H8300_GPIO_P6,H8300_GPIO_B3},
51 {H8300_GPIO_P6,H8300_GPIO_B4},{H8300_GPIO_P6,H8300_GPIO_B5},
52 {H8300_GPIO_PF,H8300_GPIO_B1},{H8300_GPIO_PF,H8300_GPIO_B2},
53};
54/* ISTR = 1 */
55static const struct irq_pins irq_assign_table1[16]={
56 {H8300_GPIO_P8,H8300_GPIO_B0},{H8300_GPIO_P8,H8300_GPIO_B1},
57 {H8300_GPIO_P8,H8300_GPIO_B2},{H8300_GPIO_P8,H8300_GPIO_B3},
58 {H8300_GPIO_P8,H8300_GPIO_B4},{H8300_GPIO_P8,H8300_GPIO_B5},
59 {H8300_GPIO_PH,H8300_GPIO_B2},{H8300_GPIO_PH,H8300_GPIO_B3},
60 {H8300_GPIO_P2,H8300_GPIO_B0},{H8300_GPIO_P2,H8300_GPIO_B1},
61 {H8300_GPIO_P2,H8300_GPIO_B2},{H8300_GPIO_P2,H8300_GPIO_B3},
62 {H8300_GPIO_P2,H8300_GPIO_B4},{H8300_GPIO_P2,H8300_GPIO_B5},
63 {H8300_GPIO_P2,H8300_GPIO_B6},{H8300_GPIO_P2,H8300_GPIO_B7},
64};
65
66/* IRQ to GPIO pin translation */
67#define IRQ_GPIO_MAP(irqbit,irq,port,bit) \
68do { \
69 if (*(volatile unsigned short *)ITSR & irqbit) { \
70 port = irq_assign_table1[irq - EXT_IRQ0].port_no; \
71 bit = irq_assign_table1[irq - EXT_IRQ0].bit_no; \
72 } else { \
73 port = irq_assign_table0[irq - EXT_IRQ0].port_no; \
74 bit = irq_assign_table0[irq - EXT_IRQ0].bit_no; \
75 } \
76} while(0)
77
78int h8300_enable_irq_pin(unsigned int irq)
79{
80 if (irq >= EXT_IRQ0 && irq <= EXT_IRQ15) {
81 unsigned short ptn = 1 << (irq - EXT_IRQ0);
82 unsigned int port_no,bit_no;
83 IRQ_GPIO_MAP(ptn, irq, port_no, bit_no);
84 if (H8300_GPIO_RESERVE(port_no, bit_no) == 0)
85 return -EBUSY; /* pin already use */
86 H8300_GPIO_DDR(port_no, bit_no, H8300_GPIO_INPUT);
87 *(volatile unsigned short *)ISR &= ~ptn; /* ISR clear */
88 }
89
90 return 0;
91}
92
93void h8300_disable_irq_pin(unsigned int irq)
94{
95 if (irq >= EXT_IRQ0 && irq <= EXT_IRQ15) {
96 /* disable interrupt & release IRQ pin */
97 unsigned short ptn = 1 << (irq - EXT_IRQ0);
98 unsigned short port_no,bit_no;
99 *(volatile unsigned short *)ISR &= ~ptn;
100 *(volatile unsigned short *)IER &= ~ptn;
101 IRQ_GPIO_MAP(ptn, irq, port_no, bit_no);
102 H8300_GPIO_FREE(port_no, bit_no);
103 }
104}
diff --git a/arch/h8300/platform/h8s/ptrace_h8s.c b/arch/h8300/platform/h8s/ptrace_h8s.c
deleted file mode 100644
index c058ab1a8495..000000000000
--- a/arch/h8300/platform/h8s/ptrace_h8s.c
+++ /dev/null
@@ -1,84 +0,0 @@
1/*
2 * linux/arch/h8300/platform/h8s/ptrace_h8s.c
3 * ptrace cpu depend helper functions
4 *
5 * Yoshinori Sato <ysato@users.sourceforge.jp>
6 *
7 * This file is subject to the terms and conditions of the GNU General
8 * Public License. See the file COPYING in the main directory of
9 * this archive for more details.
10 */
11
12#include <linux/linkage.h>
13#include <linux/sched.h>
14#include <linux/errno.h>
15#include <asm/ptrace.h>
16
17#define CCR_MASK 0x6f
18#define EXR_TRACE 0x80
19
20/* Mapping from PT_xxx to the stack offset at which the register is
21 saved. Notice that usp has no stack-slot and needs to be treated
22 specially (see get_reg/put_reg below). */
23static const int h8300_register_offset[] = {
24 PT_REG(er1), PT_REG(er2), PT_REG(er3), PT_REG(er4),
25 PT_REG(er5), PT_REG(er6), PT_REG(er0), PT_REG(orig_er0),
26 PT_REG(ccr), PT_REG(pc), 0, PT_REG(exr)
27};
28
29/* read register */
30long h8300_get_reg(struct task_struct *task, int regno)
31{
32 switch (regno) {
33 case PT_USP:
34 return task->thread.usp + sizeof(long)*2 + 2;
35 case PT_CCR:
36 case PT_EXR:
37 return *(unsigned short *)(task->thread.esp0 + h8300_register_offset[regno]);
38 default:
39 return *(unsigned long *)(task->thread.esp0 + h8300_register_offset[regno]);
40 }
41}
42
43/* write register */
44int h8300_put_reg(struct task_struct *task, int regno, unsigned long data)
45{
46 unsigned short oldccr;
47 switch (regno) {
48 case PT_USP:
49 task->thread.usp = data - sizeof(long)*2 - 2;
50 case PT_CCR:
51 oldccr = *(unsigned short *)(task->thread.esp0 + h8300_register_offset[regno]);
52 oldccr &= ~CCR_MASK;
53 data &= CCR_MASK;
54 data |= oldccr;
55 *(unsigned short *)(task->thread.esp0 + h8300_register_offset[regno]) = data;
56 break;
57 case PT_EXR:
58 /* exr modify not support */
59 return -EIO;
60 default:
61 *(unsigned long *)(task->thread.esp0 + h8300_register_offset[regno]) = data;
62 break;
63 }
64 return 0;
65}
66
67/* disable singlestep */
68void user_disable_single_step(struct task_struct *child)
69{
70 *(unsigned short *)(child->thread.esp0 + h8300_register_offset[PT_EXR]) &= ~EXR_TRACE;
71}
72
73/* enable singlestep */
74void user_enable_single_step(struct task_struct *child)
75{
76 *(unsigned short *)(child->thread.esp0 + h8300_register_offset[PT_EXR]) |= EXR_TRACE;
77}
78
79asmlinkage void trace_trap(unsigned long bp)
80{
81 (void)bp;
82 force_sig(SIGTRAP,current);
83}
84