Deleted Added
full compact
digi.c (94361) digi.c (94949)
1/*-
2 * Copyright (c) 2001 Brian Somers <brian@Awfulhak.org>
3 * based on work by Slawa Olhovchenkov
4 * John Prince <johnp@knight-trosoft.com>
5 * Eric Hernes
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 12 unchanged lines hidden (view full) ---

21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
1/*-
2 * Copyright (c) 2001 Brian Somers <brian@Awfulhak.org>
3 * based on work by Slawa Olhovchenkov
4 * John Prince <johnp@knight-trosoft.com>
5 * Eric Hernes
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 12 unchanged lines hidden (view full) ---

21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
29 * $FreeBSD: head/sys/dev/digi/digi.c 94361 2002-04-10 14:32:55Z brian $
29 * $FreeBSD: head/sys/dev/digi/digi.c 94949 2002-04-17 15:13:52Z brian $
30 */
31
32/*-
33 * TODO:
34 * Figure out what the con bios stuff is supposed to do
35 * Test with *LOTS* more cards - I only have a PCI8r and an ISA Xem.
36 */
37

--- 271 unchanged lines hidden (view full) ---

309 case PCIXR:
310 if (sc->pcibus)
311 PCIPORT = FEPRST;
312 else
313 outb(sc->port, FEPRST | FEPMEM);
314
315 for (i = 0; ((sc->pcibus ? PCIPORT : inb(sc->port)) &
316 FEPMASK) != FEPRST; i++) {
30 */
31
32/*-
33 * TODO:
34 * Figure out what the con bios stuff is supposed to do
35 * Test with *LOTS* more cards - I only have a PCI8r and an ISA Xem.
36 */
37

--- 271 unchanged lines hidden (view full) ---

309 case PCIXR:
310 if (sc->pcibus)
311 PCIPORT = FEPRST;
312 else
313 outb(sc->port, FEPRST | FEPMEM);
314
315 for (i = 0; ((sc->pcibus ? PCIPORT : inb(sc->port)) &
316 FEPMASK) != FEPRST; i++) {
317 if (i > 100) {
317 if (i > hz) {
318 log(LOG_ERR, "digi%d: %s init reset failed\n",
319 sc->res.unit, sc->name);
320 return (EIO);
321 }
322 digi_delay(sc, "digiinit0", 5);
323 }
324 DLOG(DIGIDB_INIT, (sc->dev, "Got init reset after %d us\n", i));
325

--- 39 unchanged lines hidden (view full) ---

365 resp = FEPRST;
366 } else {
367 outb(sc->port, FEPCLR | FEPMEM);
368 resp = FEPRST | FEPMEM;
369 }
370
371 for (i = 0; ((sc->pcibus ? PCIPORT : inb(sc->port)) & FEPMASK)
372 == resp; i++) {
318 log(LOG_ERR, "digi%d: %s init reset failed\n",
319 sc->res.unit, sc->name);
320 return (EIO);
321 }
322 digi_delay(sc, "digiinit0", 5);
323 }
324 DLOG(DIGIDB_INIT, (sc->dev, "Got init reset after %d us\n", i));
325

--- 39 unchanged lines hidden (view full) ---

365 resp = FEPRST;
366 } else {
367 outb(sc->port, FEPCLR | FEPMEM);
368 resp = FEPRST | FEPMEM;
369 }
370
371 for (i = 0; ((sc->pcibus ? PCIPORT : inb(sc->port)) & FEPMASK)
372 == resp; i++) {
373 if (i > 100) {
373 if (i > hz) {
374 log(LOG_ERR, "digi%d: BIOS start failed\n",
375 sc->res.unit);
376 return (EIO);
377 }
378 digi_delay(sc, "digibios0", 5);
379 }
380
381 DLOG(DIGIDB_INIT, (sc->dev, "BIOS started after %d us\n", i));
382
383 for (i = 0; vW(ptr) != *(u_short *)"GD"; i++) {
374 log(LOG_ERR, "digi%d: BIOS start failed\n",
375 sc->res.unit);
376 return (EIO);
377 }
378 digi_delay(sc, "digibios0", 5);
379 }
380
381 DLOG(DIGIDB_INIT, (sc->dev, "BIOS started after %d us\n", i));
382
383 for (i = 0; vW(ptr) != *(u_short *)"GD"; i++) {
384 if (i > 200) {
384 if (i > 2*hz) {
385 log(LOG_ERR, "digi%d: BIOS boot failed "
386 "(0x%02x != 0x%02x)\n",
387 sc->res.unit, vW(ptr), *(u_short *)"GD");
388 return (EIO);
389 }
390 digi_delay(sc, "digibios1", 5);
391 }
392

--- 23 unchanged lines hidden (view full) ---

416 vW(ptr + 8) = 0;
417 vW(ptr + 10) = sc->fep.size;
418
419 /* Run the BIOS request */
420 outb(sc->port, FEPREQ | FEPMEM);
421 outb(sc->port, FEPCLR | FEPMEM);
422
423 for (i = 0; W(ptr); i++) {
385 log(LOG_ERR, "digi%d: BIOS boot failed "
386 "(0x%02x != 0x%02x)\n",
387 sc->res.unit, vW(ptr), *(u_short *)"GD");
388 return (EIO);
389 }
390 digi_delay(sc, "digibios1", 5);
391 }
392

--- 23 unchanged lines hidden (view full) ---

416 vW(ptr + 8) = 0;
417 vW(ptr + 10) = sc->fep.size;
418
419 /* Run the BIOS request */
420 outb(sc->port, FEPREQ | FEPMEM);
421 outb(sc->port, FEPCLR | FEPMEM);
422
423 for (i = 0; W(ptr); i++) {
424 if (i > 100) {
424 if (i > hz) {
425 log(LOG_ERR, "digi%d: FEP/OS move failed\n",
426 sc->res.unit);
427 sc->hidewin(sc);
428 return (EIO);
429 }
430 digi_delay(sc, "digifep0", 5);
431 }
432 DLOG(DIGIDB_INIT,

--- 68 unchanged lines hidden (view full) ---

501 /* Run the BIOS request */
502 outb(sc->port, FEPREQ | FEPMEM); /* send interrupt to BIOS */
503 outb(sc->port, FEPCLR | FEPMEM);
504 break;
505 }
506
507 /* Now wait 'till the FEP/OS has booted */
508 for (i = 0; vW(ptr) != *(u_short *)"OS"; i++) {
425 log(LOG_ERR, "digi%d: FEP/OS move failed\n",
426 sc->res.unit);
427 sc->hidewin(sc);
428 return (EIO);
429 }
430 digi_delay(sc, "digifep0", 5);
431 }
432 DLOG(DIGIDB_INIT,

--- 68 unchanged lines hidden (view full) ---

501 /* Run the BIOS request */
502 outb(sc->port, FEPREQ | FEPMEM); /* send interrupt to BIOS */
503 outb(sc->port, FEPCLR | FEPMEM);
504 break;
505 }
506
507 /* Now wait 'till the FEP/OS has booted */
508 for (i = 0; vW(ptr) != *(u_short *)"OS"; i++) {
509 if (i > 200) {
509 if (i > 2*hz) {
510 log(LOG_ERR, "digi%d: FEP/OS start failed "
511 "(0x%02x != 0x%02x)\n",
512 sc->res.unit, vW(ptr), *(u_short *)"OS");
513 sc->hidewin(sc);
514 return (EIO);
515 }
516 digi_delay(sc, "digifep1", 5);
517 }

--- 1446 unchanged lines hidden ---
510 log(LOG_ERR, "digi%d: FEP/OS start failed "
511 "(0x%02x != 0x%02x)\n",
512 sc->res.unit, vW(ptr), *(u_short *)"OS");
513 sc->hidewin(sc);
514 return (EIO);
515 }
516 digi_delay(sc, "digifep1", 5);
517 }

--- 1446 unchanged lines hidden ---