From owner-freebsd-multimedia Wed Mar 25 19:39:52 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id TAA05987 for freebsd-multimedia-outgoing; Wed, 25 Mar 1998 19:39:52 -0800 (PST) (envelope-from owner-freebsd-multimedia@FreeBSD.ORG) Received: from taliesin.cs.ucla.edu (Taliesin.CS.UCLA.EDU [131.179.96.166]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id TAA05965 for ; Wed, 25 Mar 1998 19:39:50 -0800 (PST) (envelope-from scottm@mordred.cs.ucla.edu) Received: (qmail 5305 invoked from network); 26 Mar 1998 03:39:12 -0000 Received: from mordred.cs.ucla.edu (131.179.48.34) by taliesin.cs.ucla.edu with SMTP; 26 Mar 1998 03:39:12 -0000 Received: from mordred.cs.ucla.edu (localhost [127.0.0.1]) by mordred.cs.ucla.edu (8.8.8/8.8.8) with ESMTP id TAA00308; Wed, 25 Mar 1998 19:39:44 -0800 (PST) (envelope-from scottm@mordred.cs.ucla.edu) Message-Id: <199803260339.TAA00308@mordred.cs.ucla.edu> X-Mailer: exmh version 2.0.1 12/23/97 To: luoqi@watermarkgroup.com (Luoqi Chen) cc: freebsd-multimedia@FreeBSD.ORG, scottm@CS.UCLA.EDU Subject: Re: NEC 276 CDrom drive In-reply-to: Your message of "Tue, 24 Mar 1998 22:48:12 EST." <9803250348.AA28812@watermarkgroup.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 25 Mar 1998 19:39:43 -0800 From: Scott Michel Sender: owner-freebsd-multimedia@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org I say that this patch should be committed. I can vouch that it works. Probably needs more testing to make sure that everyone else's drive still works, but at least mine is... -scooter > I have a NEC 273/4.21 drive, and I saw the same message during bootup. > Signal timing for these NEC drives doesn't exactly follow the spec: > when data transfer is done, the drive should assert IO/CMD first, then > deassert ARQ and BSY, then assert INTRQ. > > Try the following patch: > > Index: atapi.c > =================================================================== > RCS file: /fun/cvs/src/sys/i386/isa/atapi.c,v > retrieving revision 1.24 > diff -u -r1.24 atapi.c > --- atapi.c 1998/03/01 18:57:27 1.24 > +++ atapi.c 1998/03/24 07:48:05 > @@ -711,7 +711,9 @@ > { > u_char ireason; > u_short len, i; > + int retry = 100; > > +again: > if (atapi_wait (ata->port, 0) < 0) { > ac->result.status = inb (ata->port + AR_STATUS); > ac->result.error = inb (ata->port + AR_ERROR); > @@ -734,8 +736,13 @@ > ac->result.status, ARS_BITS, > ac->result.error, AER_BITS); > } > - switch ((ireason & (ARI_CMD | ARI_IN)) | (ac->result.status & ARS_DRQ)) { > + switch ((ireason & (ARI_CMD|ARI_IN)) | (ac->result.status & ARS_DRQ)) { > default: > + /* we could be between phases for immediate requests */ > + if (!ac->callback && retry--) { > + DELAY(10); > + goto again; > + } > printf ("atapi%d.%d: unknown phase\n", ata->ctrlr, ac->unit); > ac->result.code = RES_ERR; > break; > @@ -948,20 +955,13 @@ > /* Send packet command. */ > atapi_send_cmd (ata, ac); > > - /* Wait for data i/o phase. */ > - for (cnt=20000; cnt>0; --cnt) > - if (((inb (ata->port + AR_IREASON) & (ARI_CMD | ARI_IN)) | > - (inb (ata->port + AR_STATUS) & ARS_DRQ)) != PHASE_CMDOUT) > - break; > - > - /* Do all needed i/o. */ > - while (atapi_io (ata, ac)) > - /* Wait for DRQ deassert. */ > + do { > for (cnt=2000; cnt>0; --cnt) { > - if (! (inb (ata->port + AR_STATUS) & ARS_DRQ)) > + u_char s = inb(ata->port + AR_STATUS); > + if ((s & (ARS_DRQ | ARS_BSY)) == ARS_BSY) > break; > - DELAY(10); > } > + } while (atapi_io(ata, ac)); > } > return (ac->result); > } > > > > > -scooter > > -- > > Scott Michel | In life, there are sheep and there are > > UCLA Computer Science | wolves. > > PhD Graduate Student | ... And I don't bleed ... > > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > > with "unsubscribe freebsd-multimedia" in the body of the message > > > > -lq To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-multimedia" in the body of the message