~kris/9p

9hist

fee733b45f5571e95e14441a8cac7142f5605cd4 — David du Colombier 30 years ago 950a275
Plan 9 from Bell Labs 1995-10-19
3 files changed, 32 insertions(+), 10 deletions(-)

M pc/ether509.c
M pc/ether589.c
M pc/main.c
M pc/ether509.c => pc/ether509.c +17 -2
@@ 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)

M pc/ether589.c => pc/ether589.c +2 -2
@@ 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)

M pc/main.c => pc/main.c +13 -6
@@ 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