aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/isp/ispreg.h
Commit message (Collapse)AuthorAgeFilesLines
* isp(4): Rework firmware handling/loadingJoerg Pulz2023-12-281-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* sys: Remove $FreeBSD$: one-line .c comment patternWarner Losh2023-08-161-1/+0
| | | | Remove /^/[*/]\s*\$FreeBSD\$.*\n/
* isp(4): Style changesJoerg Pulz2023-07-071-2/+2
| | | | | | | | | 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
* isp(4): Use the FLT on all supported controllersJoerg Pulz2023-07-071-9/+20
| | | | | | | | | | | | | | | | | | | | | 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
* isp(4): Add support to read contents of the FLT (flash layout table)Joerg Pulz2023-07-071-0/+81
| | | | | | | | | | | | | | | 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
* spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh2023-05-121-1/+1
| | | | | | | | | 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
* isp(4): Allow more than 2 ports to read WWNs from NVRAM.Alexander Motin2021-12-141-2/+1
| | | | | | | | | 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.
* Remove remnants of execthrottle and maxalloc parameters.Alexander Motin2020-11-221-2/+0
| | | | | | | | The first was obsolete since 26xx, not used on 25xx and not needed on 24xx. The second seems never worked on 24xx and up. Notes: svn path=/head/; revision=367924
* Remove parallel SCSI and 1/2Gb FC support from isp(4).Alexander Motin2020-11-201-939/+20
| | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=367857
* sys/dev: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-271-0/+2
| | | | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=326255
* Fix and improve error masking and reporting.Alexander Motin2015-10-291-4/+2
| | | | Notes: svn path=/head/; revision=290147
* Some polishing and unification in ISR code.Alexander Motin2015-10-231-20/+5
| | | | Notes: svn path=/head/; revision=289812
* When fiddling with options of which registers to copy out forMatt Jacob2013-07-131-2/+6
| | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=253330
* Prepare for FC-Tape support. This involved doing a lot of little cleanupsMatt Jacob2012-06-171-12/+7
| | | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=237210
* Revamp the pieces of some of the stuff I forgot to do when shifting toMatt Jacob2010-02-271-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=204397
* Add 8Gb support (isp_2500). Fix a fair number of configuration andMatt Jacob2009-08-011-6/+19
| | | | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=196008
* Fix some stupid copyright mistakes that have been there for quite some time.Matt Jacob2007-03-101-24/+26
| | | | Notes: svn path=/head/; revision=167403
* Don't attempt to load illegal hard loop addresses intoMatt Jacob2007-02-231-8/+8
| | | | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=166929
* Add 4Gb (24XX) support and lay the foundation for a lot of new stuff.Matt Jacob2006-11-021-24/+167
| | | | Notes: svn path=/head/; revision=163899
* Do various fixes to support firmware loading for the 2322Matt Jacob2006-07-031-6/+19
| | | | | | | | | | | | | | (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. Notes: svn path=/head/; revision=160080
* a) clean up some declaration stuff (i.e., make more modern with respectMatt Jacob2006-02-151-50/+50
| | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=155704
* First of several commits as this driver is dusted off and maybe broughtMatt Jacob2006-01-231-4/+15
| | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=154704
* Start each of the license/copyright comments with /*-, minor shuffle of linesWarner Losh2005-01-061-1/+1
| | | | Notes: svn path=/head/; revision=139749
* Support for f/w crash dumps (2200 && 23XX).Matt Jacob2002-02-171-0/+22
| | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=90754
* + A variety of 23XX changes:Matt Jacob2002-02-041-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=90224
* Add 2 Gigabit Fibre Channel support (2300 && 2312 cards). This requiredMatt Jacob2001-08-311-0/+32
| | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=82689
* Put in offset definitions for FPM and FBM registers, plus just enoughMatt Jacob2001-01-151-0/+17
| | | | | | | bits defined so we can reset them. Notes: svn path=/head/; revision=71078
* some copyright cleanupsMatt Jacob2000-09-211-6/+2
| | | | Notes: svn path=/head/; revision=66189
* Add in lengths of SBus or PCI registers.Matt Jacob2000-08-011-0/+3
| | | | Notes: svn path=/head/; revision=64088
* Add mailbox bitmask macros (numbers of available mailbox registersMatt Jacob2000-06-271-1/+9
| | | | | | | | based upon Qlogic chip type). Define maximum mailboxes. Add INT_PENDING_MASK macro. Change mailbox offset macro name. Notes: svn path=/head/; revision=62170
* cleanup i_int_X vs. uint_X definitionsMatt Jacob2000-06-181-16/+16
| | | | Notes: svn path=/head/; revision=61769
* The storage for WWN from NVRAM is actually the PORT WWN, not the NODE WWN.Matt Jacob2000-05-091-1/+12
| | | | Notes: svn path=/head/; revision=60218
* Add in 12160 (Ultra3) NVRAM definitions.Matt Jacob2000-02-111-2/+76
| | | | | | | Approved: jkh@freebsd.org Notes: svn path=/head/; revision=57148
* Add Dual LVD bus (1280) supportMatt Jacob1999-12-161-89/+93
| | | | Notes: svn path=/head/; revision=54671
* add in an INT_PENDING macroMatt Jacob1999-10-171-1/+2
| | | | Notes: svn path=/head/; revision=52346
* $Id$ -> $FreeBSD$Peter Wemm1999-08-281-1/+1
| | | | Notes: svn path=/head/; revision=50477
* Clean up some macros. Add in ISP 1080/1240 NVRAM layout definitions.Matt Jacob1999-05-111-8/+128
| | | | Notes: svn path=/head/; revision=46967
* Add in 1080 LVD support and some basis also for the 1240. The port databaseMatt Jacob1999-03-251-10/+21
| | | | | | | printout is now enabled. Notes: svn path=/head/; revision=45040
* A wad of changes- prepping for 1080/1240 support (which caused a massiveMatt Jacob1999-03-171-34/+54
| | | | | | | | | 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). Notes: svn path=/head/; revision=44819
* clean up some NVRAM definesMatt Jacob1999-02-091-9/+5
| | | | Notes: svn path=/head/; revision=43792
* Implement and use Fast Posting for both parallel && fibre. Redo a bit ofMatt Jacob1999-01-301-2/+3
| | | | | | | | | | 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. Notes: svn path=/head/; revision=43420
* clarify headers;move uninit to outer layer;remove watchdogMatt Jacob1998-12-281-2/+2
| | | | Notes: svn path=/head/; revision=42131
* offset was wrong for HARDLOOPID in NVRAMMatt Jacob1998-12-051-2/+3
| | | | Notes: svn path=/head/; revision=41518
* Update QLogic ISP support for CAM. Add preliminary target mode support.Justin T. Gibbs1998-09-151-26/+130
| | | | | | | Submitted by: Matthew Jacob <mjacob@feral.com> Notes: svn path=/head/; revision=39235
* Add support for the Qlogic ISP SCSI && FC/AL AdaptersMatt Jacob1998-04-221-0/+589
Notes: svn path=/head/; revision=35388