Lines Matching +full:pio +full:- +full:transfer

1 // SPDX-License-Identifier: GPL-2.0
36 #define IOMMU_CONTROL (0x2400UL - 0x2400UL) /* IOMMU control register */
37 #define IOMMU_TSBBASE (0x2408UL - 0x2400UL) /* TSB base address register */
38 #define IOMMU_FLUSH (0x2410UL - 0x2400UL) /* IOMMU flush register */
39 #define IOMMU_VADIAG (0x4400UL - 0x2400UL) /* SBUS virtual address diagnostic */
40 #define IOMMU_TAGCMP (0x4408UL - 0x2400UL) /* TLB tag compare diagnostics */
41 #define IOMMU_LRUDIAG (0x4500UL - 0x2400UL) /* IOMMU LRU queue diagnostics */
42 #define IOMMU_TAGDIAG (0x4580UL - 0x2400UL) /* TLB tag diagnostics */
43 #define IOMMU_DRAMDIAG (0x4600UL - 0x2400UL) /* TLB data RAM diagnostics */
49 #define STRBUF_CONTROL (0x2800UL - 0x2800UL) /* Control */
50 #define STRBUF_PFLUSH (0x2808UL - 0x2800UL) /* Page flush/invalidate */
51 #define STRBUF_FSYNC (0x2810UL - 0x2800UL) /* Flush synchronization */
52 #define STRBUF_DRAMDIAG (0x5000UL - 0x2800UL) /* data RAM diagnostic */
53 #define STRBUF_ERRDIAG (0x5400UL - 0x2800UL) /* error status diagnostics */
54 #define STRBUF_PTAGDIAG (0x5800UL - 0x2800UL) /* Page tag diagnostics */
55 #define STRBUF_LTAGDIAG (0x5900UL - 0x2800UL) /* Line tag diagnostics */
59 /* Enable 64-bit DVMA mode for the given device. */
62 struct iommu *iommu = dev->archdata.iommu; in sbus_set_sbus64()
69 regs = of_get_property(op->dev.of_node, "reg", NULL); in sbus_set_sbus64()
72 op->dev.of_node); in sbus_set_sbus64()
75 slot = regs->which_io; in sbus_set_sbus64()
77 cfg_reg = iommu->write_complete_reg; in sbus_set_sbus64()
107 /* Extended transfer mode already enabled. */ in sbus_set_sbus64()
153 #define bogon ((unsigned long) -1)
155 /* SBUS Slot 0 --> 3, level 1 --> 7 */
206 unsigned long diff = SYSIO_ICLR_UNUSED0 - SYSIO_IMAP_SLOT0; in sysio_imap_to_iclr()
212 struct iommu *iommu = op->dev.archdata.iommu; in sbus_build_irq()
213 unsigned long reg_base = iommu->write_complete_reg - 0x2000UL; in sbus_build_irq()
218 if (imap == ((unsigned long)-1)) { in sbus_build_irq()
252 iclr += ((unsigned long)sbus_level - 1UL) * 8UL; in sbus_build_irq()
260 #define SYSIO_UEAFSR_PPIO 0x8000000000000000UL /* Primary PIO cause */
263 #define SYSIO_UEAFSR_SPIO 0x1000000000000000UL /* Secondary PIO is cause */
268 #define SYSIO_UEAFSR_SIZE 0x00001c0000000000UL /* Bad transfer size 2^SIZE */
274 struct iommu *iommu = op->dev.archdata.iommu; in sysio_ue_handler()
275 unsigned long reg_base = iommu->write_complete_reg - 0x2000UL; in sysio_ue_handler()
293 portid = of_getintprop_default(op->dev.of_node, "portid", -1); in sysio_ue_handler()
299 "PIO" : in sysio_ue_handler()
314 printk("(PIO)"); in sysio_ue_handler()
333 #define SYSIO_CEAFSR_PPIO 0x8000000000000000UL /* Primary PIO cause */
336 #define SYSIO_CEAFSR_SPIO 0x1000000000000000UL /* Secondary PIO cause */
342 #define SYSIO_CEAFSR_SIZE 0x00001c0000000000UL /* Bad transfer size 2^SIZE */
348 struct iommu *iommu = op->dev.archdata.iommu; in sysio_ce_handler()
349 unsigned long reg_base = iommu->write_complete_reg - 0x2000UL; in sysio_ce_handler()
367 portid = of_getintprop_default(op->dev.of_node, "portid", -1); in sysio_ce_handler()
372 "PIO" : in sysio_ce_handler()
379 * XXX UDB CE trap handler does... -DaveM in sysio_ce_handler()
393 printk("(PIO)"); in sysio_ce_handler()
412 #define SYSIO_SBAFSR_PLE 0x8000000000000000UL /* Primary Late PIO Error */
415 #define SYSIO_SBAFSR_SLE 0x1000000000000000UL /* Secondary Late PIO Error */
419 #define SYSIO_SBAFSR_RD 0x0000800000000000UL /* Primary was late PIO read */
421 #define SYSIO_SBAFSR_SIZE 0x00001c0000000000UL /* Size of transfer */
427 struct iommu *iommu = op->dev.archdata.iommu; in sysio_sbus_error_handler()
432 reg_base = iommu->write_complete_reg - 0x2000UL; in sysio_sbus_error_handler()
445 portid = of_getintprop_default(op->dev.of_node, "portid", -1); in sysio_sbus_error_handler()
451 "Late PIO Error" : in sysio_sbus_error_handler()
466 printk("(Late PIO Error)"); in sysio_sbus_error_handler()
496 struct iommu *iommu = op->dev.archdata.iommu; in sysio_register_error_handlers()
497 unsigned long reg_base = iommu->write_complete_reg - 0x2000UL; in sysio_register_error_handlers()
502 portid = of_getintprop_default(op->dev.of_node, "portid", -1); in sysio_register_error_handlers()
534 control = upa_readq(iommu->write_complete_reg); in sysio_register_error_handlers()
536 upa_writeq(control, iommu->write_complete_reg); in sysio_register_error_handlers()
543 struct device_node *dp = op->dev.of_node; in sbus_iommu_init()
556 regs = pr->phys_addr; in sbus_iommu_init()
563 op->dev.archdata.iommu = iommu; in sbus_iommu_init()
564 op->dev.archdata.stc = strbuf; in sbus_iommu_init()
565 op->dev.archdata.numa_node = NUMA_NO_NODE; in sbus_iommu_init()
568 iommu->iommu_control = reg_base + IOMMU_CONTROL; in sbus_iommu_init()
569 iommu->iommu_tsbbase = reg_base + IOMMU_TSBBASE; in sbus_iommu_init()
570 iommu->iommu_flush = reg_base + IOMMU_FLUSH; in sbus_iommu_init()
571 iommu->iommu_tags = iommu->iommu_control + in sbus_iommu_init()
572 (IOMMU_TAGDIAG - IOMMU_CONTROL); in sbus_iommu_init()
575 strbuf->strbuf_control = reg_base + STRBUF_CONTROL; in sbus_iommu_init()
576 strbuf->strbuf_pflush = reg_base + STRBUF_PFLUSH; in sbus_iommu_init()
577 strbuf->strbuf_fsync = reg_base + STRBUF_FSYNC; in sbus_iommu_init()
579 strbuf->strbuf_enabled = 1; in sbus_iommu_init()
581 strbuf->strbuf_flushflag = (volatile unsigned long *) in sbus_iommu_init()
582 ((((unsigned long)&strbuf->__flushflag_buf[0]) in sbus_iommu_init()
585 strbuf->strbuf_flushflag_pa = (unsigned long) in sbus_iommu_init()
586 __pa(strbuf->strbuf_flushflag); in sbus_iommu_init()
591 iommu->write_complete_reg = regs + 0x2000UL; in sbus_iommu_init()
593 portid = of_getintprop_default(op->dev.of_node, "portid", -1); in sbus_iommu_init()
598 if (iommu_table_init(iommu, IO_TSB_SIZE, MAP_BASE, 0xffffffff, -1)) in sbus_iommu_init()
601 control = upa_readq(iommu->iommu_control); in sbus_iommu_init()
606 upa_writeq(control, iommu->iommu_control); in sbus_iommu_init()
614 dram = iommu->iommu_control + (IOMMU_DRAMDIAG - IOMMU_CONTROL); in sbus_iommu_init()
615 tag = iommu->iommu_control + (IOMMU_TAGDIAG - IOMMU_CONTROL); in sbus_iommu_init()
622 upa_readq(iommu->write_complete_reg); in sbus_iommu_init()
625 upa_writeq(__pa(iommu->page_table), iommu->iommu_tsbbase); in sbus_iommu_init()
629 upa_writeq(control, strbuf->strbuf_control); in sbus_iommu_init()
635 ptag = strbuf->strbuf_control + in sbus_iommu_init()
636 (STRBUF_PTAGDIAG - STRBUF_CONTROL); in sbus_iommu_init()
637 ltag = strbuf->strbuf_control + in sbus_iommu_init()
638 (STRBUF_LTAGDIAG - STRBUF_CONTROL); in sbus_iommu_init()
647 control = upa_readq(iommu->write_complete_reg); in sbus_iommu_init()
649 upa_writeq(control, iommu->write_complete_reg); in sbus_iommu_init()