From owner-freebsd-scsi Mon Jan 15 01:57:56 1996 Return-Path: owner-freebsd-scsi Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id BAA01553 for freebsd-scsi-outgoing; Mon, 15 Jan 1996 01:57:56 -0800 (PST) Received: from irz301.inf.tu-dresden.de (irz301.inf.tu-dresden.de [141.76.1.11]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id BAA01514 for ; Mon, 15 Jan 1996 01:56:11 -0800 (PST) Received: from sax.sax.de by irz301.inf.tu-dresden.de (8.6.12/8.6.12-s1) with ESMTP id KAA09189; Mon, 15 Jan 1996 10:55:11 +0100 Received: by sax.sax.de (8.6.11/8.6.12-s1) with UUCP id KAA12212; Mon, 15 Jan 1996 10:55:10 +0100 Received: (from j@localhost) by uriah.heep.sax.de (8.7.3/8.6.9) id KAA11225; Mon, 15 Jan 1996 10:26:42 +0100 (MET) From: J Wunsch Message-Id: <199601150926.KAA11225@uriah.heep.sax.de> Subject: Re: Cant Boot on AHA1542CP / Micropolis 2210 To: rdonovan@wln.com (Richard W Donovan) Date: Mon, 15 Jan 1996 10:26:42 +0100 (MET) Cc: freebsd-scsi@freebsd.org Reply-To: joerg_wunsch@uriah.heep.sax.de (Joerg Wunsch) In-Reply-To: from "Richard W Donovan" at Jan 14, 96 07:03:12 pm X-Phone: +49-351-2012 669 X-Mailer: ELM [version 2.4 PL23] MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Sender: owner-freebsd-scsi@freebsd.org Precedence: bulk As Richard W Donovan wrote: > I have a [...] > an Adaptec AHA1542CP controller (this is > the new Plug and Play one), ... > However, now I can't boot up the system using either the OSBS > boot manager software from the CD or the boot floppy - it just locks up > after stating "Waiting for SCSI devices to settle.". What is the proper > way to install FreeBSD and then boot the OS? Peter Dufault has been fixing the Plug'nPray AHA1542 adapter handling after 2.0.5R. You need a newer version (2.1R), or a running FreeBSD where you can build a new kernel with the following patch applied to /sys/i386/isa/aha1542.c: Index: aha1542.c =================================================================== RCS file: /home/cvs/src/sys/i386/isa/aha1542.c,v retrieving revision 1.47 retrieving revision 1.48 diff -u -r1.47 -r1.48 --- aha1542.c 1995/09/19 18:55:04 1.47 +++ aha1542.c 1995/10/01 15:09:51 1.48 @@ -12,7 +12,7 @@ * on the understanding that TFS is not responsible for the correct * functioning of this software in any circumstances. * - * $Id: aha1542.c,v 1.47 1995/09/19 18:55:04 bde Exp $ + * $Id: aha1542.c,v 1.48 1995/10/01 15:09:51 dufault Exp $ */ /* @@ -34,6 +34,7 @@ #include #include #include +#include /* XXX for bootverbose: a funny place */ #endif /* KERNEL */ #include #include @@ -255,6 +256,7 @@ /* 0x43 ('C') = AHA-1542C */ /* 0x44 ('D') = AHA-1542CF */ /* 0x45 ('E') = AHA-1542CF, BIOS v2.01 */ + /* 0x46 ('F') = AHA-1542CP, "Plug'nPlay" */ u_char spec_opts; /* special options ID */ /* 0x41 = Board is standard model */ u_char revision_1; /* firmware revision [0-9A-Z] */ @@ -963,7 +965,13 @@ scsi_done(xs); } -static char *board_rev(int type) +/* Macro to determine that a rev is potentially a new valid one + * so that the driver doesn't keep breaking on new revs as it + * did for the CF and CP. + */ +#define PROBABLY_NEW_BOARD(REV) (REV > 0x43 && REV < 0x56) + +static char *board_rev(int unit, int type) { switch(type) { @@ -974,7 +982,20 @@ case 0x43: return "AHA-1542C"; case 0x44: return "AHA-1542CF"; case 0x45: return "AHA-1542CF BIOS v2.01"; - default: return "Unknown board"; + case 0x46: return "AHA-1542CP"; + + default: + + + if (PROBABLY_NEW_BOARD(type)) + { + printf("aha%d: Assuming type %02x is a new board.\n", + unit, type); + return "New Adaptec rev?"; + } + + printf("aha%d: type %02x is an unknown board.\n", unit, type); + return "Unknown board"; } } @@ -986,6 +1007,7 @@ int unit; { struct aha_data *aha = ahadata[unit]; + char *desc; unsigned char ad[3]; volatile int i, sts; struct aha_config conf; @@ -1067,62 +1089,69 @@ aha->flags = SDEV_BOUNCE; +#define PRVERBOSE(x) if (bootverbose) printf x + /* - * If we are a 1542C or 1542CF disable the extended bios so that the + * If we are a new type of 1542 board (anything newer than a 1542C) + * then disable the extended bios so that the * mailbox interface is unlocked. * This is also true for the 1542B Version 3.20. First Adaptec * board that supports >1Gb drives. * No need to check the extended bios flags as some of the * extensions that cause us problems are not flagged in that byte. */ - printf("aha%d: %s-V%c.%c", - unit, board_rev(inquire.boardid), inquire.revision_1, - inquire.revision_2); + desc = board_rev(unit, inquire.boardid); + + PRVERBOSE( ("aha%d: Rev %02x (%s) V%c.%c", + unit, inquire.boardid, desc, inquire.revision_1, + inquire.revision_2) ); - if ((inquire.boardid == 0x43) || (inquire.boardid == 0x44) || - (inquire.boardid == 0x45) || (inquire.boardid == 0x41 + if (PROBABLY_NEW_BOARD(inquire.boardid) || + (inquire.boardid == 0x41 && inquire.revision_1 == 0x31 && inquire.revision_2 == 0x34)) { aha_cmd(unit, 0, sizeof(extbios), 0, &extbios, AHA_EXT_BIOS); #ifdef AHADEBUG printf("aha%d: extended bios flags %x\n", unit, extbios.flags); #endif /* AHADEBUG */ - printf(", enabling mailbox"); + PRVERBOSE( (", enabling mailbox") ); aha_cmd(unit, 2, 0, 0, 0, AHA_MBX_ENABLE, 0, extbios.mailboxlock); - } /* Which boards support residuals? Some early 1542A's apparently * don't. The 1542B with V0.5 of the software does, so I've * arbitrarily set that as the earliest rev. */ - if ((inquire.boardid == 0x43) || (inquire.boardid == 0x44) || - (inquire.boardid == 0x45) || (inquire.boardid == 0x41 + if (PROBABLY_NEW_BOARD(inquire.boardid) || + (inquire.boardid == 0x41 && (inquire.revision_1 > '0' || inquire.revision_2 >= '5'))) { - printf(", enabling residuals"); + + PRVERBOSE( (", enabling residuals") ); + aha->init_opcode = AHA_INIT_RESID_CCB; aha->sg_opcode = AHA_INIT_SG_RESID_CCB; } /* Which boards support target operations? The 1542C completely * locks up the SCSI bus if you enable them. I'm only sure - * about the B. + * about the B, which was sold in the OEM market as a target + * board. */ if (inquire.boardid == 0x41) { - printf(", target ops"); + PRVERBOSE( (", target ops") ); aha->flags |= SDEV_TARGET_OPS; } - printf("\n"); + PRVERBOSE( ("\n") ); /* * setup dma channel from jumpers and save int * level */ - printf("aha%d: reading board settings, ", unit); -#define PRNT(x) printf(x) + PRVERBOSE(("aha%d: reading board settings, ", unit)); + if (inquire.boardid == 0x20) { DELAY(1000); /* for Bustek 545 */ } @@ -1133,63 +1162,60 @@ outb(0x0b, 0x0c); outb(0x0a, 0x00); aha->aha_dma = 0; - PRNT("dma=0 "); break; case CHAN5: outb(0xd6, 0xc1); outb(0xd4, 0x01); aha->aha_dma = 5; - PRNT("dma=5 "); break; case CHAN6: outb(0xd6, 0xc2); outb(0xd4, 0x02); aha->aha_dma = 6; - PRNT("dma=6 "); break; case CHAN7: outb(0xd6, 0xc3); outb(0xd4, 0x03); aha->aha_dma = 7; - PRNT("dma=7 "); break; default: - printf("illegal dma jumper setting\n"); + printf("aha%d: illegal dma jumper setting\n", unit); return (EIO); } + + PRVERBOSE( ("dma=%d ", aha->aha_dma) ); + switch (conf.intr) { case INT9: aha->aha_int = 9; - PRNT("int=9 "); break; case INT10: aha->aha_int = 10; - PRNT("int=10 "); break; case INT11: aha->aha_int = 11; - PRNT("int=11 "); break; case INT12: aha->aha_int = 12; - PRNT("int=12 "); break; case INT14: aha->aha_int = 14; - PRNT("int=14 "); break; case INT15: aha->aha_int = 15; - PRNT("int=15 "); break; default: - printf("illegal int jumper setting\n"); + printf("aha%d: illegal int jumper setting\n", unit); return (EIO); } + PRVERBOSE( ("int=%d ", aha->aha_int) ); + /* who are we on the scsi bus? */ aha->aha_scsi_dev = conf.scsi_dev; + PRVERBOSE( ("id=%d ", aha->aha_scsi_dev) ); + /* * Change the bus on/off times to not clash with other dma users. */ @@ -1205,7 +1231,7 @@ return (EIO); } #else - printf (" (bus speed defaulted)\n"); + PRVERBOSE( (" (bus speed defaulted)\n") ); #endif /*TUNE_1542*/ /* * Initialize mail box -- cheers, J"org joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE Never trust an operating system you don't have sources for. ;-)