|
From: Kenn H. <ke...@us...> - 2004-10-02 11:43:06
|
Update of /cvsroot/linux-vax/kernel-2.5/arch/vax/boot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11843/arch/vax/boot Modified Files: cpu_sel.c Log Message: Switch over to new-style CPU identification. Rename the "machine vector match" stuff to "CPU match". Index: cpu_sel.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.5/arch/vax/boot/cpu_sel.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- cpu_sel.c 30 Sep 2004 08:26:55 -0000 1.13 +++ cpu_sel.c 2 Oct 2004 11:42:46 -0000 1.14 @@ -9,9 +9,6 @@ #include <asm/mv.h> /* machine vector definitions */ #include <linux/mm.h> /* for PAGE_OFFSET and KERNEL_START_PHYS */ #include <asm/system.h> /* for HALT */ -#include <asm/vaxcpu.h> /* CPU type definitions */ - -#ifdef USE_NEW_VECTORS /* * Given a virtual address in the final kernel image (i.e. an S0 @@ -31,37 +28,37 @@ { unsigned long sid; unsigned long sidex; - struct machvec_match *mvm; + struct cpu_match *match; unsigned int i; unsigned int num_matches; struct vax_mv *retmv; - extern struct machvec_match __init_vecmatch_start, __init_vecmatch_end; + extern struct cpu_match __init_cpumatch_start, __init_cpumatch_end; sid = __mfpr (PR_SID); - num_matches = &__init_vecmatch_end - &__init_vecmatch_start; + num_matches = &__init_cpumatch_end - &__init_cpumatch_start; for (i = 0; i < num_matches; i++) { - mvm = &__init_vecmatch_start + i; + match = &__init_cpumatch_start + i; - if ((sid & mvm->sid_mask) == mvm->sid_match) { + if ((sid & match->sid_mask) == match->sid_match) { /* * No sidex known? Accept the vector. * FIXME: Maybe sort the metch structs to have * those with "long" masks first, then the loose * entries with weaker/shorter masks */ - if (!mvm->sidex_addr) - return s0vmaddr_to_load_addr(mvm->mv); + if (!match->sidex_addr) + return s0vmaddr_to_load_addr(match->mv); /* * If a SIDEX match was supplied, too, check it! */ - sidex = * ((unsigned long *) mvm->sidex_addr); - if ((sidex & mvm->sidex_mask) == mvm->sidex_match) { - retmv = s0vmaddr_to_load_addr(mvm->mv); + sidex = * ((unsigned long *) match->sidex_addr); + if ((sidex & match->sidex_mask) == match->sidex_match) { + retmv = s0vmaddr_to_load_addr(match->mv); retmv->sidex = sidex; return retmv; } @@ -79,274 +76,3 @@ return NULL; } -#else /* USE_NEW_VECTORS */ - -static struct vax_mv *idcpu_uvax2(unsigned int sid) -{ - unsigned int subtype; - - subtype = (sid & UVAX2_SID_SUBTYPE_MASK) >> UVAX2_SID_SUBTYPE_SHIFT; - - switch (subtype) { -#ifdef CONFIG_CPU_KA630 - case UVAX2_SID_SUBTYPE_KA630: - case UVAX2_SID_SUBTYPE_CHARON: - return &mv_ka630; -#endif - -#ifdef CONFIG_CPU_KA410 - case UVAX2_SID_SUBTYPE_KA410: - return &mv_ka410; -#endif - - default: - /* - * Unsupported MicroVAX II CPU - Type E/I PR$_SID - * at console to get SID value and report to - * <lin...@mi...>. - */ - HALT; - } - - return NULL; -} - -static struct vax_mv *idcpu_cvax_qbus(unsigned int sidex) -{ - unsigned int subtype; - - subtype = (sidex & CVAX_Q22_SUBTYPE_MASK) >> CVAX_Q22_SUBTYPE_SHIFT; - - /* - * There are 3 different Q22 CVAX implementations, we only support - * the KA650 and KA655 at the moment. The KA640 should be fairly - * similar, since all three have the same firmware. - */ - switch (subtype) { -#ifdef CONFIG_CPU_KA650 - case CVAX_Q22_SUBTYPE_KA650: - case CVAX_Q22_SUBTYPE_KA655: - return &mv_ka650; -#endif - -#ifdef CONFIG_CPU_KA640 - case CVAX_Q22_SUBTYPE_KA640: - return &mv_ka640; -#endif - - default: - /* - * Unsupported QBUS CVAX CPU - Type E/P/L 20040004 - * at console to get SIDEX value and report to - * <lin...@mi...>. - */ - HALT; - } - - return NULL; -} - -static struct vax_mv *idcpu_cvax_vs3100(unsigned int sidex) -{ - /* - * We don't know how to interpret the SIDEX in this case, but the - * only CPU we know of that will match this far is the KA42 (as - * used in VS3100/m38) - */ - -#ifdef CONFIG_CPU_KA42 - return &mv_ka42; -#else - HALT; - return NULL; -#endif -} - -static struct vax_mv *idcpu_cvax(void) -{ - unsigned int sidex; - unsigned int type; - - sidex = *(long *)CVAX_SIDEX_ADDR; - type = (sidex & CVAX_SIDEX_TYPE_MASK) >> CVAX_SIDEX_TYPE_SHIFT; - - switch (type) { - case CVAX_SIDEX_TYPE_Q22: - return idcpu_cvax_qbus(sidex); - - case CVAX_SIDEX_TYPE_VS3100: - return idcpu_cvax_vs3100(sidex); - - default: - /* - * Unsupported CVAX CPU - Type E/P/L 20040004 at - * console to get SIDEX value and report to - * <lin...@mi...>. - */ - HALT; - } - - return NULL; -} - -static struct vax_mv *idcpu_soc_qbus(unsigned int sidex) -{ - unsigned int subtype; - - subtype = (sidex & SOC_Q22_SUBTYPE_MASK) >> SOC_Q22_SUBTYPE_SHIFT; - - switch (subtype) { - -#ifdef CONFIG_CPU_KA660 - case SOC_Q22_SUBTYPE_KA660: - return &mv_ka660; -#endif - - default: - /* - * Unsupported QBUS SOC CPU - Type E/P/L 20040004 - * at console to get SIDEX value and report to - * <lin...@mi...>. - */ - HALT; - } - - return NULL; -} - -static struct vax_mv *idcpu_soc(void) -{ - unsigned int sidex; - unsigned int type; - - sidex = *(long *)SOC_SIDEX_ADDR; - type = (sidex & SOC_SIDEX_TYPE_MASK) >> SOC_SIDEX_TYPE_SHIFT; - - switch (type) { - case SOC_SIDEX_TYPE_Q22: - return idcpu_soc_qbus(sidex); - -#ifdef CONFIG_CPU_VXT - case SOC_SIDEX_TYPE_VXT: - return &mv_vxt; -#endif - -#ifdef CONFIG_CPU_KA48 - case SOC_SIDEX_TYPE_KA48: - return &mv_ka48; -#endif - - default: - /* - * Unsupported SOC CPU - Type E/P/L 20040004 at - * console to get SIDEX value and report to - * <lin...@mi...>. - */ - HALT; - } - - return NULL; -} - -static struct vax_mv *idcpu_rigel(void) -{ - /* - * We don't know how to interpret the SIDEX in this case, but the - * only CPU we know of that will match this far is the KA43 (as - * used in VS3100/m76). - */ - -#ifdef CONFIG_CPU_KA43 - return &mv_ka43; -#else - HALT; - return NULL; -#endif -} - -static struct vax_mv *idcpu_mariah(void) -{ - /* - * We don't know how to interpret the SIDEX in this case, but the - * only CPU we know of that will match this far is the KA46 (as - * used in VS4000/m60). - */ - -#ifdef CONFIG_CPU_KA46 - return &mv_ka46; -#else - HALT; - return NULL; -#endif -} - -static struct vax_mv *idcpu_nvax(void) -{ - /* - * We don't know how to interpret the SIDEX in this case, but the - * only CPU we know of that will match this far is the KA55 (as - * used in MicroVAX 3100m85). - */ - -#ifdef CONFIG_CPU_KA55 - return &mv_ka55; -#else - HALT; - return NULL; -#endif -} - -struct vax_mv *idcpu(void) -{ - unsigned int sid; - unsigned int family; - - /* - * First get SID processor register. VARM says all CPUs must - * implement this! - */ - sid = __mfpr(PR_SID); - - /* - * CPU family is high byte of SID, remaining subtype - * is family-specific. - */ - family = (sid & VAX_SID_FAMILY_MASK) >> VAX_SID_FAMILY_SHIFT; - - switch (family) { - case VAX_CVAX: - return idcpu_cvax(); - - case VAX_RIGEL: - return idcpu_rigel(); - - case VAX_MARIAH: - return idcpu_mariah(); - - case VAX_NVAX: - return idcpu_nvax(); - - case VAX_SOC: - return idcpu_soc(); - - case VAX_UVAX2: - return idcpu_uvax2(sid); - - case VAX_780: - case VAX_750: - case VAX_730: - case VAX_8600: - case VAX_UVAX1: - default: - /* - * Unsupported CPU family - Type E/I PR$_SID at - * console to get SID register value and report to - * <lin...@mi...>. - */ - HALT; - } - - return NULL; -} -#endif - |