]> git.hungrycats.org Git - linux/commitdiff
[PATCH] h8300 support fix (1/2)
authorYoshinori Sato <ysato@users.sourceforge.jp>
Thu, 21 Aug 2003 15:56:04 +0000 (08:56 -0700)
committerLinus Torvalds <torvalds@home.osdl.org>
Thu, 21 Aug 2003 15:56:04 +0000 (08:56 -0700)
o build script update
o interrupt management fix
o mtd support fix
o signal handling fix

21 files changed:
MAINTAINERS
arch/h8300/Kconfig
arch/h8300/Makefile
arch/h8300/boot/Makefile [new file with mode: 0644]
arch/h8300/kernel/signal.c
arch/h8300/kernel/syscalls.S
arch/h8300/kernel/vmlinux.lds.S
arch/h8300/lib/romfs.S [new file with mode: 0644]
arch/h8300/platform/h8300h/aki3068net/timer.c
arch/h8300/platform/h8300h/entry.S
arch/h8300/platform/h8300h/generic/crt0_rom.S
arch/h8300/platform/h8300h/h8max/timer.c
arch/h8300/platform/h8300h/ints.c
arch/h8300/platform/h8s/edosk2674/crt0_ram.S
arch/h8300/platform/h8s/edosk2674/timer.c
arch/h8300/platform/h8s/entry.S
arch/h8300/platform/h8s/generic/crt0_ram.S
arch/h8300/platform/h8s/generic/crt0_rom.S
arch/h8300/platform/h8s/generic/rom.ld
arch/h8300/platform/h8s/generic/timer.c
arch/h8300/platform/h8s/ints.c

index f86fe18fda53c93857a824f704050eb069276a11..7ba394c423ae98334499e19830fb82bb97072426 100644 (file)
@@ -2169,6 +2169,12 @@ W:       http://www.ic.nec.co.jp/micro/uclinux/eng/
 W:     http://www.ee.nec.de/uclinux/
 S:     Supported
 
+UCLINUX FOR RENESAS H8/300
+P:     Yoshinori Sato
+M:     ysato@users.sourceforge.jp
+W:     http://uclinux-h8.sourceforge.jp/
+S:     Supported
+
 USB DIAMOND RIO500 DRIVER
 P:     Cesar Miquel
 M:     miquel@df.uba.ar
index a03881ed53a7a1e84ebb5f4425b748fc6c954a35..2037d74a96c5e52c7e22926b259b4a75db6ceb15 100644 (file)
@@ -190,6 +190,8 @@ endmenu
 
 source "drivers/base/Kconfig"
 
+source "drivers/mtd/Kconfig"
+
 source "drivers/block/Kconfig"
 
 source "drivers/ide/Kconfig"
index 8d754ce470c4857b7530dc467d5c82823c8b6322..5d7bb4b74bf7f3ecd950a0b631f63c7bbf7b3d54 100644 (file)
@@ -5,7 +5,7 @@
 # License.  See the file "COPYING" in the main directory of this archive
 # for more details.
 #
-# (C) Copyright 2002, Yoshinori Sato <ysato@users.sourceforge.jp>
+# (C) Copyright 2002,2003 Yoshinori Sato <ysato@users.sourceforge.jp>
 #
 ifndef include-config
 -include $(TOPDIR)/.config
@@ -37,8 +37,8 @@ CFLAGS += $(cflags-y)
 CFLAGS += -mint32 -fno-builtin -Os
 CFLAGS += -g
 CFLAGS += -D__linux__
-CFLAGS += -DUTS_SYSNAME=\"uClinux\" -DTARGET=$(BOARD)
-AFLAGS += -DPLATFORM=$(PLATFORM) -DTARGET=$(BOARD) -DMODEL=$(MODEL) $(cflags-y)
+CFLAGS += -DUTS_SYSNAME=\"uClinux\"
+AFLAGS += -DPLATFORM=$(PLATFORM) -DMODEL=$(MODEL) $(cflags-y)
 LDFLAGS += $(ldflags-y)
 
 CROSS_COMPILE = h8300-elf-
@@ -53,28 +53,32 @@ core-y      += arch/$(ARCH)/kernel/ \
 
 libs-y += arch/$(ARCH)/lib/ $(LIBGCC)
 
-export MODEL
+boot := arch/h8300/boot
+
+export MODEL PLATFORM BOARD
 
 archmrproper:
 
 archclean:
-       $(call descend arch/$(ARCH), subdirclean)
+       $(Q)$(MAKE) $(clean)=$(boot)
+
+prepare: include/asm-$(ARCH)/machine-depend.h include/asm-$(ARCH)/asm-offsets.h
 
-prepare: include/asm-$(ARCH)/asm-offsets.h
+include/asm-$(ARCH)/machine-depend.h: include/asm-$(ARCH)/$(BOARD)/machine-depend.h
+       $(Q)ln -sf $(BOARD)/machine-depend.h \
+                   include/asm-$(ARCH)/machine-depend.h
+       @echo '  Create include/asm-$(ARCH)/machine-depend.h'
 
 include/asm-$(ARCH)/asm-offsets.h: arch/$(ARCH)/kernel/asm-offsets.s \
                                   include/asm include/linux/version.h
        $(call filechk,gen-asm-offsets)
 
-vmlinux.bin: vmlinux
-       $(OBJCOPY) -Obinary $< $@
-
-vmlinux.srec: vmlinux
-       $(OBJCOPY) -Osrec $< $@
+vmlinux.srec vmlinux.bin: vmlinux
+       $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
 
 define archhelp
   echo  'vmlinux.bin  - Create raw binary'
   echo  'vmlinux.srec - Create srec binary'
 endef
 
-CLEAN_FILES += arch/$(ARCH)/vmlinux.bin arch/$(ARCH)/vmlinux.srec
+CLEAN_FILES += include/asm-$(ARCH)/asm-offsets.h include/asm-$(ARCH)/machine-depend.h
diff --git a/arch/h8300/boot/Makefile b/arch/h8300/boot/Makefile
new file mode 100644 (file)
index 0000000..65086d9
--- /dev/null
@@ -0,0 +1,12 @@
+# arch/h8300/boot/Makefile
+
+targets := vmlinux.srec vmlinux.bin
+
+OBJCOPYFLAGS_vmlinux.srec := -Osrec
+OBJCOPYFLAGS_vmlinux.bin  := -Obinary
+
+$(obj)/vmlinux.srec $(obj)/vmlinux.bin:  vmlinux FORCE
+       $(call if_changed,objcopy)
+       @echo '  Kernel: $@ is ready'
+
+CLEAN_FILES += arch/$(ARCH)/vmlinux.bin arch/$(ARCH)/vmlinux.srec
index 47b60d493ff86bc94a6730e1612691fdb9f7dc49..8db25723b0775e7e33530d6e3e1405e7acbec5d7 100644 (file)
@@ -157,6 +157,7 @@ struct sigframe
 #if defined(CONFIG_CPU_H8S)
        short dummy_exr;
 #endif
+       long dummy_pc;
        char *pretcode;
        unsigned char retcode[8];
        unsigned long extramask[_NSIG_WORDS-1];
@@ -170,6 +171,7 @@ struct rt_sigframe
 #if defined(CONFIG_CPU_H8S)
        short dummy_exr;
 #endif
+       long dummy_pc;
        char *pretcode;
        unsigned char retcode[8];
        struct siginfo info;
@@ -241,7 +243,7 @@ badframe:
 
 asmlinkage int do_sigreturn(unsigned long __unused,...)
 {
-       struct pt_regs *regs = (struct pt_regs *) &__unused;
+       struct pt_regs *regs = (struct pt_regs *) (&__unused - 1);
        unsigned long usp = rdusp();
        struct sigframe *frame = (struct sigframe *)(usp - 4);
        sigset_t set;
@@ -416,7 +418,6 @@ static void setup_rt_frame (int sig, struct k_sigaction *ka, siginfo_t *info,
        /* Set up to return from userspace.  */
        err |= __put_user(frame->retcode, &frame->pretcode);
 
-       /* moveq #,d0; notb d0; movea.l #,a5; trap #0 */
        /* sub.l er0,er0; mov.b #__NR_rt_sigreturn,r0l; trapa #0 */
        err != __put_user(0x1a80f800 + (__NR_rt_sigreturn & 0xff),
                        (long *)(frame->retcode + 0));
index de7cc243e196458a46cd2887e33302106d086301..e77bc055fb5a8356b1f4011b795ca3a63e3b52dd 100644 (file)
@@ -275,14 +275,18 @@ SYMBOL_NAME_LABEL(sys_call_table)
        .long SYMBOL_NAME(sys_ni_syscall)       /* sys_remap_file_pages */
        .long SYMBOL_NAME(sys_set_tid_address)
        .long SYMBOL_NAME(sys_timer_create)
-       .long SYMBOL_NAME(sys_timer_settime)            /* 260 */
+       .long SYMBOL_NAME(sys_timer_settime)    /* 260 */
        .long SYMBOL_NAME(sys_timer_gettime)
        .long SYMBOL_NAME(sys_timer_getoverrun)
        .long SYMBOL_NAME(sys_timer_delete)
        .long SYMBOL_NAME(sys_clock_settime)
-       .long SYMBOL_NAME(sys_clock_gettime)            /* 265 */
+       .long SYMBOL_NAME(sys_clock_gettime)    /* 265 */
        .long SYMBOL_NAME(sys_clock_getres)
        .long SYMBOL_NAME(sys_clock_nanosleep)
+       .long SYMBOL_NAME(sys_statfs64)
+       .long SYMBOL_NAME(sys_fstatfs64)        
+       .long SYMBOL_NAME(sys_tgkill)           /* 270 */
+       .long SYMBOL_NAME(sys_utimes)
 
        .rept NR_syscalls-(.-SYMBOL_NAME(sys_call_table))/4
                .long SYMBOL_NAME(sys_ni_syscall)
index 179b2132ecd368ca9122aa182318076c2e5df86a..60787f07eb2be2a35f82ac929c60d011d65f6708 100644 (file)
@@ -2,58 +2,62 @@
 
 #ifdef CONFIG_H8300H_GENERIC
 #ifdef CONFIG_ROMKERNEL
-#include "platform/h8300h/generic/rom.ld"
+#include "../platform/h8300h/generic/rom.ld"
 #endif
 #ifdef CONFIG_RAMKERNEL
-#include "platform/h8300h/generic/ram.ld"
+#include "../platform/h8300h/generic/ram.ld"
 #endif
 #endif
 
 #ifdef CONFIG_H8300H_AKI3068NET
 #ifdef CONFIG_ROMKERNEL
-#include "platform/h8300h/aki3068net/rom.ld"
+#include "../platform/h8300h/aki3068net/rom.ld"
 #endif
 #ifdef CONFIG_RAMKERNEL
-#include "platform/h8300h/aki3068net/ram.ld"
+#include "../platform/h8300h/aki3068net/ram.ld"
 #endif
 #endif
 
 #ifdef CONFIG_H8300H_H8MAX
 #ifdef CONFIG_ROMKERNEL
-#include "platform/h8300h/h8max/rom.ld"
+#include "../platform/h8300h/h8max/rom.ld"
 #endif
 #ifdef CONFIG_RAMKERNEL
-#include "platform/h8300h/h8max/ram.ld"
+#include "../platform/h8300h/h8max/ram.ld"
 #endif
 #endif
 
 #ifdef CONFIG_H8300H_SIM
 #ifdef CONFIG_ROMKERNEL
-#include "platform/h8300h/generic/rom.ld"
+#include "../platform/h8300h/generic/rom.ld"
 #endif
 #ifdef CONFIG_RAMKERNEL
-#include "platform/h8300h/generic/ram.ld"
+#include "../platform/h8300h/generic/ram.ld"
 #endif
 #endif
 
 #ifdef CONFIG_H8S_SIM
 #ifdef CONFIG_ROMKERNEL
-#include "platform/h8s/generic/rom.ld"
+#include "../platform/h8s/generic/rom.ld"
 #endif
 #ifdef CONFIG_RAMKERNEL
-#include "platform/h8s/generic/ram.ld"
+#include "../platform/h8s/generic/ram.ld"
 #endif
 #endif
 
 #ifdef CONFIG_H8S_EDOSK2674
 #ifdef CONFIG_ROMKERNEL
-#include "platform/h8s/edosk2674/rom.ld"
+#include "../platform/h8s/edosk2674/rom.ld"
 #endif
 #ifdef CONFIG_RAMKERNEL
-#include "platform/h8s/edosk2674/ram.ld"
+#include "../platform/h8s/edosk2674/ram.ld"
 #endif
 #endif
 
+#if defined(CONFIG_H8300H_SIM) || defined(CONFIG_H8S_SIM)
+INPUT(romfs.o)
+#endif
+
 _jiffies = _jiffies_64 + 4;
 
 SECTIONS
@@ -169,6 +173,10 @@ SECTIONS
        __end = . ;
        __ramstart = .;
        } > ram
+        .romfs :       
+       {
+               *(.romfs*)
+       } > ram
         .dummy :
         {
        COMMAND_START = . - 0x200 ;
diff --git a/arch/h8300/lib/romfs.S b/arch/h8300/lib/romfs.S
new file mode 100644 (file)
index 0000000..844f116
--- /dev/null
@@ -0,0 +1,52 @@
+/* romfs move to __ebss */
+
+#include <asm/linkage.h>
+
+#if defined(__H8300H__) 
+       .h8300h
+#endif
+#if defined(__H8300S__) 
+       .h8300s
+#endif
+
+       .text
+.globl __move_romfs
+_romfs_sig_len = 8
+
+__move_romfs:  
+       mov.l   #__sbss,er0
+       mov.l   #_romfs_sig,er1
+       mov.b   #_romfs_sig_len,r3l
+1:                                     /* check romfs image */
+       mov.b   @er0+,r2l
+       mov.b   @er1+,r2h
+       cmp.b   r2l,r2h
+       bne     2f
+       dec.b   r3l
+       bne     1b
+
+       /* find romfs image */
+       mov.l   @__sbss+8,er0           /* romfs length(be) */
+       mov.l   #__sbss,er1
+       add.l   er0,er1                 /* romfs image end */
+       mov.l   #__ebss,er2
+       add.l   er0,er2                 /* distination address */
+       adds    #2,er0
+       adds    #1,er0
+       shlr    er0
+       shlr    er0                     /* transfer length */
+1:
+       mov.l   @er1,er3                /* copy image */
+       mov.l   er3,@er2
+       subs    #4,er1
+       subs    #4,er2
+       dec.l   #1,er0
+       bpl     1b
+2:
+       rts
+
+       .section        .rodata
+_romfs_sig:    
+       .ascii  "-rom1fs-"
+
+       .end
index 05fa22144094c74e4a917d9f58872de63805de81..8dd603b7b4cbd52c6e44fdf303b3463991377a91 100644 (file)
 
 #define CMFA 6
 
-extern int request_irq_boot(unsigned int,
-                            irqreturn_t (*handler)(int, void *, struct pt_regs *),
-                            unsigned long, const char *, void *);
-
 void __init platform_timer_setup(irqreturn_t (*timer_int)(int, void *, struct pt_regs *))
 {
        outb(H8300_TIMER_COUNT_DATA,TCORA2);
        outb(0x00,_8TCSR2);
-       request_irq_boot(40,timer_int,0,"timer",0);
+       request_irq(40,timer_int,0,"timer",0);
        outb(0x40|0x08|0x03,_8TCR2);
 }
 
index b156053d91780e5ba47ad6e0f5384b989e801a2f..9bd8e636cbb42a4f83581c1388e82ee47009fb71 100644 (file)
@@ -111,7 +111,7 @@ LRET        =       38
        mov.l   er1,@(8:16,er0)
 
        mov.l   @sp+,er1
-       add.l   #(LRET-LORIG),sp                /* remove LORIG - LRET */ 
+       add.l   #(LRET-LER1),sp                 /* remove LORIG - LRET */ 
        mov.l   sp,@SYMBOL_NAME(sw_ksp)
        mov.l   er0,sp
        bra     8f
@@ -255,6 +255,7 @@ SYMBOL_NAME_LABEL(ret_from_exception)
        btst    #TIF_NEED_RESCHED,r1l
        bne     @SYMBOL_NAME(reschedule):16
        mov.l   sp,er1
+       subs    #4,er1                  /* adjust retpc */
        mov.l   er2,er0
        jsr     @SYMBOL_NAME(do_signal)
 3:      
index 48079f558654c1b7e4ad9dc44cff01cddce196e6..b1e036b457d4fa9be4695e4fbad3dd024faad41a 100644 (file)
@@ -44,14 +44,19 @@ SYMBOL_NAME_LABEL(_start)
 
        /* copy .data */
 #if !defined(CONFIG_H8300H_SIM)
+       /* copy .data */
        mov.l   #__begin_data,er5
        mov.l   #__sdata,er6
        mov.l   #__edata,er4
-       sub.l   er6,er4         
+       sub.l   er6,er4
+       shlr.l  er4
+       shlr.l  er4
 1:     
-       eepmov.w        
-       dec.w   #1,e4
-       bpl     1b      
+       mov.l   @er5+,er0
+       mov.l   er0,@er6
+       adds    #4,er6
+       dec.l   #1,er4
+       bne     1b      
 #endif
 
        /* copy kernel commandline */
index fb38a782eb6808d87c2e763eb34222229ca6722d..cfa83b017e33c1498a36c90e4bf5460ce44cecd6 100644 (file)
 
 #define CMFA 6
 
-extern int request_irq_boot(unsigned int,
-                            irqreturn_t (*handler)(int, void *, struct pt_regs *),
-                            unsigned long, const char *, void *);
-
 void __init platform_timer_setup(irqreturn_t (*timer_int)(int, void *, struct pt_regs *))
 {
        outb(H8300_TIMER_COUNT_DATA,TCORA2);
        outb(0x00,_8TCSR2);
-       request_irq_boot(40,timer_int,0,"timer",0);
+       request_irq(40,timer_int,0,"timer",0);
        outb(0x40|0x08|0x03,_8TCR2);
 }
 
index ce8c70406fb2b5c48741e9828149c223d71f6f62..b16726a7d2a64d0575e96972c05f14e4207263d7 100644 (file)
@@ -52,7 +52,8 @@ typedef struct irq_handler {
        const char  *devname;
 } irq_handler_t;
 
-irq_handler_t *irq_list[NR_IRQS];
+static irq_handler_t *irq_list[NR_IRQS];
+static int use_kmalloc;
 
 extern unsigned long *interrupt_redirect_table;
 
@@ -119,20 +120,6 @@ void __init init_IRQ(void)
 #endif
 }
 
-void __init request_irq_boot(unsigned int irq, 
-                            irqreturn_t (*handler)(int, void *, struct pt_regs *),
-                             unsigned long flags, const char *devname, void *dev_id)
-{
-       irq_handler_t *irq_handle;
-       irq_handle = alloc_bootmem(sizeof(irq_handler_t));
-       irq_handle->handler = handler;
-       irq_handle->flags   = flags;
-       irq_handle->count   = 0;
-       irq_handle->dev_id  = dev_id;
-       irq_handle->devname = devname;
-       irq_list[irq] = irq_handle;
-}
-
 int request_irq(unsigned int irq, 
                irqreturn_t (*handler)(int, void *, struct pt_regs *),
                 unsigned long flags, const char *devname, void *dev_id)
@@ -154,7 +141,14 @@ int request_irq(unsigned int irq,
                        return -EBUSY;
                H8300_GPIO_DDR(H8300_GPIO_P9, (irq - EXT_IRQ0), 0);
        }
-       irq_handle = (irq_handler_t *)kmalloc(sizeof(irq_handler_t), GFP_ATOMIC);
+
+       if (use_kmalloc)
+               irq_handle = (irq_handler_t *)kmalloc(sizeof(irq_handler_t), GFP_ATOMIC);
+       else {
+               irq_handle = alloc_bootmem(sizeof(irq_handler_t));
+               (unsigned long)irq_handle |= 0x80000000; /* bootmem allocater */
+       }
+
        if (irq_handle == NULL)
                return -ENOMEM;
 
@@ -177,8 +171,10 @@ void free_irq(unsigned int irq, void *dev_id)
                       irq, irq_list[irq]->devname);
        if (irq >= EXT_IRQ0 && irq <= EXT_IRQ5)
                *(volatile unsigned char *)IER &= ~(1 << (irq - EXT_IRQ0));
-       kfree(irq_list[irq]);
-       irq_list[irq] = NULL;
+       if ((irq_list[irq] & 0x80000000) == 0) {
+               kfree(irq_list[irq]);
+               irq_list[irq] = NULL;
+       }
 }
 
 /*
@@ -244,3 +240,9 @@ int show_interrupts(struct seq_file *p, void *v)
 void init_irq_proc(void)
 {
 }
+
+static void __init enable_kmalloc(void)
+{
+       use_kmalloc = 1;
+}
+__initcall(enable_kmalloc);
index d4b7e0641390a414f1b104439a3812694c8c747a..8105dc17d7356a61043d129dc6edad2a70d02f60 100644 (file)
@@ -37,7 +37,8 @@
        /* CPU Reset entry */
 SYMBOL_NAME_LABEL(_start)
        mov.l   #RAMEND,sp
-       ldc     #0x07,exr
+       ldc     #0x80,ccr
+       ldc     #0x00,exr
 
        /* Peripheral Setup */
        bclr    #4,@INTCR:8     /* interrupt mode 2 */
@@ -46,7 +47,7 @@ SYMBOL_NAME_LABEL(_start)
        bset    #1,@ISCRL+1:16  /* IRQ0 Positive Edge */
        bclr    #0,@ISCRL+1:16
 
-#if defined(CONFIG_BLK_DEV_BLKMEM)
+#if defined(CONFIG_MTD_UCLINUX)
        /* move romfs image */
        jsr     @__move_romfs   
 #endif
@@ -71,7 +72,7 @@ SYMBOL_NAME_LABEL(_start)
        eepmov.w
 
        /* uClinux kernel start */
-       ldc     #0x10,ccr       /* running kernel */
+       ldc     #0x90,ccr       /* running kernel */
        mov.l   #SYMBOL_NAME(init_thread_union),sp
        add.l   #0x2000,sp
        jsr     @_start_kernel
index efea48ef4acf9458f6cc4f297a7b6d9ed53c71d3..4d3392dc0f5d5a801bc8a7362db728d226e875e8 100644 (file)
 #define REGS(regs) __REGS(regs)
 #define __REGS(regs) #regs
 
-extern int request_irq_boot(unsigned int,
-                           irqreturn_t (*handler)(int, void *, struct pt_regs *),
-                           unsigned long, const char *, void *);
-
 int __init platform_timer_setup(irqreturn_t (*timer_int)(int, void *, struct pt_regs *))
 {
        unsigned char mstpcrl;
@@ -38,7 +34,7 @@ int __init platform_timer_setup(irqreturn_t (*timer_int)(int, void *, struct pt_
        outb(mstpcrl,MSTPCRL);
        outb(H8300_TIMER_COUNT_DATA,_8TCORA1);
        outb(0x00,_8TCSR1);
-       request_irq_boot(76,timer_int,0,"timer",0);
+       request_irq(76,timer_int,0,"timer",0);
        outb(0x40|0x08|0x03,_8TCR1);
        return 0;
 }
index 1326e84483e055748d318e605099e128645667e3..b701d67609a045b1169f245382db8726b4d1dca7 100644 (file)
@@ -112,7 +112,7 @@ LRET        =       40
        mov.l   er1,@(10:16,er0)
 
        mov.l   @sp+,er1
-       add.l   #(LRET-LORIG),sp                /* remove LORIG - LRET */ 
+       add.l   #(LRET-LER1),sp                 /* remove LORIG - LRET */ 
        mov.l   sp,@SYMBOL_NAME(sw_ksp)
        mov.l   er0,sp
        bra     8f
@@ -252,6 +252,7 @@ SYMBOL_NAME_LABEL(ret_from_exception)
        btst    #TIF_NEED_RESCHED,r1l
        bne     @SYMBOL_NAME(reschedule):16
        mov.l   sp,er1
+       subs    #4,er1                  /* adjust retpc */
        mov.l   er2,er0
        jsr     @SYMBOL_NAME(do_signal)
 3:      
index 9310cd57a9283e730ec21c7afa9cfcc4c6f60f5a..86f45017846608d2d903691064387e33a12318ba 100644 (file)
        /* CPU Reset entry */
 SYMBOL_NAME_LABEL(_start)
        mov.l   #RAMEND,sp
-       ldc     #0x07,exr
+       ldc     #0x80,ccr
+       ldc     #0x00,exr
 
        /* Peripheral Setup */
        bclr    #4,@INTCR:8     /* interrupt mode 2 */
        bset    #5,@INTCR:8
 
-#if defined(CONFIG_BLK_DEV_BLKMEM)
+#if defined(CONFIG_MTD_UCLINUX)
        /* move romfs image */
        jsr     @__move_romfs   
 #endif
@@ -68,7 +69,7 @@ SYMBOL_NAME_LABEL(_start)
        eepmov.w
 
        /* uClinux kernel start */
-       ldc     #0x10,ccr       /* running kernel */
+       ldc     #0x90,ccr       /* running kernel */
        mov.l   #SYMBOL_NAME(init_thread_union),sp
        add.l   #0x2000,sp
        jsr     @_start_kernel
index b49d22ceb8e8df9a792f0443e5ae4a114cc6b272..f345e090523eed07ec8b7b59abf1c10d55082b0f 100644 (file)
@@ -33,36 +33,32 @@ SYMBOL_NAME_LABEL(_start)
        
        /* Peripheral Setup */
        
-       /* .bss clear */
-       mov.l   #__sbss,er5
-       mov.l   er5,er6
-       inc.l   #1,er6
-       mov.l   #__ebss,er4
-       sub.l   er5,er4
-       sub.w   r0,r0
-       mov.b   r0l,@er5
-1:     
-       eepmov.w
-       dec.w   #1,e4
-       bpl     1b
-
        /* copy .data */
 #if !defined(CONFIG_H8S_SIM)
        mov.l   #__begin_data,er5
        mov.l   #__sdata,er6
        mov.l   #__edata,er4
-       sub.l   er6,er4         
+       sub.l   er6,er4
+       shlr.l  #2,er4
 1:     
-       eepmov.w        
-       dec.w   #1,e4
-       bpl     1b      
+       mov.l   @er5+,er0
+       mov.l   er0,@er6
+       adds    #4,er6
+       dec.l   #1,er4
+       bne     1b      
 #endif
 
-       /* copy kernel commandline */
-       mov.l   #COMMAND_START,er5
-       mov.l   #SYMBOL_NAME(_command_line),er6
-       mov.w   #512,r4
-       eepmov.w
+       /* .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
 
        /* linux kernel start */
        ldc     #0x90,ccr       /* running kernel */
index f451d2ee1df412670dcebb2760a1fb1be7488ea6..68cfd1767917a4a161198064103db3aa91124995 100644 (file)
@@ -6,6 +6,6 @@ MEMORY
        vector : ORIGIN = 0x000000, LENGTH = 0x000200
        rom    : ORIGIN = 0x000200, LENGTH = 0x200000-0x000200
        erom   : ORIGIN = 0x200000, LENGTH = 0
-       ram    : ORIGIN = 0x200000, LENGTH = 0x200000
-       eram   : ORIGIN = 0x400000, LENGTH = 0
+       ram    : ORIGIN = 0x200000, LENGTH = 0x400000
+       eram   : ORIGIN = 0x600000, LENGTH = 0
        }
index 8a2e799695b7579e69dea7a639cdd3f5d6d546f2..5367e3e66bf5402911e95199999bef8a1e56ade6 100644 (file)
 #include <asm/irq.h>
 #include <asm/regs267x.h>
 
-extern int request_irq_boot(unsigned int,
-                           irqreturn_t (*handler)(int, void *, struct pt_regs *),
-                           unsigned long, const char *, void *);
-
 int platform_timer_setup(irqreturn_t (*timer_int)(int, void *, struct pt_regs *))
 {
        outb(H8300_TIMER_COUNT_DATA,_8TCORA1);
        outb(0x00,_8TCSR1);
-       request_irq_boot(76,timer_int,0,"timer",0);
+       request_irq(76,timer_int,0,"timer",0);
        outb(0x40|0x08|0x03,_8TCR1);
        return 0;
 }
index 73409bcac4a5bd9e96519b064736f84938e4916c..0e1e66be714aae139ab37a1b9e107906ed0d76e2 100644 (file)
@@ -91,6 +91,8 @@ const static struct irq_pins irq_assign_table1[16]={
        {H8300_GPIO_P2,H8300_GPIO_B6},{H8300_GPIO_P2,H8300_GPIO_B7},
 };
 
+static int use_kmalloc;
+
 extern unsigned long *interrupt_redirect_table;
 
 static inline unsigned long *get_vector_address(void)
@@ -159,22 +161,6 @@ void __init init_IRQ(void)
 #endif
 }
 
-/* special request_irq */
-/* used bootmem allocater */
-void __init request_irq_boot(unsigned int irq, 
-                            irqreturn_t (*handler)(int, void *, struct pt_regs *),
-                             unsigned long flags, const char *devname, void *dev_id)
-{
-       irq_handler_t *irq_handle;
-       irq_handle = alloc_bootmem(sizeof(irq_handler_t));
-       irq_handle->handler = handler;
-       irq_handle->flags   = flags;
-       irq_handle->count   = 0;
-       irq_handle->dev_id  = dev_id;
-       irq_handle->devname = devname;
-       irq_list[irq] = irq_handle;
-}
-
 int request_irq(unsigned int irq,
                irqreturn_t (*handler)(int, void *, struct pt_regs *),
                 unsigned long flags, const char *devname, void *dev_id)
@@ -202,7 +188,14 @@ int request_irq(unsigned int irq,
                H8300_GPIO_DDR(port_no, bit_no, H8300_GPIO_INPUT);
                *(volatile unsigned short *)ISR &= ~ptn; /* ISR clear */
        }               
-       irq_handle = (irq_handler_t *)kmalloc(sizeof(irq_handler_t), GFP_ATOMIC);
+
+       if (use_kmalloc)
+               irq_handle = (irq_handler_t *)kmalloc(sizeof(irq_handler_t), GFP_ATOMIC);
+       else {
+               irq_handle = alloc_bootmem(sizeof(irq_handler_t));
+               (unsigned long)irq_handle |= 0x80000000; /* bootmem allocater */
+       }
+
        if (irq_handle == NULL)
                return -ENOMEM;
 
@@ -243,8 +236,10 @@ void free_irq(unsigned int irq, void *dev_id)
                }
                H8300_GPIO_FREE(port_no, bit_no);
        }
-       kfree(irq_list[irq]);
-       irq_list[irq] = NULL;
+       if (((unsigned long)irq_list[irq] & 0x80000000) == 0) {
+               kfree(irq_list[irq]);
+               irq_list[irq] = NULL;
+       }
 }
 
 unsigned long probe_irq_on (void)
@@ -306,3 +301,10 @@ int show_interrupts(struct seq_file *p, void *v)
 void init_irq_proc(void)
 {
 }
+
+static int __init enable_kmalloc(void)
+{
+       use_kmalloc = 1;
+       return 0;
+}
+__initcall(enable_kmalloc);