ixgb_ee.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. /*******************************************************************************
  2. Copyright(c) 1999 - 2005 Intel Corporation. All rights reserved.
  3. This program is free software; you can redistribute it and/or modify it
  4. under the terms of the GNU General Public License as published by the Free
  5. Software Foundation; either version 2 of the License, or (at your option)
  6. any later version.
  7. This program is distributed in the hope that it will be useful, but WITHOUT
  8. ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  9. FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  10. more details.
  11. You should have received a copy of the GNU General Public License along with
  12. this program; if not, write to the Free Software Foundation, Inc., 59
  13. Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  14. The full GNU General Public License is included in this distribution in the
  15. file called LICENSE.
  16. Contact Information:
  17. Linux NICS <linux.nics@intel.com>
  18. Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
  19. *******************************************************************************/
  20. #ifndef _IXGB_EE_H_
  21. #define _IXGB_EE_H_
  22. #define IXGB_EEPROM_SIZE 64 /* Size in words */
  23. #define IXGB_ETH_LENGTH_OF_ADDRESS 6
  24. /* EEPROM Commands */
  25. #define EEPROM_READ_OPCODE 0x6 /* EERPOM read opcode */
  26. #define EEPROM_WRITE_OPCODE 0x5 /* EERPOM write opcode */
  27. #define EEPROM_ERASE_OPCODE 0x7 /* EERPOM erase opcode */
  28. #define EEPROM_EWEN_OPCODE 0x13 /* EERPOM erase/write enable */
  29. #define EEPROM_EWDS_OPCODE 0x10 /* EERPOM erast/write disable */
  30. /* EEPROM MAP (Word Offsets) */
  31. #define EEPROM_IA_1_2_REG 0x0000
  32. #define EEPROM_IA_3_4_REG 0x0001
  33. #define EEPROM_IA_5_6_REG 0x0002
  34. #define EEPROM_COMPATIBILITY_REG 0x0003
  35. #define EEPROM_PBA_1_2_REG 0x0008
  36. #define EEPROM_PBA_3_4_REG 0x0009
  37. #define EEPROM_INIT_CONTROL1_REG 0x000A
  38. #define EEPROM_SUBSYS_ID_REG 0x000B
  39. #define EEPROM_SUBVEND_ID_REG 0x000C
  40. #define EEPROM_DEVICE_ID_REG 0x000D
  41. #define EEPROM_VENDOR_ID_REG 0x000E
  42. #define EEPROM_INIT_CONTROL2_REG 0x000F
  43. #define EEPROM_SWDPINS_REG 0x0020
  44. #define EEPROM_CIRCUIT_CTRL_REG 0x0021
  45. #define EEPROM_D0_D3_POWER_REG 0x0022
  46. #define EEPROM_FLASH_VERSION 0x0032
  47. #define EEPROM_CHECKSUM_REG 0x003F
  48. /* Mask bits for fields in Word 0x0a of the EEPROM */
  49. #define EEPROM_ICW1_SIGNATURE_MASK 0xC000
  50. #define EEPROM_ICW1_SIGNATURE_VALID 0x4000
  51. #define EEPROM_ICW1_SIGNATURE_CLEAR 0x0000
  52. /* For checksumming, the sum of all words in the EEPROM should equal 0xBABA. */
  53. #define EEPROM_SUM 0xBABA
  54. /* EEPROM Map Sizes (Byte Counts) */
  55. #define PBA_SIZE 4
  56. /* EEPROM Map defines (WORD OFFSETS)*/
  57. /* EEPROM structure */
  58. struct ixgb_ee_map_type {
  59. uint8_t mac_addr[IXGB_ETH_LENGTH_OF_ADDRESS];
  60. uint16_t compatibility;
  61. uint16_t reserved1[4];
  62. uint32_t pba_number;
  63. uint16_t init_ctrl_reg_1;
  64. uint16_t subsystem_id;
  65. uint16_t subvendor_id;
  66. uint16_t device_id;
  67. uint16_t vendor_id;
  68. uint16_t init_ctrl_reg_2;
  69. uint16_t oem_reserved[16];
  70. uint16_t swdpins_reg;
  71. uint16_t circuit_ctrl_reg;
  72. uint8_t d3_power;
  73. uint8_t d0_power;
  74. uint16_t reserved2[28];
  75. uint16_t checksum;
  76. };
  77. /* EEPROM Functions */
  78. uint16_t ixgb_read_eeprom(struct ixgb_hw *hw, uint16_t reg);
  79. boolean_t ixgb_validate_eeprom_checksum(struct ixgb_hw *hw);
  80. void ixgb_update_eeprom_checksum(struct ixgb_hw *hw);
  81. void ixgb_write_eeprom(struct ixgb_hw *hw, uint16_t reg, uint16_t data);
  82. #endif /* IXGB_EE_H */