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

Linux/Unix编程

开发平台:

Unix_Linux

  1. /*
  2.  * linux/arch/alpha/kernel/core_cia.c
  3.  *
  4.  * Written by David A Rusling (david.rusling@reo.mts.dec.com).
  5.  * December 1995.
  6.  *
  7.  * Copyright (C) 1995  David A Rusling
  8.  * Copyright (C) 1997, 1998  Jay Estabrook
  9.  * Copyright (C) 1998, 1999, 2000  Richard Henderson
  10.  *
  11.  * Code common to all CIA core logic chips.
  12.  */
  13. #include <linux/kernel.h>
  14. #include <linux/types.h>
  15. #include <linux/pci.h>
  16. #include <linux/sched.h>
  17. #include <linux/init.h>
  18. #include <asm/system.h>
  19. #include <asm/ptrace.h>
  20. #include <asm/hwrpb.h>
  21. #define __EXTERN_INLINE inline
  22. #include <asm/io.h>
  23. #include <asm/core_cia.h>
  24. #undef __EXTERN_INLINE
  25. #include <linux/bootmem.h>
  26. #include "proto.h"
  27. #include "pci_impl.h"
  28. /*
  29.  * NOTE: Herein lie back-to-back mb instructions.  They are magic. 
  30.  * One plausible explanation is that the i/o controller does not properly
  31.  * handle the system transaction.  Another involves timing.  Ho hum.
  32.  */
  33. #define DEBUG_CONFIG 0
  34. #if DEBUG_CONFIG
  35. # define DBGC(args) printk args
  36. #else
  37. # define DBGC(args)
  38. #endif
  39. #define vip volatile int  *
  40. /*
  41.  * Given a bus, device, and function number, compute resulting
  42.  * configuration space address.  It is therefore not safe to have
  43.  * concurrent invocations to configuration space access routines, but
  44.  * there really shouldn't be any need for this.
  45.  *
  46.  * Type 0:
  47.  *
  48.  *  3 3|3 3 2 2|2 2 2 2|2 2 2 2|1 1 1 1|1 1 1 1|1 1 
  49.  *  3 2|1 0 9 8|7 6 5 4|3 2 1 0|9 8 7 6|5 4 3 2|1 0 9 8|7 6 5 4|3 2 1 0
  50.  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  51.  * | | |D|D|D|D|D|D|D|D|D|D|D|D|D|D|D|D|D|D|D|D|D|F|F|F|R|R|R|R|R|R|0|0|
  52.  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  53.  *
  54.  * 31:11 Device select bit.
  55.  *  10:8 Function number
  56.  *   7:2 Register number
  57.  *
  58.  * Type 1:
  59.  *
  60.  *  3 3|3 3 2 2|2 2 2 2|2 2 2 2|1 1 1 1|1 1 1 1|1 1 
  61.  *  3 2|1 0 9 8|7 6 5 4|3 2 1 0|9 8 7 6|5 4 3 2|1 0 9 8|7 6 5 4|3 2 1 0
  62.  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  63.  * | | | | | | | | | | |B|B|B|B|B|B|B|B|D|D|D|D|D|F|F|F|R|R|R|R|R|R|0|1|
  64.  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  65.  *
  66.  * 31:24 reserved
  67.  * 23:16 bus number (8 bits = 128 possible buses)
  68.  * 15:11 Device number (5 bits)
  69.  * 10:8 function number
  70.  *  7:2 register number
  71.  *  
  72.  * Notes:
  73.  * The function number selects which function of a multi-function device 
  74.  * (e.g., SCSI and Ethernet).
  75.  * 
  76.  * The register selects a DWORD (32 bit) register offset.  Hence it
  77.  * doesn't get shifted by 2 bits as we want to "drop" the bottom two
  78.  * bits.
  79.  */
  80. static int
  81. mk_conf_addr(struct pci_dev *dev, int where, unsigned long *pci_addr,
  82.      unsigned char *type1)
  83. {
  84. u8 bus = dev->bus->number;
  85. u8 device_fn = dev->devfn;
  86. *type1 = (bus != 0);
  87. *pci_addr = (bus << 16) | (device_fn << 8) | where;
  88. DBGC(("mk_conf_addr(bus=%d ,device_fn=0x%x, where=0x%x,"
  89.       " returning address 0x%pn"
  90.       bus, device_fn, where, *pci_addr));
  91. return 0;
  92. }
  93. static unsigned int
  94. conf_read(unsigned long addr, unsigned char type1)
  95. {
  96. unsigned long flags;
  97. int stat0, value;
  98. int cia_cfg = 0;
  99. DBGC(("conf_read(addr=0x%lx, type1=%d) ", addr, type1));
  100. __save_and_cli(flags);
  101. /* Reset status register to avoid losing errors.  */
  102. stat0 = *(vip)CIA_IOC_CIA_ERR;
  103. *(vip)CIA_IOC_CIA_ERR = stat0;
  104. mb();
  105. *(vip)CIA_IOC_CIA_ERR; /* re-read to force write */
  106. /* If Type1 access, must set CIA CFG. */
  107. if (type1) {
  108. cia_cfg = *(vip)CIA_IOC_CFG;
  109. *(vip)CIA_IOC_CFG = (cia_cfg & ~3) | 1;
  110. mb();
  111. *(vip)CIA_IOC_CFG;
  112. }
  113. mb();
  114. draina();
  115. mcheck_expected(0) = 1;
  116. mcheck_taken(0) = 0;
  117. mb();
  118. /* Access configuration space.  */
  119. value = *(vip)addr;
  120. mb();
  121. mb();  /* magic */
  122. if (mcheck_taken(0)) {
  123. mcheck_taken(0) = 0;
  124. value = 0xffffffff;
  125. mb();
  126. }
  127. mcheck_expected(0) = 0;
  128. mb();
  129. /* If Type1 access, must reset IOC CFG so normal IO space ops work.  */
  130. if (type1) {
  131. *(vip)CIA_IOC_CFG = cia_cfg;
  132. mb();
  133. *(vip)CIA_IOC_CFG;
  134. }
  135. __restore_flags(flags);
  136. DBGC(("donen"));
  137. return value;
  138. }
  139. static void
  140. conf_write(unsigned long addr, unsigned int value, unsigned char type1)
  141. {
  142. unsigned long flags;
  143. int stat0, cia_cfg = 0;
  144. DBGC(("conf_write(addr=0x%lx, type1=%d) ", addr, type1));
  145. __save_and_cli(flags);
  146. /* Reset status register to avoid losing errors.  */
  147. stat0 = *(vip)CIA_IOC_CIA_ERR;
  148. *(vip)CIA_IOC_CIA_ERR = stat0;
  149. mb();
  150. *(vip)CIA_IOC_CIA_ERR; /* re-read to force write */
  151. /* If Type1 access, must set CIA CFG.  */
  152. if (type1) {
  153. cia_cfg = *(vip)CIA_IOC_CFG;
  154. *(vip)CIA_IOC_CFG = (cia_cfg & ~3) | 1;
  155. mb();
  156. *(vip)CIA_IOC_CFG;
  157. }
  158. mb();
  159. draina();
  160. mcheck_expected(0) = 1;
  161. mcheck_taken(0) = 0;
  162. mb();
  163. /* Access configuration space.  */
  164. *(vip)addr = value;
  165. mb();
  166. *(vip)addr; /* read back to force the write */
  167. mcheck_expected(0) = 0;
  168. mb();
  169. /* If Type1 access, must reset IOC CFG so normal IO space ops work.  */
  170. if (type1) {
  171. *(vip)CIA_IOC_CFG = cia_cfg;
  172. mb();
  173. *(vip)CIA_IOC_CFG;
  174. }
  175. __restore_flags(flags);
  176. DBGC(("donen"));
  177. }
  178. static int
  179. cia_read_config_byte(struct pci_dev *dev, int where, u8 *value)
  180. {
  181. unsigned long addr, pci_addr;
  182. unsigned char type1;
  183. if (mk_conf_addr(dev, where, &pci_addr, &type1))
  184. return PCIBIOS_DEVICE_NOT_FOUND;
  185. addr = (pci_addr << 5) + 0x00 + CIA_CONF;
  186. *value = conf_read(addr, type1) >> ((where & 3) * 8);
  187. return PCIBIOS_SUCCESSFUL;
  188. }
  189. static int 
  190. cia_read_config_word(struct pci_dev *dev, int where, u16 *value)
  191. {
  192. unsigned long addr, pci_addr;
  193. unsigned char type1;
  194. if (mk_conf_addr(dev, where, &pci_addr, &type1))
  195. return PCIBIOS_DEVICE_NOT_FOUND;
  196. addr = (pci_addr << 5) + 0x08 + CIA_CONF;
  197. *value = conf_read(addr, type1) >> ((where & 3) * 8);
  198. return PCIBIOS_SUCCESSFUL;
  199. }
  200. static int 
  201. cia_read_config_dword(struct pci_dev *dev, int where, u32 *value)
  202. {
  203. unsigned long addr, pci_addr;
  204. unsigned char type1;
  205. if (mk_conf_addr(dev, where, &pci_addr, &type1))
  206. return PCIBIOS_DEVICE_NOT_FOUND;
  207. addr = (pci_addr << 5) + 0x18 + CIA_CONF;
  208. *value = conf_read(addr, type1);
  209. return PCIBIOS_SUCCESSFUL;
  210. }
  211. static int 
  212. cia_write_config(struct pci_dev *dev, int where, u32 value, long mask)
  213. {
  214. unsigned long addr, pci_addr;
  215. unsigned char type1;
  216. if (mk_conf_addr(dev, where, &pci_addr, &type1))
  217. return PCIBIOS_DEVICE_NOT_FOUND;
  218. addr = (pci_addr << 5) + mask + CIA_CONF;
  219. conf_write(addr, value << ((where & 3) * 8), type1);
  220. return PCIBIOS_SUCCESSFUL;
  221. }
  222. static int
  223. cia_write_config_byte(struct pci_dev *dev, int where, u8 value)
  224. {
  225. return cia_write_config(dev, where, value, 0x00);
  226. }
  227. static int 
  228. cia_write_config_word(struct pci_dev *dev, int where, u16 value)
  229. {
  230. return cia_write_config(dev, where, value, 0x08);
  231. }
  232. static int 
  233. cia_write_config_dword(struct pci_dev *dev, int where, u32 value)
  234. {
  235. return cia_write_config(dev, where, value, 0x18);
  236. }
  237. struct pci_ops cia_pci_ops = 
  238. {
  239. read_byte: cia_read_config_byte,
  240. read_word: cia_read_config_word,
  241. read_dword: cia_read_config_dword,
  242. write_byte: cia_write_config_byte,
  243. write_word: cia_write_config_word,
  244. write_dword: cia_write_config_dword
  245. };
  246. /*
  247.  * CIA Pass 1 and PYXIS Pass 1 and 2 have a broken scatter-gather tlb.
  248.  * It cannot be invalidated.  Rather than hard code the pass numbers,
  249.  * actually try the tbia to see if it works.
  250.  */
  251. void
  252. cia_pci_tbi(struct pci_controller *hose, dma_addr_t start, dma_addr_t end)
  253. {
  254. wmb();
  255. *(vip)CIA_IOC_PCI_TBIA = 3; /* Flush all locked and unlocked.  */
  256. mb();
  257. *(vip)CIA_IOC_PCI_TBIA;
  258. }
  259. /*
  260.  * On PYXIS, even if the tbia works, we cannot use it. It effectively locks
  261.  * the chip (as well as direct write to the tag registers) if there is a
  262.  * SG DMA operation in progress. This is true at least for PYXIS rev. 1,
  263.  * so always use the method below.
  264.  */
  265. /*
  266.  * This is the method NT and NetBSD use.
  267.  *
  268.  * Allocate mappings, and put the chip into DMA loopback mode to read a
  269.  * garbage page.  This works by causing TLB misses, causing old entries to
  270.  * be purged to make room for the new entries coming in for the garbage page.
  271.  */
  272. #define CIA_BROKEN_TBIA_BASE 0x30000000
  273. #define CIA_BROKEN_TBIA_SIZE 1024
  274. /* Always called with interrupts disabled */
  275. void
  276. cia_pci_tbi_try2(struct pci_controller *hose,
  277.  dma_addr_t start, dma_addr_t end)
  278. {
  279. unsigned long bus_addr;
  280. int ctrl;
  281. /* Put the chip into PCI loopback mode.  */
  282. mb();
  283. ctrl = *(vip)CIA_IOC_CIA_CTRL;
  284. *(vip)CIA_IOC_CIA_CTRL = ctrl | CIA_CTRL_PCI_LOOP_EN;
  285. mb();
  286. *(vip)CIA_IOC_CIA_CTRL;
  287. mb();
  288. /* Read from PCI dense memory space at TBI_ADDR, skipping 32k on
  289.    each read.  This forces SG TLB misses.  NetBSD claims that the
  290.    TLB entries are not quite LRU, meaning that we need to read more
  291.    times than there are actual tags.  The 2117x docs claim strict
  292.    round-robin.  Oh well, we've come this far...  */
  293. /* Even better - as seen on the PYXIS rev 1 the TLB tags 0-3 can
  294.    be filled by the TLB misses *only once* after being invalidated
  295.    (by tbia or direct write). Next misses won't update them even
  296.    though the lock bits are cleared. Tags 4-7 are "quite LRU" though,
  297.    so use them and read at window 3 base exactly 4 times. Reading
  298.    more sometimes makes the chip crazy.  -ink */
  299. bus_addr = cia_ioremap(CIA_BROKEN_TBIA_BASE, 32768 * 4);
  300. cia_readl(bus_addr + 0x00000);
  301. cia_readl(bus_addr + 0x08000);
  302. cia_readl(bus_addr + 0x10000);
  303. cia_readl(bus_addr + 0x18000);
  304. cia_iounmap(bus_addr);
  305. /* Restore normal PCI operation.  */
  306. mb();
  307. *(vip)CIA_IOC_CIA_CTRL = ctrl;
  308. mb();
  309. *(vip)CIA_IOC_CIA_CTRL;
  310. mb();
  311. }
  312. static inline void
  313. cia_prepare_tbia_workaround(void)
  314. {
  315. unsigned long *ppte, pte;
  316. long i;
  317. /* Use minimal 1K map. */
  318. ppte = __alloc_bootmem(CIA_BROKEN_TBIA_SIZE, 32768, 0);
  319. pte = (virt_to_phys(ppte) >> (PAGE_SHIFT - 1)) | 1;
  320. for (i = 0; i < CIA_BROKEN_TBIA_SIZE / sizeof(unsigned long); ++i)
  321. ppte[i] = pte;
  322. *(vip)CIA_IOC_PCI_W1_BASE = CIA_BROKEN_TBIA_BASE | 3;
  323. *(vip)CIA_IOC_PCI_W1_MASK = (CIA_BROKEN_TBIA_SIZE*1024 - 1)
  324.     & 0xfff00000;
  325. *(vip)CIA_IOC_PCI_T1_BASE = virt_to_phys(ppte) >> 2;
  326. }
  327. static void __init
  328. verify_tb_operation(void)
  329. {
  330. static int page[PAGE_SIZE/4]
  331. __attribute__((aligned(PAGE_SIZE)))
  332. __initdata = { 0 };
  333. struct pci_iommu_arena *arena = pci_isa_hose->sg_isa;
  334. int ctrl, addr0, tag0, pte0, data0;
  335. int temp, use_tbia_try2 = 0;
  336. unsigned long bus_addr;
  337. /* pyxis -- tbia is broken */
  338. if (pci_isa_hose->dense_io_base)
  339. use_tbia_try2 = 1;
  340. /* Put the chip into PCI loopback mode.  */
  341. mb();
  342. ctrl = *(vip)CIA_IOC_CIA_CTRL;
  343. *(vip)CIA_IOC_CIA_CTRL = ctrl | CIA_CTRL_PCI_LOOP_EN;
  344. mb();
  345. *(vip)CIA_IOC_CIA_CTRL;
  346. mb();
  347. /* Write a valid entry directly into the TLB registers.  */
  348. addr0 = arena->dma_base;
  349. tag0 = addr0 | 1;
  350. pte0 = (virt_to_phys(page) >> (PAGE_SHIFT - 1)) | 1;
  351. *(vip)CIA_IOC_TB_TAGn(0) = tag0;
  352. *(vip)CIA_IOC_TB_TAGn(1) = 0;
  353. *(vip)CIA_IOC_TB_TAGn(2) = 0;
  354. *(vip)CIA_IOC_TB_TAGn(3) = 0;
  355. *(vip)CIA_IOC_TB_TAGn(4) = 0;
  356. *(vip)CIA_IOC_TB_TAGn(5) = 0;
  357. *(vip)CIA_IOC_TB_TAGn(6) = 0;
  358. *(vip)CIA_IOC_TB_TAGn(7) = 0;
  359. *(vip)CIA_IOC_TBn_PAGEm(0,0) = pte0;
  360. *(vip)CIA_IOC_TBn_PAGEm(0,1) = 0;
  361. *(vip)CIA_IOC_TBn_PAGEm(0,2) = 0;
  362. *(vip)CIA_IOC_TBn_PAGEm(0,3) = 0;
  363. mb();
  364. /* Get a usable bus address */
  365. bus_addr = cia_ioremap(addr0, 8*PAGE_SIZE);
  366. /* First, verify we can read back what we've written.  If
  367.    this fails, we can't be sure of any of the other testing
  368.    we're going to do, so bail.  */
  369. /* ??? Actually, we could do the work with machine checks.
  370.    By passing this register update test, we pretty much
  371.    guarantee that cia_pci_tbi_try1 works.  If this test
  372.    fails, cia_pci_tbi_try2 might still work.  */
  373. temp = *(vip)CIA_IOC_TB_TAGn(0);
  374. if (temp != tag0) {
  375. printk("pci: failed tb register update test "
  376.        "(tag0 %#x != %#x)n", temp, tag0);
  377. goto failed;
  378. }
  379. temp = *(vip)CIA_IOC_TB_TAGn(1);
  380. if (temp != 0) {
  381. printk("pci: failed tb register update test "
  382.        "(tag1 %#x != 0)n", temp);
  383. goto failed;
  384. }
  385. temp = *(vip)CIA_IOC_TBn_PAGEm(0,0);
  386. if (temp != pte0) {
  387. printk("pci: failed tb register update test "
  388.        "(pte0 %#x != %#x)n", temp, pte0);
  389. goto failed;
  390. }
  391. printk("pci: passed tb register update testn");
  392. /* Second, verify we can actually do I/O through this entry.  */
  393. data0 = 0xdeadbeef;
  394. page[0] = data0;
  395. mcheck_expected(0) = 1;
  396. mcheck_taken(0) = 0;
  397. mb();
  398. temp = cia_readl(bus_addr);
  399. mb();
  400. mcheck_expected(0) = 0;
  401. mb();
  402. if (mcheck_taken(0)) {
  403. printk("pci: failed sg loopback i/o read test (mcheck)n");
  404. goto failed;
  405. }
  406. if (temp != data0) {
  407. printk("pci: failed sg loopback i/o read test "
  408.        "(%#x != %#x)n", temp, data0);
  409. goto failed;
  410. }
  411. printk("pci: passed sg loopback i/o read testn");
  412. /* Third, try to invalidate the TLB.  */
  413. if (! use_tbia_try2) {
  414. cia_pci_tbi(arena->hose, 0, -1);
  415. temp = *(vip)CIA_IOC_TB_TAGn(0);
  416. if (temp & 1) {
  417. use_tbia_try2 = 1;
  418. printk("pci: failed tbia test; workaround availablen");
  419. } else {
  420. printk("pci: passed tbia testn");
  421. }
  422. }
  423. /* Fourth, verify the TLB snoops the EV5's caches when
  424.    doing a tlb fill.  */
  425. data0 = 0x5adda15e;
  426. page[0] = data0;
  427. arena->ptes[4] = pte0;
  428. mcheck_expected(0) = 1;
  429. mcheck_taken(0) = 0;
  430. mb();
  431. temp = cia_readl(bus_addr + 4*PAGE_SIZE);
  432. mb();
  433. mcheck_expected(0) = 0;
  434. mb();
  435. if (mcheck_taken(0)) {
  436. printk("pci: failed pte write cache snoop test (mcheck)n");
  437. goto failed;
  438. }
  439. if (temp != data0) {
  440. printk("pci: failed pte write cache snoop test "
  441.        "(%#x != %#x)n", temp, data0);
  442. goto failed;
  443. }
  444. printk("pci: passed pte write cache snoop testn");
  445. /* Fifth, verify that a previously invalid PTE entry gets
  446.    filled from the page table.  */
  447. data0 = 0xabcdef12;
  448. page[0] = data0;
  449. arena->ptes[5] = pte0;
  450. mcheck_expected(0) = 1;
  451. mcheck_taken(0) = 0;
  452. mb();
  453. temp = cia_readl(bus_addr + 5*PAGE_SIZE);
  454. mb();
  455. mcheck_expected(0) = 0;
  456. mb();
  457. if (mcheck_taken(0)) {
  458. printk("pci: failed valid tag invalid pte reload test "
  459.        "(mcheck; workaround available)n");
  460. /* Work around this bug by aligning new allocations
  461.    on 4 page boundaries.  */
  462. arena->align_entry = 4;
  463. } else if (temp != data0) {
  464. printk("pci: failed valid tag invalid pte reload test "
  465.        "(%#x != %#x)n", temp, data0);
  466. goto failed;
  467. } else {
  468. printk("pci: passed valid tag invalid pte reload testn");
  469. }
  470. /* Sixth, verify machine checks are working.  Test invalid
  471.    pte under the same valid tag as we used above.  */
  472. mcheck_expected(0) = 1;
  473. mcheck_taken(0) = 0;
  474. mb();
  475. temp = cia_readl(bus_addr + 6*PAGE_SIZE);
  476. mb();
  477. mcheck_expected(0) = 0;
  478. mb();
  479. printk("pci: %s pci machine check testn",
  480.        mcheck_taken(0) ? "passed" : "failed");
  481. /* Clean up after the tests.  */
  482. arena->ptes[4] = 0;
  483. arena->ptes[5] = 0;
  484. if (use_tbia_try2) {
  485. alpha_mv.mv_pci_tbi = cia_pci_tbi_try2;
  486. /* Tags 0-3 must be disabled if we use this workaraund. */
  487. wmb();
  488. *(vip)CIA_IOC_TB_TAGn(0) = 2;
  489. *(vip)CIA_IOC_TB_TAGn(1) = 2;
  490. *(vip)CIA_IOC_TB_TAGn(2) = 2;
  491. *(vip)CIA_IOC_TB_TAGn(3) = 2;
  492. printk("pci: tbia workaround enabledn");
  493. }
  494. alpha_mv.mv_pci_tbi(arena->hose, 0, -1);
  495. exit:
  496. /* unmap the bus addr */
  497. cia_iounmap(bus_addr);
  498. /* Restore normal PCI operation.  */
  499. mb();
  500. *(vip)CIA_IOC_CIA_CTRL = ctrl;
  501. mb();
  502. *(vip)CIA_IOC_CIA_CTRL;
  503. mb();
  504. return;
  505. failed:
  506. printk("pci: disabling sg translation windown");
  507. *(vip)CIA_IOC_PCI_W0_BASE = 0;
  508. *(vip)CIA_IOC_PCI_W1_BASE = 0;
  509. pci_isa_hose->sg_isa = NULL;
  510. alpha_mv.mv_pci_tbi = NULL;
  511. goto exit;
  512. }
  513. static void __init
  514. do_init_arch(int is_pyxis)
  515. {
  516. struct pci_controller *hose;
  517. int temp;
  518. int cia_rev;
  519. cia_rev = *(vip)CIA_IOC_CIA_REV & CIA_REV_MASK;
  520. printk("pci: cia revision %d%sn",
  521.        cia_rev, is_pyxis ? " (pyxis)" : "");
  522. /* Set up error reporting.  */
  523. temp = *(vip)CIA_IOC_ERR_MASK;
  524. temp &= ~(CIA_ERR_CPU_PE | CIA_ERR_MEM_NEM | CIA_ERR_PA_PTE_INV
  525.   | CIA_ERR_RCVD_MAS_ABT | CIA_ERR_RCVD_TAR_ABT);
  526. *(vip)CIA_IOC_ERR_MASK = temp;
  527. /* Clear all currently pending errors.  */
  528. temp = *(vip)CIA_IOC_CIA_ERR;
  529. *(vip)CIA_IOC_CIA_ERR = temp;
  530. /* Turn on mchecks.  */
  531. temp = *(vip)CIA_IOC_CIA_CTRL;
  532. temp |= CIA_CTRL_FILL_ERR_EN | CIA_CTRL_MCHK_ERR_EN;
  533. *(vip)CIA_IOC_CIA_CTRL = temp;
  534. /* Clear the CFG register, which gets used for PCI config space
  535.    accesses.  That is the way we want to use it, and we do not
  536.    want to depend on what ARC or SRM might have left behind.  */
  537. *(vip)CIA_IOC_CFG = 0;
  538.  
  539. /* Zero the HAEs.  */
  540. *(vip)CIA_IOC_HAE_MEM = 0;
  541. *(vip)CIA_IOC_HAE_IO = 0;
  542. /* For PYXIS, we always use BWX bus and i/o accesses.  To that end,
  543.    make sure they're enabled on the controller.  At the same time,
  544.    enable the monster window.  */
  545. if (is_pyxis) {
  546. temp = *(vip)CIA_IOC_CIA_CNFG;
  547. temp |= CIA_CNFG_IOA_BWEN | CIA_CNFG_PCI_MWEN;
  548. *(vip)CIA_IOC_CIA_CNFG = temp;
  549. }
  550. /* Syncronize with all previous changes.  */
  551. mb();
  552. *(vip)CIA_IOC_CIA_REV;
  553. /*
  554.  * Create our single hose.
  555.  */
  556. pci_isa_hose = hose = alloc_pci_controller();
  557. hose->io_space = &ioport_resource;
  558. hose->mem_space = &iomem_resource;
  559. hose->index = 0;
  560. if (! is_pyxis) {
  561. struct resource *hae_mem = alloc_resource();
  562. hose->mem_space = hae_mem;
  563. hae_mem->start = 0;
  564. hae_mem->end = CIA_MEM_R1_MASK;
  565. hae_mem->name = pci_hae0_name;
  566. hae_mem->flags = IORESOURCE_MEM;
  567. if (request_resource(&iomem_resource, hae_mem) < 0)
  568. printk(KERN_ERR "Failed to request HAE_MEMn");
  569. hose->sparse_mem_base = CIA_SPARSE_MEM - IDENT_ADDR;
  570. hose->dense_mem_base = CIA_DENSE_MEM - IDENT_ADDR;
  571. hose->sparse_io_base = CIA_IO - IDENT_ADDR;
  572. hose->dense_io_base = 0;
  573. } else {
  574. hose->sparse_mem_base = 0;
  575. hose->dense_mem_base = CIA_BW_MEM - IDENT_ADDR;
  576. hose->sparse_io_base = 0;
  577. hose->dense_io_base = CIA_BW_IO - IDENT_ADDR;
  578. }
  579. /*
  580.  * Set up the PCI to main memory translation windows.
  581.  *
  582.  * Window 0 is scatter-gather 8MB at 8MB (for isa)
  583.  * Window 1 is scatter-gather 1MB at 768MB (for tbia)
  584.  * Window 2 is direct access 2GB at 2GB
  585.  * Window 3 is DAC access 4GB at 8GB
  586.  *
  587.  * ??? NetBSD hints that page tables must be aligned to 32K,
  588.  * possibly due to a hardware bug.  This is over-aligned
  589.  * from the 8K alignment one would expect for an 8MB window. 
  590.  * No description of what revisions affected.
  591.  */
  592. hose->sg_pci = NULL;
  593. hose->sg_isa = iommu_arena_new(hose, 0x00800000, 0x00800000, 32768);
  594. __direct_map_base = 0x80000000;
  595. __direct_map_size = 0x80000000;
  596. *(vip)CIA_IOC_PCI_W0_BASE = hose->sg_isa->dma_base | 3;
  597. *(vip)CIA_IOC_PCI_W0_MASK = (hose->sg_isa->size - 1) & 0xfff00000;
  598. *(vip)CIA_IOC_PCI_T0_BASE = virt_to_phys(hose->sg_isa->ptes) >> 2;
  599. *(vip)CIA_IOC_PCI_W2_BASE = __direct_map_base | 1;
  600. *(vip)CIA_IOC_PCI_W2_MASK = (__direct_map_size - 1) & 0xfff00000;
  601. *(vip)CIA_IOC_PCI_T2_BASE = 0 >> 2;
  602. /* On PYXIS we have the monster window, selected by bit 40, so
  603.    there is no need for window3 to be enabled.
  604.    On CIA, we don't have true arbitrary addressing -- bits <39:32>
  605.    are compared against W_DAC.  We can, however, directly map 4GB,
  606.    which is better than before.  However, due to assumptions made
  607.    elsewhere, we should not claim that we support DAC unless that
  608.    4GB covers all of physical memory.  */
  609. if (is_pyxis || max_low_pfn > (0x100000000 >> PAGE_SHIFT)) {
  610. *(vip)CIA_IOC_PCI_W3_BASE = 0;
  611. } else {
  612. *(vip)CIA_IOC_PCI_W3_BASE = 0x00000000 | 1 | 8;
  613. *(vip)CIA_IOC_PCI_W3_MASK = 0xfff00000;
  614. *(vip)CIA_IOC_PCI_T3_BASE = 0 >> 2;
  615. alpha_mv.pci_dac_offset = 0x200000000;
  616. *(vip)CIA_IOC_PCI_W_DAC = alpha_mv.pci_dac_offset >> 32;
  617. }
  618. /* Prepare workaround for apparently broken tbia. */
  619. cia_prepare_tbia_workaround();
  620. }
  621. void __init
  622. cia_init_arch(void)
  623. {
  624. do_init_arch(0);
  625. }
  626. void __init
  627. pyxis_init_arch(void)
  628. {
  629. /* On pyxis machines we can precisely calculate the
  630.    CPU clock frequency using pyxis real time counter.
  631.    It's especially useful for SX164 with broken RTC.
  632.    Both CPU and chipset are driven by the single 16.666M
  633.    or 16.667M crystal oscillator. PYXIS_RT_COUNT clock is
  634.    66.66 MHz. -ink */
  635. unsigned int cc0, cc1;
  636. unsigned long pyxis_cc;
  637. __asm__ __volatile__ ("rpcc %0" : "=r"(cc0));
  638. pyxis_cc = *(vulp)PYXIS_RT_COUNT;
  639. do { } while(*(vulp)PYXIS_RT_COUNT - pyxis_cc < 4096);
  640. __asm__ __volatile__ ("rpcc %0" : "=r"(cc1));
  641. cc1 -= cc0;
  642. hwrpb->cycle_freq = ((cc1 >> 11) * 100000000UL) / 3;
  643. hwrpb_update_checksum(hwrpb);
  644. do_init_arch(1);
  645. }
  646. void __init
  647. cia_init_pci(void)
  648. {
  649. /* Must delay this from init_arch, as we need machine checks.  */
  650. verify_tb_operation();
  651. common_init_pci();
  652. }
  653. static inline void
  654. cia_pci_clr_err(void)
  655. {
  656. int jd;
  657. jd = *(vip)CIA_IOC_CIA_ERR;
  658. *(vip)CIA_IOC_CIA_ERR = jd;
  659. mb();
  660. *(vip)CIA_IOC_CIA_ERR; /* re-read to force write.  */
  661. }
  662. static void
  663. cia_decode_pci_error(struct el_CIA_sysdata_mcheck *cia, const char *msg)
  664. {
  665. static const char * const pci_cmd_desc[16] = {
  666. "Interrupt Acknowledge", "Special Cycle", "I/O Read",
  667. "I/O Write", "Reserved 0x4", "Reserved 0x5", "Memory Read",
  668. "Memory Write", "Reserved 0x8", "Reserved 0x9",
  669. "Configuration Read", "Configuration Write",
  670. "Memory Read Multiple", "Dual Address Cycle",
  671. "Memory Read Line", "Memory Write and Invalidate"
  672. };
  673. if (cia->cia_err & (CIA_ERR_COR_ERR
  674.     | CIA_ERR_UN_COR_ERR
  675.     | CIA_ERR_MEM_NEM
  676.     | CIA_ERR_PA_PTE_INV)) {
  677. static const char * const window_desc[6] = {
  678. "No window active", "Window 0 hit", "Window 1 hit",
  679. "Window 2 hit", "Window 3 hit", "Monster window hit"
  680. };
  681. const char *window;
  682. const char *cmd;
  683. unsigned long addr, tmp;
  684. int lock, dac;
  685. cmd = pci_cmd_desc[cia->pci_err0 & 0x7];
  686. lock = (cia->pci_err0 >> 4) & 1;
  687. dac = (cia->pci_err0 >> 5) & 1;
  688. tmp = (cia->pci_err0 >> 8) & 0x1F;
  689. tmp = ffs(tmp);
  690. window = window_desc[tmp];
  691. addr = cia->pci_err1;
  692. if (dac) {
  693. tmp = *(vip)CIA_IOC_PCI_W_DAC & 0xFFUL;
  694. addr |= tmp << 32;
  695. }
  696. printk(KERN_CRIT "CIA machine check: %sn", msg);
  697. printk(KERN_CRIT "  DMA command: %sn", cmd);
  698. printk(KERN_CRIT "  PCI address: %#010lxn", addr);
  699. printk(KERN_CRIT "  %s, Lock: %d, DAC: %dn",
  700.        window, lock, dac);
  701. } else if (cia->cia_err & (CIA_ERR_PERR
  702.    | CIA_ERR_PCI_ADDR_PE
  703.    | CIA_ERR_RCVD_MAS_ABT
  704.    | CIA_ERR_RCVD_TAR_ABT
  705.    | CIA_ERR_IOA_TIMEOUT)) {
  706. static const char * const master_st_desc[16] = {
  707. "Idle", "Drive bus", "Address step cycle",
  708. "Address cycle", "Data cycle", "Last read data cycle",
  709. "Last write data cycle", "Read stop cycle",
  710. "Write stop cycle", "Read turnaround cycle",
  711. "Write turnaround cycle", "Reserved 0xB",
  712. "Reserved 0xC", "Reserved 0xD", "Reserved 0xE",
  713. "Unknown state"
  714. };
  715. static const char * const target_st_desc[16] = {
  716. "Idle", "Busy", "Read data cycle", "Write data cycle",
  717. "Read stop cycle", "Write stop cycle",
  718. "Read turnaround cycle", "Write turnaround cycle",
  719. "Read wait cycle", "Write wait cycle",
  720. "Reserved 0xA", "Reserved 0xB", "Reserved 0xC",
  721. "Reserved 0xD", "Reserved 0xE", "Unknown state"
  722. };
  723. const char *cmd;
  724. const char *master, *target;
  725. unsigned long addr, tmp;
  726. int dac;
  727. master = master_st_desc[(cia->pci_err0 >> 16) & 0xF];
  728. target = target_st_desc[(cia->pci_err0 >> 20) & 0xF];
  729. cmd = pci_cmd_desc[(cia->pci_err0 >> 24) & 0xF];
  730. dac = (cia->pci_err0 >> 28) & 1;
  731. addr = cia->pci_err2;
  732. if (dac) {
  733. tmp = *(volatile int *)CIA_IOC_PCI_W_DAC & 0xFFUL;
  734. addr |= tmp << 32;
  735. }
  736. printk(KERN_CRIT "CIA machine check: %sn", msg);
  737. printk(KERN_CRIT "  PCI command: %sn", cmd);
  738. printk(KERN_CRIT "  Master state: %s, Target state: %sn",
  739.        master, target);
  740. printk(KERN_CRIT "  PCI address: %#010lx, DAC: %dn",
  741.        addr, dac);
  742. } else {
  743. printk(KERN_CRIT "CIA machine check: %sn", msg);
  744. printk(KERN_CRIT "  Unknown PCI errorn");
  745. printk(KERN_CRIT "  PCI_ERR0 = %#08lx", cia->pci_err0);
  746. printk(KERN_CRIT "  PCI_ERR1 = %#08lx", cia->pci_err1);
  747. printk(KERN_CRIT "  PCI_ERR2 = %#08lx", cia->pci_err2);
  748. }
  749. }
  750. static void
  751. cia_decode_mem_error(struct el_CIA_sysdata_mcheck *cia, const char *msg)
  752. {
  753. unsigned long mem_port_addr;
  754. unsigned long mem_port_mask;
  755. const char *mem_port_cmd;
  756. const char *seq_state;
  757. const char *set_select;
  758. unsigned long tmp;
  759. /* If this is a DMA command, also decode the PCI bits.  */
  760. if ((cia->mem_err1 >> 20) & 1)
  761. cia_decode_pci_error(cia, msg);
  762. else
  763. printk(KERN_CRIT "CIA machine check: %sn", msg);
  764. mem_port_addr = cia->mem_err0 & 0xfffffff0;
  765. mem_port_addr |= (cia->mem_err1 & 0x83UL) << 32;
  766. mem_port_mask = (cia->mem_err1 >> 12) & 0xF;
  767. tmp = (cia->mem_err1 >> 8) & 0xF;
  768. tmp |= ((cia->mem_err1 >> 20) & 1) << 4;
  769. if ((tmp & 0x1E) == 0x06)
  770. mem_port_cmd = "WRITE BLOCK or WRITE BLOCK LOCK";
  771. else if ((tmp & 0x1C) == 0x08)
  772. mem_port_cmd = "READ MISS or READ MISS MODIFY";
  773. else if (tmp == 0x1C)
  774. mem_port_cmd = "BC VICTIM";
  775. else if ((tmp & 0x1E) == 0x0E)
  776. mem_port_cmd = "READ MISS MODIFY";
  777. else if ((tmp & 0x1C) == 0x18)
  778. mem_port_cmd = "DMA READ or DMA READ MODIFY";
  779. else if ((tmp & 0x1E) == 0x12)
  780. mem_port_cmd = "DMA WRITE";
  781. else
  782. mem_port_cmd = "Unknown";
  783. tmp = (cia->mem_err1 >> 16) & 0xF;
  784. switch (tmp) {
  785. case 0x0:
  786. seq_state = "Idle";
  787. break;
  788. case 0x1:
  789. seq_state = "DMA READ or DMA WRITE";
  790. break;
  791. case 0x2: case 0x3:
  792. seq_state = "READ MISS (or READ MISS MODIFY) with victim";
  793. break;
  794. case 0x4: case 0x5: case 0x6:
  795. seq_state = "READ MISS (or READ MISS MODIFY) with no victim";
  796. break;
  797. case 0x8: case 0x9: case 0xB:
  798. seq_state = "Refresh";
  799. break;
  800. case 0xC:
  801. seq_state = "Idle, waiting for DMA pending read";
  802. break;
  803. case 0xE: case 0xF:
  804. seq_state = "Idle, ras precharge";
  805. break;
  806. default:
  807. seq_state = "Unknown";
  808. break;
  809. }
  810. tmp = (cia->mem_err1 >> 24) & 0x1F;
  811. switch (tmp) {
  812. case 0x00: set_select = "Set 0 selected"; break;
  813. case 0x01: set_select = "Set 1 selected"; break;
  814. case 0x02: set_select = "Set 2 selected"; break;
  815. case 0x03: set_select = "Set 3 selected"; break;
  816. case 0x04: set_select = "Set 4 selected"; break;
  817. case 0x05: set_select = "Set 5 selected"; break;
  818. case 0x06: set_select = "Set 6 selected"; break;
  819. case 0x07: set_select = "Set 7 selected"; break;
  820. case 0x08: set_select = "Set 8 selected"; break;
  821. case 0x09: set_select = "Set 9 selected"; break;
  822. case 0x0A: set_select = "Set A selected"; break;
  823. case 0x0B: set_select = "Set B selected"; break;
  824. case 0x0C: set_select = "Set C selected"; break;
  825. case 0x0D: set_select = "Set D selected"; break;
  826. case 0x0E: set_select = "Set E selected"; break;
  827. case 0x0F: set_select = "Set F selected"; break;
  828. case 0x10: set_select = "No set selected"; break;
  829. case 0x1F: set_select = "Refresh cycle"; break;
  830. default:   set_select = "Unknown"; break;
  831. }
  832. printk(KERN_CRIT "  Memory port command: %sn", mem_port_cmd);
  833. printk(KERN_CRIT "  Memory port address: %#010lx, mask: %#lxn",
  834.        mem_port_addr, mem_port_mask);
  835. printk(KERN_CRIT "  Memory sequencer state: %sn", seq_state);
  836. printk(KERN_CRIT "  Memory set: %sn", set_select);
  837. }
  838. static void
  839. cia_decode_ecc_error(struct el_CIA_sysdata_mcheck *cia, const char *msg)
  840. {
  841. long syn;
  842. long i;
  843. const char *fmt;
  844. cia_decode_mem_error(cia, msg);
  845. syn = cia->cia_syn & 0xff;
  846. if (syn == (syn & -syn)) {
  847. fmt = KERN_CRIT "  ECC syndrome %#x -- check bit %dn";
  848. i = ffs(syn) - 1;
  849. } else {
  850. static unsigned char const data_bit[64] = {
  851. 0xCE, 0xCB, 0xD3, 0xD5,
  852. 0xD6, 0xD9, 0xDA, 0xDC,
  853. 0x23, 0x25, 0x26, 0x29,
  854. 0x2A, 0x2C, 0x31, 0x34,
  855. 0x0E, 0x0B, 0x13, 0x15,
  856. 0x16, 0x19, 0x1A, 0x1C,
  857. 0xE3, 0xE5, 0xE6, 0xE9,
  858. 0xEA, 0xEC, 0xF1, 0xF4,
  859. 0x4F, 0x4A, 0x52, 0x54,
  860. 0x57, 0x58, 0x5B, 0x5D,
  861. 0xA2, 0xA4, 0xA7, 0xA8,
  862. 0xAB, 0xAD, 0xB0, 0xB5,
  863. 0x8F, 0x8A, 0x92, 0x94,
  864. 0x97, 0x98, 0x9B, 0x9D,
  865. 0x62, 0x64, 0x67, 0x68,
  866. 0x6B, 0x6D, 0x70, 0x75
  867. };
  868. for (i = 0; i < 64; ++i)
  869. if (data_bit[i] == syn)
  870. break;
  871. if (i < 64)
  872. fmt = KERN_CRIT "  ECC syndrome %#x -- data bit %dn";
  873. else
  874. fmt = KERN_CRIT "  ECC syndrome %#x -- unknown bitn";
  875. }
  876. printk (fmt, syn, i);
  877. }
  878. static void
  879. cia_decode_parity_error(struct el_CIA_sysdata_mcheck *cia)
  880. {
  881. static const char * const cmd_desc[16] = {
  882. "NOP", "LOCK", "FETCH", "FETCH_M", "MEMORY BARRIER",
  883. "SET DIRTY", "WRITE BLOCK", "WRITE BLOCK LOCK",
  884. "READ MISS0", "READ MISS1", "READ MISS MOD0",
  885. "READ MISS MOD1", "BCACHE VICTIM", "Spare",
  886. "READ MISS MOD STC0", "READ MISS MOD STC1"
  887. };
  888. unsigned long addr;
  889. unsigned long mask;
  890. const char *cmd;
  891. int par;
  892. addr = cia->cpu_err0 & 0xfffffff0;
  893. addr |= (cia->cpu_err1 & 0x83UL) << 32;
  894. cmd = cmd_desc[(cia->cpu_err1 >> 8) & 0xF];
  895. mask = (cia->cpu_err1 >> 12) & 0xF;
  896. par = (cia->cpu_err1 >> 21) & 1;
  897. printk(KERN_CRIT "CIA machine check: System bus parity errorn");
  898. printk(KERN_CRIT "  Command: %s, Parity bit: %dn", cmd, par);
  899. printk(KERN_CRIT "  Address: %#010lx, Mask: %#lxn", addr, mask);
  900. }
  901. static int
  902. cia_decode_mchk(unsigned long la_ptr)
  903. {
  904. struct el_common *com;
  905. struct el_CIA_sysdata_mcheck *cia;
  906. int which;
  907. com = (void *)la_ptr;
  908. cia = (void *)(la_ptr + com->sys_offset);
  909. if ((cia->cia_err & CIA_ERR_VALID) == 0)
  910. return 0;
  911. which = cia->cia_err & 0xfff;
  912. switch (ffs(which) - 1) {
  913. case 0: /* CIA_ERR_COR_ERR */
  914. cia_decode_ecc_error(cia, "Corrected ECC error");
  915. break;
  916. case 1: /* CIA_ERR_UN_COR_ERR */
  917. cia_decode_ecc_error(cia, "Uncorrected ECC error");
  918. break;
  919. case 2: /* CIA_ERR_CPU_PE */
  920. cia_decode_parity_error(cia);
  921. break;
  922. case 3: /* CIA_ERR_MEM_NEM */
  923. cia_decode_mem_error(cia, "Access to nonexistent memory");
  924. break;
  925. case 4: /* CIA_ERR_PCI_SERR */
  926. cia_decode_pci_error(cia, "PCI bus system error");
  927. break;
  928. case 5: /* CIA_ERR_PERR */
  929. cia_decode_pci_error(cia, "PCI data parity error");
  930. break;
  931. case 6: /* CIA_ERR_PCI_ADDR_PE */
  932. cia_decode_pci_error(cia, "PCI address parity error");
  933. break;
  934. case 7: /* CIA_ERR_RCVD_MAS_ABT */
  935. cia_decode_pci_error(cia, "PCI master abort");
  936. break;
  937. case 8: /* CIA_ERR_RCVD_TAR_ABT */
  938. cia_decode_pci_error(cia, "PCI target abort");
  939. break;
  940. case 9: /* CIA_ERR_PA_PTE_INV */
  941. cia_decode_pci_error(cia, "PCI invalid PTE");
  942. break;
  943. case 10: /* CIA_ERR_FROM_WRT_ERR */
  944. cia_decode_mem_error(cia, "Write to flash ROM attempted");
  945. break;
  946. case 11: /* CIA_ERR_IOA_TIMEOUT */
  947. cia_decode_pci_error(cia, "I/O timeout");
  948. break;
  949. }
  950. if (cia->cia_err & CIA_ERR_LOST_CORR_ERR)
  951. printk(KERN_CRIT "CIA lost machine check: "
  952.        "Correctable ECC errorn");
  953. if (cia->cia_err & CIA_ERR_LOST_UN_CORR_ERR)
  954. printk(KERN_CRIT "CIA lost machine check: "
  955.        "Uncorrectable ECC errorn");
  956. if (cia->cia_err & CIA_ERR_LOST_CPU_PE)
  957. printk(KERN_CRIT "CIA lost machine check: "
  958.        "System bus parity errorn");
  959. if (cia->cia_err & CIA_ERR_LOST_MEM_NEM)
  960. printk(KERN_CRIT "CIA lost machine check: "
  961.        "Access to nonexistent memoryn");
  962. if (cia->cia_err & CIA_ERR_LOST_PERR)
  963. printk(KERN_CRIT "CIA lost machine check: "
  964.        "PCI data parity errorn");
  965. if (cia->cia_err & CIA_ERR_LOST_PCI_ADDR_PE)
  966. printk(KERN_CRIT "CIA lost machine check: "
  967.        "PCI address parity errorn");
  968. if (cia->cia_err & CIA_ERR_LOST_RCVD_MAS_ABT)
  969. printk(KERN_CRIT "CIA lost machine check: "
  970.        "PCI master abortn");
  971. if (cia->cia_err & CIA_ERR_LOST_RCVD_TAR_ABT)
  972. printk(KERN_CRIT "CIA lost machine check: "
  973.        "PCI target abortn");
  974. if (cia->cia_err & CIA_ERR_LOST_PA_PTE_INV)
  975. printk(KERN_CRIT "CIA lost machine check: "
  976.        "PCI invalid PTEn");
  977. if (cia->cia_err & CIA_ERR_LOST_FROM_WRT_ERR)
  978. printk(KERN_CRIT "CIA lost machine check: "
  979.        "Write to flash ROM attemptedn");
  980. if (cia->cia_err & CIA_ERR_LOST_IOA_TIMEOUT)
  981. printk(KERN_CRIT "CIA lost machine check: "
  982.        "I/O timeoutn");
  983. return 1;
  984. }
  985. void
  986. cia_machine_check(unsigned long vector, unsigned long la_ptr,
  987.   struct pt_regs * regs)
  988. {
  989. int expected;
  990. /* Clear the error before any reporting.  */
  991. mb();
  992. mb();  /* magic */
  993. draina();
  994. cia_pci_clr_err();
  995. wrmces(rdmces()); /* reset machine check pending flag.  */
  996. mb();
  997. expected = mcheck_expected(0);
  998. if (!expected && vector == 0x660)
  999. expected = cia_decode_mchk(la_ptr);
  1000. process_mcheck_info(vector, la_ptr, regs, "CIA", expected);
  1001. }