Bug 271062 - add support for 28xx based device to isp(4)
Summary: add support for 28xx based device to isp(4)
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: amd64 Any
: --- Affects Some People
Assignee: Alexander Motin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-04-25 11:44 UTC by Joerg Pulz
Modified: 2024-02-08 03:08 UTC (History)
3 users (show)

See Also:


Attachments
patch for CURRENT and RELENG-13.2 (5.95 KB, patch)
2023-04-25 11:44 UTC, Joerg Pulz
no flags Details | Diff
patch v2 for CURRENT and RELENG-13.2 (7.07 KB, patch)
2023-04-25 19:26 UTC, Joerg Pulz
no flags Details | Diff
patch v3 for CURRENT and RELENG-13.2 (7.44 KB, patch)
2023-04-28 10:08 UTC, Joerg Pulz
no flags Details | Diff
patch v4 for CURRENT and RELENG-13.2 (20.54 KB, patch)
2023-05-01 14:40 UTC, Joerg Pulz
no flags Details | Diff
patch v5 for CURRENT and RELENG-13.2 (22.80 KB, patch)
2023-05-03 07:43 UTC, Joerg Pulz
no flags Details | Diff
patch v6 for CURRENT and RELENG-13.2 (22.56 KB, patch)
2023-05-04 07:54 UTC, Joerg Pulz
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joerg Pulz 2023-04-25 11:44:49 UTC
Created attachment 241735 [details]
patch for CURRENT and RELENG-13.2

Add support for QLogic devices based on 28xx to isp(4) namely:

ISP2812-based 64/32G Fibre Channel to PCIe Controller:
  QLE2770 Single Port 32GFC PCIe Gen4 x8 Adapter
  QLE2772 Dual Port 32GFC PCIe Gen4 x8 Adapter
  QLE2870 Single Port 64GFC PCIe Gen4 x8 Adapter
  QLE2872 Dual Port 64GFC PCIe Gen4 x8 Adapter

ISP2814-based 64/32G Fibre Channel to PCIe Controller:
  QLE2774 Quad Port 32GFC PCIe Gen4 x16 Adapter
  QLE2874 Quad Port 64GFC PCIe Gen4 x16 Adapter

The attached patch enables device detection and adds support for 64GB FC.

Sample dmesg(8) output of an ISP2812-based "QLE2772 Dual Port 32GFC PCIe Gen4 x8 Adapter" with an 16GBit/s storage attached:

-----
isp0: <Qlogic ISP 2812 PCI FC Adapter> mem 0xeea05000-0xeea05fff,0xeea02000-0xeea03fff,0xee900000-0xee9fffff at device 0.0 numa-domain 1 on pci13
isp0: Board Type 2800, Chip Revision 0x2, resident F/W Revision 9.4.1
isp0: Attributes: Class2 MultiID T10CRC MQ MSIX VP0_Decoupling HotFW EXMOFF NPMOFF DIFCHOP ASICTMP ATIOMQ (unknown 0x0000162078020000)
isp0: 2048 max I/O command limit set
isp0: invalid NVRAM header (ff ff ff)
isp0: invalid NVRAM header (ff ff ff)
isp0: Chan 0 0x400000007f000000/0x410000007f000000 Role Initiator
isp0: bad frame length (0) from NVRAM - using 2048
isp1: <Qlogic ISP 2812 PCI FC Adapter> mem 0xeea04000-0xeea04fff,0xeea00000-0xeea01fff,0xee800000-0xee8fffff at device 0.1 numa-domain 1 on pci13
isp1: invalid NVRAM header (ff ff ff)
isp1: invalid NVRAM header (ff ff ff)
isp1: bad frame length (0) from NVRAM - using 2048
isp0: Chan 0 LIP Received
isp0: Chan 0 LIP Received
isp0: Chan 0 LOOP Up
isp0: Chan 0 Port Database Changed (nphdl 0xffff state 0x6 reason 0x0)
isp0: Chan 0 Firmware state <Config Wait->Ready>
isp0: Chan 0 WWPN 410000007f000000 WWNN 400000007f000000
isp0: Chan 0 16Gb Point-to-Point (N_Port) PortID 0x0000e8 LoopID 0x00
isp0: Chan 0 [0] WWPN 0x500000e0dc8ac220 PortID 0x0000ef handle 0x0 (REC,TGT,RdXfrDis) arrived
da1 at isp0 bus 0 scbus18 target 0 lun 0
da1: <0000> Fixed Direct Access SPC-4 SCSI device
da1: Serial Number XXXXXX
da1: 1600.000MB/s transfers WWNN 0x500000e0dc8ac200 WWPN 0x500000e0dc8ac220 PortID 0xef
da1: Command Queueing enabled
da1: 14931722MB (30580166656 512 byte sectors)
-----

Some notes on the "invalid NVRAM header" and "bad frame length (0) from NVRAM":
They do not harm and one will get the same messages with already supported ISP27xx (QLE2690/2692) devices.
Looking at the linux driver code the NVRAM access is done somehow different. I'm currently further investigating this but it maybe related to the added "Firmware Integrity Protection with Hardware Root of Trust" and primary/secondary firmware images.

A note to the default frame size:
I haven't seen a single FC HBA or other FC device with a pre-configured default frame size lower than 2048.
Therefor I decided to set it to 2048 as default for ISP28xx based HBAs as long as there is no way to read it from NVRAM.
I would have changed this also for ISP27xx based HBAs (there is no NVRAM access too) but kept it for now on those and all others at 1024 just to not break any existing setups.

Build and runtime tested on CURRENT and RELENG-13.2 on amd64.

Probably a very good candidate for an MFC
Comment 1 Warner Losh freebsd_committer freebsd_triage 2023-04-25 16:17:54 UTC
I generally like this patch... however...
-		isp_prt(isp, ISP_LOGERR, "bad frame length (%d) from NVRAM- using %d", DEFAULT_FRAMESIZE(isp), ICB_DFLT_FRMLEN);
-		icbp->icb_maxfrmlen = ICB_DFLT_FRMLEN;
+		if (IS_28XX(isp)) {
+			isp_prt(isp, ISP_LOGERR, "bad frame length (%d) from NVRAM - using %d", DEFAULT_FRAMESIZE(isp), ICB_DFLT_FRMLEN_28XX);
+			icbp->icb_maxfrmlen = ICB_DFLT_FRMLEN_28XX;
+		} else {
+			isp_prt(isp, ISP_LOGERR, "bad frame length (%d) from NVRAM - using %d", DEFAULT_FRAMESIZE(isp), ICB_DFLT_FRMLEN);
+			icbp->icb_maxfrmlen = ICB_DFLT_FRMLEN;
+		}

looks a little ugly to me. I'd be tempted to add a icbp->icb_dflt_frmlen field where we detect the 2800, set a different value. That way, we'd not need the if here with the code duplication.

Other than that, the patch looks very good.
Comment 2 Mina Galić freebsd_triage 2023-04-25 17:13:08 UTC
(In reply to Joerg Pulz from comment #0)
hi Joerg (Jörg?),

may i suggest submitting that patch as GitHub pull request: https://docs.freebsd.org/en/articles/contributing/#contrib-how
Comment 3 Joerg Pulz 2023-04-25 19:26:29 UTC
Created attachment 241743 [details]
patch v2 for CURRENT and RELENG-13.2

Attached is a new patch that addresses Warner's remarks about code duplication.
I should have done this like it is now at the first try.

There is also documentation now that was totally missing in the first version.

isp(4)
  Add all new supported devices

ispfw(4)
  Add BUGS section to mention that firmware is only included for 24xx and 25xx based cards.

As I've never used/done git pull requests before, I would like to skip this for now until I get used to it.
Comment 4 Joerg Pulz 2023-04-26 12:05:22 UTC
Pull request is submitted too:

https://github.com/freebsd/freebsd-src/pull/726
Comment 5 Alexander Motin freebsd_committer freebsd_triage 2023-04-26 13:54:26 UTC
Without the NVRAM parsing HBAs won't have their WWPNs/WWNNs, using some defaults instead, making impossible to use several of them in the same network due to conflicts.  So while this patch is better then nothing, I would not call the problem harmless.  Unfortunately I don't have any documentation about that area, and previous attempts of reverse-engineering Linux code have me only a headache.
Comment 6 Joerg Pulz 2023-04-26 15:46:22 UTC
(In reply to Alexander Motin from comment #5)

You're absolutely right about this.

As a workaround one can use hint.isp.N.portwwn and hint.isp.N.nodewwn in loader.conf(5) like this:

hint.isp.0.portwwn=w2100f4deadbeef00
hint.isp.0.nodewwn=w2000f4deadbeef00

The real values can be taken from either the WWN label on the card or the Bios/EFI configuration of the card.

Maybe a note about this in the BUGS section of isp(4) is required/useful?
A hint about the special syntax for both parameters would not harm too.
Comment 7 Alexander Motin freebsd_committer freebsd_triage 2023-04-26 15:52:24 UTC
Yes, the workaround is valid, and documenting it would have sense if nothing else, but it would be really good to not need it.  Unfortunately I have neither the docs nor the hardware to do it, so all hope is on you. ;)
Comment 8 Warner Losh freebsd_committer freebsd_triage 2023-04-26 17:09:06 UTC
(In reply to Joerg Pulz from comment #6)
Yea, a note in the man page if you're not able to parse the nvram properly.
Comment 9 Joerg Pulz 2023-04-28 10:08:39 UTC
Created attachment 241807 [details]
patch v3 for CURRENT and RELENG-13.2

New patch - reading NVRAM contents (e.b. WWPN/WWNN, Framesize) is working now.

Sample dmesg(8) output with with hint.isp.N.debug=0x3f:

isp0: <Qlogic ISP 2812 PCI FC Adapter> mem 0xeea05000-0xeea05fff,0xeea02000-0xeea03fff,0xee900000-0xee9fffff at device 0.0 numa-domain 1 on pci13
isp0: set PCI line size to 16 from 0
isp0: set PCI latency to 64
isp0: loading firmware from flash
isp0: Board Type 2800, Chip Revision 0x2, resident F/W Revision 9.4.1
isp0: Attributes: Class2 MultiID T10CRC MQ MSIX VP0_Decoupling HotFW EXMOFF NPMOFF DIFCHOP ASICTMP ATIOMQ (unknown 0x0000162078020000)
isp0: 2048 max I/O command limit set
isp0: request area @ 0x304ce25000/0x80000
isp0: response area @ 0x304cea5000/0x10000
isp0: NVRAM 0x2000f4c7aa0212b0 0x2100f4c7aa0212b0 maxframelen 2048
isp0: NVRAM loopid 0 fwopt1 0x6006 fwopt2 0x26 fwopt3 0x4000
isp0: Chan 0 0x2000f4c7aa0212b0/0x2100f4c7aa0212b0 Role Initiator
isp0: Setting ICB Node 0x2000f4c7aa0212b0 Port 0x2100f4c7aa0212b0
isp0: isp_init: fwopt1 0x6006 fwopt2 0x4401026 fwopt3 0x4022
isp0: isp_init: rqst 000000304ce25000 rsp 000000304cea5000
isp0: isp_init:
isp0: 0x00000000: 01 00 00 00 00 08 00 00 00 00 00 00 21 00 f4 c7
isp0: 0x00000010: aa 02 12 b0 20 00 f4 c7 aa 02 12 b0 00 00 00 00
isp0: 0x00000020: 03 00 00 00 00 04 00 20 00 00 00 00 00 50 e2 4c
isp0: 0x00000030: 30 00 00 00 00 50 ea 4c 30 00 00 00 00 00 00 00
isp0: 0x00000040: 00 00 00 00 01 00 02 00 00 00 00 00 00 00 00 00
isp0: 0x00000050: 00 00 00 00 00 00 00 00 00 00 0a 00 06 60 00 00
isp0: 0x00000060: 26 10 40 04 22 40 00 00 00 00 00 00 00 00 00 00
isp0: 0x00000070: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
isp0: INIT F/W from 0000003047ced000
isp0: Chan 0 Loop changed
isp0: Chan 0 Freeze simq (loopdown)
isp0: Chan 0 Checking FC state
isp0: Chan 0 FC got to NIL state
isp0: Chan 0 sleep for 1 seconds
isp1: <Qlogic ISP 2812 PCI FC Adapter> mem 0xeea04000-0xeea04fff,0xeea00000-0xeea01fff,0xee800000-0xee8fffff at device 0.1 numa-domain 1 on pci13
isp1: set PCI line size to 16 from 0
isp1: set PCI latency to 64
isp1: loading firmware from flash
isp1: Board Type 2800, Chip Revision 0x2, resident F/W Revision 9.4.1
isp1: Attributes: Class2 MultiID T10CRC MQ MSIX VP0_Decoupling HotFW EXMOFF NPMOFF DIFCHOP ASICTMP ATIOMQ (unknown 0x0000162078020000)
isp1: 2048 max I/O command limit set
isp1: request area @ 0x304cee9000/0x80000
isp1: response area @ 0x304cf69000/0x10000
isp1: NVRAM 0x2000f4c7aa0212b1 0x2100f4c7aa0212b1 maxframelen 2048
isp1: NVRAM loopid 0 fwopt1 0x6006 fwopt2 0x26 fwopt3 0x4000
isp1: Chan 0 0x2000f4c7aa0212b1/0x2100f4c7aa0212b1 Role Initiator
isp1: Setting ICB Node 0x2000f4c7aa0212b1 Port 0x2100f4c7aa0212b1
isp1: isp_init: fwopt1 0x6006 fwopt2 0x4401026 fwopt3 0x4022
isp1: isp_init: rqst 000000304cee9000 rsp 000000304cf69000
isp1: isp_init:
isp1: 0x00000000: 01 00 00 00 00 08 00 00 00 00 00 00 21 00 f4 c7
isp1: 0x00000010: aa 02 12 b1 20 00 f4 c7 aa 02 12 b1 00 00 00 00
isp1: 0x00000020: 03 00 00 00 00 04 00 20 00 00 00 00 00 90 ee 4c
isp1: 0x00000030: 30 00 00 00 00 90 f6 4c 30 00 00 00 00 00 00 00
isp1: 0x00000040: 00 00 00 00 01 00 02 00 00 00 00 00 00 00 00 00
isp1: 0x00000050: 00 00 00 00 00 00 00 00 00 00 0a 00 06 60 00 00
isp1: 0x00000060: 26 10 40 04 22 40 00 00 00 00 00 00 00 00 00 00
isp1: 0x00000070: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
isp1: INIT F/W from 000000304649a000
isp1: Chan 0 Loop changed
isp1: Chan 0 Freeze simq (loopdown)
isp1: Chan 0 Checking FC state
isp1: Chan 0 FC got to NIL state
isp1: Chan 0 sleep for 1 seconds
Comment 10 Joerg Pulz 2023-05-01 14:40:19 UTC
Created attachment 241908 [details]
patch v4 for CURRENT and RELENG-13.2

New patch.

Introduce FLT (flash layout table) handling for isp(4).
Get and parse the FLT header contents to get knowledge about the FLT (version, size, checksum). Verify checksum.
Use the retrieved information (size) to get and parse all FLT regions.
An FLT region contains information about the regions code, size, start and end.
Those can be used to directly access specific data (e.g. NVRAM) without using hardcoded addresses.

Currently only the NVRAM addresses are really used, everything else is debug or for future purposes.

This should probably work for older, probably since 24xx, cards too.
Currently it's only used for 28xx based cards.

Some debug from isp(4) showing FLT header and region parsing and using the NVRAM addresses from FLT:

isp0: <Qlogic ISP 2812 PCI FC Adapter> mem 0xeea05000-0xeea05fff,0xeea02000-0xeea03fff,0xee900000-0xee9fffff at device 0.0 numa-domain 1 on pci13
isp0: set PCI latency to 64
isp0: loading firmware from flash
isp0: Board Type 2800, Chip Revision 0x2, resident F/W Revision 9.4.1
isp0: Attributes: Class2 MultiID T10CRC MQ MSIX VP0_Decoupling HotFW EXMOFF NPMOFF DIFCHOP ASICTMP ATIOMQ (unknown 0x0000162078020000)
isp0: 2048 max I/O command limit set
isp0: request area @ 0x35e4380000/0x80000
isp0: response area @ 0x35c07d0000/0x10000
isp0: FLTL[DEF]: 0x4400
isp0: FLT[DEF]: version=0x1 length=0xc38(3128) checksum=0xea11
isp0: FLT[DEF]: regions=195
isp0: FLT[0xce]: start=0x0 end=0x3fff size=0x4000 attribute=0x0
isp0: FLT[0x1a]: start=0x4000 end=0x401f size=0x20 attribute=0x0
isp0: FLT[0x1b]: start=0x4020 end=0x43ff size=0x3e0 attribute=0x0
isp0: FLT[0x1c]: start=0x4400 end=0x47ff size=0x400 attribute=0x1
isp0: FLT[0x26]: start=0x4800 end=0x4bff size=0x400 attribute=0x0
isp0: FLT[0x130]: start=0x4c00 end=0x7fff size=0x3400 attribute=0x0
isp0: FLT[0x131]: start=0x8000 end=0xbfff size=0x4000 attribute=0x0
isp0: FLT[0x82]: start=0xc000 end=0xffff size=0x4000 attribute=0x0
isp0: FLT[0x150]: start=0x10000 end=0x13fff size=0x4000 attribute=0x0
isp0: FLT[0x132]: start=0x14000 end=0x17fff size=0x4000 attribute=0x0
isp0: FLT[0x95]: start=0x18000 end=0x1bfff size=0x4000 attribute=0x0
isp0: FLT[0x96]: start=0x1c000 end=0x1ffff size=0x4000 attribute=0x0
isp0: FLT[0x133]: start=0x20000 end=0x23fff size=0x4000 attribute=0x0
isp0: FLT[0x9e]: start=0x24000 end=0x27fff size=0x4000 attribute=0x1
isp0: FLT[0x125]: start=0x28000 end=0x2bfff size=0x4000 attribute=0x0
isp0: FLT[0x126]: start=0x2c000 end=0x2ffff size=0x4000 attribute=0x0
isp0: FLT[0x136]: start=0x30000 end=0x37fff size=0x8000 attribute=0x0
isp0: FLT[0x137]: start=0x38000 end=0x3ffff size=0x8000 attribute=0x0
isp0: FLT[0xd2]: start=0x40000 end=0x47fff size=0x8000 attribute=0x0
isp0: FLT[0x138]: start=0x48000 end=0x4ffff size=0x8000 attribute=0x0
isp0: FLT[0xd1]: start=0x50000 end=0x57fff size=0x8000 attribute=0x0
isp0: FLT[0x139]: start=0x58000 end=0x5ffff size=0x8000 attribute=0x0
isp0: FLT[0xcf]: start=0x60000 end=0x67fff size=0x8000 attribute=0x0
isp0: FLT[0x13a]: start=0x68000 end=0x6ffff size=0x8000 attribute=0x0
isp0: FLT[0x13b]: start=0x70000 end=0x77fff size=0x8000 attribute=0x0
isp0: FLT[0x13]: start=0x78000 end=0x7ffff size=0x8000 attribute=0x0
isp0: FLT[0x13c]: start=0x80000 end=0x87fff size=0x8000 attribute=0x0
isp0: FLT[0x134]: start=0x88000 end=0x8ffff size=0x8000 attribute=0x0
isp0: FLT[0x13d]: start=0x90000 end=0x97fff size=0x8000 attribute=0x0
isp0: FLT[0x101]: start=0x98000 end=0x9bfff size=0x4000 attribute=0x0
isp0: FLT[0x13e]: start=0x9c000 end=0xa3fff size=0x8000 attribute=0x0
isp0: FLT[0xd3]: start=0xa4000 end=0xb3fff size=0x10000 attribute=0x1
isp0: FLT[0x13f]: start=0xb4000 end=0xc3fff size=0x10000 attribute=0x0
isp0: FLT[0x102]: start=0xc4000 end=0xc7fff size=0x4000 attribute=0x0
isp0: FLT[0x140]: start=0xc8000 end=0xcbfff size=0x4000 attribute=0x0
isp0: FLT[0x141]: start=0xcc000 end=0xd3fff size=0x8000 attribute=0x0
isp0: FLT[0x103]: start=0xd4000 end=0xd7fff size=0x4000 attribute=0x0
isp0: FLT[0x142]: start=0xd8000 end=0xdffff size=0x8000 attribute=0x0
isp0: FLT[0xba]: start=0xe0000 end=0xe7fff size=0x8000 attribute=0x0
isp0: FLT[0x143]: start=0xe8000 end=0xeffff size=0x8000 attribute=0x0
isp0: FLT[0x1]: start=0xf0000 end=0x18ffff size=0xa0000 attribute=0x3
isp0: FLT[0x144]: start=0x190000 end=0x1cffff size=0x40000 attribute=0x0
isp0: FLT[0x145]: start=0x1d0000 end=0x20ffff size=0x40000 attribute=0x0
isp0: FLT[0x146]: start=0x210000 end=0x22ffff size=0x20000 attribute=0x0
isp0: FLT[0x147]: start=0x230000 end=0x23ffff size=0x10000 attribute=0x0
isp0: FLT[0x7]: start=0x240000 end=0x24ffff size=0x10000 attribute=0x0
isp0: FLT[0x11]: start=0x250000 end=0x25ffff size=0x10000 attribute=0x0
isp0: FLT[0x148]: start=0x260000 end=0x267fff size=0x8000 attribute=0x0
isp0: FLT[0x149]: start=0x268000 end=0x26ffff size=0x8000 attribute=0x0
isp0: FLT[0x14a]: start=0x270000 end=0x27ffff size=0x10000 attribute=0x0
isp0: FLT[0x14b]: start=0x280000 end=0x2bffff size=0x40000 attribute=0x0
isp0: FLT[0x14c]: start=0x2c0000 end=0x2fffff size=0x40000 attribute=0x0
isp0: FLT[0x14]: start=0x300000 end=0x30007f size=0x80 attribute=0x0
isp0: FLT[0x15]: start=0x300080 end=0x3000ff size=0x80 attribute=0x0
isp0: FLT[0x16]: start=0x300100 end=0x30017f size=0x80 attribute=0x0
isp0: FLT[0x17]: start=0x300180 end=0x3001ff size=0x80 attribute=0x0
isp0: FLT[0xd4]: start=0x300200 end=0x30027f size=0x80 attribute=0x0
isp0: FLT[0xd5]: start=0x300280 end=0x3002ff size=0x80 attribute=0x0
isp0: FLT[0xd6]: start=0x300300 end=0x30037f size=0x80 attribute=0x0
isp0: FLT[0xd7]: start=0x300380 end=0x3003ff size=0x80 attribute=0x0
isp0: FLT[0x3e]: start=0x300400 end=0x303fff size=0x3c00 attribute=0x0
isp0: FLT[0x14d]: start=0x304000 end=0x307fff size=0x4000 attribute=0x0
isp0: FLT[0x50]: start=0x308000 end=0x30807f size=0x80 attribute=0x0
isp0: FLT[0x51]: start=0x308080 end=0x3080ff size=0x80 attribute=0x0
isp0: FLT[0x52]: start=0x308100 end=0x30817f size=0x80 attribute=0x0
isp0: FLT[0x53]: start=0x308180 end=0x3081ff size=0x80 attribute=0x0
isp0: FLT[0xd8]: start=0x308200 end=0x30827f size=0x80 attribute=0x0
isp0: FLT[0xd9]: start=0x308280 end=0x3082ff size=0x80 attribute=0x0
isp0: FLT[0xda]: start=0x308300 end=0x30837f size=0x80 attribute=0x0
isp0: FLT[0xdb]: start=0x308380 end=0x3083ff size=0x80 attribute=0x0
isp0: FLT[0x3f]: start=0x308400 end=0x30bfff size=0x3c00 attribute=0x0
isp0: FLT[0x14e]: start=0x30c000 end=0x30ffff size=0x4000 attribute=0x0
isp0: FLT[0x104]: start=0x310000 end=0x313fff size=0x4000 attribute=0x0
isp0: FLT[0x190]: start=0x314000 end=0x31407f size=0x80 attribute=0x0
isp0: FLT[0x191]: start=0x314080 end=0x3140ff size=0x80 attribute=0x0
isp0: FLT[0x192]: start=0x314100 end=0x31417f size=0x80 attribute=0x0
isp0: FLT[0x193]: start=0x314180 end=0x3141ff size=0x80 attribute=0x0
isp0: FLT[0x194]: start=0x314200 end=0x31427f size=0x80 attribute=0x0
isp0: FLT[0x195]: start=0x314280 end=0x3142ff size=0x80 attribute=0x0
isp0: FLT[0x196]: start=0x314300 end=0x31437f size=0x80 attribute=0x0
isp0: FLT[0x197]: start=0x314380 end=0x3143ff size=0x80 attribute=0x0
isp0: FLT[0x14f]: start=0x314400 end=0x317fff size=0x3c00 attribute=0x0
isp0: FLT[0xa0]: start=0x318000 end=0x31bfff size=0x4000 attribute=0x0
isp0: FLT[0xdf]: start=0x31c000 end=0x31ffff size=0x4000 attribute=0x0
isp0: FLT[0x29]: start=0x320000 end=0x321fff size=0x2000 attribute=0x0
isp0: FLT[0x2a]: start=0x322000 end=0x323fff size=0x2000 attribute=0x0
isp0: FLT[0x5e]: start=0x324000 end=0x325fff size=0x2000 attribute=0x0
isp0: FLT[0x5f]: start=0x326000 end=0x327fff size=0x2000 attribute=0x0
isp0: FLT[0x151]: start=0x328000 end=0x32ffff size=0x8000 attribute=0x0
isp0: FLT[0x152]: start=0x330000 end=0x337fff size=0x8000 attribute=0x0
isp0: FLT[0x87]: start=0x338000 end=0x339fff size=0x2000 attribute=0x0
isp0: FLT[0x88]: start=0x33a000 end=0x33bfff size=0x2000 attribute=0x0
isp0: FLT[0x3c]: start=0x33c000 end=0x33dfff size=0x2000 attribute=0x0
isp0: FLT[0x3d]: start=0x33e000 end=0x33ffff size=0x2000 attribute=0x0
isp0: FLT[0xf4]: start=0x340000 end=0x347fff size=0x8000 attribute=0x0
isp0: FLT[0xf5]: start=0x348000 end=0x34ffff size=0x8000 attribute=0x0
isp0: FLT[0xf6]: start=0x350000 end=0x357fff size=0x8000 attribute=0x0
isp0: FLT[0xf7]: start=0x358000 end=0x35ffff size=0x8000 attribute=0x0
isp0: FLT[0x153]: start=0x360000 end=0x36ffff size=0x10000 attribute=0x0
isp0: FLT[0x154]: start=0x370000 end=0x37ffff size=0x10000 attribute=0x0
isp0: FLT[0x1d]: start=0x380000 end=0x3803ff size=0x400 attribute=0x0
isp0: FLT[0x1f]: start=0x380400 end=0x3807ff size=0x400 attribute=0x0
isp0: FLT[0xf2]: start=0x380800 end=0x380bff size=0x400 attribute=0x0
isp0: FLT[0xf3]: start=0x380c00 end=0x380fff size=0x400 attribute=0x0
isp0: FLT[0x155]: start=0x381000 end=0x383fff size=0x3000 attribute=0x0
isp0: FLT[0x156]: start=0x384000 end=0x387fff size=0x4000 attribute=0x0
isp0: FLT[0xc5]: start=0x388000 end=0x38bfff size=0x4000 attribute=0x0
isp0: FLT[0x157]: start=0x38c000 end=0x38ffff size=0x4000 attribute=0x0
isp0: FLT[0x21]: start=0x390000 end=0x393fff size=0x4000 attribute=0x0
isp0: FLT[0x158]: start=0x394000 end=0x39bfff size=0x8000 attribute=0x0
isp0: FLT[0x159]: start=0x39c000 end=0x3bbfff size=0x20000 attribute=0x0
isp0: FLT[0x15a]: start=0x3bc000 end=0x3fbfff size=0x40000 attribute=0x0
isp0: FLT[0x122]: start=0x3fc000 end=0x3fffff size=0x4000 attribute=0x0
isp0: FLT[0x15b]: start=0x400000 end=0x403fff size=0x4000 attribute=0x0
isp0: FLT[0x15c]: start=0x404000 end=0x407fff size=0x4000 attribute=0x0
isp0: FLT[0x15d]: start=0x408000 end=0x40bfff size=0x4000 attribute=0x0
isp0: FLT[0x15e]: start=0x40c000 end=0x40ffff size=0x4000 attribute=0x0
isp0: FLT[0x15f]: start=0x410000 end=0x417fff size=0x8000 attribute=0x0
isp0: FLT[0x160]: start=0x418000 end=0x41ffff size=0x8000 attribute=0x0
isp0: FLT[0x161]: start=0x420000 end=0x42ffff size=0x10000 attribute=0x0
isp0: FLT[0x162]: start=0x430000 end=0x43ffff size=0x10000 attribute=0x0
isp0: FLT[0x105]: start=0x440000 end=0x447fff size=0x8000 attribute=0x0
isp0: FLT[0x163]: start=0x448000 end=0x44ffff size=0x8000 attribute=0x0
isp0: FLT[0xf1]: start=0x450000 end=0x457fff size=0x8000 attribute=0x0
isp0: FLT[0x164]: start=0x458000 end=0x45ffff size=0x8000 attribute=0x0
isp0: FLT[0x106]: start=0x460000 end=0x467fff size=0x8000 attribute=0x0
isp0: FLT[0x165]: start=0x468000 end=0x46ffff size=0x8000 attribute=0x0
isp0: FLT[0x166]: start=0x470000 end=0x477fff size=0x8000 attribute=0x0
isp0: FLT[0x107]: start=0x478000 end=0x47ffff size=0x8000 attribute=0x0
isp0: FLT[0x167]: start=0x480000 end=0x487fff size=0x8000 attribute=0x0
isp0: FLT[0x187]: start=0x488000 end=0x48ffff size=0x8000 attribute=0x0
isp0: FLT[0x168]: start=0x490000 end=0x497fff size=0x8000 attribute=0x0
isp0: FLT[0x108]: start=0x498000 end=0x49bfff size=0x4000 attribute=0x0
isp0: FLT[0x169]: start=0x49c000 end=0x4a3fff size=0x8000 attribute=0x0
isp0: FLT[0xf0]: start=0x4a4000 end=0x4b3fff size=0x10000 attribute=0x1
isp0: FLT[0x16a]: start=0x4b4000 end=0x4c3fff size=0x10000 attribute=0x0
isp0: FLT[0x109]: start=0x4c4000 end=0x4c7fff size=0x4000 attribute=0x0
isp0: FLT[0x16b]: start=0x4c8000 end=0x4cbfff size=0x4000 attribute=0x0
isp0: FLT[0x16c]: start=0x4cc000 end=0x4d3fff size=0x8000 attribute=0x0
isp0: FLT[0x10a]: start=0x4d4000 end=0x4d7fff size=0x4000 attribute=0x0
isp0: FLT[0x16d]: start=0x4d8000 end=0x4dffff size=0x8000 attribute=0x0
isp0: FLT[0x10b]: start=0x4e0000 end=0x4e7fff size=0x8000 attribute=0x0
isp0: FLT[0x16e]: start=0x4e8000 end=0x4effff size=0x8000 attribute=0x0
isp0: FLT[0x2]: start=0x4f0000 end=0x58ffff size=0xa0000 attribute=0x3
isp0: FLT[0x16f]: start=0x590000 end=0x5cffff size=0x40000 attribute=0x0
isp0: FLT[0x170]: start=0x5d0000 end=0x60ffff size=0x40000 attribute=0x0
isp0: FLT[0x171]: start=0x610000 end=0x62ffff size=0x20000 attribute=0x0
isp0: FLT[0x172]: start=0x630000 end=0x63ffff size=0x10000 attribute=0x0
isp0: FLT[0x9]: start=0x640000 end=0x64ffff size=0x10000 attribute=0x0
isp0: FLT[0xa]: start=0x650000 end=0x65ffff size=0x10000 attribute=0x0
isp0: FLT[0x173]: start=0x660000 end=0x667fff size=0x8000 attribute=0x0
isp0: FLT[0x174]: start=0x668000 end=0x66ffff size=0x8000 attribute=0x0
isp0: FLT[0x175]: start=0x670000 end=0x67ffff size=0x10000 attribute=0x0
isp0: FLT[0x176]: start=0x680000 end=0x6bffff size=0x40000 attribute=0x0
isp0: FLT[0x177]: start=0x6c0000 end=0x6fffff size=0x40000 attribute=0x0
isp0: FLT[0x10c]: start=0x700000 end=0x70007f size=0x80 attribute=0x0
isp0: FLT[0x10d]: start=0x700080 end=0x7000ff size=0x80 attribute=0x0
isp0: FLT[0x10e]: start=0x700100 end=0x70017f size=0x80 attribute=0x0
isp0: FLT[0x10f]: start=0x700180 end=0x7001ff size=0x80 attribute=0x0
isp0: FLT[0x110]: start=0x700200 end=0x70027f size=0x80 attribute=0x0
isp0: FLT[0x111]: start=0x700280 end=0x7002ff size=0x80 attribute=0x0
isp0: FLT[0x112]: start=0x700300 end=0x70037f size=0x80 attribute=0x0
isp0: FLT[0x113]: start=0x700380 end=0x7003ff size=0x80 attribute=0x0
isp0: FLT[0x114]: start=0x700400 end=0x703fff size=0x3c00 attribute=0x0
isp0: FLT[0x178]: start=0x704000 end=0x707fff size=0x4000 attribute=0x0
isp0: FLT[0x115]: start=0x708000 end=0x70807f size=0x80 attribute=0x0
isp0: FLT[0x116]: start=0x708080 end=0x7080ff size=0x80 attribute=0x0
isp0: FLT[0x117]: start=0x708100 end=0x70817f size=0x80 attribute=0x0
isp0: FLT[0x118]: start=0x708180 end=0x7081ff size=0x80 attribute=0x0
isp0: FLT[0x119]: start=0x708200 end=0x70827f size=0x80 attribute=0x0
isp0: FLT[0x11a]: start=0x708280 end=0x7082ff size=0x80 attribute=0x0
isp0: FLT[0x11b]: start=0x708300 end=0x70837f size=0x80 attribute=0x0
isp0: FLT[0x11c]: start=0x708380 end=0x7083ff size=0x80 attribute=0x0
isp0: FLT[0x11d]: start=0x708400 end=0x70bfff size=0x3c00 attribute=0x0
isp0: FLT[0x179]: start=0x70c000 end=0x70ffff size=0x4000 attribute=0x0
isp0: FLT[0x17a]: start=0x710000 end=0x713fff size=0x4000 attribute=0x0
isp0: FLT[0x17b]: start=0x714000 end=0x717fff size=0x4000 attribute=0x0
isp0: FLT[0x17c]: start=0x718000 end=0x71bfff size=0x4000 attribute=0x0
isp0: FLT[0x124]: start=0x71c000 end=0x71ffff size=0x4000 attribute=0x0
isp0: FLT[0x11e]: start=0x720000 end=0x721fff size=0x2000 attribute=0x0
isp0: FLT[0x11f]: start=0x722000 end=0x723fff size=0x2000 attribute=0x0
isp0: FLT[0x120]: start=0x724000 end=0x725fff size=0x2000 attribute=0x0
isp0: FLT[0x121]: start=0x726000 end=0x727fff size=0x2000 attribute=0x0
isp0: FLT[0x17e]: start=0x728000 end=0x72ffff size=0x8000 attribute=0x0
isp0: FLT[0x17f]: start=0x730000 end=0x73ffff size=0x10000 attribute=0x0
isp0: FLT[0x180]: start=0x740000 end=0x75ffff size=0x20000 attribute=0x0
isp0: FLT[0x181]: start=0x760000 end=0x77ffff size=0x20000 attribute=0x0
isp0: FLT[0x182]: start=0x780000 end=0x783fff size=0x4000 attribute=0x0
isp0: FLT[0x183]: start=0x784000 end=0x78bfff size=0x8000 attribute=0x0
isp0: FLT[0x184]: start=0x78c000 end=0x79bfff size=0x10000 attribute=0x0
isp0: FLT[0x185]: start=0x79c000 end=0x7bbfff size=0x20000 attribute=0x0
isp0: FLT[0x186]: start=0x7bc000 end=0x7fbfff size=0x40000 attribute=0x0
isp0: FLT[0x123]: start=0x7fc000 end=0x7fffff size=0x4000 attribute=0x0
isp0: FLT[0xff]: start=0x0 end=0x7fffff size=0x800000 attribute=0x0
isp0: FLT[0xffff]: start=0x0 end=0x7fffff size=0x800000 attribute=0x0
isp0: FLT[FLT]: boot=0x240000 fw=0xf0000 vpd_nvram=0x300000 vpd=0x300000 nvram 0x300080 fdt=0x4000 flt=0x4400 npiv=0x320000 fcp_prif_cfg=0x338000
isp0: NVRAM 0x2000f4c7aa0212b0 0x2100f4c7aa0212b0 maxframelen 2048
isp0: NVRAM loopid 0 fwopt1 0x6006 fwopt2 0x26 fwopt3 0x4000
isp0: Chan 0 0x2000f4c7aa0212b0/0x2100f4c7aa0212b0 Role Initiator
isp0: Setting ICB Node 0x2000f4c7aa0212b0 Port 0x2100f4c7aa0212b0
isp0: isp_init: fwopt1 0x6006 fwopt2 0x4401026 fwopt3 0x4022
isp0: isp_init: rqst 00000035e4380000 rsp 00000035c07d0000
isp0: isp_init:
isp0: 0x00000000: 01 00 00 00 00 08 00 00 00 00 00 00 21 00 f4 c7
isp0: 0x00000010: aa 02 12 b0 20 00 f4 c7 aa 02 12 b0 00 00 00 00
isp0: 0x00000020: 03 00 00 00 00 04 00 20 00 00 00 00 00 00 38 e4
isp0: 0x00000030: 35 00 00 00 00 00 7d c0 35 00 00 00 00 00 00 00
isp0: 0x00000040: 00 00 00 00 01 00 02 00 00 00 00 00 00 00 00 00
isp0: 0x00000050: 00 00 00 00 00 00 00 00 00 00 0a 00 06 60 00 00
isp0: 0x00000060: 26 10 40 04 22 40 00 00 00 00 00 00 00 00 00 00
isp0: 0x00000070: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
isp0: INIT F/W from 00000030aaad1000
Comment 11 Joerg Pulz 2023-05-03 07:43:29 UTC
Created attachment 241948 [details]
patch v5 for CURRENT and RELENG-13.2

Use the FLT on all supported controllers but explicit leave the 26xx ones is.
The 26xx are a bit special as those are known as 83xx (2031 and 8031 for real).
I don't have such a device around so i will investigate the 26xx later.
    
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)

dmesg(8) debug outputs (slightly stripped to the most important parts)
for Qlogic ISP 2532 (QLogic QLE2562 8Gb 2Port FC Adapter)
-----
isp0: <Qlogic ISP 2532 PCI FC-AL Adapter> port 0x8200-0x82ff mem 0xb8a04000-0xb8a07fff,0xb8900000-0xb89fffff at device 0.0 numa-domain 0 on pci9
isp0: loaded firmware isp_2500
isp0: set PCI line size to 16 from 0
isp0: set PCI latency to 64
isp0: Board Type 2532, Chip Revision 0x2, resident F/W Revision 8.7.0
isp0: Attributes: Class2 MultiID T10CRC MQ MSIX VP0_Decoupling NPMOFF
isp0: 2048 max I/O command limit set
isp0: request area @ 0x1f7e56000/0x80000
isp0: response area @ 0x1f7ed6000/0x10000
isp0: FLTL[DEF]: 0x50400
isp0: FLT[DEF]: version=0x1 length=0x290(656) checksum=0xb62a
isp0: FLT[DEF]: regions=40
<skipped FLT regions parsing debug output>
isp0: FLT[FLT]: boot=0x0 fw=0x20000 vpd_nvram=0x48000 vpd=0x48000 nvram 0x48080 fdt=0x50000 flt=0x50400 npiv=0x5c000 fcp_prif_cfg=0x3c000
isp0: NVRAM 0x0000000000000000 0x21000024ff3f6fc8 maxframelen 2048
isp0: NVRAM loopid 0 fwopt1 0x2006 fwopt2 0x20 fwopt3 0x4008
isp0: Chan 0 0x20000024ff3f6fc8/0x21000024ff3f6fc8 Role Initiator
isp0: Setting ICB Node 0x20000024ff3f6fc8 Port 0x21000024ff3f6fc8
isp0: isp_init: fwopt1 0x6006 fwopt2 0x1020 fwopt3 0x402a
isp0: isp_init: rqst 00000001f7e56000 rsp 00000001f7ed6000
isp0: isp_init:
isp0: 0x00000000: 01 00 00 00 00 08 ff ff 00 00 00 00 21 00 00 24
isp0: 0x00000010: ff 3f 6f c8 20 00 00 24 ff 3f 6f c8 00 00 00 00
isp0: 0x00000020: 03 00 00 00 00 04 00 20 00 00 00 00 00 60 e5 f7
isp0: 0x00000030: 01 00 00 00 00 60 ed f7 01 00 00 00 00 00 00 00
isp0: 0x00000040: 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00
isp0: 0x00000050: 00 00 00 00 00 00 00 00 00 00 0a 00 06 60 00 00
isp0: 0x00000060: 20 10 00 00 2a 40 00 00 00 00 00 00 00 00 00 00
isp0: 0x00000070: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
isp0: INIT F/W from 000000011186e000
-----

for Qlogic ISP 2722 (QLogic QLE2690 16Gb FC Adapter)
-----
isp0: <Qlogic ISP 2722 PCI FC Adapter> mem 0xb8902000-0xb8902fff,0xb8900000-0xb8901fff,0xb8800000-0xb88fffff at device 0.0 numa-domain 0 on pci9
isp0: set PCI line size to 16 from 0
isp0: set PCI latency to 64
isp0: loading firmware from flash
isp0: Board Type 2700, Chip Revision 0x1, resident F/W Revision 8.8.231
isp0: Attributes: Class2 MultiID T10CRC MQ MSIX VP0_Decoupling HotFW EXMOFF NPMOFF DIFCHOP ASICTMP ATIOMQ (unknown 0x0000020078020000)
isp0: 2048 max I/O command limit set
isp0: request area @ 0x578e21000/0x80000
isp0: response area @ 0x578ea1000/0x10000
isp0: FLTL[DEF]: 0xfc400
isp0: FLT[DEF]: version=0x1 length=0x448(1096) checksum=0x6e23
isp0: FLT[DEF]: regions=68
<skipped FLT regions parsing debug output>
isp0: FLT[FLT]: boot=0x200000 fw=0x240000 vpd_nvram=0x270000 vpd=0x270000 nvram 0x270080 fdt=0xfc000 flt=0xfc400 npiv=0x2a8000 fcp_prif_cfg=0x0
isp0: NVRAM 0x0000000000000000 0x210034800d3ebaac maxframelen 2048
isp0: NVRAM loopid 0 fwopt1 0x20c6 fwopt2 0x26 fwopt3 0x4000
isp0: Chan 0 0x200034800d3ebaac/0x210034800d3ebaac Role Initiator
isp0: Setting ICB Node 0x200034800d3ebaac Port 0x210034800d3ebaac
isp0: isp_init: fwopt1 0x60c6 fwopt2 0x4401026 fwopt3 0x4022
isp0: isp_init: rqst 0000000578e21000 rsp 0000000578ea1000
isp0: isp_init:
isp0: 0x00000000: 01 00 00 00 00 08 00 00 00 00 00 00 21 00 34 80
isp0: 0x00000010: 0d 3e ba ac 20 00 34 80 0d 3e ba ac 00 00 00 00
isp0: 0x00000020: 03 00 00 00 00 04 00 20 00 00 00 00 00 10 e2 78
isp0: 0x00000030: 05 00 00 00 00 10 ea 78 05 00 00 00 00 00 00 00
isp0: 0x00000040: 00 00 00 00 01 00 02 00 00 00 00 00 00 00 00 00
isp0: 0x00000050: 00 00 00 00 00 00 00 00 00 00 0a 00 c6 60 00 00
isp0: 0x00000060: 26 10 40 04 22 40 00 00 00 00 00 00 00 00 00 00
isp0: 0x00000070: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
isp0: INIT F/W from 0000000112698000
-----

for Qlogic ISP 2812 (QLogic QLE2772 32Gbit 2Port FC Adapter)
-----
isp2: <Qlogic ISP 2812 PCI FC Adapter> mem 0xeea05000-0xeea05fff,0xeea02000-0xeea03fff,0xee900000-0xee9fffff at device 0.0 numa-domain 1 on pci14
isp2: set PCI line size to 16 from 0
isp2: set PCI latency to 64
isp2: loading firmware from flash
isp2: Board Type 2800, Chip Revision 0x2, resident F/W Revision 9.4.1
isp2: Attributes: Class2 MultiID T10CRC MQ MSIX VP0_Decoupling HotFW EXMOFF NPMOFF DIFCHOP ASICTMP ATIOMQ (unknown 0x0000162078020000)
isp2: 2048 max I/O command limit set
isp2: request area @ 0x30d6a80000/0x80000
isp2: response area @ 0x30c54f0000/0x10000
isp2: FLTL[DEF]: 0x4400
isp2: FLT[DEF]: version=0x1 length=0xc38(3128) checksum=0xea11
isp2: FLT[DEF]: regions=195
<skipped FLT regions parsing debug output>
isp2: FLT[FLT]: boot=0x240000 fw=0xf0000 vpd_nvram=0x300000 vpd=0x300000 nvram 0x300080 fdt=0x4000 flt=0x4400 npiv=0x320000 fcp_prif_cfg=0x338000
isp2: NVRAM 0x2000f4c7aa0212b0 0x2100f4c7aa0212b0 maxframelen 2048
isp2: NVRAM loopid 0 fwopt1 0x6006 fwopt2 0x26 fwopt3 0x4000
isp2: Chan 0 0x2000f4c7aa0212b0/0x2100f4c7aa0212b0 Role Initiator
isp2: Setting ICB Node 0x2000f4c7aa0212b0 Port 0x2100f4c7aa0212b0
isp2: isp_init: fwopt1 0x6006 fwopt2 0x4401026 fwopt3 0x4022
isp2: isp_init: rqst 00000030d6a80000 rsp 00000030c54f0000
isp2: isp_init:
isp2: 0x00000000: 01 00 00 00 00 08 00 00 00 00 00 00 21 00 f4 c7
isp2: 0x00000010: aa 02 12 b0 20 00 f4 c7 aa 02 12 b0 00 00 00 00
isp2: 0x00000020: 03 00 00 00 00 04 00 20 00 00 00 00 00 00 a8 d6
isp2: 0x00000030: 30 00 00 00 00 00 4f c5 30 00 00 00 00 00 00 00
isp2: 0x00000040: 00 00 00 00 01 00 02 00 00 00 00 00 00 00 00 00
isp2: 0x00000050: 00 00 00 00 00 00 00 00 00 00 0a 00 06 60 00 00
isp2: 0x00000060: 26 10 40 04 22 40 00 00 00 00 00 00 00 00 00 00
isp2: 0x00000070: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
isp2: INIT F/W from 0000003094b09000
Comment 12 Joerg Pulz 2023-05-04 07:54:55 UTC
Created attachment 241964 [details]
patch v6 for CURRENT and RELENG-13.2

Rename function isp_rd_2400_nvram() to isp_rd_2xxx_flash() and use it to do the real flash reads for FLT header, FLT and NVRAM.
Removed redundant and now obsolete isp_rd_2xxx_flthdr() and isp_rd_2xxx_flt() functions.

All FLT related output is now hidden behind ISP_LOGDEBUG0.

Thanks to mav@ for the comments.
Comment 13 commit-hook freebsd_committer freebsd_triage 2023-07-07 21:49:01 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=295fd9c1caeb42a4c93005080320d011bf01e4c0

commit 295fd9c1caeb42a4c93005080320d011bf01e4c0
Author:     Joerg Pulz <Joerg.Pulz@frm2.tum.de>
AuthorDate: 2023-07-07 21:43:34 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2023-07-07 21:45:30 +0000

    isp(4): Remove redundant functions for reading data from FLT and flash

    Rename isp_rd_2400_nvram to isp_rd_2xxx_flash.
    Cleanup some leftovers.
    Hide all output regarding FLT parsing behind ISP_LOGDEBUG0.

    Thanks to imp@ and mav@ for reviewing and commenting.

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

 sys/dev/isp/isp.c | 115 +++++++++++++++---------------------------------------
 1 file changed, 31 insertions(+), 84 deletions(-)
Comment 14 commit-hook freebsd_committer freebsd_triage 2023-07-07 21:49:03 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=348ec8dc036bf4ba1f607bb8acb25a0358436cc7

commit 348ec8dc036bf4ba1f607bb8acb25a0358436cc7
Author:     Joerg Pulz <Joerg.Pulz@frm2.tum.de>
AuthorDate: 2023-07-07 21:43:35 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2023-07-07 21:45:30 +0000

    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

 sys/dev/isp/isp.c    | 42 ++++++++++++++++++++++--------------------
 sys/dev/isp/ispreg.h |  4 ++--
 2 files changed, 24 insertions(+), 22 deletions(-)
Comment 15 commit-hook freebsd_committer freebsd_triage 2023-07-07 21:49:04 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=27b4a1b7e5b871c248dc501aa359c93f7263b074

commit 27b4a1b7e5b871c248dc501aa359c93f7263b074
Author:     Joerg Pulz <Joerg.Pulz@frm2.tum.de>
AuthorDate: 2023-07-07 21:43:34 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2023-07-07 21:45:30 +0000

    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

 sys/dev/isp/isp.c    | 296 ++++++++++++++++++++++++++++++++++++++++++++++++++-
 sys/dev/isp/ispreg.h |  81 ++++++++++++++
 sys/dev/isp/ispvar.h |  22 ++++
 3 files changed, 397 insertions(+), 2 deletions(-)
Comment 16 commit-hook freebsd_committer freebsd_triage 2023-07-07 21:49:05 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=233ab94cfd78db16ca431b09f36cebb8ee4674e9

commit 233ab94cfd78db16ca431b09f36cebb8ee4674e9
Author:     Joerg Pulz <Joerg.Pulz@frm2.tum.de>
AuthorDate: 2023-07-07 21:43:34 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2023-07-07 21:45:30 +0000

    ispfw(4): Reword to be more specific

    Make clear what "included" means, as suggested by imp@

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

 share/man/man4/ispfw.4 | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Comment 17 commit-hook freebsd_committer freebsd_triage 2023-07-07 21:49:07 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=2b4ccfbbc65b2f140fab6db998e9654c5c2bb972

commit 2b4ccfbbc65b2f140fab6db998e9654c5c2bb972
Author:     Joerg Pulz <Joerg.Pulz@frm2.tum.de>
AuthorDate: 2023-07-07 21:43:34 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2023-07-07 21:45:29 +0000

    isp(4): Document support for new devices

    Add 28xx based HBAs to manpage.

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

 share/man/man4/isp.4 | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
Comment 18 commit-hook freebsd_committer freebsd_triage 2023-07-07 21:49:08 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=f76f7fefa1bb5dc2ec0c9e44740faac0b46dac25

commit f76f7fefa1bb5dc2ec0c9e44740faac0b46dac25
Author:     Joerg Pulz <Joerg.Pulz@frm2.tum.de>
AuthorDate: 2023-07-07 21:43:34 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2023-07-07 21:45:30 +0000

    isp(4): Fix reading NVRAM contents for 28xx based devices

    Use correct NVRAM address for ISP28xx based HBAs to read NVRAM contents.
      WWPN/WWNN and framesize are correctly read from NVRAM now.

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

 sys/dev/isp/isp.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
Comment 19 commit-hook freebsd_committer freebsd_triage 2023-07-07 21:49:09 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=0c5f23d2f7029608b0f9977f81fcb5746608fc21

commit 0c5f23d2f7029608b0f9977f81fcb5746608fc21
Author:     Joerg Pulz <Joerg.Pulz@frm2.tum.de>
AuthorDate: 2023-07-07 21:43:34 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2023-07-07 21:45:29 +0000

    ispfw(4): Add BUGS section with note about bundled firmware

    Note that only firmware for 24xx and 25xx based HBAs is bundled with ispfw(4).
    Those get the bundled firmware loaded into the HBAs memory and executed.
    All other HBAs will use the firmware from flash.

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

 share/man/man4/ispfw.4 | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
Comment 20 commit-hook freebsd_committer freebsd_triage 2023-07-07 21:49:11 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=407abff6a445c8db335093868e9e7e70438c5901

commit 407abff6a445c8db335093868e9e7e70438c5901
Author:     Joerg Pulz <Joerg.Pulz@frm2.tum.de>
AuthorDate: 2023-07-07 21:43:34 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2023-07-07 21:45:29 +0000

    isp(4): Add support for QLogic 28xx devices

    This covers the following HBAs:
      ISP2812-based 64/32G Fibre Channel to PCIe Controller:
        QLE2770 Single Port 32GFC PCIe Gen4 x8 Adapter
        QLE2772 Dual Port 32GFC PCIe Gen4 x8 Adapter
        QLE2870 Single Port 64GFC PCIe Gen4 x8 Adapter
        QLE2872 Dual Port 64GFC PCIe Gen4 x8 Adapter

      ISP2814-based 64/32G Fibre Channel to PCIe Controller:
        QLE2774 Quad Port 32GFC PCIe Gen4 x16 Adapter
        QLE2874 Quad Port 64GFC PCIe Gen4 x16 Adapter

    While here, add required bits to support 64GB FC.

    Default framesize is set to 2048 for ISP28xx based HBAs for now.

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

 sys/dev/isp/isp.c     | 14 +++++++++++++-
 sys/dev/isp/isp_pci.c | 28 ++++++++++++++++++++++++++++
 sys/dev/isp/ispmbox.h |  3 +++
 sys/dev/isp/ispvar.h  |  3 +++
 4 files changed, 47 insertions(+), 1 deletion(-)
Comment 21 commit-hook freebsd_committer freebsd_triage 2023-07-07 21:49:12 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=707e4d1b20aa3983f7cd2f444d6ce41eebc02698

commit 707e4d1b20aa3983f7cd2f444d6ce41eebc02698
Author:     Joerg Pulz <Joerg.Pulz@frm2.tum.de>
AuthorDate: 2023-07-07 21:43:34 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2023-07-07 21:45:30 +0000

    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

 sys/dev/isp/isp.c    | 417 +++++++++++++++++++++++++++++----------------------
 sys/dev/isp/ispreg.h |  29 ++--
 sys/dev/isp/ispvar.h |   4 +
 3 files changed, 260 insertions(+), 190 deletions(-)
Comment 22 Joerg Pulz 2024-01-08 07:18:29 UTC
Can we get this MFC'd to 13 or are there any objections?

I would like to close this PR and MFC to 13 is the last open point here.
Comment 23 commit-hook freebsd_committer freebsd_triage 2024-01-19 16:54:02 UTC
A commit in branch stable/13 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=a922b89834ef611395cb440a5b4098d2c741c5fd

commit a922b89834ef611395cb440a5b4098d2c741c5fd
Author:     Joerg Pulz <Joerg.Pulz@frm2.tum.de>
AuthorDate: 2023-07-07 21:43:34 +0000
Commit:     Alexander Motin <mav@FreeBSD.org>
CommitDate: 2024-01-19 16:51:45 +0000

    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

    (cherry picked from commit 27b4a1b7e5b871c248dc501aa359c93f7263b074)

 sys/dev/isp/isp.c    | 296 ++++++++++++++++++++++++++++++++++++++++++++++++++-
 sys/dev/isp/ispreg.h |  81 ++++++++++++++
 sys/dev/isp/ispvar.h |  22 ++++
 3 files changed, 397 insertions(+), 2 deletions(-)
Comment 24 commit-hook freebsd_committer freebsd_triage 2024-01-19 16:54:03 UTC
A commit in branch stable/13 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=0a38059e24d44c2cb573df97b26dc10a2a9053c3

commit 0a38059e24d44c2cb573df97b26dc10a2a9053c3
Author:     Joerg Pulz <Joerg.Pulz@frm2.tum.de>
AuthorDate: 2023-07-07 21:43:34 +0000
Commit:     Alexander Motin <mav@FreeBSD.org>
CommitDate: 2024-01-19 16:51:46 +0000

    isp(4): Remove redundant functions for reading data from FLT and flash

    Rename isp_rd_2400_nvram to isp_rd_2xxx_flash.
    Cleanup some leftovers.
    Hide all output regarding FLT parsing behind ISP_LOGDEBUG0.

    Thanks to imp@ and mav@ for reviewing and commenting.

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

    (cherry picked from commit 295fd9c1caeb42a4c93005080320d011bf01e4c0)

 sys/dev/isp/isp.c | 115 +++++++++++++++---------------------------------------
 1 file changed, 31 insertions(+), 84 deletions(-)
Comment 25 commit-hook freebsd_committer freebsd_triage 2024-01-19 16:54:05 UTC
A commit in branch stable/13 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=6fdabe9b8df4493af8242fb2755b69e20d1ef042

commit 6fdabe9b8df4493af8242fb2755b69e20d1ef042
Author:     Joerg Pulz <Joerg.Pulz@frm2.tum.de>
AuthorDate: 2023-07-07 21:43:34 +0000
Commit:     Alexander Motin <mav@FreeBSD.org>
CommitDate: 2024-01-19 16:51:45 +0000

    isp(4): Add support for QLogic 28xx devices

    This covers the following HBAs:
      ISP2812-based 64/32G Fibre Channel to PCIe Controller:
        QLE2770 Single Port 32GFC PCIe Gen4 x8 Adapter
        QLE2772 Dual Port 32GFC PCIe Gen4 x8 Adapter
        QLE2870 Single Port 64GFC PCIe Gen4 x8 Adapter
        QLE2872 Dual Port 64GFC PCIe Gen4 x8 Adapter

      ISP2814-based 64/32G Fibre Channel to PCIe Controller:
        QLE2774 Quad Port 32GFC PCIe Gen4 x16 Adapter
        QLE2874 Quad Port 64GFC PCIe Gen4 x16 Adapter

    While here, add required bits to support 64GB FC.

    Default framesize is set to 2048 for ISP28xx based HBAs for now.

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

    (cherry picked from commit 407abff6a445c8db335093868e9e7e70438c5901)

 sys/dev/isp/isp.c     | 14 +++++++++++++-
 sys/dev/isp/isp_pci.c | 28 ++++++++++++++++++++++++++++
 sys/dev/isp/ispmbox.h |  3 +++
 sys/dev/isp/ispvar.h  |  3 +++
 4 files changed, 47 insertions(+), 1 deletion(-)
Comment 26 commit-hook freebsd_committer freebsd_triage 2024-01-19 16:54:06 UTC
A commit in branch stable/13 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=f0275240dc3dea56c498a8e41e56c00761d3a597

commit f0275240dc3dea56c498a8e41e56c00761d3a597
Author:     Joerg Pulz <Joerg.Pulz@frm2.tum.de>
AuthorDate: 2023-07-07 21:43:34 +0000
Commit:     Alexander Motin <mav@FreeBSD.org>
CommitDate: 2024-01-19 16:51:45 +0000

    isp(4): Fix reading NVRAM contents for 28xx based devices

    Use correct NVRAM address for ISP28xx based HBAs to read NVRAM contents.
      WWPN/WWNN and framesize are correctly read from NVRAM now.

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

    (cherry picked from commit f76f7fefa1bb5dc2ec0c9e44740faac0b46dac25)

 sys/dev/isp/isp.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
Comment 27 commit-hook freebsd_committer freebsd_triage 2024-01-19 16:54:07 UTC
A commit in branch stable/13 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=de4c073977c9b77d29cdfba9241a0bbe3e5de879

commit de4c073977c9b77d29cdfba9241a0bbe3e5de879
Author:     Joerg Pulz <Joerg.Pulz@frm2.tum.de>
AuthorDate: 2023-07-07 21:43:34 +0000
Commit:     Alexander Motin <mav@FreeBSD.org>
CommitDate: 2024-01-19 16:51:46 +0000

    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

    (cherry picked from commit 707e4d1b20aa3983f7cd2f444d6ce41eebc02698)

 sys/dev/isp/isp.c    | 417 +++++++++++++++++++++++++++++----------------------
 sys/dev/isp/ispreg.h |  29 ++--
 sys/dev/isp/ispvar.h |   4 +
 3 files changed, 260 insertions(+), 190 deletions(-)
Comment 28 commit-hook freebsd_committer freebsd_triage 2024-01-19 16:54:09 UTC
A commit in branch stable/13 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=07dd91cb046b9cabafb19e7d1dd38a1df89133ed

commit 07dd91cb046b9cabafb19e7d1dd38a1df89133ed
Author:     Joerg Pulz <Joerg.Pulz@frm2.tum.de>
AuthorDate: 2023-07-07 21:43:35 +0000
Commit:     Alexander Motin <mav@FreeBSD.org>
CommitDate: 2024-01-19 16:51:46 +0000

    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

    (cherry picked from commit 348ec8dc036bf4ba1f607bb8acb25a0358436cc7)

 sys/dev/isp/isp.c    | 42 ++++++++++++++++++++++--------------------
 sys/dev/isp/ispreg.h |  4 ++--
 2 files changed, 24 insertions(+), 22 deletions(-)
Comment 29 Mark Linimon freebsd_committer freebsd_triage 2024-02-08 03:08:16 UTC
^Triage: assign to committer who also MFCed.