Lines Matching +full:fault +full:- +full:log +full:- +full:enable
1 // SPDX-License-Identifier: GPL-2.0
37 #define IOMMU_CONTROL (0x2400UL - 0x2400UL) /* IOMMU control register */
38 #define IOMMU_TSBBASE (0x2408UL - 0x2400UL) /* TSB base address register */
39 #define IOMMU_FLUSH (0x2410UL - 0x2400UL) /* IOMMU flush register */
40 #define IOMMU_VADIAG (0x4400UL - 0x2400UL) /* SBUS virtual address diagnostic */
41 #define IOMMU_TAGCMP (0x4408UL - 0x2400UL) /* TLB tag compare diagnostics */
42 #define IOMMU_LRUDIAG (0x4500UL - 0x2400UL) /* IOMMU LRU queue diagnostics */
43 #define IOMMU_TAGDIAG (0x4580UL - 0x2400UL) /* TLB tag diagnostics */
44 #define IOMMU_DRAMDIAG (0x4600UL - 0x2400UL) /* TLB data RAM diagnostics */
50 #define STRBUF_CONTROL (0x2800UL - 0x2800UL) /* Control */
51 #define STRBUF_PFLUSH (0x2808UL - 0x2800UL) /* Page flush/invalidate */
52 #define STRBUF_FSYNC (0x2810UL - 0x2800UL) /* Flush synchronization */
53 #define STRBUF_DRAMDIAG (0x5000UL - 0x2800UL) /* data RAM diagnostic */
54 #define STRBUF_ERRDIAG (0x5400UL - 0x2800UL) /* error status diagnostics */
55 #define STRBUF_PTAGDIAG (0x5800UL - 0x2800UL) /* Page tag diagnostics */
56 #define STRBUF_LTAGDIAG (0x5900UL - 0x2800UL) /* Line tag diagnostics */
60 /* Enable 64-bit DVMA mode for the given device. */
63 struct iommu *iommu = dev->archdata.iommu; in sbus_set_sbus64()
70 regs = of_get_property(op->dev.of_node, "reg", NULL); in sbus_set_sbus64()
73 op->dev.of_node); in sbus_set_sbus64()
76 slot = regs->which_io; in sbus_set_sbus64()
78 cfg_reg = iommu->write_complete_reg; in sbus_set_sbus64()
154 #define bogon ((unsigned long) -1)
156 /* SBUS Slot 0 --> 3, level 1 --> 7 */
207 unsigned long diff = SYSIO_ICLR_UNUSED0 - SYSIO_IMAP_SLOT0; in sysio_imap_to_iclr()
213 struct iommu *iommu = op->dev.archdata.iommu; in sbus_build_irq()
214 unsigned long reg_base = iommu->write_complete_reg - 0x2000UL; in sbus_build_irq()
219 if (imap == ((unsigned long)-1)) { in sbus_build_irq()
253 iclr += ((unsigned long)sbus_level - 1UL) * 8UL; in sbus_build_irq()
270 #define SYSIO_UEAFSR_MID 0x000003e000000000UL /* UPA MID causing the fault */
275 struct iommu *iommu = op->dev.archdata.iommu; in sysio_ue_handler()
276 unsigned long reg_base = iommu->write_complete_reg - 0x2000UL; in sysio_ue_handler()
294 portid = of_getintprop_default(op->dev.of_node, "portid", -1); in sysio_ue_handler()
296 /* Log the error. */ in sysio_ue_handler()
344 #define SYSIO_CEAFSR_MID 0x000003e000000000UL /* UPA MID causing the fault */
349 struct iommu *iommu = op->dev.archdata.iommu; in sysio_ce_handler()
350 unsigned long reg_base = iommu->write_complete_reg - 0x2000UL; in sysio_ce_handler()
368 portid = of_getintprop_default(op->dev.of_node, "portid", -1); in sysio_ce_handler()
380 * XXX UDB CE trap handler does... -DaveM in sysio_ce_handler()
428 struct iommu *iommu = op->dev.archdata.iommu; in sysio_sbus_error_handler()
433 reg_base = iommu->write_complete_reg - 0x2000UL; in sysio_sbus_error_handler()
446 portid = of_getintprop_default(op->dev.of_node, "portid", -1); in sysio_sbus_error_handler()
448 /* Log the error. */ in sysio_sbus_error_handler()
487 #define SYSIO_ECNTRL_ECCEN 0x8000000000000000UL /* Enable ECC Checking */
488 #define SYSIO_ECNTRL_UEEN 0x4000000000000000UL /* Enable UE Interrupts */
489 #define SYSIO_ECNTRL_CEEN 0x2000000000000000UL /* Enable CE Interrupts */
497 struct iommu *iommu = op->dev.archdata.iommu; in sysio_register_error_handlers()
498 unsigned long reg_base = iommu->write_complete_reg - 0x2000UL; in sysio_register_error_handlers()
503 portid = of_getintprop_default(op->dev.of_node, "portid", -1); in sysio_register_error_handlers()
529 /* Now turn the error interrupts on and also enable ECC checking. */ in sysio_register_error_handlers()
535 control = upa_readq(iommu->write_complete_reg); in sysio_register_error_handlers()
536 control |= 0x100UL; /* SBUS Error Interrupt Enable */ in sysio_register_error_handlers()
537 upa_writeq(control, iommu->write_complete_reg); in sysio_register_error_handlers()
544 struct device_node *dp = op->dev.of_node; in sbus_iommu_init()
557 regs = pr->phys_addr; in sbus_iommu_init()
564 op->dev.archdata.iommu = iommu; in sbus_iommu_init()
565 op->dev.archdata.stc = strbuf; in sbus_iommu_init()
566 op->dev.archdata.numa_node = NUMA_NO_NODE; in sbus_iommu_init()
569 iommu->iommu_control = reg_base + IOMMU_CONTROL; in sbus_iommu_init()
570 iommu->iommu_tsbbase = reg_base + IOMMU_TSBBASE; in sbus_iommu_init()
571 iommu->iommu_flush = reg_base + IOMMU_FLUSH; in sbus_iommu_init()
572 iommu->iommu_tags = iommu->iommu_control + in sbus_iommu_init()
573 (IOMMU_TAGDIAG - IOMMU_CONTROL); in sbus_iommu_init()
576 strbuf->strbuf_control = reg_base + STRBUF_CONTROL; in sbus_iommu_init()
577 strbuf->strbuf_pflush = reg_base + STRBUF_PFLUSH; in sbus_iommu_init()
578 strbuf->strbuf_fsync = reg_base + STRBUF_FSYNC; in sbus_iommu_init()
580 strbuf->strbuf_enabled = 1; in sbus_iommu_init()
582 strbuf->strbuf_flushflag = (volatile unsigned long *) in sbus_iommu_init()
583 ((((unsigned long)&strbuf->__flushflag_buf[0]) in sbus_iommu_init()
586 strbuf->strbuf_flushflag_pa = (unsigned long) in sbus_iommu_init()
587 __pa(strbuf->strbuf_flushflag); in sbus_iommu_init()
592 iommu->write_complete_reg = regs + 0x2000UL; in sbus_iommu_init()
594 portid = of_getintprop_default(op->dev.of_node, "portid", -1); in sbus_iommu_init()
599 if (iommu_table_init(iommu, IO_TSB_SIZE, MAP_BASE, 0xffffffff, -1)) in sbus_iommu_init()
602 control = upa_readq(iommu->iommu_control); in sbus_iommu_init()
607 upa_writeq(control, iommu->iommu_control); in sbus_iommu_init()
615 dram = iommu->iommu_control + (IOMMU_DRAMDIAG - IOMMU_CONTROL); in sbus_iommu_init()
616 tag = iommu->iommu_control + (IOMMU_TAGDIAG - IOMMU_CONTROL); in sbus_iommu_init()
623 upa_readq(iommu->write_complete_reg); in sbus_iommu_init()
626 upa_writeq(__pa(iommu->page_table), iommu->iommu_tsbbase); in sbus_iommu_init()
630 upa_writeq(control, strbuf->strbuf_control); in sbus_iommu_init()
636 ptag = strbuf->strbuf_control + in sbus_iommu_init()
637 (STRBUF_PTAGDIAG - STRBUF_CONTROL); in sbus_iommu_init()
638 ltag = strbuf->strbuf_control + in sbus_iommu_init()
639 (STRBUF_LTAGDIAG - STRBUF_CONTROL); in sbus_iommu_init()
647 /* Enable DVMA arbitration for all devices/slots. */ in sbus_iommu_init()
648 control = upa_readq(iommu->write_complete_reg); in sbus_iommu_init()
650 upa_writeq(control, iommu->write_complete_reg); in sbus_iommu_init()