summaryrefslogtreecommitdiffstats
path: root/arch/h8300/platform/h8s/edosk2674
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 15:20:36 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 15:20:36 -0700
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /arch/h8300/platform/h8s/edosk2674
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/h8300/platform/h8s/edosk2674')
-rw-r--r--arch/h8300/platform/h8s/edosk2674/Makefile6
-rw-r--r--arch/h8300/platform/h8s/edosk2674/crt0_ram.S131
-rw-r--r--arch/h8300/platform/h8s/edosk2674/crt0_rom.S187
-rw-r--r--arch/h8300/platform/h8s/edosk2674/timer.c55
4 files changed, 379 insertions, 0 deletions
diff --git a/arch/h8300/platform/h8s/edosk2674/Makefile b/arch/h8300/platform/h8s/edosk2674/Makefile
new file mode 100644
index 00000000000..f763654ac6f
--- /dev/null
+++ b/arch/h8300/platform/h8s/edosk2674/Makefile
@@ -0,0 +1,6 @@
+#
+# Makefile for the linux kernel.
+#
+
+extra-y := crt0_$(MODEL).o
+obj-y := timer.o
diff --git a/arch/h8300/platform/h8s/edosk2674/crt0_ram.S b/arch/h8300/platform/h8s/edosk2674/crt0_ram.S
new file mode 100644
index 00000000000..8105dc17d73
--- /dev/null
+++ b/arch/h8300/platform/h8s/edosk2674/crt0_ram.S
@@ -0,0 +1,131 @@
+/*
+ * linux/arch/h8300/platform/h8s/edosk2674/crt0_ram.S
+ *
+ * Yoshinori Sato <ysato@users.sourceforge.jp>
+ *
+ * Platform depend startup
+ * Target Archtecture: EDOSK-2674
+ * Memory Layout : RAM
+ */
+
+#define ASSEMBLY
+
+#include <linux/config.h>
+#include <asm/linkage.h>
+#include <asm/regs267x.h>
+
+#if !defined(CONFIG_BLKDEV_RESERVE)
+#if defined(CONFIG_GDB_DEBUG)
+#define RAMEND (__ramend - 0xc000)
+#else
+#define RAMEND __ramend
+#endif
+#else
+#define RAMEND CONFIG_BLKDEV_RESERVE_ADDRESS
+#endif
+
+ .global SYMBOL_NAME(_start)
+ .global SYMBOL_NAME(_command_line)
+ .global SYMBOL_NAME(_platform_gpio_table)
+ .global SYMBOL_NAME(_target_name)
+
+ .h8300s
+
+ .section .text
+ .file "crt0_ram.S"
+
+ /* CPU Reset entry */
+SYMBOL_NAME_LABEL(_start)
+ mov.l #RAMEND,sp
+ ldc #0x80,ccr
+ ldc #0x00,exr
+
+ /* Peripheral Setup */
+ bclr #4,@INTCR:8 /* interrupt mode 2 */
+ bset #5,@INTCR:8
+ bclr #0,@IER+1:16
+ bset #1,@ISCRL+1:16 /* IRQ0 Positive Edge */
+ bclr #0,@ISCRL+1:16
+
+#if defined(CONFIG_MTD_UCLINUX)
+ /* move romfs image */
+ jsr @__move_romfs
+#endif
+
+ /* .bss clear */
+ mov.l #__sbss,er5
+ mov.l er5,er6
+ mov.l #__ebss,er4
+ sub.l er5,er4
+ shlr #2,er4
+ sub.l er0,er0
+1:
+ mov.l er0,@er5
+ adds #4,er5
+ dec.l #1,er4
+ bne 1b
+
+ /* copy kernel commandline */
+ mov.l #COMMAND_START,er5
+ mov.l #SYMBOL_NAME(command_line),er6
+ mov.w #512,r4
+ eepmov.w
+
+ /* uClinux kernel start */
+ ldc #0x90,ccr /* running kernel */
+ mov.l #SYMBOL_NAME(init_thread_union),sp
+ add.l #0x2000,sp
+ jsr @_start_kernel
+_exit:
+
+ jmp _exit
+
+ rts
+
+ /* I/O port assign information */
+__platform_gpio_table:
+ mov.l #gpio_table,er0
+ rts
+
+gpio_table:
+ ;; P1DDR
+ ;; used,ddr
+ .byte 0x00,0x00
+ ;; P2DDR
+ .byte 0x00,0x00
+ ;; P3DDR
+ .byte 0x3f,0x3a
+ ;; dummy
+ .byte 0x00,0x00
+ ;; P5DDR
+ .byte 0x00,0x00
+ ;; P6DDR
+ .byte 0x00,0x00
+ ;; P7DDR
+ .byte 0x00,0x00
+ ;; P8DDR
+ .byte 0x00,0x00
+ ;; dummy
+ .byte 0x00,0x00
+ ;; PADDR
+ .byte 0xff,0xff
+ ;; PBDDR
+ .byte 0xff,0x00
+ ;; PCDDR
+ .byte 0xff,0x00
+ ;; PDDDR
+ .byte 0xff,0x00
+ ;; PEDDR
+ .byte 0xff,0x00
+ ;; PFDDR
+ .byte 0xff,0xff
+ ;; PGDDR
+ .byte 0x0f,0x0f
+ ;; PHDDR
+ .byte 0x0f,0x0f
+
+__target_name:
+ .asciz "EDOSK-2674"
+
+ .section .bootvec,"ax"
+ jmp @SYMBOL_NAME(_start)
diff --git a/arch/h8300/platform/h8s/edosk2674/crt0_rom.S b/arch/h8300/platform/h8s/edosk2674/crt0_rom.S
new file mode 100644
index 00000000000..65748bf1855
--- /dev/null
+++ b/arch/h8300/platform/h8s/edosk2674/crt0_rom.S
@@ -0,0 +1,187 @@
+/*
+ * linux/arch/h8300/platform/h8s/edosk2674/crt0_rom.S
+ *
+ * Yoshinori Sato <ysato@users.sourceforge.jp>
+ *
+ * Platform depend startup
+ * Target Archtecture: EDOSK-2674
+ * Memory Layout : ROM
+ */
+
+#define ASSEMBLY
+
+#include <linux/config.h>
+#include <asm/linkage.h>
+#include <asm/regs267x.h>
+
+ .global SYMBOL_NAME(_start)
+ .global SYMBOL_NAME(_command_line)
+ .global SYMBOL_NAME(_platform_gpio_table)
+ .global SYMBOL_NAME(_target_name)
+
+ .h8300s
+ .section .text
+ .file "crt0_rom.S"
+
+ /* CPU Reset entry */
+SYMBOL_NAME_LABEL(_start)
+ mov.l #__ramend,sp
+ ldc #0x80,ccr
+ ldc #0,exr
+
+ /* Peripheral Setup */
+;BSC/GPIO setup
+ mov.l #init_regs,er0
+ mov.w #0xffff,e2
+1:
+ mov.w @er0+,r2
+ beq 2f
+ mov.w @er0+,r1
+ mov.b r1l,@er2
+ bra 1b
+
+2:
+;SDRAM setup
+#define SDRAM_SMR 0x400040
+
+ mov.b #0,r0l
+ mov.b r0l,@DRACCR:16
+ mov.w #0x188,r0
+ mov.w r0,@REFCR:16
+ mov.w #0x85b4,r0
+ mov.w r0,@DRAMCR:16
+ mov.b #0,r1l
+ mov.b r1l,@SDRAM_SMR
+ mov.w #0x84b4,r0
+ mov.w r0,@DRAMCR:16
+;special thanks to Arizona Cooperative Power
+
+ /* copy .data */
+ mov.l #__begin_data,er5
+ mov.l #__sdata,er6
+ mov.l #__edata,er4
+ sub.l er6,er4
+ shlr.l #2,er4
+1:
+ mov.l @er5+,er0
+ mov.l er0,@er6
+ adds #4,er6
+ dec.l #1,er4
+ bne 1b
+
+ /* .bss clear */
+ mov.l #__sbss,er5
+ mov.l #__ebss,er4
+ sub.l er5,er4
+ shlr.l #2,er4
+ sub.l er0,er0
+1:
+ mov.l er0,@er5
+ adds #4,er5
+ dec.l #1,er4
+ bne 1b
+
+ /* copy kernel commandline */
+ mov.l #COMMAND_START,er5
+ mov.l #SYMBOL_NAME(_command_line),er6
+ mov.w #512,r4
+ eepmov.w
+
+ /* linux kernel start */
+ ldc #0x90,ccr /* running kernel */
+ mov.l #SYMBOL_NAME(init_thread_union),sp
+ add.l #0x2000,sp
+ jsr @_start_kernel
+_exit:
+
+ jmp _exit
+
+ rts
+
+ /* I/O port assign information */
+__platform_gpio_table:
+ mov.l #gpio_table,er0
+ rts
+
+#define INIT_REGS_DATA(REGS,DATA) \
+ .word ((REGS) & 0xffff),DATA
+
+init_regs:
+INIT_REGS_DATA(ASTCR,0xff)
+INIT_REGS_DATA(RDNCR,0x00)
+INIT_REGS_DATA(ABWCR,0x80)
+INIT_REGS_DATA(WTCRAH,0x27)
+INIT_REGS_DATA(WTCRAL,0x77)
+INIT_REGS_DATA(WTCRBH,0x71)
+INIT_REGS_DATA(WTCRBL,0x22)
+INIT_REGS_DATA(CSACRH,0x80)
+INIT_REGS_DATA(CSACRL,0x80)
+INIT_REGS_DATA(BROMCRH,0xa0)
+INIT_REGS_DATA(BROMCRL,0xa0)
+INIT_REGS_DATA(P3DDR,0x3a)
+INIT_REGS_DATA(P3ODR,0x06)
+INIT_REGS_DATA(PADDR,0xff)
+INIT_REGS_DATA(PFDDR,0xfe)
+INIT_REGS_DATA(PGDDR,0x0f)
+INIT_REGS_DATA(PHDDR,0x0f)
+INIT_REGS_DATA(PFCR0,0xff)
+INIT_REGS_DATA(PFCR2,0x0d)
+INIT_REGS_DATA(ITSR, 0x00)
+INIT_REGS_DATA(ITSR+1,0x3f)
+INIT_REGS_DATA(INTCR,0x20)
+
+ .word 0
+
+gpio_table:
+ ;; P1DDR
+ .byte 0x00,0x00
+ ;; P2DDR
+ .byte 0x00,0x00
+ ;; P3DDR
+ .byte 0x00,0x00
+ ;; dummy
+ .byte 0x00,0x00
+ ;; P5DDR
+ .byte 0x00,0x00
+ ;; P6DDR
+ .byte 0x00,0x00
+ ;; P7DDR
+ .byte 0x00,0x00
+ ;; P8DDR
+ .byte 0x00,0x00
+ ;; dummy
+ .byte 0x00,0x00
+ ;; PADDR
+ .byte 0x00,0x00
+ ;; PBDDR
+ .byte 0x00,0x00
+ ;; PCDDR
+ .byte 0x00,0x00
+ ;; PDDDR
+ .byte 0x00,0x00
+ ;; PEDDR
+ .byte 0x00,0x00
+ ;; PFDDR
+ .byte 0x00,0x00
+ ;; PGDDR
+ .byte 0x00,0x00
+ ;; PHDDR
+ .byte 0x00,0x00
+
+ .section .rodata
+__target_name:
+ .asciz "EDOSK-2674"
+
+ .section .bss
+__command_line:
+ .space 512
+
+ /* interrupt vector */
+ .section .vectors,"ax"
+ .long __start
+ .long __start
+vector = 2
+ .rept 126
+ .long _interrupt_redirect_table+vector*4
+vector = vector + 1
+ .endr
diff --git a/arch/h8300/platform/h8s/edosk2674/timer.c b/arch/h8300/platform/h8s/edosk2674/timer.c
new file mode 100644
index 00000000000..9441a4f1631
--- /dev/null
+++ b/arch/h8300/platform/h8s/edosk2674/timer.c
@@ -0,0 +1,55 @@
+/*
+ * linux/arch/h8300/platform/h8s/edosk2674/timer.c
+ *
+ * Yoshinori Sato <ysato@users.sourceforge.jp>
+ *
+ * Platform depend Timer Handler
+ *
+ */
+
+#include <linux/config.h>
+#include <linux/errno.h>
+#include <linux/sched.h>
+#include <linux/kernel.h>
+#include <linux/param.h>
+#include <linux/string.h>
+#include <linux/mm.h>
+#include <linux/interrupt.h>
+#include <linux/init.h>
+#include <linux/timex.h>
+
+#include <asm/segment.h>
+#include <asm/io.h>
+#include <asm/irq.h>
+#include <asm/regs267x.h>
+
+#define CMFA 6
+
+#define CMIEA 0x40
+#define CCLR_CMA 0x08
+#define CLK_DIV8192 0x03
+
+#define H8300_TIMER_FREQ CONFIG_CPU_CLOCK*1000/8192 /* Timer input freq. */
+
+void __init platform_timer_setup(irqreturn_t (*timer_int)(int, void *, struct pt_regs *))
+{
+ /* 8bit timer module enabled */
+ ctrl_outb(ctrl_inb(MSTPCRL) & ~0x01, MSTPCRL);
+ /* setup 8bit timer ch1 */
+ ctrl_outb(H8300_TIMER_FREQ / HZ, _8TCORA1); /* set interval */
+ ctrl_outb(0x00, _8TCSR1); /* no output */
+ request_irq(76, timer_int, 0, "timer" ,0);
+ ctrl_outb(CMIEA|CCLR_CMA|CLK_DIV8192, _8TCR1); /* start count */
+}
+
+void platform_timer_eoi(void)
+{
+ *(volatile unsigned char *)_8TCSR1 &= ~(1 << CMFA);
+}
+
+void platform_gettod(int *year, int *mon, int *day, int *hour,
+ int *min, int *sec)
+{
+/* FIXME! not RTC support */
+ *year = *mon = *day = *hour = *min = *sec = 0;
+}