From 8fb8593dd7914e1d45c3f99eca210c6c081d5b3d Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Thu, 17 May 2001 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 2001-05-17 --- pc/devi82365.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/pc/devi82365.c b/pc/devi82365.c index 2d08091849fac8c57df880c4a947d18516ec2aab..b3a07a6f37ce428527f44261c79fa08aa23d258f 100644 --- a/pc/devi82365.c +++ b/pc/devi82365.c @@ -97,6 +97,18 @@ enum typedef struct I82365 I82365; +enum { + Ricoh_vid = 0x1180, + Ricoh_476_did = 0x476, +}; + +static struct { + ushort r_did; + char *r_name; +} variant[] = { +{ Ricoh_476_did, "Ricoh 476 PCI/Cardbus bridge", } +}; + /* a controller */ enum { @@ -581,6 +593,7 @@ static void i82365reset(void) { static int already; + Pcidev *p; int i, j; I82365 *cp; PCMslot *pp; @@ -590,6 +603,24 @@ i82365reset(void) return; already = 1; + /* First find Ricoh controllers on the PCI bus */ + p = nil; + while ((p = pcimatch(p, Ricoh_vid, 0)) != nil) { + for (i = 0; i != nelem(variant); i++) + if (p->did == variant[i].r_did) + break; + if (i == nelem(variant)) { + print("No match on %.4X/%.4X\n", p->vid, p->did); + continue; + } + + print("#y: %s, intl %d\n", variant[i].r_name, p->intl); + + for (i = 0; i != 0xE4 / 4; i++) + iprint("pci[%.2X] %.8ulX\n", i * 4, pcicfgr32(p, i * 4)); + break; + } + /* look for controllers if the ports aren't already taken */ if(ioalloc(0x3E0, 2, 0, "i82365.0") >= 0){ i82365probe(0x3E0, 0x3E1, 0);