2 #include "../port/lib.h"
6 #include "../port/error.h"
10 * GISB arbiter registers
12 static u32int *regs = (u32int*)(VIRTIO2 + 0x400000);
15 ArbMasterMask = 0x004/4,
17 TimerFreq = 216000000, // 216MHz
19 ArbErrCapClear = 0x7e4/4,
20 ArbErrCapAddrHi = 0x7e8/4,
21 ArbErrCapAddr = 0x7ec/4,
22 ArbErrCapData = 0x7f0/4,
23 ArbErrCapStatus = 0x7f4/4,
24 CapStatusTimeout = 1<<12,
25 CapStatusAbort = 1<<11,
26 CapStatusStrobe = 15<<2,
27 CapStatusWrite = 1<<1,
28 CapStatusValid = 1<<0,
29 ArbErrCapMaster = 0x7f8/4,
31 ArbIntrSts = 0x3000/4,
32 ArbIntrSet = 0x3004/4,
33 ArbIntrClr = 0x3008/4,
35 ArbCpuMaskSet = 0x3010/4,
45 status = regs[ArbErrCapStatus];
46 if((status & CapStatusValid) == 0)
48 intr = regs[ArbIntrSts];
49 master = regs[ArbErrCapMaster];
50 addr = regs[ArbErrCapAddr];
51 addr |= (uvlong)regs[ArbErrCapAddrHi]<<32;
52 data = regs[ArbErrCapData];
54 regs[ArbIntrClr] = intr;
55 regs[ArbErrCapClear] = CapStatusValid;
57 iprint("cpu%d: GISB arbiter error: %s%s %s bus addr %llux data %.8ux, "
58 "master %.8ux, status %.8ux, intr %.8ux\n",
60 (status & CapStatusTimeout) ? "timeout" : "",
61 (status & CapStatusAbort) ? "abort" : "",
62 (status & CapStatusWrite) ? "writing" : "reading",
64 master, status, intr);
78 extern int (*buserror)(Ureg*); // trap.c
80 regs[ArbErrCapClear] = CapStatusValid;
81 regs[ArbIntrClr] = -1;
83 addclock0link(arbclock, 100);