9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Mike Haertel <mike@ducky.net>
To: 9fans@cse.psu.edu
Subject: [9fans] Alpha success (w/ clock.c bugfix and ether2114x.c update)
Date: Mon, 22 Oct 2001 00:54:42 -0700	[thread overview]
Message-ID: <200110220754.f9M7sg509636@ducky.net> (raw)

Ok, nobody replied to my previous query, so I was on my own.
In order to get my Alpha working, I fixed two things.

1.  Fixed a bug in the clock interrupt handler.

term% diff 9/alphapc/clock.c 9.new/alphapc/clock.c
137,140c137,141
< 		lock(&clock0lock);
< 		for(lp = clock0link; lp; lp = lp->link)
< 			lp->clock();
< 		unlock(&clock0lock);
---
> 		if (canlock(&clock0lock)) {
> 			for(lp = clock0link; lp; lp = lp->link)
> 				lp->clock();
> 			unlock(&clock0lock);
> 		}

2.  Added (very minimal) support for the DEC DE-500 (and perhaps
other 21143-based cards that use SYM media controllers) to ether2114x.c.
I based my work on the more up-to-date driver in the PC platform port
of Plan 9.  Therefore, to apply this patch, do two steps:
	a) copy /sys/src/9/pc/ether2114x.c to /sys/src/9/alphapc
	2) apply the following diffs
Note that the portion of the diffs from line 978 onwards can
also be applied to /sys/src/9/pc/ether2114x.c to add support for
21143 cards with SYM media controllers on PC platforms.

By the way, I think it would be a big win to share PCI drivers
between platforms.  The only difference between the Alpha and PCI
versions of ether2114x.c were use of PCIWADDR instead of PADDR,
and one use of xspanalloc instead of malloc.  With just a little
work I'm sure many drivers could be platform-independent.

term% diff 9/pc/ether2114x.c 9.new/alphapc/ether21114x.c
388c388
< 		des->addr = PADDR(bp->rp);
---
> 		des->addr = PCIWADDR(bp->rp);
473c473
< 					des->addr = PADDR(bp->rp);
---
> 					des->addr = PCIWADDR(bp->rp);
577c577
< 	ctlr->rdr = malloc(ctlr->nrdr*sizeof(Des));
---
> 	ctlr->rdr = xspanalloc(ctlr->nrdr*sizeof(Des), 8*sizeof(ulong), 0);
582c582
< 		des->addr = PADDR(des->bp->rp);
---
> 		des->addr = PCIWADDR(des->bp->rp);
586c586
< 	csr32w(ctlr, 3, PADDR(ctlr->rdr));
---
> 	csr32w(ctlr, 3, PCIWADDR(ctlr->rdr));
592c592
< 	csr32w(ctlr, 4, PADDR(ctlr->tdr));
---
> 	csr32w(ctlr, 4, PCIWADDR(ctlr->tdr));
978a979,998
> typesymmode(Ctlr *ctlr, uchar *block, int wait)
> {
> 	uint gpmode, gpdata, command;
> 
> 	USED(wait);
> 	gpmode = block[3] | ((uint) block[4] << 8);
> 	gpdata = block[5] | ((uint) block[6] << 8);
> 	command = (block[7] | ((uint) block[8] << 8)) & 0x71;
> 	if (command & 0x8000) {
> 		print("ether2114x.c: FIXME: handle type 4 mode blocks where cmd.active_invalid != 0\n");
> 		return -1;
> 	}
> 	csr32w(ctlr, 15, gpmode);
> 	csr32w(ctlr, 15, gpdata);
> 	ctlr->csr6 = (command & 0x71) << 18;
> 	csr32w(ctlr, 6, ctlr->csr6);
> 	return 0;
> }
> 
> static int
1070a1091,1094
> 				return 0;
> 			break;
> 		case 4:
> 			if(typesymmode(ctlr, block, wait))


             reply	other threads:[~2001-10-22  7:54 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-10-22  7:54 Mike Haertel [this message]
2001-10-22 14:11 jmk
2001-10-23  4:53 ` Mike Haertel
2001-10-23  5:54   ` George Bronnikov
2001-10-23 14:00 jmk
2001-10-23 14:17 jmk
2001-10-23 14:35 ` Ronald G Minnich
2001-10-23 20:32   ` Matthew Hannigan
2001-10-23 22:26     ` Dan Cross
2001-10-25  4:36   ` Boyd Roberts
2001-10-25  6:06     ` andrey mirtchovski
2001-11-05 10:21       ` Jonadab the Unsightly One
2001-11-05 11:42         ` Boyd Roberts
2001-10-23 14:56 ` Sam Ducksworth
2001-10-23 17:25   ` Ronald G Minnich
2001-10-23 18:55 ` Mike Haertel
2001-10-23 19:23   ` Ronald G Minnich
2001-10-23 20:17     ` Scott Schwartz
2001-10-23 20:26       ` andrey
2001-10-23 20:36       ` Ronald G Minnich
2001-10-23 14:58 jmk
2001-10-23 20:41 rob pike
2001-10-25  1:13 okamoto
2001-11-05  5:32 okamoto

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200110220754.f9M7sg509636@ducky.net \
    --to=mike@ducky.net \
    --cc=9fans@cse.psu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).