/drivers/net/ethernet/intel/ixgb/ixgb_ee.h

http://github.com/mirrors/linux · C Header · 79 lines · 54 code · 15 blank · 10 comment · 0 complexity · 4e57a93d717216306d75a5d272875d4d MD5 · raw file

  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /* Copyright(c) 1999 - 2008 Intel Corporation. */
  3. #ifndef _IXGB_EE_H_
  4. #define _IXGB_EE_H_
  5. #define IXGB_EEPROM_SIZE 64 /* Size in words */
  6. /* EEPROM Commands */
  7. #define EEPROM_READ_OPCODE 0x6 /* EEPROM read opcode */
  8. #define EEPROM_WRITE_OPCODE 0x5 /* EEPROM write opcode */
  9. #define EEPROM_ERASE_OPCODE 0x7 /* EEPROM erase opcode */
  10. #define EEPROM_EWEN_OPCODE 0x13 /* EEPROM erase/write enable */
  11. #define EEPROM_EWDS_OPCODE 0x10 /* EEPROM erase/write disable */
  12. /* EEPROM MAP (Word Offsets) */
  13. #define EEPROM_IA_1_2_REG 0x0000
  14. #define EEPROM_IA_3_4_REG 0x0001
  15. #define EEPROM_IA_5_6_REG 0x0002
  16. #define EEPROM_COMPATIBILITY_REG 0x0003
  17. #define EEPROM_PBA_1_2_REG 0x0008
  18. #define EEPROM_PBA_3_4_REG 0x0009
  19. #define EEPROM_INIT_CONTROL1_REG 0x000A
  20. #define EEPROM_SUBSYS_ID_REG 0x000B
  21. #define EEPROM_SUBVEND_ID_REG 0x000C
  22. #define EEPROM_DEVICE_ID_REG 0x000D
  23. #define EEPROM_VENDOR_ID_REG 0x000E
  24. #define EEPROM_INIT_CONTROL2_REG 0x000F
  25. #define EEPROM_SWDPINS_REG 0x0020
  26. #define EEPROM_CIRCUIT_CTRL_REG 0x0021
  27. #define EEPROM_D0_D3_POWER_REG 0x0022
  28. #define EEPROM_FLASH_VERSION 0x0032
  29. #define EEPROM_CHECKSUM_REG 0x003F
  30. /* Mask bits for fields in Word 0x0a of the EEPROM */
  31. #define EEPROM_ICW1_SIGNATURE_MASK 0xC000
  32. #define EEPROM_ICW1_SIGNATURE_VALID 0x4000
  33. #define EEPROM_ICW1_SIGNATURE_CLEAR 0x0000
  34. /* For checksumming, the sum of all words in the EEPROM should equal 0xBABA. */
  35. #define EEPROM_SUM 0xBABA
  36. /* EEPROM Map Sizes (Byte Counts) */
  37. #define PBA_SIZE 4
  38. /* EEPROM Map defines (WORD OFFSETS)*/
  39. /* EEPROM structure */
  40. struct ixgb_ee_map_type {
  41. u8 mac_addr[ETH_ALEN];
  42. __le16 compatibility;
  43. __le16 reserved1[4];
  44. __le32 pba_number;
  45. __le16 init_ctrl_reg_1;
  46. __le16 subsystem_id;
  47. __le16 subvendor_id;
  48. __le16 device_id;
  49. __le16 vendor_id;
  50. __le16 init_ctrl_reg_2;
  51. __le16 oem_reserved[16];
  52. __le16 swdpins_reg;
  53. __le16 circuit_ctrl_reg;
  54. u8 d3_power;
  55. u8 d0_power;
  56. __le16 reserved2[28];
  57. __le16 checksum;
  58. };
  59. /* EEPROM Functions */
  60. u16 ixgb_read_eeprom(struct ixgb_hw *hw, u16 reg);
  61. bool ixgb_validate_eeprom_checksum(struct ixgb_hw *hw);
  62. void ixgb_update_eeprom_checksum(struct ixgb_hw *hw);
  63. void ixgb_write_eeprom(struct ixgb_hw *hw, u16 reg, u16 data);
  64. #endif /* IXGB_EE_H */