History log of /freebsd-current/sys/dev/isp/ispreg.h
Revision Date Author Comments
# 10ed63fc 27-Oct-2023 Joerg Pulz <Joerg.Pulz@frm2.tum.de>

isp(4): Rework firmware handling/loading

Correctly identify the active firmware in flash on adapters with
primary and secondary firmware region in flash.
Correctly identify the active NVRAM on adapters with primary
and secondary NVRAM region in flash.

Loading ispfw(4) moved from isp_pci_attach() to isp_reset().
Drop the reference to ispfw(4) after using it so one can kldunload(8) it.
New isp_load_ram() function to load either ispfw(4) or flash firmware
into RISC's RAM.
New functions to read data from flash. The old ones will be removed later.
A bunch of new helper functions to identify and validate active flash
regions for firmware, auxiliary and NVRAM.
Overhaul ISP_FW_* macros and make use of it when comparing firmware
versions. We can handle firmware versions up to 255.255.255.

Firmware load priority slightly changed:
For 27xx and newer adapters:
- load ispfw(4) firmware
- request (active) flash firmware information
- compare version numbers of ispfw(4) and flash firmware
- load firmware with highest version into RISC's RAM
- if loading ispfw(4) is disabled or failed - load firmware from flash
- if everything else fails use MBOX_LOAD_FLASH_FIRMWARE as fallback

For 26xx and older adapters nothing changed:
- load ispfw(4) firmware and load it into RISC's RAM
- if loading ispfw(4) is disabled or failed use MBOX_EXEC_FIRMWARE
- for 26xx a preceding MBOX_LOAD_FLASH_FIRMWARE is used

New read only sysctl(8)'s:
dev.isp.N.fw_version_run: the firmware version actually running
dev.isp.N.fw_version_ispfw: the firmware version provided by ispfw(4)
dev.isp.N.fw_version_flash: the (active) firmware version in flash

While here:
- firmware attribute handling/parsing reworked
+ renamed defines from ISP2400_FW_ATTR_* to ISP_FW_ATTR_*
+ changed values to match new handling/parsing
+ added some more attributes
- enable FLT support on 26xx based adapters
- log level adjustments
- new function return status codes (some for now, some for later use)
- some minor style changes

Tested and approved to work on real hardware with:
- Qlogic ISP 2532 (QLogic QLE2560 8Gb FC Adapter)
- Qlogic ISP 2031 (QLogic QLE2662 16Gbit 2Port FC Adapter)
- Qlogic ISP 2722 (QLogic QLE2690 16Gb FC Adapter)
- Qlogic ISP 2812 (QLogic QLE2772 32Gbit 2Port FC Adapter)

PR: 273263
Reviewed by: mav
Pull Request: https://github.com/freebsd/freebsd-src/pull/877
MFC after: 1 month
Sponsored by: Technical University of Munich


# 71625ec9 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

sys: Remove $FreeBSD$: one-line .c comment pattern

Remove /^/[*/]\s*\$FreeBSD\$.*\n/


# 348ec8dc 07-Jul-2023 Joerg Pulz <Joerg.Pulz@frm2.tum.de>

isp(4): Style changes

Please tools/build/checkstyle9.pl as mentioned by imp@

PR: 271062
Reviewed by: imp, mav
Sponsored by: Technical University of Munich
Pull Request: https://github.com/freebsd/freebsd-src/pull/726


# 707e4d1b 07-Jul-2023 Joerg Pulz <Joerg.Pulz@frm2.tum.de>

isp(4): Use the FLT on all supported controllers

The ISP26xx based HBAs are left as is for now with static NVRAM addressing.
Those HBAs are known as 83xx (2031 and 8031 for real) and need special handling.
This is left for further investigation for now.

Cosmetics:
- rename functions and defines as they are no longer specific to 28xx
- set reasonable log levels
- sort FLT and NVRAM functions (in the order they are used)

Tested and approved to work on real hardware with:
- Qlogic ISP 2532 (QLogic QLE2562 8Gb 2Port FC Adapter)
- Qlogic ISP 2722 (QLogic QLE2690 16Gb FC Adapter)
- Qlogic ISP 2812 (QLogic QLE2772 32Gbit 2Port FC Adapter)

PR: 271062
Reviewed by: imp, mav
Sponsored by: Technical University of Munich
Pull Request: https://github.com/freebsd/freebsd-src/pull/726


# 27b4a1b7 07-Jul-2023 Joerg Pulz <Joerg.Pulz@frm2.tum.de>

isp(4): Add support to read contents of the FLT (flash layout table)

The FLT is like a TOC for the flash area and contains entries for every flash
region with start/end address, size and flags.
Start using NVRAM addresses from FLT instead of hardcoded ones for ISP28xx
based HBAs.

The FLT should be available on earlier HBAs too, probably since ISP24xx based.
This needs further investigation and testing.

PR: 271062
Reviewed by: imp, mav
Sponsored by: Technical University of Munich
Pull Request: https://github.com/freebsd/freebsd-src/pull/726


# 4d846d26 10-May-2023 Warner Losh <imp@FreeBSD.org>

spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD

The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.

Discussed with: pfg
MFC After: 3 days
Sponsored by: Netflix


# 483e464e 14-Dec-2021 Alexander Motin <mav@FreeBSD.org>

isp(4): Allow more than 2 ports to read WWNs from NVRAM.

It appears at least on QLE2694L cards 3rd and 4th ports follow the
same NVRAM addressing logic as the first two. In lack of proper
documentation this guess is as good as it can be.

MFC after: 1 week
Sponsored by: iXsystems, Inc.


# c515717a 21-Nov-2020 Alexander Motin <mav@FreeBSD.org>

Remove remnants of execthrottle and maxalloc parameters.

The first was obsolete since 26xx, not used on 25xx and not needed on 24xx.
The second seems never worked on 24xx and up.


# 1b760be4 19-Nov-2020 Alexander Motin <mav@FreeBSD.org>

Remove parallel SCSI and 1/2Gb FC support from isp(4).

This removes 288KB (36%) of the driver code and zillions of hacks and
workarounds, making single driver uniformly support several different
generations of hardware interfaces, not counting minor card variations.
After years of the hopeless fight, I don't think it worth to continue
support for hardware obsolete for 15-20 years. Instead much cleaner
now code should allow to move forward toward better locking, multiple
queues and other cool features.

All the remaining Qlogic cards starting from 4Gb 24xx to 32Gb 27xx use
the same hardware/firmware interface with minor incremental improvements,
so it seems to be a good new starting point. Except one PCI-X model all
all of them are PCIe and so still usable in modern systems.

Discussed with: ken, scottl, jpaetzel, imp
Relnotes: yes


# 718cf2cc 27-Nov-2017 Pedro F. Giffuni <pfg@FreeBSD.org>

sys/dev: further adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.


# 2e6beaf1 29-Oct-2015 Alexander Motin <mav@FreeBSD.org>

Fix and improve error masking and reporting.


# 6ce548a1 23-Oct-2015 Alexander Motin <mav@FreeBSD.org>

Some polishing and unification in ISR code.


# 22629d29 13-Jul-2013 Matt Jacob <mjacob@FreeBSD.org>

When fiddling with options of which registers to copy out for
a mailbox command and which registers to copy back in when
the command completes, the bits being set need to not only
specify what bits you want to add from the default from the
table but also what bits you want *subtract* (mask) from the
default from the table.

A failing ISP2200 command pointed this out.

Much appreciation to: marius, who persisted and narrowed down what
the failure delta was, and shamed me into actually fixing it.
MFC after: 1 week


# ad0ab753 17-Jun-2012 Matt Jacob <mjacob@FreeBSD.org>

Prepare for FC-Tape support. This involved doing a lot of little cleanups
and crosschecks against firmware documentation. We now check and report
FC firmware attributes and at least are now prepared for the upper 48 bits
of f/w attributes (which are probably for the 8100 or later cards). This
involed changing how inbits and outbits are calculated for varios commands,
hopefully clearer and cleaner. This also caused me to clean up the actual
mailbox register usage. Finally, we are now unconditionally using a CRN
for initiator mode.

A longstanding issue with the 2400/2500 is that they do *not* support
a "Prefer PTP followed by loop", which explains why enabling that
caused the f/w to crash.

A slightly more invasive change is to let the firmware load entirely
drive whether multi_id support is enabled or not.

Sponsored by: Spectralogic
MFC after: 1 week


# a7d5f7eb 19-Oct-2010 Jamie Gritton <jamie@FreeBSD.org>

A new jail(8) with a configuration file, to replace the work currently done
by /etc/rc.d/jail.


# 87aa0933 01-Mar-2010 Matt Jacob <mjacob@FreeBSD.org>

MFC of 204397: fix problems with fast posting handles


# 443e752d 26-Feb-2010 Matt Jacob <mjacob@FreeBSD.org>

Revamp the pieces of some of the stuff I forgot to do when shifting to
32 bit handles. The RIO (reduced interrupt operation) and fast posting
for the parallel SCSI cards were all 16 bit handles. Furthermore,
target mode parallel SCSI only can have 16 bit handles.

Use part of a supplied patch to switch over to using 32 bit handles.
Be a bit more conservative here and only do this for parallel SCSI
for the 12160 (Ultra3) cards. There were a lot of marginal Ultra2
cards, and, frankly, few are findable now for testing.

Fix the target handle routine to only do 16 bit handles for parallel
SCSI cards. This is okay because the upper sixteen bits of the new
32 bit handles is a sequence number to help protect against duplicate
completions. This would be very unlikely to happen with parallel
SCSI target mode, and wasn't present before, so we're no worse off
than we used to be.

While we're at it, finally split the async mailbox completion handlers
into FC and parallel SCSI functions. This makes it much cleaner and
easier to figure out what is or isn't a legal async mailbox completion
code for different card classes.

PR: kern/144250
Submitted partially by: Charles D
MFC after: 1 week


# 2df76c16 31-Jul-2009 Matt Jacob <mjacob@FreeBSD.org>

Add 8Gb support (isp_2500). Fix a fair number of configuration and
firmware loading bugs.

Target mode support has received some serious attention to make it
more usable and stable.

Some backward compatible additions to CAM have been made that make
target mode async events easier to deal with have also been put
into place.

Further refinement and better support for NP-IV (N-port Virtualization)
is now in place.

Code for release prior to RELENG_7 has been stripped away for code clarity.

Sponsored by: Copan Systems

Reviewed by: scottl, ken, jung-uk kim
Approved by: re


# d7f03759 19-Oct-2008 Ulf Lilleengen <lulf@FreeBSD.org>

- Import the HEAD csup code which is the basis for the cvsmode work.


# e48b2487 09-Mar-2007 Matt Jacob <mjacob@FreeBSD.org>

Fix some stupid copyright mistakes that have been there for quite some time.


# af4394d4 23-Feb-2007 Matt Jacob <mjacob@FreeBSD.org>

Don't attempt to load illegal hard loop addresses into
an ICB. This shows up on card restarts, and usually for
2200-2300 cards. What happens is that we start up,
attempting to acquire a hard address. We end up instead
being an F-port topology, which reports out a loop id
of 0xff (or 0xffff for 2K Login f/w). Then, if we restart,
we end up telling the card to go off an acquire this loop
address, which the card then rejects. Bah.

Compilation fixes from Solaris port.


# 10365e5a 01-Nov-2006 Matt Jacob <mjacob@FreeBSD.org>

Add 4Gb (24XX) support and lay the foundation for a lot of new stuff.


# 8a97c03a 03-Jul-2006 Matt Jacob <mjacob@FreeBSD.org>

Do various fixes to support firmware loading for the 2322
(and by extension, the 2422).

One peculiar thing I've found with the 2322 is that if you
don't force it to do Hard LoopID acquisition, the firmware
crashes. This took a while to figure out.

While we're at it, fix various bugs having to do with NVRAM
reading and option setting with respect to pieces of NVRAM.


# 1dae40eb 14-Feb-2006 Matt Jacob <mjacob@FreeBSD.org>

a) clean up some declaration stuff (i.e., make more modern with respect
to getting rid u_int for uint and so on).

b) Turn back on 64 bit DAC support. Cheeze it a bit in that we have two
DMA callback functions- one when we have bus_addr_t > 4 bits in width and
the other which should be normal. Even Cheezier in that we turn off setting
up DMA maps to be BUS_SPACE_MAXADDR if we're in ISP_TARGET_MODE. More work
on this in a week or so.

c) Tested under amd64 and 1MB DFLTPHYS, sparc64, i386 (PAE, but insufficient
memory to really test > 4GB). LINT check under amd64.

MFC after: 1 month


# e5265237 22-Jan-2006 Matt Jacob <mjacob@FreeBSD.org>

First of several commits as this driver is dusted off and maybe brought
up to date. Principle changes for this reelase is to support 2K Port Login
firmware. This allows us to support the 2322 (and 2422 4Gb) cards which only
come with the 2K Port Login firmware. The 2322 should now work- but we don't
have firmware sets for it in ispfw (as the change to load 2K Port Login f/w
hasn't been made- that f/w is so big it has to be loaded in more than one
chunk).

Other changes are the beginnings of cleaning up some long standing target
mode issues. The next changes here will incorporate a lot of bug fixes
from others.

Finally, some copyright cleanup and attempts to make the parts of the
driver that are FreeBSD specific start conforming more to FreeBSD style.

MFC after: 1 month


# 098ca2bd 05-Jan-2005 Warner Losh <imp@FreeBSD.org>

Start each of the license/copyright comments with /*-, minor shuffle of lines


# b8941882 16-Feb-2002 Matt Jacob <mjacob@FreeBSD.org>

Support for f/w crash dumps (2200 && 23XX).

If you want QLogic to look at a potential f/w problem for FC cards, you really
have to provide them info in the format they expect. This involves dumping
a lot of hardware registers (> 300 16 bit registers) and a lot of SRAM
(> 128KB minimum). Thus all of this code is #ifdef protected which will
become an option so that the memory allocation of where to dump the crash
image is pretty expensive. It's worth it if you have a reproducible problem
because they have some tools that can tell them, given the f/w version,
the precise state of everything.

MFC after: 1 week


# 75c1e828 04-Feb-2002 Matt Jacob <mjacob@FreeBSD.org>

+ A variety of 23XX changes:
disable MWI on 2300

based on function code, set an 'isp_port' for the 2312- it's a
separate instance, but the NVRAM is shared, and the second port's
NVRAM is at offset 256.

+ Enable RIO operation for LVD SCSI cards. This makes a *big* difference
as even under reasonable load we get batched completions of about 30
commands at a time on, say, an ISP1080.

+ Do 'continuation' mailbox commands- this allows us to specify a work
area within the softc and 'continue' repeated mailbox commands. This is
more or less on an ad hoc basis and is currently only used for firmware
loading (which f/w now loads substantially faster becuase the calling
thread is only woken when all the f/w words are loaded- not for each
one of the 40000 f/w words that gets loaded).

+ If we're about to return from isp_intr with a 'bogus interrupt' indication,
and we're not a 23XX card, check to see whether the semaphore register is
currently *2* (not *1* as it should be) and whether there's an async completion
sitting in outgoing mailbox0. This seems to capture cases of lost fast posting
and RIO interrupts that the 12160 && 1080 have been known to pump out under
extreme load (extreme, as in > 250 active commands).

+ FC_SCRATCH_ACQUIRE/FC_SCRATCH_RELEASE macros.

+ Endian correct swizzle/unswizzle of an ATIO2 that has a WWPN in it.

MFC after: 1 week


# 126ec864 31-Aug-2001 Matt Jacob <mjacob@FreeBSD.org>

Add 2 Gigabit Fibre Channel support (2300 && 2312 cards). This required
some reworking (and consequent cleanup) of the interrupt service code.

Also begin to start a cleanup of target mode support that will (eventually)
not require more inforamtion routed with the ATIO to come back with the
CTIO other than tag.

MFC after: 4 weeks


# 144ff119 15-Jan-2001 Matt Jacob <mjacob@FreeBSD.org>

Put in offset definitions for FPM and FBM registers, plus just enough
bits defined so we can reset them.


# aa57fd6f 21-Sep-2000 Matt Jacob <mjacob@FreeBSD.org>

some copyright cleanups


# a6db0ba6 01-Aug-2000 Matt Jacob <mjacob@FreeBSD.org>

Add in lengths of SBus or PCI registers.


# 40e88de6 27-Jun-2000 Matt Jacob <mjacob@FreeBSD.org>

Add mailbox bitmask macros (numbers of available mailbox registers
based upon Qlogic chip type). Define maximum mailboxes. Add INT_PENDING_MASK
macro. Change mailbox offset macro name.


# 22e83dac 17-Jun-2000 Matt Jacob <mjacob@FreeBSD.org>

cleanup i_int_X vs. uint_X definitions


# a96d513d 08-May-2000 Matt Jacob <mjacob@FreeBSD.org>

The storage for WWN from NVRAM is actually the PORT WWN, not the NODE WWN.


# c211f23b 11-Feb-2000 Matt Jacob <mjacob@FreeBSD.org>

Add in 12160 (Ultra3) NVRAM definitions.

Approved: jkh@freebsd.org


# 22e1dc85 15-Dec-1999 Matt Jacob <mjacob@FreeBSD.org>

Add Dual LVD bus (1280) support


# b996239f 17-Oct-1999 Matt Jacob <mjacob@FreeBSD.org>

add in an INT_PENDING macro


# c3aac50f 27-Aug-1999 Peter Wemm <peter@FreeBSD.org>

$Id$ -> $FreeBSD$


# 981e6b25 10-May-1999 Matt Jacob <mjacob@FreeBSD.org>

Clean up some macros. Add in ISP 1080/1240 NVRAM layout definitions.


# 4394c92f 25-Mar-1999 Matt Jacob <mjacob@FreeBSD.org>

Add in 1080 LVD support and some basis also for the 1240. The port database
printout is now enabled.


# 57c801f5 16-Mar-1999 Matt Jacob <mjacob@FreeBSD.org>

A wad of changes- prepping for 1080/1240 support (which caused a massive
thwank in register layout goop). A different mboxcmd approach. Some PDB change
infrastructure. Some better management of loopdown/loopup events (keep them
distinct from resource starvation for simq freeze/unfreeze actions).


# 68ce4ba5 08-Feb-1999 Matt Jacob <mjacob@FreeBSD.org>

clean up some NVRAM defines


# cbf57b47 30-Jan-1999 Matt Jacob <mjacob@FreeBSD.org>

Implement and use Fast Posting for both parallel && fibre. Redo a bit of
the startup code. Implement a call to outer framework function so that
asynchronous events can be handled (e.g., speed negotiation, target mode).

Roll internal release tags.


# c3055363 28-Dec-1998 Matt Jacob <mjacob@FreeBSD.org>

clarify headers;move uninit to outer layer;remove watchdog


# f1535c02 04-Dec-1998 Matt Jacob <mjacob@FreeBSD.org>

offset was wrong for HARDLOOPID in NVRAM


# 478f8a96 15-Sep-1998 Justin T. Gibbs <gibbs@FreeBSD.org>

Update QLogic ISP support for CAM. Add preliminary target mode support.

Submitted by: Matthew Jacob <mjacob@feral.com>


# 6054c3f6 22-Apr-1998 Matt Jacob <mjacob@FreeBSD.org>

Add support for the Qlogic ISP SCSI && FC/AL Adapters