Lines Matching +full:- +full:1 +full:ul
1 // SPDX-License-Identifier: GPL-2.0
56 #define SCHIZO_IOMMU_TSBSZ_1K 0x0000000000000000UL /* TSB Table 1024 8-byte entries */
57 #define SCHIZO_IOMMU_TSBSZ_2K 0x0000000000010000UL /* TSB Table 2048 8-byte entries */
58 #define SCHIZO_IOMMU_TSBSZ_4K 0x0000000000020000UL /* TSB Table 4096 8-byte entries */
59 #define SCHIZO_IOMMU_TSBSZ_8K 0x0000000000030000UL /* TSB Table 8192 8-byte entries */
60 #define SCHIZO_IOMMU_TSBSZ_16K 0x0000000000040000UL /* TSB Table 16k 8-byte entries */
61 #define SCHIZO_IOMMU_TSBSZ_32K 0x0000000000050000UL /* TSB Table 32k 8-byte entries */
62 #define SCHIZO_IOMMU_TSBSZ_64K 0x0000000000060000UL /* TSB Table 64k 8-byte entries */
63 #define SCHIZO_IOMMU_TSBSZ_128K 0x0000000000070000UL /* TSB Table 128k 8-byte entries */
65 #define SCHIZO_IOMMU_CTRL_TBWSZ 0x0000000000000004UL /* Assumed page size, 0=8k 1=64k */
72 * 32 24 23 16 15 11 10 8 7 2 1 0
73 * ---------------------------------------------------------
75 * ---------------------------------------------------------
77 #define SCHIZO_CONFIG_BASE(PBM) ((PBM)->config_space)
90 bus -= pbm->pci_first_busno; in schizo_pci_config_mkaddr()
112 #define SCHIZO_STC_ERR 0xb800UL /* --> 0xba00 */
113 #define SCHIZO_STC_TAG 0xba00UL /* --> 0xba80 */
114 #define SCHIZO_STC_LINE 0xbb00UL /* --> 0xbb80 */
134 struct strbuf *strbuf = &pbm->stc; in __schizo_check_stc_error_pbm()
135 unsigned long regbase = pbm->pbm_regs; in __schizo_check_stc_error_pbm()
149 * of the line tag valid bits before re-enabling in __schizo_check_stc_error_pbm()
155 control = upa_readq(strbuf->strbuf_control); in __schizo_check_stc_error_pbm()
157 strbuf->strbuf_control); in __schizo_check_stc_error_pbm()
161 val = upa_readq(err_base + (i * 8UL)); in __schizo_check_stc_error_pbm()
162 upa_writeq(0UL, err_base + (i * 8UL)); in __schizo_check_stc_error_pbm()
166 stc_tag_buf[i] = upa_readq(tag_base + (i * 8UL)); in __schizo_check_stc_error_pbm()
167 stc_line_buf[i] = upa_readq(line_base + (i * 8UL)); in __schizo_check_stc_error_pbm()
168 upa_writeq(0UL, tag_base + (i * 8UL)); in __schizo_check_stc_error_pbm()
169 upa_writeq(0UL, line_base + (i * 8UL)); in __schizo_check_stc_error_pbm()
173 upa_writeq(control, strbuf->strbuf_control); in __schizo_check_stc_error_pbm()
186 pbm->name, in __schizo_check_stc_error_pbm()
188 (errval & SCHIZO_STCERR_WRITE) ? 1 : 0, in __schizo_check_stc_error_pbm()
189 (errval & SCHIZO_STCERR_READ) ? 1 : 0); in __schizo_check_stc_error_pbm()
196 pbm->name, in __schizo_check_stc_error_pbm()
198 ((tagval & SCHIZO_STCTAG_PPN) >> 19UL), in __schizo_check_stc_error_pbm()
200 ((tagval & SCHIZO_STCTAG_VALID) ? 1 : 0), in __schizo_check_stc_error_pbm()
201 ((tagval & SCHIZO_STCTAG_READ) ? 1 : 0)); in __schizo_check_stc_error_pbm()
203 /* XXX Should spit out per-bank error information... -DaveM */ in __schizo_check_stc_error_pbm()
206 pbm->name, in __schizo_check_stc_error_pbm()
208 ((lineval & SCHIZO_STCLINE_LINDX) >> 23UL), in __schizo_check_stc_error_pbm()
209 ((lineval & SCHIZO_STCLINE_SPTR) >> 13UL), in __schizo_check_stc_error_pbm()
210 ((lineval & SCHIZO_STCLINE_LADDR) >> 6UL), in __schizo_check_stc_error_pbm()
211 ((lineval & SCHIZO_STCLINE_EPTR) >> 0UL), in __schizo_check_stc_error_pbm()
212 ((lineval & SCHIZO_STCLINE_VALID) ? 1 : 0), in __schizo_check_stc_error_pbm()
213 ((lineval & SCHIZO_STCLINE_FOFN) ? 1 : 0)); in __schizo_check_stc_error_pbm()
220 /* IOMMU is per-PBM in Schizo, so interrogate both for anonymous
242 struct iommu *iommu = pbm->iommu; in schizo_check_iommu_error_pbm()
249 spin_lock_irqsave(&iommu->lock, flags); in schizo_check_iommu_error_pbm()
250 control = upa_readq(iommu->iommu_control); in schizo_check_iommu_error_pbm()
257 upa_writeq(control, iommu->iommu_control); in schizo_check_iommu_error_pbm()
259 switch((control & SCHIZO_IOMMU_CTRL_XLTESTAT) >> 25UL) { in schizo_check_iommu_error_pbm()
263 case 1: in schizo_check_iommu_error_pbm()
275 pbm->name, type_string); in schizo_check_iommu_error_pbm()
288 iommu->iommu_control); in schizo_check_iommu_error_pbm()
290 base = pbm->pbm_regs; in schizo_check_iommu_error_pbm()
294 upa_readq(base + SCHIZO_IOMMU_TAG + (i * 8UL)); in schizo_check_iommu_error_pbm()
296 upa_readq(base + SCHIZO_IOMMU_DATA + (i * 8UL)); in schizo_check_iommu_error_pbm()
299 upa_writeq(0, base + SCHIZO_IOMMU_TAG + (i * 8UL)); in schizo_check_iommu_error_pbm()
300 upa_writeq(0, base + SCHIZO_IOMMU_DATA + (i * 8UL)); in schizo_check_iommu_error_pbm()
304 upa_writeq(control, iommu->iommu_control); in schizo_check_iommu_error_pbm()
314 switch((tag & SCHIZO_IOMMU_TAG_ERRSTS) >> 23UL) { in schizo_check_iommu_error_pbm()
318 case 1: in schizo_check_iommu_error_pbm()
331 pbm->name, i, type_string, in schizo_check_iommu_error_pbm()
332 (int)((tag & SCHIZO_IOMMU_TAG_CTXT) >> 25UL), in schizo_check_iommu_error_pbm()
333 ((tag & SCHIZO_IOMMU_TAG_WRITE) ? 1 : 0), in schizo_check_iommu_error_pbm()
334 ((tag & SCHIZO_IOMMU_TAG_STREAM) ? 1 : 0), in schizo_check_iommu_error_pbm()
338 pbm->name, i, in schizo_check_iommu_error_pbm()
339 ((data & SCHIZO_IOMMU_DATA_VALID) ? 1 : 0), in schizo_check_iommu_error_pbm()
340 ((data & SCHIZO_IOMMU_DATA_CACHE) ? 1 : 0), in schizo_check_iommu_error_pbm()
344 if (pbm->stc.strbuf_enabled) in schizo_check_iommu_error_pbm()
346 spin_unlock_irqrestore(&iommu->lock, flags); in schizo_check_iommu_error_pbm()
353 if (pbm->sibling) in schizo_check_iommu_error()
354 schizo_check_iommu_error_pbm(pbm->sibling, type); in schizo_check_iommu_error()
379 unsigned long afsr_reg = pbm->controller_regs + SCHIZO_UE_AFSR; in schizo_ue_intr()
380 unsigned long afar_reg = pbm->controller_regs + SCHIZO_UE_AFAR; in schizo_ue_intr()
389 * the hardware and we must re-read to get a clean value. in schizo_ue_intr()
394 } while ((afsr & SCHIZO_UEAFSR_ERRPNDG) != 0 && --limit); in schizo_ue_intr()
406 pbm->name, in schizo_ue_intr()
414 pbm->name, in schizo_ue_intr()
415 (afsr & SCHIZO_UEAFSR_BMSK) >> 32UL, in schizo_ue_intr()
416 (afsr & SCHIZO_UEAFSR_QOFF) >> 30UL, in schizo_ue_intr()
417 (afsr & SCHIZO_UEAFSR_AID) >> 24UL); in schizo_ue_intr()
419 pbm->name, in schizo_ue_intr()
420 (afsr & SCHIZO_UEAFSR_PARTIAL) ? 1 : 0, in schizo_ue_intr()
421 (afsr & SCHIZO_UEAFSR_OWNEDIN) ? 1 : 0, in schizo_ue_intr()
422 (afsr & SCHIZO_UEAFSR_MTAG) >> 13UL, in schizo_ue_intr()
423 (afsr & SCHIZO_UEAFSR_MTAGSYND) >> 16UL, in schizo_ue_intr()
424 (afsr & SCHIZO_UEAFSR_ECCSYND) >> 0UL); in schizo_ue_intr()
425 printk("%s: UE AFAR [%016lx]\n", pbm->name, afar); in schizo_ue_intr()
426 printk("%s: UE Secondary errors [", pbm->name); in schizo_ue_intr()
467 unsigned long afsr_reg = pbm->controller_regs + SCHIZO_CE_AFSR; in schizo_ce_intr()
468 unsigned long afar_reg = pbm->controller_regs + SCHIZO_CE_AFAR; in schizo_ce_intr()
477 * the hardware and we must re-read to get a clean value. in schizo_ce_intr()
482 } while ((afsr & SCHIZO_UEAFSR_ERRPNDG) != 0 && --limit); in schizo_ce_intr()
494 pbm->name, in schizo_ce_intr()
503 * XXX UDB CE trap handler does... -DaveM in schizo_ce_intr()
506 pbm->name, in schizo_ce_intr()
507 (afsr & SCHIZO_UEAFSR_BMSK) >> 32UL, in schizo_ce_intr()
508 (afsr & SCHIZO_UEAFSR_QOFF) >> 30UL, in schizo_ce_intr()
509 (afsr & SCHIZO_UEAFSR_AID) >> 24UL); in schizo_ce_intr()
511 pbm->name, in schizo_ce_intr()
512 (afsr & SCHIZO_UEAFSR_PARTIAL) ? 1 : 0, in schizo_ce_intr()
513 (afsr & SCHIZO_UEAFSR_OWNEDIN) ? 1 : 0, in schizo_ce_intr()
514 (afsr & SCHIZO_UEAFSR_MTAG) >> 13UL, in schizo_ce_intr()
515 (afsr & SCHIZO_UEAFSR_MTAGSYND) >> 16UL, in schizo_ce_intr()
516 (afsr & SCHIZO_UEAFSR_ECCSYND) >> 0UL); in schizo_ce_intr()
517 printk("%s: CE AFAR [%016lx]\n", pbm->name, afar); in schizo_ce_intr()
518 printk("%s: CE Secondary errors [", pbm->name); in schizo_ce_intr()
557 #define SCHIZO_PCICTRL_BUS_UNUS (1UL << 63UL) /* Safari */
558 #define SCHIZO_PCICTRL_DTO_INT (1UL << 61UL) /* Tomatillo */
559 #define SCHIZO_PCICTRL_ARB_PRIO (0x1ff << 52UL) /* Tomatillo */
560 #define SCHIZO_PCICTRL_ESLCK (1UL << 51UL) /* Safari */
561 #define SCHIZO_PCICTRL_ERRSLOT (7UL << 48UL) /* Safari */
562 #define SCHIZO_PCICTRL_TTO_ERR (1UL << 38UL) /* Safari/Tomatillo */
563 #define SCHIZO_PCICTRL_RTRY_ERR (1UL << 37UL) /* Safari/Tomatillo */
564 #define SCHIZO_PCICTRL_DTO_ERR (1UL << 36UL) /* Safari/Tomatillo */
565 #define SCHIZO_PCICTRL_SBH_ERR (1UL << 35UL) /* Safari */
566 #define SCHIZO_PCICTRL_SERR (1UL << 34UL) /* Safari/Tomatillo */
567 #define SCHIZO_PCICTRL_PCISPD (1UL << 33UL) /* Safari */
568 #define SCHIZO_PCICTRL_MRM_PREF (1UL << 30UL) /* Tomatillo */
569 #define SCHIZO_PCICTRL_RDO_PREF (1UL << 29UL) /* Tomatillo */
570 #define SCHIZO_PCICTRL_RDL_PREF (1UL << 28UL) /* Tomatillo */
571 #define SCHIZO_PCICTRL_PTO (3UL << 24UL) /* Safari/Tomatillo */
572 #define SCHIZO_PCICTRL_PTO_SHIFT 24UL
573 #define SCHIZO_PCICTRL_TRWSW (7UL << 21UL) /* Tomatillo */
574 #define SCHIZO_PCICTRL_F_TGT_A (1UL << 20UL) /* Tomatillo */
575 #define SCHIZO_PCICTRL_S_DTO_INT (1UL << 19UL) /* Safari */
576 #define SCHIZO_PCICTRL_F_TGT_RT (1UL << 19UL) /* Tomatillo */
577 #define SCHIZO_PCICTRL_SBH_INT (1UL << 18UL) /* Safari */
578 #define SCHIZO_PCICTRL_T_DTO_INT (1UL << 18UL) /* Tomatillo */
579 #define SCHIZO_PCICTRL_EEN (1UL << 17UL) /* Safari/Tomatillo */
580 #define SCHIZO_PCICTRL_PARK (1UL << 16UL) /* Safari/Tomatillo */
581 #define SCHIZO_PCICTRL_PCIRST (1UL << 8UL) /* Safari */
582 #define SCHIZO_PCICTRL_ARB_S (0x3fUL << 0UL) /* Safari */
583 #define SCHIZO_PCICTRL_ARB_T (0xffUL << 0UL) /* Tomatillo */
591 csr_reg = pbm->pbm_regs + SCHIZO_PCI_CTRL; in schizo_pcierr_intr_other()
607 pbm->name); in schizo_pcierr_intr_other()
610 pbm->name); in schizo_pcierr_intr_other()
613 pbm->name); in schizo_pcierr_intr_other()
616 pbm->name); in schizo_pcierr_intr_other()
619 pbm->name); in schizo_pcierr_intr_other()
622 pbm->name); in schizo_pcierr_intr_other()
625 pbm->pci_ops->read(pbm->pci_bus, 0, PCI_STATUS, 2, &stat); in schizo_pcierr_intr_other()
632 pbm->name, stat); in schizo_pcierr_intr_other()
633 pbm->pci_ops->write(pbm->pci_bus, 0, PCI_STATUS, 2, 0xffff); in schizo_pcierr_intr_other()
646 base = pbm->pbm_regs; in schizo_pcierr_intr()
669 pbm->name, in schizo_pcierr_intr()
683 pbm->name, in schizo_pcierr_intr()
684 (afsr & SCHIZO_PCIAFSR_BMSK) >> 32UL, in schizo_pcierr_intr()
685 (afsr & SCHIZO_PCIAFSR_BLK) ? 1 : 0, in schizo_pcierr_intr()
693 pbm->name, afar); in schizo_pcierr_intr()
695 pbm->name); in schizo_pcierr_intr()
736 pci_scan_for_target_abort(pbm, pbm->pci_bus); in schizo_pcierr_intr()
739 pci_scan_for_master_abort(pbm, pbm->pci_bus); in schizo_pcierr_intr()
749 pci_scan_for_parity_error(pbm, pbm->pci_bus); in schizo_pcierr_intr()
798 errlog = upa_readq(pbm->controller_regs + SCHIZO_SAFARI_ERRLOG); in schizo_safarierr_intr()
800 pbm->controller_regs + SCHIZO_SAFARI_ERRLOG); in schizo_safarierr_intr()
804 pbm->name, errlog); in schizo_safarierr_intr()
810 pbm->name); in schizo_safarierr_intr()
831 if (pbm->ino_bitmap & (1UL << ino)) in pbm_routes_this_ino()
832 return 1; in pbm_routes_this_ino()
853 struct platform_device *op = of_find_device_by_node(pbm->op->dev.of_node); in tomatillo_register_error_handlers()
859 * 1: UE ERR in tomatillo_register_error_handlers()
866 err = request_irq(op->archdata.irqs[1], schizo_ue_intr, 0, in tomatillo_register_error_handlers()
870 "err=%d\n", pbm->name, err); in tomatillo_register_error_handlers()
873 err = request_irq(op->archdata.irqs[2], schizo_ce_intr, 0, in tomatillo_register_error_handlers()
877 "err=%d\n", pbm->name, err); in tomatillo_register_error_handlers()
881 err = request_irq(op->archdata.irqs[0], schizo_pcierr_intr, 0, in tomatillo_register_error_handlers()
884 err = request_irq(op->archdata.irqs[0], schizo_pcierr_intr, 0, in tomatillo_register_error_handlers()
889 "err=%d\n", pbm->name, err); in tomatillo_register_error_handlers()
892 err = request_irq(op->archdata.irqs[3], schizo_safarierr_intr, 0, in tomatillo_register_error_handlers()
896 "err=%d\n", pbm->name, err); in tomatillo_register_error_handlers()
902 SCHIZO_ECCCTRL_CE), pbm->controller_regs + SCHIZO_ECC_CTRL); in tomatillo_register_error_handlers()
915 tmp = upa_readq(pbm->pbm_regs + SCHIZO_PCI_CTRL); in tomatillo_register_error_handlers()
918 upa_writeq(tmp, pbm->pbm_regs + SCHIZO_PCI_CTRL); in tomatillo_register_error_handlers()
927 upa_writeq(err_mask, pbm->pbm_regs + SCHIZO_PCI_AFSR); in tomatillo_register_error_handlers()
940 pbm->controller_regs + SCHIZO_SAFARI_ERRCTRL); in tomatillo_register_error_handlers()
943 pbm->controller_regs + SCHIZO_SAFARI_IRQCTRL); in tomatillo_register_error_handlers()
948 struct platform_device *op = of_find_device_by_node(pbm->op->dev.of_node); in schizo_register_error_handlers()
954 * 1: UE ERR in schizo_register_error_handlers()
961 err = request_irq(op->archdata.irqs[1], schizo_ue_intr, 0, in schizo_register_error_handlers()
965 "err=%d\n", pbm->name, err); in schizo_register_error_handlers()
968 err = request_irq(op->archdata.irqs[2], schizo_ce_intr, 0, in schizo_register_error_handlers()
972 "err=%d\n", pbm->name, err); in schizo_register_error_handlers()
976 err = request_irq(op->archdata.irqs[0], schizo_pcierr_intr, 0, in schizo_register_error_handlers()
979 err = request_irq(op->archdata.irqs[0], schizo_pcierr_intr, 0, in schizo_register_error_handlers()
984 "err=%d\n", pbm->name, err); in schizo_register_error_handlers()
987 err = request_irq(op->archdata.irqs[3], schizo_safarierr_intr, 0, in schizo_register_error_handlers()
991 "err=%d\n", pbm->name, err); in schizo_register_error_handlers()
997 SCHIZO_ECCCTRL_CE), pbm->controller_regs + SCHIZO_ECC_CTRL); in schizo_register_error_handlers()
1013 tmp = upa_readq(pbm->pbm_regs + SCHIZO_PCI_CTRL); in schizo_register_error_handlers()
1016 upa_writeq(tmp, pbm->pbm_regs + SCHIZO_PCI_CTRL); in schizo_register_error_handlers()
1024 pbm->pbm_regs + SCHIZO_PCI_AFSR); in schizo_register_error_handlers()
1039 #if 1 in schizo_register_error_handlers()
1041 * XXX Sun is shipping. The behavior on a 2-cpu in schizo_register_error_handlers()
1045 * XXX ignore them for now. -DaveM in schizo_register_error_handlers()
1052 pbm->controller_regs + SCHIZO_SAFARI_ERRCTRL); in schizo_register_error_handlers()
1059 /* Set cache-line size to 64 bytes, this is actually in pbm_config_busmastering()
1062 addr = schizo_pci_config_mkaddr(pbm, pbm->pci_first_busno, in pbm_config_busmastering()
1067 addr = schizo_pci_config_mkaddr(pbm, pbm->pci_first_busno, in pbm_config_busmastering()
1075 pbm->is_66mhz_capable = in schizo_scan_bus()
1076 (of_find_property(pbm->op->dev.of_node, "66mhz-capable", NULL) in schizo_scan_bus()
1079 pbm->pci_bus = pci_scan_one_pbm(pbm, parent); in schizo_scan_bus()
1081 if (pbm->chip_type == PBM_CHIP_TYPE_TOMATILLO) in schizo_scan_bus()
1095 unsigned long base = pbm->pbm_regs; in schizo_pbm_strbuf_init()
1098 if (pbm->chip_type == PBM_CHIP_TYPE_TOMATILLO) { in schizo_pbm_strbuf_init()
1104 pbm->stc.strbuf_control = base + SCHIZO_STRBUF_CONTROL; in schizo_pbm_strbuf_init()
1105 pbm->stc.strbuf_pflush = base + SCHIZO_STRBUF_FLUSH; in schizo_pbm_strbuf_init()
1106 pbm->stc.strbuf_fsync = base + SCHIZO_STRBUF_FSYNC; in schizo_pbm_strbuf_init()
1107 pbm->stc.strbuf_ctxflush = base + SCHIZO_STRBUF_CTXFLUSH; in schizo_pbm_strbuf_init()
1108 pbm->stc.strbuf_ctxmatch_base = base + SCHIZO_STRBUF_CTXMATCH; in schizo_pbm_strbuf_init()
1110 pbm->stc.strbuf_flushflag = (volatile unsigned long *) in schizo_pbm_strbuf_init()
1111 ((((unsigned long)&pbm->stc.__flushflag_buf[0]) in schizo_pbm_strbuf_init()
1112 + 63UL) in schizo_pbm_strbuf_init()
1113 & ~63UL); in schizo_pbm_strbuf_init()
1114 pbm->stc.strbuf_flushflag_pa = (unsigned long) in schizo_pbm_strbuf_init()
1115 __pa(pbm->stc.strbuf_flushflag); in schizo_pbm_strbuf_init()
1118 * streaming buffer and leave the rerun-disable in schizo_pbm_strbuf_init()
1121 control = upa_readq(pbm->stc.strbuf_control); in schizo_pbm_strbuf_init()
1126 upa_writeq(control, pbm->stc.strbuf_control); in schizo_pbm_strbuf_init()
1128 pbm->stc.strbuf_enabled = 1; in schizo_pbm_strbuf_init()
1140 struct iommu *iommu = pbm->iommu; in schizo_pbm_iommu_init()
1146 vdma = of_get_property(pbm->op->dev.of_node, "virtual-dma", NULL); in schizo_pbm_iommu_init()
1151 switch (vdma[1]) { in schizo_pbm_iommu_init()
1168 printk(KERN_ERR PFX "Strange virtual-dma size.\n"); in schizo_pbm_iommu_init()
1169 return -EINVAL; in schizo_pbm_iommu_init()
1173 iommu->iommu_control = pbm->pbm_regs + SCHIZO_IOMMU_CONTROL; in schizo_pbm_iommu_init()
1174 iommu->iommu_tsbbase = pbm->pbm_regs + SCHIZO_IOMMU_TSBBASE; in schizo_pbm_iommu_init()
1175 iommu->iommu_flush = pbm->pbm_regs + SCHIZO_IOMMU_FLUSH; in schizo_pbm_iommu_init()
1176 iommu->iommu_tags = iommu->iommu_flush + (0xa580UL - 0x0210UL); in schizo_pbm_iommu_init()
1177 iommu->iommu_ctxflush = pbm->pbm_regs + SCHIZO_IOMMU_CTXFLUSH; in schizo_pbm_iommu_init()
1182 iommu->write_complete_reg = pbm->controller_regs + 0x10000UL; in schizo_pbm_iommu_init()
1187 control = upa_readq(iommu->iommu_control); in schizo_pbm_iommu_init()
1189 upa_writeq(control, iommu->iommu_control); in schizo_pbm_iommu_init()
1194 upa_writeq(0, pbm->pbm_regs + tagbase + (i * 8UL)); in schizo_pbm_iommu_init()
1195 upa_writeq(0, pbm->pbm_regs + database + (i * 8UL)); in schizo_pbm_iommu_init()
1198 /* Leave diag mode enabled for full-flushing done in schizo_pbm_iommu_init()
1202 pbm->numa_node); in schizo_pbm_iommu_init()
1208 upa_writeq(__pa(iommu->page_table), iommu->iommu_tsbbase); in schizo_pbm_iommu_init()
1210 control = upa_readq(iommu->iommu_control); in schizo_pbm_iommu_init()
1222 upa_writeq(control, iommu->iommu_control); in schizo_pbm_iommu_init()
1231 #define SCHIZO_PCIDIAG_D_BADECC (1UL << 10UL) /* Disable BAD ECC errors (Schizo) */
1232 #define SCHIZO_PCIDIAG_D_BYPASS (1UL << 9UL) /* Disable MMU bypass mode (Schizo/Tomatillo) */
1233 #define SCHIZO_PCIDIAG_D_TTO (1UL << 8UL) /* Disable TTO errors (Schizo/Tomatillo) */
1234 #define SCHIZO_PCIDIAG_D_RTRYARB (1UL << 7UL) /* Disable retry arbitration (Schizo) */
1235 #define SCHIZO_PCIDIAG_D_RETRY (1UL << 6UL) /* Disable retry limit (Schizo/Tomatillo) */
1236 #define SCHIZO_PCIDIAG_D_INTSYNC (1UL << 5UL) /* Disable interrupt/DMA synch (Schizo/Tomatillo) */
1237 #define SCHIZO_PCIDIAG_I_DMA_PARITY (1UL << 3UL) /* Invert DMA parity (Schizo/Tomatillo) */
1238 #define SCHIZO_PCIDIAG_I_PIOD_PARITY (1UL << 2UL) /* Invert PIO data parity (Schizo/Tomatillo) */
1239 #define SCHIZO_PCIDIAG_I_PIOA_PARITY (1UL << 1UL) /* Invert PIO address parity (Schizo/Tomatillo)…
1247 #define TOMATILLO_IOC_RDMULT_PLEN_SHIFT 14UL
1249 #define TOMATILLO_IOC_RDONE_PLEN_SHIFT 12UL
1251 #define TOMATILLO_IOC_RDLINE_PLEN_SHIFT 10UL
1253 #define TOMATILLO_IOC_PREF_OFF_SHIFT 3UL
1265 upa_writeq(5, pbm->pbm_regs + SCHIZO_PCI_IRQ_RETRY); in schizo_pbm_hw_init()
1267 tmp = upa_readq(pbm->pbm_regs + SCHIZO_PCI_CTRL); in schizo_pbm_hw_init()
1272 if (pbm->chip_type == PBM_CHIP_TYPE_TOMATILLO && in schizo_pbm_hw_init()
1273 pbm->chip_version >= 0x2) in schizo_pbm_hw_init()
1276 if (!of_property_read_bool(pbm->op->dev.of_node, "no-bus-parking")) in schizo_pbm_hw_init()
1281 if (pbm->chip_type == PBM_CHIP_TYPE_TOMATILLO && in schizo_pbm_hw_init()
1282 pbm->chip_version <= 0x1) in schizo_pbm_hw_init()
1287 if (pbm->chip_type == PBM_CHIP_TYPE_TOMATILLO) in schizo_pbm_hw_init()
1292 upa_writeq(tmp, pbm->pbm_regs + SCHIZO_PCI_CTRL); in schizo_pbm_hw_init()
1294 tmp = upa_readq(pbm->pbm_regs + SCHIZO_PCI_DIAG); in schizo_pbm_hw_init()
1298 upa_writeq(tmp, pbm->pbm_regs + SCHIZO_PCI_DIAG); in schizo_pbm_hw_init()
1300 if (pbm->chip_type == PBM_CHIP_TYPE_TOMATILLO) { in schizo_pbm_hw_init()
1305 (1 << TOMATILLO_IOC_PREF_OFF_SHIFT) | in schizo_pbm_hw_init()
1310 upa_writeq(tmp, pbm->pbm_regs + TOMATILLO_PCI_IOC_CSR); in schizo_pbm_hw_init()
1319 struct device_node *dp = op->dev.of_node; in schizo_pbm_init()
1339 * 1) PBM controller regs in schizo_pbm_init()
1340 * 2) Schizo front-end controller regs (same for both PBMs) in schizo_pbm_init()
1344 * 1) PBM controller regs in schizo_pbm_init()
1345 * 2) Tomatillo front-end controller regs in schizo_pbm_init()
1351 pbm->next = pci_pbm_root; in schizo_pbm_init()
1354 pbm->numa_node = NUMA_NO_NODE; in schizo_pbm_init()
1356 pbm->pci_ops = &sun4u_pci_ops; in schizo_pbm_init()
1357 pbm->config_space_reg_bits = 8; in schizo_pbm_init()
1359 pbm->index = pci_num_pbms++; in schizo_pbm_init()
1361 pbm->portid = portid; in schizo_pbm_init()
1362 pbm->op = op; in schizo_pbm_init()
1364 pbm->chip_type = chip_type; in schizo_pbm_init()
1365 pbm->chip_version = of_getintprop_default(dp, "version#", 0); in schizo_pbm_init()
1366 pbm->chip_revision = of_getintprop_default(dp, "module-version#", 0); in schizo_pbm_init()
1368 pbm->pbm_regs = regs[0].phys_addr; in schizo_pbm_init()
1369 pbm->controller_regs = regs[1].phys_addr - 0x10000UL; in schizo_pbm_init()
1372 pbm->sync_reg = regs[3].phys_addr + 0x1a18UL; in schizo_pbm_init()
1374 pbm->name = dp->full_name; in schizo_pbm_init()
1377 pbm->name, chipset_name, in schizo_pbm_init()
1378 pbm->chip_version, pbm->chip_revision); in schizo_pbm_init()
1392 schizo_scan_bus(pbm, &op->dev); in schizo_pbm_init()
1400 if (x == (y ^ 1)) in portid_compare()
1401 return 1; in portid_compare()
1411 for (pbm = pci_pbm_root; pbm; pbm = pbm->next) { in schizo_find_sibling()
1412 if (portid_compare(pbm->portid, portid, chip_type)) in schizo_find_sibling()
1420 struct device_node *dp = op->dev.of_node; in __schizo_init()
1428 err = -ENOMEM; in __schizo_init()
1435 pbm->sibling = schizo_find_sibling(portid, chip_type); in __schizo_init()
1443 pbm->iommu = iommu; in __schizo_init()
1448 if (pbm->sibling) in __schizo_init()
1449 pbm->sibling->sibling = pbm; in __schizo_init()
1451 dev_set_drvdata(&op->dev, pbm); in __schizo_init()
1456 kfree(pbm->iommu); in __schizo_init()
1467 unsigned long chip_type = (unsigned long)device_get_match_data(&op->dev); in schizo_probe()
1470 return -EINVAL; in schizo_probe()