ql4_nvram.h 6.8 KB

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