You can subscribe to this list here.
2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(6) |
Sep
(2) |
Oct
(43) |
Nov
(4) |
Dec
(12) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(78) |
Feb
(97) |
Mar
(29) |
Apr
(2) |
May
(22) |
Jun
(38) |
Jul
(11) |
Aug
(27) |
Sep
(40) |
Oct
(2) |
Nov
(17) |
Dec
(8) |
2002 |
Jan
|
Feb
(2) |
Mar
(1) |
Apr
(480) |
May
(456) |
Jun
(12) |
Jul
|
Aug
(1) |
Sep
|
Oct
(18) |
Nov
(3) |
Dec
(6) |
2003 |
Jan
|
Feb
(18) |
Mar
(1) |
Apr
|
May
(6) |
Jun
(147) |
Jul
(7) |
Aug
(3) |
Sep
(235) |
Oct
(10) |
Nov
(2) |
Dec
(1) |
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Dave A. <ai...@us...> - 2001-04-11 21:51:39
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/vax/mm In directory usw-pr-cvs1:/tmp/cvs-serv22005 Modified Files: pgtable.c Log Message: implemented check_pgt_cache Index: pgtable.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/vax/mm/pgtable.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- pgtable.c 2001/02/15 01:26:58 1.3 +++ pgtable.c 2001/04/11 21:51:36 1.4 @@ -38,9 +38,20 @@ flush_tlb_all(); } -int do_check_pgt_cache(int low_water, int high_water) +int do_check_pgt_cache(int low, int high) { - /* FIXME: implement this */ - return 0; + /* implemented like everyone else has - D.A. */ + int freed = 0; + if(pgtable_cache_size > high) { + do { + if(pgd_quicklist) + free_pgd_slow(get_pgd_fast()), freed++; + if(pmd_quicklist) + free_pmd_slow(get_pmd_fast()), freed++; + if(pte_quicklist) + free_pte_slow(get_pte_fast()), freed++; + } while(pgtable_cache_size > low); + } + return freed; } |
From: Dave A. <ai...@us...> - 2001-04-11 21:36:57
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/vax/mm In directory usw-pr-cvs1:/tmp/cvs-serv19515 Modified Files: fault.c Log Message: hmm how did we ever miss this ... wrong args to handle_mm_fault Index: fault.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/vax/mm/fault.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- fault.c 2001/03/14 23:08:49 1.3 +++ fault.c 2001/04/11 21:36:53 1.4 @@ -53,7 +53,7 @@ struct mm_struct *mm = NULL; unsigned fixup; - printk("mmfault: fault at %p\n", address); + printk("mmfault: fault at %8X\n", address); /* This check, and the mm != NULL checks later, will be removed later, once we actually have a 'current' properly defined */ if (tsk != NULL) { @@ -90,7 +90,7 @@ } survive: { - int fault = handle_mm_fault(current, vma, address, reason & REASON_WRITE); + int fault = handle_mm_fault(mm, vma, address, reason & REASON_WRITE); if (!fault) goto do_sigbus; if (fault < 0) |
From: Dave A. <ai...@us...> - 2001-03-14 23:06:50
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/vax/mm In directory usw-pr-cvs1:/tmp/cvs-serv1798/mm Modified Files: fault.c Log Message: make fault.c look more like everyone elses Index: fault.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/vax/mm/fault.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- fault.c 2001/01/29 01:00:48 1.2 +++ fault.c 2001/03/14 23:08:49 1.3 @@ -20,6 +20,7 @@ #include <linux/reboot.h> #include <linux/smp.h> #include <linux/smp_lock.h> +#include <asm/hardirq.h> #include <asm/system.h> #include <asm/uaccess.h> @@ -48,20 +49,23 @@ unsigned long address = info->addr; unsigned int reason = info->reason; struct vm_area_struct * vma; + struct task_struct *tsk = current; struct mm_struct *mm = NULL; unsigned fixup; + printk("mmfault: fault at %p\n", address); /* This check, and the mm != NULL checks later, will be removed later, once we actually have a 'current' properly defined */ - if (current != NULL) { - mm = current->mm; + if (tsk != NULL) { + mm = tsk->mm; } - if (mm != NULL) { - down(&mm->mmap_sem); - } - - lock_kernel(); + /* If we're in an interrupt context, or have no user context, + we must not take the fault. */ + if (in_interrupt() || !mm) + goto no_context; + + down (&mm->mmap_sem); vma = find_vma(mm, address); if (!vma) goto bad_area; @@ -93,8 +97,6 @@ goto out_of_memory; } up(&mm->mmap_sem); - out_unlock: - unlock_kernel(); return; /* @@ -102,20 +104,19 @@ * Fix it, but check if it's kernel or user first.. */ bad_area: - if (mm != NULL) { - up(&mm->mmap_sem); - } + up(&mm->mmap_sem); if (user_mode(regs)) { + printk("do_page_fault: sending SIGSEGV\n"); force_sig(SIGSEGV, current); - goto out_unlock; + return; } no_context: /* Are we prepared to handle this fault as an exception? */ if ((fixup = search_exception_table(regs->pc)) != 0) { regs->pc = fixup; - goto out_unlock; + return; } /* @@ -165,7 +166,7 @@ /* Kernel mode? Handle exceptions or die */ if (!user_mode(regs)) goto no_context; - goto out_unlock; + } /* This is the access violation handler */ @@ -209,8 +210,9 @@ accvios in the page fault handler. It will have to go eventually as it's not SMP safe */ if (!active) { - active = 1; + /* active = 1;*/ do_page_fault(info, regs); + printk("finished fault\n"); active = 0; } else { |
From: Dave A. <ai...@us...> - 2001-03-14 22:34:56
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/vax/lib In directory usw-pr-cvs1:/tmp/cvs-serv30067 Modified Files: clear_user.S Log Message: oops.. forgot a b ... Index: clear_user.S =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/vax/lib/clear_user.S,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- clear_user.S 2001/03/14 22:31:05 1.1 +++ clear_user.S 2001/03/14 22:36:58 1.2 @@ -26,9 +26,9 @@ movl 8(ap), r1 /* r0 has size */ beql 2f 1: EX(movb, (r1)+, 0, fault) - sobgtr r0, 1 + sobgtr r0, 1b 2: ret .section .fixup, "ax" fault: ret - .previous \ No newline at end of file + .previous |
From: Dave A. <ai...@us...> - 2001-03-14 22:29:04
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/vax/lib In directory usw-pr-cvs1:/tmp/cvs-serv29071 Modified Files: Makefile Added Files: clear_user.S Log Message: add clear user .. finished user access .. now to optimise at some stage --- NEW FILE --- /* * $Id: clear_user.S,v 1.1 2001/03/14 22:31:05 airlied Exp $ * * Copyright (C) 2001, Dave Airlie * * VAX Assembly implementation of clear_user */ #include <asm/errno.h> #include <linux/linkage.h> /* unsigned long __clear_user(void *addr, unsigned long size); * number of bytes not cleared is returned */ #define EX(insn, addr, reg, handler) \ 9: insn addr, reg; \ .section __ex_table, "a"; \ .long 9b, handler; \ .previous .text ENTRY(__clear_user) .word 0x3e movl 4(ap), r1 /* r1 now has addr */ movl 8(ap), r1 /* r0 has size */ beql 2f 1: EX(movb, (r1)+, 0, fault) sobgtr r0, 1 2: ret .section .fixup, "ax" fault: ret .previous Index: Makefile =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/vax/lib/Makefile,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- Makefile 2001/03/11 23:54:31 1.11 +++ Makefile 2001/03/14 22:31:05 1.12 @@ -12,7 +12,7 @@ all: libio.a L_TARGET := libio.a -obj-y := string.o string_user.o console.o negdi.o checksum.o lshrdi3.o strncpy_user.o copy_tofrom_user.o strnlen_user.o +obj-y := string.o console.o negdi.o checksum.o lshrdi3.o strncpy_user.o copy_tofrom_user.o strnlen_user.o clear_user.o include $(TOPDIR)/Rules.make |
From: Dave A. <ai...@us...> - 2001-03-11 23:52:38
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/vax/lib In directory usw-pr-cvs1:/tmp/cvs-serv26260 Modified Files: Makefile string_user.c Added Files: strnlen_user.S Log Message: strnlen_user and strlen_user implemented.. only one left - clear_user... --- NEW FILE --- /* * $Id: strnlen_user.S,v 1.1 2001/03/11 23:54:31 airlied Exp $ * * Copyright (C) 2001, Dave Airlie * * VAX Assembly implementation of strnlen */ #include <asm/errno.h> #include <linux/linkage.h> /* long __strnlen_user(const char *s, long n) * Returns either strlen s or n */ #define EX(insn, arg0, arg1, handler) \ 9: insn arg0, arg1; \ .section __ex_table, "a"; \ .long 9b, handler; \ .previous .text ENTRY(__strnlen_user) .word 0x3e movl 4(ap), r0 movl 8(ap), r1 movl r0, r2 1: EX(movb, (r0)+, r3, fault) cmpb $0, r3 beql 2f sobgtr r1, 1b incl r0 2: subl2 r2, r0 ret .section .fixup,"ax" .align 4 fault: movl $0, r0 ret Index: Makefile =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/vax/lib/Makefile,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- Makefile 2001/03/11 22:08:00 1.10 +++ Makefile 2001/03/11 23:54:31 1.11 @@ -12,7 +12,7 @@ all: libio.a L_TARGET := libio.a -obj-y := string.o string_user.o console.o negdi.o checksum.o lshrdi3.o strncpy_user.o copy_tofrom_user.o +obj-y := string.o string_user.o console.o negdi.o checksum.o lshrdi3.o strncpy_user.o copy_tofrom_user.o strnlen_user.o include $(TOPDIR)/Rules.make Index: string_user.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/vax/lib/string_user.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- string_user.c 2001/03/11 22:08:00 1.3 +++ string_user.c 2001/03/11 23:54:31 1.4 @@ -15,15 +15,3 @@ panic("__clear_user: not implemented"); } - -extern long __strlen_user(const char *s) -{ - panic("__strlen_user: not implemented"); -} - - -extern long __strnlen_user(const char *s, long n) -{ - panic("__strnlen_user: not implemented"); -} - |
From: Dave A. <ai...@us...> - 2001-03-11 23:50:06
|
Update of /cvsroot/linux-vax/kernel-2.4/include/asm-vax In directory usw-pr-cvs1:/tmp/cvs-serv25968 Modified Files: uaccess.h Log Message: define strlen_user to strnlen_user with fixed n value.. got this from ARM .. not sure if applicable to VAX.. will use for now.. Index: uaccess.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/include/asm-vax/uaccess.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- uaccess.h 2001/02/05 00:09:31 1.2 +++ uaccess.h 2001/03/11 23:51:59 1.3 @@ -261,12 +261,7 @@ * * Return 0 for error */ -extern long __strlen_user(const char *); - -extern inline long strlen_user(const char *str) -{ - return access_ok(VERIFY_READ,str,0) ? __strlen_user(str) : 0; -} +#define strlen_user(s) strnlen_user(s, ~0UL >> 1) /* Returns: 0 if exception before NUL or reaching the supplied limit (N), * a value greater than N if the limit would be exceeded, else strlen. */ |
From: Dave A. <ai...@us...> - 2001-03-11 23:47:07
|
Update of /cvsroot/linux-vax/kernel-2.4/include/asm-vax In directory usw-pr-cvs1:/tmp/cvs-serv25391 Modified Files: byteorder.h Log Message: byteorder can be included from userspace.. so don't use u_int16_t use __u16 Index: byteorder.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/include/asm-vax/byteorder.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- byteorder.h 2001/03/03 20:39:47 1.5 +++ byteorder.h 2001/03/11 23:49:00 1.6 @@ -31,7 +31,7 @@ static __inline__ __const__ __u16 ___arch__swab16(__u16 x) { register __u16 __x = (x); - return (u_int16_t)(__x << 8 | __x >> 8); + return (__u16)(__x << 8 | __x >> 8); } #if VAX_USE_ARCH_SWAB32 #define __arch__swab32(x) ___arch__swab32(x) |
From: Dave A. <ai...@us...> - 2001-03-11 22:06:07
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/vax/lib In directory usw-pr-cvs1:/tmp/cvs-serv13134 Modified Files: Makefile string_user.c strncpy_user.S Added Files: copy_tofrom_user.S Log Message: initial copy to/from user implementation.. this is a) not what I'd call tuned.. b) maybe missing something in the faulting path c) works for me (tm) :-) also moved strncpy_from_user to a use EX macro --- NEW FILE --- /* * $Id: copy_tofrom_user.S,v 1.1 2001/03/11 22:08:00 airlied Exp $ * * Copyright (C) 2001, Dave Airlie * * VAX Assembly implementation of copy_tofrom_user */ #include <asm/errno.h> #include <linux/linkage.h> /* * int __copy_tofrom_user(void *to, const void *from, unsigned long size); */ #define EX(insn, arg0, arg1, handler) \ 9: insn arg0, arg1; \ .section __ex_table, "a"; \ .long 9b, handler; \ .previous .text ENTRY(__copy_tofrom_user) .word 0x3e movl 4(ap), r2 /* to in r2 */ movl 8(ap), r3 /* from in r3 */ movl 12(ap), r0 /* size in r0 */ 1: EX(movb, (r3)+, r4, l_fixup) EX(movb, r4, (r2)+, s_fixup) sobgtr r0, 1b ret .section .fixup,"ax" .align 4 l_fixup: s_fixup: ret .previous Index: Makefile =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/vax/lib/Makefile,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- Makefile 2001/03/11 14:00:58 1.9 +++ Makefile 2001/03/11 22:08:00 1.10 @@ -12,7 +12,7 @@ all: libio.a L_TARGET := libio.a -obj-y := string.o string_user.o console.o negdi.o checksum.o lshrdi3.o strncpy_user.o +obj-y := string.o string_user.o console.o negdi.o checksum.o lshrdi3.o strncpy_user.o copy_tofrom_user.o include $(TOPDIR)/Rules.make Index: string_user.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/vax/lib/string_user.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- string_user.c 2001/03/11 14:00:58 1.2 +++ string_user.c 2001/03/11 22:08:00 1.3 @@ -10,12 +10,6 @@ #include <linux/kernel.h> /* for panic() */ -int __copy_tofrom_user(void *to, const void *from, unsigned long size) -{ - panic("__copy_tofrom_user: not implemented"); -} - - unsigned long __clear_user(void *addr, unsigned long size) { panic("__clear_user: not implemented"); Index: strncpy_user.S =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/vax/lib/strncpy_user.S,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- strncpy_user.S 2001/03/11 14:00:58 1.1 +++ strncpy_user.S 2001/03/11 22:08:00 1.2 @@ -1,5 +1,5 @@ /* - * $ID$ + * $Id$ * * Copyright (C) 2001, Dave Airlie * @@ -13,6 +13,12 @@ * Returns number of bytes copied */ +#define EX(insn, addr, reg, handler) \ +9: insn addr, reg; \ + .section __ex_table, "a"; \ + .long 9b, handler; \ + .previous + .text ENTRY(__strncpy_from_user) .word 0x3e @@ -21,7 +27,7 @@ movl 12(ap), r0 /* r0 has count */ movl r0, r1 /* keep count in r1 */ beql 2f -1: movb (r3)+, r4 +1: EX(movb, (r3)+, r4, fault) movb r4, (r2)+ cmpb $0, r4 beql 2f @@ -29,10 +35,6 @@ 2: subl2 r1, r0 ret .section .fixup, "ax" -3: movl r0, -EFAULT +fault: movl r0, -EFAULT ret .previous - .section __ex_table, "a" - .align 4 - .long 1b, 3b - .previous \ No newline at end of file |
From: Dave A. <ai...@us...> - 2001-03-11 13:59:07
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/vax/lib In directory usw-pr-cvs1:/tmp/cvs-serv28187 Modified Files: string_user.c Makefile Added Files: strncpy_user.S Log Message: implemented strncpy_from_user... first of many ... copy/to/from should be next ... then strnlen the strncpy bit seems correct .. the fixup/exception table stuff not sure about --- NEW FILE --- /* * $ID$ * * Copyright (C) 2001, Dave Airlie * * VAX Assembly implementation of strncpy_from_user */ #include <asm/errno.h> #include <linux/linkage.h> /* int __strncpy_from_user(char *dst, const char *src, long count) * Returns number of bytes copied */ .text ENTRY(__strncpy_from_user) .word 0x3e movl 4(ap), r2 /* r2 now has dst */ movl 8(ap), r3 /* r3 now has src */ movl 12(ap), r0 /* r0 has count */ movl r0, r1 /* keep count in r1 */ beql 2f 1: movb (r3)+, r4 movb r4, (r2)+ cmpb $0, r4 beql 2f sobgtr r1, 1b 2: subl2 r1, r0 ret .section .fixup, "ax" 3: movl r0, -EFAULT ret .previous .section __ex_table, "a" .align 4 .long 1b, 3b .previous Index: string_user.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/vax/lib/string_user.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- string_user.c 2001/02/05 00:08:02 1.1 +++ string_user.c 2001/03/11 14:00:58 1.2 @@ -22,12 +22,6 @@ } -int __strncpy_from_user(char *dst, const char *src, long count) -{ - panic("__strncpy_from_user: not implemented"); -} - - extern long __strlen_user(const char *s) { panic("__strlen_user: not implemented"); Index: Makefile =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/vax/lib/Makefile,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- Makefile 2001/03/03 13:01:55 1.8 +++ Makefile 2001/03/11 14:00:58 1.9 @@ -12,7 +12,7 @@ all: libio.a L_TARGET := libio.a -obj-y := string.o string_user.o console.o negdi.o checksum.o lshrdi3.o +obj-y := string.o string_user.o console.o negdi.o checksum.o lshrdi3.o strncpy_user.o include $(TOPDIR)/Rules.make |
From: Kenn H. <ke...@us...> - 2001-03-07 02:13:56
|
Update of /cvsroot/linux-vax/kernel-2.4/drivers/net In directory usw-pr-cvs1:/tmp/cvs-serv18727 Modified Files: vaxlance.c Log Message: Make it work on KA43. Major cleanups and simplifications. Index: vaxlance.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/vaxlance.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- vaxlance.c 2001/03/04 23:54:44 1.9 +++ vaxlance.c 2001/03/07 02:15:34 1.10 @@ -22,39 +22,19 @@ static char *lancestr = "LANCE"; #include <linux/init.h> -#include <linux/kernel.h> #include <linux/netdevice.h> - -#include <linux/config.h> -#include <linux/errno.h> -#include <linux/hdreg.h> -#include <linux/ioport.h> -#include <linux/sched.h> -#include <linux/mm.h> -#include <linux/stddef.h> -#include <linux/string.h> -#include <linux/unistd.h> -#include <linux/ptrace.h> -#include <linux/slab.h> -#include <linux/user.h> -#include <linux/utsname.h> -#include <linux/a.out.h> -#include <linux/tty.h> #include <linux/delay.h> -#include <asm/io.h> #include <linux/etherdevice.h> +#include <linux/ioport.h> /* for autoirq_setup/_report */ + +#include <asm/pgalloc.h> /* for __flush_tlb_one */ #include <asm/vsa.h> +/* Ugly kludge to deal with KA43 weirdness */ #include <asm/mv.h> #include <asm/ka43.h> extern struct vax_mv mv_ka43; -#ifndef CONFIG_TC -unsigned long system_base = 0; -unsigned long dmaptr; -#endif -static int type; - #define CRC_POLYNOMIAL_BE 0x04c11db7UL /* Ethernet CRC, big endian */ #define CRC_POLYNOMIAL_LE 0xedb88320UL /* Ethernet CRC, little endian */ @@ -129,25 +109,11 @@ #define PKT_BUF_SZ 1536 #define RX_BUFF_SIZE PKT_BUF_SZ #define TX_BUFF_SIZE PKT_BUF_SZ - -#undef TEST_HITS -#define DEBUG_VAX_DRIVER 0 -#define ZERO 0 +#undef VAX_LANCE_DEBUG +#undef VAX_LANCE_DEBUG_BUFFERS +#define VAX_LANCE_AUTOPROBE_IRQ -/* The DS2000/3000 have a linear 64 KB buffer. - - * The PMAD-AA has 128 kb buffer on-board. - * - * The IOASIC LANCE devices use a shared memory region. This region as seen - * from the CPU is (max) 128 KB long and has to be on an 128 KB boundary. - * The LANCE sees this as a 64 KB long continuous memory region. - * - * The LANCE's DMA address is used as an index in this buffer and DMA takes - * place in bursts of eight 16-Bit words which are packed into four 32-Bit words - * by the IOASIC. This leads to a strange padding: 16 bytes of valid data followed - * by a 16 byte gap :-(. - */ struct lance_rx_desc { unsigned short rmd0; /* low address of packet */ @@ -189,32 +155,36 @@ short gap0[4]; /* The buffer descriptors */ - struct lance_rx_desc brx_ring[RX_RING_SIZE]; - struct lance_tx_desc btx_ring[TX_RING_SIZE]; + struct lance_rx_desc brx_ring[RX_RING_SIZE]; + struct lance_tx_desc btx_ring[TX_RING_SIZE]; }; -#define BUF_OFFSET_CPU sizeof(struct lance_init_block) -/*#define BUF_OFFSET_LNC (sizeof(struct lance_init_block)>>1)*/ -#define BUF_OFFSET_LNC (sizeof(struct lance_init_block)) +#define BUF_OFFSET_CPU (offsetof(struct lance_shared_mem, rx_buf)) +#define BUF_OFFSET_LNC BUF_OFFSET_CPU -#define libdesc_offset(rt, elem) \ -((__u32)(((unsigned long)(&(((struct lance_init_block *)0)->rt[elem]))))) +/* This is how our shared memory block is layed out */ -#define libvaxdesc_offset(rt, elem) \ -((__u32)(((unsigned long)(&(ib->rt[elem]))))) -/* - * This works *only* for the ring descriptors - */ -#define LANCE_ADDR(x) (x & 0xFFFFFF) -/*(PHYSADDR(x))*/ +struct lance_shared_mem { + struct lance_init_block init_block; /* Includes RX/TX descriptors */ + char rx_buf[RX_RING_SIZE][RX_BUFF_SIZE]; + char tx_buf[RX_RING_SIZE][RX_BUFF_SIZE]; +}; + struct lance_private { char *name; + + /* virtual addr of registers */ volatile struct lance_regs *ll; + + /* virtual addr of shared memory block */ + volatile struct lance_shared_mem *lance_mem; + + /* virtual addr of block inside shared mem block */ volatile struct lance_init_block *init_block; - volatile unsigned long *dma_ptr_reg; + unsigned char vsbus_int; spinlock_t lock; @@ -228,26 +198,14 @@ struct net_device *dev; /* Backpointer */ struct lance_private *next_module; struct timer_list multicast_timer; - - /* Pointers to the ring buffers as seen from the CPU */ - char *rx_buf_ptr_cpu[RX_RING_SIZE]; - char *tx_buf_ptr_cpu[TX_RING_SIZE]; - - /* Pointers to the ring buffers as seen from the LANCE */ - char *rx_buf_ptr_lnc[RX_RING_SIZE]; - char *tx_buf_ptr_lnc[TX_RING_SIZE]; - - /* Virtual addr of buffer memory */ - char *buf_va; }; #define TX_BUFFS_AVAIL ((lp->tx_old<=lp->tx_new)?\ lp->tx_old+TX_RING_MOD_MASK-lp->tx_new:\ lp->tx_old - lp->tx_new-1) -/* The lance control ports are at an absolute address, machine and tc-slot - * dependant. - * DECstations do only 32-bit access and the LANCE uses 16 bit addresses, +/* The lance control ports are at an absolute address, machine dependent. + * VAXstations align the two 16-bit registers on 32-bit boundaries * so we have to give the structure an extra member making rap pointing * at the right address */ @@ -257,38 +215,83 @@ volatile unsigned short rap; /* register address port */ }; -int vax_lance_debug = 2; -/* - #ifdef MODULE - static struct lance_private *root_lance_dev = NULL; - #endif - */ +/* Communication with the LANCE takes place via four channels: + + 1. The RDP and RAP ports (which live at 200e0000 physical on + VS3100-family machines). Through these two ports we can + access the LANCE's 4 registers: CSR0, CSR1, CSR2 and CSR3 + (very imaginatively named...) + + 2. The LANCE init block which we allocate. We tell the LANCE where the + init block lives in memory via the CSR1 and CSR2 registers. The init + block contains the ethernet address, multi-cast address filter and + contains the physical addresses of the RX and TX buffer descriptors. + The init block must be word aligned. + + 3. The RX and TX buffer descriptors are pointed to by the init block and + in turn contain the physical addresses of the RX and TX buffers. + The buffer descriptors must be quadword aligned. + + 4. The RX and TX buffers themselves. These buffers have no alignment + requirement. + + To keep things simple, we allocate a single 64K chunk of memory which + contains the init block, followed by the buffer descriptors and then + the buffers. + + For most CPUs, the physical addresses used by the LANCE and the + virtual addresses used by the CPU follow the usual virt = phys+0x80000000 + convention. + + However, the KA43 has an unusual requirement. Physical memory on the + KA43 is accessible from address 0 upwards as normal, but is also visible + in the region starting a 0x28000000. This region is called the DIAGMEM + region. What's different about it, I don't know, but it's probably + something to do with caching. + + So, after allocating the 64KB chunk, but before we tell the LANCE + about it, we tweak the PTEs behind these pages to map to physical + addresses in the DIAGMEM region. + + As of 2001-03-06, the closest data sheet I can find is the AM79C90 (aka + C-LANCE) on AMD's site at http://www.amd.com/products/npd/techdocs/17881.pdf. +*/ + + + static inline void writereg(volatile unsigned short *regptr, short value) { *regptr = value; } +static inline void writecsr0(volatile struct lance_regs *ll, unsigned short value) +{ + writereg(&ll->rap, LE_CSR0); + writereg(&ll->rdp, value); +} + +static inline void lance_stop(volatile struct lance_regs *ll) +{ + writecsr0(ll, LE_C0_STOP); + + /* Is this needed? NetBSD does it sometimes */ + udelay(100); +} + /* Load the CSR registers */ static void load_csrs(struct lance_private *lp) { volatile struct lance_regs *ll = lp->ll; unsigned long leptr; - leptr = (unsigned long)lp->init_block; + leptr = virt_to_phys(lp->init_block); - /* FIXME: This function needs a re-write for VAX, - need to figure out init block address and - pass it to the lance - ai...@li... 14 Aug */ writereg(&ll->rap, LE_CSR1); writereg(&ll->rdp, (leptr & 0xFFFF)); writereg(&ll->rap, LE_CSR2); writereg(&ll->rdp, (leptr >> 16) & 0xFF); - /* - writereg(&ll->rdp, (leptr & 0xFFFF));*/ - /* writereg(&ll->rap, LE_CSR2); - writereg(&ll->rdp, leptr >> 16);*/ writereg(&ll->rap, LE_CSR3); writereg(&ll->rdp, lp->busmaster_regval); @@ -296,16 +299,17 @@ writereg(&ll->rap, LE_CSR0); } + /* * Our specialized copy routines * */ -void cp_to_buf(void *to, const void *from, __kernel_size_t len) +static inline void cp_to_buf(void *to, const void *from, __kernel_size_t len) { memcpy(to, from, len); } -void cp_from_buf(void *to, unsigned char *from, int len) +static inline void cp_from_buf(void *to, unsigned char *from, int len) { memcpy(to, from, len); } @@ -314,13 +318,10 @@ static void lance_init_ring(struct net_device *dev) { struct lance_private *lp = (struct lance_private *) dev->priv; - volatile struct lance_init_block *ib; - int leptr; + volatile struct lance_init_block *ib = lp->init_block; + unsigned long leptr; int i; - ib = (struct lance_init_block *) (dev->mem_start); - lp->init_block=ib; - /* Lock out other processes while setting up hardware */ netif_stop_queue(dev); @@ -338,54 +339,61 @@ ib->phys_addr[5] = dev->dev_addr[5]; /* Setup the initialization block */ - -#if 1 /* Setup rx descriptor pointer */ - /* leptr = LANCE_ADDR(libdesc_offset(brx_ring, 0));*/ - leptr = LANCE_ADDR(libvaxdesc_offset(brx_ring, 0)); + + /* Calculate the physical address of the first receive descriptor */ + leptr = virt_to_phys(ib->brx_ring); ib->rx_len = (LANCE_LOG_RX_BUFFERS << 13) | (leptr >> 16); ib->rx_ptr = leptr; - if (ZERO) - printk("RX ptr: %8.8x(%8.8x)\n", leptr, libvaxdesc_offset(brx_ring, 0)); - + +#ifdef VAX_LANCE_DEBUG + printk("RX ptr: %8.8lx(%8.8x)\n", leptr, libdesc_offset(brx_ring, 0)); +#endif /* Setup tx descriptor pointer */ - /* leptr = LANCE_ADDR(libdesc_offset(btx_ring, 0));*/ - leptr = LANCE_ADDR(libvaxdesc_offset(btx_ring, 0)); + + /* Calculate the physical address of the first transmit descriptor */ + leptr = virt_to_phys(ib->btx_ring); ib->tx_len = (LANCE_LOG_TX_BUFFERS << 13) | (leptr >> 16); ib->tx_ptr = leptr; - if (ZERO) - printk("TX ptr: %8.8x(%8.8x)\n", leptr, libvaxdesc_offset(btx_ring, 0)); -#endif - if (ZERO) - printk("TX rings:\n"); -#if 1 +#ifdef VAX_LANCE_DEBUG + printk("TX ptr: %8.8lx(%8.8x)\n", leptr, libdesc_offset(btx_ring, 0)); + + printk("TX rings:\n"); +#endif /* Setup the Tx ring entries */ for (i = 0; i < TX_RING_SIZE; i++) { - leptr = (int) lp->tx_buf_ptr_lnc[i]; + leptr = virt_to_phys(lp->lance_mem->tx_buf[i]) & 0xffffff; + ib->btx_ring[i].tmd0 = leptr; ib->btx_ring[i].tmd1_hadr = leptr >> 16; ib->btx_ring[i].tmd1_bits = 0; ib->btx_ring[i].length = 0xf000; /* The ones required by tmd2 */ ib->btx_ring[i].misc = 0; - if (i < 3 && ZERO) - printk("%d: 0x%8.8x(0x%8.8x)\n", i, leptr, (int) lp->tx_buf_ptr_cpu[i]); + +#ifdef VAX_LANCE_DEBUG + if (i < 3) + printk("%d: 0x%8.8lx(0x%8.8x)\n", i, leptr, (int) lp->lance_mem->tx_buf[i]); +#endif } /* Setup the Rx ring entries */ - if (ZERO) - printk("RX rings:\n"); +#ifdef VAX_LANCE_DEBUG + printk("RX rings:\n"); +#endif for (i = 0; i < RX_RING_SIZE; i++) { - leptr = (int) lp->rx_buf_ptr_lnc[i]; + leptr = virt_to_phys(lp->lance_mem->rx_buf[i]) & 0xffffff; + ib->brx_ring[i].rmd0 = leptr; ib->brx_ring[i].rmd1_hadr = leptr >> 16; ib->brx_ring[i].rmd1_bits = LE_R1_OWN; ib->brx_ring[i].length = -RX_BUFF_SIZE | 0xf000; ib->brx_ring[i].mblength = 0; - if (i < 3 && ZERO) - printk("%d: 0x%8.8x(0x%8.8x)\n", i, leptr, (int) lp->rx_buf_ptr_cpu[i]); - } +#ifdef VAX_LANCE_DEBUG + if (i < 3) + printk("%d: 0x%8.8lx(0x%8.8x)\n", i, leptr, (int) lp->lance_mem->rx_buf[i]); #endif + } } static int init_restart_lance(struct lance_private *lp) @@ -393,43 +401,58 @@ volatile struct lance_regs *ll = lp->ll; int i; - writereg(&ll->rap, LE_CSR0); - writereg(&ll->rdp, LE_C0_INIT); + /* Is this needed? NetBSD does it. */ + udelay(100); + + writecsr0(ll, LE_C0_INIT); /* Wait for the lance to complete initialization */ for (i = 0; (i < 100) && !(ll->rdp & LE_C0_IDON); i++) { +#ifdef VAX_LANCE_DEBUG printk("LANCE opened maybe %d\n", i); +#endif udelay(10); } if ((i == 100) || (ll->rdp & LE_C0_ERR)) { +#ifdef VAX_LANCE_DEBUG printk("LANCE unopened after %d ticks, csr0=%4.4x.\n", i, ll->rdp); +#endif return -1; } if ((ll->rdp & LE_C0_ERR)) { +#ifdef VAX_LANCE_DEBUG printk("LANCE unopened after %d ticks, csr0=%4.4x.\n", i, ll->rdp); +#endif return -1; } +#ifdef VAX_LANCE_DEBUG printk("LANCE opened maybe\n"); - writereg(&ll->rdp, LE_C0_IDON); - writereg(&ll->rdp, LE_C0_INEA|LE_C0_STRT); - /* writereg(&ll->rdp, LE_C0_INEA);*/ +#endif + writecsr0(ll, LE_C0_IDON); + writecsr0(ll, LE_C0_INEA | LE_C0_STRT); + /* AM79C90 datasheet describes a problem in the original AM7990 + whereby INEA cannot be set while STOP is set. What is not + clear is if setting INEA at the same time is STRT is OK. + So, just in case, we might need to set INEA again */ + /* writecsr0(ll, LE_C0_INEA); */ + return 0; } static int lance_rx(struct net_device *dev) { struct lance_private *lp = (struct lance_private *) dev->priv; - volatile struct lance_init_block *ib; + volatile struct lance_init_block *ib = lp->init_block; volatile struct lance_rx_desc *rd = 0; unsigned char bits; int len = 0; -#ifdef TEST_HITS +#ifdef VAX_LANCE_DEBUG_BUFFERS int i; #endif struct sk_buff *skb = 0; - ib = (struct lance_init_block *) (dev->mem_start); -#ifdef TEST_HITS + +#ifdef VAX_LANCE_DEBUG_BUFFERS printk("["); for (i = 0; i < RX_RING_SIZE; i++) { @@ -484,7 +507,7 @@ skb_reserve(skb, 2); /* 16 byte align */ skb_put(skb, len); /* make room */ cp_from_buf(skb->data, - (char *) lp->rx_buf_ptr_cpu[lp->rx_new], + (char *) lp->lance_mem->rx_buf[lp->rx_new], len); skb->protocol = eth_type_trans(skb, dev); netif_rx(skb); @@ -504,12 +527,11 @@ static void lance_tx(struct net_device *dev) { struct lance_private *lp = (struct lance_private *) dev->priv; - volatile struct lance_init_block *ib; + volatile struct lance_init_block *ib = lp->init_block; volatile struct lance_regs *ll = lp->ll; volatile struct lance_tx_desc *td; int i, j; int status; - ib = (struct lance_init_block *) (dev->mem_start); j = lp->tx_old; spin_lock(&lp->lock); @@ -532,9 +554,8 @@ if (status & LE_T3_CLOS) { lp->stats.tx_carrier_errors++; printk("%s: Carrier Lost", dev->name); - /* Stop the lance */ - writereg(&ll->rap, LE_CSR0); - writereg(&ll->rdp, LE_C0_STOP); + + lance_stop(ll); lance_init_ring(dev); load_csrs(lp); init_restart_lance(lp); @@ -548,9 +569,8 @@ printk("%s: Tx: ERR_BUF|ERR_UFL, restarting\n", dev->name); - /* Stop the lance */ - writereg(&ll->rap, LE_CSR0); - writereg(&ll->rdp, LE_C0_STOP); + + lance_stop(ll); lance_init_ring(dev); load_csrs(lp); init_restart_lance(lp); @@ -590,17 +610,32 @@ volatile struct lance_regs *ll = lp->ll; int csr0; -printk("lance_interrupt: entered\n"); writereg(&ll->rap, LE_CSR0); csr0 = ll->rdp; + + if ((csr0 & LE_C0_INTR) == 0) { + /* Hmmm, not for us... */ + return; + } vsbus_clear_int(lp->vsbus_int); - /* Acknowledge all the interrupt sources ASAP */ - writereg(&ll->rdp, csr0 & (LE_C0_INTR | LE_C0_TINT | LE_C0_RINT)); - + + /* According to NetBSD, we need to temporarily disable the + interrupts here to get things to work properly all the + time */ + + /* temporarily disable interrupts from LANCE */ + csr0 &= ~LE_C0_INEA; + + /* Acknowledge all the interrupt sources */ + writecsr0(ll, csr0); + + /* re-enable interrupts from LANCE */ + writecsr0(ll, LE_C0_INEA); + if ((csr0 & LE_C0_ERR)) { /* Clear the error condition */ - writereg(&ll->rdp, LE_C0_BABL | LE_C0_ERR | LE_C0_MISS | - LE_C0_CERR | LE_C0_MERR); + writecsr0(ll, LE_C0_BABL | LE_C0_ERR | LE_C0_MISS | + LE_C0_CERR | LE_C0_MERR); } if (csr0 & LE_C0_RINT) lance_rx(dev); @@ -616,36 +651,25 @@ if (csr0 & LE_C0_MERR) { printk("%s: Memory error, status %04x", dev->name, csr0); -#if 0 - volatile unsigned long int_stat = *(unsigned long *) (system_base + IOCTL + SIR); - printk("%s: Memory error, status %04x", dev->name, csr0); - if (int_stat & LANCE_DMA_MEMRDERR) { - printk("%s: DMA error\n", dev->name); - int_stat |= LANCE_DMA_MEMRDERR; - /* - * re-enable LANCE DMA - */ - *(unsigned long *) (system_base + IOCTL + SSR) |= (1 << 16); - } -#endif - writereg(&ll->rdp, LE_C0_STOP); + lance_stop(ll); lance_init_ring(dev); load_csrs(lp); init_restart_lance(lp); netif_wake_queue(dev); } - writereg(&ll->rdp, LE_C0_INEA); - writereg(&ll->rdp, LE_C0_INEA); + + /* FIXME: why is this really needed? */ + writecsr0(ll, LE_C0_INEA); } struct net_device *last_dev = 0; static int lance_open(struct net_device *dev) { - volatile struct lance_init_block *ib = (struct lance_init_block *) (dev->mem_start); struct lance_private *lp = (struct lance_private *) dev->priv; + volatile struct lance_init_block *ib = lp->init_block; volatile struct lance_regs *ll = lp->ll; int status = 0; @@ -660,9 +684,7 @@ /* this is just a hack for now */ vsbus_enable_int(lp->vsbus_int); - /* Stop the Lance */ - writereg(&ll->rap, LE_CSR0); - writereg(&ll->rdp, LE_C0_STOP); + lance_stop(ll); /* Clear the multicast filter */ ib->mode=0; @@ -694,9 +716,7 @@ netif_stop_queue(dev); del_timer_sync(&lp->multicast_timer); - /* Stop the card */ - writereg(&ll->rap, LE_CSR0); - writereg(&ll->rdp, LE_C0_STOP); + lance_stop(ll); free_irq(dev->irq, (void *) dev); /* @@ -711,15 +731,13 @@ volatile struct lance_regs *ll = lp->ll; int status; - /* Stop the lance */ - writereg(&ll->rap, LE_CSR0); - writereg(&ll->rdp, LE_C0_STOP); + lance_stop(ll); lance_init_ring(dev); load_csrs(lp); dev->trans_start = jiffies; status = init_restart_lance(lp); -#ifdef DEBUG_DRIVER +#ifdef VAX_LANCE_DEBUG printk("Lance restart=%d\n", status); #endif return status; @@ -740,7 +758,7 @@ { struct lance_private *lp = (struct lance_private *) dev->priv; volatile struct lance_regs *ll = lp->ll; - volatile struct lance_init_block *ib = (struct lance_init_block *) (dev->mem_start); + volatile struct lance_init_block *ib = lp->init_block; int entry, skblen, len; skblen = skb->len; @@ -755,7 +773,7 @@ ib->btx_ring[entry].length = (-len) | 0xf000; ib->btx_ring[entry].misc = 0; - cp_to_buf((char *) lp->tx_buf_ptr_cpu[entry], skb->data, skblen); + cp_to_buf((char *) lp->lance_mem->tx_buf[entry], skb->data, skblen); /* Clear the slack of the packet, do I need this? */ /* For a firewall its a good idea - AC */ @@ -771,7 +789,7 @@ netif_stop_queue(dev); /* Kick the lance: transmit now */ - writereg(&ll->rdp, LE_C0_INEA | LE_C0_TDMD); + writecsr0(ll, LE_C0_INEA | LE_C0_TDMD); spin_unlock_irq(&lp->lock); @@ -790,7 +808,8 @@ static void lance_load_multicast(struct net_device *dev) { - volatile struct lance_init_block *ib = (struct lance_init_block *) (dev->mem_start); + struct lance_private *lp = (struct lance_private *) dev->priv; + volatile struct lance_init_block *ib = lp->init_block; volatile u16 *mcast_table = (u16 *)&ib->filter; struct dev_mc_list *dmi = dev->mc_list; char *addrs; @@ -842,11 +861,9 @@ static void lance_set_multicast(struct net_device *dev) { struct lance_private *lp = (struct lance_private *) dev->priv; - volatile struct lance_init_block *ib; + volatile struct lance_init_block *ib = lp->init_block; volatile struct lance_regs *ll = lp->ll; - ib = (struct lance_init_block *) (dev->mem_start); - if (!netif_running(dev)) return; @@ -858,8 +875,7 @@ netif_stop_queue(dev); - writereg(&ll->rap, LE_CSR0); - writereg(&ll->rdp, LE_C0_STOP); + lance_stop(ll); lance_init_ring(dev); @@ -883,7 +899,7 @@ volatile void *base_addr=NULL; -static int __init vax_lance_init(struct net_device *dev, const int type) +static int __init vax_lance_init(struct net_device *dev) { static unsigned version_printed = 0; struct lance_private *lp; @@ -895,11 +911,9 @@ unsigned long lance_phys_addr=KA43_LAN_BASE; unsigned long esar_phys_addr=KA43_NWA_BASE; - base_addr=ioremap(lance_phys_addr, 0x8); - esar=ioremap(esar_phys_addr, 0x80); - if (vax_lance_debug && version_printed++ == 0) - printk(version); -#if 1 + if (version_printed++ == 0) + printk(version); + if (dev == NULL) { dev = init_etherdev(0, sizeof(struct lance_private) + 8); } else { @@ -912,26 +926,31 @@ } /* Make certain the data structures used by the LANCE are aligned. */ dev->priv = (void *) (((unsigned long) dev->priv + 7) & ~7); -#else - /* If this is dead code, let's remove it... - KPH 2001-03-04 */ - dev = init_etherdev(0, sizeof(struct lance_private)); - if (!dev) - return -ENOMEM; -#endif lp = (struct lance_private *) dev->priv; + spin_lock_init(&lp->lock); - /* Need to kmalloc a block of 64k */ - lp->buf_va = kmalloc(65536 + 7, GFP_KERNEL); - if (lp->buf_va == NULL) { - /* Should be free dev->priv here if dev was non-NULL on entry? */ + /* Need a block of 64KB */ + dev->mem_start = __get_free_pages(GFP_KERNEL, 4); + if (!dev->mem_start) { + /* Shouldn't we free dev->priv here if dev was non-NULL on entry? */ return -ENOMEM; } - /* Ensure alignment */ - lp->buf_va = (char *) (((unsigned long) lp->buf_va + 7) & ~7); if (mv == &mv_ka43) { + + /* FIXME: + We need to check if this block straddles the 16MB boundary. If + it does, then we can't use it for DMA. Instead we allocate + another 64KB block (which obviously cannot straddle the 16MB + boundary as well) and free the first. + + We also need to set the magic bit in PARCTL if we are above + the 16MB boundary. + + */ + /* KA43 only. * * The KA43 seems to be nicely fscked up... All physical memory @@ -942,57 +961,37 @@ * caches or something... If you don't do this you get evil * "memory read parity error" machine checks. * - * We really need a cleaner way to do this, for two reasons: - * - * 1. This is wasteful of SPTEs since the region ends up - * double-mapped - * 2. I think other drivers (SCSI?) will need this too */ - dev->mem_start = (unsigned long) ioremap(virt_to_phys(lp->buf_va)|KA43_DIAGMEM, 65536); - } else { - /* other CPUs */ - dev->mem_start = (unsigned long) lp->buf_va; + + /* You MUST remember to clear the DIAGMEM bits in these PTEs + before giving the pages back to free_pages() */ + + pte_t *p = GET_SPTE_VIRT(dev->mem_start); + for (i=0; i<(65536>>PAGE_SHIFT); i++, p++) { + set_pte(p, __pte(pte_val(*p) | (KA43_DIAGMEM >> PAGELET_SHIFT))); + __flush_tlb_one(dev->mem_start + i * PAGE_SIZE); + } } dev->mem_end = dev->mem_start + 65536; + + /* FIXME: check this for NULL */ + base_addr=ioremap(lance_phys_addr, 0x8); + dev->base_addr=(unsigned long)base_addr; + lp->lance_mem = (volatile struct lance_shared_mem *)(dev->mem_start); + lp->init_block = &(lp->lance_mem->init_block); + /* need something meaningful in here */ dev->irq = 0; + ll = (struct lance_regs *) base_addr; - for (i = 0; i < RX_RING_SIZE; i++) { - lp->rx_buf_ptr_cpu[i] = - (char *) (dev->mem_start + BUF_OFFSET_CPU - + i * RX_BUFF_SIZE); - - lp->rx_buf_ptr_lnc[i] = - (char *) ((dev->mem_start + BUF_OFFSET_LNC - + i * RX_BUFF_SIZE) & 0xFFFFFF); - - } - for (i = 0; i < TX_RING_SIZE; i++) { - lp->tx_buf_ptr_cpu[i] = - (char *) (dev->mem_start + BUF_OFFSET_CPU - + RX_RING_SIZE * RX_BUFF_SIZE - + i * TX_BUFF_SIZE); - lp->tx_buf_ptr_lnc[i] = - (char *) ((dev->mem_start + BUF_OFFSET_LNC - + RX_RING_SIZE * RX_BUFF_SIZE - + i * TX_BUFF_SIZE) & 0xFFFFFF); - } + /* FIXME: deal with failure here */ + esar=ioremap(esar_phys_addr, 0x80); - ll = (struct lance_regs *) base_addr; -#if DEBUG_VAX_DRIVER - printk("Hello %p\n",esar); - { - unsigned int x; - for (x=0x50; x<0x7E; x++) - printk("%02X %d \n", x, esar[x]); - } - printk("\nHello2 \n"); -#endif /* prom checks */ #if 0 /* If this is dead code, let's remove it... - KPH 2001-03-04 */ @@ -1019,22 +1018,32 @@ * lance initialization block so the lance gets it every time it's * (re)initialized. */ + printk("Ethernet address in ROM: "); for (i = 0; i < 6; i++) { dev->dev_addr[i] = esar[i * 4]; - printk("%2.2x%c", dev->dev_addr[i], i == 5 ? ',' : ':'); + printk("%2.2x%c", dev->dev_addr[i], i == 5 ? '\n' : ':'); } + + /* Don't need this any more */ + iounmap(esar); + lp->vsbus_int=5; + +#ifdef VAX_LANCE_AUTOPROBE_IRQ + + printk("Autoprobing LANCE interrupt vector..."); -#if 1 vsbus_enable_int(lp->vsbus_int); autoirq_setup(0); - writereg(&ll->rap, LE_CSR0); - writereg(&ll->rdp, LE_C0_STOP); - + lance_stop(ll); - writereg(&ll->rap, LE_CSR0); - writereg(&ll->rdp, LE_C0_INEA|LE_C0_INIT); + /* Shouldn't we really load CSR1/2 with the address of a + reasonable init block, just in case the LANCE goes and + does something wild with whatever garbage it's currently + pointing to? - KPH 2001-03-06 */ + + writecsr0(ll, LE_C0_INEA|LE_C0_INIT); dev->irq = autoirq_report(100); @@ -1042,7 +1051,7 @@ vsbus_clear_int(lp->vsbus_int); if (dev->irq) - printk(" probed IRQ %d", dev->irq); + printk(" probed IRQ %d\n", dev->irq); else { dev->irq=0x94; @@ -1051,8 +1060,8 @@ /* Fill the dev fields */ #else dev->irq=0x94; + printk("Using LANCE interrupt vector %d", dev->irq); #endif - printk(" irq = %d\n", dev->irq); dev->open = &lance_open; dev->stop = &lance_close; dev->hard_start_xmit = &lance_start_xmit; @@ -1093,20 +1102,6 @@ */ #endif -#if 0 - vsbus_enable_int(lp->vsbus_int); - writereg(&ll->rap, LE_CSR0); - writereg(&ll->rdp, LE_C0_STOP); - lp->busmaster_regval=0; - lance_init_ring(dev); - - netif_start_queue(dev); - load_csrs(lp); - init_restart_lance(lp); - - /* I'll try fecking something out from the card here soon - D.A. */ - vax_lance_test_xmit(dev); -#endif return 0; err_out: @@ -1125,7 +1120,7 @@ if (!called) { called=1; - return vax_lance_init(dev, type); + return vax_lance_init(dev); } else return -ENODEV; @@ -1133,19 +1128,17 @@ __initcall(vax_lance_probe); -/* - #ifdef MODULE - int - init_module(void) - { +#ifdef MODULE + +int init_module(void) +{ root_lance_dev = NULL; return vax_lance_probe(NULL); - } +} - void - cleanup_module(void) - { +void cleanup_module(void) +{ struct lance_private *lp; while (root_lance_dev) { @@ -1155,54 +1148,7 @@ kfree(root_lance_dev->dev); root_lance_dev = lp; } - } - - #endif -* MODULE */ -unsigned char tx_block[30]; - -#if 0 -static int vax_lance_test_xmit(struct net_device *dev) -{ - struct lance_private *lp = (struct lance_private *) dev->priv; - volatile struct lance_regs *ll = lp->ll; - volatile struct lance_init_block *ib; - unsigned long flags; - int entry, skblen, len; - int status = 0, i; - static int outs; - - ib = (struct lance_init_block *) (dev->mem_start); - printk("Attempt TX\n"); - - // memset(tx_block, 0, 30); - for (i=5; i<25; i++) - tx_block[i-5]=i; - - skblen = 16; - save_flags(flags); - cli(); - len = (skblen <= ETH_ZLEN) ? ETH_ZLEN : skblen; - - lp->stats.tx_bytes += len; - - entry = lp->tx_new & TX_RING_MOD_MASK; - ib->btx_ring[entry].length = (-len) | 0xf000; - ib->btx_ring[entry].misc = 0; - - cp_to_buf((char *) lp->tx_buf_ptr_cpu[entry], tx_block, skblen); - - /* Now, give the packet to the lance */ - ib->btx_ring[entry].tmd1_bits = (LE_T1_POK | LE_T1_OWN); - lp->tx_new = (lp->tx_new + 1) & TX_RING_MOD_MASK; - - /* Kick the lance: transmit now */ - writereg(&ll->rdp, LE_C0_INEA | LE_C0_TDMD); - dev->trans_start = jiffies; - - if (TX_BUFFS_AVAIL<=0) - netif_stop_queue(dev); - - restore_flags(flags); - return status; } + #endif + |
From: Kenn H. <ke...@us...> - 2001-03-07 02:07:04
|
Update of /cvsroot/linux-vax/kernel-2.4 In directory usw-pr-cvs1:/tmp/cvs-serv17703 Modified Files: Makefile Log Message: Increment EXTRAVERSION again Index: Makefile =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/Makefile,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- Makefile 2001/02/26 02:28:26 1.10 +++ Makefile 2001/03/07 02:08:40 1.11 @@ -1,7 +1,7 @@ VERSION = 2 PATCHLEVEL = 4 SUBLEVEL = 2 -EXTRAVERSION = -20010226 +EXTRAVERSION = -20010307 KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) |
From: Kenn H. <ke...@us...> - 2001-03-07 02:02:14
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/vax/boot In directory usw-pr-cvs1:/tmp/cvs-serv16844/boot Modified Files: head.S Log Message: remove error-inducing apostrophe Index: head.S =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/vax/boot/head.S,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- head.S 2001/02/21 00:35:24 1.5 +++ head.S 2001/03/07 02:03:52 1.6 @@ -135,7 +135,7 @@ fill_done: decl r3 # movl r3, r9 # save phys addr of last byte of kernel - # in R9. We'll need this later + # in R9. We will need this later # Need to know the distance we have moved the kernel, so that we can # fix up the machine vector pointer after we jump |
From: Kenn H. <ke...@us...> - 2001-03-07 02:01:46
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/vax/kernel In directory usw-pr-cvs1:/tmp/cvs-serv16752/kernel Modified Files: process.c Log Message: Disable task switch message Index: process.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/vax/kernel/process.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- process.c 2001/02/27 22:36:52 1.6 +++ process.c 2001/03/07 02:03:25 1.7 @@ -46,8 +46,10 @@ unsigned long pcbb; /* physical address of new pcb */ struct task_struct *retval; +#if 0 printk("vax_switch_to: switching %08lx -> %08lx\n", (unsigned long)prev, (unsigned long)next); +#endif /* We should check that __pa((prev)->thread.pcb) == PR_PCBB */ |
From: Kenn H. <ke...@us...> - 2001-03-07 02:00:52
|
Update of /cvsroot/linux-vax/kernel-2.4/include/asm-vax/mm In directory usw-pr-cvs1:/tmp/cvs-serv16568 Modified Files: pgtable.h Log Message: Make GET_{HW}SPTE_PHYS return the correct type Index: pgtable.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/include/asm-vax/mm/pgtable.h,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- pgtable.h 2001/02/21 00:26:58 1.9 +++ pgtable.h 2001/03/07 02:02:30 1.10 @@ -51,13 +51,13 @@ * results, */ /* macro to get linear page table entry for a physical address */ -#define GET_HWSPTE_PHYS(x) (SPT_BASE + ((x) >> (PAGELET_SHIFT-SIZEOF_PTR_LOG2))) -#define GET_SPTE_PHYS(x) (SPT_BASE + ((x) >> (PAGE_SHIFT-SIZEOF_PTE_LOG2))) +#define GET_HWSPTE_PHYS(x) ((hwpte_t *)(SPT_BASE + ((x) >> (PAGELET_SHIFT-SIZEOF_PTR_LOG2)))) +#define GET_SPTE_PHYS(x) ((pte_t *)(SPT_BASE + ((x) >> (PAGE_SHIFT-SIZEOF_PTE_LOG2)))) /* macro to get linear page table entry for a virtual address (only works for addresses in S0 space) */ #define GET_HWSPTE_VIRT(x) GET_HWSPTE_PHYS(((unsigned long)x) - PAGE_OFFSET) -#define GET_SPTE_VIRT(x) GET_SPTE_PHYS(((unsigned long)x) - PAGE_OFFSET) +#define GET_SPTE_VIRT(x) GET_SPTE_PHYS(((unsigned long)x) - PAGE_OFFSET) /* macro to get the virtual address represented by an SPTE, given the address of the SPTE */ #define SPTE_TO_VIRT(p) (void *)((((unsigned long)p - (unsigned long)swapper_pg_dir[2].br) << (PAGE_SHIFT-SIZEOF_PTE_LOG2)) + PAGE_OFFSET) |
From: Kenn H. <ke...@us...> - 2001-03-07 02:00:07
|
Update of /cvsroot/linux-vax/kernel-2.4/include/asm-vax/mm In directory usw-pr-cvs1:/tmp/cvs-serv16338 Modified Files: pagelet_pte.h Log Message: Clarify PTE description Index: pagelet_pte.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/include/asm-vax/mm/pagelet_pte.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- pagelet_pte.h 2001/02/15 01:17:23 1.1 +++ pagelet_pte.h 2001/03/07 02:01:42 1.2 @@ -30,8 +30,8 @@ */ /* This is the definition of the pagelet_t. - * Note that the first pte is the one that linux sees. - * The first pte is used for all tests except + * Note that the first hwpte is the one that linux sees. + * The first hwpte is used for all tests except * the dirty test, which has to be applied to all */ typedef unsigned long hwpte_t; |
From: Kenn H. <ke...@us...> - 2001-03-04 23:53:11
|
Update of /cvsroot/linux-vax/kernel-2.4/drivers/net In directory usw-pr-cvs1:/tmp/cvs-serv16107 Modified Files: vaxlance.c Log Message: Deal with KA43's DMA requirements Index: vaxlance.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/vaxlance.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- vaxlance.c 2001/02/27 22:05:26 1.8 +++ vaxlance.c 2001/03/04 23:54:44 1.9 @@ -14,10 +14,6 @@ * the lance pointed at the init block in the right address space. * - D.A. 14 Aug 2000 * - * THIS VERSION IS JUST A PLACE HOLDER, IT DOES LITTLE OR NOTHING - * IT READS THE CONTENTS OF THE PROM, - * - * will try and get some more working soon .. malloc would be nice :-) */ static char *version = @@ -49,6 +45,10 @@ #include <linux/etherdevice.h> #include <asm/vsa.h> +#include <asm/mv.h> +#include <asm/ka43.h> +extern struct vax_mv mv_ka43; + #ifndef CONFIG_TC unsigned long system_base = 0; unsigned long dmaptr; @@ -236,6 +236,9 @@ /* Pointers to the ring buffers as seen from the LANCE */ char *rx_buf_ptr_lnc[RX_RING_SIZE]; char *tx_buf_ptr_lnc[TX_RING_SIZE]; + + /* Virtual addr of buffer memory */ + char *buf_va; }; #define TX_BUFFS_AVAIL ((lp->tx_old<=lp->tx_new)?\ @@ -587,6 +590,7 @@ volatile struct lance_regs *ll = lp->ll; int csr0; +printk("lance_interrupt: entered\n"); writereg(&ll->rap, LE_CSR0); csr0 = ll->rdp; vsbus_clear_int(lp->vsbus_int); @@ -611,6 +615,7 @@ lp->stats.rx_errors++; if (csr0 & LE_C0_MERR) { + printk("%s: Memory error, status %04x", dev->name, csr0); #if 0 volatile unsigned long int_stat = *(unsigned long *) (system_base + IOCTL + SIR); @@ -651,6 +656,7 @@ printk("Lance: Can't get irq %d\n", dev->irq); return -EAGAIN; } + /* this is just a hack for now */ vsbus_enable_int(lp->vsbus_int); @@ -883,13 +889,14 @@ struct lance_private *lp; volatile struct lance_regs *ll; int i, ret; - unsigned long esar_base; unsigned char *esar; - unsigned long lance_phys_addr=0x200e0000; - unsigned long esar_phys_addr=0x20090000; + /* Could these base addresses be different on other CPUs? */ + unsigned long lance_phys_addr=KA43_LAN_BASE; + unsigned long esar_phys_addr=KA43_NWA_BASE; + base_addr=ioremap(lance_phys_addr, 0x8); - esar_base=ioremap(esar_phys_addr, 0x80); + esar=ioremap(esar_phys_addr, 0x80); if (vax_lance_debug && version_printed++ == 0) printk(version); #if 1 @@ -906,6 +913,7 @@ /* Make certain the data structures used by the LANCE are aligned. */ dev->priv = (void *) (((unsigned long) dev->priv + 7) & ~7); #else + /* If this is dead code, let's remove it... - KPH 2001-03-04 */ dev = init_etherdev(0, sizeof(struct lance_private)); if (!dev) return -ENOMEM; @@ -915,12 +923,40 @@ spin_lock_init(&lp->lock); /* Need to kmalloc a block of 64k */ - dev->mem_start=kmalloc(65536, GFP_KERNEL); - dev->mem_start = (((unsigned long) dev->mem_start + 7) & ~7); + lp->buf_va = kmalloc(65536 + 7, GFP_KERNEL); + if (lp->buf_va == NULL) { + /* Should be free dev->priv here if dev was non-NULL on entry? */ + return -ENOMEM; + } + /* Ensure alignment */ + lp->buf_va = (char *) (((unsigned long) lp->buf_va + 7) & ~7); + + if (mv == &mv_ka43) { + /* KA43 only. + * + * The KA43 seems to be nicely fscked up... All physical memory + * is accessible from 0x00000000 up (as normal) and also from + * 0x28000000 (KA43_DIAGMEM) in IO space. In order to reliably + * share memory with the LANCE, we _must_ read and write to this + * shared memory via the DIAGMEM region. Maybe this bypasses + * caches or something... If you don't do this you get evil + * "memory read parity error" machine checks. + * + * We really need a cleaner way to do this, for two reasons: + * + * 1. This is wasteful of SPTEs since the region ends up + * double-mapped + * 2. I think other drivers (SCSI?) will need this too + */ + dev->mem_start = (unsigned long) ioremap(virt_to_phys(lp->buf_va)|KA43_DIAGMEM, 65536); + } else { + /* other CPUs */ + dev->mem_start = (unsigned long) lp->buf_va; + } + + dev->mem_end = dev->mem_start + 65536; - /* dev->mem_start = base_addr;*/ - /* dev->base_addr = dev->mem_start + 0x100000;*/ - dev->base_addr=base_addr; + dev->base_addr=(unsigned long)base_addr; /* need something meaningful in here */ dev->irq = 0; @@ -948,9 +984,8 @@ } ll = (struct lance_regs *) base_addr; - esar = (unsigned char *)esar_base; #if DEBUG_VAX_DRIVER - printk("Hello %p\n",esar_base); + printk("Hello %p\n",esar); { unsigned int x; for (x=0x50; x<0x7E; x++) @@ -960,6 +995,7 @@ #endif /* prom checks */ #if 0 + /* If this is dead code, let's remove it... - KPH 2001-03-04 */ /* First, check for test pattern */ if (esar[0x60] != 0xff && esar[0x64] != 0x00 && esar[0x68] != 0x55 && esar[0x6c] != 0xaa) { @@ -988,6 +1024,7 @@ printk("%2.2x%c", dev->dev_addr[i], i == 5 ? ',' : ':'); } lp->vsbus_int=5; + #if 1 vsbus_enable_int(lp->vsbus_int); autoirq_setup(0); @@ -1000,13 +1037,16 @@ writereg(&ll->rdp, LE_C0_INEA|LE_C0_INIT); dev->irq = autoirq_report(100); + + /* maybe we should stop the LANCE here? */ + vsbus_clear_int(lp->vsbus_int); if (dev->irq) printk(" probed IRQ %d", dev->irq); else { - dev->irq=0x114; - printk(" failed to detect IRQ line.\n"); + dev->irq=0x94; + printk(" failed to detect IRQ line - assuming 0x94.\n"); } /* Fill the dev fields */ #else |
From: Kenn H. <ke...@us...> - 2001-03-04 23:51:54
|
Update of /cvsroot/linux-vax/kernel-2.4/include/asm-vax In directory usw-pr-cvs1:/tmp/cvs-serv16016 Modified Files: ka43.h Log Message: Pull in more definitions from NetBSD Index: ka43.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/include/asm-vax/ka43.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- ka43.h 2001/01/17 16:18:52 1.1 +++ ka43.h 2001/03/04 23:53:25 1.2 @@ -1,3 +1,72 @@ +/* + * $Id$ + * + * Definitions for KA43 CPU (VAXstation 3100m76). + * + * Taken from NetBSD + * + */ + +#ifndef __VAX_KA43_H +#define __VAX_KA43_H + +/* Fixed addresses in CPU's physical memory map */ + +#define KA43_CH2_BASE 0x10000000 /* 2nd level cache data area */ +#define KA43_CH2_END 0x1FFFFFFF +#define KA43_CH2_SIZE 0x10000000 + +#define KA43_CPU_BASE 0x20080000 /* so called "CPU registers" */ +#define KA43_CPU_END 0x200800FF +#define KA43_CPU_SIZE 0x100 + +#define KA43_NWA_BASE 0x20090000 /* Network Address ROM */ +#define KA43_NWA_END 0x2009007F +#define KA43_NWA_SIZE 0x80 + +#define KA43_SER_BASE 0x200A0000 /* Serial line controller */ +#define KA43_SER_END 0x200A000F +#define KA43_SER_SIZE 0x10 + +#define KA43_WAT_BASE 0x200B0000 /* TOY clock and NV-RAM */ +#define KA43_WAT_END 0x200B00FF +#define KA43_WAT_SIZE 0x100 + +#define KA43_SC1_BASE 0x200C0080 /* 1st SCSI Controller Chip */ +#define KA43_SC1_END 0x200C009F +#define KA43_SC1_SIZE 0x20 + +#define KA43_SC2_BASE 0x200C0180 /* 2nd SCSI Controller Chip */ +#define KA43_SC2_END 0x200C019F +#define KA43_SC2_SIZE 0x20 + +#define KA43_SCS_BASE 0x200C0000 /* area occupied by SCSI 1+2 */ +#define KA43_SCS_END 0x200C01FF +#define KA43_SCS_SIZE 0x200 + +#define KA43_LAN_BASE 0x200E0000 /* LANCE chip registers */ +#define KA43_LAN_END 0x200E0007 +#define KA43_LAN_SIZE 0x08 + +#define KA43_CUR_BASE 0x200F0000 /* Monochrome video cursor chip */ +#define KA43_CUR_END 0x200F003C +#define KA43_CUR_SIZE 0x40 + +#define KA43_DMA_BASE 0x202D0000 /* 128KB Data Buffer */ +#define KA43_DMA_END 0x202EFFFF +#define KA43_DMA_SIZE 0x20000 + +#define KA43_CT2_BASE 0x21000000 /* 2nd level cache tag area */ +#define KA43_CT2_END 0x2101FFFF +#define KA43_CT2_SIZE 0x20000 +#define KA43_CH2_CREG 0x21100000 /* 2nd level cache control register */ + +#define KA43_VME_BASE 0x30000000 +#define KA43_VME_END 0x3003FFFF +#define KA43_VME_SIZE 0x40000 + +#define KA43_DIAGMEM 0x28000000 + /* Cache defines Primary Cachce */ #define KA43_PCS_ENABLE 0x00000002 /* Enable primary cache */ #define KA43_PCS_FLUSH 0x00000004 /* Flush cache */ @@ -19,16 +88,34 @@ #define KA43_SESR_WSB 0x00010000 #define KA43_SESR_CIEA 0x7FFC0000 -#define KA43_CH2_BASE 0x10000000 /* 2nd level cache data area */ -#define KA43_CH2_END 0x1FFFFFFF -#define KA43_CH2_SIZE 0x10000000 -#define KA43_CT2_BASE 0x21000000 /* 2nd level cache tag area */ -#define KA43_CT2_END 0x2101FFFF -#define KA43_CT2_SIZE 0x20000 -#define KA43_CH2_CREG 0x21100000 /* 2nd level cache control register */ - #define PR_PCTAG 124 #define PR_PCIDX 125 #define PC_PCERR 126 #define PR_PCSTS 127 + +/* Bits in ka43_cpu_regs.parctl */ +#define KA43_PCTL_DPEN 0x00000001 /* DMA parity enable (bit 0) */ +#define KA43_PCTL_CPEN 0x00000002 /* CPU Parity enable (bit 1) */ +#define KA43_PCTL_DMA 0x01000000 /* LANCE DMA control (bit 24) */ + +#ifndef __ASSEMBLY__ + +struct ka43_cpu_regs { + unsigned long hltcod; /* Halt Code Register */ + unsigned long pad2; + unsigned long pad3; + unsigned char intreg[4]; /* Four 1-byte registers */ + unsigned short diagdsp; /* Diagnostic display register */ + unsigned short pad4; + unsigned long parctl; /* Parity Control Register */ + unsigned short pad5; + unsigned short pad6; + unsigned short pad7; + unsigned short diagtme; /* Diagnostic time register */ +}; + +#endif /* __ASSEMBLY */ + +#endif /* __VAX_KA43_H */ + |
From: Kenn H. <ke...@us...> - 2001-03-04 23:48:58
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/vax/kernel In directory usw-pr-cvs1:/tmp/cvs-serv15326 Modified Files: cpu_ka43.c Log Message: Unmap cache-relation I/O mappings after cache has been initialized. We don't need them any more... Clear CPEN (CPU parity enable). Not sure about this, but VMS seems to do it, and NetBSD does it when netbooting. Index: cpu_ka43.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/vax/kernel/cpu_ka43.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- cpu_ka43.c 2001/02/22 22:36:42 1.4 +++ cpu_ka43.c 2001/03/04 23:50:30 1.5 @@ -25,19 +25,16 @@ void ka43_pre_vm_init(void); void ka43_post_vm_init(void); -void ka43_cache_disable(void); -void ka43_cache_clear(void); -void ka43_cache_enable(void); +void ka43_cache_disable(volatile unsigned int *creg_addr); +void ka43_cache_clear(volatile unsigned int *ctag_addr); +void ka43_cache_enable(volatile unsigned int *creg_addr); void ka43_init_devices(void); const char *ka43_cpu_type_str(void); -/* These are initialized at compile time with the physical addresses - of the KA43's CPU-specific data structures. Once VM is turned on, - we'll map in these physical ranges, and update these pointers. */ -static volatile unsigned int *ka43_creg = (void*)KA43_CH2_CREG; -static volatile unsigned int *ka43_ctag = (void*)KA43_CT2_BASE; +/* Internal CPU register space */ +static volatile struct ka43_cpu_regs *cpu_regs; struct ka43_machine_vector { struct vax_mv mv; @@ -78,34 +75,46 @@ void ka43_post_vm_init(void) { + volatile unsigned int *ctag_addr; + volatile unsigned int *creg_addr; + init_dz11_console(0x200A0000, 3); dz_serial_console_init(0, 0); - ka43_creg = ioremap(KA43_CH2_CREG, 1); - ka43_ctag = ioremap(KA43_CT2_BASE, KA43_CT2_SIZE); + cpu_regs = ioremap(KA43_CPU_BASE, KA43_CPU_SIZE); + creg_addr = ioremap(KA43_CH2_CREG, 1); + ctag_addr = ioremap(KA43_CT2_BASE, KA43_CT2_SIZE); + + /* Disable parity on DMA and CPU memory accesses. Don't know what the + story is with this, but VMS seems do this too... */ + cpu_regs->parctl = 0; /* * Resetting the cache involves disabling it, then clear it and enable again. */ - ka43_cache_disable(); - ka43_cache_clear(); - ka43_cache_enable(); - + ka43_cache_disable(creg_addr); + ka43_cache_clear(ctag_addr); + ka43_cache_enable(creg_addr); + + /* Don't need these mappings any more */ + iounmap((void *)ctag_addr); + iounmap((void *)creg_addr); } -void ka43_cache_disable(void) +void ka43_cache_disable(volatile unsigned int *creg_addr) { __mtpr(KA43_PCS_REFRESH, PR_PCSTS); /* disable primary cache */ __mtpr(__mfpr(PR_PCSTS), PR_PCSTS); /* clear error flags */ /* disable secondary cache */ - *ka43_creg = *ka43_creg & ~KA43_SESR_CENB; + *creg_addr = *creg_addr & ~KA43_SESR_CENB; + /* clear error flags */ - *ka43_creg = KA43_SESR_SERR | KA43_SESR_LERR | KA43_SESR_CERR; + *creg_addr = KA43_SESR_SERR | KA43_SESR_LERR | KA43_SESR_CERR; } -void ka43_cache_clear(void) +void ka43_cache_clear(volatile unsigned int *ctag_addr) { int i; @@ -117,13 +126,13 @@ __mtpr(KA43_PCS_FLUSH | KA43_PCS_REFRESH, PR_PCSTS); - for (i = 0; i < KA43_CT2_SIZE; i+= 4) + for (i = 0; i < KA43_CT2_SIZE / sizeof(*ctag_addr); i++) { - ka43_ctag[i/4] = 0xff; + ctag_addr[i] = 0xff; } } -void ka43_cache_enable(void) +void ka43_cache_enable(volatile unsigned int *creg_addr) { volatile char *membase = (void*)0x80000000; /* physical 0x00 */ int i,val; @@ -133,7 +142,7 @@ __mtpr(KA43_PCS_ENABLE | KA43_PCS_REFRESH, PR_PCSTS); /* enable */ /* enable secondary cache */ - *ka43_creg = KA43_SESR_CENB; + *creg_addr = KA43_SESR_CENB; for (i=0; i<128*1024; i++) { val += membase[i]; } |
From: Kenn H. <ke...@us...> - 2001-03-04 23:44:17
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/vax/boot In directory usw-pr-cvs1:/tmp/cvs-serv15118 Modified Files: tmp_init.c Log Message: Remove obsolete comment and fix compiler warnings Index: tmp_init.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/vax/boot/tmp_init.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- tmp_init.c 2001/02/18 16:42:45 1.8 +++ tmp_init.c 2001/03/04 23:45:50 1.9 @@ -106,12 +106,6 @@ void vax_start_kernel(void) { - unsigned long mempages; -/* this is a temporary command line that allows booting via nfsroot */ -/* - * Interrupts are still disabled. Do necessary setups, then - * enable them - */ /* set the number of 4k pages */ max_pfn = max_hwpfn/8; @@ -143,7 +137,7 @@ printk("RPB info: l_pfncnt: %08x, .l_vmb_version: %08x .l_badpgs: %08x\n", boot_rpb.l_pfncnt, boot_rpb.l_vmb_version, boot_rpb.l_badpgs); - printk("Physical memory: %08x HW pagelets, %08x pages (%dKB)\n", + printk("Physical memory: %08x HW pagelets, %08lx pages (%dKB)\n", max_hwpfn, max_pfn, max_hwpfn/2); printk("CPU type: %s, SID: %08x\n", mv->cpu_type_str(), vax_cpu.sid); @@ -193,7 +187,7 @@ printk("RPB info: l_pfncnt: %08x, .l_vmb_version: %08x .l_badpgs: %08x\n", boot_rpb.l_pfncnt, boot_rpb.l_vmb_version, boot_rpb.l_badpgs); - printk("Physical memory: %08x HW pagelets, %08x pages (%dKB)\n", + printk("Physical memory: %08x HW pagelets, %08lx pages (%dKB)\n", max_hwpfn, max_pfn, max_hwpfn/2); setup_arch(&command_line); |
From: Kenn H. <ke...@us...> - 2001-03-04 23:43:10
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/vax/kernel In directory usw-pr-cvs1:/tmp/cvs-serv15025/kernel Modified Files: Makefile Log Message: Use standard .S -> .o rule as described in Documentation/kbuild/makefiles.txt Index: Makefile =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/vax/kernel/Makefile,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- Makefile 2001/02/18 20:37:39 1.6 +++ Makefile 2001/03/04 23:44:42 1.7 @@ -7,6 +7,8 @@ # # Note 2! The CFLAGS definitions are now in the main makefile... +USE_STANDARD_AS_RULE := true + all: kernel.o O_TARGET := kernel.o |
From: Kenn H. <ke...@us...> - 2001-03-04 23:43:10
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/vax/mm In directory usw-pr-cvs1:/tmp/cvs-serv15025/mm Modified Files: Makefile Log Message: Use standard .S -> .o rule as described in Documentation/kbuild/makefiles.txt Index: Makefile =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/vax/mm/Makefile,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- Makefile 2001/01/20 13:51:05 1.2 +++ Makefile 2001/03/04 23:44:43 1.3 @@ -7,6 +7,8 @@ # # Note 2! The CFLAGS definitions are now in the main makefile... +USE_STANDARD_AS_RULE := true + all: mm.o O_TARGET := mm.o |
From: Kenn H. <ke...@us...> - 2001-03-04 23:43:10
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/vax/boot In directory usw-pr-cvs1:/tmp/cvs-serv15025/boot Modified Files: Makefile Log Message: Use standard .S -> .o rule as described in Documentation/kbuild/makefiles.txt Index: Makefile =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/vax/boot/Makefile,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- Makefile 2001/01/26 00:27:00 1.3 +++ Makefile 2001/03/04 23:44:42 1.4 @@ -9,11 +9,7 @@ # Taking the lead from the alpha -.S.s: - $(CPP) $(AFLAGS) -traditional -o $*.o $< -.S.o: - $(CC) $(AFLAGS) -traditional -c -o $*.o $< - +USE_STANDARD_AS_RULE := true all: head.o libboot.a |
From: Kenn H. <ke...@us...> - 2001-03-04 23:41:20
|
Update of /cvsroot/linux-vax/kernel-2.4 In directory usw-pr-cvs1:/tmp/cvs-serv14928 Modified Files: Rules.make Log Message: Enable assembly listings for standard .S -> .o rule Index: Rules.make =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/Rules.make,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- Rules.make 2001/01/26 00:27:00 1.2 +++ Rules.make 2001/03/04 23:42:52 1.3 @@ -74,7 +74,8 @@ $(CPP) $(AFLAGS) $(EXTRA_AFLAGS) $(AFLAGS_$@) $< > $@ %.o: %.S - $(CC) $(AFLAGS) $(EXTRA_AFLAGS) $(AFLAGS_$@) -c -o $@ $< + $(CC) $(AFLAGS) $(EXTRA_AFLAGS) $(AFLAGS_$@) -c -o $@ $< -Wa,-adnhls=$*.lst -g + endif |
From: Kenn H. <ke...@us...> - 2001-03-04 23:40:09
|
Update of /cvsroot/linux-vax/kernel-2.4/Documentation/vax In directory usw-pr-cvs1:/tmp/cvs-serv14866/Documentation/vax Added Files: cpu.txt Log Message: Start documenting CPU details --- NEW FILE --- $Id: cpu.txt,v 1.1 2001/03/04 23:41:37 kenn Exp $ INTRODUCTION ============ This file attempts to collate all the CPUs that we know about, how they are identified and any quirks or bugs that we need to watch for. VAX CPUs are identified with model numbers beginning with KA followed by 2 or 3 digits. Multiple DEC systems may use the same CPUs, with different surrounding hardware (and slightly different firmware in some cases), but the basic operation should be much the same. These CPUs fall into families that seem to have various codenames (such as RIGEL and MARIAH). Where possible, we will try to use the KAxx designations, rather than the codenames. A VAX CPU is identified during boot by first examining internal processor register 0x3E (PR$_SID). The high byte of this register seems to denote the processor family. The meaning of the low 3 bytes depends on the family. SUPPORTED CPUS ============== KA42 KA43 KA46 KA410 KA630 KA650 UNSUPPORTED CPUS ================ KA41 KA52 KA55 KA60 KA620 KA640 KA655 KA660 KA730 KA750 KA780 KA785 KA790 ******************************************************************************* ******************************************************************************* KA650 ===== Description: Q-22 bus single-board CPU. M-number is M7620. Based on the CVAX implementation of VAX. Sometimes called a MicroVAX III. The only I/O on the CPU itself is the console serial port. Shipped in: VAXstation 3500 Identification: PR$_SID: The high byte is 0x0A. This indicates a CVAX-based CPU. The low byte holds the microcode revision. SIDEX at 20040004: The high byte is 0x01. This seems to indicate a Qbus CPU. Bits 16 to 23 hold the firmware revision. Bits 8 to 15 contain 0x01. This means KA650. The meaning of bits 0 to 7 is unknown. Notes: The KA650's firmware is held in a pair of 27512 EPROMs. Some units shipped with firmware versions that didn't even have a HELP command. Looking at the KA650 firmware, it looks like the same firmware is used in the KA640 and KA655 as well. There are a lot of CASEx instructions that dispatch on bits 8 to 15 of SIDEX. ******************************************************************************* ******************************************************************************* KA43 ==== Description: Integrated CPU and mainboard based on the RIGEL implementation of VAX. The board also contains two NCR5380 SCSI controllers, an AMD LANCE ethernet controller and a DZ11-compatible serial controller. Maximum memory is 32MB. Online copy of the VAXstation 3100 Model 76 Owner's Guide (EK-VX31M-UG) available at http://www.whiteice.com/~williamwebb/intro/DOC-i.html. Shipped in: VAXstation 3100 Model 76 Identification: PR$_SID: The high byte is 0x0B. This seems to indicate a RIGEL-based CPU. The meaning of the low 3 bytes is unknown. SIDEX at 20040004: The meaning of the SIDEX is unknown. Notes: Sharing memory with the LANCE chip requires a bit of hackery. Physical memory is accessible from 0x00000000 to 0x01ffffff (as normal), but is also accessible via the "DIAGMEM" region of I/O space from 0x28000000 to 0x29ffffff. To prevent strange behaviour (such as memory read parity error machine checks), you _must_ read and write the memory shared with the LANCE via the DIAGMEM region. One way to do this is to kmalloc() a region for the LANCE structures and buffers and modify the PTEs for this region to OR in bits 0x00140000 in the PFN field (to make them point to the DIAGMEM region). Actually, using get_free_pages() might be a better idea, since there might be other data structures sharing pages with this region, because kmalloc() doesn't page-align. Another way is to calculate the physical addresses behind the kmalloc()ed region and ioremap() them. This has the disadvantage of using twice as many PTEs. It looks like this might be needed for DMA to the SCSI controllers as well. |