changelog shortlog tags branches changeset file revisions annotate raw help

Mercurial > hg > plan9front / sys/src/9/pc/pci.c

revision 4409: c2b9c15c753e
parent 4010: 205af6a658d5
child 4410: 1d44e3322df1
     1.1--- a/sys/src/9/pc/pci.c
     1.2+++ b/sys/src/9/pc/pci.c
     1.3@@ -249,6 +249,7 @@ pcibusmap(Pcidev *root, ulong *pmema, ul
     1.4 			if(size == 0)
     1.5 				continue;
     1.6 
     1.7+			p->mem[i].size = size;
     1.8 			if(v & 1) {
     1.9 				itb->dev = p;
    1.10 				itb->bar = i;
    1.11@@ -260,9 +261,10 @@ pcibusmap(Pcidev *root, ulong *pmema, ul
    1.12 				mtb->bar = i;
    1.13 				mtb->siz = size;
    1.14 				mtb++;
    1.15+
    1.16+				if((v & 7) == 4)
    1.17+					i++;
    1.18 			}
    1.19-
    1.20-			p->mem[i].size = size;
    1.21 		}
    1.22 	}
    1.23 
    1.24@@ -438,11 +440,24 @@ pcilscan(int bno, Pcidev** list, Pcidev 
    1.25 			case 0x0C:		/* serial bus controllers */
    1.26 				if((hdt & 0x7F) != 0)
    1.27 					break;
    1.28-				rno = PciBAR0 - 4;
    1.29+				rno = PciBAR0;
    1.30 				for(i = 0; i < nelem(p->mem); i++) {
    1.31-					rno += 4;
    1.32 					p->mem[i].bar = pcicfgr32(p, rno);
    1.33 					p->mem[i].size = pcibarsize(p, rno);
    1.34+					if((p->mem[i].bar & 7) == 4){
    1.35+						ulong hi;
    1.36+
    1.37+						rno += 4;
    1.38+						hi = pcicfgr32(p, rno);
    1.39+						if(hi != 0){
    1.40+							print("ignoring 64-bit bar %d: %llux %d from %T\n",
    1.41+								i, (uvlong)hi<<32 | p->mem[i].bar, p->mem[i].size, p->tbdf);
    1.42+							p->mem[i].bar = 0;
    1.43+							p->mem[i].size = 0;
    1.44+						}
    1.45+						i++;
    1.46+					}
    1.47+					rno += 4;
    1.48 				}
    1.49 				break;
    1.50