diff -Naur uClinux-dist.ref/linux-2.4.x/arch/m68knommu/config.in uClinux-dist/linux-2.4.x/arch/m68knommu/config.in --- uClinux-dist.ref/linux-2.4.x/arch/m68knommu/config.in Thu Mar 21 09:59:41 2002 +++ uClinux-dist/linux-2.4.x/arch/m68knommu/config.in Thu Mar 21 10:04:30 2002 @@ -111,12 +111,6 @@ if [ "$CONFIG_M68VZ328" = "y" ]; then bool 'uCdimm module support' CONFIG_UCDIMM bool 'Dragon Engine II board support' CONFIG_DRAGEN2 - if [ "$CONFIG_DRAGEN2" = "y" ]; then - bool ' Read ETH address from EEPROM' CONFIG_HWADDR_FROMEEPROM - if [ "$CONFIG_HWADDR_FROMEEPROM" = "y" ]; then - int ' Offset from start of EEPROM' CONFIG_HWADDR_OFFSET 2 - fi - fi fi if [ "$CONFIG_UCSIMM" = "y" -o "$CONFIG_UCDIMM" = "y" -o "$CONFIG_DRAGEN2" = "y" ]; then diff -Naur uClinux-dist.ref/linux-2.4.x/arch/m68knommu/platform/68VZ328/de2/config.c uClinux-dist/linux-2.4.x/arch/m68knommu/platform/68VZ328/de2/config.c --- uClinux-dist.ref/linux-2.4.x/arch/m68knommu/platform/68VZ328/de2/config.c Sat Mar 23 10:36:16 2002 +++ uClinux-dist/linux-2.4.x/arch/m68knommu/platform/68VZ328/de2/config.c Sat Mar 23 21:00:27 2002 @@ -18,6 +18,7 @@ #include #include #include +#include #include #include @@ -26,116 +27,7 @@ #include #include -/* - * Port K - FIXME : should be declared in MC68VZ328.h - */ -#define PKDIR_ADDR 0xfffff440 /* Port K direction reg */ -#define PKDATA_ADDR 0xfffff441 /* Port K data register */ -#define PKPUEN_ADDR 0xfffff442 /* Port K Pull-Up enable reg */ -#define PKSEL_ADDR 0xfffff443 /* Port K Select Register */ - -#define PKDIR BYTE_REF(PKDIR_ADDR) -#define PKDATA BYTE_REF(PKDATA_ADDR) -#define PKPUEN BYTE_REF(PKPUEN_ADDR) -#define PKSEL BYTE_REF(PKSEL_ADDR) - -#define RTCTIME_ADDR 0xfffffb00 -#define RTCTIME LONG_REF(RTCTIME_ADDR) - -#define BIT0 0x01 -#define BIT1 0x02 -#define BIT2 0x04 -#define BIT3 0x08 -#define BIT4 0x10 -#define BIT5 0x20 -#define BIT6 0x40 -#define BIT7 0x80 -#define BIT8 0x0100 -#define BIT9 0x0200 -#define BIT10 0x0400 -#define BIT11 0x0800 -#define BIT12 0x1000 -#define BIT13 0x2000 -#define BIT14 0x4000 -#define BIT15 0x8000 - -/* SPI 2 Control/Status register */ -#define SPIDATA2 WORD_REF(0xfffff800) -/* SPI 2 Data register */ -#define SPICONT2 WORD_REF(0xfffff802) - -unsigned char dragen2_cs8900_hwaddr[6]; - -#if defined(CONFIG_HWADDR_FROMEEPROM) - -/* EEPROM commands */ -#define EE_WREN 0x0006 -#define EE_WRDI 0x0004 -#define EE_RDSR 0x0500 -#define EE_WRSR 0x0100 -#define EE_READ 0x0003 -#define EE_WRIT 0x0002 - -#define eepromEnable PDDATA &= ~BIT6 -#define eepromDisable PDDATA |= BIT6 - -unsigned short spi2Exchange(unsigned short data, int bitcount) -{ - unsigned short ret; - - SPICONT2 = BIT9; - SPICONT2 = BIT14|BIT9|((bitcount-1)&15); - SPIDATA2 = data; - SPICONT2 |= BIT8; - while ((SPICONT2&BIT7) == 0); - ret = SPIDATA2; - SPICONT2 = 0; - - return ret; -} - -unsigned char eepromReadStatus(void) -{ - register unsigned char sts; - - eepromEnable; - sts = spi2Exchange(EE_RDSR,16); - eepromDisable; - - return sts; -} - -int eepromWaitReady(void) -{ - int timeout = 1000; - while (timeout && (eepromReadStatus() & 1)) --timeout; - return timeout == 0; -} - -int eepromRead(void *buf, int len, unsigned short addr) -{ - register unsigned short data; - register int i; - - if (eepromWaitReady()) return -1; - - eepromEnable; - (void)spi2Exchange(EE_READ,8); - (void)spi2Exchange(addr,16); - for (i = 0; i < (len>>1); ++i) { - data = spi2Exchange(0,16); - *(char *)buf++ = data>>8; - *(char *)buf++ = data; - } - if (len&1) { - *(char *)buf = spi2Exchange(0,8); - } - eepromDisable; - - return 0; -} - -#endif /* CONFIG_HWADDR_FROMEEPROM */ +#define CLOCK_COMPARE (32768/HZ) static void dragen2_sched_init(void (*timer_routine)(int, void *, struct pt_regs *)) { @@ -147,10 +39,8 @@ /* Restart mode, Enable int, 32KHz */ TCTL = TCTL_OM | TCTL_IRQEN | TCTL_CLKSOURCE_32KHZ; - /* Set prescaler (Divide 32KHz by 32)*/ - TPRER = 31; - /* Set compare register 32Khz / 32 / 10 = 100 */ - TCMP = 10; + TPRER = 0; + TCMP = CLOCK_COMPARE-1; /* Enable timer 1 */ TCTL |= TCTL_TEN; @@ -162,92 +52,90 @@ TSTAT &= 0; } -static int dragen2_hwclk(int op, struct hwclk_time *t) +static unsigned long dragen2_gettimeoffset(void) { - if (!op) { - /* read */ - long now = RTCTIME; - t->hour = (now>>24)&0x1f; - t->min = (now>>16)&0x3f; - t->sec = now&0x3f; - } else { - /* write */ - RTCTIME = (t->hour<<24)+(t->min<<16)+(t->sec); + unsigned long ticks, offset = 0; + + ticks = TCN; + + if (ticks > (CLOCK_COMPARE>>1)) { + /* check for pending interrupt */ + if (ISR & (1<dev_addr, (void *)0x400fffa, 6); + dev->irq = INT1_IRQ_NUM; + return dev->base_addr = 0x08000041; +} +static void init_hardware(void) +{ /* CSGB Init */ CSGBB = 0x4000; CSB = 0x1a1; - /* SPI 2 init */ - SPICONT2 = 0; - PESEL &= ~(BIT2|BIT1|BIT0); - - /* TouchScreen init */ - PESEL |= BIT3; /* select PE3 as I/O */ - PEDIR |= BIT3; /* select Port E bit 3 as output */ - PEDATA |= BIT3; /* set touchScr CS high */ - - /* EEPROM init */ - PDSEL |= BIT6; /* select PD6 as I/O */ - PDDIR |= BIT6; /* select Port D bit 6 as output */ - PDDATA |= BIT6; /* set eeprom CS high */ - /* CS8900 init */ /* PK3: hardware sleep function pin, active low */ - PKSEL |= BIT3; /* select pin as I/O */ - PKDIR |= BIT3; /* select pin as output */ - PKDATA |= BIT3; /* set pin high */ + PKSEL |= PK(3); /* select pin as I/O */ + PKDIR |= PK(3); /* select pin as output */ + PKDATA |= PK(3); /* set pin high */ /* PF5: hardware reset function pin, active high */ - PFSEL |= BIT5; /* select pin as I/O */ - PFDIR |= BIT5; /* select pin as output */ - PFDATA &= ~BIT5; /* set pin low */ + PFSEL |= PF(5); /* select pin as I/O */ + PFDIR |= PF(5); /* select pin as output */ + PFDATA &= ~PF(5); /* set pin low */ /* cs8900 hardware reset */ - PFDATA |= BIT5; + PFDATA |= PF(5); { volatile int i; for (i = 0; i < 32000; ++i); } - PFDATA &= ~BIT5; + PFDATA &= ~PF(5); /* INT1 enable (cs8900 IRQ) */ - PDPOL &= ~BIT1; /* active high signal */ - PDIQEG &= ~BIT1; - PDIRQEN |= BIT1; /* IRQ enabled */ - -#if defined(CONFIG_HWADDR_FROMEEPROM) - /* read ETH address from EEPROM */ - eepromRead(dragen2_cs8900_hwaddr, sizeof dragen2_cs8900_hwaddr, CONFIG_HWADDR_OFFSET); -#else - /* Set the ETH hardware address from the flash monitor location 0x400FFA */ - memcpy(dragen2_cs8900_hwaddr, (void *)0x400fffa, sizeof dragen2_cs8900_hwaddr); + PDPOL &= ~PD(1); /* active high signal */ + PDIQEG &= ~PD(1); + PDIRQEN |= PD(1); /* IRQ enabled */ + +#ifdef CONFIG_68328_SERIAL_UART2 + /* Enable RXD TXD port bits to enable UART2 */ + PJSEL &= ~(PJ(5)|PJ(4)); #endif +} + +void config_BSP(char *command, int len) +{ + void dragen2_trap_init(void); + + printk("68VZ328 DragonBallVZ support (c) 2001 Lineo, Inc.\n"); + command[0] = '\0'; /* no specific boot option */ + + init_hardware(); mach_sched_init = dragen2_sched_init; mach_tick = dragen2_tick; + mach_gettimeoffset = dragen2_gettimeoffset; mach_reset = dragen2_reset; - mach_hwclk = dragen2_hwclk; - - config_dragen2_irq(); + mach_trap_init = dragen2_trap_init; } - diff -Naur uClinux-dist.ref/linux-2.4.x/arch/m68knommu/platform/68VZ328/de2/entry.S uClinux-dist/linux-2.4.x/arch/m68knommu/platform/68VZ328/de2/entry.S --- uClinux-dist.ref/linux-2.4.x/arch/m68knommu/platform/68VZ328/de2/entry.S Thu Jan 1 01:00:00 1970 +++ uClinux-dist/linux-2.4.x/arch/m68knommu/platform/68VZ328/de2/entry.S Tue Mar 19 21:25:20 2002 @@ -0,0 +1,707 @@ +/* -*- mode: asm -*- + * + * linux/arch/m68knommu/platorm/68VZ328/de2/entry.S + * + * Copyright (C) 1991, 1992 Linus Torvalds + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file README.legal in the main directory of this archive + * for more details. + * + * Linux/m68k support by Hamish Macdonald + * DragonEngine board support by Georges Menie + * + */ + +/* + * entry.S contains the system-call and fault low-level handling routines. + * This also contains the timer-interrupt handler, as well as all interrupts + * and faults that can result in a task-switch. + * + * NOTE: This code handles signal-recognition, which happens every time + * after a timer-interrupt and after each system call. + * + */ + +/* + * 12/03/96 Jes: Currently we only support m68k single-cpu systems, so + * all pointers that used to be 'current' are now entry + * number 0 in the 'current_set' list. + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "m68k_defs.h" + +#define IMMED # +#define DBG_PUTC(x) moveb IMMED x,0xfffff907; \ + moveb IMMED '\r',0xfffff907; \ + moveb IMMED '\n',0xfffff907 + +.globl SYMBOL_NAME(system_call), SYMBOL_NAME(buserr), SYMBOL_NAME(trap) +.globl SYMBOL_NAME(exception3), SYMBOL_NAME(exception4), SYMBOL_NAME(exception5) +.globl SYMBOL_NAME(exception6), SYMBOL_NAME(exception7), SYMBOL_NAME(exception8) +.globl SYMBOL_NAME(exception9), SYMBOL_NAME(exception10), SYMBOL_NAME(exception12) +.globl SYMBOL_NAME(exception14), SYMBOL_NAME(exception15) +.globl SYMBOL_NAME(trap1), SYMBOL_NAME(trap15) +.globl SYMBOL_NAME(resume), SYMBOL_NAME(ret_from_exception) +.globl SYMBOL_NAME(ret_from_signal) +.globl SYMBOL_NAME(sys_call_table) +.globl SYMBOL_NAME(sys_fork), SYMBOL_NAME(sys_clone), SYMBOL_NAME(sys_vfork) +.globl SYMBOL_NAME(ret_from_interrupt), SYMBOL_NAME(bad_interrupt) +.globl SYMBOL_NAME(inthandler1), SYMBOL_NAME(inthandler2),SYMBOL_NAME(inthandler3) +.globl SYMBOL_NAME(inthandler4),SYMBOL_NAME(inthandler5),SYMBOL_NAME(inthandler6) +.globl SYMBOL_NAME(inthandler7) + +.text +ENTRY(buserr) + SAVE_ALL_INT 8 + GET_CURRENT(%d0) + movel %sp,%sp@- /* stack frame pointer argument*/ + bsrw SYMBOL_NAME(buserr_c) + addql #4,%sp + jra SYMBOL_NAME(ret_from_exception) + +ENTRY(exception3) + SAVE_ALL_INT 12 + GET_CURRENT(%d0) + movel %sp,%sp@- /* stack frame pointer argument*/ + bsrw SYMBOL_NAME(trap_c) + addql #4,%sp + jra SYMBOL_NAME(ret_from_exception) + +ENTRY(exception4) + SAVE_ALL_INT 16 + GET_CURRENT(%d0) + movel %sp,%sp@- /* stack frame pointer argument*/ + bsrw SYMBOL_NAME(trap_c) + addql #4,%sp + jra SYMBOL_NAME(ret_from_exception) + +ENTRY(exception5) + SAVE_ALL_INT 20 + GET_CURRENT(%d0) + movel %sp,%sp@- /* stack frame pointer argument*/ + bsrw SYMBOL_NAME(trap_c) + addql #4,%sp + jra SYMBOL_NAME(ret_from_exception) + +ENTRY(exception6) + SAVE_ALL_INT 24 + GET_CURRENT(%d0) + movel %sp,%sp@- /* stack frame pointer argument*/ + bsrw SYMBOL_NAME(trap_c) + addql #4,%sp + jra SYMBOL_NAME(ret_from_exception) + +ENTRY(exception7) + SAVE_ALL_INT 28 + GET_CURRENT(%d0) + movel %sp,%sp@- /* stack frame pointer argument*/ + bsrw SYMBOL_NAME(trap_c) + addql #4,%sp + jra SYMBOL_NAME(ret_from_exception) + +ENTRY(exception8) + SAVE_ALL_INT 32 + GET_CURRENT(%d0) + movel %sp,%sp@- /* stack frame pointer argument*/ + bsrw SYMBOL_NAME(trap_c) + addql #4,%sp + jra SYMBOL_NAME(ret_from_exception) + +ENTRY(exception9) + SAVE_ALL_INT 36 + GET_CURRENT(%d0) + movel %sp,%sp@- /* stack frame pointer argument*/ + bsrw SYMBOL_NAME(trap_c) + addql #4,%sp + jra SYMBOL_NAME(ret_from_exception) + +ENTRY(exception10) + SAVE_ALL_INT 40 + GET_CURRENT(%d0) + movel %sp,%sp@- /* stack frame pointer argument*/ + bsrw SYMBOL_NAME(trap_c) + addql #4,%sp + jra SYMBOL_NAME(ret_from_exception) + +ENTRY(exception11) + SAVE_ALL_INT 44 + GET_CURRENT(%d0) + movel %sp,%sp@- /* stack frame pointer argument*/ + bsrw SYMBOL_NAME(trap_c) + addql #4,%sp + jra SYMBOL_NAME(ret_from_exception) + +ENTRY(exception14) + SAVE_ALL_INT 56 + GET_CURRENT(%d0) + movel %sp,%sp@- /* stack frame pointer argument*/ + bsrw SYMBOL_NAME(trap_c) + addql #4,%sp + jra SYMBOL_NAME(ret_from_exception) + +ENTRY(exception15) + SAVE_ALL_INT 60 + GET_CURRENT(%d0) + movel %sp,%sp@- /* stack frame pointer argument*/ + bsrw SYMBOL_NAME(trap_c) + addql #4,%sp + jra SYMBOL_NAME(ret_from_exception) + +ENTRY(trap1) + SAVE_ALL_INT 132 + GET_CURRENT(%d0) + movel %sp,%sp@- /* stack frame pointer argument*/ + bsrw SYMBOL_NAME(trap_c) + addql #4,%sp + jra SYMBOL_NAME(ret_from_exception) + +ENTRY(trap15) + SAVE_ALL_INT 188 + GET_CURRENT(%d0) + movel %sp,%sp@- /* stack frame pointer argument*/ + bsrw SYMBOL_NAME(trap_c) + addql #4,%sp + jra SYMBOL_NAME(ret_from_exception) + +ENTRY(reschedule) + /* save top of frame*/ + movel SYMBOL_NAME(_current_task),%a2 + movel %sp,%a2@(TASK_THREAD+THREAD_ESP0) + + pea SYMBOL_NAME(ret_from_exception) + jmp SYMBOL_NAME(schedule) + + /* After a fork we jump here directly from resume,*/ + /* so that %d1 contains the previous task*/ + /* Theoretically only needed on SMP, but let's watch*/ + /* what happens in schedule_tail() in future...*/ +ENTRY(ret_from_fork) + movel %d1,%sp@- + jsr SYMBOL_NAME(schedule_tail) + addql #4,%sp + jra SYMBOL_NAME(ret_from_exception) + +badsys: + movel #-ENOSYS,%sp@(PT_D0) + jra SYMBOL_NAME(ret_from_exception) + +do_trace: + movel #-ENOSYS,%sp@(PT_D0) /* needed for strace*/ + subql #4,%sp + SAVE_SWITCH_STACK + jbsr SYMBOL_NAME(syscall_trace) + RESTORE_SWITCH_STACK + addql #4,%sp + movel %sp@(PT_ORIG_D0),%d1 + movel #-ENOSYS,%d0 + cmpl #NR_syscalls,%d1 + jcc 1f + lsl #2,%d1 + lea SYMBOL_NAME(sys_call_table), %a0 + jbsr %a0@(%d1) + +1: movel %d0,%sp@(PT_D0) /* save the return value*/ + subql #4,%sp /* dummy return address*/ + SAVE_SWITCH_STACK + jbsr SYMBOL_NAME(syscall_trace) + +SYMBOL_NAME_LABEL(ret_from_signal) + RESTORE_SWITCH_STACK + addql #4,%sp + jra SYMBOL_NAME(ret_from_exception) + +ENTRY(system_call) + SAVE_ALL_SYS 128 + + GET_CURRENT(%d1) + /* save top of frame*/ + movel SYMBOL_NAME(_current_task),%a2 + movel %sp,%a2@(TASK_THREAD+THREAD_ESP0) + + btst #PF_TRACESYS_BIT,%a2@(TASK_FLAGS+PF_TRACESYS_OFF) + jne do_trace + cmpl #NR_syscalls,%d0 + jcc badsys + lsl #2,%d0 + lea SYMBOL_NAME(sys_call_table),%a0 + movel %a0@(%d0), %a0 + jbsr %a0@ + movel %d0,%sp@(PT_D0) /* save the return value*/ + +SYMBOL_NAME_LABEL(ret_from_exception) + btst #5,%sp@(PT_SR) /* check if returning to kernel*/ + bnes 2f /* if so, skip resched, signals*/ + /* only allow interrupts when we are really the last one on the*/ + /* kernel stack, otherwise stack overflow can occur during*/ + /* heavy interupt load*/ + andw #ALLOWINT,%sr + movel SYMBOL_NAME(_current_task),%a2 + tstl %a2@(TASK_NEEDRESCHED) + jne SYMBOL_NAME(reschedule) + /* check for delayed trace*/ + bclr #PF_DTRACE_BIT,%a2@(TASK_FLAGS+PF_DTRACE_OFF) + jne do_delayed_trace +5: + tstl %a2@(TASK_STATE) /* state*/ + jne SYMBOL_NAME(reschedule) + + tstl %a2@(TASK_SIGPENDING) + jne Lsignal_return +2: RESTORE_ALL + +Lsignal_return: + subql #4,%sp /* dummy return address*/ + SAVE_SWITCH_STACK + pea %sp@(SWITCH_STACK_SIZE) + clrl %sp@- + bsrw SYMBOL_NAME(do_signal) + addql #8,%sp + RESTORE_SWITCH_STACK + addql #4,%sp + RESTORE_ALL + +do_delayed_trace: + bclr #7,%sp@(PT_SR) /* clear trace bit in SR*/ + pea 1 /* send SIGTRAP*/ + movel %a2,%sp@- + pea LSIGTRAP + jbsr SYMBOL_NAME(send_sig) + addql #8,%sp + addql #4,%sp + jra 5b + +SYMBOL_NAME_LABEL(inthandler1) + SAVE_ALL_INT 260 + GET_CURRENT(%d0) + addql #1,SYMBOL_NAME(irq_stat)+CPUSTAT_LOCAL_IRQ_COUNT + movel %sp,%sp@- + jbsr SYMBOL_NAME(process_int)/* process the IRQ*/ + addql #4,%sp /* pop parameters off stack*/ + bra SYMBOL_NAME(ret_from_interrupt) + +SYMBOL_NAME_LABEL(inthandler2) + SAVE_ALL_INT 264 + GET_CURRENT(%d0) + addql #1,SYMBOL_NAME(irq_stat)+CPUSTAT_LOCAL_IRQ_COUNT + movel %sp,%sp@- + jbsr SYMBOL_NAME(process_int)/* process the IRQ*/ + addql #4,%sp /* pop parameters off stack*/ + bra SYMBOL_NAME(ret_from_interrupt) + +SYMBOL_NAME_LABEL(inthandler3) + SAVE_ALL_INT 268 + GET_CURRENT(%d0) + addql #1,SYMBOL_NAME(irq_stat)+CPUSTAT_LOCAL_IRQ_COUNT + movel %sp,%sp@- + jbsr SYMBOL_NAME(process_int)/* process the IRQ*/ + addql #4,%sp /* pop parameters off stack*/ + bra SYMBOL_NAME(ret_from_interrupt) + +SYMBOL_NAME_LABEL(inthandler4) + SAVE_ALL_INT 272 + GET_CURRENT(%d0) + addql #1,SYMBOL_NAME(irq_stat)+CPUSTAT_LOCAL_IRQ_COUNT + movel %sp,%sp@- + jbsr SYMBOL_NAME(process_int)/* process the IRQ*/ + addql #4,%sp /* pop parameters off stack*/ + bra SYMBOL_NAME(ret_from_interrupt) + +SYMBOL_NAME_LABEL(inthandler5) + SAVE_ALL_INT 276 + GET_CURRENT(%d0) + addql #1,SYMBOL_NAME(irq_stat)+CPUSTAT_LOCAL_IRQ_COUNT + movel %sp,%sp@- + jbsr SYMBOL_NAME(process_int)/* process the IRQ*/ + addql #4,%sp /* pop parameters off stack*/ + bra SYMBOL_NAME(ret_from_interrupt) + +SYMBOL_NAME_LABEL(inthandler6) + SAVE_ALL_INT 280 + GET_CURRENT(%d0) + addql #1,SYMBOL_NAME(irq_stat)+CPUSTAT_LOCAL_IRQ_COUNT + movel %sp,%sp@- + jbsr SYMBOL_NAME(process_int)/* process the IRQ*/ + addql #4,%sp /* pop parameters off stack*/ +/* bra SYMBOL_NAME(ret_from_interrupt) fall through */ + +SYMBOL_NAME_LABEL(ret_from_interrupt) + subql #1,SYMBOL_NAME(irq_stat)+CPUSTAT_LOCAL_IRQ_COUNT + jeq 1f +2: + RESTORE_ALL +1: + moveb %sp@(PT_SR), %d0 /* Check for nested interrupt.*/ + and #7, %d0 + +#if MAX_NOINT_IPL > 0 + cmpiw #MAX_NOINT_IPL,%d0 +#endif + jhi 2b + /* check if we need to do software interrupts */ + + movel SYMBOL_NAME(irq_stat)+CPUSTAT_SOFTIRQ_PENDING,%d0 + jeq SYMBOL_NAME(ret_from_exception) + + pea SYMBOL_NAME(ret_from_exception) + jra SYMBOL_NAME(do_softirq) + +SYMBOL_NAME_LABEL(inthandler7) + SAVE_ALL_INT 284 + GET_CURRENT(%d0) + addql #1,SYMBOL_NAME(irq_stat)+CPUSTAT_LOCAL_IRQ_COUNT + movel %sp,%sp@- + jbsr SYMBOL_NAME(process_int)/* process the IRQ*/ + addql #4,%sp /* pop parameters off stack*/ + bra SYMBOL_NAME(ret_from_interrupt) + +/* Handler for uninitialized and spurious interrupts */ + +SYMBOL_NAME_LABEL(trap) +SYMBOL_NAME_LABEL(bad_interrupt) + addql #1,SYMBOL_NAME(num_spurious) + rte + +ENTRY(sys_fork) + SAVE_SWITCH_STACK + pea %sp@(SWITCH_STACK_SIZE) + jbsr SYMBOL_NAME(m68k_fork) + addql #4,%sp + RESTORE_SWITCH_STACK + rts + +ENTRY(sys_clone) + SAVE_SWITCH_STACK + pea %sp@(SWITCH_STACK_SIZE) + jbsr SYMBOL_NAME(m68k_clone) + addql #4,%sp + RESTORE_SWITCH_STACK + rts + +ENTRY(sys_vfork) + SAVE_SWITCH_STACK + pea %sp@(SWITCH_STACK_SIZE) + jbsr SYMBOL_NAME(m68k_vfork) + addql #4,%sp + RESTORE_SWITCH_STACK + rts + +ENTRY(sys_sigsuspend) + SAVE_SWITCH_STACK + pea %sp@(SWITCH_STACK_SIZE) + jbsr SYMBOL_NAME(do_sigsuspend) + addql #4,%sp + RESTORE_SWITCH_STACK + rts + +ENTRY(sys_rt_sigsuspend) + SAVE_SWITCH_STACK + pea %sp@(SWITCH_STACK_SIZE) + jbsr SYMBOL_NAME(do_rt_sigsuspend) + addql #4,%sp + RESTORE_SWITCH_STACK + rts + +ENTRY(sys_sigreturn) + SAVE_SWITCH_STACK + jbsr SYMBOL_NAME(do_sigreturn) + RESTORE_SWITCH_STACK + rts + +ENTRY(sys_rt_sigreturn) + SAVE_SWITCH_STACK + jbsr SYMBOL_NAME(do_rt_sigreturn) + RESTORE_SWITCH_STACK + rts + +SYMBOL_NAME_LABEL(resume) + /* + * Beware - when entering resume, prev (the current task) is + * in a0, next (the new task) is in a1,so don't change these + * registers until their contents are no longer needed. + */ + + /* save sr */ + movew %sr,%a0@(TASK_THREAD+THREAD_SR) +#ifdef USE_SFC_DFC + /* save fs (sfc,%dfc) (may be pointing to kernel memory) */ + movec %sfc,%d0 + movew %d0,%a0@(TASK_THREAD+THREAD_FS) +#endif + + /* save non-scratch registers on stack */ + SAVE_SWITCH_STACK + + /* save usp */ + /* it is better to use a movel here instead of a movew 8*) */ + movel %usp,%a2 + movel %a2,%a0@(TASK_THREAD+THREAD_USP) + + /* save current kernel stack pointer */ + movel %sp,%a0@(TASK_THREAD+THREAD_KSP) + + /* Return previous task in %d1 */ + movel SYMBOL_NAME(_current_task),%d1 + + /* switch to new task (a1 contains new task) */ + movel %a1, SYMBOL_NAME(_current_task) + + /* restore the kernel stack pointer */ + movel %a1@(TASK_THREAD+THREAD_KSP),%sp + + /* restore non-scratch registers */ + RESTORE_SWITCH_STACK + + /* restore user stack pointer */ + movel %a1@(TASK_THREAD+THREAD_USP),%a0 + movel %a0,%usp + +#ifdef USE_SFC_DFC + /* restore fs (sfc,%dfc) */ + movew %a1@(TASK_THREAD+THREAD_FS),%a0 + movec %a0,%sfc + movec %a0,%dfc +#endif + /* restore status register */ + movew %a1@(TASK_THREAD+THREAD_SR),%sr + + rts + + +.data +ALIGN +SYMBOL_NAME_LABEL(sys_call_table) + .long SYMBOL_NAME(sys_ni_syscall) /* 0 - old "setup()" system call*/ + .long SYMBOL_NAME(sys_exit) + .long SYMBOL_NAME(sys_fork) + .long SYMBOL_NAME(sys_read) + .long SYMBOL_NAME(sys_write) + .long SYMBOL_NAME(sys_open) /* 5 */ + .long SYMBOL_NAME(sys_close) + .long SYMBOL_NAME(sys_waitpid) + .long SYMBOL_NAME(sys_creat) + .long SYMBOL_NAME(sys_link) + .long SYMBOL_NAME(sys_unlink) /* 10 */ + .long SYMBOL_NAME(sys_execve) + .long SYMBOL_NAME(sys_chdir) + .long SYMBOL_NAME(sys_time) + .long SYMBOL_NAME(sys_mknod) + .long SYMBOL_NAME(sys_chmod) /* 15 */ + .long SYMBOL_NAME(sys_chown16) + .long SYMBOL_NAME(sys_ni_syscall) /* old break syscall holder */ + .long SYMBOL_NAME(sys_stat) + .long SYMBOL_NAME(sys_lseek) + .long SYMBOL_NAME(sys_getpid) /* 20 */ + .long SYMBOL_NAME(sys_mount) + .long SYMBOL_NAME(sys_oldumount) + .long SYMBOL_NAME(sys_setuid16) + .long SYMBOL_NAME(sys_getuid16) + .long SYMBOL_NAME(sys_stime) /* 25 */ + .long SYMBOL_NAME(sys_ptrace) + .long SYMBOL_NAME(sys_alarm) + .long SYMBOL_NAME(sys_fstat) + .long SYMBOL_NAME(sys_pause) + .long SYMBOL_NAME(sys_utime) /* 30 */ + .long SYMBOL_NAME(sys_ni_syscall) /* old stty syscall holder */ + .long SYMBOL_NAME(sys_ni_syscall) /* old gtty syscall holder */ + .long SYMBOL_NAME(sys_access) + .long SYMBOL_NAME(sys_nice) + .long SYMBOL_NAME(sys_ni_syscall) /* 35 */ /* old ftime syscall holder */ + .long SYMBOL_NAME(sys_sync) + .long SYMBOL_NAME(sys_kill) + .long SYMBOL_NAME(sys_rename) + .long SYMBOL_NAME(sys_mkdir) + .long SYMBOL_NAME(sys_rmdir) /* 40 */ + .long SYMBOL_NAME(sys_dup) + .long SYMBOL_NAME(sys_pipe) + .long SYMBOL_NAME(sys_times) + .long SYMBOL_NAME(sys_ni_syscall) /* old prof syscall holder */ + .long SYMBOL_NAME(sys_brk) /* 45 */ + .long SYMBOL_NAME(sys_setgid16) + .long SYMBOL_NAME(sys_getgid16) + .long SYMBOL_NAME(sys_signal) + .long SYMBOL_NAME(sys_geteuid16) + .long SYMBOL_NAME(sys_getegid16) /* 50 */ + .long SYMBOL_NAME(sys_acct) + .long SYMBOL_NAME(sys_umount) /* recycled never used phys() */ + .long SYMBOL_NAME(sys_ni_syscall) /* old lock syscall holder */ + .long SYMBOL_NAME(sys_ioctl) + .long SYMBOL_NAME(sys_fcntl) /* 55 */ + .long SYMBOL_NAME(sys_ni_syscall) /* old mpx syscall holder */ + .long SYMBOL_NAME(sys_setpgid) + .long SYMBOL_NAME(sys_ni_syscall) /* old ulimit syscall holder */ + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_umask) /* 60 */ + .long SYMBOL_NAME(sys_chroot) + .long SYMBOL_NAME(sys_ustat) + .long SYMBOL_NAME(sys_dup2) + .long SYMBOL_NAME(sys_getppid) + .long SYMBOL_NAME(sys_getpgrp) /* 65 */ + .long SYMBOL_NAME(sys_setsid) + .long SYMBOL_NAME(sys_sigaction) + .long SYMBOL_NAME(sys_sgetmask) + .long SYMBOL_NAME(sys_ssetmask) + .long SYMBOL_NAME(sys_setreuid16) /* 70 */ + .long SYMBOL_NAME(sys_setregid16) + .long SYMBOL_NAME(sys_sigsuspend) + .long SYMBOL_NAME(sys_sigpending) + .long SYMBOL_NAME(sys_sethostname) + .long SYMBOL_NAME(sys_setrlimit) /* 75 */ + .long SYMBOL_NAME(sys_old_getrlimit) + .long SYMBOL_NAME(sys_getrusage) + .long SYMBOL_NAME(sys_gettimeofday) + .long SYMBOL_NAME(sys_settimeofday) + .long SYMBOL_NAME(sys_getgroups16) /* 80 */ + .long SYMBOL_NAME(sys_setgroups16) + .long SYMBOL_NAME(old_select) + .long SYMBOL_NAME(sys_symlink) + .long SYMBOL_NAME(sys_lstat) + .long SYMBOL_NAME(sys_readlink) /* 85 */ + .long SYMBOL_NAME(sys_uselib) + .long SYMBOL_NAME(sys_swapon) + .long SYMBOL_NAME(sys_reboot) + .long SYMBOL_NAME(old_readdir) + .long SYMBOL_NAME(old_mmap) /* 90 */ + .long SYMBOL_NAME(sys_munmap) + .long SYMBOL_NAME(sys_truncate) + .long SYMBOL_NAME(sys_ftruncate) + .long SYMBOL_NAME(sys_fchmod) + .long SYMBOL_NAME(sys_fchown16) /* 95 */ + .long SYMBOL_NAME(sys_getpriority) + .long SYMBOL_NAME(sys_setpriority) + .long SYMBOL_NAME(sys_ni_syscall) /* old profil syscall holder */ + .long SYMBOL_NAME(sys_statfs) + .long SYMBOL_NAME(sys_fstatfs) /* 100 */ + .long SYMBOL_NAME(sys_ioperm) + .long SYMBOL_NAME(sys_socketcall) + .long SYMBOL_NAME(sys_syslog) + .long SYMBOL_NAME(sys_setitimer) + .long SYMBOL_NAME(sys_getitimer) /* 105 */ + .long SYMBOL_NAME(sys_newstat) + .long SYMBOL_NAME(sys_newlstat) + .long SYMBOL_NAME(sys_newfstat) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) /* iopl for i386 */ /* 110 */ + .long SYMBOL_NAME(sys_vhangup) + .long SYMBOL_NAME(sys_ni_syscall) /* obsolete idle() syscall */ + .long SYMBOL_NAME(sys_ni_syscall) /* vm86old for i386 */ + .long SYMBOL_NAME(sys_wait4) + .long SYMBOL_NAME(sys_swapoff) /* 115 */ + .long SYMBOL_NAME(sys_sysinfo) + .long SYMBOL_NAME(sys_ipc) + .long SYMBOL_NAME(sys_fsync) + .long SYMBOL_NAME(sys_sigreturn) + .long SYMBOL_NAME(sys_clone) /* 120 */ + .long SYMBOL_NAME(sys_setdomainname) + .long SYMBOL_NAME(sys_newuname) + .long SYMBOL_NAME(sys_cacheflush) /* modify_ldt for i386 */ + .long SYMBOL_NAME(sys_adjtimex) + .long SYMBOL_NAME(sys_mprotect) /* 125 */ + .long SYMBOL_NAME(sys_sigprocmask) + .long SYMBOL_NAME(sys_create_module) + .long SYMBOL_NAME(sys_init_module) + .long SYMBOL_NAME(sys_delete_module) + .long SYMBOL_NAME(sys_get_kernel_syms) /* 130 */ + .long SYMBOL_NAME(sys_quotactl) + .long SYMBOL_NAME(sys_getpgid) + .long SYMBOL_NAME(sys_fchdir) + .long SYMBOL_NAME(sys_bdflush) + .long SYMBOL_NAME(sys_sysfs) /* 135 */ + .long SYMBOL_NAME(sys_personality) + .long SYMBOL_NAME(sys_ni_syscall) /* for afs_syscall */ + .long SYMBOL_NAME(sys_setfsuid16) + .long SYMBOL_NAME(sys_setfsgid16) + .long SYMBOL_NAME(sys_llseek) /* 140 */ + .long SYMBOL_NAME(sys_getdents) + .long SYMBOL_NAME(sys_select) + .long SYMBOL_NAME(sys_flock) + .long SYMBOL_NAME(sys_msync) + .long SYMBOL_NAME(sys_readv) /* 145 */ + .long SYMBOL_NAME(sys_writev) + .long SYMBOL_NAME(sys_getsid) + .long SYMBOL_NAME(sys_fdatasync) + .long SYMBOL_NAME(sys_sysctl) + .long SYMBOL_NAME(sys_mlock) /* 150 */ + .long SYMBOL_NAME(sys_munlock) + .long SYMBOL_NAME(sys_mlockall) + .long SYMBOL_NAME(sys_munlockall) + .long SYMBOL_NAME(sys_sched_setparam) + .long SYMBOL_NAME(sys_sched_getparam) /* 155 */ + .long SYMBOL_NAME(sys_sched_setscheduler) + .long SYMBOL_NAME(sys_sched_getscheduler) + .long SYMBOL_NAME(sys_sched_yield) + .long SYMBOL_NAME(sys_sched_get_priority_max) + .long SYMBOL_NAME(sys_sched_get_priority_min) /* 160 */ + .long SYMBOL_NAME(sys_sched_rr_get_interval) + .long SYMBOL_NAME(sys_nanosleep) + .long SYMBOL_NAME(sys_mremap) + .long SYMBOL_NAME(sys_setresuid16) + .long SYMBOL_NAME(sys_getresuid16) /* 165 */ + .long SYMBOL_NAME(sys_ni_syscall) /* for vm86 */ + .long SYMBOL_NAME(sys_query_module) + .long SYMBOL_NAME(sys_poll) + .long SYMBOL_NAME(sys_nfsservctl) + .long SYMBOL_NAME(sys_setresgid16) /* 170 */ + .long SYMBOL_NAME(sys_getresgid16) + .long SYMBOL_NAME(sys_prctl) + .long SYMBOL_NAME(sys_rt_sigreturn) + .long SYMBOL_NAME(sys_rt_sigaction) + .long SYMBOL_NAME(sys_rt_sigprocmask) /* 175 */ + .long SYMBOL_NAME(sys_rt_sigpending) + .long SYMBOL_NAME(sys_rt_sigtimedwait) + .long SYMBOL_NAME(sys_rt_sigqueueinfo) + .long SYMBOL_NAME(sys_rt_sigsuspend) + .long SYMBOL_NAME(sys_pread) /* 180 */ + .long SYMBOL_NAME(sys_pwrite) + .long SYMBOL_NAME(sys_lchown16); + .long SYMBOL_NAME(sys_getcwd) + .long SYMBOL_NAME(sys_capget) + .long SYMBOL_NAME(sys_capset) /* 185 */ + .long SYMBOL_NAME(sys_sigaltstack) + .long SYMBOL_NAME(sys_sendfile) + .long SYMBOL_NAME(sys_ni_syscall) /* streams1 */ + .long SYMBOL_NAME(sys_ni_syscall) /* streams2 */ + .long SYMBOL_NAME(sys_vfork) /* 190 */ + .long SYMBOL_NAME(sys_getrlimit) + .long SYMBOL_NAME(sys_mmap2) + .long SYMBOL_NAME(sys_truncate64) + .long SYMBOL_NAME(sys_ftruncate64) + .long SYMBOL_NAME(sys_stat64) /* 195 */ + .long SYMBOL_NAME(sys_lstat64) + .long SYMBOL_NAME(sys_fstat64) + .long SYMBOL_NAME(sys_chown) + .long SYMBOL_NAME(sys_getuid) + .long SYMBOL_NAME(sys_getgid) /* 200 */ + .long SYMBOL_NAME(sys_geteuid) + .long SYMBOL_NAME(sys_getegid) + .long SYMBOL_NAME(sys_setreuid) + .long SYMBOL_NAME(sys_setregid) + .long SYMBOL_NAME(sys_getgroups) /* 205 */ + .long SYMBOL_NAME(sys_setgroups) + .long SYMBOL_NAME(sys_fchown) + .long SYMBOL_NAME(sys_setresuid) + .long SYMBOL_NAME(sys_getresuid) + .long SYMBOL_NAME(sys_setresgid) /* 210 */ + .long SYMBOL_NAME(sys_getresgid) + .long SYMBOL_NAME(sys_lchown) + .long SYMBOL_NAME(sys_setuid) + .long SYMBOL_NAME(sys_setgid) + .long SYMBOL_NAME(sys_setfsuid) /* 215 */ + .long SYMBOL_NAME(sys_setfsgid) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_getdents64) /* 220 */ + + .rept NR_syscalls-(.-SYMBOL_NAME(sys_call_table))/4 + .long SYMBOL_NAME(sys_ni_syscall) + .endr diff -Naur uClinux-dist.ref/linux-2.4.x/arch/m68knommu/platform/68VZ328/de2/ints.c uClinux-dist/linux-2.4.x/arch/m68knommu/platform/68VZ328/de2/ints.c --- uClinux-dist.ref/linux-2.4.x/arch/m68knommu/platform/68VZ328/de2/ints.c Thu Mar 21 09:59:41 2002 +++ uClinux-dist/linux-2.4.x/arch/m68knommu/platform/68VZ328/de2/ints.c Thu Mar 21 10:12:33 2002 @@ -7,6 +7,8 @@ * * Copyright 1996 Roman Zippel * Copyright 1999 D. Jeff Dionne + * Copyright 2002 Georges Menie + * */ #include @@ -20,287 +22,179 @@ #include #include #include - #include -#define INTERNAL_IRQS (32) - -/* assembler routines */ -asmlinkage void buserr(void); -asmlinkage void exception3(void); -asmlinkage void exception4(void); -asmlinkage void exception5(void); -asmlinkage void exception6(void); -asmlinkage void exception7(void); -asmlinkage void exception8(void); -asmlinkage void exception9(void); -asmlinkage void exception10(void); -asmlinkage void exception11(void); -asmlinkage void exception14(void); -asmlinkage void exception15(void); -asmlinkage void bad_interrupt(void); -asmlinkage void inthandler1(void); -asmlinkage void inthandler2(void); -asmlinkage void inthandler3(void); -asmlinkage void inthandler4(void); -asmlinkage void inthandler5(void); -asmlinkage void inthandler6(void); -asmlinkage void inthandler7(void); -asmlinkage void system_call(void); -asmlinkage void trap1(void); -asmlinkage void trap15(void); - -// extern void *_ramvec[]; -extern e_vector *_ramvec; +#include "traps_proto.h" /* irq node variables for the 32 (potential) on chip sources */ -static irq_node_t *int_irq_list[INTERNAL_IRQS]; - +#define INTERNAL_IRQS 32 +static irq_node_t int_irq_list[INTERNAL_IRQS]; static int int_irq_count[INTERNAL_IRQS]; -static short int_irq_ablecount[INTERNAL_IRQS]; -static void int_badint(int irq, void *dev_id, struct pt_regs *fp) -{ - num_spurious += 1; -} +/* The number of spurious interrupts */ +volatile unsigned int num_spurious; /* * This function should be called during kernel startup to initialize * the IRQ handling routines. */ -static void dragen2_init_IRQ(void) +void init_IRQ(void) { int i; - /* set up the vectors */ - for (i=2; i < 32; ++i) - _ramvec[i] = bad_interrupt; - - _ramvec[2] = buserr; - _ramvec[3] = exception3; - _ramvec[4] = exception4; - _ramvec[5] = exception5; - _ramvec[6] = exception6; - _ramvec[7] = exception7; - _ramvec[8] = exception8; - _ramvec[9] = exception9; - _ramvec[10] = exception10; - _ramvec[11] = exception11; - _ramvec[14] = exception14; - _ramvec[15] = exception15; - _ramvec[32] = system_call; - _ramvec[33] = trap1; - _ramvec[47] = trap15; - - _ramvec[64] = bad_interrupt; - _ramvec[65] = inthandler1; - _ramvec[66] = inthandler2; - _ramvec[67] = inthandler3; - _ramvec[68] = inthandler4; - _ramvec[69] = inthandler5; - _ramvec[70] = inthandler6; - _ramvec[71] = inthandler7; - - IVR = 0x40; /* Set DragonBall IVR (interrupt base) to 64 */ - - /* initialize handlers */ for (i = 0; i < INTERNAL_IRQS; i++) { - int_irq_list[i] = NULL; - - int_irq_ablecount[i] = 0; + int_irq_list[i].handler = NULL; int_irq_count[i] = 0; } + /* turn off all interrupts */ IMR = ~0; } -static int dragen2_request_irq(unsigned int irq, void (*handler)(int, void *, struct pt_regs *), - unsigned long flags, const char *devname, void *dev_id) +int request_irq(unsigned int irq, void (*handler)(int, void *, struct pt_regs *), + unsigned long flags, const char *devname, void *dev_id) { if (irq >= INTERNAL_IRQS) { printk ("%s: Unknown IRQ %d from %s\n", __FUNCTION__, irq, devname); return -ENXIO; } - if (!int_irq_list[irq]) { - int_irq_list[irq] = new_irq_node(); - int_irq_list[irq]->flags = IRQ_FLG_STD; - } - - if (!(int_irq_list[irq]->flags & IRQ_FLG_STD)) { - if (int_irq_list[irq]->flags & IRQ_FLG_LOCK) { + if (!(int_irq_list[irq].flags & IRQ_FLG_STD)) { + if (int_irq_list[irq].flags & IRQ_FLG_LOCK) { printk("%s: IRQ %d from %s is not replaceable\n", - __FUNCTION__, irq, int_irq_list[irq]->devname); + __FUNCTION__, irq, int_irq_list[irq].devname); return -EBUSY; } if (flags & IRQ_FLG_REPLACE) { printk("%s: %s can't replace IRQ %d from %s\n", - __FUNCTION__, devname, irq, int_irq_list[irq]->devname); + __FUNCTION__, devname, irq, int_irq_list[irq].devname); return -EBUSY; } } - int_irq_list[irq]->handler = handler; - int_irq_list[irq]->flags = flags; - int_irq_list[irq]->dev_id = dev_id; - int_irq_list[irq]->devname = devname; - - /* enable in the IMR */ - if (!int_irq_ablecount[irq]) - *(volatile unsigned long *)0xfffff304 &= ~(1<= INTERNAL_IRQS) { printk ("%s: Unknown IRQ %d\n", __FUNCTION__, irq); return; } - if (int_irq_list[irq]->dev_id != dev_id) + if (int_irq_list[irq].dev_id != dev_id) printk("%s: removing probably wrong IRQ %d from %s\n", - __FUNCTION__, irq, int_irq_list[irq]->devname); - int_irq_list[irq]->handler = int_badint; - int_irq_list[irq]->flags = IRQ_FLG_STD; - int_irq_list[irq]->dev_id = NULL; - int_irq_list[irq]->devname = NULL; + __FUNCTION__, irq, int_irq_list[irq].devname); - *(volatile unsigned long *)0xfffff304 |= 1<= INTERNAL_IRQS) { - printk("%s: Unknown IRQ %d\n", __FUNCTION__, irq); - return; - } - - if (--int_irq_ablecount[irq]) - return; + int i, len = 0; - /* enable the interrupt */ - *(volatile unsigned long *)0xfffff304 &= ~(1<= INTERNAL_IRQS) { - printk("%s: Unknown IRQ %d\n", __FUNCTION__, irq); - return; - } - - if (int_irq_ablecount[irq]++) - return; + return 0; +} - /* disable the interrupt */ - *(volatile unsigned long *)0xfffff304 |= 1<handler) { - int_irq_list[irq]->handler(irq, int_irq_list[irq]->dev_id, fp); +#if NR_IRQS >= INTERNAL_IRQS + ++kstat.irqs[0][irq]; +#endif + if (int_irq_list[irq].handler) { + int_irq_list[irq].handler(irq, int_irq_list[irq].dev_id, &fp->ptregs); int_irq_count[irq]++; } else { + ++num_spurious; printk("unregistered interrupt %d!\nTurning it off in the IMR...\n", irq); - *(volatile unsigned long *)0xfffff304 |= mask; + IMR |= mask; } pend &= ~mask; } -} - -static int dragen2_get_irq_list(char *buf) -{ - int i, len = 0; - irq_node_t *node; - - len += sprintf(buf+len, "Internal 68VZ328 interrupts\n"); - - for (i = 0; i < INTERNAL_IRQS; i++) { - if (!(node = int_irq_list[i])) - continue; - if (!(node->handler)) - continue; - - len += sprintf(buf+len, " %2d: %10u %s\n", i, - int_irq_count[i], int_irq_list[i]->devname); - } - return len; -} - -void config_dragen2_irq(void) -{ - mach_default_handler = NULL; - mach_init_IRQ = dragen2_init_IRQ; - mach_request_irq = dragen2_request_irq; - mach_free_irq = dragen2_free_irq; - mach_enable_irq = dragen2_enable_irq; - mach_disable_irq = dragen2_disable_irq; - mach_get_irq_list = dragen2_get_irq_list; - mach_process_int = dragen2_do_irq; } diff -Naur uClinux-dist.ref/linux-2.4.x/arch/m68knommu/platform/68VZ328/de2/traps.c uClinux-dist/linux-2.4.x/arch/m68knommu/platform/68VZ328/de2/traps.c --- uClinux-dist.ref/linux-2.4.x/arch/m68knommu/platform/68VZ328/de2/traps.c Thu Jan 1 01:00:00 1970 +++ uClinux-dist/linux-2.4.x/arch/m68knommu/platform/68VZ328/de2/traps.c Tue Mar 19 21:28:10 2002 @@ -0,0 +1,72 @@ +/* + * linux/arch/m68knommu/platform/MC68VZ328/de2/traps.c -- general exception handling code + * + * Cloned from Linux/m68k. + * + * No original Copyright holder listed, + * Probabily original (C) Roman Zippel (assigned DJD, 1999) + * + * Copyright 1999-2000 D. Jeff Dionne, + * Copyright 2000-2001 Lineo, Inc. D. Jeff Dionne + * Copyright 2002 Georges Menie + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file COPYING in the main directory of this archive + * for more details. + * + */ + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "traps_proto.h" + +extern e_vector *_ramvec; + +void dragen2_trap_init(void) +{ + int i; + + /* set up the vectors */ + for (i=2; i < 32; ++i) + _ramvec[i] = bad_interrupt; + + _ramvec[2] = buserr; + _ramvec[3] = exception3; + _ramvec[4] = exception4; + _ramvec[5] = exception5; + _ramvec[6] = exception6; + _ramvec[7] = exception7; + _ramvec[8] = exception8; + _ramvec[9] = exception9; + _ramvec[10] = exception10; + _ramvec[11] = exception11; + + _ramvec[14] = exception14; + _ramvec[15] = exception15; + + _ramvec[32] = system_call; + _ramvec[33] = trap1; + + _ramvec[47] = trap15; + + _ramvec[64] = bad_interrupt; + _ramvec[65] = inthandler1; + _ramvec[66] = inthandler2; + _ramvec[67] = inthandler3; + _ramvec[68] = inthandler4; + _ramvec[69] = inthandler5; + _ramvec[70] = inthandler6; + _ramvec[71] = inthandler7; + + IVR = 0x40; /* Set interrupt base to 64 */ +} diff -Naur uClinux-dist.ref/linux-2.4.x/arch/m68knommu/platform/68VZ328/de2/traps_proto.h uClinux-dist/linux-2.4.x/arch/m68knommu/platform/68VZ328/de2/traps_proto.h --- uClinux-dist.ref/linux-2.4.x/arch/m68knommu/platform/68VZ328/de2/traps_proto.h Thu Jan 1 01:00:00 1970 +++ uClinux-dist/linux-2.4.x/arch/m68knommu/platform/68VZ328/de2/traps_proto.h Tue Mar 19 21:28:24 2002 @@ -0,0 +1,23 @@ +asmlinkage void buserr(void); +asmlinkage void exception3(void); +asmlinkage void exception4(void); +asmlinkage void exception5(void); +asmlinkage void exception6(void); +asmlinkage void exception7(void); +asmlinkage void exception8(void); +asmlinkage void exception9(void); +asmlinkage void exception10(void); +asmlinkage void exception11(void); +asmlinkage void exception14(void); +asmlinkage void exception15(void); +asmlinkage void bad_interrupt(void); +asmlinkage void inthandler1(void); +asmlinkage void inthandler2(void); +asmlinkage void inthandler3(void); +asmlinkage void inthandler4(void); +asmlinkage void inthandler5(void); +asmlinkage void inthandler6(void); +asmlinkage void inthandler7(void); +asmlinkage void system_call(void); +asmlinkage void trap1(void); +asmlinkage void trap15(void); diff -Naur uClinux-dist.ref/linux-2.4.x/drivers/net/cs89x0.c uClinux-dist/linux-2.4.x/drivers/net/cs89x0.c --- uClinux-dist.ref/linux-2.4.x/drivers/net/cs89x0.c Fri Jan 4 06:00:51 2002 +++ uClinux-dist/linux-2.4.x/drivers/net/cs89x0.c Sat Mar 23 21:21:44 2002 @@ -187,8 +187,6 @@ static unsigned int netcard_portlist[] __initdata = { 0x10200300, 0 }; #elif defined(CONFIG_UCSIMM) || defined(CONFIG_UCDIMM) static unsigned int netcard_portlist[] __initdata = { 0x10000300, 0 }; -#elif defined(CONFIG_DRAGEN2) -static unsigned int netcard_portlist[] __initdata = { 0x08000041, 0 }; #elif defined(CONFIG_EZ328LCD) || defined(CONFIG_VZ328LCD) static unsigned int netcard_portlist[] __initdata = { 0x2000300, 0 }; #elif defined(CONFIG_ARCH_CLPS7500) @@ -307,6 +305,13 @@ #endif int base_addr = dev ? dev->base_addr : 0; +#if defined(CONFIG_DRAGEN2) + if (dev) { + extern int dragen2_cs8900_setup(struct net_device *dev); + base_addr = dragen2_cs8900_setup(dev); + } else base_addr = 1; +#endif + SET_MODULE_OWNER(dev); if (net_debug) @@ -499,9 +504,6 @@ #if defined( CONFIG_UCSIMM ) || defined( CONFIG_EZ328LCD ) || defined( CONFIG_UCDIMM ) dev->irq = IRQ5_IRQ_NUM; #endif -#if defined(CONFIG_DRAGEN2) - dev->irq = INT1_IRQ_NUM; -#endif /* get the chip type */ rev_type = readreg(dev, PRODUCT_ID_ADD); @@ -1709,10 +1711,6 @@ #if defined( CONFIG_UCSIMM ) || defined(CONFIG_UCDIMM) extern unsigned char *cs8900a_hwaddr; memcpy(dev->dev_addr, cs8900a_hwaddr, 6); -#endif -#if defined(CONFIG_DRAGEN2) - extern unsigned char dragen2_cs8900_hwaddr[]; - memcpy(dev->dev_addr, dragen2_cs8900_hwaddr, 6); #endif #ifdef CONFIG_EZ328LCD dev->dev_addr[0] = 0x00; diff -Naur uClinux-dist.ref/linux-2.4.x/include/asm-m68knommu/param.h uClinux-dist/linux-2.4.x/include/asm-m68knommu/param.h --- uClinux-dist.ref/linux-2.4.x/include/asm-m68knommu/param.h Sat Mar 23 10:10:15 2002 +++ uClinux-dist/linux-2.4.x/include/asm-m68knommu/param.h Sat Mar 23 21:28:07 2002 @@ -25,7 +25,11 @@ #endif #ifdef CONFIG_M68VZ328 +#ifdef CONFIG_DRAGEN2 +#define HZ 128 +#else #define HZ 100 +#endif #endif #ifdef CONFIG_SHGLCORE