From: Richard B. <rb...@us...> - 2002-12-02 02:55:22
|
Update of /cvsroot/linux-vax/kernel-2.4/drivers/vsbus In directory sc8-pr-cvs1:/tmp/cvs-serv8266/drivers/vsbus Modified Files: vsbus.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: vsbus.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/vsbus/vsbus.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- vsbus.c 29 May 2002 03:02:50 -0000 1.9 +++ vsbus.c 2 Dec 2002 02:55:11 -0000 1.10 @@ -14,38 +14,24 @@ #include <asm/mv.h> #include <asm/ka43.h> -#include <asm/ka55.h> -extern struct vax_mv mv_ka46; -extern struct vax_mv mv_ka55; -struct vsbus { - struct vs_cpu *vs_cpu_ptr; - unsigned char vs_mask; - unsigned char vs_enabled; -} sys_vs; - -struct ka55_cpu_regs *ka55_cpu; - -int is_ka46(void) { return (mv==&mv_ka46); } - -int is_ka55(void) { return (mv==&mv_ka55); } +struct vsbus sys_vs; int vsbus_setup(void) { unsigned long irqs; - if (!is_ka55()){ + if (mv->cpu_type!=MV_CPU_KA55){ sys_vs.vs_cpu_ptr=(void *)ioremap(VSA_BASE_REGS, 128); sys_vs.vs_mask=sys_vs.vs_cpu_ptr->vc_intreq; } else { - sys_vs.vs_cpu_ptr=(void *)ioremap(VSA_KA55_BASE_REGS,128); - ka55_cpu = (struct ka55_cpu_regs *)sys_vs.vs_cpu_ptr; - sys_vs.vs_mask=ka55_cpu->intreq; + sys_vs.ka55_cpu_ptr=(void *)ioremap(VSA_KA55_BASE_REGS,128); + sys_vs.vs_mask=sys_vs.ka55_cpu_ptr->intreq; } irqs=probe_irq_on(); - if (!is_ka55()) { + if (mv->cpu_type!=MV_CPU_KA55) { sys_vs.vs_cpu_ptr->vc_intmsk=0; sys_vs.vs_cpu_ptr->vc_intclr=0xFF; mdelay(1000); @@ -55,10 +41,10 @@ sys_vs.vs_cpu_ptr->vc_intmsk=0; /*~sys_vs.vs_mask;*/ } else { - ka55_cpu->intmsk = 0; - ka55_cpu->intclr = 0xff; + sys_vs.ka55_cpu_ptr->intmsk = 0; + sys_vs.ka55_cpu_ptr->intclr = 0xff; mdelay(1000); - sys_vs.vs_mask=ka55_cpu->intreq; + sys_vs.vs_mask=sys_vs.ka55_cpu_ptr->intreq; } probe_irq_off(irqs); return 0; @@ -66,30 +52,30 @@ int vsbus_enable_int(int bit_nr) { - if (!is_ka55()) + if (mv->cpu_type!=MV_CPU_KA55) sys_vs.vs_cpu_ptr->vc_intmsk|=1<<bit_nr; else - ka55_cpu->intmsk|=1<<bit_nr; + sys_vs.ka55_cpu_ptr->intmsk|=1<<bit_nr; sys_vs.vs_enabled |= 1<< bit_nr; return 0; } int vsbus_clear_int(int bit_nr) { - if(!is_ka55()) + if(mv->cpu_type!=MV_CPU_KA55) sys_vs.vs_cpu_ptr->vc_intclr=1<<bit_nr; else - ka55_cpu->intclr=1<<bit_nr; + sys_vs.ka55_cpu_ptr->intclr=1<<bit_nr; return 0; } int vsbus_disable_int(int bit_nr) { - if (!is_ka55()) + if (mv->cpu_type!=MV_CPU_KA55) sys_vs.vs_cpu_ptr->vc_intmsk&=~(1<<bit_nr); else - ka55_cpu->intmsk&=~(1<<bit_nr); + sys_vs.ka55_cpu_ptr->intmsk&=~(1<<bit_nr); sys_vs.vs_enabled &= ~(1<<bit_nr); return 0; } @@ -97,12 +83,12 @@ int vsbus_probe_irq_on(void) { printk("vsbus: probing set mask ~%2X\n", sys_vs.vs_mask); - if (!is_ka55()){ + if (mv->cpu_type!=MV_CPU_KA55){ sys_vs.vs_cpu_ptr->vc_intmsk = 0; //~sys_vs.vs_mask; sys_vs.vs_cpu_ptr->vc_intclr=0xff; } else { - ka55_cpu->intmsk=0; - ka55_cpu->intclr=0xff; + sys_vs.ka55_cpu_ptr->intmsk=0; + sys_vs.ka55_cpu_ptr->intclr=0xff; } return 0; } @@ -111,15 +97,15 @@ { unsigned char x, y; - if (!is_ka55()) + if (mv->cpu_type!=MV_CPU_KA55) x=sys_vs.vs_cpu_ptr->vc_intreq; else - x=ka55_cpu->intreq; + x=sys_vs.ka55_cpu_ptr->intreq; y = x & ~sys_vs.vs_mask; printk("vsbus: probe returning %2X, %2X\n", x, ffs(y)); - if(!is_ka55()) + if(mv->cpu_type!=MV_CPU_KA55) sys_vs.vs_cpu_ptr->vc_intmsk = sys_vs.vs_enabled; else - ka55_cpu->intmsk=sys_vs.vs_enabled; + sys_vs.ka55_cpu_ptr->intmsk=sys_vs.vs_enabled; return ffs(y)-1; } |