From: Richard B. <rb...@us...> - 2002-12-02 02:55:21
|
Update of /cvsroot/linux-vax/kernel-2.4/drivers/scsi In directory sc8-pr-cvs1:/tmp/cvs-serv8266/drivers/scsi Modified Files: vax_esp.c Log Message: Added cpu_type to machine vector. Use this to remove the is_ka55 and is_ka46 calls and replace with a more generic cpu_type check. Changed the drivers for the dz, lance, sgec and vax_esp devices. Also merged the ka55.h file into the vsa.h file and added the vsbus struct into the same file. Actual register and hex addresses are still hardcoded for the moment, but at least this is a bit cleaner than before... Index: vax_esp.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/scsi/vax_esp.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- vax_esp.c 29 Nov 2002 04:32:44 -0000 1.4 +++ vax_esp.c 2 Dec 2002 02:55:11 -0000 1.5 @@ -25,10 +25,11 @@ #include <asm/mm/pagelet.h> #include <asm/vsa.h> #include <asm/mv.h> -#include <asm/ka55.h> #include <asm/pgtable.h> +extern struct vsbus sys_vs; + static int dma_bytes_sent(struct NCR_ESP *esp, int fifo_count); static void dma_drain(struct NCR_ESP *esp); static int dma_can_transfer(struct NCR_ESP *esp, Scsi_Cmnd * sp); @@ -59,8 +60,6 @@ unsigned char *scsi_dma_buffer; /* 64K area for DMA transfers */ int scsi_current_length = 0; -extern struct ka55_cpu_regs *ka55_cpu; - unsigned long *esp_pte; /* device page table pointer */ unsigned long esp_pte_offset; @@ -75,17 +74,18 @@ unsigned long *pte; unsigned long l,m; - //scsi_base = 0x200c0080; - - /* On the 3100/85: + /* On the KA55: * The SCSI DMA registers are at 0x25c00000 (address & direction) which * is part of the vsbus cpu registers and should already be mapped * The SCSI DMA Map registers are at 0x27000000-27007FFF (8K) * The SCSI controller registers are at0X26000080-BF */ - scsi_base = 0x26000080; /* hardcode for 3100/85 for now */ - + if (mv->cpu_type != MV_CPU_KA55) + scsi_base = 0x200c0080; + else + scsi_base = 0x26000080; + esp_dev = 0; esp = esp_allocate(tpnt, (void *) esp_dev); @@ -170,8 +170,8 @@ /* need to set the address and direction scsi registers. * on the KA55 they're located in the cpu register area. */ - ka55_cpu->scsi_adr = virt_to_phys(scsi_dma_buffer); - ka55_cpu->scsi_dir = VAX_SCSI_DMA_MAP_LOADED | VAX_SCSI_DMA_ACTIVE; + sys_vs.ka55_cpu_ptr->scsi_adr = virt_to_phys(scsi_dma_buffer); + sys_vs.ka55_cpu_ptr->scsi_dir = VAX_SCSI_DMA_MAP_LOADED | VAX_SCSI_DMA_ACTIVE; // esp->irq = SCSI_INT; esp->irq = 255; @@ -267,9 +267,9 @@ } printk("]\n"); printk("vax_esp: dma_init_write: setting scsi_adr to 0x%x\n",virt_to_phys(scsi_dma_buffer)); - ka55_cpu->scsi_adr = virt_to_phys(scsi_dma_buffer); /* note: virtual address */ + sys_vs.ka55_cpu_ptr->scsi_adr = virt_to_phys(scsi_dma_buffer); /* note: virtual address */ /* tell device that it should read from memory */ - ka55_cpu->scsi_dir |= VAX_SCSI_DMA_FROM_MEMORY; + sys_vs.ka55_cpu_ptr->scsi_dir |= VAX_SCSI_DMA_FROM_MEMORY; } static void dma_ints_off(struct NCR_ESP *esp) |