6 #include <linux/kernel.h>
7 #include <linux/types.h>
10 #include <linux/slab.h>
11 #include <linux/export.h>
15 #include <asm/iommu.h>
24 #define DRIVER_NAME "schizo"
25 #define PFX DRIVER_NAME ": "
38 #define SCHIZO_STRBUF_CTRL_LPTR 0x00000000000000f0UL
39 #define SCHIZO_STRBUF_CTRL_LENAB 0x0000000000000008UL
40 #define SCHIZO_STRBUF_CTRL_RRDIS 0x0000000000000004UL
41 #define SCHIZO_STRBUF_CTRL_DENAB 0x0000000000000002UL
42 #define SCHIZO_STRBUF_CTRL_ENAB 0x0000000000000001UL
45 #define SCHIZO_IOMMU_CTRL_RESV 0xfffffffff9000000UL
46 #define SCHIZO_IOMMU_CTRL_XLTESTAT 0x0000000006000000UL
47 #define SCHIZO_IOMMU_CTRL_XLTEERR 0x0000000001000000UL
48 #define SCHIZO_IOMMU_CTRL_LCKEN 0x0000000000800000UL
49 #define SCHIZO_IOMMU_CTRL_LCKPTR 0x0000000000780000UL
50 #define SCHIZO_IOMMU_CTRL_TSBSZ 0x0000000000070000UL
51 #define SCHIZO_IOMMU_TSBSZ_1K 0x0000000000000000UL
52 #define SCHIZO_IOMMU_TSBSZ_2K 0x0000000000010000UL
53 #define SCHIZO_IOMMU_TSBSZ_4K 0x0000000000020000UL
54 #define SCHIZO_IOMMU_TSBSZ_8K 0x0000000000030000UL
55 #define SCHIZO_IOMMU_TSBSZ_16K 0x0000000000040000UL
56 #define SCHIZO_IOMMU_TSBSZ_32K 0x0000000000050000UL
57 #define SCHIZO_IOMMU_TSBSZ_64K 0x0000000000060000UL
58 #define SCHIZO_IOMMU_TSBSZ_128K 0x0000000000070000UL
59 #define SCHIZO_IOMMU_CTRL_RESV2 0x000000000000fff8UL
60 #define SCHIZO_IOMMU_CTRL_TBWSZ 0x0000000000000004UL
61 #define SCHIZO_IOMMU_CTRL_DENAB 0x0000000000000002UL
62 #define SCHIZO_IOMMU_CTRL_ENAB 0x0000000000000001UL
72 #define SCHIZO_CONFIG_BASE(PBM) ((PBM)->config_space)
73 #define SCHIZO_CONFIG_ENCODE(BUS, DEVFN, REG) \
74 (((unsigned long)(BUS) << 16) | \
75 ((unsigned long)(DEVFN) << 8) | \
76 ((unsigned long)(REG)))
78 static void *schizo_pci_config_mkaddr(
struct pci_pbm_info *pbm,
97 static unsigned long stc_error_buf[128];
98 static unsigned long stc_tag_buf[16];
99 static unsigned long stc_line_buf[16];
101 #define SCHIZO_UE_INO 0x30
102 #define SCHIZO_CE_INO 0x31
103 #define SCHIZO_PCIERR_A_INO 0x32
104 #define SCHIZO_PCIERR_B_INO 0x33
105 #define SCHIZO_SERR_INO 0x34
107 #define SCHIZO_STC_ERR 0xb800UL
108 #define SCHIZO_STC_TAG 0xba00UL
109 #define SCHIZO_STC_LINE 0xbb00UL
111 #define SCHIZO_STCERR_WRITE 0x2UL
112 #define SCHIZO_STCERR_READ 0x1UL
114 #define SCHIZO_STCTAG_PPN 0x3fffffff00000000UL
115 #define SCHIZO_STCTAG_VPN 0x00000000ffffe000UL
116 #define SCHIZO_STCTAG_VALID 0x8000000000000000UL
117 #define SCHIZO_STCTAG_READ 0x4000000000000000UL
119 #define SCHIZO_STCLINE_LINDX 0x0000000007800000UL
120 #define SCHIZO_STCLINE_SPTR 0x000000000007e000UL
121 #define SCHIZO_STCLINE_LADDR 0x0000000000001fc0UL
122 #define SCHIZO_STCLINE_EPTR 0x000000000000003fUL
123 #define SCHIZO_STCLINE_VALID 0x0000000000600000UL
124 #define SCHIZO_STCLINE_FOFN 0x0000000000180000UL
126 static void __schizo_check_stc_error_pbm(
struct pci_pbm_info *pbm,
130 unsigned long regbase = pbm->
pbm_regs;
131 unsigned long err_base, tag_base, line_base;
139 spin_lock(&stc_buf_lock);
153 for (i = 0; i < 128; i++) {
156 val = upa_readq(err_base + (i * 8
UL));
157 upa_writeq(0UL, err_base + (i * 8UL));
158 stc_error_buf[
i] =
val;
160 for (i = 0; i < 16; i++) {
161 stc_tag_buf[
i] = upa_readq(tag_base + (i * 8
UL));
162 stc_line_buf[
i] = upa_readq(line_base + (i * 8UL));
163 upa_writeq(0UL, tag_base + (i * 8UL));
164 upa_writeq(0UL, line_base + (i * 8UL));
170 for (i = 0; i < 16; i++) {
176 for (j = first; j < last; j++) {
177 unsigned long errval = stc_error_buf[
j];
180 printk(
"%s: STC_ERR(%d)[wr(%d)rd(%d)]\n",
187 if (saw_error != 0) {
188 unsigned long tagval = stc_tag_buf[
i];
189 unsigned long lineval = stc_line_buf[
i];
190 printk(
"%s: STC_TAG(%d)[PA(%016lx)VA(%08lx)V(%d)R(%d)]\n",
199 printk(
"%s: STC_LINE(%d)[LIDX(%lx)SP(%lx)LADDR(%lx)EP(%lx)"
212 spin_unlock(&stc_buf_lock);
219 #define SCHIZO_IOMMU_TAG 0xa580UL
220 #define SCHIZO_IOMMU_DATA 0xa600UL
222 #define SCHIZO_IOMMU_TAG_CTXT 0x0000001ffe000000UL
223 #define SCHIZO_IOMMU_TAG_ERRSTS 0x0000000001800000UL
224 #define SCHIZO_IOMMU_TAG_ERR 0x0000000000400000UL
225 #define SCHIZO_IOMMU_TAG_WRITE 0x0000000000200000UL
226 #define SCHIZO_IOMMU_TAG_STREAM 0x0000000000100000UL
227 #define SCHIZO_IOMMU_TAG_SIZE 0x0000000000080000UL
228 #define SCHIZO_IOMMU_TAG_VPAGE 0x000000000007ffffUL
230 #define SCHIZO_IOMMU_DATA_VALID 0x0000000100000000UL
231 #define SCHIZO_IOMMU_DATA_CACHE 0x0000000040000000UL
232 #define SCHIZO_IOMMU_DATA_PPAGE 0x000000003fffffffUL
234 static void schizo_check_iommu_error_pbm(
struct pci_pbm_info *pbm,
238 unsigned long iommu_tag[16];
239 unsigned long iommu_data[16];
251 control &= ~SCHIZO_IOMMU_CTRL_XLTEERR;
256 type_string =
"Protection Error";
259 type_string =
"Invalid Error";
262 type_string =
"TimeOut Error";
266 type_string =
"ECC Error";
269 printk(
"%s: IOMMU Error, type[%s]\n",
270 pbm->
name, type_string);
287 for (i = 0; i < 16; i++) {
301 for (i = 0; i < 16; i++) {
308 data = iommu_data[
i];
311 type_string =
"Protection Error";
314 type_string =
"Invalid Error";
317 type_string =
"TimeOut Error";
321 type_string =
"ECC Error";
324 printk(
"%s: IOMMU TAG(%d)[error(%s) ctx(%x) wr(%d) str(%d) "
325 "sz(%dK) vpg(%08lx)]\n",
326 pbm->
name, i, type_string,
332 printk(
"%s: IOMMU DATA(%d)[valid(%d) cache(%d) ppg(%016lx)]\n",
339 if (pbm->
stc.strbuf_enabled)
340 __schizo_check_stc_error_pbm(pbm, type);
341 spin_unlock_irqrestore(&iommu->
lock, flags);
344 static void schizo_check_iommu_error(
struct pci_pbm_info *pbm,
347 schizo_check_iommu_error_pbm(pbm, type);
349 schizo_check_iommu_error_pbm(pbm->
sibling, type);
353 #define SCHIZO_UE_AFSR 0x10030UL
354 #define SCHIZO_UE_AFAR 0x10038UL
356 #define SCHIZO_UEAFSR_PPIO 0x8000000000000000UL
357 #define SCHIZO_UEAFSR_PDRD 0x4000000000000000UL
358 #define SCHIZO_UEAFSR_PDWR 0x2000000000000000UL
359 #define SCHIZO_UEAFSR_SPIO 0x1000000000000000UL
360 #define SCHIZO_UEAFSR_SDMA 0x0800000000000000UL
361 #define SCHIZO_UEAFSR_ERRPNDG 0x0300000000000000UL
362 #define SCHIZO_UEAFSR_BMSK 0x000003ff00000000UL
363 #define SCHIZO_UEAFSR_QOFF 0x00000000c0000000UL
364 #define SCHIZO_UEAFSR_AID 0x000000001f000000UL
365 #define SCHIZO_UEAFSR_PARTIAL 0x0000000000800000UL
366 #define SCHIZO_UEAFSR_OWNEDIN 0x0000000000400000UL
367 #define SCHIZO_UEAFSR_MTAGSYND 0x00000000000f0000UL
368 #define SCHIZO_UEAFSR_MTAG 0x000000000000e000UL
369 #define SCHIZO_UEAFSR_ECCSYND 0x00000000000001ffUL
380 afar = upa_readq(afar_reg);
388 afsr = upa_readq(afsr_reg);
397 upa_writeq(error_bits, afsr_reg);
400 printk(
"%s: Uncorrectable Error, primary error type[%s]\n",
407 "DMA Write" :
"???")))));
408 printk(
"%s: bytemask[%04lx] qword_offset[%lx] SAFARI_AID[%02lx]\n",
413 printk(
"%s: partial[%d] owned_in[%d] mtag[%lx] mtag_synd[%lx] ecc_sync[%lx]\n",
420 printk(
"%s: UE AFAR [%016lx]\n", pbm->
name, afar);
421 printk(
"%s: UE Secondary errors [", pbm->
name);
436 schizo_check_iommu_error(pbm,
UE_ERR);
441 #define SCHIZO_CE_AFSR 0x10040UL
442 #define SCHIZO_CE_AFAR 0x10048UL
444 #define SCHIZO_CEAFSR_PPIO 0x8000000000000000UL
445 #define SCHIZO_CEAFSR_PDRD 0x4000000000000000UL
446 #define SCHIZO_CEAFSR_PDWR 0x2000000000000000UL
447 #define SCHIZO_CEAFSR_SPIO 0x1000000000000000UL
448 #define SCHIZO_CEAFSR_SDMA 0x0800000000000000UL
449 #define SCHIZO_CEAFSR_ERRPNDG 0x0300000000000000UL
450 #define SCHIZO_CEAFSR_BMSK 0x000003ff00000000UL
451 #define SCHIZO_CEAFSR_QOFF 0x00000000c0000000UL
452 #define SCHIZO_CEAFSR_AID 0x000000001f000000UL
453 #define SCHIZO_CEAFSR_PARTIAL 0x0000000000800000UL
454 #define SCHIZO_CEAFSR_OWNEDIN 0x0000000000400000UL
455 #define SCHIZO_CEAFSR_MTAGSYND 0x00000000000f0000UL
456 #define SCHIZO_CEAFSR_MTAG 0x000000000000e000UL
457 #define SCHIZO_CEAFSR_ECCSYND 0x00000000000001ffUL
468 afar = upa_readq(afar_reg);
476 afsr = upa_readq(afsr_reg);
485 upa_writeq(error_bits, afsr_reg);
488 printk(
"%s: Correctable Error, primary error type[%s]\n",
495 "DMA Write" :
"???")))));
500 printk(
"%s: bytemask[%04lx] qword_offset[%lx] SAFARI_AID[%02lx]\n",
505 printk(
"%s: partial[%d] owned_in[%d] mtag[%lx] mtag_synd[%lx] ecc_sync[%lx]\n",
512 printk(
"%s: CE AFAR [%016lx]\n", pbm->
name, afar);
513 printk(
"%s: CE Secondary errors [", pbm->
name);
530 #define SCHIZO_PCI_AFSR 0x2010UL
531 #define SCHIZO_PCI_AFAR 0x2018UL
533 #define SCHIZO_PCIAFSR_PMA 0x8000000000000000UL
534 #define SCHIZO_PCIAFSR_PTA 0x4000000000000000UL
535 #define SCHIZO_PCIAFSR_PRTRY 0x2000000000000000UL
536 #define SCHIZO_PCIAFSR_PPERR 0x1000000000000000UL
537 #define SCHIZO_PCIAFSR_PTTO 0x0800000000000000UL
538 #define SCHIZO_PCIAFSR_PUNUS 0x0400000000000000UL
539 #define SCHIZO_PCIAFSR_SMA 0x0200000000000000UL
540 #define SCHIZO_PCIAFSR_STA 0x0100000000000000UL
541 #define SCHIZO_PCIAFSR_SRTRY 0x0080000000000000UL
542 #define SCHIZO_PCIAFSR_SPERR 0x0040000000000000UL
543 #define SCHIZO_PCIAFSR_STTO 0x0020000000000000UL
544 #define SCHIZO_PCIAFSR_SUNUS 0x0010000000000000UL
545 #define SCHIZO_PCIAFSR_BMSK 0x000003ff00000000UL
546 #define SCHIZO_PCIAFSR_BLK 0x0000000080000000UL
547 #define SCHIZO_PCIAFSR_CFG 0x0000000040000000UL
548 #define SCHIZO_PCIAFSR_MEM 0x0000000020000000UL
549 #define SCHIZO_PCIAFSR_IO 0x0000000010000000UL
551 #define SCHIZO_PCI_CTRL (0x2000UL)
552 #define SCHIZO_PCICTRL_BUS_UNUS (1UL << 63UL)
553 #define SCHIZO_PCICTRL_DTO_INT (1UL << 61UL)
554 #define SCHIZO_PCICTRL_ARB_PRIO (0x1ff << 52UL)
555 #define SCHIZO_PCICTRL_ESLCK (1UL << 51UL)
556 #define SCHIZO_PCICTRL_ERRSLOT (7UL << 48UL)
557 #define SCHIZO_PCICTRL_TTO_ERR (1UL << 38UL)
558 #define SCHIZO_PCICTRL_RTRY_ERR (1UL << 37UL)
559 #define SCHIZO_PCICTRL_DTO_ERR (1UL << 36UL)
560 #define SCHIZO_PCICTRL_SBH_ERR (1UL << 35UL)
561 #define SCHIZO_PCICTRL_SERR (1UL << 34UL)
562 #define SCHIZO_PCICTRL_PCISPD (1UL << 33UL)
563 #define SCHIZO_PCICTRL_MRM_PREF (1UL << 30UL)
564 #define SCHIZO_PCICTRL_RDO_PREF (1UL << 29UL)
565 #define SCHIZO_PCICTRL_RDL_PREF (1UL << 28UL)
566 #define SCHIZO_PCICTRL_PTO (3UL << 24UL)
567 #define SCHIZO_PCICTRL_PTO_SHIFT 24UL
568 #define SCHIZO_PCICTRL_TRWSW (7UL << 21UL)
569 #define SCHIZO_PCICTRL_F_TGT_A (1UL << 20UL)
570 #define SCHIZO_PCICTRL_S_DTO_INT (1UL << 19UL)
571 #define SCHIZO_PCICTRL_F_TGT_RT (1UL << 19UL)
572 #define SCHIZO_PCICTRL_SBH_INT (1UL << 18UL)
573 #define SCHIZO_PCICTRL_T_DTO_INT (1UL << 18UL)
574 #define SCHIZO_PCICTRL_EEN (1UL << 17UL)
575 #define SCHIZO_PCICTRL_PARK (1UL << 16UL)
576 #define SCHIZO_PCICTRL_PCIRST (1UL << 8UL)
577 #define SCHIZO_PCICTRL_ARB_S (0x3fUL << 0UL)
578 #define SCHIZO_PCICTRL_ARB_T (0xffUL << 0UL)
582 unsigned long csr_reg,
csr, csr_error_bits;
587 csr = upa_readq(csr_reg);
595 if (csr_error_bits) {
597 upa_writeq(csr, csr_reg);
601 printk(
"%s: Bus unusable error asserted.\n",
604 printk(
"%s: PCI TRDY# timeout error asserted.\n",
607 printk(
"%s: PCI excessive retry error asserted.\n",
610 printk(
"%s: PCI discard timeout error asserted.\n",
613 printk(
"%s: PCI streaming byte hole error asserted.\n",
616 printk(
"%s: PCI SERR signal asserted.\n",
626 printk(
"%s: PCI bus error, PCI_STATUS[%04x]\n",
637 unsigned long afsr_reg, afar_reg,
base;
647 afar = upa_readq(afar_reg);
648 afsr = upa_readq(afsr_reg);
659 return schizo_pcierr_intr_other(pbm);
660 upa_writeq(error_bits, afsr_reg);
663 printk(
"%s: PCI Error, primary error type[%s]\n",
670 "Excessive Retries" :
676 "Bus Unusable" :
"???"))))))));
677 printk(
"%s: bytemask[%04lx] was_block(%d) space(%s)\n",
687 printk(
"%s: PCI AFAR [%016lx]\n",
689 printk(
"%s: PCI Secondary errors [",
702 printk(
"(Excessive Retries)");
730 schizo_check_iommu_error(pbm,
PCI_ERR);
749 #define SCHIZO_SAFARI_ERRLOG 0x10018UL
751 #define SAFARI_ERRLOG_ERROUT 0x8000000000000000UL
753 #define BUS_ERROR_BADCMD 0x4000000000000000UL
754 #define BUS_ERROR_SSMDIS 0x2000000000000000UL
755 #define BUS_ERROR_BADMA 0x1000000000000000UL
756 #define BUS_ERROR_BADMB 0x0800000000000000UL
757 #define BUS_ERROR_BADMC 0x0400000000000000UL
758 #define BUS_ERROR_SNOOP_GR 0x0000000000200000UL
759 #define BUS_ERROR_SNOOP_PCI 0x0000000000100000UL
760 #define BUS_ERROR_SNOOP_RD 0x0000000000080000UL
761 #define BUS_ERROR_SNOOP_RDS 0x0000000000020000UL
762 #define BUS_ERROR_SNOOP_RDSA 0x0000000000010000UL
763 #define BUS_ERROR_SNOOP_OWN 0x0000000000008000UL
764 #define BUS_ERROR_SNOOP_RDO 0x0000000000004000UL
765 #define BUS_ERROR_CPU1PS 0x0000000000002000UL
766 #define BUS_ERROR_WDATA_PERR 0x0000000000002000UL
767 #define BUS_ERROR_CPU1PB 0x0000000000001000UL
768 #define BUS_ERROR_CTRL_PERR 0x0000000000001000UL
769 #define BUS_ERROR_CPU0PS 0x0000000000000800UL
770 #define BUS_ERROR_SNOOP_ERR 0x0000000000000800UL
771 #define BUS_ERROR_CPU0PB 0x0000000000000400UL
772 #define BUS_ERROR_JBUS_ILL_B 0x0000000000000400UL
773 #define BUS_ERROR_CIQTO 0x0000000000000200UL
774 #define BUS_ERROR_LPQTO 0x0000000000000100UL
775 #define BUS_ERROR_JBUS_ILL_C 0x0000000000000100UL
776 #define BUS_ERROR_SFPQTO 0x0000000000000080UL
777 #define BUS_ERROR_UFPQTO 0x0000000000000040UL
778 #define BUS_ERROR_RD_PERR 0x0000000000000040UL
779 #define BUS_ERROR_APERR 0x0000000000000020UL
780 #define BUS_ERROR_UNMAP 0x0000000000000010UL
781 #define BUS_ERROR_BUSERR 0x0000000000000004UL
782 #define BUS_ERROR_TIMEOUT 0x0000000000000002UL
783 #define BUS_ERROR_ILL 0x0000000000000001UL
788 static irqreturn_t schizo_safarierr_intr(
int irq,
void *dev_id)
798 printk(
"%s: Unexpected Safari/JBUS error interrupt, errlog[%016llx]\n",
804 printk(
"%s: Safari/JBUS interrupt, UNMAPPED error, interrogating IOMMUs.\n",
812 #define SCHIZO_ECC_CTRL 0x10020UL
813 #define SCHIZO_ECCCTRL_EE 0x8000000000000000UL
814 #define SCHIZO_ECCCTRL_UE 0x4000000000000000UL
815 #define SCHIZO_ECCCTRL_CE 0x2000000000000000UL
817 #define SCHIZO_SAFARI_ERRCTRL 0x10008UL
818 #define SCHIZO_SAFERRCTRL_EN 0x8000000000000000UL
819 #define SCHIZO_SAFARI_IRQCTRL 0x10010UL
820 #define SCHIZO_SAFIRQCTRL_EN 0x8000000000000000UL
846 static void tomatillo_register_error_handlers(
struct pci_pbm_info *pbm)
849 u64 tmp, err_mask, err_no_mask;
862 "TOMATILLO_UE", pbm);
865 "err=%d\n", pbm->
name, err);
869 "TOMATILLO_CE", pbm);
872 "err=%d\n", pbm->
name, err);
877 "TOMATILLO_PCIERR", pbm);
880 "TOMATILLO_PCIERR", pbm);
884 "err=%d\n", pbm->
name, err);
888 "TOMATILLO_SERR", pbm);
891 "err=%d\n", pbm->
name, err);
918 SCHIZO_PCIAFSR_SMA | SCHIZO_PCIAFSR_STA |
919 SCHIZO_PCIAFSR_SRTRY | SCHIZO_PCIAFSR_SPERR |
922 upa_writeq(err_mask, pbm->
pbm_regs + SCHIZO_PCI_AFSR);
941 static void schizo_register_error_handlers(
struct pci_pbm_info *pbm)
944 u64 tmp, err_mask, err_no_mask;
960 "err=%d\n", pbm->
name, err);
967 "err=%d\n", pbm->
name, err);
972 "SCHIZO_PCIERR", pbm);
975 "SCHIZO_PCIERR", pbm);
979 "err=%d\n", pbm->
name, err);
986 "err=%d\n", pbm->
name, err);
1010 tmp &= ~err_no_mask;
1016 SCHIZO_PCIAFSR_SMA | SCHIZO_PCIAFSR_STA |
1017 SCHIZO_PCIAFSR_SRTRY | SCHIZO_PCIAFSR_SPERR |
1018 SCHIZO_PCIAFSR_STTO | SCHIZO_PCIAFSR_SUNUS),
1050 static void pbm_config_busmastering(
struct pci_pbm_info *pbm)
1070 pbm_config_busmastering(pbm);
1078 tomatillo_register_error_handlers(pbm);
1080 schizo_register_error_handlers(pbm);
1083 #define SCHIZO_STRBUF_CONTROL (0x02800UL)
1084 #define SCHIZO_STRBUF_FLUSH (0x02808UL)
1085 #define SCHIZO_STRBUF_FSYNC (0x02810UL)
1086 #define SCHIZO_STRBUF_CTXFLUSH (0x02818UL)
1087 #define SCHIZO_STRBUF_CTXMATCH (0x10000UL)
1089 static void schizo_pbm_strbuf_init(
struct pci_pbm_info *pbm)
1091 unsigned long base = pbm->
pbm_regs;
1106 pbm->
stc.strbuf_flushflag = (
volatile unsigned long *)
1107 ((((
unsigned long)&pbm->
stc.__flushflag_buf[0])
1110 pbm->
stc.strbuf_flushflag_pa = (
unsigned long)
1111 __pa(pbm->
stc.strbuf_flushflag);
1117 control = upa_readq(pbm->
stc.strbuf_control);
1122 upa_writeq(control, pbm->
stc.strbuf_control);
1124 pbm->
stc.strbuf_enabled = 1;
1127 #define SCHIZO_IOMMU_CONTROL (0x00200UL)
1128 #define SCHIZO_IOMMU_TSBBASE (0x00208UL)
1129 #define SCHIZO_IOMMU_FLUSH (0x00210UL)
1130 #define SCHIZO_IOMMU_CTXFLUSH (0x00218UL)
1132 static int schizo_pbm_iommu_init(
struct pci_pbm_info *pbm)
1134 static const u32 vdma_default[] = { 0xc0000000, 0x40000000 };
1135 unsigned long i, tagbase, database;
1144 vdma = vdma_default;
1149 dma_mask |= 0x1fffffff;
1154 dma_mask |= 0x3fffffff;
1159 dma_mask |= 0x7fffffff;
1189 for (i = 0; i < 16; i++) {
1190 upa_writeq(0, pbm->
pbm_regs + tagbase + (i * 8
UL));
1191 upa_writeq(0, pbm->
pbm_regs + database + (i * 8UL));
1223 #define SCHIZO_PCI_IRQ_RETRY (0x1a00UL)
1224 #define SCHIZO_IRQ_RETRY_INF 0xffUL
1226 #define SCHIZO_PCI_DIAG (0x2020UL)
1227 #define SCHIZO_PCIDIAG_D_BADECC (1UL << 10UL)
1228 #define SCHIZO_PCIDIAG_D_BYPASS (1UL << 9UL)
1229 #define SCHIZO_PCIDIAG_D_TTO (1UL << 8UL)
1230 #define SCHIZO_PCIDIAG_D_RTRYARB (1UL << 7UL)
1231 #define SCHIZO_PCIDIAG_D_RETRY (1UL << 6UL)
1232 #define SCHIZO_PCIDIAG_D_INTSYNC (1UL << 5UL)
1233 #define SCHIZO_PCIDIAG_I_DMA_PARITY (1UL << 3UL)
1234 #define SCHIZO_PCIDIAG_I_PIOD_PARITY (1UL << 2UL)
1235 #define SCHIZO_PCIDIAG_I_PIOA_PARITY (1UL << 1UL)
1237 #define TOMATILLO_PCI_IOC_CSR (0x2248UL)
1238 #define TOMATILLO_IOC_PART_WPENAB 0x0000000000080000UL
1239 #define TOMATILLO_IOC_RDMULT_PENAB 0x0000000000040000UL
1240 #define TOMATILLO_IOC_RDONE_PENAB 0x0000000000020000UL
1241 #define TOMATILLO_IOC_RDLINE_PENAB 0x0000000000010000UL
1242 #define TOMATILLO_IOC_RDMULT_PLEN 0x000000000000c000UL
1243 #define TOMATILLO_IOC_RDMULT_PLEN_SHIFT 14UL
1244 #define TOMATILLO_IOC_RDONE_PLEN 0x0000000000003000UL
1245 #define TOMATILLO_IOC_RDONE_PLEN_SHIFT 12UL
1246 #define TOMATILLO_IOC_RDLINE_PLEN 0x0000000000000c00UL
1247 #define TOMATILLO_IOC_RDLINE_PLEN_SHIFT 10UL
1248 #define TOMATILLO_IOC_PREF_OFF 0x00000000000003f8UL
1249 #define TOMATILLO_IOC_PREF_OFF_SHIFT 3UL
1250 #define TOMATILLO_IOC_RDMULT_CPENAB 0x0000000000000004UL
1251 #define TOMATILLO_IOC_RDONE_CPENAB 0x0000000000000002UL
1252 #define TOMATILLO_IOC_RDLINE_CPENAB 0x0000000000000001UL
1254 #define TOMATILLO_PCI_IOC_TDIAG (0x2250UL)
1255 #define TOMATILLO_PCI_IOC_DDIAG (0x2290UL)
1257 static void schizo_pbm_hw_init(
struct pci_pbm_info *pbm)
1316 const char *chipset_name;
1319 switch (chip_type) {
1321 chipset_name =
"TOMATILLO";
1325 chipset_name =
"SCHIZO+";
1330 chipset_name =
"SCHIZO";
1372 printk(
"%s: %s PCI Bus Module ver[%x:%x]\n",
1373 pbm->
name, chipset_name,
1376 schizo_pbm_hw_init(pbm);
1382 err = schizo_pbm_iommu_init(pbm);
1386 schizo_pbm_strbuf_init(pbm);
1388 schizo_scan_bus(pbm, &op->
dev);
1393 static inline int portid_compare(
u32 x,
u32 y,
int chip_type)
1409 if (portid_compare(pbm->
portid, portid, chip_type))
1432 pbm->
sibling = schizo_find_sibling(portid, chip_type);
1434 iommu = kzalloc(
sizeof(
struct iommu),
GFP_KERNEL);
1442 if (schizo_pbm_init(pbm, op, portid, chip_type))
1443 goto out_free_iommu;
1470 return __schizo_init(op, (
unsigned long)match->
data);
1481 .compatible =
"pci108e,a801",
1486 .compatible =
"pci108e,8002",
1491 .compatible =
"pci108e,8001",
1501 .of_match_table = schizo_match,
1503 .probe = schizo_probe,
1506 static int __init schizo_init(
void)