freebsd-src/share
Joerg Pulz 10ed63fc06 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
2023-12-28 13:33:07 -05:00
..
colldef Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
colldef_unicode Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
ctypedef Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
dict share: Remove ancient SCCS tags. 2023-11-26 22:23:29 -07:00
doc share: Remove ancient SCCS tags. 2023-11-26 22:23:29 -07:00
dtrace Remove $FreeBSD$: one-line bare tag 2023-08-16 11:55:20 -06:00
examples Silence snprintf truncation warnings in printf_test examples 2023-12-21 23:45:52 +01:00
i18n Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
keys Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
man isp(4): Rework firmware handling/loading 2023-12-28 13:33:07 -05:00
misc update homepage for FreeBSD Manual Pages (again) 2023-12-28 07:11:38 +00:00
mk <bsd.progs.mk>: Allow using SRCS for common sources 2023-12-27 17:01:39 -07:00
monetdef Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
monetdef_unicode Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
msgdef msgdef: fix NO and SI locales 2023-09-21 12:54:21 +02:00
msgdef_unicode Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
numericdef Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
numericdef_unicode Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
security Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
sendmail Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
skel share: Remove ancient SCCS tags. 2023-11-26 22:23:29 -07:00
snmp Remove $FreeBSD$: two-line lua tag 2023-08-16 11:55:30 -06:00
syscons Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
tabset share: Remove ancient SCCS tags. 2023-11-26 22:23:29 -07:00
termcap share: Remove ancient SCCS tags. 2023-11-26 22:23:29 -07:00
tests Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
timedef Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
vt Trim various $FreeBSD$ 2023-10-10 10:34:43 -07:00
zoneinfo Fix share/zoneinfo for DIRDEPS_BUILD 2023-11-20 12:52:43 -08:00
Makefile share: Remove ancient SCCS tags. 2023-11-26 22:23:29 -07:00
Makefile.inc share: Remove ancient SCCS tags. 2023-11-26 22:23:29 -07:00