Skip to content

Commit

Permalink
isp(4): Rework firmware handling/loading
Browse files Browse the repository at this point in the history
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:	freebsd/freebsd-src#877
MFC after:	1 month
Sponsored by:	Technical University of Munich
  • Loading branch information
jpulz authored and bsdjhb committed Mar 13, 2024
2 parents b8ff939 + 10ed63f commit 49b3354
Show file tree
Hide file tree
Showing 8 changed files with 1,002 additions and 258 deletions.
21 changes: 16 additions & 5 deletions share/man/man4/isp.4
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
.Dd April 25, 2023
.Dd October 27, 2023
.Dt ISP 4
.Os
.Sh NAME
Expand Down Expand Up @@ -80,12 +80,15 @@ FC-Tape is automatically enabled when connecting controller that supports
it to a target that supports it.
It may be disabled using configuration and hint options described below.
.Sh FIRMWARE
Firmware loading is supported if the
Firmware loading is supported and handled by
.Xr firmware 9 .
The correct firmware is either loaded automatically, if available for this
type of adapter, or by manually loading the
.Xr ispfw 4
module is loaded.
module.
It is strongly recommended that you use the firmware available from
.Xr ispfw 4
as it is the most likely to have been tested with this driver.
as it is the one that most likely has been tested with this driver.
.Sh HARDWARE
Cards supported by the
.Nm
Expand Down Expand Up @@ -136,7 +139,7 @@ Limit on number of Message Signaled Interrupts (MSI) to be used.
.It Va hint.isp. Ns Ar N Ns Va .msix
Limit on number of Extended Message Signaled Interrupts (MSI-X) to be used.
.It Va hint.isp. Ns Ar N Ns Va .fwload_disable
A hint value to disable loading of firmware
A hint value to disable loading of firmware provided by
.Xr ispfw 4 .
.It Va hint.isp. Ns Ar N Ns Va .ignore_nvram
A hint value to ignore board NVRAM settings for.
Expand Down Expand Up @@ -210,6 +213,14 @@ The default is 1 (enabled).
This is the readonly World Wide Node Name value for this port.
.It Va dev.isp. Ns Ar N Ns Va .wwpn
This is the readonly World Wide Port Name value for this port.
.It Va dev.isp. Ns Ar N Ns Va .fw_version_flash
The readonly flash firmware version value in the active region of the
controller.
.It Va dev.isp. Ns Ar N Ns Va .fw_version_ispfw
The readonly firmware version value provided by
.Xr ispfw 4 .
.It Va dev.isp. Ns Ar N Ns Va .fw_version_run
The readonly firmware version value currently executed on the controller.
.El
.Sh SEE ALSO
.Xr da 4 ,
Expand Down
Loading

0 comments on commit 49b3354

Please sign in to comment.