setup.c
上传用户:jlfgdled
上传日期:2013-04-10
资源大小:33168k
文件大小:16k
源码类别:

Linux/Unix编程

开发平台:

Unix_Linux

  1. /*
  2.  * setup.c: Baget/MIPS specific setup, including init of the feature struct.
  3.  *
  4.  * Copyright (C) 1998 Gleb Raiko & Vladimir Roganov
  5.  */
  6. #include <linux/init.h>
  7. #include <linux/kernel.h>
  8. #include <linux/sched.h>
  9. #include <asm/irq.h>
  10. #include <asm/addrspace.h>
  11. #include <asm/reboot.h>
  12. #include <asm/baget/baget.h>
  13. long int vac_memory_upper;
  14. #define CACHEABLE_STR(val) ((val) ? "not cached" : "cached")
  15. #define MIN(a,b)           (((a)<(b)) ? (a):(b)) 
  16. static void __init vac_show(void)
  17. int i;
  18. unsigned short val, decode = vac_inw(VAC_DECODE_CTRL);
  19. unsigned short a24_base = vac_inw(VAC_A24_BASE);
  20. unsigned long  a24_addr = ((unsigned long)
  21.    (a24_base & VAC_A24_MASK)) << 16;
  22. char *decode_mode[]  = { "eprom", "vsb", "shared", "dram" };
  23. char *address_mode[] = { "", ", A16", ", A32/A24", ", A32/A24/A16" };
  24. char *state[] = { "", " on write", " on read", " on read/write", };
  25. char *region_mode[] = { "inactive", "shared", "vsb", "vme" };
  26. char *asiz[]        = { "user", "A32", "A16", "A24" };
  27. unsigned short regs[] = { VAC_REG1,     VAC_REG2, VAC_REG3  };
  28. unsigned short bndr[] = { VAC_DRAM_MASK,VAC_BNDR2,VAC_BNDR3 };
  29. unsigned short io_sels[] = { VAC_IOSEL0_CTRL,
  30.      VAC_IOSEL1_CTRL,
  31.      VAC_IOSEL2_CTRL,
  32.      VAC_IOSEL3_CTRL,
  33.      VAC_IOSEL4_CTRL,
  34.      VAC_IOSEL5_CTRL };
  35. printk("[DSACKi %s, DRAMCS%s qualified, boundary%s qualified%s]n",
  36.        (decode & VAC_DECODE_DSACKI)     ? "on" : "off",
  37.        (decode & VAC_DECODE_QFY_DRAMCS) ? ""   : " not",
  38.        (decode & VAC_DECODE_QFY_BNDR)   ? ""   : " not",
  39.        (decode & VAC_DECODE_FPUCS)      ? ", fpu" : "");
  40. printk("slave0 ");
  41. if (decode & VAC_DECODE_RDR_SLSEL0)
  42. printk("at %08lx (%d MB)t[dram %s]n",
  43.        ((unsigned long)vac_inw(VAC_SLSEL0_BASE))<<16,
  44.        ((0xffff ^ vac_inw(VAC_SLSEL0_MASK)) + 1) >> 4,
  45.        (decode & VAC_DECODE_QFY_SLSEL0) ? "qualified" : "");
  46. else
  47. printk("offn");
  48. printk("slave1 ");
  49. if (decode & VAC_DECODE_RDR_SLSEL1)
  50. printk("at %08lx (%d MB)t[%s%s, %s]n",
  51.        ((unsigned long)vac_inw(VAC_SLSEL1_BASE))<<16,
  52.        ((0xffff ^ vac_inw(VAC_SLSEL1_MASK)) + 1) >> 4,
  53.        decode_mode[VAC_DECODE_MODE_VAL(decode)],
  54.        address_mode[VAC_DECODE_CMP_SLSEL1_VAL(decode)],
  55.        (decode & VAC_DECODE_QFY_SLSEL1) ? "qualified" : "");
  56. else
  57. printk("offn");
  58. printk("icf global at %04x, module at %04x [%s]n",
  59.        ((unsigned int)
  60. VAC_ICFSEL_GLOBAL_VAL(vac_inw(VAC_ICFSEL_BASE)))<<4,
  61.        ((unsigned int)
  62. VAC_ICFSEL_MODULE_VAL(vac_inw(VAC_ICFSEL_BASE)))<<4,
  63.        (decode & VAC_DECODE_QFY_ICFSEL) ? "qualified" : "");
  64. printk("region0 at 00000000 (%dMB)t[dram, %s, delay %d cpuclk"
  65.        ", cached]n",
  66.        (vac_inw(VAC_DRAM_MASK)+1)>>4,
  67.        (decode & VAC_DECODE_DSACK) ? "D32" : "3state",
  68.        VAC_DECODE_CPUCLK_VAL(decode));
  69. for (i = 0; i < sizeof(regs)/sizeof(regs[0]); i++) {
  70. unsigned long from = 
  71. ((unsigned long)vac_inw(bndr[i]))<<16;
  72. unsigned long to   = 
  73. ((unsigned long)
  74.  ((i+1 == sizeof(bndr)/sizeof(bndr[0])) ? 
  75.   0xff00 : vac_inw(bndr[i+1])))<<16;
  76. val = vac_inw(regs[i]);
  77. printk("region%d at %08lx (%dMB)t[%s %s/%s, %s]n", 
  78.        i+1,
  79.        from,
  80.        (unsigned int)((to - from) >> 20),
  81.        region_mode[VAC_REG_MODE(val)],
  82.        asiz[VAC_REG_ASIZ_VAL(val)],
  83.        ((val & VAC_REG_WORD) ?  "D16" : "D32"),
  84.        CACHEABLE_STR(val&VAC_A24_A24_CACHINH));
  85. if (a24_addr >= from && a24_addr < to)
  86. printk("ta24 at %08lx (%dMB)t[vme, A24/%s, %s]n",
  87.        a24_addr,
  88.        MIN((unsigned int)(a24_addr - from)>>20, 32),
  89.        (a24_base & VAC_A24_DATAPATH) ?  "user" :
  90.        ((a24_base & VAC_A24_D32_ENABLE)  ?  
  91. "D32" : "D16"),
  92.        CACHEABLE_STR(a24_base & VAC_A24_A24_CACHINH));
  93. }
  94. printk("region4 at ff000000 (15MB)t[eprom]n");
  95. val = vac_inw(VAC_EPROMCS_CTRL);
  96. printk("t[ack %d cpuclk%s, %s%srecovery %d cpuclk, "
  97.        "read %d%s, write %d%s, assert %d%s]n",
  98.        VAC_CTRL_DELAY_DSACKI_VAL(val),
  99.        state[val & (VAC_CTRL_IORD|VAC_CTRL_IOWR)],
  100.        (val & VAC_CTRL_DSACK0) ? "dsack0*, " : "",
  101.        (val & VAC_CTRL_DSACK1) ? "dsack1*, " : "",
  102.        VAC_CTRL_RECOVERY_IOSELI_VAL(val),
  103.        VAC_CTRL_DELAY_IORD_VAL(val)/2,
  104.        (VAC_CTRL_DELAY_IORD_VAL(val)&1) ? ".5" : "",
  105.        VAC_CTRL_DELAY_IOWR_VAL(val)/2,
  106.        (VAC_CTRL_DELAY_IOWR_VAL(val)&1) ? ".5" : "",
  107.        VAC_CTRL_DELAY_IOSELI_VAL(val)/2,
  108.        (VAC_CTRL_DELAY_IOSELI_VAL(val)&1) ? ".5" : "");
  109. printk("region5 at fff00000 (896KB)t[local io, %s]n",
  110.        CACHEABLE_STR(vac_inw(VAC_A24_BASE) & VAC_A24_IO_CACHINH));
  111. for (i = 0; i < sizeof(io_sels)/sizeof(io_sels[0]); i++) {
  112. val = vac_inw(io_sels[i]);
  113. printk("tio%d[ack %d cpuclk%s, %s%srecovery %d cpuclk, "
  114.        "nt read %d%s cpuclk, write %d%s cpuclk, "
  115.        "assert %d%s%s cpuclk]n",
  116.        i, 
  117.        VAC_CTRL_DELAY_DSACKI_VAL(val),
  118.        state[val & (VAC_CTRL_IORD|VAC_CTRL_IOWR)],
  119.        (val & VAC_CTRL_DSACK0) ? "dsack0*, " : "",
  120.        (val & VAC_CTRL_DSACK1) ? "dsack1*, " : "",
  121.        VAC_CTRL_RECOVERY_IOSELI_VAL(val),
  122.        VAC_CTRL_DELAY_IORD_VAL(val)/2,
  123.        (VAC_CTRL_DELAY_IORD_VAL(val)&1) ? ".5" : "",
  124.        VAC_CTRL_DELAY_IOWR_VAL(val)/2,
  125.        (VAC_CTRL_DELAY_IOWR_VAL(val)&1) ? ".5" : "",
  126.        VAC_CTRL_DELAY_IOSELI_VAL(val)/2,
  127.        (VAC_CTRL_DELAY_IOSELI_VAL(val)&1) ? ".5" : "",
  128.        (vac_inw(VAC_DEV_LOC) & VAC_DEV_LOC_IOSEL(i)) ? 
  129.           ", id" : "");
  130. }
  131. printk("region6 at fffe0000 (128KB)t[vme, A16/%s, "
  132.        "not cached]n",
  133.        (a24_base & VAC_A24_A16D32_ENABLE) ? 
  134.        ((a24_base & VAC_A24_A16D32) ? "D32" : "D16") : "user");
  135.        
  136. val = vac_inw(VAC_SHRCS_CTRL);
  137. printk("shared[ack %d cpuclk%s, %s%srecovery %d cpuclk, "
  138.        "read %d%s, write %d%s, assert %d%s]n",
  139.        VAC_CTRL_DELAY_DSACKI_VAL(val),
  140.        state[val & (VAC_CTRL_IORD|VAC_CTRL_IOWR)],
  141.        (val & VAC_CTRL_DSACK0) ? "dsack0*, " : "",
  142.        (val & VAC_CTRL_DSACK1) ? "dsack1*, " : "",
  143.        VAC_CTRL_RECOVERY_IOSELI_VAL(val),
  144.        VAC_CTRL_DELAY_IORD_VAL(val)/2,
  145.        (VAC_CTRL_DELAY_IORD_VAL(val)&1) ? ".5" : "",
  146.        VAC_CTRL_DELAY_IOWR_VAL(val)/2,
  147.        (VAC_CTRL_DELAY_IOWR_VAL(val)&1) ? ".5" : "",
  148.        VAC_CTRL_DELAY_IOSELI_VAL(val)/2,
  149.        (VAC_CTRL_DELAY_IOSELI_VAL(val)&1) ? ".5" : "");
  150. }
  151. static void __init vac_init(void)
  152. {
  153. unsigned short mem_limit = (vac_memory_upper >> 16);
  154. switch(vac_inw(VAC_ID)) {
  155. case 0x1AC0:
  156. printk("VAC068-F5: ");
  157. break;
  158. case 0x1AC1:
  159. printk("VAC068A: ");
  160. break;
  161. default:
  162. panic("Unknown VAC revision number");
  163. }
  164. vac_outw(mem_limit-1, VAC_DRAM_MASK); 
  165. vac_outw(mem_limit, VAC_BNDR2);
  166. vac_outw(mem_limit, VAC_BNDR3);
  167. vac_outw(((BAGET_A24M_BASE>>16)&~VAC_A24_D32_ENABLE)|VAC_A24_DATAPATH,
  168.  VAC_A24_BASE);
  169. vac_outw(VAC_REG_INACTIVE|VAC_REG_ASIZ0,VAC_REG1);
  170. vac_outw(VAC_REG_INACTIVE|VAC_REG_ASIZ0,VAC_REG2);
  171. vac_outw(VAC_REG_MWB|VAC_REG_ASIZ1,VAC_REG3);
  172. vac_outw(BAGET_A24S_BASE>>16,VAC_SLSEL0_BASE);
  173. vac_outw(BAGET_A24S_MASK>>16,VAC_SLSEL0_MASK);
  174. vac_outw(BAGET_A24S_BASE>>16,VAC_SLSEL1_BASE);
  175. vac_outw(BAGET_A24S_MASK>>16,VAC_SLSEL1_MASK);
  176. vac_outw(BAGET_GSW_BASE|BAGET_MSW_BASE(0),VAC_ICFSEL_BASE);
  177. vac_outw(VAC_DECODE_FPUCS|
  178.  VAC_DECODE_CPUCLK(3)|
  179.  VAC_DECODE_RDR_SLSEL0|VAC_DECODE_RDR_SLSEL1|
  180.  VAC_DECODE_DSACK|
  181.  VAC_DECODE_QFY_BNDR|
  182.  VAC_DECODE_QFY_ICFSEL|
  183.  VAC_DECODE_QFY_SLSEL1|VAC_DECODE_QFY_SLSEL0|
  184.  VAC_DECODE_CMP_SLSEL1_HI|
  185.  VAC_DECODE_DRAMCS|
  186.  VAC_DECODE_QFY_DRAMCS|
  187.  VAC_DECODE_DSACKI,VAC_DECODE_CTRL);
  188. vac_outw(VAC_PIO_FUNC_UART_A_TX|VAC_PIO_FUNC_UART_A_RX|
  189.  VAC_PIO_FUNC_UART_B_TX|VAC_PIO_FUNC_UART_B_RX|
  190.  VAC_PIO_FUNC_IOWR|
  191.  VAC_PIO_FUNC_IOSEL3|
  192.  VAC_PIO_FUNC_IRQ7|VAC_PIO_FUNC_IRQ10|VAC_PIO_FUNC_IRQ11|
  193.  VAC_PIO_FUNC_IOSEL2|
  194.  VAC_PIO_FUNC_FCIACK,VAC_PIO_FUNC);
  195. vac_outw(VAC_PIO_DIR_FCIACK |
  196.  VAC_PIO_DIR_OUT(0) |
  197.  VAC_PIO_DIR_OUT(1) |
  198.  VAC_PIO_DIR_OUT(2) |
  199.  VAC_PIO_DIR_OUT(3) |
  200.  VAC_PIO_DIR_IN(4)  |
  201.  VAC_PIO_DIR_OUT(5) |
  202.  VAC_PIO_DIR_OUT(6) |
  203.  VAC_PIO_DIR_OUT(7) |
  204.  VAC_PIO_DIR_OUT(8) |
  205.  VAC_PIO_DIR_IN(9)  |
  206.  VAC_PIO_DIR_OUT(10)|
  207.  VAC_PIO_DIR_OUT(11)|
  208.  VAC_PIO_DIR_OUT(12)|
  209.  VAC_PIO_DIR_OUT(13),VAC_PIO_DIRECTION);
  210. vac_outw(VAC_DEV_LOC_IOSEL(2),VAC_DEV_LOC);
  211. vac_outw(VAC_CTRL_IOWR|
  212.  VAC_CTRL_DELAY_IOWR(3)|
  213.  VAC_CTRL_DELAY_IORD(3)|
  214.  VAC_CTRL_RECOVERY_IOSELI(1)|
  215.  VAC_CTRL_DELAY_DSACKI(8),VAC_SHRCS_CTRL);
  216. vac_outw(VAC_CTRL_IOWR|
  217.  VAC_CTRL_DELAY_IOWR(3)|
  218.  VAC_CTRL_DELAY_IORD(3)|
  219.  VAC_CTRL_RECOVERY_IOSELI(1)|
  220.  VAC_CTRL_DSACK0|VAC_CTRL_DSACK1|
  221.  VAC_CTRL_DELAY_DSACKI(8),VAC_EPROMCS_CTRL);
  222. vac_outw(VAC_CTRL_IOWR|
  223.  VAC_CTRL_DELAY_IOWR(3)|
  224.  VAC_CTRL_DELAY_IORD(3)|
  225.  VAC_CTRL_RECOVERY_IOSELI(2)|
  226.  VAC_CTRL_DSACK0|VAC_CTRL_DSACK1|
  227.  VAC_CTRL_DELAY_DSACKI(8),VAC_IOSEL0_CTRL);
  228. vac_outw(VAC_CTRL_IOWR|
  229.  VAC_CTRL_DELAY_IOWR(3)|
  230.  VAC_CTRL_DELAY_IORD(3)|
  231.  VAC_CTRL_RECOVERY_IOSELI(2)|
  232.  VAC_CTRL_DSACK0|VAC_CTRL_DSACK1|
  233.  VAC_CTRL_DELAY_DSACKI(8),VAC_IOSEL1_CTRL);
  234. vac_outw(VAC_CTRL_IOWR|
  235.  VAC_CTRL_DELAY_IOWR(3)|
  236.  VAC_CTRL_DELAY_IORD(3)|
  237.  VAC_CTRL_RECOVERY_IOSELI(2)|
  238.  VAC_CTRL_DSACK0|VAC_CTRL_DSACK1|
  239.  VAC_CTRL_DELAY_DSACKI(8),VAC_IOSEL2_CTRL);
  240. vac_outw(VAC_CTRL_IOWR|
  241.  VAC_CTRL_DELAY_IOWR(3)|
  242.  VAC_CTRL_DELAY_IORD(3)|
  243.  VAC_CTRL_RECOVERY_IOSELI(2)|
  244.  VAC_CTRL_DSACK0|VAC_CTRL_DSACK1|
  245.  VAC_CTRL_DELAY_DSACKI(8),VAC_IOSEL3_CTRL);
  246. vac_outw(VAC_CTRL_IOWR|
  247.  VAC_CTRL_DELAY_IOWR(3)|
  248.  VAC_CTRL_DELAY_IORD(3)|
  249.  VAC_CTRL_RECOVERY_IOSELI(2)|
  250.  VAC_CTRL_DELAY_DSACKI(8),VAC_IOSEL4_CTRL);
  251. vac_outw(VAC_CTRL_IOWR|
  252.  VAC_CTRL_DELAY_IOWR(3)|
  253.  VAC_CTRL_DELAY_IORD(3)|
  254.  VAC_CTRL_RECOVERY_IOSELI(2)|
  255.  VAC_CTRL_DELAY_DSACKI(8),VAC_IOSEL5_CTRL);
  256.         vac_show();
  257. }
  258. static void __init vac_start(void)
  259. {
  260. vac_outw(0, VAC_ID);
  261. vac_outw(VAC_INT_CTRL_TIMER_DISABLE|
  262.  VAC_INT_CTRL_UART_B_DISABLE|
  263.  VAC_INT_CTRL_UART_A_DISABLE|
  264.  VAC_INT_CTRL_MBOX_DISABLE|
  265.  VAC_INT_CTRL_PIO4_DISABLE|
  266.  VAC_INT_CTRL_PIO7_DISABLE|
  267.  VAC_INT_CTRL_PIO8_DISABLE|
  268.  VAC_INT_CTRL_PIO9_DISABLE,VAC_INT_CTRL);
  269. vac_outw(VAC_INT_CTRL_TIMER_PIO10|
  270.  VAC_INT_CTRL_UART_B_PIO7|
  271.  VAC_INT_CTRL_UART_A_PIO7,VAC_INT_CTRL);
  272. /* 
  273.  *  Set quadro speed for both UARTs.
  274.  *  To do it we need use formulae from VIC/VAC manual,
  275.  *  keeping in mind Baget's 50MHz frequency...
  276.  */
  277. vac_outw((500000/(384*16))<<8,VAC_CPU_CLK_DIV); 
  278. }
  279. static void __init vic_show(void)
  280. {
  281. unsigned char val;
  282. char *timeout[]  = { "4", "16", "32", "64", "128", "256", "disabled" };
  283. char *deadlock[] = { "[dedlk only]", "[dedlk only]", 
  284.      "[dedlk], [halt w/ rmc], [lberr]",
  285.      "[dedlk], [halt w/o rmc], [lberr]" };
  286. val = vic_inb(VIC_IFACE_CFG);
  287. if (val & VIC_IFACE_CFG_VME)
  288. printk("VMEbus controller ");
  289. if (val & VIC_IFACE_CFG_TURBO)
  290. printk("turbo ");
  291. if (val & VIC_IFACE_CFG_MSTAB)
  292. printk("metastability delay ");
  293. printk("%s ",
  294.        deadlock[VIC_IFACE_CFG_DEADLOCK_VAL(val)]);
  295. printk("interrupts: ");
  296. val = vic_inb(VIC_ERR_INT);
  297. if (!(val & VIC_ERR_INT_SYSFAIL))
  298. printk("[sysfail]");
  299. if (!(val & VIC_ERR_INT_TIMO))
  300. printk("[timeout]");
  301. if (!(val & VIC_ERR_INT_WRPOST))
  302. printk("[write post]");
  303. if (!(val & VIC_ERR_INT_ACFAIL))
  304. printk("[acfail] ");
  305. printk("n");
  306. printk("timeouts: ");
  307. val = vic_inb(VIC_XFER_TIMO);
  308. printk("local %s, vme %s ",
  309.        timeout[VIC_XFER_TIMO_LOCAL_PERIOD_VAL(val)],
  310.        timeout[VIC_XFER_TIMO_VME_PERIOD_VAL(val)]);
  311. if (val & VIC_XFER_TIMO_VME)
  312. printk("acquisition ");
  313. if (val & VIC_XFER_TIMO_ARB)
  314. printk("arbitration ");
  315. printk("n");
  316. val = vic_inb(VIC_LOCAL_TIM);
  317. printk("pas time: (%d,%d), ds time: %dn",
  318.        VIC_LOCAL_TIM_PAS_ASSERT_VAL(val),
  319.        VIC_LOCAL_TIM_PAS_DEASSERT_VAL(val),
  320.        VIC_LOCAT_TIM_DS_DEASSERT_VAL(val));
  321. val = vic_inb(VIC_BXFER_DEF);
  322. printk("dma: ");
  323. if (val & VIC_BXFER_DEF_DUAL)
  324. printk("[dual path]");
  325. if (val & VIC_BXFER_DEF_LOCAL_CROSS)
  326. printk("[local boundary cross]");
  327. if (val & VIC_BXFER_DEF_VME_CROSS)
  328. printk("[vme boundary cross]");
  329. }
  330. static void __init vic_init(void)
  331. {
  332.  unsigned char id = vic_inb(VIC_ID);
  333.  if ((id & 0xf0) != 0xf0)
  334.  panic("VIC not found");
  335.  printk(" VIC068A Rev. %X: ", id & 0x0f);
  336.  vic_outb(VIC_INT_IPL(3)|VIC_INT_DISABLE,VIC_VME_II);
  337.  vic_outb(VIC_INT_IPL(3)|VIC_INT_DISABLE,VIC_VME_INT1);
  338.  vic_outb(VIC_INT_IPL(3)|VIC_INT_DISABLE,VIC_VME_INT2);
  339.  vic_outb(VIC_INT_IPL(3)|VIC_INT_DISABLE,VIC_VME_INT3);
  340.  vic_outb(VIC_INT_IPL(3)|VIC_INT_DISABLE,VIC_VME_INT4);
  341. /*  
  342.  vic_outb(VIC_INT_IPL(3)|VIC_INT_DISABLE, VIC_VME_INT5);
  343. */
  344.  vic_outb(VIC_INT_IPL(3)|VIC_INT_DISABLE, VIC_VME_INT6);
  345.  vic_outb(VIC_INT_IPL(3)|VIC_INT_DISABLE, VIC_VME_INT7);
  346.  vic_outb(VIC_INT_IPL(3)|VIC_INT_DISABLE, VIC_DMA_INT);
  347.  vic_outb(VIC_INT_IPL(3)|VIC_INT_NOAUTO|VIC_INT_EDGE|
  348.   VIC_INT_LOW|VIC_INT_DISABLE, VIC_LINT1);
  349.  vic_outb(VIC_INT_IPL(3)|VIC_INT_NOAUTO|VIC_INT_EDGE|
  350.   VIC_INT_HIGH|VIC_INT_DISABLE, VIC_LINT2);
  351.  vic_outb(VIC_INT_IPL(3)|VIC_INT_NOAUTO|VIC_INT_EDGE|
  352.   VIC_INT_HIGH|VIC_INT_DISABLE, VIC_LINT3);
  353.  vic_outb(VIC_INT_IPL(3)|VIC_INT_NOAUTO|VIC_INT_EDGE|
  354.   VIC_INT_LOW|VIC_INT_DISABLE, VIC_LINT4);
  355. /*  
  356.  vic_outb(VIC_INT_IPL(3)|VIC_INT_NOAUTO|VIC_INT_LEVEL|
  357.   VIC_INT_LOW|VIC_INT_DISABLE, VIC_LINT5);
  358. */
  359.  vic_outb(VIC_INT_IPL(6)|VIC_INT_NOAUTO|VIC_INT_EDGE|
  360.   VIC_INT_LOW|VIC_INT_DISABLE, VIC_LINT6);
  361.  vic_outb(VIC_INT_IPL(6)|VIC_INT_NOAUTO|VIC_INT_EDGE|
  362.   VIC_INT_LOW|VIC_INT_DISABLE, VIC_LINT7);
  363.  vic_outb(VIC_INT_IPL(3)|
  364.   VIC_INT_SWITCH(0)|
  365.   VIC_INT_SWITCH(1)|
  366.   VIC_INT_SWITCH(2)|
  367.   VIC_INT_SWITCH(3), VIC_ICGS_INT);
  368.  vic_outb(VIC_INT_IPL(3)|
  369.   VIC_INT_SWITCH(0)|
  370.   VIC_INT_SWITCH(1)|
  371.   VIC_INT_SWITCH(2)|
  372.   VIC_INT_SWITCH(3), VIC_ICMS_INT);
  373.  vic_outb(VIC_INT_IPL(6)|
  374.   VIC_ERR_INT_SYSFAIL|
  375.   VIC_ERR_INT_TIMO|
  376.   VIC_ERR_INT_WRPOST|
  377.   VIC_ERR_INT_ACFAIL, VIC_ERR_INT);
  378.  vic_outb(VIC_ICxS_BASE_ID(0xf), VIC_ICGS_BASE);
  379.  vic_outb(VIC_ICxS_BASE_ID(0xe), VIC_ICMS_BASE);
  380.  vic_outb(VIC_LOCAL_BASE_ID(0x6), VIC_LOCAL_BASE);
  381.  vic_outb(VIC_ERR_BASE_ID(0x3), VIC_ERR_BASE);
  382.  vic_outb(VIC_XFER_TIMO_VME_PERIOD_32|
  383.   VIC_XFER_TIMO_LOCAL_PERIOD_32, VIC_XFER_TIMO);
  384.  vic_outb(VIC_LOCAL_TIM_PAS_ASSERT(2)|
  385.   VIC_LOCAT_TIM_DS_DEASSERT(1)|
  386.   VIC_LOCAL_TIM_PAS_DEASSERT(1), VIC_LOCAL_TIM);
  387.  vic_outb(VIC_BXFER_DEF_VME_CROSS|
  388.   VIC_BXFER_DEF_LOCAL_CROSS|
  389.   VIC_BXFER_DEF_AMSR|
  390.   VIC_BXFER_DEF_DUAL, VIC_BXFER_DEF);
  391.  vic_outb(VIC_SSxCR0_LOCAL_XFER_SINGLE|
  392.   VIC_SSxCR0_A32|VIC_SSxCR0_D32|
  393.   VIC_SS0CR0_TIMER_FREQ_NONE, VIC_SS0CR0);
  394.  vic_outb(VIC_SSxCR1_TF1(0xf)|
  395.   VIC_SSxCR1_TF2(0xf), VIC_SS0CR1);
  396.  vic_outb(VIC_SSxCR0_LOCAL_XFER_SINGLE|
  397.   VIC_SSxCR0_A24|VIC_SSxCR0_D32, VIC_SS1CR0);
  398.  vic_outb(VIC_SSxCR1_TF1(0xf)|
  399.   VIC_SSxCR1_TF2(0xf), VIC_SS1CR1);
  400.          vic_outb(VIC_IFACE_CFG_NOHALT|
  401.   VIC_IFACE_CFG_NOTURBO, VIC_IFACE_CFG);
  402.  vic_outb(VIC_AMS_CODE(0), VIC_AMS);
  403.  vic_outb(VIC_BXFER_CTRL_INTERLEAVE(0), VIC_BXFER_CTRL);
  404.  vic_outb(0, VIC_BXFER_LEN_LO);
  405.  vic_outb(0, VIC_BXFER_LEN_HI);
  406.  vic_outb(VIC_REQ_CFG_FAIRNESS_DISABLED|
  407.   VIC_REQ_CFG_LEVEL(3)|
  408.   VIC_REQ_CFG_RR_ARBITRATION, VIC_REQ_CFG);
  409.  vic_outb(VIC_RELEASE_BLKXFER_BLEN(0)|
  410.   VIC_RELEASE_RWD, VIC_RELEASE);
  411.  vic_outb(VIC_IC6_RUN, VIC_IC6);
  412.  vic_outb(0, VIC_IC7);
  413.  
  414.  vic_show();
  415. }
  416. static void vic_start(void)
  417. {
  418. vic_outb(VIC_INT_IPL(3)|
  419.  VIC_INT_NOAUTO|
  420.  VIC_INT_EDGE|
  421.  VIC_INT_HIGH|
  422.  VIC_INT_ENABLE, VIC_LINT7);
  423. }
  424. void __init baget_irq_setup(void)
  425. {
  426. extern void bagetIRQ(void);
  427.         /* Now, it's safe to set the exception vector. */
  428. set_except_vector(0, bagetIRQ);
  429. }
  430. extern void baget_machine_restart(char *command);
  431. extern void baget_machine_halt(void);
  432. extern void baget_machine_power_off(void);
  433.  
  434. void __init baget_setup(void)
  435. {
  436. printk("BT23/63-201n found.n");
  437. *BAGET_WRERR_ACK = 0;
  438. irq_setup = baget_irq_setup;
  439.         _machine_restart   = baget_machine_restart;
  440.         _machine_halt      = baget_machine_halt;
  441.         _machine_power_off = baget_machine_power_off;
  442. vac_init();
  443. vic_init();
  444. vac_start();
  445. vic_start();
  446. }