Lines Matching refs:pbm
135 struct pci_pbm_info *pbm = dev_id; in psycho_ue_intr() local
136 unsigned long afsr_reg = pbm->controller_regs + PSYCHO_UE_AFSR; in psycho_ue_intr()
137 unsigned long afar_reg = pbm->controller_regs + PSYCHO_UE_AFAR; in psycho_ue_intr()
155 pbm->name, in psycho_ue_intr()
163 pbm->name, in psycho_ue_intr()
168 printk("%s: UE AFAR [%016lx]\n", pbm->name, afar); in psycho_ue_intr()
169 printk("%s: UE Secondary errors [", pbm->name); in psycho_ue_intr()
188 psycho_check_iommu_error(pbm, afsr, afar, UE_ERR); in psycho_ue_intr()
189 if (pbm->sibling) in psycho_ue_intr()
190 psycho_check_iommu_error(pbm->sibling, afsr, afar, UE_ERR); in psycho_ue_intr()
214 struct pci_pbm_info *pbm = dev_id; in psycho_ce_intr() local
215 unsigned long afsr_reg = pbm->controller_regs + PSYCHO_CE_AFSR; in psycho_ce_intr()
216 unsigned long afar_reg = pbm->controller_regs + PSYCHO_CE_AFAR; in psycho_ce_intr()
234 pbm->name, in psycho_ce_intr()
247 pbm->name, in psycho_ce_intr()
253 printk("%s: CE AFAR [%016lx]\n", pbm->name, afar); in psycho_ce_intr()
254 printk("%s: CE Secondary errors [", pbm->name); in psycho_ce_intr()
288 static void psycho_register_error_handlers(struct pci_pbm_info *pbm) in psycho_register_error_handlers() argument
290 struct platform_device *op = of_find_device_by_node(pbm->op->dev.of_node); in psycho_register_error_handlers()
291 unsigned long base = pbm->controller_regs; in psycho_register_error_handlers()
315 "PSYCHO_UE", pbm); in psycho_register_error_handlers()
317 "PSYCHO_CE", pbm); in psycho_register_error_handlers()
324 "PSYCHO_PCIERR", pbm); in psycho_register_error_handlers()
327 "err=%d\n", pbm->name, err); in psycho_register_error_handlers()
353 static void pbm_config_busmastering(struct pci_pbm_info *pbm) in pbm_config_busmastering() argument
360 addr = psycho_pci_config_mkaddr(pbm, pbm->pci_first_busno, in pbm_config_busmastering()
365 addr = psycho_pci_config_mkaddr(pbm, pbm->pci_first_busno, in pbm_config_busmastering()
370 static void psycho_scan_bus(struct pci_pbm_info *pbm, in psycho_scan_bus() argument
373 pbm_config_busmastering(pbm); in psycho_scan_bus()
374 pbm->is_66mhz_capable = 0; in psycho_scan_bus()
375 pbm->pci_bus = pci_scan_one_pbm(pbm, parent); in psycho_scan_bus()
380 psycho_register_error_handlers(pbm); in psycho_scan_bus()
395 static void psycho_controller_hwinit(struct pci_pbm_info *pbm) in psycho_controller_hwinit() argument
399 upa_writeq(5, pbm->controller_regs + PSYCHO_IRQ_RETRY); in psycho_controller_hwinit()
402 tmp = upa_readq(pbm->controller_regs + PSYCHO_PCIA_CTRL); in psycho_controller_hwinit()
404 upa_writeq(tmp, pbm->controller_regs + PSYCHO_PCIA_CTRL); in psycho_controller_hwinit()
406 tmp = upa_readq(pbm->controller_regs + PSYCHO_PCIB_CTRL); in psycho_controller_hwinit()
408 upa_writeq(tmp, pbm->controller_regs + PSYCHO_PCIB_CTRL); in psycho_controller_hwinit()
414 tmp = upa_readq(pbm->controller_regs + PSYCHO_PCIA_DIAG); in psycho_controller_hwinit()
416 upa_writeq(tmp, pbm->controller_regs + PSYCHO_PCIA_DIAG); in psycho_controller_hwinit()
418 tmp = upa_readq(pbm->controller_regs + PSYCHO_PCIB_DIAG); in psycho_controller_hwinit()
420 upa_writeq(tmp, pbm->controller_regs + PSYCHO_PCIB_DIAG); in psycho_controller_hwinit()
423 static void psycho_pbm_strbuf_init(struct pci_pbm_info *pbm, in psycho_pbm_strbuf_init() argument
426 unsigned long base = pbm->controller_regs; in psycho_pbm_strbuf_init()
430 pbm->stc.strbuf_control = base + PSYCHO_STRBUF_CONTROL_A; in psycho_pbm_strbuf_init()
431 pbm->stc.strbuf_pflush = base + PSYCHO_STRBUF_FLUSH_A; in psycho_pbm_strbuf_init()
432 pbm->stc.strbuf_fsync = base + PSYCHO_STRBUF_FSYNC_A; in psycho_pbm_strbuf_init()
433 pbm->stc.strbuf_err_stat = base + PSYCHO_STC_ERR_A; in psycho_pbm_strbuf_init()
434 pbm->stc.strbuf_tag_diag = base + PSYCHO_STC_TAG_A; in psycho_pbm_strbuf_init()
435 pbm->stc.strbuf_line_diag= base + PSYCHO_STC_LINE_A; in psycho_pbm_strbuf_init()
437 pbm->stc.strbuf_control = base + PSYCHO_STRBUF_CONTROL_B; in psycho_pbm_strbuf_init()
438 pbm->stc.strbuf_pflush = base + PSYCHO_STRBUF_FLUSH_B; in psycho_pbm_strbuf_init()
439 pbm->stc.strbuf_fsync = base + PSYCHO_STRBUF_FSYNC_B; in psycho_pbm_strbuf_init()
440 pbm->stc.strbuf_err_stat = base + PSYCHO_STC_ERR_B; in psycho_pbm_strbuf_init()
441 pbm->stc.strbuf_tag_diag = base + PSYCHO_STC_TAG_B; in psycho_pbm_strbuf_init()
442 pbm->stc.strbuf_line_diag= base + PSYCHO_STC_LINE_B; in psycho_pbm_strbuf_init()
445 pbm->stc.strbuf_ctxflush = 0; in psycho_pbm_strbuf_init()
446 pbm->stc.strbuf_ctxmatch_base = 0; in psycho_pbm_strbuf_init()
448 pbm->stc.strbuf_flushflag = (volatile unsigned long *) in psycho_pbm_strbuf_init()
449 ((((unsigned long)&pbm->stc.__flushflag_buf[0]) in psycho_pbm_strbuf_init()
452 pbm->stc.strbuf_flushflag_pa = (unsigned long) in psycho_pbm_strbuf_init()
453 __pa(pbm->stc.strbuf_flushflag); in psycho_pbm_strbuf_init()
465 control = upa_readq(pbm->stc.strbuf_control); in psycho_pbm_strbuf_init()
475 upa_writeq(control, pbm->stc.strbuf_control); in psycho_pbm_strbuf_init()
477 pbm->stc.strbuf_enabled = 1; in psycho_pbm_strbuf_init()
487 static void psycho_pbm_init(struct pci_pbm_info *pbm, in psycho_pbm_init() argument
490 psycho_pbm_init_common(pbm, op, "PSYCHO", PBM_CHIP_TYPE_PSYCHO); in psycho_pbm_init()
491 psycho_pbm_strbuf_init(pbm, is_pbm_a); in psycho_pbm_init()
492 psycho_scan_bus(pbm, &op->dev); in psycho_pbm_init()
497 struct pci_pbm_info *pbm; in psycho_find_sibling() local
499 for (pbm = pci_pbm_root; pbm; pbm = pbm->next) { in psycho_find_sibling()
500 if (pbm->portid == upa_portid) in psycho_find_sibling()
501 return pbm; in psycho_find_sibling()
512 struct pci_pbm_info *pbm; in psycho_probe() local
520 pbm = kzalloc(sizeof(*pbm), GFP_KERNEL); in psycho_probe()
521 if (!pbm) { in psycho_probe()
526 pbm->sibling = psycho_find_sibling(upa_portid); in psycho_probe()
527 if (pbm->sibling) { in psycho_probe()
528 iommu = pbm->sibling->iommu; in psycho_probe()
537 pbm->iommu = iommu; in psycho_probe()
538 pbm->portid = upa_portid; in psycho_probe()
549 pbm->controller_regs = pr_regs[2].phys_addr; in psycho_probe()
550 pbm->config_space = (pr_regs[2].phys_addr + PSYCHO_CONFIGSPACE); in psycho_probe()
553 pbm->pci_afsr = pbm->controller_regs + PSYCHO_PCI_AFSR_A; in psycho_probe()
554 pbm->pci_afar = pbm->controller_regs + PSYCHO_PCI_AFAR_A; in psycho_probe()
555 pbm->pci_csr = pbm->controller_regs + PSYCHO_PCIA_CTRL; in psycho_probe()
557 pbm->pci_afsr = pbm->controller_regs + PSYCHO_PCI_AFSR_B; in psycho_probe()
558 pbm->pci_afar = pbm->controller_regs + PSYCHO_PCI_AFAR_B; in psycho_probe()
559 pbm->pci_csr = pbm->controller_regs + PSYCHO_PCIB_CTRL; in psycho_probe()
562 psycho_controller_hwinit(pbm); in psycho_probe()
563 if (!pbm->sibling) { in psycho_probe()
564 err = psycho_iommu_init(pbm, 128, 0xc0000000, in psycho_probe()
571 starfire_hookup(pbm->portid); in psycho_probe()
574 psycho_pbm_init(pbm, op, is_pbm_a); in psycho_probe()
576 pbm->next = pci_pbm_root; in psycho_probe()
577 pci_pbm_root = pbm; in psycho_probe()
579 if (pbm->sibling) in psycho_probe()
580 pbm->sibling->sibling = pbm; in psycho_probe()
582 dev_set_drvdata(&op->dev, pbm); in psycho_probe()
587 if (!pbm->sibling) in psycho_probe()
588 kfree(pbm->iommu); in psycho_probe()
591 kfree(pbm); in psycho_probe()