wbflush.c
上传用户:lgb322
上传日期:2013-02-24
资源大小:30529k
文件大小:2k
- /*
- * Setup the right wbflush routine for the different DECstations.
- *
- * Created with information from:
- * DECstation 3100 Desktop Workstation Functional Specification
- * DECstation 5000/200 KN02 System Module Functional Specification
- * mipsel-linux-objdump --disassemble vmunix | grep "wbflush" :-)
- *
- * 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.
- *
- * Copyright (C) 1998 Harald Koerfgen
- */
- #include <asm/bootinfo.h>
- #include <linux/init.h>
- static void wbflush_kn01(void);
- static void wbflush_kn210(void);
- static void wbflush_kn02ba(void);
- static void wbflush_kn03(void);
- void (*__wbflush) (void);
- void __init wbflush_setup(void)
- {
- switch (mips_machtype) {
- case MACH_DS23100:
- __wbflush = wbflush_kn01;
- break;
- case MACH_DS5100: /* DS5100 MIPSMATE */
- __wbflush = wbflush_kn210;
- break;
- case MACH_DS5000_200: /* DS5000 3max */
- __wbflush = wbflush_kn01;
- break;
- case MACH_DS5000_1XX: /* DS5000/100 3min */
- __wbflush = wbflush_kn02ba;
- break;
- case MACH_DS5000_2X0: /* DS5000/240 3max+ */
- __wbflush = wbflush_kn03;
- break;
- case MACH_DS5000_XX: /* Personal DS5000/2x */
- __wbflush = wbflush_kn02ba;
- break;
- }
- }
- /*
- * For the DS3100 and DS5000/200 the writeback buffer functions
- * as part of Coprocessor 0.
- */
- static void wbflush_kn01(void)
- {
- asm(".settpushnt"
- ".settnoreordernt"
- "1:tbc0ft1bnt"
- "nopnt"
- ".settpop");
- }
- /*
- * For the DS5100 the writeback buffer seems to be a part of Coprocessor 3.
- * But CP3 has to enabled first.
- */
- static void wbflush_kn210(void)
- {
- asm(".settpushnt"
- ".settnoreordernt"
- "mfc0t$2,$12nt"
- "luit$3,0x8000nt"
- "ort$3,$2,$3nt"
- "mtc0t$3,$12nt"
- "nopn"
- "1:tbc3ft1bnt"
- "nopnt"
- "mtc0t$2,$12nt"
- "nopnt"
- ".settpop"
- : : :"$2", "$3");
- }
- /*
- * Looks like some magic with the System Interrupt Mask Register
- * in the famous IOASIC for kmins and maxines.
- */
- static void wbflush_kn02ba(void)
- {
- asm(".settpushnt"
- ".settnoreordernt"
- "luit$2,0xbc04nt"
- "lwt$3,0x120($2)nt"
- "lwt$3,0x120($2)nt"
- ".settpop"
- : : :"$2", "$3");
- }
- /*
- * The DS500/2x0 doesnt need to write back the WB.
- */
- static void wbflush_kn03(void)
- {
- }
- #include <linux/module.h>
- EXPORT_SYMBOL(__wbflush);