ql4_nvram.h 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * QLogic iSCSI HBA Driver
  4. * Copyright (c) 2003-2013 QLogic Corporation
  5. */
  6. #ifndef _QL4XNVRM_H_
  7. #define _QL4XNVRM_H_
  8. /**
  9. * AM29LV Flash definitions
  10. **/
  11. #define FM93C56A_SIZE_8 0x100
  12. #define FM93C56A_SIZE_16 0x80
  13. #define FM93C66A_SIZE_8 0x200
  14. #define FM93C66A_SIZE_16 0x100/* 4010 */
  15. #define FM93C86A_SIZE_16 0x400/* 4022 */
  16. #define FM93C56A_START 0x1
  17. /* Commands */
  18. #define FM93C56A_READ 0x2
  19. #define FM93C56A_WEN 0x0
  20. #define FM93C56A_WRITE 0x1
  21. #define FM93C56A_WRITE_ALL 0x0
  22. #define FM93C56A_WDS 0x0
  23. #define FM93C56A_ERASE 0x3
  24. #define FM93C56A_ERASE_ALL 0x0
  25. /* Command Extensions */
  26. #define FM93C56A_WEN_EXT 0x3
  27. #define FM93C56A_WRITE_ALL_EXT 0x1
  28. #define FM93C56A_WDS_EXT 0x0
  29. #define FM93C56A_ERASE_ALL_EXT 0x2
  30. /* Address Bits */
  31. #define FM93C56A_NO_ADDR_BITS_16 8 /* 4010 */
  32. #define FM93C56A_NO_ADDR_BITS_8 9 /* 4010 */
  33. #define FM93C86A_NO_ADDR_BITS_16 10 /* 4022 */
  34. /* Data Bits */
  35. #define FM93C56A_DATA_BITS_16 16
  36. #define FM93C56A_DATA_BITS_8 8
  37. /* Special Bits */
  38. #define FM93C56A_READ_DUMMY_BITS 1
  39. #define FM93C56A_READY 0
  40. #define FM93C56A_BUSY 1
  41. #define FM93C56A_CMD_BITS 2
  42. /* Auburn Bits */
  43. #define AUBURN_EEPROM_DI 0x8
  44. #define AUBURN_EEPROM_DI_0 0x0
  45. #define AUBURN_EEPROM_DI_1 0x8
  46. #define AUBURN_EEPROM_DO 0x4
  47. #define AUBURN_EEPROM_DO_0 0x0
  48. #define AUBURN_EEPROM_DO_1 0x4
  49. #define AUBURN_EEPROM_CS 0x2
  50. #define AUBURN_EEPROM_CS_0 0x0
  51. #define AUBURN_EEPROM_CS_1 0x2
  52. #define AUBURN_EEPROM_CLK_RISE 0x1
  53. #define AUBURN_EEPROM_CLK_FALL 0x0
  54. /**/
  55. /* EEPROM format */
  56. /**/
  57. struct bios_params {
  58. uint16_t SpinUpDelay:1;
  59. uint16_t BIOSDisable:1;
  60. uint16_t MMAPEnable:1;
  61. uint16_t BootEnable:1;
  62. uint16_t Reserved0:12;
  63. uint8_t bootID0:7;
  64. uint8_t bootID0Valid:1;
  65. uint8_t bootLUN0[8];
  66. uint8_t bootID1:7;
  67. uint8_t bootID1Valid:1;
  68. uint8_t bootLUN1[8];
  69. uint16_t MaxLunsPerTarget;
  70. uint8_t Reserved1[10];
  71. };
  72. struct eeprom_port_cfg {
  73. /* MTU MAC 0 */
  74. u16 etherMtu_mac;
  75. /* Flow Control MAC 0 */
  76. u16 pauseThreshold_mac;
  77. u16 resumeThreshold_mac;
  78. u16 reserved[13];
  79. };
  80. struct eeprom_function_cfg {
  81. u8 reserved[30];
  82. /* MAC ADDR */
  83. u8 macAddress[6];
  84. u8 macAddressSecondary[6];
  85. u16 subsysVendorId;
  86. u16 subsysDeviceId;
  87. };
  88. struct eeprom_data {
  89. union {
  90. struct { /* isp4010 */
  91. u8 asic_id[4]; /* x00 */
  92. u8 version; /* x04 */
  93. u8 reserved; /* x05 */
  94. u16 board_id; /* x06 */
  95. #define EEPROM_BOARDID_ELDORADO 1
  96. #define EEPROM_BOARDID_PLACER 2
  97. #define EEPROM_SERIAL_NUM_SIZE 16
  98. u8 serial_number[EEPROM_SERIAL_NUM_SIZE]; /* x08 */
  99. /* ExtHwConfig: */
  100. /* Offset = 24bytes
  101. *
  102. * | SSRAM Size| |ST|PD|SDRAM SZ| W| B| SP | |
  103. * |15|14|13|12|11|10| 9| 8| 7| 6| 5| 4| 3| 2| 1| 0|
  104. * +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
  105. */
  106. u16 ext_hw_conf; /* x18 */
  107. u8 mac0[6]; /* x1A */
  108. u8 mac1[6]; /* x20 */
  109. u8 mac2[6]; /* x26 */
  110. u8 mac3[6]; /* x2C */
  111. u16 etherMtu; /* x32 */
  112. u16 macConfig; /* x34 */
  113. #define MAC_CONFIG_ENABLE_ANEG 0x0001
  114. #define MAC_CONFIG_ENABLE_PAUSE 0x0002
  115. u16 phyConfig; /* x36 */
  116. #define PHY_CONFIG_PHY_ADDR_MASK 0x1f
  117. #define PHY_CONFIG_ENABLE_FW_MANAGEMENT_MASK 0x20
  118. u16 reserved_56; /* x38 */
  119. #define EEPROM_UNUSED_1_SIZE 2
  120. u8 unused_1[EEPROM_UNUSED_1_SIZE]; /* x3A */
  121. u16 bufletSize; /* x3C */
  122. u16 bufletCount; /* x3E */
  123. u16 bufletPauseThreshold; /* x40 */
  124. u16 tcpWindowThreshold50; /* x42 */
  125. u16 tcpWindowThreshold25; /* x44 */
  126. u16 tcpWindowThreshold0; /* x46 */
  127. u16 ipHashTableBaseHi; /* x48 */
  128. u16 ipHashTableBaseLo; /* x4A */
  129. u16 ipHashTableSize; /* x4C */
  130. u16 tcpHashTableBaseHi; /* x4E */
  131. u16 tcpHashTableBaseLo; /* x50 */
  132. u16 tcpHashTableSize; /* x52 */
  133. u16 ncbTableBaseHi; /* x54 */
  134. u16 ncbTableBaseLo; /* x56 */
  135. u16 ncbTableSize; /* x58 */
  136. u16 drbTableBaseHi; /* x5A */
  137. u16 drbTableBaseLo; /* x5C */
  138. u16 drbTableSize; /* x5E */
  139. #define EEPROM_UNUSED_2_SIZE 4
  140. u8 unused_2[EEPROM_UNUSED_2_SIZE]; /* x60 */
  141. u16 ipReassemblyTimeout; /* x64 */
  142. u16 tcpMaxWindowSizeHi; /* x66 */
  143. u16 tcpMaxWindowSizeLo; /* x68 */
  144. u32 net_ip_addr0; /* x6A Added for TOE
  145. * functionality. */
  146. u32 net_ip_addr1; /* x6E */
  147. u32 scsi_ip_addr0; /* x72 */
  148. u32 scsi_ip_addr1; /* x76 */
  149. #define EEPROM_UNUSED_3_SIZE 128 /* changed from 144 to account
  150. * for ip addresses */
  151. u8 unused_3[EEPROM_UNUSED_3_SIZE]; /* x7A */
  152. u16 subsysVendorId_f0; /* xFA */
  153. u16 subsysDeviceId_f0; /* xFC */
  154. /* Address = 0x7F */
  155. #define FM93C56A_SIGNATURE 0x9356
  156. #define FM93C66A_SIGNATURE 0x9366
  157. u16 signature; /* xFE */
  158. #define EEPROM_UNUSED_4_SIZE 250
  159. u8 unused_4[EEPROM_UNUSED_4_SIZE]; /* x100 */
  160. u16 subsysVendorId_f1; /* x1FA */
  161. u16 subsysDeviceId_f1; /* x1FC */
  162. u16 checksum; /* x1FE */
  163. } __attribute__ ((packed)) isp4010;
  164. struct { /* isp4022 */
  165. u8 asicId[4]; /* x00 */
  166. u8 version; /* x04 */
  167. u8 reserved_5; /* x05 */
  168. u16 boardId; /* x06 */
  169. u8 boardIdStr[16]; /* x08 */
  170. u8 serialNumber[16]; /* x18 */
  171. /* External Hardware Configuration */
  172. u16 ext_hw_conf; /* x28 */
  173. /* MAC 0 CONFIGURATION */
  174. struct eeprom_port_cfg macCfg_port0; /* x2A */
  175. /* MAC 1 CONFIGURATION */
  176. struct eeprom_port_cfg macCfg_port1; /* x4A */
  177. /* DDR SDRAM Configuration */
  178. u16 bufletSize; /* x6A */
  179. u16 bufletCount; /* x6C */
  180. u16 tcpWindowThreshold50; /* x6E */
  181. u16 tcpWindowThreshold25; /* x70 */
  182. u16 tcpWindowThreshold0; /* x72 */
  183. u16 ipHashTableBaseHi; /* x74 */
  184. u16 ipHashTableBaseLo; /* x76 */
  185. u16 ipHashTableSize; /* x78 */
  186. u16 tcpHashTableBaseHi; /* x7A */
  187. u16 tcpHashTableBaseLo; /* x7C */
  188. u16 tcpHashTableSize; /* x7E */
  189. u16 ncbTableBaseHi; /* x80 */
  190. u16 ncbTableBaseLo; /* x82 */
  191. u16 ncbTableSize; /* x84 */
  192. u16 drbTableBaseHi; /* x86 */
  193. u16 drbTableBaseLo; /* x88 */
  194. u16 drbTableSize; /* x8A */
  195. u16 reserved_142[4]; /* x8C */
  196. /* TCP/IP Parameters */
  197. u16 ipReassemblyTimeout; /* x94 */
  198. u16 tcpMaxWindowSize; /* x96 */
  199. u16 ipSecurity; /* x98 */
  200. u8 reserved_156[294]; /* x9A */
  201. u16 qDebug[8]; /* QLOGIC USE ONLY x1C0 */
  202. struct eeprom_function_cfg funcCfg_fn0; /* x1D0 */
  203. u16 reserved_510; /* x1FE */
  204. /* Address = 512 */
  205. u8 oemSpace[432]; /* x200 */
  206. struct bios_params sBIOSParams_fn1; /* x3B0 */
  207. struct eeprom_function_cfg funcCfg_fn1; /* x3D0 */
  208. u16 reserved_1022; /* x3FE */
  209. /* Address = 1024 */
  210. u8 reserved_1024[464]; /* x400 */
  211. struct eeprom_function_cfg funcCfg_fn2; /* x5D0 */
  212. u16 reserved_1534; /* x5FE */
  213. /* Address = 1536 */
  214. u8 reserved_1536[432]; /* x600 */
  215. struct bios_params sBIOSParams_fn3; /* x7B0 */
  216. struct eeprom_function_cfg funcCfg_fn3; /* x7D0 */
  217. u16 checksum; /* x7FE */
  218. } __attribute__ ((packed)) isp4022;
  219. };
  220. };
  221. #endif /* _QL4XNVRM_H_ */