Plan 9 from Bell Labs’s /usr/web/sources/contrib/uriel/changes/2006/0413/4

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


9load: merge in current cardslot code, attempt to fix 3com
 [jmk] --rw-rw-r-- M 779778 jmk sys 9232 Apr 13 16:46 sys/src/boot/pc/cis.c
 [jmk] --rw-rw-r-- M 779778 glenda sys 3597 Apr 13 16:46 sys/src/boot/pc/dat.h
	/n/sourcesdump/2006/0413/plan9/sys/src/boot/pc/dat.h:112,117 - 
	/n/sourcesdump/2006/0414/plan9/sys/src/boot/pc/dat.h:112,118
	  
	  typedef struct Pcidev Pcidev;
	  typedef struct PCMmap PCMmap;
	+ typedef struct PCMslot PCMslot;
	  
	  #define BOOTLINE	((char*)CONFADDR)
	  
 [jmk] --rw-rw-r-- M 779778 glenda sys 15051 Apr 13 16:46 sys/src/boot/pc/devi82365.c
	[diffs elided - too long]
	[diff -c /n/sourcesdump/2006/0413/plan9/sys/src/boot/pc/devi82365.c /n/sourcesdump/2006/0414/plan9/sys/src/boot/pc/devi82365.c]
 [jmk] --rw-rw-r-- M 779778 glenda sys 33938 Apr 13 16:46 sys/src/boot/pc/devpccard.c
	[diffs elided - too long]
	[diff -c /n/sourcesdump/2006/0413/plan9/sys/src/boot/pc/devpccard.c /n/sourcesdump/2006/0414/plan9/sys/src/boot/pc/devpccard.c]
 [jmk] --rw-rw-r-- M 779778 glenda sys 4624 Apr 13 16:46 sys/src/boot/pc/ether589.c
	/n/sourcesdump/2006/0413/plan9/sys/src/boot/pc/ether589.c:155,161 - 
	/n/sourcesdump/2006/0414/plan9/sys/src/boot/pc/ether589.c:155,161
	  	if(memcmp(ea, ether->ea, 6) == 0 && strcmp(type, "3C562") == 0) {
	  		if(debug)
	  			print("read 562...");
	- 		if(pcmcistuple(slot, 0x88, ea, 6) == 6) {
	+ 		if(pcmcistuple(slot, 0x88, -1, ea, 6) == 6) {
	  			for(i = 0; i < 6; i += 2){
	  				t = ea[i];
	  				ea[i] = ea[i+1];
 [jmk] --rw-rw-r-- M 779778 jmk sys 18634 Apr 13 16:49 sys/src/boot/pc/ether8169.c
	/n/sourcesdump/2006/0413/plan9/sys/src/boot/pc/ether8169.c:22,29 - 
	/n/sourcesdump/2006/0414/plan9/sys/src/boot/pc/ether8169.c:22,27
	  #define qlock(i)	while(0)
	  #define qunlock(i)	while(0)
	  #define iallocb		allocb
	- extern void mb386(void);
	- #define coherence()	mb386()
	  #define iprint		print
	  #define mallocalign(n, a, o, s)	ialloc((n), (a))
	  
 [jmk] --rw-rw-r-- M 779778 glenda sys 21993 Apr 13 16:46 sys/src/boot/pc/ether83815.c
	/n/sourcesdump/2006/0413/plan9/sys/src/boot/pc/ether83815.c:301,311 - 
	/n/sourcesdump/2006/0414/plan9/sys/src/boot/pc/ether83815.c:301,306
	  #define csr16w(c, r, l)	(outs((c)->port+(r), (ulong)(l)))
	  
	  static void
	- coherence(void)
	- {
	- }
	- 
	- static void
	  dumpcregs(Ctlr *ctlr)
	  {
	  	int i;
 [jmk] --rw-rw-r-- M 779778 glenda sys 44662 Apr 13 16:46 sys/src/boot/pc/etherelnk3.c
	[diffs elided - too long]
	[diff -c /n/sourcesdump/2006/0413/plan9/sys/src/boot/pc/etherelnk3.c /n/sourcesdump/2006/0414/plan9/sys/src/boot/pc/etherelnk3.c]
 [jmk] --rw-rw-r-- M 779778 jmk sys 12383 Apr 13 16:46 sys/src/boot/pc/etherrhine.c
	/n/sourcesdump/2006/0413/plan9/sys/src/boot/pc/etherrhine.c:18,24 - 
	/n/sourcesdump/2006/0414/plan9/sys/src/boot/pc/etherrhine.c:18,23
	  typedef struct QLock { int r; } QLock;
	  #define qlock(i)	while(0)
	  #define qunlock(i)	while(0)
	- #define coherence()
	  #define iprint		print
	  
	  #include "etherif.h"
 [jmk] --rw-rw-r-- M 779778 glenda sys 4457 Apr 13 16:46 sys/src/boot/pc/fns.h
	/n/sourcesdump/2006/0413/plan9/sys/src/boot/pc/fns.h:15,20 - 
	/n/sourcesdump/2006/0414/plan9/sys/src/boot/pc/fns.h:15,21
	  void	changeconf(char*, ...);
	  void	checkalarms(void);
	  void	clockinit(void);
	+ #define coherence()	mb386()
	  void	consdrain(void);
	  void	consinit(char*, char*);
	  void	consputs(char*, int);
	/n/sourcesdump/2006/0413/plan9/sys/src/boot/pc/fns.h:53,63 - 
	/n/sourcesdump/2006/0414/plan9/sys/src/boot/pc/fns.h:54,67
	  void	insb(int, void*, int);
	  void	inss(int, void*, int);
	  void	insl(int, void*, int);
	+ #define ioalloc(addr, len, align, name)	(addr)
	+ #define iofree(addr)
	  void	iunlock(Lock*);
	  int	isaconfig(char*, int, ISAConf*);
	  void	kbdinit(void);
	  void	kbdchar(int);
	  void	machinit(void);
	+ void	mb386(void);
	  void	meminit(ulong);
	  void	microdelay(int);
	  void	mmuinit(void);
	/n/sourcesdump/2006/0413/plan9/sys/src/boot/pc/fns.h:83,89 - 
	/n/sourcesdump/2006/0414/plan9/sys/src/boot/pc/fns.h:87,95
	  uchar	pciipin(Pcidev *, uchar);
	  void	pcireset(void);
	  void	pcisetbme(Pcidev*);
	- int	pcmcistuple(int, int, void*, int);
	+ void	pcmcisread(PCMslot*);
	+ int	pcmcistuple(int, int, int, void*, int);
	+ PCMmap*	pcmmap(int, ulong, int, int);
	  int	pcmspecial(char*, ISAConf*);
	  void	pcmspecialclose(int);
	  void	pcmunmap(int, PCMmap*);
 [jmk] --rw-rw-r-- M 779778 glenda sys 6821 Apr 13 16:46 sys/src/boot/pc/io.h
	[diffs elided - too long]
	[diff -c /n/sourcesdump/2006/0413/plan9/sys/src/boot/pc/io.h /n/sourcesdump/2006/0414/plan9/sys/src/boot/pc/io.h]
 [jmk] --rw-rw-r-- M 779778 glenda sys 3112 Apr 13 16:46 sys/src/boot/pc/mkfile
	/n/sourcesdump/2006/0413/plan9/sys/src/boot/pc/mkfile:33,41 - 
	/n/sourcesdump/2006/0414/plan9/sys/src/boot/pc/mkfile:33,42
	  	8250.$O\
	  	apm.$O\
	  	boot.$O\
	- 	devpccard.$O\
	+ 	cis.$O\
	  	conf.$O\
	  	devi82365.$O\
	+ 	devpccard.$O\
	  	devsd.$O\
	  	inflate.$O\
	  	load.$O\
	/n/sourcesdump/2006/0413/plan9/sys/src/boot/pc/mkfile:166,173 - 
	/n/sourcesdump/2006/0414/plan9/sys/src/boot/pc/mkfile:167,174
	  		mk $MKFLAGS $i.install
	  
	  %.install:V:	$BIN/%
	- 	#import lookout / /n/lookout
	- 	#cp $prereq /n/lookout/$prereq
	+ 	import lookout / /n/lookout
	+ 	cp $prereq /n/lookout/$prereq
	  
	  $BIN/%:	%
	  	cp $stem $BIN/$stem
 [jmk] --rw-rw-r-- M 779778 glenda sys 52127 Apr 13 16:46 sys/src/boot/pc/sd53c8xx.c
	/n/sourcesdump/2006/0413/plan9/sys/src/boot/pc/sd53c8xx.c:1869,1891 - 
	/n/sourcesdump/2006/0414/plan9/sys/src/boot/pc/sd53c8xx.c:1869,1896
	  static int
	  xfunc(Controller *c, enum na_external x, unsigned long *v)
	  {
	- 	switch (x)
	- 	{
	+ 	switch (x) {
	+ 	default:
	+ 		print("xfunc: can't find external %d\n", x);
	+ 		return 0;
	  	case X_scsi_id_buf:
	- 		*v = offsetof(Dsa, scsi_id_buf[0]); return 1;
	+ 		*v = offsetof(Dsa, scsi_id_buf[0]);
	+ 		break;
	  	case X_msg_out_buf:
	- 		*v = offsetof(Dsa, msg_out_buf); return 1;
	+ 		*v = offsetof(Dsa, msg_out_buf);
	+ 		break;
	  	case X_cmd_buf:
	- 		*v = offsetof(Dsa, cmd_buf); return 1;
	+ 		*v = offsetof(Dsa, cmd_buf);
	+ 		break;
	  	case X_data_buf:
	- 		*v = offsetof(Dsa, data_buf); return 1;
	+ 		*v = offsetof(Dsa, data_buf);
	+ 		break;
	  	case X_status_buf:
	- 		*v = offsetof(Dsa, status_buf); return 1;
	+ 		*v = offsetof(Dsa, status_buf);
	+ 		break;
	  	case X_dsa_head:
	- 		*v = DMASEG(&c->dsalist.head[0]); return 1;
	- 	default:
	- 		print("xfunc: can't find external %d\n", x);
	- 		return 0;
	+ 		*v = DMASEG(&c->dsalist.head[0]);
	+ 		break;
	  	}
	  	return 1;
	  }
	/n/sourcesdump/2006/0413/plan9/sys/src/boot/pc/sd53c8xx.c:1960,1966 - 
	/n/sourcesdump/2006/0414/plan9/sys/src/boot/pc/sd53c8xx.c:1965,1971
	  		}
	  		if(v >= &variant[nelem(variant)])
	  			continue;
	- 		print("sd53c8xx: %s rev. 0x%2.2x intr=%d command=%4.4luX\n",
	+ 		print("sd53c8xx: %s rev. 0x%2.2x intr=%d command=%4.4uX\n",
	  			v->name, p->rid, p->intl, p->pcr);
	  
	  		regpa = p->mem[1].bar;
 [jmk] --rw-rw-r-- M 779778 glenda sys 38221 Apr 13 16:46 sys/src/boot/pc/sdata.c
	/n/sourcesdump/2006/0413/plan9/sys/src/boot/pc/sdata.c:1465,1471 - 
	/n/sourcesdump/2006/0414/plan9/sys/src/boot/pc/sdata.c:1465,1471
	  		case (0x4D69<<16)|0x105A:	/* Promise Ultra/133 TX2 */
	  		case (0x3373<<16)|0x105A:	/* Promise 20378 RAID */
	  		case (0x3149<<16)|0x1106:	/* VIA VT8237 SATA/RAID */
	- 		case (0x3112<<16)|0x1095:   	/* SiL 3112 SATA (DMA busted?) */
	+ 		case (0x3112<<16)|0x1095:	/* SiL 3112 SATA (DMA busted?) */
	  		case (0x3114<<16)|0x1095:	/* SiL 3114 SATA/RAID */
	  			pi = 0x85;
	  			break;
 [jmk] --rw-rw-r-- M 779778 glenda sys 28693 Apr 13 16:46 sys/src/boot/pc/sdmylex.c
	/n/sourcesdump/2006/0413/plan9/sys/src/boot/pc/sdmylex.c:26,33 - 
	/n/sourcesdump/2006/0414/plan9/sys/src/boot/pc/sdmylex.c:26,31
	  typedef struct Rendez{ int r; } Rendez;
	  #define	intrenable(irq, f, c, tbdf, name)	setvec(VectorPIC+(irq), f, c);\
	  						USED(tbdf);
	- #define ioalloc(p, b, c, d)	(1)
	- #define iofree(p)
	  
	  #define K2BPA(va, tbdf)	PADDR(va)
	  #define BPA2K(pa, tbdf)	KADDR(pa)
 [jmk] --rw-rw-r-- M 779778 glenda sys 7006 Apr 13 16:47 sys/src/boot/pc/sdscsi.c
	/n/sourcesdump/2006/0413/plan9/sys/src/boot/pc/sdscsi.c:133,139 - 
	/n/sourcesdump/2006/0414/plan9/sys/src/boot/pc/sdscsi.c:133,139
	  // cgascreenputs("C", 1);
	  	switch(r->unit->dev->ifc->rio(r)){
	  	default:
	- 		return -1;
	+ 		break;
	  	case SDcheck:
	  		if(!(r->flags & SDvalidsense))
	  			return -1;
	/n/sourcesdump/2006/0413/plan9/sys/src/boot/pc/sdscsi.c:151,157 - 
	/n/sourcesdump/2006/0414/plan9/sys/src/boot/pc/sdscsi.c:151,157
	  				return 2;
	  			if(r->sense[12] == 0x29)
	  				return 2;
	- 			return -1;
	+ 			break;
	  		case 0x02:		/* not ready */
	  			/*
	  			 * If no medium present, bail out.
	/n/sourcesdump/2006/0413/plan9/sys/src/boot/pc/sdscsi.c:166,174 - 
	/n/sourcesdump/2006/0414/plan9/sys/src/boot/pc/sdscsi.c:166,174
	  			scsitest(r);
	  			return 2;
	  		default:
	- 			return -1;
	+ 			break;
	  		}
	- 		return -1;
	+ 		break;
	  	case SDok:
	  		return 0;
	  	}
 [jmk] --rw-rw-r-- M 779778 glenda sys 7499 Apr 13 16:46 sys/src/boot/pc/trap.c
	/n/sourcesdump/2006/0413/plan9/sys/src/boot/pc/trap.c:182,188 - 
	/n/sourcesdump/2006/0414/plan9/sys/src/boot/pc/trap.c:182,188
	  	 */
	  	outb(Int0ctl, Icw1|0x01);	/* ICW1 - edge triggered, master,
	  					   ICW4 will be sent */
	- 	outb(Int0aux, VectorPIC);		/* ICW2 - interrupt vector offset */
	+ 	outb(Int0aux, VectorPIC);	/* ICW2 - interrupt vector offset */
	  	outb(Int0aux, 0x04);		/* ICW3 - have slave on level 2 */
	  	outb(Int0aux, 0x01);		/* ICW4 - 8086 mode, not buffered */
	  
	/n/sourcesdump/2006/0413/plan9/sys/src/boot/pc/trap.c:194,200 - 
	/n/sourcesdump/2006/0414/plan9/sys/src/boot/pc/trap.c:194,200
	  	 */
	  	outb(Int1ctl, Icw1|0x01);	/* ICW1 - edge triggered, master,
	  					   ICW4 will be sent */
	- 	outb(Int1aux, VectorPIC+8);		/* ICW2 - interrupt vector offset */
	+ 	outb(Int1aux, VectorPIC+8);	/* ICW2 - interrupt vector offset */
	  	outb(Int1aux, 0x02);		/* ICW3 - I am a slave on level 2 */
	  	outb(Int1aux, 0x01);		/* ICW4 - 8086 mode, not buffered */
	  	outb(Int1aux, int1mask);
 [jmk] --rw-rw-r-- M 779778 glenda sys 38028 Apr 13 21:17 sys/src/boot/pc/ether2114x.c
	/n/sourcesdump/2006/0413/plan9/sys/src/boot/pc/ether2114x.c:186,191 - 
	/n/sourcesdump/2006/0414/plan9/sys/src/boot/pc/ether2114x.c:186,193
	  	Tulip3		= (0x0019<<16)|0x1011,
	  	Pnic		= (0x0002<<16)|0x11AD,
	  	Pnic2		= (0xC115<<16)|0x11AD,
	+ 	CentaurP	= (0x0985<<16)|0x1317,
	+ 	CentaurPcb	= (0x1985<<16)|0x1317,
	  };
	  
	  typedef struct Ctlr Ctlr;
	/n/sourcesdump/2006/0413/plan9/sys/src/boot/pc/ether2114x.c:1372,1377 - 
	/n/sourcesdump/2006/0414/plan9/sys/src/boot/pc/ether2114x.c:1374,1386
	  			ctlr->srom[20+i+1] = ctlr->srom[i];
	  		}
	  	}
	+ 	if(ctlr->id == CentaurP || ctlr->id == CentaurPcb){
	+ 		memmove(&ctlr->srom[20], leafpnic, sizeof(leafpnic));
	+ 		for(i = 0; i < Eaddrlen; i += 2){
	+ 			ctlr->srom[20+i] = ctlr->srom[8+i];
	+ 			ctlr->srom[20+i+1] = ctlr->srom[8+i+1];
	+ 		}
	+ 	}
	  
	  	/*
	  	 * Next, try to find the info leaf in the SROM for media detection.
	/n/sourcesdump/2006/0413/plan9/sys/src/boot/pc/ether2114x.c:1453,1458 - 
	/n/sourcesdump/2006/0414/plan9/sys/src/boot/pc/ether2114x.c:1462,1469
	  	if(phy){
	  		x = 0;
	  		for(k = 0; k < nelem(ctlr->phy); k++){
	+ 			if((ctlr->id == CentaurP || ctlr->id == CentaurPcb) && k != 1)
	+ 				continue;
	  			if((oui = miir(ctlr, k, 2)) == -1 || oui == 0)
	  				continue;
	  			if(DEBUG){
	/n/sourcesdump/2006/0413/plan9/sys/src/boot/pc/ether2114x.c:1497,1506 - 
	/n/sourcesdump/2006/0414/plan9/sys/src/boot/pc/ether2114x.c:1508,1519
	  			pcicfgw32(p, 0x40, x);
	  			/*FALLTHROUGH*/
	  
	- 		case Pnic:			/* PNIC */
	- 		case Pnic2:			/* PNIC-II */
	  		case Tulip0:			/* 21140 */
	  		case Tulip1:			/* 21041 */
	+ 		case Pnic:			/* PNIC */
	+ 		case Pnic2:			/* PNIC-II */
	+ 		case CentaurP:			/* ADMtek */
	+ 		case CentaurPcb:		/* ADMtek CardBus */
	  			break;
	  		}
	  
	/n/sourcesdump/2006/0413/plan9/sys/src/boot/pc/ether2114x.c:1531,1542 - 
	/n/sourcesdump/2006/0414/plan9/sys/src/boot/pc/ether2114x.c:1544,1569
	  		switch(ctlr->id){
	  		default:
	  			break;
	- 
	  		case Pnic:			/* PNIC */
	  			/*
	  			 * Turn off the jabber timer.
	  			 */
	  			csr32w(ctlr, 15, 0x00000001);
	+ 			break;
	+ 		case CentaurP:
	+ 		case CentaurPcb:
	+ 			/*
	+ 			 * Nice - the register offsets change from *8 to *4
	+ 			 * for CSR16 and up...
	+ 			 * CSR25/26 give the MAC address read from the SROM.
	+ 			 * Don't really need to use this other than as a check,
	+ 			 * the SROM will be read in anyway so the value there
	+ 			 * can be used directly.
	+ 			 */
	+ 			debug("csr25 %8.8luX csr26 %8.8luX\n",
	+ 				inl(ctlr->port+0xA4), inl(ctlr->port+0xA8));
	+ 			debug("phyidr1 %4.4luX phyidr2 %4.4luX\n",
	+ 				inl(ctlr->port+0xBC), inl(ctlr->port+0xC0));
	  			break;
	  		}
	  


Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].