From fee733b45f5571e95e14441a8cac7142f5605cd4 Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Thu, 19 Oct 1995 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 1995-10-19 --- pc/ether509.c | 19 +++++++++++++++++-- pc/ether589.c | 4 ++-- pc/main.c | 19 +++++++++++++------ 3 files changed, 32 insertions(+), 10 deletions(-) diff --git a/pc/ether509.c b/pc/ether509.c index 94dba6aaf5e48118386d390a294b525b998589d1..81b1b65787840f1352caa8ee71089d094b2bdd1b 100644 --- a/pc/ether509.c +++ b/pc/ether509.c @@ -607,6 +607,21 @@ tcm590(Ether *ether) return 0; } +static ulong +tcm589(ISAConf *isa) +{ + if(strcmp(isa->type, "3C589") != 0) + return 0; + + /* + * The 3com manual register description says that this a noop for + * PCMCIA but the flow chart at the end shows it. + */ + COMMAND(isa->port, SelectWindow, 0); + outs(isa->port+ConfigControl, Ena); + return isa->port; +} + /* * Get configuration parameters. */ @@ -639,8 +654,8 @@ ether509reset(Ether *ether) break; } } - if(strcmp(ether->type, "3C589") == 0) - port = ether->port; + if(port == 0) + port = tcm589(ether); if(port == 0 && (pcicfg = tcm590(ether))) port = pcicfg->baseaddr[0] & ~0x01; if(port == 0) diff --git a/pc/ether589.c b/pc/ether589.c index 59f20626a888c0fd6c016f5db60bbab453a47e8b..6e2b7127cd002d7ff7b88a31d8cfa47d70eea57f 100644 --- a/pc/ether589.c +++ b/pc/ether589.c @@ -53,11 +53,11 @@ configASIC(Ether *ether, int port, int xcvr) /* ROM size & base - must be set before we can access ROM */ /* transceiver type is 2 for 'figure it out' */ x = ins(port + AddressConfig); - outs(port + AddressConfig, (x & 0x20) | xcvr); + outs(port + AddressConfig, (x & 0xf0) | xcvr); /* IRQ must be 3 on 3C589 */ x = ins(port + ResourceConfig); - outs(port + ResourceConfig, 0x3f00 | (x&0xfff)); + outs(port + ResourceConfig, 0x3f00 | (x&0xff)); /* move product ID to register */ while(ins(port+EEPROMcmd) & 0x8000) diff --git a/pc/main.c b/pc/main.c index f1c259a2697178a6e4721054e6cfe0129b533ab9..07fe67cd1918bdf1e3d8f741f4fc58611b0d4a5b 100644 --- a/pc/main.c +++ b/pc/main.c @@ -330,17 +330,24 @@ romscan(void) p[0] = 0x55; p[1] = 0xAA; p[2] = 4; - if(p[0] != 0x55 || p[1] != 0xAA){ - putisa(PADDR(p), 2048); - p += 2048; + if(p[0] == 0x55 && p[1] == 0xAA){ + p += p[2]*512; continue; } - p += p[2]*512; + p[0] = 0xff; + p[2048-1] = 0xff; + if(p[0] == 0xff && p[2048-1] == 0xff) + putisa(PADDR(p), 2048); + p += 2048; } p = (uchar*)(KZERO+0xE0000); - if(p[0] != 0x55 || p[1] != 0xAA) - putisa(PADDR(p), 64*1024); + if(p[0] != 0x55 || p[1] != 0xAA){ + p[0] = 0xff; + p[64*1024-1] = 0xff; + if(p[0] == 0xff && p[64*1024-1] == 0xff) + putisa(PADDR(p), 64*1024); + } } void