Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/ic Clean up some issues wrt loaded f/w vs. resident ...
details: https://anonhg.NetBSD.org/src/rev/6febc83cd5ea
branches: trunk
changeset: 514583:6febc83cd5ea
user: mjacob <mjacob%NetBSD.org@localhost>
date: Wed Sep 05 23:05:20 2001 +0000
description:
Clean up some issues wrt loaded f/w vs. resident f/w. We can tell
attributes of some variants of FC f/w (SCCLUN or not). Fake f/w
rev for SBus cards- the f/w versions we're using don't return
version in outgoing mailbox registers like they should.
diffstat:
sys/dev/ic/isp.c | 117 +++++++++++++++++++++++++++++++++++-------------------
1 files changed, 76 insertions(+), 41 deletions(-)
diffs (250 lines):
diff -r 13e29d8785a7 -r 6febc83cd5ea sys/dev/ic/isp.c
--- a/sys/dev/ic/isp.c Wed Sep 05 22:32:38 2001 +0000
+++ b/sys/dev/ic/isp.c Wed Sep 05 23:05:20 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: isp.c,v 1.79 2001/09/01 07:12:23 mjacob Exp $ */
+/* $NetBSD: isp.c,v 1.80 2001/09/05 23:05:20 mjacob Exp $ */
/*
* This driver, which is contained in NetBSD in the files:
*
@@ -92,8 +92,6 @@
/*
* Local static data
*/
-static const char warnlun[] =
- "WARNING- cannot determine Expanded LUN capability- limiting to one LUN";
static const char portshift[] =
"Target %d Loop ID 0x%x (Port 0x%x) => Loop 0x%x (Port 0x%x)";
static const char portdup[] =
@@ -189,7 +187,6 @@
isp->isp_state = ISP_NILSTATE;
-
/*
* Basic types (SCSI, FibreChannel and PCI or SBus)
* have been set in the MD code. We figure out more
@@ -212,7 +209,13 @@
/*
* First see whether or not we're sitting in the ISP PROM.
* If we've just been reset, we'll have the string "ISP "
- * spread through outgoing mailbox registers 1-3.
+ * spread through outgoing mailbox registers 1-3. We do
+ * this for PCI cards because otherwise we really don't
+ * know what state the card is in and we could hang if
+ * we try this command otherwise.
+ *
+ * For SBus cards, we just do this because they almost
+ * certainly will be running firmware by now.
*/
if (ISP_READ(isp, OUTMAILBOX1) != 0x4953 ||
ISP_READ(isp, OUTMAILBOX2) != 0x5020 ||
@@ -222,10 +225,7 @@
*/
ISP_WRITE(isp, HCCR, HCCR_CMD_RELEASE);
mbs.param[0] = MBOX_ABOUT_FIRMWARE;
- isp_mboxcmd(isp, &mbs, MBOX_COMMAND_ERROR);
- /*
- * This *shouldn't* fail.....
- */
+ isp_mboxcmd(isp, &mbs, MBLOGNONE);
if (mbs.param[0] == MBOX_COMMAND_COMPLETE) {
isp->isp_romfw_rev[0] = mbs.param[1];
isp->isp_romfw_rev[1] = mbs.param[2];
@@ -236,14 +236,22 @@
}
DISABLE_INTS(isp);
+
/*
* Set up default request/response queue in-pointer/out-pointer
* register indices.
*/
- isp->isp_rqstinrp = INMAILBOX4;
- isp->isp_rqstoutrp = OUTMAILBOX4;
- isp->isp_respinrp = OUTMAILBOX5;
- isp->isp_respoutrp = INMAILBOX5;
+ if (IS_2300(isp)) {
+ isp->isp_rqstinrp = BIU_REQINP;
+ isp->isp_rqstoutrp = BIU_REQOUTP;
+ isp->isp_respinrp = BIU_RSPINP;
+ isp->isp_respoutrp = BIU_RSPOUTP;
+ } else {
+ isp->isp_rqstinrp = INMAILBOX4;
+ isp->isp_rqstoutrp = OUTMAILBOX4;
+ isp->isp_respinrp = OUTMAILBOX5;
+ isp->isp_respoutrp = INMAILBOX5;
+ }
/*
* Put the board into PAUSE mode (so we can read the SXP registers
@@ -260,10 +268,6 @@
btype = "2200";
break;
case ISP_HA_FC_2300:
- isp->isp_rqstinrp = BIU_REQINP;
- isp->isp_rqstoutrp = BIU_REQOUTP;
- isp->isp_respinrp = BIU_RSPINP;
- isp->isp_respoutrp = BIU_RSPOUTP;
btype = "2300";
break;
default:
@@ -703,22 +707,52 @@
if (mbs.param[0] != MBOX_COMMAND_COMPLETE) {
return;
}
+
+ /*
+ * The SBus firmware that we are using apparently does not return
+ * major, minor, micro revisions in the mailbox registers, which
+ * is really, really, annoying.
+ */
+ if (isp->isp_bustype == ISP_BT_SBUS) {
+ if (dodnld) {
+#ifdef ISP_TARGET_MODE
+ isp->isp_fwrev[0] = 7;
+ isp->isp_fwrev[1] = 55;
+#else
+ isp->isp_fwrev[0] = 1;
+ isp->isp_fwrev[1] = 37;
+#endif
+ isp->isp_fwrev[2] = 0;
+ }
+ } else {
+ isp->isp_fwrev[0] = mbs.param[1];
+ isp->isp_fwrev[1] = mbs.param[2];
+ isp->isp_fwrev[2] = mbs.param[3];
+ }
isp_prt(isp, ISP_LOGCONFIG,
"Board Type %s, Chip Revision 0x%x, %s F/W Revision %d.%d.%d",
btype, isp->isp_revision, dodnld? "loaded" : "resident",
- mbs.param[1], mbs.param[2], mbs.param[3]);
+ isp->isp_fwrev[0], isp->isp_fwrev[1], isp->isp_fwrev[2]);
+
if (IS_FC(isp)) {
- isp_prt(isp, ISP_LOGCONFIG, "Firmware Attributes = 0x%x",
- mbs.param[6]);
+ /*
+ * We do not believe firmware attributes for 2100 code less
+ * than 1.17.0.
+ */
+ if (IS_2100(isp) &&
+ (ISP_FW_REVX(isp->isp_fwrev) < ISP_FW_REV(1, 17, 0))) {
+ FCPARAM(isp)->isp_fwattr = 0;
+ } else {
+ FCPARAM(isp)->isp_fwattr = mbs.param[6];
+ isp_prt(isp, ISP_LOGDEBUG0,
+ "Firmware Attributes = 0x%x", mbs.param[6]);
+ }
if (ISP_READ(isp, BIU2100_CSR) & BIU2100_PCI64) {
isp_prt(isp, ISP_LOGCONFIG,
"Installed in 64-Bit PCI slot");
}
}
- isp->isp_fwrev[0] = mbs.param[1];
- isp->isp_fwrev[1] = mbs.param[2];
- isp->isp_fwrev[2] = mbs.param[3];
if (isp->isp_romfw_rev[0] || isp->isp_romfw_rev[1] ||
isp->isp_romfw_rev[2]) {
isp_prt(isp, ISP_LOGCONFIG, "Last F/W revision was %d.%d.%d",
@@ -748,15 +782,15 @@
/*
* Okay- now that we have new firmware running, we now (re)set our
* notion of how many luns we support. This is somewhat tricky because
- * if we haven't loaded firmware, we don't have an easy way of telling
- * how many luns we support.
- *
- * We'll make a simplifying assumption- if we loaded firmware, we
- * are running with expanded lun firmware, otherwise not.
+ * if we haven't loaded firmware, we sometimes do not have an easy way
+ * of knowing how many luns we support.
*
* Expanded lun firmware gives you 32 luns for SCSI cards and
* 65536 luns for Fibre Channel cards.
*
+ * It turns out that even for QLogic 2100s with ROM 1.10 and above
+ * we do get a firmware attributes word returned in mailbox register 6.
+ *
* Because the lun is in a a different position in the Request Queue
* Entry structure for Fibre Channel with expanded lun firmware, we
* can only support one lun (lun zero) when we don't know what kind
@@ -767,18 +801,17 @@
* and released.
*/
if (touched == 0) {
- if (dodnld) {
- if (IS_SCSI(isp)) {
+ if (IS_SCSI(isp)) {
+ if (dodnld) {
isp->isp_maxluns = 32;
} else {
- isp->isp_maxluns = 65536;
+ isp->isp_maxluns = 8;
}
} else {
- if (IS_SCSI(isp)) {
- isp->isp_maxluns = 8;
+ if (FCPARAM(isp)->isp_fwattr & ISP_FW_ATTR_SCCLUN) {
+ isp->isp_maxluns = 65536;
} else {
- isp_prt(isp, ISP_LOGALL, warnlun);
- isp->isp_maxluns = 1;
+ isp->isp_maxluns = 16;
}
}
}
@@ -1221,7 +1254,8 @@
}
}
- if (IS_2200(isp) || IS_2300(isp)) {
+ if ((IS_2200(isp) && ISP_FW_REVX(isp->isp_fwrev) >=
+ ISP_FW_REV(2, 1, 26)) || IS_2300(isp)) {
/*
* Turn on LIP F8 async event (1)
* Turn on generate AE 8013 on all LIP Resets (2)
@@ -2706,7 +2740,7 @@
reqp->req_lun_trn = XS_LUN(xs);
reqp->req_cdblen = XS_CDBLEN(xs);
} else {
- if (isp->isp_maxluns > 16)
+ if (FCPARAM(isp)->isp_fwattr & ISP_FW_ATTR_SCCLUN)
t2reqp->req_scclun = XS_LUN(xs);
else
t2reqp->req_lun_trn = XS_LUN(xs);
@@ -2829,7 +2863,7 @@
bus = XS_CHANNEL(xs);
mbs.param[0] = MBOX_ABORT;
if (IS_FC(isp)) {
- if (isp->isp_maxluns > 16) {
+ if (FCPARAM(isp)->isp_fwattr & ISP_FW_ATTR_SCCLUN) {
mbs.param[1] = tgt << 8;
mbs.param[4] = 0;
mbs.param[5] = 0;
@@ -4009,7 +4043,7 @@
ISPOPMAP(0x03, 0x07), /* 0x05: MBOX_READ_RAM_WORD */
ISPOPMAP(0x3f, 0x3f), /* 0x06: MBOX_MAILBOX_REG_TEST */
ISPOPMAP(0x03, 0x07), /* 0x07: MBOX_VERIFY_CHECKSUM */
- ISPOPMAP(0x01, 0x4f), /* 0x08: MBOX_ABOUT_FIRMWARE */
+ ISPOPMAP(0x01, 0x0f), /* 0x08: MBOX_ABOUT_FIRMWARE */
ISPOPMAP(0x00, 0x00), /* 0x09: */
ISPOPMAP(0x00, 0x00), /* 0x0a: */
ISPOPMAP(0x00, 0x00), /* 0x0b: */
@@ -4205,7 +4239,7 @@
ISPOPMAP(0x03, 0x07), /* 0x05: MBOX_READ_RAM_WORD */
ISPOPMAP(0xff, 0xff), /* 0x06: MBOX_MAILBOX_REG_TEST */
ISPOPMAP(0x03, 0x05), /* 0x07: MBOX_VERIFY_CHECKSUM */
- ISPOPMAP(0x01, 0x0f), /* 0x08: MBOX_ABOUT_FIRMWARE */
+ ISPOPMAP(0x01, 0x4f), /* 0x08: MBOX_ABOUT_FIRMWARE */
ISPOPMAP(0xdf, 0x01), /* 0x09: LOAD RAM */
ISPOPMAP(0xdf, 0x01), /* 0x0a: DUMP RAM */
ISPOPMAP(0x00, 0x00), /* 0x0b: */
@@ -5517,5 +5551,6 @@
ISP2100_NVRAM_EXECUTION_THROTTLE(nvram_data);
fcp->isp_fwoptions = ISP2100_NVRAM_OPTIONS(nvram_data);
isp_prt(isp, ISP_LOGDEBUG0,
- "fwoptions from nvram are 0x%x", fcp->isp_fwoptions);
+ "NVRAM: maxfrmlen %d execthrottle %d fwoptions 0x%x",
+ fcp->isp_maxfrmlen, fcp->isp_execthrottle, fcp->isp_fwoptions);
}
Home |
Main Index |
Thread Index |
Old Index